mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-11 05:59:57 -06:00
Introduced fadeIn and fadeOut functionality via scripting.
This commit is contained in:
@@ -260,15 +260,19 @@ void ScriptEngine::addLibrary(LuaLibrary library) {
|
||||
}
|
||||
|
||||
bool ScriptEngine::runScript(const std::string& script) {
|
||||
if (script.empty())
|
||||
return false;
|
||||
if (script.empty()){
|
||||
LWARNING("Script was empty");
|
||||
return false;
|
||||
}
|
||||
|
||||
int status = luaL_loadstring(_state, script.c_str());
|
||||
if (status != LUA_OK) {
|
||||
LERROR("Error loading script: '" << lua_tostring(_state, -1) << "'");
|
||||
return false;
|
||||
}
|
||||
|
||||
//LDEBUG("Executing script");
|
||||
LDEBUG("Executing script");
|
||||
LINFO(script);
|
||||
if (lua_pcall(_state, 0, LUA_MULTRET, 0)) {
|
||||
LERROR("Error executing script: " << lua_tostring(_state, -1));
|
||||
return false;
|
||||
@@ -608,6 +612,7 @@ bool ScriptEngine::writeDocumentation(const std::string& filename, const std::st
|
||||
|
||||
void ScriptEngine::serialize(SyncBuffer* syncBuffer){
|
||||
syncBuffer->encode(_currentSyncedScript);
|
||||
_currentSyncedScript.clear();
|
||||
}
|
||||
|
||||
void ScriptEngine::deserialize(SyncBuffer* syncBuffer){
|
||||
|
||||
Reference in New Issue
Block a user