summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-11-30 13:02:19 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-11-30 13:30:27 +0200
commit27dae1d96753634c40619af8bc5b982f5238289b (patch)
treec0a0e28d016ee08f82033385450c71b5a268e0ad /indra/newview/llappearancemgr.cpp
parent683bf84bb38adc88d4a4b7fedaed89b41fcac45e (diff)
parent110eb2c989b6655796c15a657d0898375027f3f2 (diff)
Merge branch 'DRTVWR-591-maint-X' into marchcat/591-x-pbr-merge
# Conflicts: # indra/llrender/llgl.cpp # indra/llrender/llvertexbuffer.cpp # indra/llui/llflatlistview.cpp # indra/newview/app_settings/settings.xml # indra/newview/lldrawpoolground.cpp # indra/newview/llinventorybridge.cpp # indra/newview/llinventorygallery.cpp # indra/newview/llspatialpartition.cpp # indra/newview/llviewercontrol.cpp # indra/newview/llviewertexture.cpp # indra/newview/llvosky.cpp # indra/newview/skins/default/xui/en/menu_inventory.xml
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp56
1 files changed, 47 insertions, 9 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 8010b84c20..10b3f4b573 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -1399,7 +1399,7 @@ const std::string LLAppearanceMgr::sExpectedTextureName = "OutfitPreview";
const LLUUID LLAppearanceMgr::getCOF() const
{
- return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
+ return mCOFID;
}
S32 LLAppearanceMgr::getCOFVersion() const
@@ -1415,6 +1415,11 @@ S32 LLAppearanceMgr::getCOFVersion() const
}
}
+void LLAppearanceMgr::initCOFID()
+{
+ mCOFID = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
+}
+
const LLViewerInventoryItem* LLAppearanceMgr::getBaseOutfitLink()
{
const LLUUID& current_outfit_cat = getCOF();
@@ -3749,6 +3754,14 @@ LLSD LLAppearanceMgr::dumpCOF() const
return result;
}
+void LLAppearanceMgr::cleanup()
+{
+ mIsInUpdateAppearanceFromCOF = false;
+ mOutstandingAppearanceBakeRequest = false;
+ mRerequestAppearanceBake = false;
+ mCOFID.setNull();
+}
+
// static
void LLAppearanceMgr::onIdle(void *)
{
@@ -4117,7 +4130,7 @@ void LLAppearanceMgr::wearBaseOutfit()
updateCOF(base_outfit_id);
}
-void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove)
+void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove, nullary_func_t post_update_func)
{
LL_DEBUGS("UIUsage") << "removeItemsFromAvatar" << LL_ENDL;
LLUIUsage::instance().logCommand("Avatar.RemoveItem");
@@ -4127,7 +4140,7 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove)
LL_WARNS() << "called with empty list, nothing to do" << LL_ENDL;
return;
}
- LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy;
+ LLPointer<LLInventoryCallback> cb = new LLUpdateAppearanceOnDestroy(true, true, post_update_func);
for (uuid_vec_t::const_iterator it = ids_to_remove.begin(); it != ids_to_remove.end(); ++it)
{
const LLUUID& id_to_remove = *it;
@@ -4146,11 +4159,11 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove)
}
}
-void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove)
+void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove, nullary_func_t post_update_func)
{
uuid_vec_t ids_to_remove;
ids_to_remove.push_back(id_to_remove);
- removeItemsFromAvatar(ids_to_remove);
+ removeItemsFromAvatar(ids_to_remove, post_update_func);
}
@@ -4387,20 +4400,45 @@ BOOL LLAppearanceMgr::getIsInCOF(const LLUUID& obj_id) const
return FALSE;
}
-BOOL LLAppearanceMgr::getIsProtectedCOFItem(const LLUUID& obj_id) const
+bool LLAppearanceMgr::getIsInCOF(const LLInventoryObject* obj) const
+{
+ const LLUUID& cof = getCOF();
+ if (obj->getUUID() == cof)
+ return true;
+ if (obj && obj->getParentUUID() == cof)
+ return true;
+ return false;
+}
+
+bool LLAppearanceMgr::getIsProtectedCOFItem(const LLUUID& obj_id) const
{
- if (!getIsInCOF(obj_id)) return FALSE;
+ if (!getIsInCOF(obj_id)) return false;
// If a non-link somehow ended up in COF, allow deletion.
const LLInventoryObject *obj = gInventory.getObject(obj_id);
if (obj && !obj->getIsLinkType())
{
- return FALSE;
+ return false;
}
// For now, don't allow direct deletion from the COF. Instead, force users
// to choose "Detach" or "Take Off".
- return TRUE;
+ return true;
+}
+
+bool LLAppearanceMgr::getIsProtectedCOFItem(const LLInventoryObject* obj) const
+{
+ if (!getIsInCOF(obj)) return false;
+
+ // If a non-link somehow ended up in COF, allow deletion.
+ if (obj && !obj->getIsLinkType())
+ {
+ return false;
+ }
+
+ // For now, don't allow direct deletion from the COF. Instead, force users
+ // to choose "Detach" or "Take Off".
+ return true;
}
class CallAfterCategoryFetchStage2: public LLInventoryFetchItemsObserver