Skip to content

feat(isometric): generic object selection + modal system#7825

Merged
h0lybyte merged 1 commit intodevfrom
trunk/isometric-dev-1773035717
Mar 9, 2026
Merged

feat(isometric): generic object selection + modal system#7825
h0lybyte merged 1 commit intodevfrom
trunk/isometric-dev-1773035717

Conversation

@h0lybyte
Copy link
Member

@h0lybyte h0lybyte commented Mar 9, 2026

Summary

  • Add InteractableKind discriminated union (Tree, Crate, Crystal, Pillar, Sphere) as a generic <T> pattern for clickable objects
  • Bevy detect_click_selection system writes SelectedObject snapshot on left-click of hovered Interactable entities (take semantics — read clears)
  • React useObjectSelection hook polls snapshot every 100ms and opens the existing modal with kind-specific title, description, and action button
  • All hoverable entities (trees, crates, crystals, pillars, spheres) now carry Interactable component

Test plan

  • Click a highlighted tree — modal opens with "Tree" title and "Chop Tree" button
  • Click a highlighted crate — modal opens with "Wooden Crate" and "Open Crate"
  • Click crystal/pillar/sphere — corresponding modal content appears
  • Close modal, click another object — new modal opens
  • Click with nothing hovered — nothing happens
  • Action button shows toast confirmation (placeholder)

🤖 Generated with Claude Code

Add InteractableKind discriminated union so any hoverable entity carries
typed data that drives a modal on click. Bevy detects left-click on
hovered Interactable entities, writes a SelectedObject snapshot with
take semantics, and React polls it to open the existing modal with
kind-specific title, description, and action button.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@h0lybyte h0lybyte merged commit 40fde48 into dev Mar 9, 2026
4 checks passed
@h0lybyte h0lybyte deleted the trunk/isometric-dev-1773035717 branch March 9, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant