add _LuaEngineMode

This commit is contained in:
Syping 2020-07-29 11:07:29 +02:00
parent d6117ee54a
commit 8dfd5b9455
3 changed files with 4 additions and 3 deletions

View file

@ -66,7 +66,7 @@ int main(int argc, char *argv[])
LuaEngineNetwork::pushClass(&luaEngineGui);
LuaEngineOS::pushClass(&luaEngineGui);
luaEngineGui.pushVariant("_LuaEngineRT", rtPath);
luaEngineGui.setProperty("EngineMode", "GUI");
luaEngineGui.pushVariant("_LuaEngineMode", "GUI");
luaEngineGui.setProperty("EngineType", "Runtime");
luaEngineGui.setProperty("ScriptPath", scriptPath);
luaEngineGui.executeLuaScript(luaScript.readAll());

View file

@ -80,6 +80,7 @@ int main(int argc, char *argv[])
LuaEngineIO::pushClass(&luaEngineGui);
LuaEngineNetwork::pushClass(&luaEngineGui);
LuaEngineOS::pushClass(&luaEngineGui);
luaEngineGui.pushVariant("_LuaEngineMode", "GUI");
luaEngineGui.setProperty("EngineType", "Portable");
luaEngineGui.executeLuaScript(luaScript);
@ -94,7 +95,7 @@ int main(int argc, char *argv[])
return variant.toInt();
}
else if (variant.type() == QVariant::String) {
if (variant.toString() == "GuiExecuted") {
if (variant.toString() == "GuiExecuted" || variant.toString() == "CliExecuted") {
return a.exec();
}
else {

View file

@ -53,7 +53,7 @@ int main(int argc, char *argv[])
LuaEngineNetwork::pushClass(&luaEngine);
LuaEngineOS::pushClass(&luaEngine);
luaEngine.pushVariant("_LuaEngineRT", rtPath);
luaEngine.setProperty("EngineMode", "CLI");
luaEngine.pushVariant("_LuaEngineMode", "CLI");
luaEngine.setProperty("EngineType", "Runtime");
luaEngine.setProperty("ScriptPath", scriptPath);
luaEngine.executeLuaScript(luaScript.readAll());