Skip to content

sort: clickable stress icons in the top bar - #5953

Open
Alistair-Afton wants to merge 1 commit into
DFHack:developfrom
Alistair-Afton:sort-stress-icons
Open

Alistair-Afton wants to merge 1 commit into
DFHack:developfrom
Alistair-Afton:sort-stress-icons

Conversation

@Alistair-Afton

Copy link
Copy Markdown
Contributor

Summary

  • Adds an invisible hotspot overlay widget (sort.stress_icons) over the seven stress/happiness icons next to the "Pop" label in the fortress-mode top bar.
  • Clicking an icon opens a searchable ListBox of the citizens in that stress category (e.g. "Citizens: Unhappy").
  • Selecting a citizen dismisses the list and centers the map on them via dfhack.gui.revealInDwarfmodeMap.
  • Empty categories show a brief message instead of an empty list.
  • Icon positions are discovered each second by scanning the top bar for the Pop label, so the hotspot tracks window resizes and fort-name length changes. Only active on dwarfmode/Default.
  • Includes a new in-engine test file (test/plugins/sort.lua) covering rect detection, click handling, list filtering, and map centering.

Test plan

  • test -t plugins.sort in-game on a fortress save: 5/5 tests, 38/38 checks pass
  • Clicked all seven icons in-game: populated categories open the filtered list; empty categories show the "no citizens" message
  • Selecting a dwarf recenters the map viewport on their position (verified across z-levels)
  • Clicks outside the icons pass through to the map; clicks on the modal list are consumed

Adds an invisible hotspot overlay over the seven stress/happiness icons
next to the Pop label. Clicking an icon opens a filterable list of the
citizens in that stress category, and selecting one centers the map on
them.
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