From 1b5b36431315a999fe7f95645e07ab6f8d0bfa3b Mon Sep 17 00:00:00 2001 From: "m.cirafisi" Date: Mon, 29 Jun 2026 23:56:37 +0200 Subject: [PATCH] fix game menu --- addons/PageFlip/page_flip.gd | 2 ++ core/game_menu/game_menu.tscn | 23 +++++++++++++++-------- core/game_menu/highlighted_photo.gd | 13 ++++++++----- core/game_menu/highlighted_photo.tscn | 2 -- core/game_menu/page_2_right.tscn | 5 ----- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/addons/PageFlip/page_flip.gd b/addons/PageFlip/page_flip.gd index 88870d2..c50be7b 100644 --- a/addons/PageFlip/page_flip.gd +++ b/addons/PageFlip/page_flip.gd @@ -793,6 +793,8 @@ func _reset_viewport_input_state() -> void: func _input(event): if Engine.is_editor_hint(): return if not visible or is_animating: return + if get_viewport().is_input_handled(): return + var handled = false if event is InputEventMouse or event is InputEventMouseMotion: diff --git a/core/game_menu/game_menu.tscn b/core/game_menu/game_menu.tscn index 6934f8d..92177a0 100644 --- a/core/game_menu/game_menu.tscn +++ b/core/game_menu/game_menu.tscn @@ -14,6 +14,7 @@ [ext_resource type="Texture2D" uid="uid://cit41jypw2sy1" path="res://addons/PageFlip/Assets/spine.png" id="11_5shjh"] [ext_resource type="Texture2D" uid="uid://dbdwbowx32d3v" path="res://addons/PageFlip/Assets/front.png" id="14_3hj3t"] [ext_resource type="Script" uid="uid://ce5ib2f4qff24" path="res://addons/PageFlip/page_rigger.gd" id="15_5d0t0"] +[ext_resource type="PackedScene" uid="uid://c7t3p8sp54apy" path="res://core/game_menu/highlighted_photo.tscn" id="16_hr6qm"] [ext_resource type="Texture2D" uid="uid://rm7bporlv3cf" path="res://addons/PageFlip/Assets/shadow_gradient.tres" id="16_pjwsa"] [sub_resource type="ViewportTexture" id="ViewportTexture_7r0mx"] @@ -34,7 +35,7 @@ tracks/0/keys = { "values": [SubResource("ViewportTexture_7r0mx")] } -[sub_resource type="Animation" id="Animation_nq5sp"] +[sub_resource type="Animation" id="Animation_hr6qm"] length = 1.3 step = 0.01 tracks/0/type = "value" @@ -727,7 +728,7 @@ tracks/56/keys = { }] } -[sub_resource type="Animation" id="Animation_hr6qm"] +[sub_resource type="Animation" id="Animation_35sf4"] length = 1.3 step = 0.01 tracks/0/type = "value" @@ -1420,7 +1421,7 @@ tracks/56/keys = { }] } -[sub_resource type="Animation" id="Animation_35sf4"] +[sub_resource type="Animation" id="Animation_5shjh"] length = 1.3 step = 0.01 tracks/0/type = "value" @@ -2101,7 +2102,7 @@ tracks/55/keys = { }] } -[sub_resource type="Animation" id="Animation_5shjh"] +[sub_resource type="Animation" id="Animation_8vea8"] length = 1.3 step = 0.01 tracks/0/type = "value" @@ -2785,10 +2786,10 @@ tracks/55/keys = { [sub_resource type="AnimationLibrary" id="AnimationLibrary_hqhik"] _data = { &"RESET": SubResource("Animation_cuh5i"), -&"turn_flexible_page": SubResource("Animation_nq5sp"), -&"turn_flexible_page_mirror": SubResource("Animation_hr6qm"), -&"turn_rigid_page": SubResource("Animation_35sf4"), -&"turn_rigid_page_mirror": SubResource("Animation_5shjh") +&"turn_flexible_page": SubResource("Animation_hr6qm"), +&"turn_flexible_page_mirror": SubResource("Animation_35sf4"), +&"turn_rigid_page": SubResource("Animation_5shjh"), +&"turn_rigid_page_mirror": SubResource("Animation_8vea8") } [node name="GameMenu" type="Control" unique_id=2124096517] @@ -2866,6 +2867,7 @@ visible = false layout_mode = 1 [node name="Rings" type="TextureRect" parent="." unique_id=1905177535] +z_index = 2 layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -3021,3 +3023,8 @@ autoplay = &"turn_page_left" speed_scale = 10.0 [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="PageFlip" unique_id=1072226159] + +[node name="HighlightedPhoto" parent="." unique_id=888465569 instance=ExtResource("16_hr6qm")] +visible = false +z_index = 2 +layout_mode = 1 diff --git a/core/game_menu/highlighted_photo.gd b/core/game_menu/highlighted_photo.gd index f820ba2..c2c85cf 100644 --- a/core/game_menu/highlighted_photo.gd +++ b/core/game_menu/highlighted_photo.gd @@ -3,7 +3,7 @@ extends Control @onready var photo: Photo = $%Photo @onready var panel: Panel = $%Panel - +var is_closing: bool = false func _ready() -> void: GameState.on_photo_highlighted.connect(_on_photo_highlighted) @@ -15,10 +15,13 @@ func _on_photo_highlighted(texture: Texture) -> void: TweenFX.fold_in(photo) photo.setup(texture) - -var is_closing: bool = false - -func _on_panel_gui_input(event: InputEvent) -> void: +func _input(event: InputEvent) -> void: + if not visible: + return + + if event is InputEventMouse: + get_viewport().set_input_as_handled() + if is_closing: return if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed: diff --git a/core/game_menu/highlighted_photo.tscn b/core/game_menu/highlighted_photo.tscn index fb44250..d8bf1ff 100644 --- a/core/game_menu/highlighted_photo.tscn +++ b/core/game_menu/highlighted_photo.tscn @@ -45,6 +45,4 @@ theme_override_constants/margin_top = 30 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 185 -[connection signal="gui_input" from="Panel" to="." method="_on_panel_gui_input"] - [editable path="Photo"] diff --git a/core/game_menu/page_2_right.tscn b/core/game_menu/page_2_right.tscn index 0fddace..7999b53 100644 --- a/core/game_menu/page_2_right.tscn +++ b/core/game_menu/page_2_right.tscn @@ -4,7 +4,6 @@ [ext_resource type="Texture2D" uid="uid://xfl3ks4dbfaw" path="res://core/game_menu/assets/page_2/achievements_text.png" id="3_4uwhd"] [ext_resource type="Texture2D" uid="uid://drwe2xcnp8vs1" path="res://core/game_menu/assets/page_2/2_dx.png" id="3_msl27"] [ext_resource type="PackedScene" uid="uid://bvw086glfpcba" path="res://core/game_menu/collectible_gallery.tscn" id="5_w0bcg"] -[ext_resource type="PackedScene" uid="uid://c7t3p8sp54apy" path="res://core/game_menu/highlighted_photo.tscn" id="6_2273a"] [ext_resource type="Texture2D" uid="uid://bx6gsh5uchkge" path="res://core/game_menu/assets/lock.png" id="8_48jk0"] [ext_resource type="Texture2D" uid="uid://vg5y4qgc26ko" path="res://core/game_menu/assets/page_3/coming_soon_01.png" id="8_71v1w"] [ext_resource type="Texture2D" uid="uid://bmatlcouch6jm" path="res://core/game_menu/assets/page_3/coming_soon_02.png" id="9_g7kul"] @@ -82,10 +81,6 @@ offset_top = 129.5 offset_right = 767.0 offset_bottom = 539.5 -[node name="HighlightedPhoto" parent="." unique_id=2124003447 instance=ExtResource("6_2273a")] -visible = false -layout_mode = 1 - [node name="LockTexture" type="TextureRect" parent="." unique_id=535700029] layout_mode = 0 offset_left = 342.0