Removing debug output from lua scripts for release builds.
This commit is contained in:
parent
48d9f173f3
commit
857fc76c40
@ -6,7 +6,7 @@ if(global.triggeredSCRIPTNAMEUndo == nil) then
|
||||
global.triggeredSCRIPTNAMEUndo = false
|
||||
end
|
||||
|
||||
function trigger(objectToChange)
|
||||
function trigger(objectToChange, printDebug)
|
||||
if(global.triggeredSCRIPTNAME == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -16,11 +16,13 @@ function trigger(objectToChange)
|
||||
--enter the scripts code here and replace all occurences of SCRIPTNAME with the name of the script.
|
||||
|
||||
global.triggeredSCRIPTNAME = true
|
||||
print("SCRIPTNAME")
|
||||
if(printDebug) then
|
||||
print("SCRIPTNAME")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function triggerUndo(objectToChange)
|
||||
function triggerUndo(objectToChange, printDebug)
|
||||
if(global.triggeredSCRIPTNAMEUndo == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -30,6 +32,8 @@ function triggerUndo(objectToChange)
|
||||
--enter the scripts undo code here
|
||||
|
||||
global.triggeredSCRIPTNAMEUndo = true
|
||||
print("SCRIPTNAMEUndo")
|
||||
if(printDebug) then
|
||||
print("SCRIPTNAMEUndo")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -3,13 +3,15 @@ if(global.triggeredFristCheckpoint == nil) then
|
||||
global.triggeredFristCheckpoint = false
|
||||
end
|
||||
|
||||
function trigger(objectToChange)
|
||||
function trigger(objectToChange, printDebug)
|
||||
if(global.triggeredFristCheckpoint == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
return
|
||||
end
|
||||
global.triggeredFristCheckpoint = true
|
||||
print("firstCheckpoint")
|
||||
if(printDebug) then
|
||||
print("firstCheckpoint")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ if(global.triggeredOpenFirstDoorUndo == nil) then
|
||||
global.triggeredOpenFirstDoorUndo = true
|
||||
end
|
||||
|
||||
function trigger(objectToChange)
|
||||
function trigger(objectToChange, printDebug)
|
||||
if(global.triggeredOpenFirstDoor == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -22,11 +22,13 @@ function trigger(objectToChange)
|
||||
global.triggeredOpenFirstDoorUndo = false
|
||||
|
||||
global.triggeredOpenFirstDoor = true
|
||||
print("openFirstDoor")
|
||||
if (printDebug) then
|
||||
print("openFirstDoor")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function triggerUndo(objectToChange)
|
||||
function triggerUndo(objectToChange, printDebug)
|
||||
if(global.triggeredOpenFirstDoorUndo == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -42,6 +44,8 @@ function triggerUndo(objectToChange)
|
||||
global.triggeredOpenFirstDoor = false
|
||||
|
||||
global.triggeredOpenFirstDoorUndo = true
|
||||
print("openFirstDoorUndo")
|
||||
if(printDebug) then
|
||||
print("openFirstDoorUndo")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ if(global.triggeredOpenSecondDoor1Undo == nil) then
|
||||
global.triggeredOpenSecondDoor1Undo = true
|
||||
end
|
||||
|
||||
function trigger(objectToChange)
|
||||
function trigger(objectToChange, printDebug)
|
||||
if(global.triggeredOpenSecondDoor1 == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -30,11 +30,13 @@ function trigger(objectToChange)
|
||||
local zPos = 54.5
|
||||
level:preloadLightPosition(xPos, yPos, zPos)
|
||||
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -2.0, 1.3, 2.0)
|
||||
print("openSecondDoor1")
|
||||
if(printDebug) then
|
||||
print("openSecondDoor1")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function triggerUndo(objectToChange)
|
||||
function triggerUndo(objectToChange, printDebug)
|
||||
if(global.triggeredOpenSecondDoor1Undo == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -49,6 +51,8 @@ function triggerUndo(objectToChange)
|
||||
level:deleteFourLights()
|
||||
|
||||
global.triggeredOpenSecondDoor1Undo = true
|
||||
print("openSecondDoor1Undo")
|
||||
if(printDebug) then
|
||||
print("openSecondDoor1Undo")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ if(global.triggeredOpenSecondDoor2Undo == nil) then
|
||||
global.triggeredOpenSecondDoor2Undo = true
|
||||
end
|
||||
|
||||
function trigger(objectToChange)
|
||||
function trigger(objectToChange, printDebug)
|
||||
if(global.triggeredOpenSecondDoor2 == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -30,11 +30,13 @@ function trigger(objectToChange)
|
||||
local zPos = 26.5
|
||||
level:preloadLightPosition(xPos, yPos, zPos)
|
||||
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -2.0, 1.3, 2.0)
|
||||
print("openSecondDoor2")
|
||||
if(printDebug) then
|
||||
print("openSecondDoor2")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function triggerUndo(objectToChange)
|
||||
function triggerUndo(objectToChange, printDebug)
|
||||
if(global.triggeredOpenSecondDoor2Undo == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -49,6 +51,8 @@ function triggerUndo(objectToChange)
|
||||
level:deleteFourLights()
|
||||
|
||||
global.triggeredOpenSecondDoor2Undo = true
|
||||
print("openSecondDoor2Undo")
|
||||
if(printDebug) then
|
||||
print("openSecondDoor2Undo")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ if(global.triggeredOpenSecondDoor3Undo == nil) then
|
||||
global.triggeredOpenSecondDoor3Undo = true
|
||||
end
|
||||
|
||||
function trigger(objectToChange)
|
||||
function trigger(objectToChange, printDebug)
|
||||
if(global.triggeredOpenSecondDoor3 == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -30,11 +30,13 @@ function trigger(objectToChange)
|
||||
local zPos = 26.5
|
||||
level:preloadLightPosition(xPos, yPos, zPos)
|
||||
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -2.0, 1.3, 2.0)
|
||||
print("openSecondDoor3")
|
||||
if(printDebug) then
|
||||
print("openSecondDoor3")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function triggerUndo(objectToChange)
|
||||
function triggerUndo(objectToChange, printDebug)
|
||||
if(global.triggeredOpenSecondDoor3Undo == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -49,6 +51,8 @@ function triggerUndo(objectToChange)
|
||||
level:deleteFourLights()
|
||||
|
||||
global.triggeredOpenSecondDoor3Undo = true
|
||||
print("openSecondDoor3Undo")
|
||||
if(printDebug) then
|
||||
print("openSecondDoor3Undo")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ if(global.triggeredOpenSecondDoor4Undo == nil) then
|
||||
global.triggeredOpenSecondDoor4Undo = true
|
||||
end
|
||||
|
||||
function trigger(objectToChange)
|
||||
function trigger(objectToChange, printDebug)
|
||||
if(global.triggeredOpenSecondDoor4 == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -39,11 +39,13 @@ function trigger(objectToChange)
|
||||
local zPos = 54.5
|
||||
level:preloadLightPosition(xPos, yPos, zPos)
|
||||
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -2.0, 1.3, 2.0)
|
||||
print("openSecondDoor4")
|
||||
if(printDebug) then
|
||||
print("openSecondDoor4")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function triggerUndo(objectToChange)
|
||||
function triggerUndo(objectToChange, printDebug)
|
||||
if(global.triggeredOpenSecondDoor4Undo == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -58,6 +60,8 @@ function triggerUndo(objectToChange)
|
||||
level:deleteFourLights()
|
||||
|
||||
global.triggeredOpenSecondDoor4Undo = true
|
||||
print("openSecondDoor4Undo")
|
||||
if(printDebug) then
|
||||
print("openSecondDoor4Undo")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ if(global.triggeredOpenThirdDoorUndo == nil) then
|
||||
global.triggeredOpenThirdDoorUndo = true
|
||||
end
|
||||
|
||||
function trigger(objectToChange)
|
||||
function trigger(objectToChange, printDebug)
|
||||
if(global.triggeredOpenThirdDoor == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -22,11 +22,13 @@ function trigger(objectToChange)
|
||||
global.triggeredOpenThirdDoorUndo = false
|
||||
|
||||
global.triggeredOpenThirdDoor = true
|
||||
print("openThirdDoor")
|
||||
if(printDebug) then
|
||||
print("openThirdDoor")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function triggerUndo(objectToChange)
|
||||
function triggerUndo(objectToChange, printDebug)
|
||||
if(global.triggeredOpenThirdDoorUndo == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -42,6 +44,8 @@ function triggerUndo(objectToChange)
|
||||
global.triggeredOpenThirdDoor = false
|
||||
|
||||
global.triggeredOpenThirdDoorUndo = true
|
||||
print("openThirdDoorUndo")
|
||||
if(printDebug) then
|
||||
print("openThirdDoorUndo")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ if(global.triggeredResetBox == nil) then
|
||||
global.triggeredResetBox = false
|
||||
end
|
||||
|
||||
function trigger(objectToChange)
|
||||
function trigger(objectToChange, printDebug)
|
||||
if(global.triggeredResetBox == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -14,6 +14,8 @@ function trigger(objectToChange)
|
||||
local z =8.5
|
||||
level:forceMove(x, y, z, objectToChange)
|
||||
|
||||
print("reset box")
|
||||
if(printDebug) then
|
||||
print("reset box")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ if(global.triggeredResetPlayer == nil) then
|
||||
global.triggeredResetPlayer = false
|
||||
end
|
||||
|
||||
function trigger(objectToChange)
|
||||
function trigger(objectToChange, printDebug)
|
||||
if(global.triggeredResetPlayer == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -28,6 +28,8 @@ function trigger(objectToChange)
|
||||
level:resetPlayer()
|
||||
end
|
||||
|
||||
print("reset player")
|
||||
if(printDebug) then
|
||||
print("reset player")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ if(global.triggeredSunStart == nil) then
|
||||
global.triggeredSunStart = false
|
||||
end
|
||||
|
||||
function trigger(objectToChange)
|
||||
function trigger(objectToChange, printDebug)
|
||||
if(global.triggeredSunStart == false) then
|
||||
if(not level) then
|
||||
print("No level found in Lua!")
|
||||
@ -14,6 +14,8 @@ function trigger(objectToChange)
|
||||
global.sunStartTime = time
|
||||
global.triggeredSunStart = true
|
||||
level:activateEndgame()
|
||||
print("sunStart")
|
||||
if(printDebug) then
|
||||
print("sunStart")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -27,6 +27,11 @@ Trigger::~Trigger(){
|
||||
}
|
||||
|
||||
void Trigger::triggerUpdate(){
|
||||
#ifdef SAXUM_DEBUG
|
||||
bool printDebug = true;
|
||||
#else
|
||||
bool printDebug = false;
|
||||
#endif
|
||||
if (isBigger && (glm::distance(object->getPosition(), position) > distance)) {
|
||||
int error = luaL_dofile(luaState, luaScript.c_str());
|
||||
if (error != 0) {
|
||||
@ -34,9 +39,9 @@ void Trigger::triggerUpdate(){
|
||||
exit(-1);
|
||||
}
|
||||
if (undo){
|
||||
luabridge::getGlobal(luaState, "triggerUndo")(objectToChange);
|
||||
luabridge::getGlobal(luaState, "triggerUndo")(objectToChange, printDebug);
|
||||
}else{
|
||||
luabridge::getGlobal(luaState, "trigger")(objectToChange);
|
||||
luabridge::getGlobal(luaState, "trigger")(objectToChange, printDebug);
|
||||
}
|
||||
}
|
||||
else if (!isBigger && (glm::distance(object->getPosition(), position) < distance)) {
|
||||
@ -46,9 +51,9 @@ void Trigger::triggerUpdate(){
|
||||
exit(-1);
|
||||
}
|
||||
if (undo){
|
||||
luabridge::getGlobal(luaState, "triggerUndo")(objectToChange);
|
||||
luabridge::getGlobal(luaState, "triggerUndo")(objectToChange, printDebug);
|
||||
}else{
|
||||
luabridge::getGlobal(luaState, "trigger")(objectToChange);
|
||||
luabridge::getGlobal(luaState, "trigger")(objectToChange, printDebug);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user