add a warning when DT appears to be running

develop
Myk Taylor 2023-04-18 15:50:59 -07:00
parent 649d72e658
commit 250f05667b
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 16 additions and 4 deletions

@ -42,6 +42,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
- ``toggle-kbd-cursor``: add hotkey for toggling the keyboard cursor (Alt-K)
- `gui/control-panel`: add preference option for hiding the terminal console on startup
- `gui/control-panel`: add preference option for hiding "armok" tools in command lists
- ``Dwarf Therapist``: add a warning to the Labors screen when Dwarf Therapist is active so players know that changes they make to that screen will have no effect. If you're starting a new embark and nobody seems to be doing anything, check your Labors tab for this warning to see if Dwarf Therapist thinks it is in control (even if it's not running).
## Documentation

@ -10,7 +10,7 @@ AutolaborOverlay.ATTRS{
default_enabled=true,
viewscreens='dwarfmode/Info/LABOR',
frame={w=29, h=5},
frame_style=gui.MEDIUM_FRAME,
frame_style=gui.THIN_FRAME,
frame_background=gui.CLEAR_PEN,
}
@ -18,9 +18,20 @@ function AutolaborOverlay:init()
self:addviews{
widgets.Label{
frame={t=0, l=0},
text_pen=COLOR_RED,
text_pen=COLOR_LIGHTRED,
text='DFHack autolabor is active!',
visible=isEnabled,
},
widgets.Label{
frame={t=0, l=0},
text_pen=COLOR_LIGHTRED,
text='Dwarf Therapist is active!',
visible=function() return not isEnabled() end,
},
widgets.Label{
frame={t=1, l=0},
text_pen=COLOR_WHITE,
text={
'DFHack autolabor is active!', NEWLINE,
'Any changes made on this', NEWLINE,
'screen will have no effect.'
},
@ -29,7 +40,7 @@ function AutolaborOverlay:init()
end
function AutolaborOverlay:render(dc)
if not isEnabled() then return false end
if df.global.game_extra.external_flag ~= 1 then return end
AutolaborOverlay.super.render(self, dc)
end