bcirpggithubmirror/Phase2/Godot _Game_Code/MainMenu/GodotUserInterface_Luke/GUI.gd

58 lines
2.4 KiB
GDScript3
Raw Normal View History

extends MarginContainer
onready var currentSelection_Start = get_node("HBoxContainer/VBoxContainer/MenuOptions/StartGame")
onready var currentSelection_DieTest = get_node("HBoxContainer/VBoxContainer/MenuOptions/DieTest")
onready var currentSelection_LoadGame = get_node("HBoxContainer/VBoxContainer/MenuOptions/LoadGame")
onready var currentSelection_HostAndJoinGame = get_node("HBoxContainer/VBoxContainer/MenuOptions/HostAndJoinGame")
onready var currentSelection_PlayerSettings = get_node("HBoxContainer/VBoxContainer/MenuOptions/PlayerSettings")
2022-01-16 20:00:25 +00:00
var currentSelectionIndex = 0;
var currentIndexObject = currentSelection_Start;
2022-01-16 20:00:25 +00:00
func _ready():
SetMenuSelections(currentSelectionIndex)
2022-01-16 20:00:25 +00:00
func _process(delta):
## Tab is ui_focus_next. Check Input Maps under project settings
## To find the usable map names, for the keys.
if Input.is_action_just_pressed("ui_focus_next"):
2022-01-16 20:00:25 +00:00
currentSelectionIndex +=1;
if(currentSelectionIndex == 5):
currentSelectionIndex = 0
SetMenuSelections(currentSelectionIndex)
2022-01-16 20:00:25 +00:00
func SetMenuSelections(CurrentSelection):
currentSelection_Start.set_uppercase(false)
currentSelection_DieTest.set_uppercase(false)
currentSelection_LoadGame.set_uppercase(false)
currentSelection_HostAndJoinGame.set_uppercase(false)
currentSelection_PlayerSettings.set_uppercase(false)
2022-01-16 20:00:25 +00:00
var index = CurrentSelection
match index:
0:
currentSelection_PlayerSettings.set("custom_colors/default_color", Color(1,1,1,1))
currentSelection_Start.set_uppercase(true)
get_node("HBoxContainer/VBoxContainer/MenuOptions/StartGame").set("custom_colors/default_color", Color(0,0,0,1))
2022-01-16 20:00:25 +00:00
1:
currentSelection_Start.set("custom_colors/default_color", Color(1,1,1,1))
currentSelection_DieTest.set_uppercase(true)
currentSelection_DieTest.set("custom_colors/default_color", Color(0,0,0,1))
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))
2022-01-16 20:00:25 +00:00
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))
2022-01-16 20:00:25 +00:00
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))