From 206ff9a212ad020a92b083bbd40c10f1e33f782d Mon Sep 17 00:00:00 2001 From: Shard Date: Sun, 29 Mar 2026 19:55:03 +0000 Subject: [PATCH] Add touch tap/hold selection and keep one-finger orbit --- .../origin-client/scenes/game/game_screen.gd | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index 7c27a31..847dbeb 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -851,16 +851,36 @@ func _unhandled_input(event: InputEvent) -> void: var st := event as InputEventScreenTouch if st.pressed: _touch_points[st.index] = st.position - _touch_drag_active = false - if _touch_points.size() >= 2: + if _touch_points.size() == 1: + # Single-touch start: arm tap + hold (touch right-click) behavior. + _touch_drag_active = false + _press_was_on_board = true + _last_mouse = st.position + var touch_coord := _mouse_to_tile_coord(st.position) + if touch_coord.x >= 0: + _held_coord = touch_coord + _hold_timer.start() + else: + _held_coord = Vector2i(-1, -1) + elif _touch_points.size() >= 2: _pinch_dist = _touch_pair_dist() _last_mouse = _touch_pair_mid() _was_multi_touch = true + _held_coord = Vector2i(-1, -1) _hold_timer.stop() else: + var released_pos := st.position + var had_single_touch := (_touch_points.size() == 1 and _touch_points.has(st.index)) _touch_points.erase(st.index) + if had_single_touch and not _touch_drag_active and not _was_multi_touch and _press_was_on_board: + _hold_timer.stop() + _handle_board_click(released_pos) if _touch_points.is_empty(): - _was_multi_touch = false + _was_multi_touch = false + _touch_drag_active = false + _press_was_on_board = false + _held_coord = Vector2i(-1, -1) + _hold_timer.stop() elif event is InputEventScreenDrag: var sd := event as InputEventScreenDrag