improve ui, bug fix and update assets

This commit is contained in:
2026-06-04 23:33:52 +02:00
parent 34ffced619
commit 5ffd92c26b
72 changed files with 1276 additions and 144 deletions

View File

@@ -23,17 +23,20 @@ func _ready():
func _on_pressed() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.PUNCH_IN):
return
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0
TweenFX.punch_in(self)
func _on_mouse_entered() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.BREATHE):
return
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0
TweenFX.breathe(self, 1)
func _on_mouse_exited() -> void:
TweenFX.stop(self, TweenFX.Animations.BREATHE)
scale = Vector2(1, 1)
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0

View File

@@ -19,6 +19,7 @@ func _ready():
TweenFX.breathe(self, 1)
func _on_pressed() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.PRESS_ROTATE):
return
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0
TweenFX.press_rotate(self)

View File

@@ -29,6 +29,9 @@ func select() -> void:
return
selected = true
$%Border.color.a = 1
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0
TweenFX.press_rotate(self)
@@ -40,12 +43,13 @@ func deselect() -> void:
func _on_mouse_entered() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.BREATHE):
return
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0
TweenFX.breathe(self, 1)
func _on_mouse_exited() -> void:
TweenFX.stop(self, TweenFX.Animations.BREATHE)
scale = Vector2(1, 1)
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0

View File

@@ -2,7 +2,7 @@ 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:
@@ -27,3 +27,7 @@ func on_tab_pressed(index: int, disable_animation: bool = false) -> void:
tab.deselect()
pages[index].show_page()
current_index = index
func open() -> void:
pages[current_index].show_page()

View File

@@ -16,8 +16,14 @@ func _on_photo_highlighted(texture: Texture) -> void:
photo.setup(texture)
var is_closing: bool = false
func _on_panel_gui_input(event: InputEvent) -> void:
if is_closing:
return
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
is_closing = true
await TweenFX.fold_out(photo).finished
photo.texture_rect.texture = null
hide()
is_closing = false

View File

@@ -13,17 +13,20 @@ func _ready():
func _on_pressed() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.PUNCH_IN):
return
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0
TweenFX.punch_in(self)
func _on_mouse_entered() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.BREATHE):
return
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0
TweenFX.breathe(self, 1)
func _on_mouse_exited() -> void:
TweenFX.stop(self, TweenFX.Animations.BREATHE)
scale = Vector2(1, 1)
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0

View File

@@ -2,6 +2,8 @@ extends Control
class_name GameMenuPage
func _ready() -> void:
GameState.on_game_resumed.connect(_on_game_resumed)
func show_page() -> void:
var tweens = find_children("*", "ContainerTween", true, false)
@@ -11,4 +13,12 @@ func show_page() -> void:
func hide_page() -> void:
var tweens = find_children("*", "ContainerTween", true, false)
for tween in tweens:
tween.stop_tween()
hide()
func _on_game_resumed() -> void:
var tweens = find_children("*", "ContainerTween", true, false)
for tween in tweens:
tween.stop_tween()

View File

@@ -12,19 +12,22 @@ func setup(texture: Texture) -> void:
func _on_pressed() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.PUNCH_IN):
return
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0
TweenFX.punch_in(self)
GameState.on_photo_highlighted.emit(texture_rect.texture)
func _on_mouse_entered() -> void:
if TweenFX.is_playing(self, TweenFX.Animations.BREATHE):
return
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0
TweenFX.breathe(self, 1)
func _on_mouse_exited() -> void:
TweenFX.stop(self, TweenFX.Animations.BREATHE)
scale = Vector2(1, 1)
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0