ai and game menu
This commit was merged in pull request #23.
This commit is contained in:
@@ -5,19 +5,27 @@ extends Control
|
||||
|
||||
func _ready() -> void:
|
||||
for tab: GameMenuTab in tabs:
|
||||
tab.on_tab_selected.connect(_on_tab_pressed)
|
||||
tab.on_tab_selected.connect(on_tab_pressed)
|
||||
|
||||
tabs[0].select_without_animation()
|
||||
pages[0].show()
|
||||
on_tab_pressed(0, true)
|
||||
|
||||
func _on_tab_pressed(index: int):
|
||||
func on_tab_pressed(index: int, disable_animation: bool = false) -> void:
|
||||
for page in pages:
|
||||
page.hide()
|
||||
|
||||
for tab in tabs:
|
||||
if tab.index == index:
|
||||
tab.select()
|
||||
if disable_animation:
|
||||
tab.select_without_animation()
|
||||
else:
|
||||
tab.select()
|
||||
else:
|
||||
tab.deselect()
|
||||
if disable_animation:
|
||||
tab.deselect_without_animation()
|
||||
else:
|
||||
tab.deselect()
|
||||
|
||||
pages[index].show()
|
||||
|
||||
func _on_resume_button_on_button_pressed() -> void:
|
||||
hide()
|
||||
|
||||
Reference in New Issue
Block a user