From 9971c42963bf1c7ed52dcb04a6d3ceccd3fb4630 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 18 Oct 2017 14:36:40 +0200 Subject: [PATCH] Surprise! Viewer wasn't using downloaded OpenSim script library files... --- indra/newview/llpreviewscript.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 0ef611aae8..ab6b9635fb 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -631,12 +631,36 @@ void LLScriptEdCore::processKeywords() LLColor3 color(LLUIColorTable::instance().getColor("SyntaxLslFunction")); if (gSavedSettings.getBOOL("_NACL_LSLPreprocessor")) + { mEditor->loadKeywords(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "scriptlibrary_preproc.xml"), funcs, tooltips, color); + } + #ifdef OPENSIM if (LLGridManager::getInstance()->isInOpenSim()) - mEditor->loadKeywords(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "scriptlibrary_ossl.xml"), funcs, tooltips, color); + { + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "scriptlibrary_ossl.xml"); + if (LLFile::isfile(filename)) + { + mEditor->loadKeywords(filename, funcs, tooltips, color); + } + else + { + mEditor->loadKeywords(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "scriptlibrary_ossl.xml"), funcs, tooltips, color); + } + } + if (LLGridManager::getInstance()->isInAuroraSim()) - mEditor->loadKeywords(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "scriptlibrary_aa.xml"), funcs, tooltips, color); + { + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "scriptlibrary_aa.xml"); + if (LLFile::isfile(filename)) + { + mEditor->loadKeywords(filename, funcs, tooltips, color); + } + else + { + mEditor->loadKeywords(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "scriptlibrary_aa.xml"), funcs, tooltips, color); + } + } #endif // OPENSIM //