diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llagentwearablesfetch.cpp | 48 | ||||
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llappearancemgr.h | 7 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_edit_tattoo.xml | 19 |
4 files changed, 73 insertions, 11 deletions
diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 43a0d48d8b..ef0b97d376 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -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); } } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index e017fffa54..e90dd2ac75 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -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); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 96541beb7d..dbde055c3a 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -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, diff --git a/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml b/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml index 6d02dd41de..6fa9383507 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_tattoo.xml @@ -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" /> |