Brought over LLInventoryIcon
This commit is contained in:
@@ -280,6 +280,7 @@ set(viewer_SOURCE_FILES
|
||||
llinventorybackup.cpp
|
||||
llinventorybridge.cpp
|
||||
llinventoryclipboard.cpp
|
||||
llinventoryicon.cpp
|
||||
llinventorymodel.cpp
|
||||
llinventoryview.cpp
|
||||
lljoystickbutton.cpp
|
||||
@@ -762,6 +763,7 @@ set(viewer_HEADER_FILES
|
||||
llinventorybackup.h
|
||||
llinventorybridge.h
|
||||
llinventoryclipboard.h
|
||||
llinventoryicon.h
|
||||
llinventorymodel.h
|
||||
llinventoryview.h
|
||||
lljoystickbutton.h
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "llalertdialog.h"
|
||||
#include "llinventorymodel.h" // for gInventory
|
||||
#include "llinventorydefines.h"
|
||||
#include "llinventoryview.h" // for get_item_icon
|
||||
#include "llinventoryicon.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llselectmgr.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
@@ -156,7 +156,7 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info)
|
||||
LLSD row;
|
||||
|
||||
// Compute icon for this item
|
||||
std::string icon_name = get_item_icon_name(LLAssetType::AT_OBJECT,
|
||||
std::string icon_name = LLInventoryIcon::getIconName(LLAssetType::AT_OBJECT,
|
||||
LLInventoryType::IT_OBJECT,
|
||||
0x0, FALSE);
|
||||
|
||||
@@ -258,7 +258,7 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj,
|
||||
item_is_multi = TRUE;
|
||||
}
|
||||
|
||||
std::string icon_name = get_item_icon_name(inv_item->getType(),
|
||||
std::string icon_name = LLInventoryIcon::getIconName(inv_item->getType(),
|
||||
inv_item->getInventoryType(),
|
||||
inv_item->getFlags(),
|
||||
item_is_multi);
|
||||
|
||||
@@ -47,7 +47,8 @@
|
||||
#include "llcheckboxctrl.h"
|
||||
#include "llinventorymodel.h" // for gInventory
|
||||
#include "llinventorydefines.h"
|
||||
#include "llinventoryview.h" // for get_item_icon
|
||||
#include "llinventoryview.h"
|
||||
#include "llinventoryicon.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llselectmgr.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
@@ -225,7 +226,7 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj,
|
||||
item_is_multi = TRUE;
|
||||
}
|
||||
|
||||
std::string icon_name = get_item_icon_name(inv_item->getType(),
|
||||
std::string icon_name =LLInventoryIcon::getIconName(inv_item->getType(),
|
||||
inv_item->getInventoryType(),
|
||||
inv_item->getFlags(),
|
||||
item_is_multi);
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
#include "lltabcontainervertical.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "llinventoryview.h"
|
||||
#include "llinventoryicon.h"
|
||||
#include "lltextbox.h"
|
||||
#include "lllineeditor.h"
|
||||
#include "llviewertexturelist.h"
|
||||
@@ -511,7 +511,7 @@ BOOL LLPanelEditWearable::postBuild()
|
||||
/*std::string icon_name = (asset_type == LLAssetType::AT_CLOTHING ?
|
||||
"inv_item_clothing.tga" :
|
||||
"inv_item_skin.tga" );*/
|
||||
std::string icon_name = get_item_icon_name(asset_type,LLInventoryType::IT_WEARABLE,mType,FALSE);
|
||||
std::string icon_name = LLInventoryIcon::getIconName(asset_type,LLInventoryType::IT_WEARABLE,mType,FALSE);
|
||||
|
||||
childSetValue("icon", icon_name);
|
||||
|
||||
|
||||
@@ -46,8 +46,9 @@
|
||||
|
||||
#include "llagent.h" // for agent id
|
||||
#include "llalertdialog.h"
|
||||
#include "llinventoryview.h"
|
||||
#include "llinventorybridge.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "llinventoryview.h"
|
||||
#include "llpanelinventory.h"
|
||||
#include "llselectmgr.h"
|
||||
#include "lluiconstants.h"
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include "llui.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llfloatergroupinfo.h"
|
||||
#include "llinventoryview.h"
|
||||
#include "llinventoryicon.h"
|
||||
#include "llinventory.h"
|
||||
|
||||
#include "llglheaders.h"
|
||||
@@ -218,7 +218,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
|
||||
{
|
||||
addChild(new NoticeText(std::string("subjecttitle"),LLRect(x,y,x + LABEL_WIDTH,y - LINE_HEIGHT),std::string("Attached: "),LLFontGL::getFontSansSerif()));
|
||||
|
||||
LLUIImagePtr item_icon = get_item_icon(mInventoryOffer->mType,
|
||||
LLUIImagePtr item_icon = LLInventoryIcon::getIcon(mInventoryOffer->mType,
|
||||
LLInventoryType::IT_TEXTURE,
|
||||
0, FALSE);
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "llinventoryview.h"
|
||||
#include "llinventorybridge.h"
|
||||
#include "llinventorydefines.h"
|
||||
#include "llinventoryicon.h"
|
||||
|
||||
#include "message.h"
|
||||
|
||||
@@ -122,6 +123,18 @@
|
||||
#include "llattachmentsmgr.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
typedef std::pair<LLUUID, LLUUID> two_uuids_t;
|
||||
typedef std::list<two_uuids_t> two_uuids_list_t;
|
||||
|
||||
struct LLMoveInv
|
||||
{
|
||||
LLUUID mObjectID;
|
||||
LLUUID mCategoryID;
|
||||
two_uuids_list_t mMoveList;
|
||||
void (*mCallback)(S32, void*);
|
||||
void* mUserData;
|
||||
};
|
||||
|
||||
// Helpers
|
||||
// bug in busy count inc/dec right now, logic is complex... do we really need it?
|
||||
void inc_busy_count()
|
||||
@@ -162,47 +175,6 @@ void gotAssetForSaveItemAs(LLVFS *vfs,
|
||||
void* user_data, S32 status, LLExtStat ext_status);
|
||||
// </edit>
|
||||
|
||||
std::string ICON_NAME[ICON_NAME_COUNT] =
|
||||
{
|
||||
"inv_item_texture.tga",
|
||||
"inv_item_sound.tga",
|
||||
"inv_item_callingcard_online.tga",
|
||||
"inv_item_callingcard_offline.tga",
|
||||
"inv_item_landmark.tga",
|
||||
"inv_item_landmark_visited.tga",
|
||||
"inv_item_script.tga",
|
||||
"inv_item_clothing.tga",
|
||||
"inv_item_object.tga",
|
||||
"inv_item_object_multi.tga",
|
||||
"inv_item_notecard.tga",
|
||||
"inv_item_skin.tga",
|
||||
"inv_item_snapshot.tga",
|
||||
|
||||
"inv_item_shape.tga",
|
||||
"inv_item_skin.tga",
|
||||
"inv_item_hair.tga",
|
||||
"inv_item_eyes.tga",
|
||||
"inv_item_shirt.tga",
|
||||
"inv_item_pants.tga",
|
||||
"inv_item_shoes.tga",
|
||||
"inv_item_socks.tga",
|
||||
"inv_item_jacket.tga",
|
||||
"inv_item_gloves.tga",
|
||||
"inv_item_undershirt.tga",
|
||||
"inv_item_underpants.tga",
|
||||
"inv_item_skirt.tga",
|
||||
"inv_item_alpha.tga",
|
||||
"inv_item_tattoo.tga",
|
||||
"inv_item_physics.png",
|
||||
|
||||
"inv_item_animation.tga",
|
||||
"inv_item_gesture.tga",
|
||||
|
||||
"inv_link_item.tga",
|
||||
"inv_link_folder.tga"
|
||||
"inv_item_mesh.png"
|
||||
};
|
||||
|
||||
struct LLWearInfo
|
||||
{
|
||||
LLUUID mCategoryID;
|
||||
@@ -1051,7 +1023,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
|
||||
{
|
||||
llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl;
|
||||
}
|
||||
new_listener = new LLScriptBridge(inventory, uuid);
|
||||
new_listener = new LLItemBridge(inventory, uuid);
|
||||
break;
|
||||
|
||||
case LLAssetType::AT_OBJECT:
|
||||
@@ -1332,13 +1304,12 @@ LLUIImagePtr LLItemBridge::getIcon() const
|
||||
LLInventoryObject *obj = getInventoryObject();
|
||||
if (obj)
|
||||
{
|
||||
return get_item_icon( obj->getType(),
|
||||
LLInventoryType::IT_NONE,
|
||||
0,
|
||||
mIsLink);
|
||||
return LLInventoryIcon::getIcon(obj->getType(),
|
||||
LLInventoryType::IT_NONE,
|
||||
mIsLink);
|
||||
}
|
||||
|
||||
return LLUI::getUIImage(ICON_NAME[OBJECT_ICON_NAME]);
|
||||
return LLInventoryIcon::getIcon(LLInventoryIcon::ICONNAME_OBJECT);
|
||||
}
|
||||
|
||||
PermissionMask LLItemBridge::getPermissionMask() const
|
||||
@@ -3167,22 +3138,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
|
||||
return accept;
|
||||
}
|
||||
|
||||
// +=================================================+
|
||||
// | LLScriptBridge (DEPRECATED) |
|
||||
// +=================================================+
|
||||
|
||||
LLUIImagePtr LLScriptBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE);
|
||||
}
|
||||
|
||||
// +=================================================+
|
||||
// | LLTextureBridge |
|
||||
// +=================================================+
|
||||
|
||||
LLUIImagePtr LLTextureBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_TEXTURE, mInvType, 0, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_TEXTURE, mInvType);
|
||||
}
|
||||
|
||||
void open_texture(const LLUUID& item_id,
|
||||
@@ -3333,7 +3295,7 @@ LLLandmarkBridge::LLLandmarkBridge(LLInventoryPanel* inventory,
|
||||
|
||||
LLUIImagePtr LLLandmarkBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, mVisited, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, mVisited, FALSE);
|
||||
}
|
||||
|
||||
void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
@@ -3538,7 +3500,7 @@ LLUIImagePtr LLCallingCardBridge::getIcon() const
|
||||
{
|
||||
online = LLAvatarTracker::instance().isBuddyOnline(item->getCreatorUUID());
|
||||
}
|
||||
return get_item_icon(LLAssetType::AT_CALLINGCARD, LLInventoryType::IT_CALLINGCARD, online, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_CALLINGCARD, LLInventoryType::IT_CALLINGCARD, online, FALSE);
|
||||
}
|
||||
|
||||
std::string LLCallingCardBridge::getLabelSuffix() const
|
||||
@@ -4020,7 +3982,7 @@ BOOL LLObjectBridge::isItemRemovable()
|
||||
|
||||
LLUIImagePtr LLObjectBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_OBJECT, mInvType, mAttachPt, mIsMultiObject );
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_OBJECT, mInvType, mAttachPt, mIsMultiObject );
|
||||
}
|
||||
|
||||
LLInventoryObject* LLObjectBridge::getObject() const
|
||||
@@ -5255,7 +5217,7 @@ std::string LLWearableBridge::getLabelSuffix() const
|
||||
|
||||
LLUIImagePtr LLWearableBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(mAssetType, mInvType, mWearableType, FALSE);
|
||||
return LLInventoryIcon::getIcon(mAssetType, mInvType, mWearableType, FALSE);
|
||||
}
|
||||
|
||||
// virtual
|
||||
@@ -5618,9 +5580,9 @@ LLUIImagePtr LLLinkItemBridge::getIcon() const
|
||||
U32 attachment_point = (item->getFlags() & 0xff); // low byte of inventory flags
|
||||
bool is_multi = LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS & item->getFlags();
|
||||
|
||||
return get_item_icon(item->getActualType(), item->getInventoryType(), attachment_point, is_multi);
|
||||
return LLInventoryIcon::getIcon(item->getActualType(), item->getInventoryType(), attachment_point, is_multi);
|
||||
}
|
||||
return get_item_icon(LLAssetType::AT_LINK, LLInventoryType::IT_NONE, 0, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_LINK, LLInventoryType::IT_NONE, 0, FALSE);
|
||||
}
|
||||
|
||||
void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
@@ -5721,7 +5683,7 @@ const LLUUID &LLLinkFolderBridge::getFolderID() const
|
||||
|
||||
LLUIImagePtr LLMeshBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_TEXTURE, LLInventoryType::IT_TEXTURE, 0, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_MESH, LLInventoryType::IT_MESH, 0, FALSE);
|
||||
}
|
||||
|
||||
void LLMeshBridge::openItem()
|
||||
|
||||
@@ -47,65 +47,8 @@ class LLMenuGL;
|
||||
class LLCallingCardObserver;
|
||||
class LLViewerJointAttachment;
|
||||
|
||||
enum EInventoryIcon
|
||||
{
|
||||
TEXTURE_ICON_NAME,
|
||||
SOUND_ICON_NAME,
|
||||
CALLINGCARD_ONLINE_ICON_NAME,
|
||||
CALLINGCARD_OFFLINE_ICON_NAME,
|
||||
LANDMARK_ICON_NAME,
|
||||
LANDMARK_VISITED_ICON_NAME,
|
||||
SCRIPT_ICON_NAME,
|
||||
CLOTHING_ICON_NAME,
|
||||
OBJECT_ICON_NAME,
|
||||
OBJECT_MULTI_ICON_NAME,
|
||||
NOTECARD_ICON_NAME,
|
||||
BODYPART_ICON_NAME,
|
||||
SNAPSHOT_ICON_NAME,
|
||||
|
||||
BODYPART_SHAPE_ICON_NAME,
|
||||
BODYPART_SKIN_ICON_NAME,
|
||||
BODYPART_HAIR_ICON_NAME,
|
||||
BODYPART_EYES_ICON_NAME,
|
||||
CLOTHING_SHIRT_ICON_NAME,
|
||||
CLOTHING_PANTS_ICON_NAME,
|
||||
CLOTHING_SHOES_ICON_NAME,
|
||||
CLOTHING_SOCKS_ICON_NAME,
|
||||
CLOTHING_JACKET_ICON_NAME,
|
||||
CLOTHING_GLOVES_ICON_NAME,
|
||||
CLOTHING_UNDERSHIRT_ICON_NAME,
|
||||
CLOTHING_UNDERPANTS_ICON_NAME,
|
||||
CLOTHING_SKIRT_ICON_NAME,
|
||||
CLOTHING_ALPHA_ICON_NAME,
|
||||
CLOTHING_TATTOO_ICON_NAME,
|
||||
CLOTHING_PHYSICS_ICON_NAME,
|
||||
|
||||
ANIMATION_ICON_NAME,
|
||||
GESTURE_ICON_NAME,
|
||||
|
||||
LINKITEM_ICON_NAME,
|
||||
LINKFOLDER_ICON_NAME,
|
||||
MESH_ICON_NAME,
|
||||
|
||||
ICON_NAME_COUNT
|
||||
};
|
||||
|
||||
extern std::string ICON_NAME[ICON_NAME_COUNT];
|
||||
|
||||
typedef std::pair<LLUUID, LLUUID> two_uuids_t;
|
||||
typedef std::list<two_uuids_t> two_uuids_list_t;
|
||||
typedef std::pair<LLUUID, two_uuids_list_t> uuid_move_list_t;
|
||||
typedef std::vector<std::string> menuentry_vec_t;
|
||||
|
||||
struct LLMoveInv
|
||||
{
|
||||
LLUUID mObjectID;
|
||||
LLUUID mCategoryID;
|
||||
two_uuids_list_t mMoveList;
|
||||
void (*mCallback)(S32, void*);
|
||||
void* mUserData;
|
||||
};
|
||||
|
||||
struct LLAttachmentRezAction
|
||||
{
|
||||
LLUUID mItemID;
|
||||
@@ -417,18 +360,6 @@ private:
|
||||
menuentry_vec_t mDisabledItems;
|
||||
};
|
||||
|
||||
// DEPRECATED
|
||||
class LLScriptBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
LLUIImagePtr getIcon() const;
|
||||
|
||||
protected:
|
||||
LLScriptBridge( LLInventoryPanel* inventory, const LLUUID& uuid ) :
|
||||
LLItemBridge(inventory, uuid) {}
|
||||
};
|
||||
|
||||
|
||||
class LLTextureBridge : public LLItemBridge
|
||||
{
|
||||
@@ -647,23 +578,30 @@ protected:
|
||||
static std::string sPrefix;
|
||||
};
|
||||
|
||||
class LLMeshBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void openItem();
|
||||
virtual void previewItem();
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
|
||||
protected:
|
||||
LLMeshBridge(LLInventoryPanel* inventory,
|
||||
const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, uuid) {}
|
||||
class LLMeshBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void openItem();
|
||||
virtual void previewItem();
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
|
||||
protected:
|
||||
LLMeshBridge(LLInventoryPanel* inventory,
|
||||
const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, uuid) {}
|
||||
};
|
||||
|
||||
void rez_attachment(LLViewerInventoryItem* item,
|
||||
LLViewerJointAttachment* attachment,
|
||||
bool replace = false);
|
||||
|
||||
// Move items from an in-world object's "Contents" folder to a specified
|
||||
// folder in agent inventory.
|
||||
BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
|
||||
const LLUUID& category_id,
|
||||
BOOL drop,
|
||||
void (*callback)(S32, void*) = NULL,
|
||||
void* user_data = NULL);
|
||||
#endif // LL_LLINVENTORYBRIDGE_H
|
||||
|
||||
183
indra/newview/llinventoryicon.cpp
Normal file
183
indra/newview/llinventoryicon.cpp
Normal file
@@ -0,0 +1,183 @@
|
||||
/**
|
||||
* @file llinventoryicon.cpp
|
||||
* @brief Implementation of the inventory icon.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
#include "llinventoryicon.h"
|
||||
|
||||
#include "lldictionary.h"
|
||||
#include "llinventorydefines.h"
|
||||
#include "llui.h"
|
||||
#include "llwearabletype.h"
|
||||
|
||||
struct IconEntry : public LLDictionaryEntry
|
||||
{
|
||||
IconEntry(const std::string &item_name)
|
||||
:
|
||||
LLDictionaryEntry(item_name)
|
||||
{}
|
||||
};
|
||||
|
||||
class LLIconDictionary : public LLSingleton<LLIconDictionary>,
|
||||
public LLDictionary<LLInventoryIcon::EIconName, IconEntry>
|
||||
{
|
||||
public:
|
||||
LLIconDictionary();
|
||||
};
|
||||
|
||||
LLIconDictionary::LLIconDictionary()
|
||||
{
|
||||
addEntry(LLInventoryIcon::ICONNAME_TEXTURE, new IconEntry("inv_item_texture.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_SOUND, new IconEntry("inv_item_sound.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CALLINGCARD_ONLINE, new IconEntry("inv_item_callingcard_online.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CALLINGCARD_OFFLINE, new IconEntry("inv_item_callingcard_offline.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_LANDMARK, new IconEntry("inv_item_landmark.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_LANDMARK_VISITED, new IconEntry("inv_item_landmark_visited.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_SCRIPT, new IconEntry("inv_item_script.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING, new IconEntry("inv_item_clothing.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_OBJECT, new IconEntry("inv_item_object.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_OBJECT_MULTI, new IconEntry("inv_item_object_multi.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_NOTECARD, new IconEntry("inv_item_notecard.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_BODYPART, new IconEntry("inv_item_skin.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_SNAPSHOT, new IconEntry("inv_item_snapshot.tga"));
|
||||
|
||||
addEntry(LLInventoryIcon::ICONNAME_BODYPART_SHAPE, new IconEntry("inv_item_shape.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_BODYPART_SKIN, new IconEntry("inv_item_skin.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_BODYPART_HAIR, new IconEntry("inv_item_hair.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_BODYPART_EYES, new IconEntry("inv_item_eyes.tga"));
|
||||
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_SHIRT, new IconEntry("inv_item_skirt.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_PANTS, new IconEntry("inv_item_pants.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_SHOES, new IconEntry("inv_item_shoes.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_SOCKS, new IconEntry("inv_item_socks.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_JACKET, new IconEntry("inv_item_jacket.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_GLOVES, new IconEntry("inv_item_gloves.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_UNDERSHIRT, new IconEntry("inv_item_undershirt.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_UNDERPANTS, new IconEntry("inv_item_underpants.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_SKIRT, new IconEntry("inv_item_skirt.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_ALPHA, new IconEntry("inv_item_alpha.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_TATTOO, new IconEntry("inv_item_tattoo.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_ANIMATION, new IconEntry("inv_item_animation.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_GESTURE, new IconEntry("inv_item_gesture.tga"));
|
||||
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_PHYSICS, new IconEntry("inv_item_physics.tga"));
|
||||
|
||||
addEntry(LLInventoryIcon::ICONNAME_LINKITEM, new IconEntry("inv_link_item.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_LINKFOLDER, new IconEntry("inv_link_folder.tga"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_MESH, new IconEntry("inv_item_mesh.tga"));
|
||||
|
||||
addEntry(LLInventoryIcon::ICONNAME_INVALID, new IconEntry("Inv_Invalid.png"));
|
||||
|
||||
addEntry(LLInventoryIcon::ICONNAME_NONE, new IconEntry("NONE"));
|
||||
}
|
||||
|
||||
LLUIImagePtr LLInventoryIcon::getIcon(LLAssetType::EType asset_type,
|
||||
LLInventoryType::EType inventory_type,
|
||||
U32 misc_flag,
|
||||
BOOL item_is_multi)
|
||||
{
|
||||
const std::string& icon_name = getIconName(asset_type, inventory_type, misc_flag, item_is_multi);
|
||||
return LLUI::getUIImage(icon_name);
|
||||
}
|
||||
|
||||
LLUIImagePtr LLInventoryIcon::getIcon(EIconName idx)
|
||||
{
|
||||
return LLUI::getUIImage(getIconName(idx));
|
||||
}
|
||||
|
||||
const std::string& LLInventoryIcon::getIconName(LLAssetType::EType asset_type,
|
||||
LLInventoryType::EType inventory_type,
|
||||
U32 misc_flag,
|
||||
BOOL item_is_multi)
|
||||
{
|
||||
EIconName idx = ICONNAME_OBJECT;
|
||||
if (item_is_multi)
|
||||
{
|
||||
idx = ICONNAME_OBJECT_MULTI;
|
||||
return getIconName(idx);
|
||||
}
|
||||
|
||||
switch(asset_type)
|
||||
{
|
||||
case LLAssetType::AT_TEXTURE:
|
||||
idx = (inventory_type == LLInventoryType::IT_SNAPSHOT) ? ICONNAME_SNAPSHOT : ICONNAME_TEXTURE;
|
||||
break;
|
||||
case LLAssetType::AT_SOUND:
|
||||
idx = ICONNAME_SOUND;
|
||||
break;
|
||||
case LLAssetType::AT_CALLINGCARD:
|
||||
idx = (misc_flag != 0) ? ICONNAME_CALLINGCARD_ONLINE : ICONNAME_CALLINGCARD_OFFLINE;
|
||||
break;
|
||||
case LLAssetType::AT_LANDMARK:
|
||||
idx = (misc_flag != 0) ? ICONNAME_LANDMARK_VISITED : ICONNAME_LANDMARK;
|
||||
break;
|
||||
case LLAssetType::AT_SCRIPT:
|
||||
case LLAssetType::AT_LSL_TEXT:
|
||||
case LLAssetType::AT_LSL_BYTECODE:
|
||||
idx = ICONNAME_SCRIPT;
|
||||
break;
|
||||
case LLAssetType::AT_CLOTHING:
|
||||
case LLAssetType::AT_BODYPART:
|
||||
idx = assignWearableIcon(misc_flag);
|
||||
break;
|
||||
case LLAssetType::AT_NOTECARD:
|
||||
idx = ICONNAME_NOTECARD;
|
||||
break;
|
||||
case LLAssetType::AT_ANIMATION:
|
||||
idx = ICONNAME_ANIMATION;
|
||||
break;
|
||||
case LLAssetType::AT_GESTURE:
|
||||
idx = ICONNAME_GESTURE;
|
||||
break;
|
||||
case LLAssetType::AT_LINK:
|
||||
idx = ICONNAME_LINKITEM;
|
||||
break;
|
||||
case LLAssetType::AT_LINK_FOLDER:
|
||||
idx = ICONNAME_LINKFOLDER;
|
||||
break;
|
||||
case LLAssetType::AT_OBJECT:
|
||||
idx = ICONNAME_OBJECT;
|
||||
break;
|
||||
case LLAssetType::AT_MESH:
|
||||
idx = ICONNAME_MESH;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return getIconName(idx);
|
||||
}
|
||||
|
||||
|
||||
const std::string& LLInventoryIcon::getIconName(EIconName idx)
|
||||
{
|
||||
const IconEntry *entry = LLIconDictionary::instance().lookup(idx);
|
||||
return entry->mName;
|
||||
}
|
||||
|
||||
LLInventoryIcon::EIconName LLInventoryIcon::assignWearableIcon(U32 misc_flag)
|
||||
{
|
||||
const LLWearableType::EType wearable_type = LLWearableType::EType(LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK & misc_flag);
|
||||
return LLWearableType::getIconName(wearable_type);
|
||||
}
|
||||
102
indra/newview/llinventoryicon.h
Normal file
102
indra/newview/llinventoryicon.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
* @file llinventoryfunctions.h
|
||||
* @brief Miscellaneous inventory-related functions and classes
|
||||
* class definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLINVENTORYICON_H
|
||||
#define LL_LLINVENTORYICON_H
|
||||
|
||||
#include "llassettype.h"
|
||||
#include "llinventorytype.h"
|
||||
#include "llui.h"
|
||||
|
||||
class LLInventoryIcon
|
||||
{
|
||||
public:
|
||||
enum EIconName
|
||||
{
|
||||
ICONNAME_TEXTURE,
|
||||
ICONNAME_SOUND,
|
||||
ICONNAME_CALLINGCARD_ONLINE,
|
||||
ICONNAME_CALLINGCARD_OFFLINE,
|
||||
ICONNAME_LANDMARK,
|
||||
ICONNAME_LANDMARK_VISITED,
|
||||
ICONNAME_SCRIPT,
|
||||
ICONNAME_CLOTHING,
|
||||
ICONNAME_OBJECT,
|
||||
ICONNAME_OBJECT_MULTI,
|
||||
ICONNAME_NOTECARD,
|
||||
ICONNAME_BODYPART,
|
||||
ICONNAME_SNAPSHOT,
|
||||
|
||||
ICONNAME_BODYPART_SHAPE,
|
||||
ICONNAME_BODYPART_SKIN,
|
||||
ICONNAME_BODYPART_HAIR,
|
||||
ICONNAME_BODYPART_EYES,
|
||||
ICONNAME_CLOTHING_SHIRT,
|
||||
ICONNAME_CLOTHING_PANTS,
|
||||
ICONNAME_CLOTHING_SHOES,
|
||||
ICONNAME_CLOTHING_SOCKS,
|
||||
ICONNAME_CLOTHING_JACKET,
|
||||
ICONNAME_CLOTHING_GLOVES,
|
||||
ICONNAME_CLOTHING_UNDERSHIRT,
|
||||
ICONNAME_CLOTHING_UNDERPANTS,
|
||||
ICONNAME_CLOTHING_SKIRT,
|
||||
ICONNAME_CLOTHING_ALPHA,
|
||||
ICONNAME_CLOTHING_TATTOO,
|
||||
|
||||
ICONNAME_ANIMATION,
|
||||
ICONNAME_GESTURE,
|
||||
|
||||
ICONNAME_CLOTHING_PHYSICS,
|
||||
|
||||
ICONNAME_LINKITEM,
|
||||
ICONNAME_LINKFOLDER,
|
||||
ICONNAME_MESH,
|
||||
|
||||
ICONNAME_INVALID,
|
||||
ICONNAME_COUNT,
|
||||
ICONNAME_NONE = -1
|
||||
};
|
||||
|
||||
static const std::string& getIconName(LLAssetType::EType asset_type,
|
||||
LLInventoryType::EType inventory_type = LLInventoryType::IT_NONE,
|
||||
U32 misc_flag = 0, // different meanings depending on item type
|
||||
BOOL item_is_multi = FALSE);
|
||||
static const std::string& getIconName(EIconName idx);
|
||||
|
||||
static LLUIImagePtr getIcon(LLAssetType::EType asset_type,
|
||||
LLInventoryType::EType inventory_type = LLInventoryType::IT_NONE,
|
||||
U32 misc_flag = 0, // different meanings depending on item type
|
||||
BOOL item_is_multi = FALSE);
|
||||
static LLUIImagePtr getIcon(EIconName idx);
|
||||
|
||||
protected:
|
||||
static EIconName assignWearableIcon(U32 misc_flag);
|
||||
};
|
||||
#endif // LL_LLINVENTORYICON_H
|
||||
|
||||
|
||||
|
||||
@@ -1432,147 +1432,6 @@ BOOL LLInventoryView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
||||
|
||||
return handled;
|
||||
}
|
||||
std::string get_item_icon_name(LLAssetType::EType asset_type,
|
||||
LLInventoryType::EType inventory_type,
|
||||
U32 attachment_point,
|
||||
BOOL item_is_multi )
|
||||
{
|
||||
EInventoryIcon idx = OBJECT_ICON_NAME;
|
||||
if ( item_is_multi )
|
||||
{
|
||||
idx = OBJECT_MULTI_ICON_NAME;
|
||||
}
|
||||
|
||||
switch(asset_type)
|
||||
{
|
||||
case LLAssetType::AT_TEXTURE:
|
||||
if(LLInventoryType::IT_SNAPSHOT == inventory_type)
|
||||
{
|
||||
idx = SNAPSHOT_ICON_NAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
idx = TEXTURE_ICON_NAME;
|
||||
}
|
||||
break;
|
||||
|
||||
case LLAssetType::AT_SOUND:
|
||||
idx = SOUND_ICON_NAME;
|
||||
break;
|
||||
case LLAssetType::AT_CALLINGCARD:
|
||||
if(attachment_point!= 0)
|
||||
{
|
||||
idx = CALLINGCARD_ONLINE_ICON_NAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
idx = CALLINGCARD_OFFLINE_ICON_NAME;
|
||||
}
|
||||
break;
|
||||
case LLAssetType::AT_LANDMARK:
|
||||
if(attachment_point!= 0)
|
||||
{
|
||||
idx = LANDMARK_VISITED_ICON_NAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
idx = LANDMARK_ICON_NAME;
|
||||
}
|
||||
break;
|
||||
case LLAssetType::AT_SCRIPT:
|
||||
case LLAssetType::AT_LSL_TEXT:
|
||||
case LLAssetType::AT_LSL_BYTECODE:
|
||||
idx = SCRIPT_ICON_NAME;
|
||||
break;
|
||||
case LLAssetType::AT_CLOTHING:
|
||||
idx = CLOTHING_ICON_NAME;
|
||||
case LLAssetType::AT_BODYPART :
|
||||
if(LLAssetType::AT_BODYPART == asset_type)
|
||||
{
|
||||
idx = BODYPART_ICON_NAME;
|
||||
}
|
||||
switch(LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK & attachment_point)
|
||||
{
|
||||
case LLWearableType::WT_SHAPE:
|
||||
idx = BODYPART_SHAPE_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_SKIN:
|
||||
idx = BODYPART_SKIN_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_HAIR:
|
||||
idx = BODYPART_HAIR_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_EYES:
|
||||
idx = BODYPART_EYES_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_SHIRT:
|
||||
idx = CLOTHING_SHIRT_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_PANTS:
|
||||
idx = CLOTHING_PANTS_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_SHOES:
|
||||
idx = CLOTHING_SHOES_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_SOCKS:
|
||||
idx = CLOTHING_SOCKS_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_JACKET:
|
||||
idx = CLOTHING_JACKET_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_GLOVES:
|
||||
idx = CLOTHING_GLOVES_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_UNDERSHIRT:
|
||||
idx = CLOTHING_UNDERSHIRT_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_UNDERPANTS:
|
||||
idx = CLOTHING_UNDERPANTS_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_SKIRT:
|
||||
idx = CLOTHING_SKIRT_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_ALPHA:
|
||||
idx = CLOTHING_ALPHA_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_TATTOO:
|
||||
idx = CLOTHING_TATTOO_ICON_NAME;
|
||||
break;
|
||||
case LLWearableType::WT_PHYSICS:
|
||||
idx = CLOTHING_PHYSICS_ICON_NAME;
|
||||
break;
|
||||
default:
|
||||
// no-op, go with choice above
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case LLAssetType::AT_NOTECARD:
|
||||
idx = NOTECARD_ICON_NAME;
|
||||
break;
|
||||
case LLAssetType::AT_ANIMATION:
|
||||
idx = ANIMATION_ICON_NAME;
|
||||
break;
|
||||
case LLAssetType::AT_GESTURE:
|
||||
idx = GESTURE_ICON_NAME;
|
||||
break;
|
||||
case LLAssetType::AT_MESH:
|
||||
idx = MESH_ICON_NAME;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ICON_NAME[idx];
|
||||
}
|
||||
|
||||
LLUIImagePtr get_item_icon(LLAssetType::EType asset_type,
|
||||
LLInventoryType::EType inventory_type,
|
||||
U32 attachment_point,
|
||||
BOOL item_is_multi)
|
||||
{
|
||||
const std::string& icon_name = get_item_icon_name(asset_type, inventory_type, attachment_point, item_is_multi );
|
||||
return LLUI::getUIImage(icon_name);
|
||||
}
|
||||
|
||||
const std::string LLInventoryPanel::DEFAULT_SORT_ORDER = std::string("InventorySortOrder");
|
||||
const std::string LLInventoryPanel::RECENTITEMS_SORT_ORDER = std::string("RecentItemsSortOrder");
|
||||
|
||||
@@ -384,24 +384,6 @@ void open_notecard(LLViewerInventoryItem* inv_item, const std::string& title, co
|
||||
void open_landmark(LLViewerInventoryItem* inv_item, const std::string& title, BOOL show_keep_discard, const LLUUID& source_id = LLUUID::null, BOOL take_focus = TRUE);
|
||||
void open_texture(const LLUUID& item_id, const std::string& title, BOOL show_keep_discard, const LLUUID& source_id = LLUUID::null, BOOL take_focus = TRUE);
|
||||
|
||||
std::string get_item_icon_name(LLAssetType::EType asset_type,
|
||||
LLInventoryType::EType inventory_type,
|
||||
U32 attachment_point,
|
||||
BOOL item_is_multi );
|
||||
|
||||
LLUIImagePtr get_item_icon(LLAssetType::EType asset_type,
|
||||
LLInventoryType::EType inventory_type,
|
||||
U32 attachment_point,
|
||||
BOOL item_is_multi );
|
||||
|
||||
// Move items from an in-world object's "Contents" folder to a specified
|
||||
// folder in agent inventory.
|
||||
BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
|
||||
const LLUUID& category_id,
|
||||
BOOL drop,
|
||||
void (*callback)(S32, void*) = NULL,
|
||||
void* user_data = NULL);
|
||||
|
||||
const BOOL TAKE_FOCUS_YES = TRUE;
|
||||
const BOOL TAKE_FOCUS_NO = FALSE;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "llviewerinventory.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "llinventorydefines.h"
|
||||
#include "llinventoryview.h"
|
||||
#include "llinventoryicon.h"
|
||||
#include "llagent.h"
|
||||
#include "lltooldraganddrop.h"
|
||||
|
||||
@@ -311,7 +311,7 @@ void LLPanelGroupNotices::setItem(LLPointer<LLInventoryItem> inv_item)
|
||||
item_is_multi = TRUE;
|
||||
};
|
||||
|
||||
std::string icon_name = get_item_icon_name(inv_item->getType(),
|
||||
std::string icon_name = LLInventoryIcon::getIconName(inv_item->getType(),
|
||||
inv_item->getInventoryType(),
|
||||
inv_item->getFlags(),
|
||||
item_is_multi );
|
||||
@@ -469,7 +469,7 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
|
||||
row["columns"][0]["column"] = "icon";
|
||||
if (has_attachment)
|
||||
{
|
||||
std::string icon_name = get_item_icon_name(
|
||||
std::string icon_name = LLInventoryIcon::getIconName(
|
||||
(LLAssetType::EType)asset_type,
|
||||
LLInventoryType::IT_NONE,FALSE, FALSE);
|
||||
row["columns"][0]["type"] = "icon";
|
||||
@@ -544,7 +544,7 @@ void LLPanelGroupNotices::showNotice(const std::string& subject,
|
||||
{
|
||||
mInventoryOffer = inventory_offer;
|
||||
|
||||
std::string icon_name = get_item_icon_name(mInventoryOffer->mType,
|
||||
std::string icon_name = LLInventoryIcon::getIconName(mInventoryOffer->mType,
|
||||
LLInventoryType::IT_TEXTURE,
|
||||
0, FALSE);
|
||||
|
||||
|
||||
@@ -50,7 +50,9 @@
|
||||
#include "llfontgl.h"
|
||||
#include "llassetstorage.h"
|
||||
#include "llinventory.h"
|
||||
#include "llinventorybridge.h"
|
||||
#include "llinventorydefines.h"
|
||||
#include "llinventoryicon.h"
|
||||
#include "llnotificationsutil.h"
|
||||
|
||||
#include "llagent.h"
|
||||
@@ -61,7 +63,8 @@
|
||||
#include "llfolderview.h"
|
||||
#include "llgl.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "llinventoryview.h"
|
||||
#include "llinventoryicon.h"
|
||||
#include "llinventorybridge.h"
|
||||
#include "llmenugl.h"
|
||||
#include "llpreviewanim.h"
|
||||
#include "llpreviewgesture.h"
|
||||
@@ -361,7 +364,7 @@ LLUIImagePtr LLTaskInvFVBridge::getIcon() const
|
||||
item_is_multi = TRUE;
|
||||
}
|
||||
|
||||
return get_item_icon(LLAssetType::AT_OBJECT, LLInventoryType::IT_OBJECT, 0, item_is_multi );
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_OBJECT, LLInventoryType::IT_OBJECT, 0, item_is_multi );
|
||||
}
|
||||
|
||||
void LLTaskInvFVBridge::openItem()
|
||||
@@ -1002,7 +1005,7 @@ LLTaskTextureBridge::LLTaskTextureBridge(
|
||||
|
||||
LLUIImagePtr LLTaskTextureBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_TEXTURE, mInventoryType, 0, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_TEXTURE, mInventoryType, 0, FALSE);
|
||||
}
|
||||
|
||||
void LLTaskTextureBridge::openItem()
|
||||
@@ -1062,7 +1065,7 @@ LLTaskSoundBridge::LLTaskSoundBridge(
|
||||
|
||||
LLUIImagePtr LLTaskSoundBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_SOUND, LLInventoryType::IT_SOUND, 0, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_SOUND, LLInventoryType::IT_SOUND, 0, FALSE);
|
||||
}
|
||||
|
||||
void LLTaskSoundBridge::openItem()
|
||||
@@ -1196,7 +1199,7 @@ LLTaskLandmarkBridge::LLTaskLandmarkBridge(
|
||||
|
||||
LLUIImagePtr LLTaskLandmarkBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, 0, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, 0, FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -1227,7 +1230,7 @@ LLTaskCallingCardBridge::LLTaskCallingCardBridge(
|
||||
|
||||
LLUIImagePtr LLTaskCallingCardBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_CALLINGCARD, LLInventoryType::IT_CALLINGCARD, 0, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_CALLINGCARD, LLInventoryType::IT_CALLINGCARD, 0, FALSE);
|
||||
}
|
||||
|
||||
BOOL LLTaskCallingCardBridge::isItemRenameable() const
|
||||
@@ -1267,7 +1270,7 @@ LLTaskScriptBridge::LLTaskScriptBridge(
|
||||
|
||||
LLUIImagePtr LLTaskScriptBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -1381,7 +1384,7 @@ LLUIImagePtr LLTaskObjectBridge::getIcon() const
|
||||
item_is_multi = TRUE;
|
||||
}
|
||||
|
||||
return get_item_icon(LLAssetType::AT_OBJECT, LLInventoryType::IT_OBJECT, 0, item_is_multi);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_OBJECT, LLInventoryType::IT_OBJECT, 0, item_is_multi);
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
@@ -1411,7 +1414,7 @@ LLTaskNotecardBridge::LLTaskNotecardBridge(
|
||||
|
||||
LLUIImagePtr LLTaskNotecardBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE);
|
||||
}
|
||||
|
||||
void LLTaskNotecardBridge::openItem()
|
||||
@@ -1485,7 +1488,7 @@ LLTaskGestureBridge::LLTaskGestureBridge(
|
||||
|
||||
LLUIImagePtr LLTaskGestureBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, 0, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, 0, FALSE);
|
||||
}
|
||||
|
||||
void LLTaskGestureBridge::openItem()
|
||||
@@ -1545,7 +1548,7 @@ LLTaskAnimationBridge::LLTaskAnimationBridge(
|
||||
|
||||
LLUIImagePtr LLTaskAnimationBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_ANIMATION, LLInventoryType::IT_ANIMATION, 0, FALSE);
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_ANIMATION, LLInventoryType::IT_ANIMATION, 0, FALSE);
|
||||
}
|
||||
|
||||
void LLTaskAnimationBridge::openItem()
|
||||
@@ -1629,7 +1632,7 @@ LLTaskWearableBridge::LLTaskWearableBridge(
|
||||
|
||||
LLUIImagePtr LLTaskWearableBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(mAssetType, LLInventoryType::IT_WEARABLE, mFlags, FALSE );
|
||||
return LLInventoryIcon::getIcon(mAssetType, LLInventoryType::IT_WEARABLE, mFlags, FALSE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ BOOL LLTexLayerParamAlpha::getSkip() const
|
||||
}
|
||||
|
||||
LLWearableType::EType type = (LLWearableType::EType)getWearableType();
|
||||
if ((type != WT_INVALID) && !avatar->isWearingWearableType(type))
|
||||
if ((type != LLWearableType::WT_INVALID) && !avatar->isWearingWearableType(type))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -32,17 +32,26 @@ struct WearableEntry : public LLDictionaryEntry
|
||||
{
|
||||
WearableEntry(const std::string &name,
|
||||
const std::string& default_new_name,
|
||||
LLAssetType::EType assetType) :
|
||||
LLAssetType::EType assetType,
|
||||
LLInventoryIcon::EIconName iconName,
|
||||
BOOL disable_camera_switch = FALSE,
|
||||
BOOL allow_multiwear = TRUE) :
|
||||
LLDictionaryEntry(name),
|
||||
mAssetType(assetType),
|
||||
mDefaultNewName(default_new_name),
|
||||
mLabel(/*(LLTrans::getString*/(name))
|
||||
mLabel(/*LLTrans::getString*/(name)),
|
||||
mIconName(iconName),
|
||||
mDisableCameraSwitch(disable_camera_switch),
|
||||
mAllowMultiwear(allow_multiwear)
|
||||
{
|
||||
|
||||
}
|
||||
const LLAssetType::EType mAssetType;
|
||||
const std::string mLabel;
|
||||
const std::string mDefaultNewName; //keep mLabel for backward compatibility
|
||||
LLInventoryIcon::EIconName mIconName;
|
||||
BOOL mDisableCameraSwitch;
|
||||
BOOL mAllowMultiwear;
|
||||
};
|
||||
|
||||
class LLWearableDictionary : public LLSingleton<LLWearableDictionary>,
|
||||
@@ -54,26 +63,26 @@ public:
|
||||
|
||||
LLWearableDictionary::LLWearableDictionary()
|
||||
{
|
||||
addEntry(LLWearableType::WT_SHAPE, new WearableEntry("shape", "New Shape", LLAssetType::AT_BODYPART));
|
||||
addEntry(LLWearableType::WT_SKIN, new WearableEntry("skin", "New Skin", LLAssetType::AT_BODYPART));
|
||||
addEntry(LLWearableType::WT_HAIR, new WearableEntry("hair", "New Hair", LLAssetType::AT_BODYPART));
|
||||
addEntry(LLWearableType::WT_EYES, new WearableEntry("eyes", "New Eyes", LLAssetType::AT_BODYPART));
|
||||
addEntry(LLWearableType::WT_SHIRT, new WearableEntry("shirt", "New Shirt", LLAssetType::AT_CLOTHING));
|
||||
addEntry(LLWearableType::WT_PANTS, new WearableEntry("pants", "New Pants", LLAssetType::AT_CLOTHING));
|
||||
addEntry(LLWearableType::WT_SHOES, new WearableEntry("shoes", "New Shoes", LLAssetType::AT_CLOTHING));
|
||||
addEntry(LLWearableType::WT_SOCKS, new WearableEntry("socks", "New Socks", LLAssetType::AT_CLOTHING));
|
||||
addEntry(LLWearableType::WT_JACKET, new WearableEntry("jacket", "New Jacket", LLAssetType::AT_CLOTHING));
|
||||
addEntry(LLWearableType::WT_GLOVES, new WearableEntry("gloves", "New Gloves", LLAssetType::AT_CLOTHING));
|
||||
addEntry(LLWearableType::WT_UNDERSHIRT, new WearableEntry("undershirt", "New Undershirt", LLAssetType::AT_CLOTHING));
|
||||
addEntry(LLWearableType::WT_UNDERPANTS, new WearableEntry("underpants", "New Underpants", LLAssetType::AT_CLOTHING));
|
||||
addEntry(LLWearableType::WT_SKIRT, new WearableEntry("skirt", "New Skirt", LLAssetType::AT_CLOTHING));
|
||||
addEntry(LLWearableType::WT_ALPHA, new WearableEntry("alpha", "New Alpha", LLAssetType::AT_CLOTHING));
|
||||
addEntry(LLWearableType::WT_TATTOO, new WearableEntry("tattoo", "New Tattoo", LLAssetType::AT_CLOTHING));
|
||||
addEntry(LLWearableType::WT_SHAPE, new WearableEntry("shape", "New Shape", LLAssetType::AT_BODYPART, LLInventoryIcon::ICONNAME_BODYPART_SHAPE, FALSE, FALSE));
|
||||
addEntry(LLWearableType::WT_SKIN, new WearableEntry("skin", "New Skin", LLAssetType::AT_BODYPART, LLInventoryIcon::ICONNAME_BODYPART_SKIN, FALSE, FALSE));
|
||||
addEntry(LLWearableType::WT_HAIR, new WearableEntry("hair", "New Hair", LLAssetType::AT_BODYPART, LLInventoryIcon::ICONNAME_BODYPART_HAIR, FALSE, FALSE));
|
||||
addEntry(LLWearableType::WT_EYES, new WearableEntry("eyes", "New Eyes", LLAssetType::AT_BODYPART, LLInventoryIcon::ICONNAME_BODYPART_EYES, FALSE, FALSE));
|
||||
addEntry(LLWearableType::WT_SHIRT, new WearableEntry("shirt", "New Shirt", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_SHIRT, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_PANTS, new WearableEntry("pants", "New Pants", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_PANTS, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_SHOES, new WearableEntry("shoes", "New Shoes", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_SHOES, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_SOCKS, new WearableEntry("socks", "New Socks", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_SOCKS, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_JACKET, new WearableEntry("jacket", "New Jacket", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_JACKET, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_GLOVES, new WearableEntry("gloves", "New Gloves", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_GLOVES, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_UNDERSHIRT, new WearableEntry("undershirt", "New Undershirt", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_UNDERSHIRT, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_UNDERPANTS, new WearableEntry("underpants", "New Underpants", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_UNDERPANTS, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_SKIRT, new WearableEntry("skirt", "New Skirt", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_SKIRT, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_ALPHA, new WearableEntry("alpha", "New Alpha", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_ALPHA, FALSE, TRUE));
|
||||
addEntry(LLWearableType::WT_TATTOO, new WearableEntry("tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_TATTOO, FALSE, TRUE));
|
||||
|
||||
addEntry(LLWearableType::WT_PHYSICS, new WearableEntry("physics", "New Physics", LLAssetType::AT_CLOTHING));
|
||||
addEntry(LLWearableType::WT_PHYSICS, new WearableEntry("physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryIcon::ICONNAME_CLOTHING_PHYSICS, TRUE, TRUE));
|
||||
|
||||
addEntry(LLWearableType::WT_INVALID, new WearableEntry("invalid", "Invalid Wearable", LLAssetType::AT_NONE));
|
||||
addEntry(LLWearableType::WT_NONE, new WearableEntry("none", "Invalid Wearable", LLAssetType::AT_NONE));
|
||||
addEntry(LLWearableType::WT_INVALID, new WearableEntry("invalid", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryIcon::ICONNAME_NONE, FALSE, FALSE));
|
||||
addEntry(LLWearableType::WT_NONE, new WearableEntry("none", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryIcon::ICONNAME_NONE, FALSE, FALSE));
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -120,3 +129,30 @@ LLAssetType::EType LLWearableType::getAssetType(LLWearableType::EType type)
|
||||
return entry->mAssetType;
|
||||
}
|
||||
|
||||
// static
|
||||
LLInventoryIcon::EIconName LLWearableType::getIconName(LLWearableType::EType type)
|
||||
{
|
||||
const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
|
||||
const WearableEntry *entry = dict->lookup(type);
|
||||
if (!entry) return getIconName(WT_INVALID);
|
||||
return entry->mIconName;
|
||||
}
|
||||
|
||||
// static
|
||||
BOOL LLWearableType::getDisableCameraSwitch(LLWearableType::EType type)
|
||||
{
|
||||
const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
|
||||
const WearableEntry *entry = dict->lookup(type);
|
||||
if (!entry) return FALSE;
|
||||
return entry->mDisableCameraSwitch;
|
||||
}
|
||||
|
||||
// static
|
||||
BOOL LLWearableType::getAllowMultiwear(LLWearableType::EType type)
|
||||
{
|
||||
return false; //Disabled
|
||||
/*const LLWearableDictionary *dict = LLWearableDictionary::getInstance();
|
||||
const WearableEntry *entry = dict->lookup(type);
|
||||
if (!entry) return FALSE;
|
||||
return entry->mAllowMultiwear;*/
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "llassettype.h"
|
||||
#include "lldictionary.h"
|
||||
#include "llinventoryicon.h"
|
||||
#include "llsingleton.h"
|
||||
|
||||
class LLWearableType
|
||||
@@ -63,6 +64,9 @@ public:
|
||||
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);
|
||||
static BOOL getDisableCameraSwitch(EType type);
|
||||
static BOOL getAllowMultiwear(EType type);
|
||||
|
||||
protected:
|
||||
LLWearableType() {}
|
||||
|
||||
Reference in New Issue
Block a user