summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorygallery.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2025-05-18 21:21:44 +0300
committerGitHub <noreply@github.com>2025-05-18 21:21:44 +0300
commitfdeef47611e7496ff5d5fb8f37e3b1f5240a8b14 (patch)
treeaab4b1664b82e8f49395fe3e3a75619724c9fd1c /indra/newview/llinventorygallery.cpp
parent3569cc1993dc03637b29fcd77fe5b01b6ea372fb (diff)
parenta9c75d8136f9df6885e525ea8f2b383fe4a22593 (diff)
Merge branch 'geenz/gltf-mesh-import' into marchcat/gltf-mesh-texture-import
Diffstat (limited to 'indra/newview/llinventorygallery.cpp')
-rw-r--r--indra/newview/llinventorygallery.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index eb47af85fd..43d4edb069 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -65,7 +65,7 @@ const S32 FAST_LOAD_THUMBNAIL_TRSHOLD = 50; // load folders below this value imm
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);
void dropToMyOutfits(LLInventoryCategory* inv_cat);
-void dropToMyOutfitsSubfolder(LLInventoryCategory* inv_cat, const LLUUID& dest_id, LLFolderType::EType preferred_type);
+void dropToMyOutfitsSubfolder(LLInventoryCategory* inv_cat, const LLUUID& dest_id);
class LLGalleryPanel: public LLPanel
{
@@ -3714,6 +3714,7 @@ bool dragCategoryIntoFolder(LLUUID dest_id, LLInventoryCategory* inv_cat,
//
bool is_movable = true;
+ bool create_outfit = false;
if (is_movable && (marketplacelistings_id == cat_id))
{
@@ -3759,7 +3760,12 @@ bool dragCategoryIntoFolder(LLUUID dest_id, LLInventoryCategory* inv_cat,
tooltip_msg = LLTrans::getString("TooltipOutfitNotInInventory");
is_movable = false;
}
- else if (can_move_to_my_outfits(model, inv_cat, max_items_to_wear))
+ else if (can_move_to_my_outfits_as_outfit(model, inv_cat, max_items_to_wear))
+ {
+ is_movable = true;
+ create_outfit = true;
+ }
+ else if (can_move_to_my_outfits_as_subfolder(model, inv_cat))
{
is_movable = true;
}
@@ -3793,7 +3799,12 @@ bool dragCategoryIntoFolder(LLUUID dest_id, LLInventoryCategory* inv_cat,
is_movable = false;
tooltip_msg = LLTrans::getString("TooltipCantCreateOutfit");
}
- else if (can_move_to_my_outfits(model, inv_cat, max_items_to_wear))
+ else if (can_move_to_my_outfits_as_outfit(model, inv_cat, max_items_to_wear))
+ {
+ is_movable = true;
+ create_outfit = true;
+ }
+ else if (can_move_to_my_outfits_as_subfolder(model, inv_cat))
{
is_movable = true;
}
@@ -3928,7 +3939,7 @@ bool dragCategoryIntoFolder(LLUUID dest_id, LLInventoryCategory* inv_cat,
if (dest_id == my_outifts_id)
{
EMyOutfitsSubfolderType inv_res = myoutfit_object_subfolder_type(model, cat_id, my_outifts_id);
- if (inv_res == MY_OUTFITS_SUBFOLDER || inv_res == MY_OUTFITS_OUTFIT)
+ if (inv_res == MY_OUTFITS_SUBFOLDER || inv_res == MY_OUTFITS_OUTFIT || !create_outfit)
{
gInventory.changeCategoryParent(
(LLViewerInventoryCategory*)inv_cat,
@@ -3950,14 +3961,17 @@ bool dragCategoryIntoFolder(LLUUID dest_id, LLInventoryCategory* inv_cat,
{
case MY_OUTFITS_NO:
// Moning from outside outfits into outfits
- if (dest_res == MY_OUTFITS_SUBFOLDER)
+ if (dest_res == MY_OUTFITS_SUBFOLDER && create_outfit)
{
// turn it into outfit
- dropToMyOutfitsSubfolder(inv_cat, dest_id, LLFolderType::FT_OUTFIT);
+ dropToMyOutfitsSubfolder(inv_cat, dest_id);
}
else
{
- dropToMyOutfitsSubfolder(inv_cat, dest_id, LLFolderType::FT_NONE);
+ gInventory.changeCategoryParent(
+ (LLViewerInventoryCategory*)inv_cat,
+ dest_id,
+ move_is_into_trash);
}
break;
case MY_OUTFITS_SUBFOLDER:
@@ -4136,10 +4150,10 @@ void dropToMyOutfits(LLInventoryCategory* inv_cat)
gInventory.createNewCategory(dest_id, LLFolderType::FT_OUTFIT, inv_cat->getName(), func, inv_cat->getThumbnailUUID());
}
-void dropToMyOutfitsSubfolder(LLInventoryCategory* inv_cat, const LLUUID &dest_id, LLFolderType::EType preferred_type)
+void dropToMyOutfitsSubfolder(LLInventoryCategory* inv_cat, const LLUUID &dest_id)
{
// Note: creation will take time, so passing folder id to callback is slightly unreliable,
// but so is collecting and passing descendants' ids
inventory_func_type func = boost::bind(&outfitFolderCreatedCallback, inv_cat->getUUID(), _1);
- gInventory.createNewCategory(dest_id, preferred_type, inv_cat->getName(), func, inv_cat->getThumbnailUUID());
+ gInventory.createNewCategory(dest_id, LLFolderType::FT_OUTFIT, inv_cat->getName(), func, inv_cat->getThumbnailUUID());
}