From 130e915007d3b95412abf1dc069adfb87a5e372c Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 21 Jul 2021 18:10:25 +0300 Subject: SL-15297 toolbar button is added & changing quality via radio group is handled correctly now --- indra/newview/app_settings/commands.xml | 10 ++++++++++ indra/newview/llfloaterperformance.cpp | 17 ++++++++++++++--- indra/newview/llfloaterperformance.h | 1 + indra/newview/skins/default/textures/textures.xml | 1 + .../default/textures/toolbar_icons/performance.png | Bin 0 -> 451 bytes indra/newview/skins/default/xui/en/strings.xml | 2 ++ 6 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 indra/newview/skins/default/textures/toolbar_icons/performance.png diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index d0480ca47e..b0629938a9 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -276,4 +276,14 @@ is_running_function="Floater.IsOpen" is_running_parameters="my_environments" /> + diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp index d7c0527b5c..dca19e0e28 100644 --- a/indra/newview/llfloaterperformance.cpp +++ b/indra/newview/llfloaterperformance.cpp @@ -36,6 +36,7 @@ #include "llfloaterpreference.h" // LLAvatarComplexityControls #include "llfloaterreg.h" #include "llnamelistctrl.h" +#include "llradiogroup.h" #include "llsliderctrl.h" #include "lltextbox.h" #include "lltrans.h" @@ -114,6 +115,7 @@ BOOL LLFloaterPerformance::postBuild() mObjectList->setIconClickedCallback(boost::bind(&LLFloaterPerformance::detachItem, this, _1)); mSettingsPanel->getChild("advanced_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickAdvanced, this)); + mSettingsPanel->getChild("graphics_quality")->setCommitCallback(boost::bind(&LLFloaterPerformance::onChangeQuality, this, _2)); mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickExceptions, this)); mNearbyPanel->getChild("hide_avatars")->setCommitCallback(boost::bind(&LLFloaterPerformance::onClickHideAvatars, this)); @@ -220,7 +222,7 @@ void LLFloaterPerformance::populateHUDList() for (iter = complexity_list.begin(); iter != end; ++iter) { LLHUDComplexity hud_object_complexity = *iter; - S32 obj_cost_short = hud_object_complexity.objectsCost / 1000; + S32 obj_cost_short = llmax((S32)hud_object_complexity.objectsCost / 1000, 1); LLSD item; item["special_id"] = hud_object_complexity.objectId; item["target"] = LLNameListCtrl::SPECIAL; @@ -279,7 +281,7 @@ void LLFloaterPerformance::populateObjectList() for (iter = complexity_list.begin(); iter != end; ++iter) { LLObjectComplexity object_complexity = *iter; - S32 obj_cost_short = object_complexity.objectCost / 1000; + S32 obj_cost_short = llmax((S32)object_complexity.objectCost / 1000, 1); LLSD item; item["special_id"] = object_complexity.objectId; item["target"] = LLNameListCtrl::SPECIAL; @@ -334,7 +336,7 @@ void LLFloaterPerformance::populateNearbyList() LLVOAvatar* avatar = dynamic_cast(*char_iter); if (avatar && (LLVOAvatar::AOA_INVISIBLE != avatar->getOverallAppearance())) { - S32 complexity_short = avatar->getVisualComplexity() / 1000; + S32 complexity_short = llmax((S32)avatar->getVisualComplexity() / 1000, 1);; LLSD item; item["id"] = avatar->getID(); LLSD& row = item["columns"]; @@ -439,6 +441,15 @@ void LLFloaterPerformance::onClickAdvanced() LLFloaterReg::showInstance("prefs_graphics_advanced"); } +void LLFloaterPerformance::onChangeQuality(const LLSD& data) +{ + LLFloaterPreference* instance = LLFloaterReg::getTypedInstance("preferences"); + if (instance) + { + instance->onChangeQuality(data); + } +} + void LLFloaterPerformance::onClickHideAvatars() { LLPipeline::toggleRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR); diff --git a/indra/newview/llfloaterperformance.h b/indra/newview/llfloaterperformance.h index 58f9447d4c..a5549685f6 100644 --- a/indra/newview/llfloaterperformance.h +++ b/indra/newview/llfloaterperformance.h @@ -59,6 +59,7 @@ private: void populateNearbyList(); void onClickAdvanced(); + void onChangeQuality(const LLSD& data); void onClickHideAvatars(); void onClickExceptions(); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 03878d9fe7..cf5be9afa5 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -151,6 +151,7 @@ with the same filename but different name + diff --git a/indra/newview/skins/default/textures/toolbar_icons/performance.png b/indra/newview/skins/default/textures/toolbar_icons/performance.png new file mode 100644 index 0000000000..91baf849c8 Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/performance.png differ diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index db6fbfe362..edf904226e 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4143,6 +4143,7 @@ Try enclosing path to the editor with double quotes. Mini-map Walk / run / fly People + Graphics speed Picks Places Preferences @@ -4173,6 +4174,7 @@ Try enclosing path to the editor with double quotes. Show nearby people Moving your avatar Friends, groups, and nearby people + Improve graphics speed Places to show as favorites in your profile Places you've saved Preferences -- cgit v1.2.3