rename overlay.reload to overlay.rescan

develop
Myk Taylor 2023-05-16 11:41:28 -07:00
parent 2a734b92f7
commit a76bed0ed5
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
4 changed files with 6 additions and 5 deletions

@ -54,6 +54,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## API ## API
## Lua ## 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 ## Removed

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

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

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