summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorygallery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorygallery.cpp')
-rw-r--r--indra/newview/llinventorygallery.cpp65
1 files changed, 24 insertions, 41 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 15bc578c64..d640e04915 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -61,43 +61,6 @@ const S32 GALLERY_ITEMS_PER_ROW_MIN = 2;
const S32 FAST_LOAD_THUMBNAIL_TRSHOLD = 50; // load folders below this value immediately
-namespace {
- enum EMyOutfitsSubfolderType
- {
- MY_OUTFITS_NO,
- MY_OUTFITS_SUBFOLDER,
- MY_OUTFITS_OUTFIT,
- };
-
- EMyOutfitsSubfolderType myoutfit_object_subfolder_type(LLInventoryModel* model, const LLUUID& obj_id,
- const LLUUID& cat_id)
- {
- if (obj_id == cat_id) return MY_OUTFITS_NO;
-
- const LLViewerInventoryCategory* test_cat = model->getCategory(obj_id);
- while (test_cat)
- {
- if (test_cat->getPreferredType() == LLFolderType::FT_OUTFIT)
- {
- return MY_OUTFITS_OUTFIT;
- }
-
- const LLUUID& parent_id = test_cat->getParentUUID();
- if (parent_id.isNull())
- {
- return MY_OUTFITS_NO;
- }
- if (parent_id == cat_id)
- {
- return MY_OUTFITS_SUBFOLDER;
- }
- test_cat = model->getCategory(parent_id);
- }
-
- return MY_OUTFITS_NO;
- }
-}
-
// Helper dnd functions
bool dragCategoryIntoFolder(LLUUID dest_id, LLInventoryCategory* inv_cat, bool drop, std::string& tooltip_msg, bool is_link);
bool dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, bool drop, std::string& tooltip_msg, bool user_confirm);
@@ -3784,7 +3747,12 @@ bool dragCategoryIntoFolder(LLUUID dest_id, LLInventoryCategory* inv_cat,
U32 max_items_to_wear = gSavedSettings.getU32("WearFolderLimit");
if (is_movable && move_is_into_outfit)
{
- if (dest_id == my_outifts_id)
+ if ((inv_cat->getPreferredType() != LLFolderType::FT_NONE) && (inv_cat->getPreferredType() != LLFolderType::FT_OUTFIT))
+ {
+ tooltip_msg = LLTrans::getString("TooltipCantCreateOutfit");
+ is_movable = false;
+ }
+ else if (dest_id == my_outifts_id)
{
if (source != LLToolDragAndDrop::SOURCE_AGENT || move_is_from_marketplacelistings)
{
@@ -3801,13 +3769,28 @@ bool dragCategoryIntoFolder(LLUUID dest_id, LLInventoryCategory* inv_cat,
is_movable = false;
}
}
- else if (dest_cat && dest_cat->getPreferredType() == LLFolderType::FT_NONE)
+ else if (!dest_cat)
{
- is_movable = ((inv_cat->getPreferredType() == LLFolderType::FT_NONE) || (inv_cat->getPreferredType() == LLFolderType::FT_OUTFIT));
+ is_movable = false;
+ tooltip_msg = LLTrans::getString("TooltipCantCreateOutfit");
}
else
{
- is_movable = false;
+ LLFolderType::EType type = dest_cat->getPreferredType();
+ if (type == LLFolderType::FT_OUTFIT && inv_cat->getPreferredType() == LLFolderType::FT_OUTFIT)
+ {
+ is_movable = false;
+ tooltip_msg = LLTrans::getString("TooltipCantMoveOutfitIntoOutfit");
+ }
+ else if (can_move_to_my_outfits(model, inv_cat, max_items_to_wear))
+ {
+ is_movable = true;
+ }
+ else
+ {
+ is_movable = false;
+ tooltip_msg = LLTrans::getString("TooltipCantCreateOutfit");
+ }
}
}
if (is_movable && move_is_into_current_outfit && is_link)