summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llagentwearables.cpp1
-rw-r--r--indra/newview/llappearancemgr.cpp50
-rw-r--r--indra/newview/llappearancemgr.h5
-rw-r--r--indra/newview/llsidepanelappearance.cpp4
-rw-r--r--indra/newview/llviewermedia.h1
-rw-r--r--indra/newview/llviewermenu.cpp3
6 files changed, 50 insertions, 14 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index dd19bbac2e..d21965568d 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -1396,6 +1396,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;
}
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 43b2f34ecd..25f1accb22 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -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)
{
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index b625d42a50..11b910ee11 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -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;
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index 30b0075c4b..e2ce534c4f 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -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();
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 28fb379960..63f461b4c4 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -187,6 +187,7 @@ public:
std::string getMediaURL() const { return mMediaURL; }
std::string getCurrentMediaURL();
std::string getHomeURL() { return mHomeURL; }
+ std::string getMediaEntryURL() { return mMediaEntryURL; }
void setHomeURL(const std::string& home_url) { mHomeURL = home_url; };
void clearCache();
std::string getMimeType() { return mMimeType; }
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 15855f154d..5445a79137 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -2466,7 +2466,7 @@ class LLViewJoystickFlycam : public view_listener_t
class LLViewCheckJoystickFlycam : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
- {
+ {
bool new_value = LLViewerJoystick::getInstance()->getOverrideCamera();
return new_value;
}
@@ -3704,6 +3704,7 @@ void reset_view_final( BOOL proceed )
}
gAgent.resetView(TRUE, TRUE);
+ gAgent.setLookAt(LOOKAT_TARGET_CLEAR);
}
class LLViewLookAtLastChatter : public view_listener_t