EXT-7306 : FIXED : Add shortcut-style icons for inventory links
EXT-7295 : FIXED : INFRASTRUCTURE : Cleaned up Inventory Icon code Inventory link icons were designed from scratch. Added LLInventoryIcon class and did some major refactoring for how it determines inventory icons from item bridges.meow-7.2.2
parent
79457a85fe
commit
64da5083d0
|
|
@ -254,6 +254,7 @@ set(viewer_SOURCE_FILES
|
|||
llinventoryclipboard.cpp
|
||||
llinventoryfilter.cpp
|
||||
llinventoryfunctions.cpp
|
||||
llinventoryicon.cpp
|
||||
llinventoryitemslist.cpp
|
||||
llinventorymodel.cpp
|
||||
llinventorymodelbackgroundfetch.cpp
|
||||
|
|
@ -766,6 +767,7 @@ set(viewer_HEADER_FILES
|
|||
llinventoryclipboard.h
|
||||
llinventoryfilter.h
|
||||
llinventoryfunctions.h
|
||||
llinventoryicon.h
|
||||
llinventoryitemslist.h
|
||||
llinventorymodel.h
|
||||
llinventorymodelbackgroundfetch.h
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
#include "llagent.h" // for agent id
|
||||
#include "llinventorymodel.h" // for gInventory
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfloaterinventory.h" // for get_item_icon
|
||||
#include "llinventoryicon.h"
|
||||
#include "llinventorydefines.h"
|
||||
#include "llinventoryfunctions.h"
|
||||
#include "llnotificationsutil.h"
|
||||
|
|
@ -152,7 +152,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);
|
||||
|
||||
|
|
@ -253,7 +253,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);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
#include "llinventoryfunctions.h"
|
||||
#include "llinventorymodel.h" // for gInventory
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfloaterinventory.h" // for get_item_icon
|
||||
#include "llfloaterinventory.h" // for LLInventoryIcon::getIcon
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llselectmgr.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
|
|
@ -221,7 +221,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);
|
||||
|
|
|
|||
|
|
@ -108,45 +108,6 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response
|
|||
bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response);
|
||||
void teleport_via_landmark(const LLUUID& asset_id);
|
||||
|
||||
std::string ICON_NAME[ICON_NAME_COUNT] =
|
||||
{
|
||||
"Inv_Texture",
|
||||
"Inv_Sound",
|
||||
"Inv_CallingCard",
|
||||
"Inv_CallingCard",
|
||||
"Inv_Landmark",
|
||||
"Inv_Landmark",
|
||||
"Inv_Script",
|
||||
"Inv_Clothing",
|
||||
"Inv_Object",
|
||||
"Inv_Object_Multi",
|
||||
"Inv_Notecard",
|
||||
"Inv_Skin",
|
||||
"Inv_Snapshot",
|
||||
|
||||
"Inv_BodyShape",
|
||||
"Inv_Skin",
|
||||
"Inv_Hair",
|
||||
"Inv_Eye",
|
||||
"Inv_Shirt",
|
||||
"Inv_Pants",
|
||||
"Inv_Shoe",
|
||||
"Inv_Socks",
|
||||
"Inv_Jacket",
|
||||
"Inv_Gloves",
|
||||
"Inv_Undershirt",
|
||||
"Inv_Underpants",
|
||||
"Inv_Skirt",
|
||||
"Inv_Alpha",
|
||||
"Inv_Tattoo",
|
||||
|
||||
"Inv_Animation",
|
||||
"Inv_Gesture",
|
||||
|
||||
"Inv_LinkItem",
|
||||
"Inv_LinkFolder"
|
||||
};
|
||||
|
||||
// +=================================================+
|
||||
// | LLInvFVBridge |
|
||||
// +=================================================+
|
||||
|
|
@ -156,14 +117,17 @@ LLInvFVBridge::LLInvFVBridge(LLInventoryPanel* inventory,
|
|||
const LLUUID& uuid) :
|
||||
mUUID(uuid),
|
||||
mRoot(root),
|
||||
mInvType(LLInventoryType::IT_NONE)
|
||||
mInvType(LLInventoryType::IT_NONE),
|
||||
mIsLink(FALSE)
|
||||
{
|
||||
mInventoryPanel = inventory->getHandle();
|
||||
const LLInventoryObject* obj = getInventoryObject();
|
||||
mIsLink = obj && obj->getIsLinkType();
|
||||
}
|
||||
|
||||
const std::string& LLInvFVBridge::getName() const
|
||||
{
|
||||
LLInventoryObject* obj = getInventoryObject();
|
||||
const LLInventoryObject* obj = getInventoryObject();
|
||||
if(obj)
|
||||
{
|
||||
return obj->getName();
|
||||
|
|
@ -239,6 +203,11 @@ BOOL LLInvFVBridge::isItemMovable() const
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LLInvFVBridge::isLink() const
|
||||
{
|
||||
return mIsLink;
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
/**
|
||||
* @brief Adds this item into clipboard storage
|
||||
|
|
@ -933,7 +902,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, root, uuid);
|
||||
new_listener = new LLItemBridge(inventory, root, uuid);
|
||||
break;
|
||||
|
||||
case LLAssetType::AT_OBJECT:
|
||||
|
|
@ -1245,7 +1214,15 @@ void LLItemBridge::gotoItem()
|
|||
|
||||
LLUIImagePtr LLItemBridge::getIcon() const
|
||||
{
|
||||
return LLUI::getUIImage(ICON_NAME[OBJECT_ICON_NAME]);
|
||||
LLInventoryObject *obj = getInventoryObject();
|
||||
if (obj)
|
||||
{
|
||||
return LLInventoryIcon::getIcon(obj->getType(),
|
||||
LLInventoryType::IT_NONE,
|
||||
mIsLink);
|
||||
}
|
||||
|
||||
return LLInventoryIcon::getIcon(LLInventoryIcon::ICONNAME_OBJECT);
|
||||
}
|
||||
|
||||
PermissionMask LLItemBridge::getPermissionMask() const
|
||||
|
|
@ -2370,23 +2347,39 @@ LLUIImagePtr LLFolderBridge::getIcon() const
|
|||
return getIcon(preferred_type);
|
||||
}
|
||||
|
||||
LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type)
|
||||
// static
|
||||
LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type, BOOL is_link)
|
||||
{
|
||||
// we only have one folder image now
|
||||
if (preferred_type == LLFolderType::FT_OUTFIT)
|
||||
// Bypassing LLViewerFolderType::lookup() since
|
||||
// we aren't using different system folder icons
|
||||
if (is_link)
|
||||
{
|
||||
return LLUI::getUIImage("Inv_LookFolderClosed");
|
||||
if (preferred_type == LLFolderType::FT_OUTFIT)
|
||||
return LLUI::getUIImage("Inv_LookFolderClosed_Link");
|
||||
else
|
||||
return LLUI::getUIImage("Inv_FolderClosed_Link");
|
||||
}
|
||||
return LLUI::getUIImage("Inv_FolderClosed");
|
||||
if (preferred_type == LLFolderType::FT_OUTFIT)
|
||||
return LLUI::getUIImage("Inv_LookFolderClosed");
|
||||
else
|
||||
return LLUI::getUIImage("Inv_FolderClosed");
|
||||
}
|
||||
|
||||
LLUIImagePtr LLFolderBridge::getOpenIcon() const
|
||||
{
|
||||
if (getPreferredType() == LLFolderType::FT_OUTFIT)
|
||||
// Bypassing LLViewerFolderType::lookup() since
|
||||
// we aren't using different system folder icons
|
||||
if (isLink())
|
||||
{
|
||||
return LLUI::getUIImage("Inv_LookFolderOpen");
|
||||
if (getPreferredType() == LLFolderType::FT_OUTFIT)
|
||||
return LLUI::getUIImage("Inv_LookFolderOpen_Link");
|
||||
else
|
||||
return LLUI::getUIImage("Inv_FolderOpen_Link");
|
||||
}
|
||||
return LLUI::getUIImage("Inv_FolderOpen");
|
||||
if (getPreferredType() == LLFolderType::FT_OUTFIT)
|
||||
return LLUI::getUIImage("Inv_LookFolderOpen");
|
||||
else
|
||||
return LLUI::getUIImage("Inv_FolderOpen");
|
||||
}
|
||||
|
||||
BOOL LLFolderBridge::renameItem(const std::string& new_name)
|
||||
|
|
@ -3322,22 +3315,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
|
|||
return accept;
|
||||
}
|
||||
|
||||
// +=================================================+
|
||||
// | LLScriptBridge (DEPRECTED) |
|
||||
// +=================================================+
|
||||
|
||||
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, mIsLink);
|
||||
}
|
||||
|
||||
void LLTextureBridge::openItem()
|
||||
|
|
@ -3417,32 +3401,14 @@ void LLTextureBridge::performAction(LLInventoryModel* model, std::string action)
|
|||
// | LLSoundBridge |
|
||||
// +=================================================+
|
||||
|
||||
LLUIImagePtr LLSoundBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_SOUND, LLInventoryType::IT_SOUND, 0, FALSE);
|
||||
}
|
||||
|
||||
void LLSoundBridge::openItem()
|
||||
{
|
||||
LLViewerInventoryItem* item = getItem();
|
||||
|
||||
const LLViewerInventoryItem* item = getItem();
|
||||
if (item)
|
||||
{
|
||||
LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel());
|
||||
}
|
||||
/*
|
||||
// Changed this back to the way it USED to work:
|
||||
// only open the preview dialog through the contextual right-click menu
|
||||
// double-click just plays the sound
|
||||
|
||||
LLViewerInventoryItem* item = getItem();
|
||||
if(item)
|
||||
{
|
||||
openSoundPreview((void*)this);
|
||||
//send_uuid_sound_trigger(item->getAssetUUID(), 1.0);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void LLSoundBridge::previewItem()
|
||||
{
|
||||
|
|
@ -3507,7 +3473,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, mIsLink, mVisited, FALSE);
|
||||
}
|
||||
|
||||
void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
|
|
@ -3699,7 +3665,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, mIsLink, online, FALSE);
|
||||
}
|
||||
|
||||
std::string LLCallingCardBridge::getLabelSuffix() const
|
||||
|
|
@ -3857,39 +3823,19 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop,
|
|||
// | LLNotecardBridge |
|
||||
// +=================================================+
|
||||
|
||||
LLUIImagePtr LLNotecardBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE);
|
||||
}
|
||||
|
||||
void LLNotecardBridge::openItem()
|
||||
{
|
||||
LLViewerInventoryItem* item = getItem();
|
||||
|
||||
if (item)
|
||||
{
|
||||
LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel());
|
||||
}
|
||||
|
||||
/*
|
||||
LLViewerInventoryItem* item = getItem();
|
||||
if (item)
|
||||
{
|
||||
LLFloaterReg::showInstance("preview_notecard", LLSD(item->getUUID()), TAKE_FOCUS_YES);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
// +=================================================+
|
||||
// | LLGestureBridge |
|
||||
// +=================================================+
|
||||
|
||||
LLUIImagePtr LLGestureBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, 0, FALSE);
|
||||
}
|
||||
|
||||
LLFontGL::StyleFlags LLGestureBridge::getLabelStyle() const
|
||||
{
|
||||
if( LLGestureMgr::instance().isGestureActive(mUUID) )
|
||||
|
|
@ -4065,11 +4011,6 @@ void LLGestureBridge::playGesture(const LLUUID& item_id)
|
|||
// | LLAnimationBridge |
|
||||
// +=================================================+
|
||||
|
||||
LLUIImagePtr LLAnimationBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_ANIMATION, LLInventoryType::IT_ANIMATION, 0, FALSE);
|
||||
}
|
||||
|
||||
void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
{
|
||||
menuentry_vec_t items;
|
||||
|
|
@ -4164,7 +4105,7 @@ LLObjectBridge::LLObjectBridge(LLInventoryPanel* inventory,
|
|||
|
||||
LLUIImagePtr LLObjectBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_OBJECT, mInvType, mAttachPt, mIsMultiObject );
|
||||
return LLInventoryIcon::getIcon(LLAssetType::AT_OBJECT, mInvType, mIsLink, mAttachPt, mIsMultiObject);
|
||||
}
|
||||
|
||||
LLInventoryObject* LLObjectBridge::getObject() const
|
||||
|
|
@ -4484,11 +4425,6 @@ BOOL LLObjectBridge::renameItem(const std::string& new_name)
|
|||
// | LLLSLTextBridge |
|
||||
// +=================================================+
|
||||
|
||||
LLUIImagePtr LLLSLTextBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE);
|
||||
}
|
||||
|
||||
void LLLSLTextBridge::openItem()
|
||||
{
|
||||
LLViewerInventoryItem* item = getItem();
|
||||
|
|
@ -4695,7 +4631,7 @@ std::string LLWearableBridge::getLabelSuffix() const
|
|||
|
||||
LLUIImagePtr LLWearableBridge::getIcon() const
|
||||
{
|
||||
return get_item_icon(mAssetType, mInvType, mWearableType, FALSE);
|
||||
return LLInventoryIcon::getIcon(mAssetType, mInvType, mIsLink, mWearableType, FALSE);
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
@ -5112,18 +5048,9 @@ void LLWearableBridge::removeFromAvatar()
|
|||
// | LLLinkItemBridge |
|
||||
// +=================================================+
|
||||
// For broken item links
|
||||
std::string LLLinkItemBridge::sPrefix("Link: ");
|
||||
LLUIImagePtr LLLinkItemBridge::getIcon() const
|
||||
{
|
||||
if (LLViewerInventoryItem *item = getItem())
|
||||
{
|
||||
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 get_item_icon(LLAssetType::AT_LINK, LLInventoryType::IT_NONE, 0, FALSE);
|
||||
}
|
||||
std::string LLLinkItemBridge::sPrefix("Link: ");
|
||||
|
||||
void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
{
|
||||
// *TODO: Translate
|
||||
|
|
@ -5153,16 +5080,24 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
|||
std::string LLLinkFolderBridge::sPrefix("Link: ");
|
||||
LLUIImagePtr LLLinkFolderBridge::getIcon() const
|
||||
{
|
||||
LLFolderType::EType preferred_type = LLFolderType::FT_NONE;
|
||||
if (LLViewerInventoryItem *item = getItem())
|
||||
LLFolderType::EType folder_type = LLFolderType::FT_NONE;
|
||||
const LLInventoryObject *obj = getInventoryObject();
|
||||
if (obj)
|
||||
{
|
||||
if (const LLViewerInventoryCategory* cat = item->getLinkedCategory())
|
||||
LLViewerInventoryCategory* cat = NULL;
|
||||
LLInventoryModel* model = getInventoryModel();
|
||||
if(model)
|
||||
{
|
||||
preferred_type = cat->getPreferredType();
|
||||
cat = (LLViewerInventoryCategory*)model->getCategory(obj->getLinkedUUID());
|
||||
if (cat)
|
||||
{
|
||||
folder_type = cat->getPreferredType();
|
||||
}
|
||||
}
|
||||
}
|
||||
return LLFolderBridge::getIcon(preferred_type);
|
||||
return LLFolderBridge::getIcon(folder_type, TRUE);
|
||||
}
|
||||
|
||||
void LLLinkFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
{
|
||||
// *TODO: Translate
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ public:
|
|||
virtual BOOL isItemRemovable() const;
|
||||
virtual BOOL isItemMovable() const;
|
||||
virtual BOOL isItemInTrash() const;
|
||||
virtual BOOL isLink() const;
|
||||
|
||||
//virtual BOOL removeItem() = 0;
|
||||
virtual void removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batch);
|
||||
|
|
@ -162,6 +163,7 @@ protected:
|
|||
LLFolderView* mRoot;
|
||||
const LLUUID mUUID; // item id
|
||||
LLInventoryType::EType mInvType;
|
||||
BOOL mIsLink;
|
||||
void purgeItem(LLInventoryModel *model, const LLUUID &uuid);
|
||||
};
|
||||
|
||||
|
|
@ -184,49 +186,6 @@ public:
|
|||
U32 flags = 0x00) const;
|
||||
};
|
||||
|
||||
// Used by LLItemBridge::getIcon
|
||||
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,
|
||||
|
||||
ANIMATION_ICON_NAME,
|
||||
GESTURE_ICON_NAME,
|
||||
|
||||
LINKITEM_ICON_NAME,
|
||||
LINKFOLDER_ICON_NAME,
|
||||
|
||||
ICON_NAME_COUNT
|
||||
};
|
||||
extern std::string ICON_NAME[ICON_NAME_COUNT];
|
||||
|
||||
class LLItemBridge : public LLInvFVBridge
|
||||
{
|
||||
public:
|
||||
|
|
@ -289,7 +248,7 @@ public:
|
|||
virtual LLFolderType::EType getPreferredType() const;
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual LLUIImagePtr getOpenIcon() const;
|
||||
static LLUIImagePtr getIcon(LLFolderType::EType preferred_type);
|
||||
static LLUIImagePtr getIcon(LLFolderType::EType preferred_type, BOOL is_link = FALSE);
|
||||
|
||||
virtual BOOL renameItem(const std::string& new_name);
|
||||
|
||||
|
|
@ -368,20 +327,6 @@ private:
|
|||
menuentry_vec_t mDisabledItems;
|
||||
};
|
||||
|
||||
// DEPRECATED
|
||||
class LLScriptBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
LLUIImagePtr getIcon() const;
|
||||
|
||||
protected:
|
||||
LLScriptBridge(LLInventoryPanel* inventory,
|
||||
LLFolderView* root,
|
||||
const LLUUID& uuid ) :
|
||||
LLItemBridge(inventory, root, uuid) {}
|
||||
};
|
||||
|
||||
class LLTextureBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
|
|
@ -407,7 +352,6 @@ class LLSoundBridge : public LLItemBridge
|
|||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void openItem();
|
||||
virtual void previewItem();
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
|
|
@ -466,7 +410,6 @@ class LLNotecardBridge : public LLItemBridge
|
|||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void openItem();
|
||||
protected:
|
||||
LLNotecardBridge(LLInventoryPanel* inventory,
|
||||
|
|
@ -479,8 +422,6 @@ class LLGestureBridge : public LLItemBridge
|
|||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
|
||||
// Only suffix for gesture items, not task items, because only
|
||||
// gestures in your inventory can be active.
|
||||
virtual LLFontGL::StyleFlags getLabelStyle() const;
|
||||
|
|
@ -508,7 +449,6 @@ public:
|
|||
virtual void performAction(LLInventoryModel* model, std::string action);
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void openItem();
|
||||
|
||||
protected:
|
||||
|
|
@ -548,7 +488,6 @@ class LLLSLTextBridge : public LLItemBridge
|
|||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void openItem();
|
||||
protected:
|
||||
LLLSLTextBridge(LLInventoryPanel* inventory,
|
||||
|
|
@ -605,7 +544,6 @@ class LLLinkItemBridge : public LLItemBridge
|
|||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual const std::string& getPrefix() { return sPrefix; }
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
protected:
|
||||
LLLinkItemBridge(LLInventoryPanel* inventory,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file llfloaterinventory.cpp
|
||||
* @file llinventoryfunctions.cpp
|
||||
* @brief Implementation of the inventory view and associated stuff.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
|
|
@ -87,7 +87,6 @@
|
|||
BOOL LLInventoryState::sWearNewClothing = FALSE;
|
||||
LLUUID LLInventoryState::sWearNewClothingTransactionID;
|
||||
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// LLInventoryCollectFunctor implementations
|
||||
///----------------------------------------------------------------------------
|
||||
|
|
@ -407,152 +406,28 @@ void LLOpenFoldersWithSelection::doFolder(LLFolderViewFolder* folder)
|
|||
}
|
||||
}
|
||||
|
||||
static void assign_clothing_bodypart_icon(EInventoryIcon &idx, U32 attachment_point)
|
||||
void change_item_parent(LLInventoryModel* model,
|
||||
LLViewerInventoryItem* item,
|
||||
const LLUUID& new_parent_id,
|
||||
BOOL restamp)
|
||||
{
|
||||
const EWearableType wearable_type = EWearableType(LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK & attachment_point);
|
||||
switch(wearable_type)
|
||||
if (item->getParentUUID() != new_parent_id)
|
||||
{
|
||||
case WT_SHAPE:
|
||||
idx = BODYPART_SHAPE_ICON_NAME;
|
||||
break;
|
||||
case WT_SKIN:
|
||||
idx = BODYPART_SKIN_ICON_NAME;
|
||||
break;
|
||||
case WT_HAIR:
|
||||
idx = BODYPART_HAIR_ICON_NAME;
|
||||
break;
|
||||
case WT_EYES:
|
||||
idx = BODYPART_EYES_ICON_NAME;
|
||||
break;
|
||||
case WT_SHIRT:
|
||||
idx = CLOTHING_SHIRT_ICON_NAME;
|
||||
break;
|
||||
case WT_PANTS:
|
||||
idx = CLOTHING_PANTS_ICON_NAME;
|
||||
break;
|
||||
case WT_SHOES:
|
||||
idx = CLOTHING_SHOES_ICON_NAME;
|
||||
break;
|
||||
case WT_SOCKS:
|
||||
idx = CLOTHING_SOCKS_ICON_NAME;
|
||||
break;
|
||||
case WT_JACKET:
|
||||
idx = CLOTHING_JACKET_ICON_NAME;
|
||||
break;
|
||||
case WT_GLOVES:
|
||||
idx = CLOTHING_GLOVES_ICON_NAME;
|
||||
break;
|
||||
case WT_UNDERSHIRT:
|
||||
idx = CLOTHING_UNDERSHIRT_ICON_NAME;
|
||||
break;
|
||||
case WT_UNDERPANTS:
|
||||
idx = CLOTHING_UNDERPANTS_ICON_NAME;
|
||||
break;
|
||||
case WT_SKIRT:
|
||||
idx = CLOTHING_SKIRT_ICON_NAME;
|
||||
break;
|
||||
case WT_ALPHA:
|
||||
idx = CLOTHING_ALPHA_ICON_NAME;
|
||||
break;
|
||||
case WT_TATTOO:
|
||||
idx = CLOTHING_TATTOO_ICON_NAME;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
LLInventoryModel::update_list_t update;
|
||||
LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1);
|
||||
update.push_back(old_folder);
|
||||
LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
|
||||
update.push_back(new_folder);
|
||||
gInventory.accountForUpdate(update);
|
||||
|
||||
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
|
||||
new_item->setParent(new_parent_id);
|
||||
new_item->updateParentOnServer(restamp);
|
||||
model->updateItem(new_item);
|
||||
model->notifyObservers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const 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;
|
||||
assign_clothing_bodypart_icon(idx, attachment_point);
|
||||
break;
|
||||
case LLAssetType::AT_BODYPART:
|
||||
idx = BODYPART_ICON_NAME;
|
||||
assign_clothing_bodypart_icon(idx, attachment_point);
|
||||
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_LINK:
|
||||
idx = LINKITEM_ICON_NAME;
|
||||
break;
|
||||
case LLAssetType::AT_LINK_FOLDER:
|
||||
idx = LINKFOLDER_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);
|
||||
}
|
||||
|
||||
BOOL get_is_item_worn(const LLUUID& id)
|
||||
{
|
||||
|
|
@ -582,26 +457,3 @@ BOOL get_is_item_worn(const LLUUID& id)
|
|||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
void change_item_parent(LLInventoryModel* model,
|
||||
LLViewerInventoryItem* item,
|
||||
const LLUUID& new_parent_id,
|
||||
BOOL restamp)
|
||||
{
|
||||
if (item->getParentUUID() != new_parent_id)
|
||||
{
|
||||
LLInventoryModel::update_list_t update;
|
||||
LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1);
|
||||
update.push_back(old_folder);
|
||||
LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
|
||||
update.push_back(new_folder);
|
||||
gInventory.accountForUpdate(update);
|
||||
|
||||
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
|
||||
new_item->setParent(new_parent_id);
|
||||
new_item->updateParentOnServer(restamp);
|
||||
model->updateItem(new_item);
|
||||
model->notifyObservers();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -297,16 +297,6 @@ public:
|
|||
virtual void doItem(LLFolderViewItem* item);
|
||||
};
|
||||
|
||||
const 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 );
|
||||
|
||||
// Is this item or its baseitem is worn, attached, etc...
|
||||
BOOL get_is_item_worn(const LLUUID& id);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,187 @@
|
|||
/**
|
||||
* @file llinventoryicon.cpp
|
||||
* @brief Implementation of the inventory icon.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-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 "llinventoryicon.h"
|
||||
|
||||
#include "lldictionary.h"
|
||||
#include "llinventorydefines.h"
|
||||
#include "llui.h"
|
||||
#include "llwearabledictionary.h"
|
||||
|
||||
struct IconEntry : public LLDictionaryEntry
|
||||
{
|
||||
IconEntry(const std::string &item_name,
|
||||
const std::string &link_name)
|
||||
:
|
||||
LLDictionaryEntry(item_name),
|
||||
mLinkName(link_name)
|
||||
{}
|
||||
const std::string mLinkName;
|
||||
};
|
||||
|
||||
class LLIconDictionary : public LLSingleton<LLIconDictionary>,
|
||||
public LLDictionary<LLInventoryIcon::EIconName, IconEntry>
|
||||
{
|
||||
public:
|
||||
LLIconDictionary();
|
||||
};
|
||||
|
||||
LLIconDictionary::LLIconDictionary()
|
||||
{
|
||||
addEntry(LLInventoryIcon::ICONNAME_TEXTURE, new IconEntry("Inv_Texture", "Inv_Texture_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_SOUND, new IconEntry("Inv_Texture", "Inv_Texture_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CALLINGCARD_ONLINE, new IconEntry("Inv_Callingcard", "Inv_Callingcard_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CALLINGCARD_OFFLINE, new IconEntry("Inv_Callingcard", "Inv_Callingcard_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_LANDMARK, new IconEntry("Inv_Landmark", "Inv_Landmark_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_LANDMARK_VISITED, new IconEntry("Inv_Landmark", "Inv_Landmark_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_SCRIPT, new IconEntry("Inv_Script", "Inv_Script_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING, new IconEntry("Inv_Clothing", "Inv_Clothing_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_OBJECT, new IconEntry("Inv_Object", "Inv_Object_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_OBJECT_MULTI, new IconEntry("Inv_Object_Multi", "Inv_Object_Multi_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_NOTECARD, new IconEntry("Inv_Notecard", "Inv_Notecard_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_BODYPART, new IconEntry("Inv_Skin", "Inv_Skin_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_SNAPSHOT, new IconEntry("Inv_Snapshot", "Inv_Snapshot_Link"));
|
||||
|
||||
addEntry(LLInventoryIcon::ICONNAME_BODYPART_SHAPE, new IconEntry("Inv_BodyShape", "Inv_BodyShape_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_BODYPART_SKIN, new IconEntry("Inv_Skin", "Inv_Skin_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_BODYPART_HAIR, new IconEntry("Inv_Hair", "Inv_Hair_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_BODYPART_EYES, new IconEntry("Inv_Eye", "Inv_Eye_Link"));
|
||||
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_SHIRT, new IconEntry("Inv_Shirt", "Inv_Shirt_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_PANTS, new IconEntry("Inv_Pants", "Inv_Pants_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_SHOES, new IconEntry("Inv_Shoe", "Inv_Shoe_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_SOCKS, new IconEntry("Inv_Socks", "Inv_Socks_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_JACKET, new IconEntry("Inv_Jacket", "Inv_Jacket_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_GLOVES, new IconEntry("Inv_Gloves", "Inv_Gloves_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_UNDERSHIRT, new IconEntry("Inv_Undershirt", "Inv_Undershirt_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_UNDERPANTS, new IconEntry("Inv_Underpants", "Inv_Underpants_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_SKIRT, new IconEntry("Inv_Skirt", "Inv_Skirt_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_ALPHA, new IconEntry("Inv_Alpha", "Inv_Alpha_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_CLOTHING_TATTOO, new IconEntry("Inv_Tattoo", "Inv_Tattoo_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_ANIMATION, new IconEntry("Inv_Animation", "Inv_Animation_Link"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_GESTURE, new IconEntry("Inv_Gesture", "Inv_Gesture_Link"));
|
||||
|
||||
addEntry(LLInventoryIcon::ICONNAME_LINKITEM, new IconEntry("Inv_LinkItem", "Inv_LinkItem"));
|
||||
addEntry(LLInventoryIcon::ICONNAME_LINKFOLDER, new IconEntry("Inv_LinkItem", "Inv_LinkItem"));
|
||||
|
||||
addEntry(LLInventoryIcon::ICONNAME_NONE, new IconEntry("NONE", "NONE"));
|
||||
}
|
||||
|
||||
LLUIImagePtr LLInventoryIcon::getIcon(LLAssetType::EType asset_type,
|
||||
LLInventoryType::EType inventory_type,
|
||||
BOOL item_is_link,
|
||||
U32 misc_flag,
|
||||
BOOL item_is_multi)
|
||||
{
|
||||
const std::string& icon_name = getIconName(asset_type, inventory_type, item_is_link, 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,
|
||||
BOOL item_is_link,
|
||||
U32 misc_flag,
|
||||
BOOL item_is_multi)
|
||||
{
|
||||
EIconName idx = ICONNAME_OBJECT;
|
||||
if (item_is_multi)
|
||||
{
|
||||
idx = ICONNAME_OBJECT_MULTI;
|
||||
}
|
||||
|
||||
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 : idx = 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;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return getIconName(idx, item_is_link);
|
||||
}
|
||||
|
||||
|
||||
const std::string& LLInventoryIcon::getIconName(EIconName idx, BOOL item_is_link)
|
||||
{
|
||||
const IconEntry *entry = LLIconDictionary::instance().lookup(idx);
|
||||
if (item_is_link) return entry->mLinkName;
|
||||
return entry->mName;
|
||||
}
|
||||
|
||||
LLInventoryIcon::EIconName LLInventoryIcon::assignWearableIcon(U32 misc_flag)
|
||||
{
|
||||
const EWearableType wearable_type = EWearableType(LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK & misc_flag);
|
||||
return LLWearableDictionary::instance().getIconName(wearable_type);
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
/**
|
||||
* @file llinventoryfunctions.h
|
||||
* @brief Miscellaneous inventory-related functions and classes
|
||||
* class definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-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_LLINVENTORYICON_H
|
||||
#define LL_LLINVENTORYICON_H
|
||||
|
||||
#include "llassettype.h"
|
||||
#include "llinventorytype.h"
|
||||
#include "lluiimage.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_LINKITEM,
|
||||
ICONNAME_LINKFOLDER,
|
||||
|
||||
ICONNAME_COUNT,
|
||||
|
||||
ICONNAME_NONE = -1
|
||||
};
|
||||
|
||||
static const std::string& getIconName(LLAssetType::EType asset_type,
|
||||
LLInventoryType::EType inventory_type = LLInventoryType::IT_NONE,
|
||||
BOOL item_is_link = FALSE,
|
||||
U32 misc_flag = 0, // different meanings depending on item type
|
||||
BOOL item_is_multi = FALSE);
|
||||
static const std::string& getIconName(EIconName idx,
|
||||
BOOL item_is_link = FALSE);
|
||||
|
||||
static LLUIImagePtr getIcon(LLAssetType::EType asset_type,
|
||||
LLInventoryType::EType inventory_type = LLInventoryType::IT_NONE,
|
||||
BOOL item_is_link = FALSE,
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ BOOL LLPanelInventoryListItemBase::postBuild()
|
|||
setIconCtrl(getChild<LLIconCtrl>("item_icon"));
|
||||
setTitleCtrl(getChild<LLTextBox>("item_name"));
|
||||
|
||||
mIconImage = get_item_icon(mItem->getType(), mItem->getInventoryType(), mItem->getFlags(), FALSE);
|
||||
mIconImage = LLInventoryIcon::getIcon(mItem->getType(), mItem->getInventoryType(), mItem->getFlags(), FALSE);
|
||||
|
||||
setNeedsRefresh(true);
|
||||
|
||||
|
|
|
|||
|
|
@ -335,7 +335,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 );
|
||||
|
|
@ -552,7 +552,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";
|
||||
|
|
@ -620,7 +620,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);
|
||||
|
||||
|
|
|
|||
|
|
@ -351,7 +351,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()
|
||||
|
|
@ -891,7 +891,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()
|
||||
|
|
@ -934,7 +934,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()
|
||||
|
|
@ -1056,7 +1056,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);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1087,7 +1087,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
|
||||
|
|
@ -1127,7 +1127,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);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1215,7 +1215,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);
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
|
|
@ -1245,7 +1245,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()
|
||||
|
|
@ -1298,7 +1298,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()
|
||||
|
|
@ -1345,7 +1345,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()
|
||||
|
|
@ -1402,7 +1402,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 );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification
|
|||
childSetActionTextbox("attachment", boost::bind(
|
||||
&LLToastGroupNotifyPanel::onClickAttachment, this));
|
||||
|
||||
LLUIImagePtr attachIconImg = get_item_icon(mInventoryOffer->mType,
|
||||
LLUIImagePtr attachIconImg = LLInventoryIcon::getIcon(mInventoryOffer->mType,
|
||||
LLInventoryType::IT_TEXTURE,
|
||||
0, FALSE);
|
||||
pAttachIcon->setValue(attachIconImg->getName());
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ BOOL LLPanelDummyClothingListItem::postBuild()
|
|||
|
||||
addWidgetToRightSide("btn_add");
|
||||
|
||||
setIconImage(get_item_icon(LLAssetType::AT_CLOTHING, LLInventoryType::IT_NONE, mWearableType, FALSE));
|
||||
setIconImage(LLInventoryIcon::getIcon(LLAssetType::AT_CLOTHING, LLInventoryType::IT_NONE, mWearableType, FALSE));
|
||||
updateItem();
|
||||
|
||||
// Make it look loke clothing item - reserve space for 'delete' button
|
||||
|
|
|
|||
|
|
@ -214,6 +214,40 @@ with the same filename but different name
|
|||
<texture name="Inv_Underpants" file_name="icons/Inv_Underpants.png" preload="false" />
|
||||
<texture name="Inv_Undershirt" file_name="icons/Inv_Undershirt.png" preload="false" />
|
||||
|
||||
<texture name="Inv_Alpha_Link" file_name="icons/Inv_Alpha_Link.png" preload="false" />
|
||||
<texture name="Inv_Animation_Link" file_name="icons/Inv_Animation_Link.png" preload="false" />
|
||||
<texture name="Inv_BodyShape_Link" file_name="icons/Inv_BodyShape_Link.png" preload="false" />
|
||||
<texture name="Inv_CallingCard_Link" file_name="icons/Inv_CallingCard_Link.png" preload="false" />
|
||||
<texture name="Inv_Clothing_Link" file_name="icons/Inv_Clothing_Link.png" preload="false" />
|
||||
<texture name="Inv_Eye_Link" file_name="icons/Inv_Eye_Link.png" preload="false" />
|
||||
<texture name="Inv_FolderClosed_Link" file_name="icons/Inv_FolderClosed_Link.png" preload="false" />
|
||||
<texture name="Inv_FolderOpen_Link" file_name="icons/Inv_FolderOpen_Link.png" preload="false" />
|
||||
<texture name="Inv_Gesture_Link" file_name="icons/Inv_Gesture_Link.png" preload="false" />
|
||||
<texture name="Inv_Gloves_Link" file_name="icons/Inv_Gloves_Link.png" preload="false" />
|
||||
<texture name="Inv_Hair_Link" file_name="icons/Inv_Hair_Link.png" preload="false" />
|
||||
<texture name="Inv_LinkItem_Link" file_name="icons/Inv_LinkItem_Link.png" preload="false" />
|
||||
<texture name="Inv_LinkFolder_Link" file_name="icons/Inv_LinkFolder_Link.png" preload="false" />
|
||||
<texture name="Inv_Jacket_Link" file_name="icons/Inv_Jacket_Link.png" preload="false" />
|
||||
<texture name="Inv_LookFolderOpen_Link" file_name="icons/Inv_LookFolderOpen_Link.png" preload="false" />
|
||||
<texture name="Inv_LookFolderClosed_Link" file_name="icons/Inv_LookFolderClosed_Link.png" preload="false" />
|
||||
<texture name="Inv_Landmark_Link" file_name="icons/Inv_Landmark_Link.png" preload="false" />
|
||||
<texture name="Inv_Notecard_Link" file_name="icons/Inv_Notecard_Link.png" preload="false" />
|
||||
<texture name="Inv_Object_Link" file_name="icons/Inv_Object_Link.png" preload="false" />
|
||||
<texture name="Inv_Object_Multi_Link" file_name="icons/Inv_Object_Multi_Link.png" preload="false" />
|
||||
<texture name="Inv_Pants_Link" file_name="icons/Inv_Pants_Link.png" preload="false" />
|
||||
<texture name="Inv_Script_Link" file_name="icons/Inv_Script_Link.png" preload="false" />
|
||||
<texture name="Inv_Shirt_Link" file_name="icons/Inv_Shirt_Link.png" preload="false" />
|
||||
<texture name="Inv_Shoe_Link" file_name="icons/Inv_Shoe_Link.png" preload="false" />
|
||||
<texture name="Inv_Skin_Link" file_name="icons/Inv_Skin_Link.png" preload="false" />
|
||||
<texture name="Inv_Skirt_Link" file_name="icons/Inv_Skirt_Link.png" preload="false" />
|
||||
<texture name="Inv_Snapshot_Link" file_name="icons/Inv_Snapshot_Link.png" preload="false" />
|
||||
<texture name="Inv_Socks_Link" file_name="icons/Inv_Socks_Link.png" preload="false" />
|
||||
<texture name="Inv_Sound_Link" file_name="icons/Inv_Sound_Link.png" preload="false" />
|
||||
<texture name="Inv_Tattoo_Link" file_name="icons/Inv_Tattoo_Link.png" preload="false" />
|
||||
<texture name="Inv_Texture_Link" file_name="icons/Inv_Texture_Link.png" preload="false" />
|
||||
<texture name="Inv_Underpants_Link" file_name="icons/Inv_Underpants_Link.png" preload="false" />
|
||||
<texture name="Inv_Undershirt_Link" file_name="icons/Inv_Undershirt_Link.png" preload="false" />
|
||||
|
||||
<texture name="Linden_Dollar_Alert" file_name="widgets/Linden_Dollar_Alert.png"/>
|
||||
<texture name="Linden_Dollar_Background" file_name="widgets/Linden_Dollar_Background.png"/>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue