main menu
This commit is contained in:
parent
29254dbda0
commit
089ebc4797
35 changed files with 389 additions and 117 deletions
|
|
@ -1,10 +1,9 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class ExitButton : Button
|
||||
{
|
||||
public override void _Pressed()
|
||||
{
|
||||
GetTree().Quit();
|
||||
GetTree().ChangeSceneToFile("uid://bfstrli64u23y");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public partial class PauseMenu : Control
|
|||
}
|
||||
public void Exit()
|
||||
{
|
||||
GetTree().Quit();
|
||||
GetTree().ChangeSceneToFile("uid://bfstrli64u23y");
|
||||
}
|
||||
public static void Pause()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using Newlon.Components.Plants;
|
|||
public partial class Previewport : SubViewport
|
||||
{
|
||||
private RuntimePlantData current_display;
|
||||
private Texture2D start_Field;
|
||||
|
||||
[Export] private Label title;
|
||||
[Export] private RichTextLabel description;
|
||||
|
|
@ -13,6 +14,7 @@ public partial class Previewport : SubViewport
|
|||
public override void _Ready()
|
||||
{
|
||||
GetParent().GetViewport().GuiFocusChanged += OnFocusChanged;
|
||||
start_Field = GetNode<Sprite2D>("FrameField").Texture;
|
||||
}
|
||||
|
||||
public void OnFocusChanged(Control node)
|
||||
|
|
@ -30,6 +32,12 @@ public partial class Previewport : SubViewport
|
|||
{
|
||||
current_display.QueueFree();
|
||||
}
|
||||
if (resource.customFrame != null && resource.customFrame.almanachField != null)
|
||||
{
|
||||
GetNode<Sprite2D>("FrameField").Texture = resource.customFrame.almanachField;
|
||||
}
|
||||
else
|
||||
GetNode<Sprite2D>("FrameField").Texture = start_Field;
|
||||
current_display = resource.Scene.Instantiate<RuntimePlantData>();
|
||||
title.Text = resource.display_name;
|
||||
description.Text = resource.display_description;
|
||||
|
|
|
|||
5
scripts/components/gui/main_menu_rich_text.gd
Normal file
5
scripts/components/gui/main_menu_rich_text.gd
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
extends RichTextLabel
|
||||
|
||||
|
||||
func _on_meta_clicked(meta: Variant) -> void:
|
||||
OS.shell_open(meta)
|
||||
1
scripts/components/gui/main_menu_rich_text.gd.uid
Normal file
1
scripts/components/gui/main_menu_rich_text.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://drru785m4eep
|
||||
16
scripts/components/gui/menu_buttons.gd
Normal file
16
scripts/components/gui/menu_buttons.gd
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
extends Node
|
||||
|
||||
|
||||
func _on_play_button_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://scenes/prototype_survival.tscn")
|
||||
$ChannelPlayer.call("Play")
|
||||
|
||||
|
||||
func _on_exit_button_pressed() -> void:
|
||||
get_tree().quit()
|
||||
$ChannelPlayer.call("Play")
|
||||
|
||||
|
||||
func _on_button_pressed() -> void:
|
||||
$"../AboutWindow".popup_centered()
|
||||
$ChannelPlayer.call("Play")
|
||||
1
scripts/components/gui/menu_buttons.gd.uid
Normal file
1
scripts/components/gui/menu_buttons.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c06k4k3ww48ev
|
||||
9
scripts/components/gui/prototype_window.gd
Normal file
9
scripts/components/gui/prototype_window.gd
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
extends AcceptDialog
|
||||
|
||||
static var seen = false
|
||||
|
||||
func _ready() -> void:
|
||||
if seen:
|
||||
return
|
||||
seen = true
|
||||
popup_centered()
|
||||
1
scripts/components/gui/prototype_window.gd.uid
Normal file
1
scripts/components/gui/prototype_window.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dgevhrbucpwrs
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
using Godot;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class CustomSeedpacketFrame : Resource
|
||||
{
|
||||
[Export] public Texture2D frame;
|
||||
[Export] public LabelSettings font;
|
||||
[Export] public Texture2D almanachField;
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://3m7xks3xq3hl
|
||||
|
|
@ -73,6 +73,11 @@ public partial class Seedpacket : TextureButton
|
|||
_cost.Text = _resource.Cost.ToString();
|
||||
_icon.Texture = _resource.Preview;
|
||||
_timer.WaitTime = _resource.ReloadTime;
|
||||
if (_resource.customFrame != null)
|
||||
{
|
||||
TextureNormal = _resource.customFrame.frame;
|
||||
_cost.LabelSettings = _resource.customFrame.font;
|
||||
}
|
||||
}
|
||||
|
||||
public override void _Pressed()
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ public partial class PlantResource : Resource
|
|||
[Export]
|
||||
public Texture2D Preview;
|
||||
[Export] public int Layer = 1;
|
||||
[Export] public CustomSeedpacketFrame customFrame;
|
||||
|
||||
public string internal_id;
|
||||
}
|
||||
|
|
|
|||
14
scripts/sacrifice.gd
Normal file
14
scripts/sacrifice.gd
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
extends TextureButton
|
||||
|
||||
@onready var confirm = $CONFIRM
|
||||
|
||||
func _pressed() -> void:
|
||||
confirm.popup_centered()
|
||||
|
||||
|
||||
func _on_confirm_close_requested() -> void:
|
||||
get_tree().change_scene_to_file("res://scenes/sacrifice.tscn")
|
||||
|
||||
|
||||
func _on_confirm_confirmed() -> void:
|
||||
get_tree().change_scene_to_file("res://scenes/sacrifice.tscn")
|
||||
1
scripts/sacrifice.gd.uid
Normal file
1
scripts/sacrifice.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://6e8n6kc0y11o
|
||||
Loading…
Add table
Add a link
Reference in a new issue