feat(input): guard Guest Book taps and add double-tap placement
Guest Book: only open a card on a short stationary tap, ignore drags and flings, and guard the detail Close button after opening. Board: add a persisted double-tap placement mode with deferred single taps, while hold stays the default and right-click works in both modes.
This commit is contained in:
1 parent
bed81a2e05
commit
af4951baf8
8 files changed
+344
-11
No files matched your search
+23
-3
@@ -6,6 +6,7 @@ const BoardScene = preload("res://scenes/Board.tscn")
|
||||
|
||||
var tutorial_board: Board
|
||||
var tutorial_status: Label
|
||||
var checkin_body: Label
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -54,7 +55,8 @@ func _ready() -> void:
|
||||
content.add_child(_rule_row("No shared walls or corners", "Rats cannot touch, not even diagonally.", "touch"))
|
||||
|
||||
content.add_child(_heading("Checking in", 18))
|
||||
content.add_child(_body("Tap or left-click to mark X. Tap an X or a guest to clear it. Hold or right-click to check a guest in. Gold-ringed guests are already in."))
|
||||
checkin_body = _body(_checkin_text())
|
||||
content.add_child(checkin_body)
|
||||
content.add_child(_body("Undo is unlimited. Hints are free and explain the next sensible move."))
|
||||
|
||||
content.add_child(_heading("Try a tiny room", 18))
|
||||
@@ -84,8 +86,9 @@ func _ready() -> void:
|
||||
hint.pressed.connect(_on_tutorial_hint)
|
||||
controls.add_child(hint)
|
||||
|
||||
tutorial_status = UI.label("Tap = X · Hold or right-click = check in", 10, Palette.MUTED)
|
||||
tutorial_status = UI.label(UI.place_hint(), 10, Palette.MUTED)
|
||||
content.add_child(tutorial_status)
|
||||
SaveGame.settings_changed.connect(_refresh_hints)
|
||||
|
||||
content.add_child(_heading("Housekeeping tips", 18))
|
||||
content.add_child(_body("Start with the smallest room. If a room's open cells all sit in one row, that row's guest belongs to that room. Every room has one solution and never requires guessing."))
|
||||
@@ -152,9 +155,26 @@ func _load_tutorial() -> Dictionary:
|
||||
return {}
|
||||
|
||||
|
||||
func _checkin_text() -> String:
|
||||
var place := "Double-tap or right-click to check a guest in."
|
||||
if not bool(SaveGame.get_setting("double_tap_place")):
|
||||
place = "Hold or right-click to check a guest in."
|
||||
return "Tap or left-click to mark X. Tap an X or a guest to clear it. %s Gold-ringed guests are already in." % place
|
||||
|
||||
|
||||
func _refresh_hints() -> void:
|
||||
if checkin_body != null:
|
||||
checkin_body.text = _checkin_text()
|
||||
if tutorial_status != null and (
|
||||
tutorial_status.text == "Tap = X · Hold or right-click = check in"
|
||||
or tutorial_status.text == "Tap = X · Double-tap or right-click = check in"
|
||||
):
|
||||
tutorial_status.text = UI.place_hint()
|
||||
|
||||
|
||||
func _on_tutorial_reset() -> void:
|
||||
tutorial_board.restart()
|
||||
tutorial_status.text = "Tap = X · Hold or right-click = check in"
|
||||
tutorial_status.text = UI.place_hint()
|
||||
tutorial_status.add_theme_color_override("font_color", Palette.MUTED)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user