diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-11-16 01:21:05 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-11-16 01:21:05 +0200 |
commit | 0bffd3d365023fea504b1070480e7b2f72080129 (patch) | |
tree | e11a931c690abe94ca1d7201a9375ea2ed8e1158 /indra/llappearance/llwearabletype.h | |
parent | 3c2ccd879cb59ac0fdcacfab1fe68bc4dcefc68b (diff) | |
parent | 9957c28ddc5e5c129af2db662da7d69f1509af65 (diff) |
Merge branch 'master' into DRTVWR-519
# Conflicts:
# README.md
Diffstat (limited to 'indra/llappearance/llwearabletype.h')
-rw-r--r-- | indra/llappearance/llwearabletype.h | 56 |
1 files changed, 44 insertions, 12 deletions
diff --git a/indra/llappearance/llwearabletype.h b/indra/llappearance/llwearabletype.h index 57f3ef160d..793a33cc87 100644 --- a/indra/llappearance/llwearabletype.h +++ b/indra/llappearance/llwearabletype.h @@ -35,10 +35,9 @@ class LLWearableType : public LLParamSingleton<LLWearableType> { - LLSINGLETON(LLWearableType, LLTranslationBridge* trans); + LLSINGLETON(LLWearableType, LLTranslationBridge::ptr_t &trans); ~LLWearableType(); void initSingleton(); - friend struct WearableEntry; public: enum EType { @@ -67,20 +66,53 @@ public: // Most methods are wrappers for dictionary, but if LLWearableType is not initialized, // they will crash. Whole LLWearableType is just wrapper for convinient calls. - static const std::string& getTypeName(EType type); - static const std::string& getTypeDefaultNewName(EType type); - static const std::string& getTypeLabel(EType type); - static LLAssetType::EType getAssetType(EType type); - static EType typeNameToType(const std::string& type_name); - static LLInventoryType::EIconName getIconName(EType type); - static BOOL getDisableCameraSwitch(EType type); - static BOOL getAllowMultiwear(EType type); + const std::string& getTypeName(EType type); + const std::string& getTypeDefaultNewName(EType type); + const std::string& getTypeLabel(EType type); + LLAssetType::EType getAssetType(EType type); + EType typeNameToType(const std::string& type_name); + LLInventoryType::EIconName getIconName(EType type); + BOOL getDisableCameraSwitch(EType type); + BOOL getAllowMultiwear(EType type); static EType inventoryFlagsToWearableType(U32 flags); -protected: +private: + struct WearableEntry : public LLDictionaryEntry + { + WearableEntry(LLTranslationBridge::ptr_t& trans, + const std::string &name, + const std::string& default_new_name, + LLAssetType::EType assetType, + LLInventoryType::EIconName iconName, + BOOL disable_camera_switch = FALSE, + BOOL allow_multiwear = TRUE) : + LLDictionaryEntry(name), + mAssetType(assetType), + mDefaultNewName(default_new_name), + mLabel(trans->getString(name)), + mIconName(iconName), + mDisableCameraSwitch(disable_camera_switch), + mAllowMultiwear(allow_multiwear) + { - LLTranslationBridge* mTrans; + } + const LLAssetType::EType mAssetType; + const std::string mLabel; + const std::string mDefaultNewName; + LLInventoryType::EIconName mIconName; + BOOL mDisableCameraSwitch; + BOOL mAllowMultiwear; + }; + + class LLWearableDictionary : public LLDictionary<LLWearableType::EType, WearableEntry> + { + public: + LLWearableDictionary(LLTranslationBridge::ptr_t& trans); + ~LLWearableDictionary() {} + }; + + LLWearableDictionary mDictionary; }; #endif // LL_LLWEARABLETYPE_H |