summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/llagentwearablesfetch.h2
-rw-r--r--indra/newview/lldriverparam.h2
-rw-r--r--indra/newview/llinventoryicon.cpp2
-rw-r--r--indra/newview/llpaneleditwearable.h2
-rw-r--r--indra/newview/llwearable.h2
-rw-r--r--indra/newview/llwearableitemslist.h2
-rw-r--r--indra/newview/llwearabletype.cpp137
-rw-r--r--indra/newview/llwearabletype.h77
9 files changed, 222 insertions, 8 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 160b8fea48..8bef3d6b5c 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -534,9 +534,9 @@ set(viewer_SOURCE_FILES
llwaterparammanager.cpp
llwaterparamset.cpp
llwearable.cpp
- llwearabledictionary.cpp
llwearableitemslist.cpp
llwearablelist.cpp
+ llwearabletype.cpp
llweb.cpp
llwind.cpp
llwlanimator.cpp
@@ -1045,9 +1045,9 @@ set(viewer_HEADER_FILES
llwaterparammanager.h
llwaterparamset.h
llwearable.h
- llwearabledictionary.h
llwearableitemslist.h
llwearablelist.h
+ llwearabletype.h
llweb.h
llwind.h
llwindebug.h
diff --git a/indra/newview/llagentwearablesfetch.h b/indra/newview/llagentwearablesfetch.h
index 58b92a5747..faa5fbaa43 100644
--- a/indra/newview/llagentwearablesfetch.h
+++ b/indra/newview/llagentwearablesfetch.h
@@ -34,7 +34,7 @@
#define LL_LLAGENTWEARABLESINITIALFETCH_H
#include "llinventoryobserver.h"
-#include "llwearabledictionary.h"
+#include "llwearabletype.h"
#include "lluuid.h"
//--------------------------------------------------------------------
diff --git a/indra/newview/lldriverparam.h b/indra/newview/lldriverparam.h
index 2b79c18873..1069f7ad51 100644
--- a/indra/newview/lldriverparam.h
+++ b/indra/newview/lldriverparam.h
@@ -34,7 +34,7 @@
#define LL_LLDRIVERPARAM_H
#include "llviewervisualparam.h"
-#include "llwearabledictionary.h"
+#include "llwearabletype.h"
class LLVOAvatar;
class LLWearable;
diff --git a/indra/newview/llinventoryicon.cpp b/indra/newview/llinventoryicon.cpp
index 8a679297ae..144da05794 100644
--- a/indra/newview/llinventoryicon.cpp
+++ b/indra/newview/llinventoryicon.cpp
@@ -36,7 +36,7 @@
#include "lldictionary.h"
#include "llinventorydefines.h"
#include "llui.h"
-#include "llwearabledictionary.h"
+#include "llwearabletype.h"
struct IconEntry : public LLDictionaryEntry
{
diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h
index 1fed77cf91..876b22f0a5 100644
--- a/indra/newview/llpaneleditwearable.h
+++ b/indra/newview/llpaneleditwearable.h
@@ -36,7 +36,7 @@
#include "llpanel.h"
#include "llscrollingpanellist.h"
#include "llmodaldialog.h"
-#include "llwearabledictionary.h"
+#include "llwearabletype.h"
class LLWearable;
class LLTextEditor;
diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h
index dcc70cbda7..458415228f 100644
--- a/indra/newview/llwearable.h
+++ b/indra/newview/llwearable.h
@@ -38,7 +38,7 @@
#include "llpermissions.h"
#include "llsaleinfo.h"
#include "llassetstorage.h"
-#include "llwearabledictionary.h"
+#include "llwearabletype.h"
#include "llfile.h"
#include "lllocaltextureobject.h"
diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h
index 14bca21b85..41dc95cec6 100644
--- a/indra/newview/llwearableitemslist.h
+++ b/indra/newview/llwearableitemslist.h
@@ -37,7 +37,7 @@
// newview
#include "llinventoryitemslist.h"
#include "llinventorymodel.h"
-#include "llwearabledictionary.h"
+#include "llwearabletype.h"
/**
* @class LLPanelWearableListItem
diff --git a/indra/newview/llwearabletype.cpp b/indra/newview/llwearabletype.cpp
new file mode 100644
index 0000000000..ee17d7ddea
--- /dev/null
+++ b/indra/newview/llwearabletype.cpp
@@ -0,0 +1,137 @@
+/**
+ * @file llwearabletype.cpp
+ * @brief LLWearableType class implementation
+ *
+ * $LicenseInfo:firstyear=2002&license=viewergpl$
+ *
+ * Copyright (c) 2002-2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "llwearabletype.h"
+#include "llinventoryfunctions.h"
+#include "lltrans.h"
+
+struct WearableEntry : public LLDictionaryEntry
+{
+ WearableEntry(const std::string &name,
+ const std::string& default_new_name,
+ LLAssetType::EType assetType,
+ LLInventoryIcon::EIconName iconName);
+ const LLAssetType::EType mAssetType;
+ const std::string mLabel;
+ const std::string mDefaultNewName; //keep mLabel for backward compatibility
+ LLInventoryIcon::EIconName mIconName;
+};
+
+WearableEntry::WearableEntry(const std::string &name,
+ const std::string& default_new_name,
+ LLAssetType::EType assetType,
+ LLInventoryIcon::EIconName iconName) :
+ LLDictionaryEntry(name),
+ mAssetType(assetType),
+ mDefaultNewName(default_new_name),
+ mLabel(LLTrans::getString(name)),
+ mIconName(iconName)
+{
+}
+
+class LLWearableDictionary : public LLSingleton<LLWearableDictionary>,
+ public LLDictionary<LLWearableType::EType, WearableEntry>
+{
+public:
+ LLWearableDictionary();
+};
+
+LLWearableDictionary::LLWearableDictionary()
+{
+ addEntry(LLWearableType::WT_SHAPE, new WearableEntry("shape", "New Shape", LLAssetType::AT_BODYPART, LLInventoryIcon::ICONNAME_BODYPART_SHAPE));
+ addEntry(LLWearableType::WT_SKIN, new WearableEntry("skin", "New Skin", LLAssetType::AT_BODYPART, LLInventoryIcon::ICONNAME_BODYPART_SKIN));
+ addEntry(LLWearableType::WT_HAIR, new WearableEntry("hair", "New Hair", LLAssetType::AT_BODYPART, LLInventoryIcon::ICONNAME_BODYPART_HAIR));
+ addEntry(LLWearableType::WT_EYES, new WearableEntry("eyes", "New Eyes", LLAssetType::AT_BODYPART, LLInventoryIcon::ICONNAME_BODYPART_EYES));
+ addEntry(LLWearableType::WT_SHIRT, new WearableEntry("shirt", "New Shirt", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_SHIRT));
+ addEntry(LLWearableType::WT_PANTS, new WearableEntry("pants", "New Pants", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_PANTS));
+ addEntry(LLWearableType::WT_SHOES, new WearableEntry("shoes", "New Shoes", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_SHOES));
+ addEntry(LLWearableType::WT_SOCKS, new WearableEntry("socks", "New Socks", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_SOCKS));
+ addEntry(LLWearableType::WT_JACKET, new WearableEntry("jacket", "New Jacket", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_JACKET));
+ addEntry(LLWearableType::WT_GLOVES, new WearableEntry("gloves", "New Gloves", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_GLOVES));
+ addEntry(LLWearableType::WT_UNDERSHIRT, new WearableEntry("undershirt", "New Undershirt", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_UNDERSHIRT));
+ addEntry(LLWearableType::WT_UNDERPANTS, new WearableEntry("underpants", "New Underpants", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_UNDERPANTS));
+ addEntry(LLWearableType::WT_SKIRT, new WearableEntry("skirt", "New Skirt", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_SKIRT));
+ addEntry(LLWearableType::WT_ALPHA, new WearableEntry("alpha", "New Alpha", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_ALPHA));
+ addEntry(LLWearableType::WT_TATTOO, new WearableEntry("tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_TATTOO));
+ addEntry(LLWearableType::WT_NONE, new WearableEntry("invalid", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryIcon::ICONNAME_NONE));
+ addEntry(LLWearableType::WT_COUNT, NULL);
+}
+
+// static
+LLWearableType::EType LLWearableType::typeNameToType(const std::string& type_name)
+{
+ const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
+ const LLWearableType::EType wearable = dict->lookup(type_name);
+ return wearable;
+}
+
+// static
+const std::string& LLWearableType::getTypeName(LLWearableType::EType type)
+{
+ const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
+ const WearableEntry *entry = dict->lookup(type);
+ return entry->mName;
+}
+
+//static
+const std::string& LLWearableType::getTypeDefaultNewName(LLWearableType::EType type)
+{
+ const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
+ const WearableEntry *entry = dict->lookup(type);
+ return entry->mDefaultNewName;
+}
+
+// static
+const std::string& LLWearableType::getTypeLabel(LLWearableType::EType type)
+{
+ const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
+ const WearableEntry *entry = dict->lookup(type);
+ return entry->mLabel;
+}
+
+// static
+LLAssetType::EType LLWearableType::getAssetType(LLWearableType::EType type)
+{
+ const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
+ const WearableEntry *entry = dict->lookup(type);
+ return entry->mAssetType;
+}
+
+// static
+LLInventoryIcon::EIconName LLWearableType::getIconName(LLWearableType::EType type)
+{
+ const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
+ const WearableEntry *entry = dict->lookup(type);
+ return entry->mIconName;
+}
+
diff --git a/indra/newview/llwearabletype.h b/indra/newview/llwearabletype.h
new file mode 100644
index 0000000000..b0326ce0d8
--- /dev/null
+++ b/indra/newview/llwearabletype.h
@@ -0,0 +1,77 @@
+/**
+ * @file llwearabletype.h
+ * @brief LLWearableType class header file
+ *
+ * $LicenseInfo:firstyear=2002&license=viewergpl$
+ *
+ * Copyright (c) 2002-2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ * * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLWEARABLETYPE_H
+#define LL_LLWEARABLETYPE_H
+
+#include "llassettype.h"
+#include "lldictionary.h"
+#include "llinventoryicon.h"
+#include "llsingleton.h"
+
+class LLWearableType
+{
+public:
+ enum EType
+ {
+ WT_SHAPE = 0,
+ WT_SKIN = 1,
+ WT_HAIR = 2,
+ WT_EYES = 3,
+ WT_SHIRT = 4,
+ WT_PANTS = 5,
+ WT_SHOES = 6,
+ WT_SOCKS = 7,
+ WT_JACKET = 8,
+ WT_GLOVES = 9,
+ WT_UNDERSHIRT = 10,
+ WT_UNDERPANTS = 11,
+ WT_SKIRT = 12,
+ WT_ALPHA = 13,
+ WT_TATTOO = 14,
+ WT_COUNT = 15,
+
+ WT_NONE = -1,
+ };
+
+ 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 LLInventoryIcon::EIconName getIconName(EType type);
+
+protected:
+ LLWearableType() {}
+ ~LLWearableType() {}
+};
+
+#endif // LL_LLWEARABLETYPE_H