Skip to content
Snippets Groups Projects
Commit 98c74f4e authored by Brad Payne (Vir Linden)'s avatar Brad Payne (Vir Linden)
Browse files

For EXT-2637: Renaming outfit that's currently worn should update Current Outfit string

--HG--
branch : avatar-pipeline
parent 23068a2e
No related branches found
No related tags found
No related merge requests found
......@@ -574,29 +574,32 @@ void LLAppearanceManager::updateCOF(const LLUUID& category, bool append)
linkAll(cof, obj_items, link_waiter);
linkAll(cof, gest_items, link_waiter);
LLSidepanelAppearance* panel_appearance = dynamic_cast<LLSidepanelAppearance *>(LLSideTray::getInstance()->getPanel("sidepanel_appearance"));
// Add link to outfit if category is an outfit.
LLViewerInventoryCategory* catp = gInventory.getCategory(category);
if (!append && catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT)
if (!append)
{
link_inventory_item(gAgent.getID(), category, cof, catp->getName(),
LLAssetType::AT_LINK_FOLDER, link_waiter);
// Update the current outfit name of the appearance sidepanel.
if (panel_appearance)
std::string new_outfit_name = "";
if (catp && catp->getPreferredType() == LLFolderType::FT_OUTFIT)
{
panel_appearance->refreshCurrentOutfitName(catp->getName());
link_inventory_item(gAgent.getID(), category, cof, catp->getName(),
LLAssetType::AT_LINK_FOLDER, link_waiter);
new_outfit_name = catp->getName();
}
updatePanelOutfitName(new_outfit_name);
}
else
}
void LLAppearanceManager::updatePanelOutfitName(const std::string& name)
{
LLSidepanelAppearance* panel_appearance =
dynamic_cast<LLSidepanelAppearance *>(LLSideTray::getInstance()->getPanel("sidepanel_appearance"));
if (panel_appearance)
{
if (panel_appearance)
{
panel_appearance->refreshCurrentOutfitName("");
}
panel_appearance->refreshCurrentOutfitName(name);
}
}
void LLAppearanceManager::updateAgentWearables(LLWearableHoldingPattern* holder, bool append)
{
lldebugs << "updateAgentWearables()" << llendl;
......
......@@ -64,6 +64,9 @@ class LLAppearanceManager: public LLSingleton<LLAppearanceManager>
// Finds the folder link to the currently worn outfit
const LLViewerInventoryItem *getCurrentOutfitLink();
// Update the displayed outfit name in UI.
void updatePanelOutfitName(const std::string& name);
void updateAgentWearables(LLWearableHoldingPattern* holder, bool append);
// For debugging - could be moved elsewhere.
......
......@@ -67,6 +67,26 @@ class LLCurrentlyWornFetchObserver : public LLInventoryFetchObserver
LLSidepanelAppearance *mPanel;
};
class LLWatchForOutfitRenameObserver : public LLInventoryObserver
{
public:
LLWatchForOutfitRenameObserver(LLSidepanelAppearance *panel) :
mPanel(panel)
{}
virtual void changed(U32 mask);
private:
LLSidepanelAppearance *mPanel;
};
void LLWatchForOutfitRenameObserver::changed(U32 mask)
{
if (mask & LABEL)
{
mPanel->refreshCurrentOutfitName();
}
}
LLSidepanelAppearance::LLSidepanelAppearance() :
LLPanel(),
mFilterSubString(LLStringUtil::null),
......@@ -76,6 +96,8 @@ LLSidepanelAppearance::LLSidepanelAppearance() :
{
//LLUICtrlFactory::getInstance()->buildPanel(this, "panel_appearance.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
mFetchWorn = new LLCurrentlyWornFetchObserver(this);
mOutfitRenameWatcher = new LLWatchForOutfitRenameObserver(this);
}
LLSidepanelAppearance::~LLSidepanelAppearance()
......@@ -135,6 +157,8 @@ BOOL LLSidepanelAppearance::postBuild()
mCurrOutfitPanel = getChild<LLPanel>("panel_currentlook");
gInventory.addObserver(mOutfitRenameWatcher);
return TRUE;
}
......@@ -299,7 +323,7 @@ void LLSidepanelAppearance::updateVerbs()
}
}
void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string name)
void LLSidepanelAppearance::refreshCurrentOutfitName(const std::string& name)
{
if (name == "")
{
......
......@@ -40,6 +40,7 @@
class LLFilterEditor;
class LLCurrentlyWornFetchObserver;
class LLWatchForOutfitRenameObserver;
class LLPanelEditWearable;
class LLWearable;
class LLPanelOutfitsInventory;
......@@ -53,7 +54,7 @@ class LLSidepanelAppearance : public LLPanel
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
void refreshCurrentOutfitName(const std::string name = "");
void refreshCurrentOutfitName(const std::string& name = "");
static void editWearable(LLWearable *wearable, void *data);
......@@ -91,6 +92,9 @@ class LLSidepanelAppearance : public LLPanel
// Used to make sure the user's inventory is in memory.
LLCurrentlyWornFetchObserver* mFetchWorn;
// Used to update title when currently worn outfit gets renamed.
LLWatchForOutfitRenameObserver* mOutfitRenameWatcher;
// Search string for filtering landmarks and teleport
// history locations
std::string mFilterSubString;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment