Updated multiple attachment code from Henri.
Signed-off-by: Beeks <HgDelirium@gmail.com>
This commit is contained in:
@@ -118,7 +118,7 @@ void dec_busy_count()
|
||||
|
||||
// Function declarations
|
||||
struct LLWearableHoldingPattern;
|
||||
void wear_inventory_category_on_avatar(LLInventoryCategory* category, BOOL append);
|
||||
void wear_inventory_category_on_avatar(LLInventoryCategory* category, BOOL append, BOOL replace = FALSE);
|
||||
void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata);
|
||||
void wear_inventory_category_on_avatar_loop(LLWearable* wearable, void*);
|
||||
void wear_inventory_category_on_avatar_step3(LLWearableHoldingPattern* holder, BOOL append);
|
||||
@@ -183,6 +183,7 @@ struct LLWearInfo
|
||||
{
|
||||
LLUUID mCategoryID;
|
||||
BOOL mAppend;
|
||||
BOOL mReplace;
|
||||
};
|
||||
|
||||
|
||||
@@ -2106,6 +2107,10 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model
|
||||
{
|
||||
modifyOutfit(TRUE);
|
||||
}
|
||||
else if ("wearitems" == action)
|
||||
{
|
||||
modifyOutfit(TRUE, TRUE);
|
||||
}
|
||||
else if ("removefromoutfit" == action)
|
||||
{
|
||||
// <edit> derf
|
||||
@@ -2495,6 +2500,7 @@ void LLFolderBridge::folderOptionsMenu()
|
||||
{
|
||||
// </edit>
|
||||
mItems.push_back(std::string("Add To Outfit"));
|
||||
mItems.push_back(std::string("Wear Items"));
|
||||
mItems.push_back(std::string("Replace Outfit"));
|
||||
// <edit>
|
||||
}
|
||||
@@ -2857,7 +2863,7 @@ void LLFolderBridge::createWearable(LLUUID parent_id, EWearableType type)
|
||||
LLPointer<LLInventoryCallback>(NULL));
|
||||
}
|
||||
|
||||
void LLFolderBridge::modifyOutfit(BOOL append)
|
||||
void LLFolderBridge::modifyOutfit(BOOL append, BOOL replace)
|
||||
{
|
||||
// <edit> derf
|
||||
if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end())
|
||||
@@ -2871,7 +2877,7 @@ void LLFolderBridge::modifyOutfit(BOOL append)
|
||||
LLViewerInventoryCategory* cat = getCategory();
|
||||
if(!cat) return;
|
||||
|
||||
wear_inventory_category_on_avatar( cat, append );
|
||||
wear_inventory_category_on_avatar(cat, append, replace);
|
||||
}
|
||||
|
||||
// helper stuff
|
||||
@@ -4791,7 +4797,7 @@ void wear_inventory_category(LLInventoryCategory* category, bool copy, bool appe
|
||||
}
|
||||
|
||||
// *NOTE: hack to get from avatar inventory to avatar
|
||||
void wear_inventory_category_on_avatar( LLInventoryCategory* category, BOOL append )
|
||||
void wear_inventory_category_on_avatar(LLInventoryCategory* category, BOOL append, BOOL replace)
|
||||
{
|
||||
// Avoid unintentionally overwriting old wearables. We have to do
|
||||
// this up front to avoid having to deal with the case of multiple
|
||||
@@ -4802,6 +4808,7 @@ void wear_inventory_category_on_avatar( LLInventoryCategory* category, BOOL appe
|
||||
|
||||
LLWearInfo* userdata = new LLWearInfo;
|
||||
userdata->mAppend = append;
|
||||
userdata->mReplace = replace;
|
||||
userdata->mCategoryID = category->getUUID();
|
||||
|
||||
if( gFloaterCustomize )
|
||||
@@ -4999,7 +5006,7 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata )
|
||||
msg->nextBlockFast(_PREHASH_ObjectData );
|
||||
msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID());
|
||||
msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner());
|
||||
msg->addU8Fast(_PREHASH_AttachmentPt, 0 | ATTACHMENT_ADD); // Wear at the previous or default attachment point
|
||||
msg->addU8Fast(_PREHASH_AttachmentPt, wear_info->mReplace ? 0 : ATTACHMENT_ADD); // Wear at the previous or default attachment point
|
||||
pack_permissions_slam(msg, item->getFlags(), item->getPermissions());
|
||||
msg->addStringFast(_PREHASH_Name, item->getName());
|
||||
msg->addStringFast(_PREHASH_Description, item->getDescription());
|
||||
|
||||
Reference in New Issue
Block a user