diff options
author | David Luevano Alvarado <david@luevano.xyz> | 2022-06-05 14:09:41 -0600 |
---|---|---|
committer | David Luevano Alvarado <david@luevano.xyz> | 2022-06-05 14:09:41 -0600 |
commit | 14538d486de312af41ce012836861468b8fb7897 (patch) | |
tree | 569d09c43fd7724a5fbb0898f5c1d1db3fd64b3d /src/ui/main_menu | |
parent | 4b42a8ba26f21e2c6c766fa747c8b93a115a53b2 (diff) |
finish all necessary for playability
Diffstat (limited to 'src/ui/main_menu')
-rw-r--r-- | src/ui/main_menu/scenes/MainMenu.tscn | 73 | ||||
-rw-r--r-- | src/ui/main_menu/scripts/main_menu.gd | 7 |
2 files changed, 44 insertions, 36 deletions
diff --git a/src/ui/main_menu/scenes/MainMenu.tscn b/src/ui/main_menu/scenes/MainMenu.tscn index 9bce7f0..ac9c666 100644 --- a/src/ui/main_menu/scenes/MainMenu.tscn +++ b/src/ui/main_menu/scenes/MainMenu.tscn @@ -1,66 +1,81 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://ui/main_menu/scenes/MenuOption.tscn" type="PackedScene" id=1] [ext_resource path="res://fonts/monogram_extended.ttf" type="DynamicFontData" id=2] [ext_resource path="res://ui/main_menu/scripts/main_menu.gd" type="Script" id=3] +[ext_resource path="res://themes/Theme.tres" type="Theme" id=4] [sub_resource type="DynamicFont" id=1] size = 64 font_data = ExtResource( 2 ) [node name="MainMenu" type="MarginContainer"] -anchor_right = 1.0 anchor_bottom = 1.0 +margin_left = 4.0 +margin_top = 4.0 +margin_right = 120.0 +margin_bottom = -4.0 +theme = ExtResource( 4 ) script = ExtResource( 3 ) -START_OPTION_NP = NodePath("Center/VBox/Options/VBox/Start") -SETTINGS_OPTION_NP = NodePath("Center/VBox/Options/VBox/Settings") -EXIT_OPTION_NP = NodePath("Center/VBox/Options/VBox/Exit") +START_OPTION_NP = NodePath("Center/Panel/VBox/Options/VBox/Start") +EXIT_OPTION_NP = NodePath("Center/Panel/VBox/Options/VBox/Exit") [node name="Center" type="CenterContainer" parent="."] -margin_right = 320.0 -margin_bottom = 180.0 +margin_right = 122.0 +margin_bottom = 172.0 + +[node name="Panel" type="PanelContainer" parent="Center"] +margin_top = 32.0 +margin_right = 122.0 +margin_bottom = 139.0 -[node name="VBox" type="VBoxContainer" parent="Center"] -margin_left = 100.0 -margin_top = 28.0 -margin_right = 220.0 -margin_bottom = 152.0 -custom_constants/separation = 16 +[node name="VBox" type="VBoxContainer" parent="Center/Panel"] +margin_left = 1.0 +margin_top = 1.0 +margin_right = 121.0 +margin_bottom = 106.0 -[node name="Title" type="CenterContainer" parent="Center/VBox"] +[node name="Title" type="CenterContainer" parent="Center/Panel/VBox"] margin_right = 120.0 -margin_bottom = 52.0 +margin_bottom = 65.0 -[node name="Label" type="Label" parent="Center/VBox/Title"] +[node name="HBox" type="VBoxContainer" parent="Center/Panel/VBox/Title"] +margin_right = 120.0 +margin_bottom = 65.0 +custom_constants/separation = 0 + +[node name="Label" type="Label" parent="Center/Panel/VBox/Title/HBox"] margin_right = 120.0 margin_bottom = 52.0 custom_colors/font_color_shadow = Color( 0, 0, 0, 1 ) custom_fonts/font = SubResource( 1 ) text = "Snake" -[node name="Options" type="CenterContainer" parent="Center/VBox"] -margin_top = 68.0 +[node name="SubLabel" type="Label" parent="Center/Panel/VBox/Title/HBox"] +margin_top = 52.0 margin_right = 120.0 -margin_bottom = 124.0 +margin_bottom = 65.0 +custom_colors/font_color_shadow = Color( 0, 0, 0, 1 ) +text = "-tronic" +align = 2 -[node name="VBox" type="VBoxContainer" parent="Center/VBox/Options"] +[node name="Options" type="CenterContainer" parent="Center/Panel/VBox"] +margin_top = 69.0 +margin_right = 120.0 +margin_bottom = 105.0 + +[node name="VBox" type="VBoxContainer" parent="Center/Panel/VBox/Options"] margin_left = 20.0 margin_right = 100.0 -margin_bottom = 56.0 +margin_bottom = 36.0 -[node name="Start" parent="Center/VBox/Options/VBox" instance=ExtResource( 1 )] +[node name="Start" parent="Center/Panel/VBox/Options/VBox" instance=ExtResource( 1 )] margin_right = 80.0 label_text = "Start" selected = true -[node name="Settings" parent="Center/VBox/Options/VBox" instance=ExtResource( 1 )] +[node name="Exit" parent="Center/Panel/VBox/Options/VBox" instance=ExtResource( 1 )] margin_top = 20.0 margin_right = 80.0 margin_bottom = 36.0 -label_text = "Settings" - -[node name="Exit" parent="Center/VBox/Options/VBox" instance=ExtResource( 1 )] -margin_top = 40.0 -margin_right = 80.0 -margin_bottom = 56.0 label_text = "Exit" diff --git a/src/ui/main_menu/scripts/main_menu.gd b/src/ui/main_menu/scripts/main_menu.gd index 7077b68..2d955dc 100644 --- a/src/ui/main_menu/scripts/main_menu.gd +++ b/src/ui/main_menu/scripts/main_menu.gd @@ -1,11 +1,9 @@ extends MarginContainer export(NodePath) var START_OPTION_NP: NodePath -export(NodePath) var SETTINGS_OPTION_NP: NodePath export(NodePath) var EXIT_OPTION_NP: NodePath onready var start_option: MenuOption = get_node(START_OPTION_NP) -onready var settings_option: MenuOption = get_node(SETTINGS_OPTION_NP) onready var exit_option: MenuOption = get_node(EXIT_OPTION_NP) onready var main: Node2D = get_parent().get_parent() @@ -13,7 +11,6 @@ onready var main: Node2D = get_parent().get_parent() enum Option { START, - SETTINGS, EXIT } @@ -24,7 +21,6 @@ enum { onready var options: Dictionary = { Option.START: start_option, - Option.SETTINGS: settings_option, Option.EXIT: exit_option } @@ -34,7 +30,6 @@ var current_selection: int = Option.START func _ready(): Event.connect("game_start", self, "_on_game_start") start_option.type = Option.START - settings_option.type = Option.SETTINGS exit_option.type = Option.EXIT @@ -49,8 +44,6 @@ func _input(event: InputEvent) -> void: match current_selection: Option.START: Event.emit_signal("game_start") - Option.SETTINGS: - print("Option TEST.") Option.EXIT: get_tree().quit() |