Select a pawn or building on the map (#78) #144
No reviewers
Labels
No labels
assets
bug
duplicate
enhancement
help wanted
invalid
question
testing
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
liamjd/UntitledColonyBuilder!144
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "78-select-pawn-or-building"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Left-click a pawn or a building on the map to select it. This is the foundation for milestone #6: the pawn list (#140), building list (#141) and inspector (#142) all build on it. The spec is the comment on #78.
What changed
GameState.selected: Entitywithselection_changed(new, previous).push_errorand leaves the selection unchanged.interaction_mode_changedfires.InteractionMode.SELECTis removed. Selection is what a click means in NONE mode.Pawns.pick()mirrorsBuildings.pick():"pawns", set up in_spawn_view()with the layer,collision_mask = 0and an id meta.collide_with_areas = true, because the pawn's collider is anArea3D.SelectionControlleris a new node ingame.tscn, afterDemolishController.selectaction (left mouse) only in NONE mode.SelectionHighlightis a translucent tint inmaterial_overlay, so it never conflicts with the status tints or withPawnView.flash(), which both usematerial_override.Pawns.set_highlighted()andBuildings.set_highlighted(). Both do nothing quietly when there's no view.Testing
test_selection.gd: the GameState rules.test_selection_highlight.gd: the overlay material.test_selection_picking.gd: the realgame.tscn, covering picking, mode gating, click handling, and highlights surviving status changes and flashes.collide_with_areas, clearing the selection after the mode signal, highlight inmaterial_override) were each caught.Caveats and follow-ups
fa11363) rather than a separate spec commit first.Closes #78
🤖 Generated with Claude Code