Skip to content

Add tool mode state - #81

Merged
deanblackborough merged 3 commits into
mainfrom
add-tool-mode-state
Jun 21, 2026
Merged

Add tool mode state#81
deanblackborough merged 3 commits into
mainfrom
add-tool-mode-state

Conversation

@deanblackborough

@deanblackborough deanblackborough commented Jun 21, 2026

Copy link
Copy Markdown
Owner
  • Add tool mode state
  • Added tool palette to the top right of the viewport
  • Recreated PR due to a AI slop trying to review the PR

Summary by CodeRabbit

Release Notes

  • New Features

    • Added explicit Select and Move tool buttons to the editor interface, providing clearer control over object interaction behaviour.
    • Select tool enables object selection and handle-based manipulation; Move tool enables direct body dragging for movable objects.
    • Updated editor help documentation to describe tool-switching and interaction rules for each tool.
  • Improvements

    • Tool state no longer persists in saved scene files and resets to Select mode on scene load.

@deanblackborough deanblackborough self-assigned this Jun 21, 2026
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0e230b04-7e04-4383-a31a-91da48caec68

📥 Commits

Reviewing files that changed from the base of the PR and between b9f7086 and a9e3b4d.

⛔ Files ignored due to path filters (3)
  • assets/repo/artillery.png is excluded by !**/*.png
  • assets/repo/platformer.png is excluded by !**/*.png
  • assets/repo/simple-shooter.png is excluded by !**/*.png
📒 Files selected for processing (15)
  • DECISIONS.md
  • NOTES.md
  • src/prune/editor/editor_tool.hpp
  • src/prune/scene/artillery/artillery_scene.cpp
  • src/prune/scene/platformer/platformer_scene.cpp
  • src/prune/scene/scene.hpp
  • src/prune/scene/scene_interaction.cpp
  • src/prune/scene/scene_interaction.hpp
  • src/prune/scene/scene_state.hpp
  • src/prune/scene/simple_shooter/simple_shooter_scene.cpp
  • src/prune/scene/world_scene.cpp
  • src/prune/scene/world_scene.hpp
  • src/prune/tooling/controls.cpp
  • src/prune/tooling/editor_layout.cpp
  • src/prune/tooling/ui.cpp

📝 Walkthrough

Walkthrough

This PR introduces an explicit editor tool mode system with Select and Move as the initial tools. A new EditorTool enum is defined in editor_tool.hpp with two constexpr helper functions. SceneState gains a defaulted editor_tool member. The Scene base class acquires virtual methods for tool access and a execute_scene_creation_action hook. WorldScene implements these, replacing the old draw_creation_tools with a programmatic action-dispatch method. All three concrete scenes reset the tool to Select on runtime reset and mark player objects as editor-movable. SceneInteraction now dispatches drag-start selection through a new tool-aware path. Ui::draw_scene_viewport gains an in-viewport tool palette rendered as an overlay, suppressing viewport hover when the mouse is above it.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • deanblackborough/Prune#78: Both PRs modify src/prune/scene/scene_interaction.cpp to change drag initiation — this PR gates drag selection via the new Move-tool body-move logic including group-drag, while #78 adds multi-selection move/delete support.
  • deanblackborough/Prune#25: Both PRs modify the Ui::draw_scene_viewport rendering flow, viewport hover/input routing, and panel sizing, with this PR's tool-palette overlay building directly on that foundation.
  • deanblackborough/Prune#55: This PR extends DECISIONS.md with the new editor tool mode decision section, directly building on the file introduced in #55.

Suggested labels

enhancement

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-tool-mode-state

Comment @coderabbitai help to get the list of available commands and usage tips.

@deanblackborough
deanblackborough merged commit b1dc3aa into main Jun 21, 2026
1 of 2 checks passed
@deanblackborough
deanblackborough deleted the add-tool-mode-state branch June 21, 2026 22:48
@coderabbitai coderabbitai Bot added the enhancement New feature or request label Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant