Automated merge with ssh://hg.lindenlab.com/viewer/viewer-2-0/
commit
828cf66ce3
|
|
@ -1360,6 +1360,7 @@ LLUUID LLAgentWearables::makeNewOutfitLinks(const std::string& new_folder_name)
|
|||
|
||||
LLPointer<LLInventoryCallback> cb = new LLAutoRenameFolder(folder_id);
|
||||
LLAppearanceManager::instance().shallowCopyCategory(LLAppearanceManager::instance().getCOF(),folder_id, cb);
|
||||
LLAppearanceManager::instance().createBaseOutfitLink(folder_id, NULL);
|
||||
|
||||
return folder_id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ LLUUID LLAppearanceManager::getCOF()
|
|||
}
|
||||
|
||||
|
||||
const LLViewerInventoryItem* LLAppearanceManager::getCurrentOutfitLink()
|
||||
const LLViewerInventoryItem* LLAppearanceManager::getBaseOutfitLink()
|
||||
{
|
||||
const LLUUID& current_outfit_cat = getCOF();
|
||||
LLInventoryModel::cat_array_t cat_array;
|
||||
|
|
@ -444,6 +444,28 @@ void LLAppearanceManager::shallowCopyCategory(const LLUUID& src_id, const LLUUID
|
|||
}
|
||||
}
|
||||
|
||||
void LLAppearanceManager::purgeBaseOutfitLink(const LLUUID& category)
|
||||
{
|
||||
LLInventoryModel::cat_array_t cats;
|
||||
LLInventoryModel::item_array_t items;
|
||||
gInventory.collectDescendents(category, cats, items,
|
||||
LLInventoryModel::EXCLUDE_TRASH);
|
||||
for (S32 i = 0; i < items.count(); ++i)
|
||||
{
|
||||
LLViewerInventoryItem *item = items.get(i);
|
||||
if (item->getActualType() != LLAssetType::AT_LINK_FOLDER)
|
||||
continue;
|
||||
if (item->getIsLinkType())
|
||||
{
|
||||
LLViewerInventoryCategory* catp = item->getLinkedCategory();
|
||||
if(catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT)
|
||||
{
|
||||
gInventory.purgeObject(item->getUUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLAppearanceManager::purgeCategory(const LLUUID& category, bool keep_outfit_links)
|
||||
{
|
||||
LLInventoryModel::cat_array_t cats;
|
||||
|
|
@ -578,17 +600,9 @@ void LLAppearanceManager::updateCOF(const LLUUID& category, bool append)
|
|||
linkAll(cof, gest_items, link_waiter);
|
||||
|
||||
// Add link to outfit if category is an outfit.
|
||||
LLViewerInventoryCategory* catp = gInventory.getCategory(category);
|
||||
if (!append)
|
||||
{
|
||||
std::string new_outfit_name = "";
|
||||
if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT)
|
||||
{
|
||||
link_inventory_item(gAgent.getID(), category, cof, catp->getName(),
|
||||
LLAssetType::AT_LINK_FOLDER, link_waiter);
|
||||
new_outfit_name = catp->getName();
|
||||
}
|
||||
updatePanelOutfitName(new_outfit_name);
|
||||
createBaseOutfitLink(category, link_waiter);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -602,6 +616,22 @@ void LLAppearanceManager::updatePanelOutfitName(const std::string& name)
|
|||
}
|
||||
}
|
||||
|
||||
void LLAppearanceManager::createBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> link_waiter)
|
||||
{
|
||||
const LLUUID cof = getCOF();
|
||||
LLViewerInventoryCategory* catp = gInventory.getCategory(category);
|
||||
std::string new_outfit_name = "";
|
||||
|
||||
purgeBaseOutfitLink(cof);
|
||||
|
||||
if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT)
|
||||
{
|
||||
link_inventory_item(gAgent.getID(), category, cof, catp->getName(),
|
||||
LLAssetType::AT_LINK_FOLDER, link_waiter);
|
||||
new_outfit_name = catp->getName();
|
||||
}
|
||||
updatePanelOutfitName(new_outfit_name);
|
||||
}
|
||||
|
||||
void LLAppearanceManager::updateAgentWearables(LLWearableHoldingPattern* holder, bool append)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -62,11 +62,13 @@ public:
|
|||
LLUUID getCOF();
|
||||
|
||||
// Finds the folder link to the currently worn outfit
|
||||
const LLViewerInventoryItem *getCurrentOutfitLink();
|
||||
const LLViewerInventoryItem *getBaseOutfitLink();
|
||||
|
||||
// Update the displayed outfit name in UI.
|
||||
void updatePanelOutfitName(const std::string& name);
|
||||
|
||||
void createBaseOutfitLink(const LLUUID& category, LLPointer<LLInventoryCallback> link_waiter);
|
||||
|
||||
void updateAgentWearables(LLWearableHoldingPattern* holder, bool append);
|
||||
|
||||
// For debugging - could be moved elsewhere.
|
||||
|
|
@ -114,6 +116,7 @@ private:
|
|||
bool follow_folder_links);
|
||||
|
||||
void purgeCategory(const LLUUID& category, bool keep_outfit_links);
|
||||
void purgeBaseOutfitLink(const LLUUID& category);
|
||||
|
||||
std::set<LLUUID> mRegisteredAttachments;
|
||||
bool mAttachmentInvLinkEnabled;
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ void LLSidepanelAppearance::onFilterEdit(const std::string& search_string)
|
|||
|
||||
void LLSidepanelAppearance::onOpenOutfitButtonClicked()
|
||||
{
|
||||
const LLViewerInventoryItem *outfit_link = LLAppearanceManager::getInstance()->getCurrentOutfitLink();
|
||||
const LLViewerInventoryItem *outfit_link = LLAppearanceManager::getInstance()->getBaseOutfitLink();
|
||||
if (!outfit_link)
|
||||
return;
|
||||
if (!outfit_link->getIsLinkType())
|
||||
|
|
@ -313,7 +313,7 @@ void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name)
|
|||
{
|
||||
if (name == "")
|
||||
{
|
||||
const LLViewerInventoryItem *outfit_link = LLAppearanceManager::getInstance()->getCurrentOutfitLink();
|
||||
const LLViewerInventoryItem *outfit_link = LLAppearanceManager::getInstance()->getBaseOutfitLink();
|
||||
if (outfit_link)
|
||||
{
|
||||
const LLViewerInventoryCategory *cat = outfit_link->getLinkedCategory();
|
||||
|
|
|
|||
Loading…
Reference in New Issue