MCPcopy Create free account
hub / github.com/axmolengine/axmol / parseConfig

Method parseConfig

extensions/scripting/lua-bindings/manual/LuaEngine.cpp:178–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178bool LuaEngine::parseConfig(ConfigType type, std::string_view str)
179{
180 lua_getglobal(_stack->getLuaState(), "__onParseConfig");
181 if (!lua_isfunction(_stack->getLuaState(), -1))
182 {
183 AXLOGW("[LUA WARN] name '{}' does not represent a Lua function", "__onParseConfig");
184 lua_pop(_stack->getLuaState(), 1);
185 return false;
186 }
187
188 _stack->pushInt((int)type);
189 _stack->pushString(str.data(), str.length());
190
191 return _stack->executeFunction(2);
192}
193
194int LuaEngine::sendEvent(const ScriptEvent& evt)
195{

Callers 1

parseMethod · 0.80

Calls 7

lua_getglobalFunction · 0.85
getLuaStateMethod · 0.80
pushIntMethod · 0.80
pushStringMethod · 0.80
executeFunctionMethod · 0.80
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected