gui/notify: add mandates_expiring_early notification - #1633
Open
Alistair-Afton wants to merge 1 commit into
Open
Alistair-Afton wants to merge 1 commit into
Alistair-Afton wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an opt-in
mandates_expiring_earlynotification that warns when a production mandate has less than 3 months remaining — roughly the midpoint of the typical ~6 month mandate duration. The existingmandates_expiringnotification 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
Makemandates 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_counterincrements once per 10 frames, so 3 months = 10080 counter units and the existing "1 month" threshold of 2500 is ~3 weeks.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