SL-15297 WIP restore selection after updating the list & don't show avatars in the list as disabled when complexity is not limited
parent
f6a5bda34b
commit
74c6580e5c
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue