Feature Request: Add tooltip to Save Outfit button showing where it will save to

Adds refreshCurrentOutfitName() from upstream
This commit is contained in:
Lirusaito
2013-07-22 23:49:19 -04:00
parent 989e4332b7
commit 4e63a64a1d
8 changed files with 60 additions and 4 deletions

View File

@@ -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<LLSidepanelAppearance *>(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<LLInventoryCallback> link_waiter)

View File

@@ -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<LLWearableType::WT_INVALID;++type)
@@ -191,6 +197,7 @@ BOOL LLFloaterCustomize::postBuild()
{
getChild<LLUICtrl>("Make Outfit")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnMakeOutfit, this));
getChild<LLUICtrl>("Save Outfit")->setCommitCallback(boost::bind(&LLAppearanceMgr::updateBaseOutfit, LLAppearanceMgr::getInstance()));
refreshCurrentOutfitName(); // Initialize tooltip for save outfit button
getChild<LLUICtrl>("Ok")->setCommitCallback(boost::bind(&LLFloaterCustomize::onBtnOk, this));
getChild<LLUICtrl>("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<LLUICtrl>("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)
{

View File

@@ -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();

View File

@@ -400,4 +400,6 @@ und dieses anziehen.</text>
<button label="OK" label_selected="OK" name="Ok"/>
<button label="Outfit erstellen..." label_selected="Outfit erstellen..." name="Make Outfit"/>
<button name="Save Outfit" label="Speichere Outfit"/>
<string name="No Outfit" value="Kein Outfit"/>
<string name="Changing outfits" value="Outfits ändern"/>
</floater>

View File

@@ -1452,4 +1452,7 @@ one from scratch and wear it.
mouse_opaque="true" name="Make Outfit" left="10" scale_image="true"
width="100" />
<button bottom="-536" follows="left|bottom" height="20" left="110" width="100" name="Save Outfit" label="Save Outfit"/>
<string name="Save changes to" value="Save changes to [OUTFIT]"/>
<string name="No Outfit" value="No Outfit"/>
<string name="Changing outfits" value="Changing outfits"/>
</floater>

View File

@@ -613,4 +613,6 @@ una nueva y vistiéndotela.
<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
<button label="OK" label_selected="OK" name="Ok"/>
<button label="Hacer un Vestuario..." label_selected="Hacer un Vestuario..." name="Make Outfit"/>
<string name="No Outfit" value="No hay vestuario"/>
<string name="Changing outfits" value="Cambiar de vestuario"/>
</floater>

View File

@@ -487,4 +487,6 @@ inventaire. Vous pouvez aussi en créer une nouvelle et la porter.
<button label="OK" label_selected="OK" name="Ok"/>
<button label="Créer un ensemble" label_selected="Créer un ensemble" name="Make Outfit" left="200" width="125"/>
<button left="90" name="Save Outfit" label="sauvegarder"/>
<string name="No Outfit" value="Aucune tenue"/>
<string name="Changing outfits" value="Changement de tenue"/>
</floater>

View File

@@ -480,4 +480,6 @@ partir de um esboço e usá-lo.
<button label="Cancelar" label_selected="Cancelar" name="Cancel"/>
<button label="OK" label_selected="OK" name="Ok"/>
<button label="Criar Vestimenta..." label_selected="Criar Vestimenta..." name="Make Outfit" left="117" width="125" />
<string name="No Outfit" value="Nenhum"/>
<string name="Changing outfits" value="Mudando de look"/>
</floater>