Skip to content

Commit 278c935

Browse files
committed
Enabled common lua modules
1 parent 60bbe46 commit 278c935

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

Sources/OvCore/src/OvCore/Scripting/Lua/LuaScriptEngine.cpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,13 @@ namespace
112112
" \"runtime.builtin\": {{\n"
113113
" \"basic\": \"enable\",\n"
114114
" \"math\": \"enable\",\n"
115-
" \"string\": \"disable\",\n"
116-
" \"table\": \"disable\",\n"
117-
" \"io\": \"disable\",\n"
118-
" \"os\": \"disable\",\n"
119-
" \"package\": \"disable\",\n"
120-
" \"coroutine\": \"disable\"\n"
115+
" \"string\": \"enable\",\n"
116+
" \"table\": \"enable\",\n"
117+
" \"io\": \"enable\",\n"
118+
" \"os\": \"enable\",\n"
119+
" \"package\": \"enable\",\n"
120+
" \"debug\": \"enable\",\n"
121+
" \"coroutine\": \"enable\"\n"
121122
" }}\n"
122123
"}}\n",
123124
absolutePath.string(),
@@ -342,7 +343,17 @@ void OvCore::Scripting::LuaScriptEngine::CreateContext()
342343
OVASSERT(m_context.luaState == nullptr, "A Lua context already exists!");
343344

344345
m_context.luaState = std::make_unique<sol::state>();
345-
m_context.luaState->open_libraries(sol::lib::base, sol::lib::math);
346+
m_context.luaState->open_libraries(
347+
sol::lib::base,
348+
sol::lib::math,
349+
sol::lib::coroutine,
350+
sol::lib::io,
351+
sol::lib::os,
352+
sol::lib::package,
353+
sol::lib::string,
354+
sol::lib::table,
355+
sol::lib::debug
356+
);
346357

347358
for (auto& callback : luaBindings)
348359
{

0 commit comments

Comments
 (0)