Skip to content

Commit

Permalink
qtscript: Add function useSafetyTransport(bool)
Browse files Browse the repository at this point in the history
Function addSafetyTransport(bool) is used to change the default behavior of the mission transport by allowing multiple droid loads on non off-world missions. setReinforcementTime() is used to change the delay between when the transport vanishes and appears again.
  • Loading branch information
KJeff01 committed Aug 1, 2017
1 parent bd2bac6 commit d511cad
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/qtscriptfuncs.cpp
Expand Up @@ -2681,6 +2681,17 @@ static QScriptValue js_startTransporterEntry(QScriptContext *context, QScriptEng
return QScriptValue();
}

//-- \subsection{useSafetyTransport(flag)}
//-- Change if the mission transporter will fetch droids in non offworld missions
//-- setReinforcementTime() is be used to hide it before coming back after the set time
//-- which is handled by the campaign library in the victory data section (3.2.4+ only).
static QScriptValue js_useSafetyTransport(QScriptContext *context, QScriptEngine *)
{
bool flag = context->argument(0).toBool();
setDroidsToSafetyFlag(flag);
return QScriptValue();
}

//-- \subsection{setReinforcementTime(time)} Set time for reinforcements to arrive. If time is
//-- negative, the reinforcement GUI is removed and the timer stopped. Time is in seconds.
//-- If time equals to the magic LZ_COMPROMISED_TIME constant, reinforcement GUI ticker
Expand Down Expand Up @@ -5365,6 +5376,7 @@ bool registerFunctions(QScriptEngine *engine, const QString& scriptName)
engine->globalObject().setProperty("replaceTexture", engine->newFunction(js_replaceTexture));
engine->globalObject().setProperty("changePlayerColour", engine->newFunction(js_changePlayerColour));
engine->globalObject().setProperty("setHealth", engine->newFunction(js_setHealth));
engine->globalObject().setProperty("useSafetyTransport", engine->newFunction(js_useSafetyTransport));

// horrible hacks follow -- do not rely on these being present!
engine->globalObject().setProperty("hackNetOff", engine->newFunction(js_hackNetOff));
Expand Down

0 comments on commit d511cad

Please sign in to comment.