diff options
Diffstat (limited to 'indra/newview/llagentwearables.h')
-rw-r--r-- | indra/newview/llagentwearables.h | 61 |
1 files changed, 36 insertions, 25 deletions
diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index d3b18f68f1..def16e4e85 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -71,8 +71,8 @@ protected: //-------------------------------------------------------------------- public: BOOL isWearingItem(const LLUUID& item_id) const; - BOOL isWearableModifiable(EWearableType type, U32 index /*= 0*/) const; - BOOL isWearableCopyable(EWearableType type, U32 index /*= 0*/) const; + BOOL isWearableModifiable(LLWearableType::EType type, U32 index /*= 0*/) const; + BOOL isWearableCopyable(LLWearableType::EType type, U32 index /*= 0*/) const; BOOL areWearablesLoaded() const; void updateWearablesLoaded(); void checkWearablesLoaded() const; @@ -88,17 +88,17 @@ public: // Accessors //-------------------------------------------------------------------- public: - const LLUUID getWearableItemID(EWearableType type, U32 index /*= 0*/) const; - const LLUUID getWearableAssetID(EWearableType type, U32 index /*= 0*/) const; + const LLUUID getWearableItemID(LLWearableType::EType type, U32 index /*= 0*/) const; + const LLUUID getWearableAssetID(LLWearableType::EType type, U32 index /*= 0*/) const; const LLWearable* getWearableFromItemID(const LLUUID& item_id) const; LLWearable* getWearableFromAssetID(const LLUUID& asset_id); - LLInventoryItem* getWearableInventoryItem(EWearableType type, U32 index /*= 0*/); + LLInventoryItem* getWearableInventoryItem(LLWearableType::EType type, U32 index /*= 0*/); // MULTI-WEARABLE: assuming one per type. - static BOOL selfHasWearable(EWearableType type); - LLWearable* getWearable(const EWearableType type, U32 index /*= 0*/); - const LLWearable* getWearable(const EWearableType type, U32 index /*= 0*/) const; - LLWearable* getTopWearable(const EWearableType type); - U32 getWearableCount(const EWearableType type) const; + static BOOL selfHasWearable(LLWearableType::EType type); + LLWearable* getWearable(const LLWearableType::EType type, U32 index /*= 0*/); + const LLWearable* getWearable(const LLWearableType::EType type, U32 index /*= 0*/) const; + LLWearable* getTopWearable(const LLWearableType::EType type); + U32 getWearableCount(const LLWearableType::EType type) const; U32 getWearableCount(const U32 tex_index) const; //-------------------------------------------------------------------- @@ -107,17 +107,17 @@ public: private: // Low-level data structure setter - public access is via setWearableItem, etc. - void setWearable(const EWearableType type, U32 index, LLWearable *wearable); - U32 pushWearable(const EWearableType type, LLWearable *wearable); + void setWearable(const LLWearableType::EType type, U32 index, LLWearable *wearable); + U32 pushWearable(const LLWearableType::EType type, LLWearable *wearable); void wearableUpdated(LLWearable *wearable); void popWearable(LLWearable *wearable); - void popWearable(const EWearableType type, U32 index); + void popWearable(const LLWearableType::EType type, U32 index); public: void setWearableItem(LLInventoryItem* new_item, LLWearable* wearable, bool do_append = false); void setWearableOutfit(const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLWearable* >& wearables, BOOL remove); void setWearableName(const LLUUID& item_id, const std::string& new_name); - void addLocalTextureObject(const EWearableType wearable_type, const LLVOAvatarDefines::ETextureIndex texture_type, U32 wearable_index); + void addLocalTextureObject(const LLWearableType::EType wearable_type, const LLVOAvatarDefines::ETextureIndex texture_type, U32 wearable_index); U32 getWearableIndex(LLWearable *wearable); protected: @@ -132,16 +132,16 @@ protected: const U32 index, const LLUUID& item_id, LLWearable* wearable); - void recoverMissingWearable(const EWearableType type, U32 index /*= 0*/); + void recoverMissingWearable(const LLWearableType::EType type, U32 index /*= 0*/); void recoverMissingWearableDone(); //-------------------------------------------------------------------- // Removing wearables //-------------------------------------------------------------------- public: - void removeWearable(const EWearableType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); + void removeWearable(const LLWearableType::EType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); private: - void removeWearableFinal(const EWearableType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); + void removeWearableFinal(const LLWearableType::EType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); protected: static bool onRemoveWearableDialog(const LLSD& notification, const LLSD& response); static void userRemoveAllClothesStep2(BOOL proceed); // userdata is NULL @@ -165,7 +165,7 @@ protected: public: void getAllWearablesArray(LLDynamicArray<S32>& wearables); - // Note: wearables_to_include should be a list of EWearableType types + // Note: wearables_to_include should be a list of LLWearableType::EType types // attachments_to_include should be a list of attachment points void makeNewOutfit(const std::string& new_folder_name, const LLDynamicArray<S32>& wearables_to_include, @@ -185,17 +185,17 @@ private: //-------------------------------------------------------------------- public: // MULTI-WEARABLE: assumes one per type. - void saveWearableAs(const EWearableType type, const U32 index, const std::string& new_name, BOOL save_in_lost_and_found); - void saveWearable(const EWearableType type, const U32 index, BOOL send_update = TRUE); + void saveWearableAs(const LLWearableType::EType type, const U32 index, const std::string& new_name, BOOL save_in_lost_and_found); + void saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update = TRUE); void saveAllWearables(); - void revertWearable(const EWearableType type, const U32 index); + void revertWearable(const LLWearableType::EType type, const U32 index); //-------------------------------------------------------------------- // Static UI hooks //-------------------------------------------------------------------- public: - static void userRemoveWearable(const EWearableType &type, const U32 &index); - static void userRemoveWearablesOfType(const EWearableType &type); + static void userRemoveWearable(const LLWearableType::EType &type, const U32 &index); + static void userRemoveWearablesOfType(const LLWearableType::EType &type); static void userRemoveAllClothes(); typedef std::vector<LLViewerObject*> llvo_vec_t; @@ -209,11 +209,22 @@ public: U32 itemUpdatePendingCount() const; //-------------------------------------------------------------------- + // Signals + //-------------------------------------------------------------------- +public: + typedef boost::function<void()> loaded_callback_t; + typedef boost::signals2::signal<void()> loaded_signal_t; + boost::signals2::connection addLoadedCallback(loaded_callback_t cb); + +private: + loaded_signal_t mLoadedSignal; // emitted when all agent wearables get loaded + + //-------------------------------------------------------------------- // Member variables //-------------------------------------------------------------------- private: typedef std::vector<LLWearable*> wearableentry_vec_t; // all wearables of a certain type (EG all shirts) - typedef std::map<EWearableType, wearableentry_vec_t> wearableentry_map_t; // wearable "categories" arranged by wearable type + typedef std::map<LLWearableType::EType, wearableentry_vec_t> wearableentry_map_t; // wearable "categories" arranged by wearable type wearableentry_map_t mWearableDatas; static BOOL mInitialWearablesUpdateReceived; @@ -248,7 +259,7 @@ private: CALL_WEARITEM = 16 }; - // MULTI-WEARABLE: index is an EWearableType - more confusing usage. + // MULTI-WEARABLE: index is an LLWearableType::EType - more confusing usage. // MULTI-WEARABLE: need to have type and index args both? addWearableToAgentInventoryCallback(LLPointer<LLRefCount> cb, S32 type, |