mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-29 00:07:58 +03:00
First commit of assetDir command line option.
This commit is contained in:
parent
c4202101b7
commit
a2d985b4c5
12 changed files with 77 additions and 28 deletions
|
@ -37,10 +37,11 @@ ScriptInterfaceStringsHandler* ScriptInterfaceState::CreateStringsHandler()
|
|||
return new StringsHandler(&s_solState, s_rootTable);
|
||||
}
|
||||
|
||||
void ScriptInterfaceState::Init()
|
||||
void ScriptInterfaceState::Init(std::string_view assetsDir)
|
||||
{
|
||||
s_solState.open_libraries(sol::lib::base, sol::lib::math, sol::lib::package, sol::lib::coroutine, sol::lib::table, sol::lib::string, sol::lib::debug);
|
||||
s_solState.script("package.path=\"Scripts/?.lua\"");
|
||||
|
||||
s_solState.script("package.path=\"" + std::string{assetsDir} + "Scripts/?.lua\"");
|
||||
s_solState.set_exception_handler(lua_exception_handler);
|
||||
|
||||
s_rootTable = sol::table{ s_solState.lua_state(), sol::create };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue