#4604 Warn user off high settings when on low-RAM hardware
parent
e23aa06049
commit
479fee984a
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -218,6 +218,7 @@ private:
|
|||
bool mGotPersonalInfo;
|
||||
bool mLanguageChanged;
|
||||
bool mAvatarDataInitialized;
|
||||
U32 mLastQualityLevel = 0;
|
||||
std::string mPriorInstantMessageLogPath;
|
||||
|
||||
bool mOriginalHideOnlineStatus;
|
||||
|
|
|
|||
|
|
@ -12145,6 +12145,17 @@ Cannot create large prims that intersect other residents. Please re-try when ot
|
|||
yestext="OK"/>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="PreferenceQualityWithLowMemory"
|
||||
type="alert">
|
||||
Your system has [TOTAL_MEM]MB of memory, which might not be enough to run viewer at higher settings and might result in issues.
|
||||
<usetemplate
|
||||
name="okcancelbuttons"
|
||||
notext="Cancel"
|
||||
yestext="Continue"/>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="DefaultObjectPermissions"
|
||||
|
|
|
|||
Loading…
Reference in New Issue