mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 19:04:32 +02:00
Update loadScript to optionally activate main window
This commit is contained in:
parent
4115e0fab2
commit
2eeb3f5f2f
2 changed files with 3 additions and 3 deletions
|
@ -3412,7 +3412,7 @@ void Application::saveScripts() {
|
|||
_settings->endArray();
|
||||
}
|
||||
|
||||
ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScriptFromEditor) {
|
||||
ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScriptFromEditor, bool activateMainWindow) {
|
||||
if(loadScriptFromEditor && _scriptEnginesHash.contains(scriptName) && !_scriptEnginesHash[scriptName]->isFinished()){
|
||||
return _scriptEnginesHash[scriptName];
|
||||
}
|
||||
|
@ -3486,7 +3486,7 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScript
|
|||
workerThread->start();
|
||||
|
||||
// restore the main window's active state
|
||||
if (!loadScriptFromEditor) {
|
||||
if (activateMainWindow && !loadScriptFromEditor) {
|
||||
_window->activateWindow();
|
||||
}
|
||||
bumpSettings();
|
||||
|
|
|
@ -303,7 +303,7 @@ public slots:
|
|||
void loadScriptURLDialog();
|
||||
void toggleLogDialog();
|
||||
void initAvatarAndViewFrustum();
|
||||
ScriptEngine* loadScript(const QString& fileNameString, bool loadScriptFromEditor = false);
|
||||
ScriptEngine* loadScript(const QString& fileNameString, bool loadScriptFromEditor = false, bool activateMainWindow = false);
|
||||
void scriptFinished(const QString& scriptName);
|
||||
void stopAllScripts(bool restart = false);
|
||||
void stopScript(const QString& scriptName);
|
||||
|
|
Loading…
Reference in a new issue