diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2d43a6e18..2877c50e2 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2080,13 +2080,11 @@ void LLAppearanceMgr::updateCOF(LLInventoryModel::item_array_t& body_items_new, void LLAppearanceMgr::updatePanelOutfitName(const std::string& name) { - // MULTI-WEARABLE TODO - /*LLSidepanelAppearance* panel_appearance = - dynamic_cast(LLFloaterSidePanelContainer::getPanel("appearance")); + LLFloaterCustomize* panel_appearance = LLFloaterCustomize::instanceExists() ? LLFloaterCustomize::getInstance() : NULL; if (panel_appearance) { panel_appearance->refreshCurrentOutfitName(name); - }*/ + } } void LLAppearanceMgr::createBaseOutfitLink(const LLUUID& category, LLPointer link_waiter) diff --git a/indra/newview/llfloatercustomize.cpp b/indra/newview/llfloatercustomize.cpp index ab1e27876..69010602a 100644 --- a/indra/newview/llfloatercustomize.cpp +++ b/indra/newview/llfloatercustomize.cpp @@ -47,6 +47,7 @@ #include "llradiogroup.h" #include "lltoolmgr.h" #include "llviewermenu.h" +#include "lloutfitobserver.h" #include "llscrollcontainer.h" #include "llscrollingpanelparam.h" #include "llsliderctrl.h" @@ -157,6 +158,11 @@ LLFloaterCustomize::LLFloaterCustomize() mInventoryObserver = new LLFloaterCustomizeObserver(this); gInventory.addObserver(mInventoryObserver); + LLOutfitObserver& outfit_observer = LLOutfitObserver::instance(); + outfit_observer.addBOFReplacedCallback(boost::bind(&LLFloaterCustomize::refreshCurrentOutfitName, this, "")); + outfit_observer.addBOFChangedCallback(boost::bind(&LLFloaterCustomize::refreshCurrentOutfitName, this, "")); + outfit_observer.addCOFChangedCallback(boost::bind(&LLFloaterCustomize::refreshCurrentOutfitName, this, "")); + LLCallbackMap::map_t factory_map; const std::string &invalid_name = LLWearableType::getTypeName(LLWearableType::WT_INVALID); for(U32 type=LLWearableType::WT_SHAPE;type("Make Outfit")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnMakeOutfit, this)); getChild("Save Outfit")->setCommitCallback(boost::bind(&LLAppearanceMgr::updateBaseOutfit, LLAppearanceMgr::getInstance())); + refreshCurrentOutfitName(); // Initialize tooltip for save outfit button getChild("Ok")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnOk, this)); getChild("Cancel")->setCommitCallback(boost::bind(&LLFloater::onClickClose, this)); @@ -224,6 +231,44 @@ BOOL LLFloaterCustomize::postBuild() return TRUE; } +void LLFloaterCustomize::refreshCurrentOutfitName(const std::string& name) +{ + LLUICtrl* save_outfit_btn = getChild("Save Outfit"); + // Set current outfit status (wearing/unsaved). + bool dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); + //std::string cof_status_str = getString(dirty ? "Unsaved Changes" : "Now Wearing"); + //mOutfitStatus->setText(cof_status_str); + save_outfit_btn->setEnabled(dirty); // No use saving unless dirty + + if (name == "") + { + std::string outfit_name; + if (LLAppearanceMgr::getInstance()->getBaseOutfitName(outfit_name)) + { + //mCurrentLookName->setText(outfit_name); + LLStringUtil::format_map_t args; + args["[OUTFIT]"] = outfit_name; + save_outfit_btn->setToolTip(getString("Save changes to", args)); + return; + } + + std::string string_name = gAgentWearables.isCOFChangeInProgress() ? "Changing outfits" : "No Outfit"; + //mCurrentLookName->setText(getString(string_name)); + save_outfit_btn->setToolTip(getString(string_name)); + //mOpenOutfitBtn->setEnabled(FALSE); + save_outfit_btn->setEnabled(false); // Can't save right now + } + else + { + //mCurrentLookName->setText(name); + LLStringUtil::format_map_t args; + args["[OUTFIT]"] = name; + save_outfit_btn->setToolTip(getString("Save changes to", args)); + // Can't just call update verbs since the folder link may not have been created yet. + //mOpenOutfitBtn->setEnabled(TRUE); + } +} + //static void LLFloaterCustomize::editWearable(LLViewerWearable* wearable, bool disable_camera_switch) { diff --git a/indra/newview/llfloatercustomize.h b/indra/newview/llfloatercustomize.h index 115ad61ac..2a31c371d 100644 --- a/indra/newview/llfloatercustomize.h +++ b/indra/newview/llfloatercustomize.h @@ -83,6 +83,8 @@ public: /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void draw(); + void refreshCurrentOutfitName(const std::string& name = ""); + // Creation procedures static void editWearable(LLViewerWearable* wearable, bool disable_camera_switch); static void show(); diff --git a/indra/newview/skins/default/xui/de/floater_customize.xml b/indra/newview/skins/default/xui/de/floater_customize.xml index 465c0667b..f69e4311d 100644 --- a/indra/newview/skins/default/xui/de/floater_customize.xml +++ b/indra/newview/skins/default/xui/de/floater_customize.xml @@ -400,4 +400,6 @@ und dieses anziehen.