Pushed changes, Tabbing works; needs UI Polish

This commit is contained in:
Luke Gebbink 2022-01-23 12:46:53 -07:00
parent be8d1addee
commit 56d16aabd5
12 changed files with 36 additions and 28 deletions

View File

@ -1,16 +1,17 @@
extends MarginContainer extends MarginContainer
onready var selection_Start = $HBoxContainer/VBoxContainer/MenuOptions/StartGame
onready var selection_DieTest = $HBoxContainer/VBoxContainer/MenuOptions/DieTest onready var currentSelection_Start = get_node("HBoxContainer/VBoxContainer/MenuOptions/StartGame")
onready var selection_LoadGame = $HBoxContainer/CenterContainer/MenuOptions/LoadGame onready var currentSelection_DieTest = get_node("HBoxContainer/VBoxContainer/MenuOptions/DieTest")
onready var selection_HostAndJoinGame = $HBoxContainer/VBoxContainer/MenuOptions/HostAndJoinGame onready var currentSelection_LoadGame = get_node("HBoxContainer/VBoxContainer/MenuOptions/LoadGame")
onready var selection_PlayerSettings =$HBoxContainer/VBoxContainer/MenuOptions/PlayerSettings onready var currentSelection_HostAndJoinGame = get_node("HBoxContainer/VBoxContainer/MenuOptions/HostAndJoinGame")
onready var currentSelection_PlayerSettings = get_node("HBoxContainer/VBoxContainer/MenuOptions/PlayerSettings")
var currentSelectionIndex = 0; var currentSelectionIndex = 0;
var currentIndexObject = currentSelection_Start;
func _ready(): func _ready():
var TimeTest = OS.get_datetime() SetMenuSelections(currentSelectionIndex)
print(TimeTest)
func _process(delta): func _process(delta):
if Input.is_action_just_pressed("ui_down"): if Input.is_action_just_pressed("ui_down"):
@ -18,25 +19,36 @@ func _process(delta):
if(currentSelectionIndex == 5): if(currentSelectionIndex == 5):
currentSelectionIndex = 0 currentSelectionIndex = 0
SetMenuSelections(currentSelectionIndex) SetMenuSelections(currentSelectionIndex)
func SetMenuSelections(CurrentSelection): func SetMenuSelections(CurrentSelection):
selection_Start.set_uppercase(false) currentSelection_Start.set_uppercase(false)
selection_DieTest.set_uppercase(false) currentSelection_DieTest.set_uppercase(false)
selection_LoadGame.set_uppercase(false) currentSelection_LoadGame.set_uppercase(false)
selection_HostAndJoinGame.set_uppercase(false) currentSelection_HostAndJoinGame.set_uppercase(false)
selection_PlayerSettings.set_uppercase(false) currentSelection_PlayerSettings.set_uppercase(false)
var index = CurrentSelection var index = CurrentSelection
match index: match index:
0: 0:
selection_Start.set_uppercase(true) currentSelection_PlayerSettings.set("custom_colors/default_color", Color(1,1,1,1))
currentSelection_Start.set_uppercase(true)
currentSelection_Start.set("custom_colors/default_color", Color(0,0,0,1))
1: 1:
selection_DieTest.set_uppercase(true) currentSelection_Start.set("custom_colors/default_color", Color(1,1,1,1))
2: currentSelection_DieTest.set_uppercase(true)
selection_LoadGame.set_uppercase(true) currentSelection_DieTest.set("custom_colors/default_color", Color(0,0,0,1))
3:
selection_HostAndJoinGame.set_uppercase(true)
4:
selection_PlayerSettings.set_uppercase(true)
2:
currentSelection_DieTest.set("custom_colors/default_color", Color(1,1,1,1))
currentSelection_LoadGame.set_uppercase(true)
currentSelection_LoadGame.set("custom_colors/default_color", Color(0,0,0,1))
3:
currentSelection_LoadGame.set("custom_colors/default_color", Color(1,1,1,1))
currentSelection_HostAndJoinGame.set_uppercase(true)
currentSelection_HostAndJoinGame.set("custom_colors/default_color", Color(0,0,0,1))
4:
currentSelection_HostAndJoinGame.set("custom_colors/default_color", Color(1,1,1,1))
currentSelection_PlayerSettings.set_uppercase(true)
currentSelection_PlayerSettings.set("custom_colors/default_color", Color(0,0,0,1))

View File

@ -21,8 +21,10 @@ __meta__ = {
} }
[node name="ColorRect" type="ColorRect" parent="."] [node name="ColorRect" type="ColorRect" parent="."]
margin_right = 1024.0 margin_left = 120.0
margin_bottom = 600.0 margin_top = 80.0
margin_right = 904.0
margin_bottom = 520.0
color = Color( 0.858824, 0.333333, 0.129412, 1 ) color = Color( 0.858824, 0.333333, 0.129412, 1 )
[node name="HBoxContainer" type="HBoxContainer" parent="."] [node name="HBoxContainer" type="HBoxContainer" parent="."]
@ -46,7 +48,6 @@ alignment = 1
margin_top = 125.0 margin_top = 125.0
margin_right = 112.0 margin_right = 112.0
margin_bottom = 139.0 margin_bottom = 139.0
rect_scale = Vector2( 2, 2 )
mouse_filter = 1 mouse_filter = 1
text = "Start Game" text = "Start Game"
script = ExtResource( 3 ) script = ExtResource( 3 )
@ -55,7 +56,6 @@ script = ExtResource( 3 )
margin_top = 169.0 margin_top = 169.0
margin_right = 112.0 margin_right = 112.0
margin_bottom = 183.0 margin_bottom = 183.0
rect_scale = Vector2( 2, 2 )
mouse_filter = 1 mouse_filter = 1
text = "Die Test" text = "Die Test"
script = ExtResource( 5 ) script = ExtResource( 5 )
@ -64,7 +64,6 @@ script = ExtResource( 5 )
margin_top = 213.0 margin_top = 213.0
margin_right = 112.0 margin_right = 112.0
margin_bottom = 227.0 margin_bottom = 227.0
rect_scale = Vector2( 2, 2 )
mouse_filter = 1 mouse_filter = 1
text = "Load Game" text = "Load Game"
script = ExtResource( 3 ) script = ExtResource( 3 )
@ -73,7 +72,6 @@ script = ExtResource( 3 )
margin_top = 257.0 margin_top = 257.0
margin_right = 112.0 margin_right = 112.0
margin_bottom = 271.0 margin_bottom = 271.0
rect_scale = Vector2( 2, 2 )
mouse_filter = 1 mouse_filter = 1
text = "Host / Join Game" text = "Host / Join Game"
script = ExtResource( 2 ) script = ExtResource( 2 )
@ -82,7 +80,6 @@ script = ExtResource( 2 )
margin_top = 301.0 margin_top = 301.0
margin_right = 112.0 margin_right = 112.0
margin_bottom = 315.0 margin_bottom = 315.0
rect_scale = Vector2( 2, 2 )
mouse_filter = 1 mouse_filter = 1
text = "Player Settings" text = "Player Settings"
script = ExtResource( 1 ) script = ExtResource( 1 )
@ -99,7 +96,6 @@ margin_left = 300.0
margin_top = 213.0 margin_top = 213.0
margin_right = 367.0 margin_right = 367.0
margin_bottom = 227.0 margin_bottom = 227.0
rect_scale = Vector2( 4, 4 )
text = "Test Menu" text = "Test Menu"
[connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/StartGame" to="HBoxContainer/VBoxContainer/MenuOptions/StartGame" method="_on_Start_Game_gui_input"] [connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/StartGame" to="HBoxContainer/VBoxContainer/MenuOptions/StartGame" method="_on_Start_Game_gui_input"]