diff --git a/docs/changelog.txt b/docs/changelog.txt index 19209ca60..949e8fe56 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -56,7 +56,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: ## Lua - Added a ``ref_target`` field to primitive field references, corresponding to the ``ref-target`` XML attribute -- Support for splitting scripts into multiple files without polluting the output of '#DFHack ls'. Scripts that end in '-internal.lua' will not be listed, but but they can still be 'require'd from other scripts. +- Support for splitting scripts into multiple files without polluting the output of ``#DFHack ls``. Scripts can now add internal files to an ``scripts/internal`` folder. ## Ruby - Updated ``item_find`` and ``building_find`` to use centralized logic that works on more screens diff --git a/library/Core.cpp b/library/Core.cpp index 9192d5772..c6ce9ea48 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -301,7 +301,7 @@ static void listScripts(PluginManager *plug_mgr, std::map &pset, path += '/'; for (size_t i = 0; i < files.size(); i++) { - if (hasEnding(files[i], ".lua") && !hasEnding(files[i], "-internal.lua")) + if (hasEnding(files[i], ".lua")) { string help = getScriptHelp(path + files[i], "--"); string key = prefix + files[i].substr(0, files[i].size()-4); @@ -317,7 +317,7 @@ static void listScripts(PluginManager *plug_mgr, std::map &pset, pset[key] = help; } } - else if (all && !files[i].empty() && files[i][0] != '.') + else if (all && !files[i].empty() && files[i][0] != '.' && files[i] != "internal") { listScripts(plug_mgr, pset, path+files[i]+"/", all, prefix+files[i]+"/"); }