Skip to content

gui/notify: add mandates_expiring_early notification - #1633

Open
Alistair-Afton wants to merge 1 commit into
DFHack:masterfrom
Alistair-Afton:notify-mandate-early
Open

Alistair-Afton wants to merge 1 commit into
DFHack:masterfrom
Alistair-Afton:notify-mandate-early

Conversation

@Alistair-Afton

Copy link
Copy Markdown

Adds an opt-in mandates_expiring_early notification that warns when a production mandate has less than 3 months remaining — roughly the midpoint of the typical ~6 month mandate duration. The existing mandates_expiring notification still fires within ~1 month of the deadline, so enabling both gives escalating warning tiers, as suggested in the issue.

The early notification counts all Make mandates within its window (including imminent ones), so enabling it alone never hides a near-deadline mandate. It is disabled by default to avoid extra overlay noise for players who don't want it.

Implementation notes:

  • mandate.timeout_counter increments once per 10 frames, so 3 months = 10080 counter units and the existing "1 month" threshold of 2500 is ~3 weeks.
  • The shared mandate-counting loop is factored into a helper used by both notifications.
  • New in-engine regression test (test/notify.lua) fabricates mandates at all three threshold windows and asserts both notifications report the right counts. 1/1 tests, 8/8 checks pass in-game on 53.16.

Closes DFHack/dfhack#5767

Adds an opt-in notification that warns when a production mandate has
less than 3 months remaining, roughly the midpoint of the typical
~6 month mandate duration. The existing mandates_expiring notification
still fires within ~1 month of the deadline, so the two compose into
escalating tiers for players who want an earlier heads up.

Refactors the shared mandate-counting loop into a helper and adds an
in-engine regression test covering all threshold windows.

Closes DFHack/dfhack#5767
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.

Idea: notify mandate earlier warning

1 participant