Moving files pre-refactor
This commit is contained in:
16
ui/mainmenu/MainMenu.gd
Normal file
16
ui/mainmenu/MainMenu.gd
Normal file
@@ -0,0 +1,16 @@
|
||||
class_name MainMenu extends Control
|
||||
|
||||
@export var btnNewGame:Button
|
||||
@export var btnSettings:Button
|
||||
@export var settingsMenu:ClosableMenu
|
||||
|
||||
func _ready() -> void:
|
||||
btnNewGame.pressed.connect(onNewGamePressed)
|
||||
btnSettings.pressed.connect(onSettingsPressed)
|
||||
|
||||
func onNewGamePressed() -> void:
|
||||
SCENE.setScene(SceneSingleton.SceneType.OVERWORLD)
|
||||
|
||||
func onSettingsPressed() -> void:
|
||||
print("Settings button pressed")
|
||||
settingsMenu.isOpen = true
|
1
ui/mainmenu/MainMenu.gd.uid
Normal file
1
ui/mainmenu/MainMenu.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://btfeuku41py2b
|
79
ui/mainmenu/MainMenu.tscn
Normal file
79
ui/mainmenu/MainMenu.tscn
Normal file
@@ -0,0 +1,79 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://d2u7xxqmy8mws"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://btfeuku41py2b" path="res://ui/mainmenu/MainMenu.gd" id="1_vp3lc"]
|
||||
[ext_resource type="Script" uid="uid://bcjfv6dw0ugvo" path="res://ui/component/ClosableMenu.gd" id="2_f3vro"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3f31lli1ahts" path="res://ui/settings/SettingsMenu.tscn" id="3_44i87"]
|
||||
|
||||
[node name="Main Menu" type="Control" node_paths=PackedStringArray("btnNewGame", "btnSettings", "settingsMenu")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_vp3lc")
|
||||
btnNewGame = NodePath("VBoxContainer/NewGame")
|
||||
btnSettings = NodePath("VBoxContainer/Settings")
|
||||
settingsMenu = NodePath("MainMenuSettings")
|
||||
metadata/_custom_type_script = "uid://btfeuku41py2b"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Main Menu"
|
||||
|
||||
[node name="NewGame" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "New Game"
|
||||
|
||||
[node name="Settings" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Settings"
|
||||
|
||||
[node name="MainMenuSettings" type="Control" parent="."]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("2_f3vro")
|
||||
|
||||
[node name="Panel" type="Panel" parent="MainMenuSettings"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MainMenuSettings/Panel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MainMenuSettings/Panel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="MainMenuSettings/Panel/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Settings"
|
||||
|
||||
[node name="CloseBtn" type="Button" parent="MainMenuSettings/Panel/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Close"
|
||||
|
||||
[node name="SettingsMenu" parent="MainMenuSettings/Panel/VBoxContainer" instance=ExtResource("3_44i87")]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[connection signal="pressed" from="MainMenuSettings/Panel/VBoxContainer/HBoxContainer/CloseBtn" to="MainMenuSettings" method="close"]
|
Reference in New Issue
Block a user