|
|
@ -273,13 +273,11 @@ local function update_db(old_db, entry_name, text_entry, help_source, kwargs)
|
|
|
|
-- already in db (e.g. from a higher-priority script dir); skip
|
|
|
|
-- already in db (e.g. from a higher-priority script dir); skip
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if not kwargs.text_entry_only then
|
|
|
|
entrydb[entry_name] = {
|
|
|
|
entrydb[entry_name] = {
|
|
|
|
entry_types=kwargs.entry_types,
|
|
|
|
entry_types=kwargs.entry_types,
|
|
|
|
short_help=kwargs.short_help,
|
|
|
|
short_help=kwargs.short_help,
|
|
|
|
text_entry=text_entry
|
|
|
|
text_entry=text_entry
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
if entry_name ~= text_entry then
|
|
|
|
if entry_name ~= text_entry then
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -317,7 +315,7 @@ local function scan_plugins(old_db)
|
|
|
|
local plugin_names = dfhack.internal.listPlugins()
|
|
|
|
local plugin_names = dfhack.internal.listPlugins()
|
|
|
|
for _,plugin in ipairs(plugin_names) do
|
|
|
|
for _,plugin in ipairs(plugin_names) do
|
|
|
|
local commands = dfhack.internal.listCommands(plugin)
|
|
|
|
local commands = dfhack.internal.listCommands(plugin)
|
|
|
|
local includes_plugin, has_commands = false, false
|
|
|
|
local includes_plugin = false
|
|
|
|
for _,command in ipairs(commands) do
|
|
|
|
for _,command in ipairs(commands) do
|
|
|
|
local kwargs = {entry_types={[ENTRY_TYPES.COMMAND]=true}}
|
|
|
|
local kwargs = {entry_types={[ENTRY_TYPES.COMMAND]=true}}
|
|
|
|
if command == plugin then
|
|
|
|
if command == plugin then
|
|
|
@ -329,18 +327,13 @@ local function scan_plugins(old_db)
|
|
|
|
has_rendered_help(plugin) and
|
|
|
|
has_rendered_help(plugin) and
|
|
|
|
HELP_SOURCES.RENDERED or HELP_SOURCES.PLUGIN,
|
|
|
|
HELP_SOURCES.RENDERED or HELP_SOURCES.PLUGIN,
|
|
|
|
kwargs)
|
|
|
|
kwargs)
|
|
|
|
has_commands = true
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if includes_plugin then goto continue end
|
|
|
|
if not includes_plugin then
|
|
|
|
local is_enableable = dfhack.internal.isPluginEnableable(plugin)
|
|
|
|
|
|
|
|
if has_commands or is_enableable then
|
|
|
|
|
|
|
|
update_db(old_db, plugin, plugin,
|
|
|
|
update_db(old_db, plugin, plugin,
|
|
|
|
has_rendered_help(plugin) and
|
|
|
|
has_rendered_help(plugin) and
|
|
|
|
HELP_SOURCES.RENDERED or HELP_SOURCES.STUB,
|
|
|
|
HELP_SOURCES.RENDERED or HELP_SOURCES.STUB,
|
|
|
|
{entry_types={[ENTRY_TYPES.PLUGIN]=true},
|
|
|
|
{entry_types={[ENTRY_TYPES.PLUGIN]=true}})
|
|
|
|
text_entry_only=not is_enableable})
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
::continue::
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|