SL-15923 increase the shortcut level to the minimum required when clicking advanced lighting or shadows settings

master
Mnikolenko Productengine 2022-02-04 12:46:23 +02:00
parent 817f764edc
commit 7af2d51f57
3 changed files with 84 additions and 3 deletions

View File

@ -32,6 +32,7 @@
#include "llavataractions.h"
#include "llavatarrendernotifier.h"
#include "llcheckboxctrl.h"
#include "llcombobox.h"
#include "llfeaturemanager.h"
#include "llfloaterpreference.h" // LLAvatarComplexityControls
#include "llfloaterreg.h"
@ -120,6 +121,8 @@ BOOL LLFloaterPerformance::postBuild()
mSettingsPanel->getChild<LLButton>("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this));
mSettingsPanel->getChild<LLRadioGroup>("graphics_quality")->setCommitCallback(boost::bind(&LLFloaterPerformance::onChangeQuality, this, _2));
mSettingsPanel->getChild<LLCheckBoxCtrl>("advanced_lighting_model")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::onClickAdvancedLighting, this));
mSettingsPanel->getChild<LLComboBox>("ShadowDetail")->setMouseDownCallback(boost::bind(&LLFloaterPerformance::onClickShadows, this));
mNearbyPanel->getChild<LLButton>("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this));
mNearbyPanel->getChild<LLCheckBoxCtrl>("hide_avatars")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickHideAvatars, this));
@ -540,4 +543,56 @@ void LLFloaterPerformance::onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y)
}
}
const U32 RENDER_QUALITY_LEVEL = 3;
void LLFloaterPerformance::changeQualityLevel(const std::string& notif)
{
LLNotificationsUtil::add(notif, LLSD(), LLSD(),
[](const LLSD&notif, const LLSD&resp)
{
S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp);
if (opt == 0)
{
LLFloaterPreference* instance = LLFloaterReg::getTypedInstance<LLFloaterPreference>("preferences");
if (instance)
{
gSavedSettings.setU32("RenderQualityPerformance", RENDER_QUALITY_LEVEL);
instance->onChangeQuality(LLSD((S32)RENDER_QUALITY_LEVEL));
}
}
});
}
bool is_ALM_available()
{
bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump");
bool shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders");
return LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
bumpshiny &&
shaders &&
gGLManager.mHasFramebufferObject;
}
void LLFloaterPerformance::onClickAdvancedLighting()
{
if (!is_ALM_available())
{
changeQualityLevel("AdvancedLightingConfirm");
}
}
void LLFloaterPerformance::onClickShadows()
{
if (gSavedSettings.getBOOL("AutoFPS"))
{
LLFloaterPreference::showAutoAdjustWarning();
}
else
{
if (!is_ALM_available() || !gSavedSettings.getBOOL("RenderDeferred"))
{
changeQualityLevel("ShadowsConfirm");
}
}
}
// EOF

View File

@ -62,10 +62,14 @@ private:
void onChangeQuality(const LLSD& data);
void onClickHideAvatars();
void onClickExceptions();
void onClickShadows();
void onClickAdvancedLighting();
void updateMaxComplexity();
void updateComplexityText();
static void changeQualityLevel(const std::string& notif);
LLPanel* mMainPanel;
LLPanel* mNearbyPanel;
LLPanel* mComplexityPanel;

View File

@ -1848,9 +1848,9 @@ Graphics Quality can be raised in Preferences &gt; Graphics.
</notification>
<notification
icon="alertmodal.tga"
name="AutoFPSConfirmDisable"
type="alertmodal">
icon="alertmodal.tga"
name="AutoFPSConfirmDisable"
type="alertmodal">
Changing this setting will disable automatic adjustment and turn off 'Auto FPS' setting.
Are you sure you want to continue?
<tag>confirm</tag>
@ -1859,6 +1859,28 @@ Are you sure you want to continue?
notext="Cancel"
yestext="Continue"/>
</notification>
<notification
icon="alertmodal.tga"
name="AdvancedLightingConfirm"
type="alertmodal">
To turn on advanced lighting, we need to increase quality to level 4.
<tag>confirm</tag>
<usetemplate
name="okcancelbuttons"
notext="Cancel"
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
name="ShadowsConfirm"
type="alertmodal">
To enable shadows, we need to increase quality to level 4.
<tag>confirm</tag>
<usetemplate
name="okcancelbuttons"
notext="Cancel"
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"