summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2023-09-14 20:44:12 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2023-09-14 20:44:12 +0100
commit110e442bc335b88fc3e52ea83f52cb46514dd0a7 (patch)
treef92fe3fc3652d2c160a60f94a2650e7af1b26e86 /indra/newview
parent1d5db5e5926954b9f22469cd736d6cfb396491f4 (diff)
parenta93e6c12fbf8a0b05bd2db820a41aa2e1182c143 (diff)
Merge branch 'DRTVWR-589' of github.com:/secondlife/viewer-private into DRTVWR-589
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llluamanager.cpp19
-rw-r--r--indra/newview/llluamanager.h2
-rw-r--r--indra/newview/llstartup.cpp3
4 files changed, 35 insertions, 0 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 816b7b7c92..cc9740d934 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -17063,6 +17063,17 @@
<key>Value</key>
<integer>3</integer>
</map>
+ <key>AutorunLuaScriptName</key>
+ <map>
+ <key>Comment</key>
+ <string>Script name to autorun after login.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string>default.lua</string>
+ </map>
<key>ResetUIScaleOnFirstRun</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llluamanager.cpp b/indra/newview/llluamanager.cpp
index b251ebb6d5..7045379964 100644
--- a/indra/newview/llluamanager.cpp
+++ b/indra/newview/llluamanager.cpp
@@ -271,3 +271,22 @@ void LLLUAmanager::runScriptLine(const std::string &cmd, script_finished_fn cb)
}
});
}
+
+void LLLUAmanager::runScriptOnLogin()
+{
+ std::string filename = gSavedSettings.getString("AutorunLuaScriptName");
+ if (filename.empty())
+ {
+ LL_INFOS() << "Script name wasn't set." << LL_ENDL;
+ return;
+ }
+
+ filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename);
+ if (!gDirUtilp->fileExists(filename))
+ {
+ LL_INFOS() << filename << " was not found." << LL_ENDL;
+ return;
+ }
+
+ runScriptFile(filename);
+}
diff --git a/indra/newview/llluamanager.h b/indra/newview/llluamanager.h
index 5bdf58bd3d..4581c33ff2 100644
--- a/indra/newview/llluamanager.h
+++ b/indra/newview/llluamanager.h
@@ -34,6 +34,8 @@ public:
static void runScriptFile(const std::string &filename, script_finished_fn cb = script_finished_fn());
static void runScriptLine(const std::string &cmd, script_finished_fn cb = script_finished_fn());
+
+ static void runScriptOnLogin();
};
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 1b0a814c45..748c79f9d6 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -207,6 +207,7 @@
#include "llstacktrace.h"
#include "threadpool.h"
+#include "llluamanager.h"
#include "llperfstats.h"
@@ -2361,6 +2362,8 @@ bool idle_startup()
LLPerfStats::StatsRecorder::setAutotuneInit();
+ LLLUAmanager::runScriptOnLogin();
+
return TRUE;
}