Skip to content

Commit 888d4ae

Browse files
committed
#4072 Fix Appearance floater not updating
1 parent 32cd3a6 commit 888d4ae

File tree

4 files changed

+49
-36
lines changed

4 files changed

+49
-36
lines changed

indra/newview/app_settings/settings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7841,7 +7841,7 @@
78417841
<key>RenderMinFreeMainMemoryThreshold</key>
78427842
<map>
78437843
<key>Comment</key>
7844-
<string>Minimum of available physical memory in MB before textures get scaled down</string>
7844+
<string>If available free physical memory is below this value textures get agresively scaled down</string>
78457845
<key>Persist</key>
78467846
<integer>0</integer>
78477847
<key>Type</key>

indra/newview/lloutfitgallery.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,17 @@ void LLOutfitGallery::updateAddedCategory(LLUUID cat_id)
793793
LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
794794
if (!cat) return;
795795

796+
if (!isOutfitFolder(cat))
797+
{
798+
// Assume a subfolder that contains or will contain outfits, track it
799+
const LLUUID outfits = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
800+
mOutfitsObserver->addCategory(cat_id, [this, outfits]()
801+
{
802+
observerCallback(outfits);
803+
});
804+
return;
805+
}
806+
796807
std::string name = cat->getName();
797808
LLOutfitGalleryItem* item = buildGalleryItem(name, cat_id);
798809
mOutfitMap.insert(LLOutfitGallery::outfit_map_value_t(cat_id, item));

indra/newview/lloutfitslist.cpp

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,17 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id)
142142
LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
143143
if (!cat) return;
144144

145+
if (!isOutfitFolder(cat))
146+
{
147+
// Assume a subfolder that contains or will contain outfits, track it
148+
const LLUUID outfits = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
149+
mCategoriesObserver->addCategory(cat_id, [this, outfits]()
150+
{
151+
observerCallback(outfits);
152+
});
153+
return;
154+
}
155+
145156
std::string name = cat->getName();
146157

147158
outfit_accordion_tab_params tab_params(get_accordion_tab_params());
@@ -819,49 +830,38 @@ void LLOutfitListBase::observerCallback(const LLUUID& category_id)
819830
refreshList(category_id);
820831
}
821832

822-
class LLIsOutfitListFolder : public LLInventoryCollectFunctor
833+
bool LLOutfitListBase::isOutfitFolder(LLViewerInventoryCategory* cat) const
823834
{
824-
public:
825-
LLIsOutfitListFolder()
835+
if (!cat)
826836
{
827-
mOutfitsId = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
837+
return false;
828838
}
829-
virtual ~LLIsOutfitListFolder() {}
830-
831-
bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override
839+
if (cat->getPreferredType() == LLFolderType::FT_OUTFIT)
832840
{
833-
if (cat)
841+
return true;
842+
}
843+
// assumes that folder is somewhere inside MyOutfits
844+
if (cat->getPreferredType() == LLFolderType::FT_NONE)
845+
{
846+
LLViewerInventoryCategory* inv_cat = dynamic_cast<LLViewerInventoryCategory*>(cat);
847+
if (inv_cat && inv_cat->getDescendentCount() > 3)
834848
{
835-
if (cat->getPreferredType() == LLFolderType::FT_OUTFIT)
849+
LLInventoryModel::cat_array_t* cats;
850+
LLInventoryModel::item_array_t* items;
851+
gInventory.getDirectDescendentsOf(inv_cat->getUUID(), cats, items);
852+
if (cats->empty() // protection against outfits inside
853+
&& items->size() > 3) // arbitrary, if doesn't have at least base parts, not an outfit
836854
{
855+
// For now assume this to be an old style outfit, not a subfolder
856+
// but ideally no such 'outfits' should be left in My Outfits
857+
// Todo: stop counting FT_NONE as outfits,
858+
// convert obvious outfits into FT_OUTFIT
837859
return true;
838860
}
839-
if (cat->getPreferredType() == LLFolderType::FT_NONE
840-
&& cat->getParentUUID() == mOutfitsId)
841-
{
842-
LLViewerInventoryCategory* inv_cat = dynamic_cast<LLViewerInventoryCategory*>(cat);
843-
if (inv_cat && inv_cat->getDescendentCount() > 3)
844-
{
845-
LLInventoryModel::cat_array_t* cats;
846-
LLInventoryModel::item_array_t* items;
847-
gInventory.getDirectDescendentsOf(inv_cat->getUUID(), cats, items);
848-
if (cats->empty() // protection against outfits inside
849-
&& items->size() > 3) // eyes, skin, hair and shape are required
850-
{
851-
// For now assume this to be an old style outfit, not a subfolder
852-
// but ideally no such 'outfits' should be left in My Outfits
853-
// Todo: stop counting FT_NONE as outfits,
854-
// convert obvious outfits into FT_OUTFIT
855-
return true;
856-
}
857-
}
858-
}
859861
}
860-
return false;
861862
}
862-
protected:
863-
LLUUID mOutfitsId;
864-
};
863+
return false;
864+
}
865865

866866
void LLOutfitListBase::refreshList(const LLUUID& category_id)
867867
{
@@ -872,13 +872,13 @@ void LLOutfitListBase::refreshList(const LLUUID& category_id)
872872
LLInventoryModel::item_array_t item_array;
873873

874874
// Collect all sub-categories of a given category.
875-
LLIsOutfitListFolder is_outfit;
875+
LLIsType is_category(LLAssetType::AT_CATEGORY);
876876
gInventory.collectDescendentsIf(
877877
category_id,
878878
cat_array,
879879
item_array,
880880
LLInventoryModel::EXCLUDE_TRASH,
881-
is_outfit);
881+
is_category);
882882

883883
// Memorize item names for each UUID
884884
std::map<LLUUID, std::string> names;

indra/newview/lloutfitslist.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ class LLOutfitListBase : public LLPanelAppearanceTab
118118
void onOutfitsRemovalConfirmation(const LLSD& notification, const LLSD& response);
119119
virtual void onChangeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id) = 0;
120120

121+
bool isOutfitFolder(LLViewerInventoryCategory* cat) const;
122+
121123
static void onIdle(void* userdata);
122124
void onIdleRefreshList();
123125

0 commit comments

Comments
 (0)