diff --git a/entities/game/memory_game/scenes/MemoryGame.tscn b/entities/game/memory_game/scenes/MemoryGame.tscn index fdbfe6f..fd653ed 100644 --- a/entities/game/memory_game/scenes/MemoryGame.tscn +++ b/entities/game/memory_game/scenes/MemoryGame.tscn @@ -101,6 +101,7 @@ text = "PAUSE_MENU" script = ExtResource("15_2f3xl") can_request_debug_view = true active = 4 +initial_visibility = false button_behavior = SubResource("Resource_kihnp") pressed_action = SubResource("Resource_086p8") @@ -127,6 +128,7 @@ icon = ExtResource("18_pqxyo") script = ExtResource("15_2f3xl") can_request_debug_view = true active = 4 +initial_visibility = false button_behavior = SubResource("Resource_5dmxa") pressed_action = SubResource("Resource_1wouk") @@ -137,6 +139,7 @@ icon = ExtResource("20_ef4f6") script = ExtResource("15_2f3xl") can_request_debug_view = true active = 4 +initial_visibility = false button_behavior = SubResource("Resource_78e34") pressed_action = SubResource("Resource_tgl34") @@ -180,9 +183,12 @@ finished_game_template = ExtResource("4_6f670") player_node = NodePath("../Players") [connection signal="card_loading_done" from="." to="Camera2D" method="loading_done"] +[connection signal="card_loading_done" from="." to="CanvasLayer/MenuButton" method="show_button_if_valid"] [connection signal="card_loading_done" from="." to="CanvasLayer/MenuButton" method="show_button"] [connection signal="card_loading_done" from="." to="CanvasLayer/PlayersOverlay" method="show"] +[connection signal="card_loading_done" from="." to="CanvasLayer/VBoxContainer/ZoomIn" method="show_button_if_valid"] [connection signal="card_loading_done" from="." to="CanvasLayer/VBoxContainer/ZoomIn" method="show_button"] +[connection signal="card_loading_done" from="." to="CanvasLayer/VBoxContainer/ZoomOut" method="show_button_if_valid"] [connection signal="card_loading_done" from="." to="CanvasLayer/VBoxContainer/ZoomOut" method="show_button"] [connection signal="card_loading_done" from="." to="Cards" method="announce_card_field"] [connection signal="card_loading_done" from="." to="Cards" method="card_loading_done"] @@ -218,6 +224,7 @@ player_node = NodePath("../Players") [connection signal="end_current_round" from="PlayerInput" to="." method="end_round_now"] [connection signal="game_menu_requested" from="PlayerInput" to="." method="show_game_menu"] [connection signal="touch_used" from="Camera2D" to="Cards" method="disable_card_effects"] +[connection signal="pressed" from="CanvasLayer/MenuButton" to="." method="show_game_menu"] [connection signal="continue_game" from="CanvasLayer/PopupManager" to="." method="unpause_game"] [connection signal="pause_game" from="CanvasLayer/PopupManager" to="." method="pause_game"] [connection signal="tutorial_requested" from="CanvasLayer/Tutorial" to="CanvasLayer/PopupManager" method="add_and_show_popup"] diff --git a/shared/entities/clickable_button/ClickableButton.gd b/shared/entities/clickable_button/ClickableButton.gd index 256347f..fae869c 100644 --- a/shared/entities/clickable_button/ClickableButton.gd +++ b/shared/entities/clickable_button/ClickableButton.gd @@ -13,11 +13,12 @@ enum { @export var can_request_debug_view: bool = false @export_flags("Web", "Desktop", "Mobile", "Debug") var active: int = 7 @export var only_visible_if_custom_deck_active: bool = false +@export var initial_visibility: bool = true @export_group("Behavior") @export var is_focused: bool = false ## If false the button can only be clicked once -@export var button_behavior: ButtonBehavior = null +@export var button_behavior: ButtonBehavior @export_group("Animations") @export var animation_resource: ControlAnimationResource = null @@ -33,6 +34,8 @@ var _is_animated: bool = false func _ready() -> void: if !_check_for_valid_platform(): return + if !initial_visibility: + visible = false if button_behavior == null: button_behavior = DefaultButtonBehavior.new() button_behavior.init(self, pressed_action) @@ -46,6 +49,9 @@ func _ready() -> void: if is_focused: grab_focus() +func show_button_if_valid() -> void: + _check_for_valid_platform() + func _check_for_valid_platform() -> bool: if only_show_on_debug && !OS.is_debug_build(): print_debug("debug only") diff --git a/shared/entities/popup_manager/scripts/PopupManager.gd b/shared/entities/popup_manager/scripts/PopupManager.gd index b2f1aa4..6d4da46 100644 --- a/shared/entities/popup_manager/scripts/PopupManager.gd +++ b/shared/entities/popup_manager/scripts/PopupManager.gd @@ -36,7 +36,6 @@ func show_next_popup() -> void: check_and_add_id(popup) if popup.should_pause: - print(multiplayer.multiplayer_peer) if multiplayer.multiplayer_peer == null or multiplayer.get_peers().size() == 0: pause_game.emit() mouse_filter = MOUSE_FILTER_STOP