Skip to content
Snippets Groups Projects
Commit 4495dd26 authored by Vadim Savchuk's avatar Vadim Savchuk
Browse files

STORM-183 FIXED The "Replace Current Outfit" option of the My Outfits gear...

STORM-183 FIXED The "Replace Current Outfit" option of the My Outfits gear menu (which is only applicable to outfits) wasn't disabled for selected wearables.
parent 1dbcc3ff
No related branches found
No related tags found
No related merge requests found
...@@ -85,7 +85,7 @@ class LLOutfitListGearMenu ...@@ -85,7 +85,7 @@ class LLOutfitListGearMenu
registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenu::onAdd, this)); registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenu::onAdd, this));
enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitsList::isActionEnabled, mOutfitList, _2)); enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitListGearMenu::onEnable, this, _2));
enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenu::onVisible, this, _2)); enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenu::onVisible, this, _2));
mMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>( mMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>(
...@@ -209,6 +209,20 @@ class LLOutfitListGearMenu ...@@ -209,6 +209,20 @@ class LLOutfitListGearMenu
LLAgentWearables::createWearable(type, true); LLAgentWearables::createWearable(type, true);
} }
bool onEnable(LLSD::String param)
{
// Handle the "Wear - Replace Current Outfit" menu option specially
// because LLOutfitList::isActionEnabled() checks whether it's allowed
// to wear selected outfit OR selected items, while we're only
// interested in the outfit (STORM-183).
if ("wear" == param)
{
return LLAppearanceMgr::instance().getCanReplaceCOF(mOutfitList->getSelectedOutfitUUID());
}
return mOutfitList->isActionEnabled(param);
}
bool onVisible(LLSD::String param) bool onVisible(LLSD::String param)
{ {
const LLUUID& selected_outfit_id = getSelectedOutfitID(); const LLUUID& selected_outfit_id = getSelectedOutfitID();
......
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