StelScriptMgr.cpp   StelScriptMgr.cpp 
skipping to change at line 335 skipping to change at line 335
scriptFileName = fileName; scriptFileName = fileName;
if (!includePath.isEmpty()) if (!includePath.isEmpty())
scriptDir = includePath; scriptDir = includePath;
// Seed the PRNG so that script random numbers aren't always the sam e sequence // Seed the PRNG so that script random numbers aren't always the sam e sequence
qsrand(QDateTime::currentDateTime().toTime_t()); qsrand(QDateTime::currentDateTime().toTime_t());
// Make sure that the gui object have been completely initialized (t here used to be problems with startup scripts). // Make sure that the gui object have been completely initialized (t here used to be problems with startup scripts).
Q_ASSERT(StelApp::getInstance().getGui()); Q_ASSERT(StelApp::getInstance().getGui());
savedTimeRate = StelApp::getInstance().getCore()->getNavigator()->ge tTimeRate();
engine.globalObject().setProperty("scriptRateReadOnly", 1.0); engine.globalObject().setProperty("scriptRateReadOnly", 1.0);
// Notify that the script starts here although we still have to prep rocess it. // Notify that the script starts here although we still have to prep rocess it.
emit(scriptRunning()); emit(scriptRunning());
QString preprocessedScript; QString preprocessedScript;
bool ok=false; bool ok=false;
if (fileName.endsWith(".ssc")) if (fileName.endsWith(".ssc"))
ok = preprocessScript(fic, preprocessedScript, scriptDir); ok = preprocessScript(fic, preprocessedScript, scriptDir);
#ifdef ENABLE_STRATOSCRIPT_COMPAT #ifdef ENABLE_STRATOSCRIPT_COMPAT
skipping to change at line 413 skipping to change at line 412
void StelScriptMgr::scriptEnded() void StelScriptMgr::scriptEnded()
{ {
if (engine.hasUncaughtException()) if (engine.hasUncaughtException())
{ {
QString msg = QString("script error: \"%1\" @ line %2").arg( engine.uncaughtException().toString()).arg(engine.uncaughtExceptionLineNumb er()); QString msg = QString("script error: \"%1\" @ line %2").arg( engine.uncaughtException().toString()).arg(engine.uncaughtExceptionLineNumb er());
emit(scriptDebug(msg)); emit(scriptDebug(msg));
qWarning() << msg; qWarning() << msg;
} }
// reset time rate to non-scaped script rates... TODO
StelNavigator* nav = StelApp::getInstance().getCore()->getNavigator(
);
nav->setTimeRate(savedTimeRate);
GETSTELMODULE(StelMovementMgr)->setMovementSpeedFactor(1.0); GETSTELMODULE(StelMovementMgr)->setMovementSpeedFactor(1.0);
emit(scriptStopped()); emit(scriptStopped());
} }
QMap<QString, QString> StelScriptMgr::mappify(const QStringList& args, bool lowerKey) QMap<QString, QString> StelScriptMgr::mappify(const QStringList& args, bool lowerKey)
{ {
QMap<QString, QString> map; QMap<QString, QString> map;
for(int i=0; i+1<args.size(); i++) for(int i=0; i+1<args.size(); i++)
if (lowerKey) if (lowerKey)
map[args.at(i).toLower()] = args.at(i+1); map[args.at(i).toLower()] = args.at(i+1);
 End of changes. 2 change blocks. 
5 lines changed or deleted 0 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/