summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2021-06-25 20:05:07 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2021-06-25 20:05:07 +0300
commit74c6580e5c3507ef72590a3543e2b0b2ee9c13a3 (patch)
tree1abb5c7f1cd19e4b8b75f2f87ea4203013aa1718 /indra
parentf6a5bda34b4c574cf198c6c2b4131c18d3b68fc0 (diff)
SL-15297 WIP restore selection after updating the list & don't show avatars in the list as disabled when complexity is not limited
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llscrolllistcell.cpp2
-rw-r--r--indra/newview/llfloaterperformance.cpp14
-rw-r--r--indra/newview/llnamelistctrl.cpp28
-rw-r--r--indra/newview/llnamelistctrl.h3
-rw-r--r--indra/newview/skins/default/colors.xml5
-rw-r--r--indra/newview/skins/default/xui/en/floater_add_payment_method.xml2
-rw-r--r--indra/newview/skins/default/xui/en/floater_performance.xml12
7 files changed, 50 insertions, 16 deletions
diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp
index 50f0f5f820..c5f53823f3 100644
--- a/indra/llui/llscrolllistcell.cpp
+++ b/indra/llui/llscrolllistcell.cpp
@@ -54,7 +54,7 @@ LLScrollListCell* LLScrollListCell::create(const LLScrollListCell::Params& cell_
{
cell = new LLScrollListIconText(cell_p);
}
- else if (cell_p.type() == "image")
+ else if (cell_p.type() == "bar")
{
cell = new LLScrollListBar(cell_p);
}
diff --git a/indra/newview/llfloaterperformance.cpp b/indra/newview/llfloaterperformance.cpp
index beeebcb202..b8adf7fedc 100644
--- a/indra/newview/llfloaterperformance.cpp
+++ b/indra/newview/llfloaterperformance.cpp
@@ -190,6 +190,7 @@ void LLFloaterPerformance::initBackBtn(LLPanel* panel)
void LLFloaterPerformance::populateHUDList()
{
S32 prev_pos = mHUDList->getScrollPos();
+ LLUUID prev_selected_id = mHUDList->getSelectedSpecialId();
mHUDList->clearRows();
mHUDList->updateColumns(true);
@@ -213,7 +214,7 @@ void LLFloaterPerformance::populateHUDList()
item["target"] = LLNameListCtrl::SPECIAL;
LLSD& row = item["columns"];
row[0]["column"] = "complex_visual";
- row[0]["type"] = "image";
+ row[0]["type"] = "bar";
LLSD& value = row[0]["value"];
value["ratio"] = (F32)hud_object_complexity.objectsCost / max_complexity;
value["bottom"] = BAR_BOTTOM_PAD;
@@ -234,6 +235,7 @@ void LLFloaterPerformance::populateHUDList()
}
mHUDList->sortByColumnIndex(1, FALSE);
mHUDList->setScrollPos(prev_pos);
+ mHUDList->selectItemBySpecialId(prev_selected_id);
mHUDsPanel->getChild<LLTextBox>("huds_value")->setValue(std::to_string(complexity_list.size()));
}
@@ -241,6 +243,7 @@ void LLFloaterPerformance::populateHUDList()
void LLFloaterPerformance::populateObjectList()
{
S32 prev_pos = mObjectList->getScrollPos();
+ LLUUID prev_selected_id = mObjectList->getSelectedSpecialId();
mObjectList->clearRows();
mObjectList->updateColumns(true);
@@ -264,7 +267,7 @@ void LLFloaterPerformance::populateObjectList()
item["target"] = LLNameListCtrl::SPECIAL;
LLSD& row = item["columns"];
row[0]["column"] = "complex_visual";
- row[0]["type"] = "image";
+ row[0]["type"] = "bar";
LLSD& value = row[0]["value"];
value["ratio"] = (F32)object_complexity.objectCost / max_complexity;
value["bottom"] = BAR_BOTTOM_PAD;
@@ -285,11 +288,13 @@ void LLFloaterPerformance::populateObjectList()
}
mObjectList->sortByColumnIndex(1, FALSE);
mObjectList->setScrollPos(prev_pos);
+ mObjectList->selectItemBySpecialId(prev_selected_id);
}
void LLFloaterPerformance::populateNearbyList()
{
S32 prev_pos = mNearbyList->getScrollPos();
+ LLUUID prev_selected_id = mNearbyList->getStringUUIDSelectedItem();
mNearbyList->clearRows();
mNearbyList->updateColumns(true);
@@ -307,7 +312,7 @@ void LLFloaterPerformance::populateNearbyList()
item["id"] = avatar->getID();
LLSD& row = item["columns"];
row[0]["column"] = "complex_visual";
- row[0]["type"] = "image";
+ row[0]["type"] = "bar";
LLSD& value = row[0]["value"];
value["ratio"] = (F32)avatar->getVisualComplexity() / mNearbyMaxComplexity;
value["bottom"] = BAR_BOTTOM_PAD;
@@ -331,7 +336,7 @@ void LLFloaterPerformance::populateNearbyList()
if (name_text)
{
std::string color = "white";
- if (avatar->getVisualComplexity() > max_render_cost)
+ if ((max_render_cost != 0) && (avatar->getVisualComplexity() > max_render_cost))
{
color = "LabelDisabledColor";
LLScrollListBar* bar = dynamic_cast<LLScrollListBar*>(av_item->getColumn(0));
@@ -352,6 +357,7 @@ void LLFloaterPerformance::populateNearbyList()
}
mNearbyList->sortByColumnIndex(1, FALSE);
mNearbyList->setScrollPos(prev_pos);
+ mNearbyList->selectByID(prev_selected_id);
}
void LLFloaterPerformance::getNearbyAvatars(std::vector<LLCharacter*> &valid_nearby_avs)
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index e1bf9b1a17..92805e03f0 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -464,6 +464,34 @@ LLScrollListItem* LLNameListCtrl::getNameItemByAgentId(const LLUUID& agent_id)
return NULL;
}
+void LLNameListCtrl::selectItemBySpecialId(const LLUUID& special_id)
+{
+ if (special_id.isNull())
+ {
+ return;
+ }
+
+ for (item_list::iterator it = getItemList().begin(); it != getItemList().end(); it++)
+ {
+ LLNameListItem* item = dynamic_cast<LLNameListItem*>(*it);
+ if (item && item->getSpecialID() == special_id)
+ {
+ item->setSelected(TRUE);
+ break;
+ }
+ }
+}
+
+LLUUID LLNameListCtrl::getSelectedSpecialId()
+{
+ LLNameListItem* item = dynamic_cast<LLNameListItem*>(getFirstSelected());
+ if(item)
+ {
+ return item->getSpecialID();
+ }
+ return LLUUID();
+}
+
void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name,
std::string suffix,
diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h
index 1a31b1cc10..d7e991c94d 100644
--- a/indra/newview/llnamelistctrl.h
+++ b/indra/newview/llnamelistctrl.h
@@ -162,6 +162,9 @@ public:
LLScrollListItem* getNameItemByAgentId(const LLUUID& agent_id);
+ void selectItemBySpecialId(const LLUUID& special_id);
+ LLUUID getSelectedSpecialId();
+
// LLView interface
/*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index 9fcb6edca4..e8d3c12d39 100644
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -967,10 +967,7 @@
name="OutfitGalleryItemUnselected"
value="0.4 0.4 0.4 1" />
<color
- name="AddPaymentPanel"
- value="0.27 0.27 0.27 1" />
- <color
- name="PerformanceFloaterGray"
+ name="PanelGray"
value="0.27 0.27 0.27 1" />
<color
name="PerformanceMid"
diff --git a/indra/newview/skins/default/xui/en/floater_add_payment_method.xml b/indra/newview/skins/default/xui/en/floater_add_payment_method.xml
index 1f980564d4..ac88263aa1 100644
--- a/indra/newview/skins/default/xui/en/floater_add_payment_method.xml
+++ b/indra/newview/skins/default/xui/en/floater_add_payment_method.xml
@@ -19,7 +19,7 @@
</floater.string>
<panel
background_opaque="false"
- bg_alpha_color="AddPaymentPanel"
+ bg_alpha_color="PanelGray"
border_visible="false"
background_visible="true"
label="wrapper_panel"
diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml
index 4cd3c7a603..039421d589 100644
--- a/indra/newview/skins/default/xui/en/floater_performance.xml
+++ b/indra/newview/skins/default/xui/en/floater_performance.xml
@@ -75,7 +75,7 @@
left="0"
top="60">
<panel
- bg_alpha_color="PerformanceFloaterGray"
+ bg_alpha_color="PanelGray"
background_visible="true"
background_opaque="false"
border="true"
@@ -122,7 +122,7 @@
right="-20"/>
</panel>
<panel
- bg_alpha_color="PerformanceFloaterGray"
+ bg_alpha_color="PanelGray"
background_visible="true"
background_opaque="false"
border="true"
@@ -168,7 +168,7 @@
right="-20"/>
</panel>
<panel
- bg_alpha_color="PerformanceFloaterGray"
+ bg_alpha_color="PanelGray"
background_visible="true"
background_opaque="false"
border="true"
@@ -225,7 +225,7 @@
right="-20"/>
</panel>
<panel
- bg_alpha_color="PerformanceFloaterGray"
+ bg_alpha_color="PanelGray"
background_visible="true"
background_opaque="false"
border="true"
@@ -282,7 +282,7 @@
right="-20"/>
</panel>
<panel
- bg_alpha_color="PerformanceFloaterGray"
+ bg_alpha_color="PanelGray"
background_visible="true"
background_opaque="false"
border="true"
@@ -339,7 +339,7 @@
right="-20"/>
</panel>
<panel
- bg_alpha_color="PerformanceFloaterGray"
+ bg_alpha_color="PanelGray"
background_visible="true"
background_opaque="false"
border="true"