From cf43ef9a98a0a37819aaeac7e128966188a43010 Mon Sep 17 00:00:00 2001 From: megaproxy Date: Sat, 16 May 2026 18:27:26 +0100 Subject: [PATCH] camera_rig defers to active paint tool + gitignore build artifacts K: camera_rig._unhandled_input checks World.designation_ctl.active_tool() before starting drag-pan or applying ScreenDrag. Fixes drag-paint being silently downgraded to single-cell when a designate/build/stockpile tool is active. Reverse-tree input dispatch gave CameraRig first crack at drag events (CameraRig is later in world.tscn than DesignationCtl). S: .gitignore now covers *.pck, Rimlike.sh, export_presets.cfg, and .claude/scheduled_tasks.lock. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitignore | 4 ++++ scenes/world/camera_rig.gd | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 607a22f..7be353c 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,9 @@ exports/ *.x86_64 *.app *.zip +*.pck +Rimlike.sh +export_presets.cfg # Proprietary addons — installed locally from the paid zip, not redistributed # (Godot MCP Pro lives at D:\godot\mcp\; re-copy on fresh clone — see CLAUDE.md) @@ -62,3 +65,4 @@ addons/godot_mcp/ # Local-only Claude Code subagent definitions (personal AI tooling) .claude/agents/ +.claude/scheduled_tasks.lock diff --git a/scenes/world/camera_rig.gd b/scenes/world/camera_rig.gd index cd4490f..45af880 100644 --- a/scenes/world/camera_rig.gd +++ b/scenes/world/camera_rig.gd @@ -50,6 +50,13 @@ func _process(delta: float) -> void: position += pan_input.normalized() * (PAN_SPEED_PX_PER_SEC / zoom.x) * delta +## Returns true when a Designation paint tool is active. +## Camera drag-pan must yield to the paint tool so drag strokes reach Designation. +func _paint_tool_active() -> bool: + var d = World.designation_ctl + return d != null and d.active_tool() != Designation.TOOL_NONE + + func _unhandled_input(event: InputEvent) -> void: # --- Pinch-zoom via magnify gesture (trackpad + native touch pinch) --- if event is InputEventMagnifyGesture: @@ -78,18 +85,24 @@ func _unhandled_input(event: InputEvent) -> void: # --- Desktop left-mouse: drag-pan tracking + double-tap detection --- if event.button_index == MOUSE_BUTTON_LEFT: if event.pressed: - _dragging = true + # Don't start a pan drag while a paint tool is active; the + # button-down belongs to Designation's stroke start. + if not _paint_tool_active(): + _dragging = true _check_double_tap(event.position) else: _dragging = false return - # --- Touch drag-pan --- + # --- Touch drag-pan (skip when a paint tool is active) --- if event is InputEventScreenDrag: - _apply_pan(event.relative) + if not _paint_tool_active(): + _apply_pan(event.relative) return # --- Desktop mouse-motion drag-pan (only while left mouse held) --- + # _dragging is only set when no paint tool was active at press time, so this + # guard is sufficient for the desktop case. if event is InputEventMouseMotion and _dragging: _apply_pan(event.relative) return