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) <noreply@anthropic.com>
This commit is contained in:
megaproxy 2026-05-16 18:27:26 +01:00
parent cc6d60d044
commit cf43ef9a98
2 changed files with 20 additions and 3 deletions

4
.gitignore vendored
View file

@ -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

View file

@ -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:
# 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:
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