Merge pull request #3379 from myk002/myk_rescan

[overlay] rename overlay.reload to overlay.rescan
develop
Myk 2023-05-17 10:21:15 -07:00 committed by GitHub
commit b787ee7aa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

@ -56,6 +56,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## API
## Lua
- ``overlay.reload()``: has been renamed to ``overlay.rescan()`` so as not to conflict with the global ``reload()`` function. If you are developing an overlay, please take note of the new function name for reloading your overlay during development.
## Removed

@ -183,7 +183,7 @@ Scripts
#. If the script is not in your `script-paths`, install your script (see the
`modding-guide` for help setting up a dev environment so that you don't need
to reinstall your scripts after every edit).
#. Call ``:lua require('plugins.overlay').reload()`` to reload your overlay
#. Call ``:lua require('plugins.overlay').rescan()`` to reload your overlay
widget
Plugins
@ -194,7 +194,7 @@ Plugins
:file:`hack/lua/plugins/`
#. If you have changed the compiled plugin, `reload` it
#. If you have changed the lua code, run ``:lua reload('plugins.mypluginname')``
#. Call ``:lua require('plugins.overlay').reload()`` to reload your overlay
#. Call ``:lua require('plugins.overlay').rescan()`` to reload your overlay
widget
Troubleshooting

@ -292,7 +292,7 @@ local function load_widgets(env_name, env)
end
-- called directly from cpp on plugin enable
function reload()
function rescan()
reset()
for _,plugin in ipairs(dfhack.internal.listPlugins()) do
@ -317,7 +317,7 @@ dfhack.onStateChange[GLOBAL_KEY] = function(sc)
return
end
-- pick up widgets from active mods
reload()
rescan()
end
local function dump_widget_config(name, widget)

@ -128,7 +128,7 @@ DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) {
if (enable) {
screenSize = Screen::getWindowSize();
call_overlay_lua(&out, "reload");
call_overlay_lua(&out, "rescan");
}
DEBUG(control).print("%sing interpose hooks\n", enable ? "enabl" : "disabl");