Skip to content
Snippets Groups Projects
Commit 0fa0ffb5 authored by Andrew Polunin's avatar Andrew Polunin
Browse files

EXT-7639 FIXED (Make shop button open different URLs depending on what is...

EXT-7639 FIXED (Make shop button open different URLs depending on what is selected in outfit editor) - 'Add More' panel multiple selection behavior

Implemented the following behavior: \"if multiple selection is made in the Add More panel then default marketplace home URL can be used\".

Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/769/

--HG--
branch : product-engine
parent f3f56874
No related branches found
No related tags found
No related merge requests found
...@@ -629,24 +629,35 @@ void LLPanelOutfitEdit::onShopButtonClicked() ...@@ -629,24 +629,35 @@ void LLPanelOutfitEdit::onShopButtonClicked()
if (isAgentAvatarValid()) if (isAgentAvatarValid())
{ {
// try to get wearable type from 'Add More' panel first (EXT-7639) // 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 // WT_INVALID comes for attachments
if (type != LLWearableType::WT_INVALID && type != LLWearableType::WT_NONE) if (type != LLWearableType::WT_INVALID && type != LLWearableType::WT_NONE)
{ {
url = url_resolver.resolveURL(type, sex); url = url_resolver.resolveURL(type, sex);
} }
if (url.empty()) if (url.empty())
{ {
url = url_resolver.resolveURL(mCOFWearables->getExpandedAccordionAssetType(), sex); url = url_resolver.resolveURL(
mCOFWearables->getExpandedAccordionAssetType(), sex);
}
} }
} }
else else
...@@ -685,9 +696,9 @@ LLWearableType::EType LLPanelOutfitEdit::getCOFWearablesSelectionType() const ...@@ -685,9 +696,9 @@ LLWearableType::EType LLPanelOutfitEdit::getCOFWearablesSelectionType() const
return type; 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()) if (mAddWearablesPanel != NULL && mAddWearablesPanel->getVisible())
{ {
...@@ -695,9 +706,11 @@ LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const ...@@ -695,9 +706,11 @@ LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const
{ {
std::set<LLUUID> selected_uuids = mInventoryItemsPanel->getRootFolder()->getSelectionList(); 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()) else if (mWearableItemsList != NULL && mWearableItemsList->getVisible())
...@@ -705,14 +718,16 @@ LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const ...@@ -705,14 +718,16 @@ LLWearableType::EType LLPanelOutfitEdit::getAddMorePanelSelectionType() const
std::vector<LLUUID> selected_uuids; std::vector<LLUUID> selected_uuids;
mWearableItemsList->getSelectedUUIDs(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 LLWearableType::EType LLPanelOutfitEdit::getWearableTypeByItemUUID(const LLUUID& item_uuid) const
......
...@@ -198,8 +198,10 @@ class LLPanelOutfitEdit : public LLPanel ...@@ -198,8 +198,10 @@ class LLPanelOutfitEdit : public LLPanel
void getCurrentItemUUID(LLUUID& selected_id); void getCurrentItemUUID(LLUUID& selected_id);
void onCOFChanged(); void onCOFChanged();
typedef std::pair<LLWearableType::EType, size_t> selection_info_t;
LLWearableType::EType getCOFWearablesSelectionType() const; LLWearableType::EType getCOFWearablesSelectionType() const;
LLWearableType::EType getAddMorePanelSelectionType() const; selection_info_t getAddMorePanelSelectionType() const;
LLWearableType::EType getWearableTypeByItemUUID(const LLUUID& item_uuid) const; LLWearableType::EType getWearableTypeByItemUUID(const LLUUID& item_uuid) const;
LLTextBox* mCurrentOutfitName; LLTextBox* mCurrentOutfitName;
......
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