From be8d1addeeffd41401027146e4b6e60eca0c3614 Mon Sep 17 00:00:00 2001 From: Luke Gebbink <48702026+PersonGuyGit@users.noreply.github.com> Date: Sun, 16 Jan 2022 13:00:25 -0700 Subject: [PATCH] Pushed Changes --- Godot/MainMenu/GodotUserInterface_Luke/Die.gd | 19 ---------- Godot/MainMenu/GodotUserInterface_Luke/GUI.gd | 37 +++++++++++++++++++ .../MainMenu/GodotUserInterface_Luke/GUI.tscn | 23 +++++++++--- 3 files changed, 54 insertions(+), 25 deletions(-) diff --git a/Godot/MainMenu/GodotUserInterface_Luke/Die.gd b/Godot/MainMenu/GodotUserInterface_Luke/Die.gd index 34eaa09..4283d75 100644 --- a/Godot/MainMenu/GodotUserInterface_Luke/Die.gd +++ b/Godot/MainMenu/GodotUserInterface_Luke/Die.gd @@ -1,9 +1,6 @@ extends Node class_name Die -# Declare member variables here. Examples: -# var a = 2 -# var b = "text" enum DieCategory{ D4 = 4, @@ -18,7 +15,6 @@ enum DieCategory{ var DieType = DieCategory var NumberOfFaces = 0 - func RollDie(InputDie): #InputDie is supposed to be DieType for example. var DieFaceResult = 0; @@ -45,15 +41,8 @@ func RollDie(InputDie): print("Die Success Rate") print(DieSuccessPercentage) - func SetNumberOfSides(): var DSides = DieType -# For 7 Die Set, testing purposes - - -######################################## -# Need to Seed Random Number Generator # -######################################## match DSides: 4: @@ -72,16 +61,8 @@ func SetNumberOfSides(): NumberOfFaces = 20 print(NumberOfFaces) - - # Called when the node enters the scene tree for the first time. func _ready(): DieType = DieCategory.D00 SetNumberOfSides() RollDie(NumberOfFaces) - # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass diff --git a/Godot/MainMenu/GodotUserInterface_Luke/GUI.gd b/Godot/MainMenu/GodotUserInterface_Luke/GUI.gd index ecce02f..4ec77dc 100644 --- a/Godot/MainMenu/GodotUserInterface_Luke/GUI.gd +++ b/Godot/MainMenu/GodotUserInterface_Luke/GUI.gd @@ -1,5 +1,42 @@ extends MarginContainer +onready var selection_Start = $HBoxContainer/VBoxContainer/MenuOptions/StartGame +onready var selection_DieTest = $HBoxContainer/VBoxContainer/MenuOptions/DieTest +onready var selection_LoadGame = $HBoxContainer/CenterContainer/MenuOptions/LoadGame +onready var selection_HostAndJoinGame = $HBoxContainer/VBoxContainer/MenuOptions/HostAndJoinGame +onready var selection_PlayerSettings =$HBoxContainer/VBoxContainer/MenuOptions/PlayerSettings + +var currentSelectionIndex = 0; + func _ready(): var TimeTest = OS.get_datetime() print(TimeTest) + +func _process(delta): + if Input.is_action_just_pressed("ui_down"): + currentSelectionIndex +=1; + if(currentSelectionIndex == 5): + currentSelectionIndex = 0 + SetMenuSelections(currentSelectionIndex) + +func SetMenuSelections(CurrentSelection): + selection_Start.set_uppercase(false) + selection_DieTest.set_uppercase(false) + selection_LoadGame.set_uppercase(false) + selection_HostAndJoinGame.set_uppercase(false) + selection_PlayerSettings.set_uppercase(false) + + var index = CurrentSelection + + match index: + 0: + selection_Start.set_uppercase(true) + 1: + selection_DieTest.set_uppercase(true) + 2: + selection_LoadGame.set_uppercase(true) + 3: + selection_HostAndJoinGame.set_uppercase(true) + 4: + selection_PlayerSettings.set_uppercase(true) + diff --git a/Godot/MainMenu/GodotUserInterface_Luke/GUI.tscn b/Godot/MainMenu/GodotUserInterface_Luke/GUI.tscn index f9a929f..1136160 100644 --- a/Godot/MainMenu/GodotUserInterface_Luke/GUI.tscn +++ b/Godot/MainMenu/GodotUserInterface_Luke/GUI.tscn @@ -20,6 +20,11 @@ __meta__ = { "_edit_use_anchors_": false } +[node name="ColorRect" type="ColorRect" parent="."] +margin_right = 1024.0 +margin_bottom = 600.0 +color = Color( 0.858824, 0.333333, 0.129412, 1 ) + [node name="HBoxContainer" type="HBoxContainer" parent="."] margin_left = 120.0 margin_top = 80.0 @@ -37,10 +42,11 @@ size_flags_vertical = 3 custom_constants/separation = 30 alignment = 1 -[node name="Start Game" type="Label" parent="HBoxContainer/VBoxContainer/MenuOptions"] +[node name="StartGame" type="Label" parent="HBoxContainer/VBoxContainer/MenuOptions"] margin_top = 125.0 margin_right = 112.0 margin_bottom = 139.0 +rect_scale = Vector2( 2, 2 ) mouse_filter = 1 text = "Start Game" script = ExtResource( 3 ) @@ -49,14 +55,16 @@ script = ExtResource( 3 ) margin_top = 169.0 margin_right = 112.0 margin_bottom = 183.0 +rect_scale = Vector2( 2, 2 ) mouse_filter = 1 text = "Die Test" script = ExtResource( 5 ) -[node name="Load Game" type="Label" parent="HBoxContainer/VBoxContainer/MenuOptions"] +[node name="LoadGame" type="Label" parent="HBoxContainer/VBoxContainer/MenuOptions"] margin_top = 213.0 margin_right = 112.0 margin_bottom = 227.0 +rect_scale = Vector2( 2, 2 ) mouse_filter = 1 text = "Load Game" script = ExtResource( 3 ) @@ -65,14 +73,16 @@ script = ExtResource( 3 ) margin_top = 257.0 margin_right = 112.0 margin_bottom = 271.0 +rect_scale = Vector2( 2, 2 ) mouse_filter = 1 text = "Host / Join Game" script = ExtResource( 2 ) -[node name="Player Settings" type="Label" parent="HBoxContainer/VBoxContainer/MenuOptions"] +[node name="PlayerSettings" type="Label" parent="HBoxContainer/VBoxContainer/MenuOptions"] margin_top = 301.0 margin_right = 112.0 margin_bottom = 315.0 +rect_scale = Vector2( 2, 2 ) mouse_filter = 1 text = "Player Settings" script = ExtResource( 1 ) @@ -89,10 +99,11 @@ margin_left = 300.0 margin_top = 213.0 margin_right = 367.0 margin_bottom = 227.0 +rect_scale = Vector2( 4, 4 ) text = "Test Menu" -[connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/Start Game" to="HBoxContainer/VBoxContainer/MenuOptions/Start Game" 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"] [connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/DieTest" to="HBoxContainer/VBoxContainer/MenuOptions/DieTest" method="_on_Start_Game_gui_input"] -[connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/Load Game" to="HBoxContainer/VBoxContainer/MenuOptions/Load Game" method="_on_Start_Game_gui_input"] +[connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/LoadGame" to="HBoxContainer/VBoxContainer/MenuOptions/LoadGame" method="_on_Start_Game_gui_input"] [connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/HostAndJoinGame" to="HBoxContainer/VBoxContainer/MenuOptions/HostAndJoinGame" method="_on_HostAndJoinGame_gui_input"] -[connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/Player Settings" to="HBoxContainer/VBoxContainer/MenuOptions/Player Settings" method="_on_Player_Settings_gui_input"] +[connection signal="gui_input" from="HBoxContainer/VBoxContainer/MenuOptions/PlayerSettings" to="HBoxContainer/VBoxContainer/MenuOptions/PlayerSettings" method="_on_Player_Settings_gui_input"]