fix(input): let swipes reach scroll containers
Godot ScrollContainer only receives drag gestures when the controls under the finger pass them through. Guest Book cards, House Rules rows, and Settings rows now use PASS, so swiping scrolls while taps, toggles, sliders, and buttons still work. The tutorial board keeps its own input.
This commit is contained in:
1 parent
dffdee63a6
commit
d679a12e1d
5 files changed
+47
-4
No files matched your search
@@ -142,6 +142,19 @@ static func safe_bottom() -> int:
|
||||
return 24 if OS.has_feature("mobile") else 14
|
||||
|
||||
|
||||
## Godot's ScrollContainer only sees a touch drag when the controls under the
|
||||
## finger let the event through. PASS keeps buttons clickable while allowing
|
||||
## the parent ScrollContainer to handle the same gesture. `skip` protects
|
||||
## controls that must own their input, such as the tutorial Board.
|
||||
static func pass_scroll_input(root: Node, skip: Array = []) -> void:
|
||||
if root is Control and not skip.has(root):
|
||||
root.mouse_filter = Control.MOUSE_FILTER_PASS
|
||||
for child in root.get_children():
|
||||
if skip.has(child):
|
||||
continue
|
||||
pass_scroll_input(child, skip)
|
||||
|
||||
|
||||
## Short control hint that follows the saved placement mode.
|
||||
static func place_hint() -> String:
|
||||
if bool(SaveGame.get_setting("double_tap_place")):
|
||||
|
||||
Reference in new issue
Block a user