update game_menu

This commit was merged in pull request #40.
This commit is contained in:
2026-06-30 20:01:13 +00:00
parent 7db1df9ab6
commit 7be800398d
81 changed files with 8493 additions and 139 deletions

View File

@@ -1,8 +1,6 @@
extends Control
@onready var tabs: Array[GameMenuTab] = [$%Tab1, $%Tab2, $%Tab3]
@onready var pages: Array[GameMenuPage] = [$%Page1, $%Page2, $%Page3]
var current_index = 0
func _ready() -> void:
for tab: GameMenuTab in tabs:
@@ -10,10 +8,12 @@ func _ready() -> void:
on_tab_pressed(0, true)
func on_tab_pressed(index: int, disable_animation: bool = false) -> void:
for page in pages:
page.hide_page()
if BookAPI.is_busy() and not disable_animation:
return
for tab in tabs:
if tab.index == index:
if disable_animation:
@@ -25,9 +25,5 @@ func on_tab_pressed(index: int, disable_animation: bool = false) -> void:
tab.deselect_without_animation()
else:
tab.deselect()
pages[index].show_page()
current_index = index
func open() -> void:
pages[current_index].show_page()
BookAPI.go_to_page((index + 1) * 2)