|
|
|
@ -8,6 +8,7 @@ local widgets = require('gui.widgets')
|
|
|
|
|
|
|
|
|
|
local OVERLAY_CONFIG_FILE = 'dfhack-config/overlay.json'
|
|
|
|
|
local OVERLAY_WIDGETS_VAR = 'OVERLAY_WIDGETS'
|
|
|
|
|
local GLOBAL_KEY = 'OVERLAY'
|
|
|
|
|
|
|
|
|
|
local DEFAULT_X_POS, DEFAULT_Y_POS = -2, -2
|
|
|
|
|
|
|
|
|
@ -311,6 +312,14 @@ function reload()
|
|
|
|
|
reposition_widgets()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
dfhack.onStateChange[GLOBAL_KEY] = function(sc)
|
|
|
|
|
if sc ~= SC_WORLD_LOADED then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
-- pick up widgets from active mods
|
|
|
|
|
reload()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function dump_widget_config(name, widget)
|
|
|
|
|
local pos = overlay_config[name].pos
|
|
|
|
|
print(('widget %s is positioned at x=%d, y=%d'):format(name, pos.x, pos.y))
|
|
|
|
|