MCPcopy Create free account
hub / github.com/DFHack/dfhack / loadModScriptPaths

Function loadModScriptPaths

library/Core.cpp:575–589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573}
574
575static void loadModScriptPaths(color_ostream &out) {
576 std::vector<std::string> mod_script_paths_str;
577 std::vector<std::filesystem::path> mod_script_paths;
578 Lua::CallLuaModuleFunction(out, "script-manager", "get_mod_script_paths", {}, 1,
579 [&](lua_State *L) {
580 Lua::GetVector(L, mod_script_paths_str);
581 });
582 DEBUG(script,out).print("final mod script paths:\n");
583 for (auto& path : mod_script_paths_str)
584 {
585 DEBUG(script, out).print(" {}\n", path);
586 mod_script_paths.push_back(std::filesystem::weakly_canonical(std::filesystem::path{ path }));
587 }
588 Core::getInstance().setModScriptPaths(mod_script_paths);
589}
590
591static std::map<std::string, state_change_event> state_change_event_map;
592static void sc_event_map_init() {

Callers 1

onStateChangeMethod · 0.85

Calls 4

CallLuaModuleFunctionFunction · 0.85
GetVectorFunction · 0.85
setModScriptPathsMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected