Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions entities/game/memory_game/scenes/MemoryGame.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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")

Expand All @@ -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")

Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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"]
Expand Down
8 changes: 7 additions & 1 deletion shared/entities/clickable_button/ClickableButton.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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")
Expand Down
1 change: 0 additions & 1 deletion shared/entities/popup_manager/scripts/PopupManager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down