refactoring UI
This commit was merged in pull request #26.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
extends Control
|
||||
|
||||
@onready var tabs: Array[GameMenuTab] = [$%Tab1, $%Tab2, $%Tab3]
|
||||
@onready var pages: Array[Control] = [$%Page1, $%Page2, $%Page3]
|
||||
@onready var pages: Array[GameMenuPage] = [$%Page1, $%Page2, $%Page3]
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
for tab: GameMenuTab in tabs:
|
||||
@@ -11,7 +12,7 @@ func _ready() -> void:
|
||||
|
||||
func on_tab_pressed(index: int, disable_animation: bool = false) -> void:
|
||||
for page in pages:
|
||||
page.hide()
|
||||
page.hide_page()
|
||||
|
||||
for tab in tabs:
|
||||
if tab.index == index:
|
||||
@@ -25,7 +26,4 @@ func on_tab_pressed(index: int, disable_animation: bool = false) -> void:
|
||||
else:
|
||||
tab.deselect()
|
||||
|
||||
pages[index].show()
|
||||
|
||||
func _on_resume_button_on_button_pressed() -> void:
|
||||
hide()
|
||||
pages[index].show_page()
|
||||
|
||||
Reference in New Issue
Block a user