From a93e6c12fbf8a0b05bd2db820a41aa2e1182c143 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 13 Sep 2023 20:19:04 +0300 Subject: autorun selected script after login --- indra/newview/llluamanager.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'indra/newview/llluamanager.cpp') diff --git a/indra/newview/llluamanager.cpp b/indra/newview/llluamanager.cpp index edfd5c3cad..df5011597b 100644 --- a/indra/newview/llluamanager.cpp +++ b/indra/newview/llluamanager.cpp @@ -253,3 +253,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); +} -- cgit v1.2.3