commit
d2cc5dd0f5
|
|
@ -40,6 +40,50 @@
|
|||
#include "llstartup.h"
|
||||
#include "llvoavatarself.h"
|
||||
|
||||
|
||||
class LLOrderMyOutfitsOnDestroy: public LLInventoryCallback
|
||||
{
|
||||
public:
|
||||
LLOrderMyOutfitsOnDestroy() {};
|
||||
|
||||
virtual ~LLOrderMyOutfitsOnDestroy()
|
||||
{
|
||||
const LLUUID& my_outfits_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
|
||||
if (my_outfits_id.isNull()) return;
|
||||
|
||||
LLInventoryModel::cat_array_t* cats;
|
||||
LLInventoryModel::item_array_t* items;
|
||||
gInventory.getDirectDescendentsOf(my_outfits_id, cats, items);
|
||||
if (!cats) return;
|
||||
|
||||
//My Outfits should at least contain saved initial outfit and one another outfit
|
||||
if (cats->size() < 2)
|
||||
{
|
||||
llwarning("My Outfits category was not populated properly", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
llinfos << "Starting updating My Outfits with wearables ordering information" << llendl;
|
||||
|
||||
for (LLInventoryModel::cat_array_t::iterator outfit_iter = cats->begin();
|
||||
outfit_iter != cats->end(); ++outfit_iter)
|
||||
{
|
||||
const LLUUID& cat_id = (*outfit_iter)->getUUID();
|
||||
if (cat_id.isNull()) continue;
|
||||
|
||||
// saved initial outfit already contains wearables ordering information
|
||||
if (cat_id == LLAppearanceMgr::getInstance()->getBaseOutfitUUID()) continue;
|
||||
|
||||
LLAppearanceMgr::getInstance()->updateClothingOrderingInfo(cat_id);
|
||||
}
|
||||
|
||||
llinfos << "Finished updating My Outfits with wearables ordering information" << llendl;
|
||||
}
|
||||
|
||||
/* virtual */ void fire(const LLUUID& inv_item) {};
|
||||
};
|
||||
|
||||
|
||||
LLInitialWearablesFetch::LLInitialWearablesFetch(const LLUUID& cof_id) :
|
||||
LLInventoryFetchDescendentsObserver(cof_id)
|
||||
{
|
||||
|
|
@ -483,6 +527,8 @@ void LLLibraryOutfitsFetch::contentsDone()
|
|||
LLInventoryModel::cat_array_t cat_array;
|
||||
LLInventoryModel::item_array_t wearable_array;
|
||||
|
||||
LLPointer<LLOrderMyOutfitsOnDestroy> order_myoutfits_on_destroy = new LLOrderMyOutfitsOnDestroy;
|
||||
|
||||
for (uuid_vec_t::const_iterator folder_iter = mImportedClothingFolders.begin();
|
||||
folder_iter != mImportedClothingFolders.end();
|
||||
++folder_iter)
|
||||
|
|
@ -518,7 +564,7 @@ void LLLibraryOutfitsFetch::contentsDone()
|
|||
item->getName(),
|
||||
item->getDescription(),
|
||||
LLAssetType::AT_LINK,
|
||||
NULL);
|
||||
order_myoutfits_on_destroy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1792,10 +1792,16 @@ struct WearablesOrderComparator
|
|||
U32 mControlSize;
|
||||
};
|
||||
|
||||
void LLAppearanceMgr::updateClothingOrderingInfo()
|
||||
void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id)
|
||||
{
|
||||
if (cat_id.isNull())
|
||||
{
|
||||
cat_id = getCOF();
|
||||
}
|
||||
|
||||
// COF is processed if cat_id is not specified
|
||||
LLInventoryModel::item_array_t wear_items;
|
||||
getDescendentsOfAssetType(getCOF(), wear_items, LLAssetType::AT_CLOTHING, false);
|
||||
getDescendentsOfAssetType(cat_id, wear_items, LLAssetType::AT_CLOTHING, false);
|
||||
|
||||
wearables_by_type_t items_by_type(LLWearableType::WT_COUNT);
|
||||
divvyWearablesByType(wear_items, items_by_type);
|
||||
|
|
|
|||
|
|
@ -154,15 +154,16 @@ public:
|
|||
//Divvy items into arrays by wearable type
|
||||
static void divvyWearablesByType(const LLInventoryModel::item_array_t& items, wearables_by_type_t& items_by_type);
|
||||
|
||||
//Check ordering information on wearables stored in links' descriptions and update if it is invalid
|
||||
// COF is processed if cat_id is not specified
|
||||
void updateClothingOrderingInfo(LLUUID cat_id = LLUUID::null);
|
||||
|
||||
protected:
|
||||
LLAppearanceMgr();
|
||||
~LLAppearanceMgr();
|
||||
|
||||
private:
|
||||
|
||||
//Check ordering information on wearables stored in links' descriptions and update if it is invalid
|
||||
void updateClothingOrderingInfo();
|
||||
|
||||
void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type);
|
||||
|
||||
void getDescendentsOfAssetType(const LLUUID& category,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,10 @@
|
|||
name="Head Tattoo"
|
||||
tool_tip="Click to choose a picture"
|
||||
top="10"
|
||||
width="94" />
|
||||
width="94" >
|
||||
<texture_picker.commit_callback
|
||||
function="TexturePicker.Commit" />
|
||||
</texture_picker>
|
||||
<texture_picker
|
||||
can_apply_immediately="true"
|
||||
default_image_name="Default"
|
||||
|
|
@ -44,7 +47,10 @@
|
|||
name="Upper Tattoo"
|
||||
tool_tip="Click to choose a picture"
|
||||
top="10"
|
||||
width="94" />
|
||||
width="94" >
|
||||
<texture_picker.commit_callback
|
||||
function="TexturePicker.Commit" />
|
||||
</texture_picker>
|
||||
<texture_picker
|
||||
can_apply_immediately="true"
|
||||
default_image_name="Default"
|
||||
|
|
@ -56,17 +62,20 @@
|
|||
name="Lower Tattoo"
|
||||
tool_tip="Click to choose a picture"
|
||||
top_pad="10"
|
||||
width="94" />
|
||||
width="94" >
|
||||
<texture_picker.commit_callback
|
||||
function="TexturePicker.Commit" />
|
||||
</texture_picker>
|
||||
<color_swatch
|
||||
can_apply_immediately="true"
|
||||
follows="left|top"
|
||||
height="80"
|
||||
label="Color/Tint"
|
||||
layout="topleft"
|
||||
left_pad="20"
|
||||
left_pad="45"
|
||||
name="Color/Tint"
|
||||
tool_tip="Click to open color picker"
|
||||
top="10"
|
||||
top_delta="10"
|
||||
width="64" >
|
||||
<color_swatch.commit_callback
|
||||
function="ColorSwatch.Commit" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue