diff options
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r-- | indra/newview/llpaneloutfitedit.cpp | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 6d9465d422..2074fd89c0 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -766,24 +766,35 @@ void LLPanelOutfitEdit::onShopButtonClicked() if (isAgentAvatarValid()) { // try to get wearable type from 'Add More' panel first (EXT-7639) - LLWearableType::EType type = getAddMorePanelSelectionType(); + selection_info_t selection_info = getAddMorePanelSelectionType(); - if (type == LLWearableType::WT_NONE) + LLWearableType::EType type = selection_info.first; + + if (selection_info.second > 1) { - type = getCOFWearablesSelectionType(); + // the second argument is not important in this case: generic market place will be opened + url = url_resolver.resolveURL(LLWearableType::WT_NONE, SEX_FEMALE); } + else + { + if (type == LLWearableType::WT_NONE) + { + type = getCOFWearablesSelectionType(); + } - ESex sex = gAgentAvatarp->getSex(); + ESex sex = gAgentAvatarp->getSex(); - // WT_INVALID comes for attachments - if (type != LLWearableType::WT_INVALID && type != LLWearableType::WT_NONE) - { - url = url_resolver.resolveURL(type, sex); - } + // WT_INVALID comes for attachments + if (type != LLWearableType::WT_INVALID && type != LLWearableType::WT_NONE) + { + url = url_resolver.resolveURL(type, sex); + } - if (url.empty()) - { - url = url_resolver.resolveURL(mCOFWearables->getExpandedAccordionAssetType(), sex); + if (url.empty()) + { + url = url_resolver.resolveURL( + mCOFWearables->getExpandedAccordionAssetType(), sex); + } } } else @@ -822,9 +833,9 @@ LLWearableType::EType LLPanelOutfitEdit::getCOFWearablesSelectionType() const return type; } -LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const +LLPanelOutfitEdit::selection_info_t LLPanelOutfitEdit::getAddMorePanelSelectionType() const { - LLWearableType::EType type = LLWearableType::WT_NONE; + selection_info_t result = std::make_pair(LLWearableType::WT_NONE, 0); if (mAddWearablesPanel != NULL && mAddWearablesPanel->getVisible()) { @@ -832,9 +843,11 @@ LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const { std::set<LLUUID> selected_uuids = mInventoryItemsPanel->getRootFolder()->getSelectionList(); - if (selected_uuids.size() == 1) + result.second = selected_uuids.size(); + + if (result.second == 1) { - type = getWearableTypeByItemUUID(*(selected_uuids.begin())); + result.first = getWearableTypeByItemUUID(*(selected_uuids.begin())); } } else if (mWearableItemsList != NULL && mWearableItemsList->getVisible()) @@ -842,14 +855,16 @@ LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const std::vector<LLUUID> selected_uuids; mWearableItemsList->getSelectedUUIDs(selected_uuids); - if (selected_uuids.size() == 1) + result.second = selected_uuids.size(); + + if (result.second == 1) { - type = getWearableTypeByItemUUID(selected_uuids.front()); + result.first = getWearableTypeByItemUUID(selected_uuids.front()); } } } - return type; + return result; } LLWearableType::EType LLPanelOutfitEdit::getWearableTypeByItemUUID(const LLUUID& item_uuid) const @@ -1305,9 +1320,6 @@ void LLPanelOutfitEdit::saveListSelection() void LLPanelOutfitEdit::onCOFChanged() { - //the panel is only updated when is visible to a user - if (!isInVisibleChain()) return; - update(); } |