| 51 | } |
| 52 | |
| 53 | void Engine::initScript() |
| 54 | { |
| 55 | m_lua = std::make_unique<sol::state>(); |
| 56 | m_lua->open_libraries(sol::lib::base, sol::lib::string, sol::lib::table, |
| 57 | sol::lib::package, sol::lib::os, sol::lib::coroutine, sol::lib::math, |
| 58 | sol::lib::count, sol::lib::debug, sol::lib::io, sol::lib::bit32); |
| 59 | |
| 60 | m_lua->safe_script("LuaCore = {}"); |
| 61 | m_lua->safe_script_file("Lib/Internal/ScriptInit.lua"_fs); |
| 62 | m_lua->safe_script_file("Lib/Internal/Triggers.lua"_fs); |
| 63 | |
| 64 | Bindings::IndexAllBindings(*m_lua); |
| 65 | m_lua->safe_script_file("Lib/Internal/Searcher.lua"_fs); |
| 66 | m_lua->safe_script_file("Lib/Internal/GameInit.lua"_fs); |
| 67 | m_lua->safe_script_file("Lib/Internal/Logger.lua"_fs); |
| 68 | m_lua->set_exception_handler(&lua_exception_handler); |
| 69 | |
| 70 | (*m_lua)["Engine"] = this; |
| 71 | } |
| 72 | |
| 73 | void Engine::initResources() |
| 74 | { |
no test coverage detected