diff options
| author | Callum Prentice <callum@lindenlab.com> | 2025-08-29 14:51:08 -0700 |
|---|---|---|
| committer | Callum Prentice <callum@lindenlab.com> | 2025-08-29 14:51:08 -0700 |
| commit | db69b09d82e29ea98c216d84d394f602a72b8f93 (patch) | |
| tree | 7cb1481c15eb8f9dfbc12d6ed1424131c98264fa /indra/newview/llfloaterpreference.cpp | |
| parent | 87ec630053aadcb5b5f6104f7d083acf4609e2e9 (diff) | |
| parent | e77eb6b5316ce68fbc8bc03c4b06fe0f13b3443d (diff) | |
Merge branch 'develop' into callum/viewer-cef-2025-08
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
| -rw-r--r-- | indra/newview/llfloaterpreference.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index b74736a39d..291f22d78f 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -758,6 +758,7 @@ void LLFloaterPreference::onOpen(const LLSD& key) // Forget previous language changes. mLanguageChanged = false; + mLastQualityLevel = gSavedSettings.getU32("RenderQualityPerformance"); // Display selected maturity icons. onChangeMaturity(); @@ -1327,6 +1328,33 @@ void LLFloaterPreference::onCommitWindowedMode() void LLFloaterPreference::onChangeQuality(const LLSD& data) { U32 level = (U32)(data.asReal()); + constexpr U32 LVL_HIGH = 4; + if (level >= LVL_HIGH && mLastQualityLevel < level) + { + constexpr U32 LOW_MEM_THRESHOLD = 4097; + U32 total_mem = (U32Megabytes)LLMemory::getMaxMemKB(); + if (total_mem < LOW_MEM_THRESHOLD) + { + LLSD args; + args["TOTAL_MEM"] = LLSD::Integer(total_mem); + LLNotificationsUtil::add("PreferenceQualityWithLowMemory", args, LLSD(), [this](const LLSD& notification, const LLSD& response) + { + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + // If cancel pressed + if (option == 1) + { + constexpr U32 LVL_MED_PLUS = 3; + gSavedSettings.setU32("RenderQualityPerformance", LVL_MED_PLUS); + mLastQualityLevel = LVL_MED_PLUS; + LLFeatureManager::getInstance()->setGraphicsLevel(LVL_MED_PLUS, true); + refreshEnabledGraphics(); + refresh(); + } + } + ); + } + } + mLastQualityLevel = level; LLFeatureManager::getInstance()->setGraphicsLevel(level, true); refreshEnabledGraphics(); refresh(); |
