Add screen management to top menu and update button functionality; replace close button with back button

This commit is contained in:
Kirill
2026-09-21 22:32:56 +03:00
parent 8867da569a
commit a3d24114a1
3 changed files with 29 additions and 40 deletions
+8 -17
View File
@@ -61,6 +61,10 @@ const SWIPE_DURATION: float = 0.4
@onready var g_time_minus: TextureButton = $World/TopMenu/TimeMinus
@onready var g_time_plus: TextureButton = $World/TopMenu/TimePlus
@onready var screens: Dictionary = {
"World": $World,
"MainMenu": $MainMenu
}
var g_tween: Tween = null
var g_dragged_start: Vector2 = Vector2.ZERO
@@ -365,24 +369,11 @@ func _change_speed(delta: int) -> void:
g_time_plus.texture_normal = load(SPEED_TEXTURE_NAME_TEMPLATE % str(speed + 1))
func _on_topmenu_button_pressed(_ButtonName) -> void:
print("Debug → ")
#, owniverse.state)
for id in owniverse.state.batches:
var s = owniverse.state.batches[id].size()
if s != 0:
print(id, " → ", s)
#, owniverse.state.batches[id])
if id == 'HG':
print(owniverse.state.batches[id])
func _on_topmenu_button_pressed(screen_name: String) -> void:
for screen_id in screens:
screens[screen_id].visible = screen_id == screen_name
#var s: float = 1E15
#var z = 1.0
#for i in range(30):
#print(i, " | ", z, " | ", " | ", s - z)
#z *= 10
print("-------")
func _on_unlock_and_save_timeout() -> void:
save_data()