-
Notifications
You must be signed in to change notification settings - Fork 496
Expand file tree
/
Copy pathautolabor.lua
More file actions
52 lines (46 loc) · 1.43 KB
/
autolabor.lua
File metadata and controls
52 lines (46 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
local _ENV = mkmodule('plugins.autolabor')
local gui = require('gui')
local overlay = require('plugins.overlay')
local widgets = require('gui.widgets')
AutolaborOverlay = defclass(AutolaborOverlay, overlay.OverlayWidget)
AutolaborOverlay.ATTRS{
desc='Adds information to the work details screen about whether work details are enabled.',
default_pos={x=7,y=-13},
default_enabled=true,
viewscreens='dwarfmode/Info/LABOR/WORK_DETAILS',
frame={w=29, h=5},
frame_style=gui.MEDIUM_FRAME,
frame_background=gui.CLEAR_PEN,
}
function AutolaborOverlay:init()
self:addviews{
widgets.Label{
frame={t=0, l=0},
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={
'Any changes made on this', NEWLINE,
'screen will have no effect.'
},
},
}
end
function AutolaborOverlay:render(dc)
if not df.global.game.external_flag.automatic_professions_disabled then return end
AutolaborOverlay.super.render(self, dc)
end
OVERLAY_WIDGETS = {
overlay=AutolaborOverlay,
}
return _ENV