summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-06-10 11:41:28 -0400
committerLoren Shih <seraph@lindenlab.com>2010-06-10 11:41:28 -0400
commit388318c5328d002e316d27500dc91560d176b414 (patch)
tree0adbee4a47e38588a66f7ab58960312c74dd5900 /indra/newview
parente414a91d7fb8ffea664bf1c035cb0bab3c4ece7e (diff)
EXT-7430 : Create art overlay for inventory icons that are links
Changed folder icon logic to use LLViewerFolderType (as it should always been doing).
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorybridge.cpp31
-rw-r--r--indra/newview/llviewerfoldertype.cpp65
-rw-r--r--indra/newview/llviewerfoldertype.h2
3 files changed, 40 insertions, 58 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index d82f96bc25..293585cd9c 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -65,6 +65,7 @@
#include "llsidetray.h"
#include "lltrans.h"
#include "llviewerassettype.h"
+#include "llviewerfoldertype.h"
#include "llviewermenu.h"
#include "llviewermessage.h"
#include "llviewerobjectlist.h"
@@ -2257,38 +2258,12 @@ LLUIImagePtr LLFolderBridge::getIcon() const
// static
LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type)
{
- switch (preferred_type)
- {
- case LLFolderType::FT_OUTFIT:
- return LLUI::getUIImage("Inv_LookFolderClosed");
- case LLFolderType::FT_LOST_AND_FOUND:
- return LLUI::getUIImage("Inv_LostClosed");
- case LLFolderType::FT_TRASH:
- return LLUI::getUIImage("Inv_TrashClosed");
- case LLFolderType::FT_NONE:
- return LLUI::getUIImage("Inv_FolderClosed");
- default:
- return LLUI::getUIImage("Inv_SysClosed");
- }
+ return LLUI::getUIImage(LLViewerFolderType::lookupIconName(preferred_type, FALSE));
}
LLUIImagePtr LLFolderBridge::getOpenIcon() const
{
- // Bypassing LLViewerFolderType::lookup() since
- // we aren't using different system folder icons
- switch (getPreferredType())
- {
- case LLFolderType::FT_OUTFIT:
- return LLUI::getUIImage("Inv_LookFolderOpen");
- case LLFolderType::FT_LOST_AND_FOUND:
- return LLUI::getUIImage("Inv_LostOpen");
- case LLFolderType::FT_TRASH:
- return LLUI::getUIImage("Inv_TrashOpen");
- case LLFolderType::FT_NONE:
- return LLUI::getUIImage("Inv_FolderOpen");
- default:
- return LLUI::getUIImage("Inv_SysOpen");
- }
+ return LLUI::getUIImage(LLViewerFolderType::lookupIconName(getPreferredType(), TRUE));
}
diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp
index 033d35d80a..2859dabfba 100644
--- a/indra/newview/llviewerfoldertype.cpp
+++ b/indra/newview/llviewerfoldertype.cpp
@@ -43,13 +43,15 @@ struct ViewerFolderEntry : public LLDictionaryEntry
{
// Constructor for non-ensembles
ViewerFolderEntry(const std::string &new_category_name, // default name when creating a new category of this type
- const std::string &icon_name, // name of the folder icon
+ const std::string &icon_name_open, // name of the folder icon
+ const std::string &icon_name_closed,
BOOL is_quiet // folder doesn't need a UI update when changed
)
:
LLDictionaryEntry(empty_string), // no reverse lookup needed on non-ensembles, so just leave this blank
- mIconName(icon_name),
mNewCategoryName(new_category_name),
+ mIconNameOpen(icon_name_open),
+ mIconNameClosed(icon_name_closed),
mIsQuiet(is_quiet)
{
mAllowedNames.clear();
@@ -63,7 +65,8 @@ struct ViewerFolderEntry : public LLDictionaryEntry
)
:
LLDictionaryEntry(xui_name),
- mIconName(icon_name),
+ mIconNameOpen(icon_name),
+ mIconNameClosed(icon_name),
mNewCategoryName(new_category_name),
mIsQuiet(FALSE)
{
@@ -84,7 +87,8 @@ struct ViewerFolderEntry : public LLDictionaryEntry
}
return false;
}
- const std::string mIconName;
+ const std::string mIconNameOpen;
+ const std::string mIconNameClosed;
const std::string mNewCategoryName;
typedef std::vector<std::string> name_vec_t;
name_vec_t mAllowedNames;
@@ -104,31 +108,31 @@ LLViewerFolderDictionary::LLViewerFolderDictionary()
{
initEnsemblesFromFile();
- // NEW CATEGORY NAME FOLDER ICON NAME QUIET?
- // |-------------------------|-------------------------------|-----------|
- addEntry(LLFolderType::FT_TEXTURE, new ViewerFolderEntry("Textures", "inv_folder_texture.tga", FALSE));
- addEntry(LLFolderType::FT_SOUND, new ViewerFolderEntry("Sounds", "inv_folder_sound.tga", FALSE));
- addEntry(LLFolderType::FT_CALLINGCARD, new ViewerFolderEntry("Calling Cards", "inv_folder_callingcard.tga", FALSE));
- addEntry(LLFolderType::FT_LANDMARK, new ViewerFolderEntry("Landmarks", "inv_folder_landmark.tga", FALSE));
- addEntry(LLFolderType::FT_CLOTHING, new ViewerFolderEntry("Clothing", "inv_folder_clothing.tga", FALSE));
- addEntry(LLFolderType::FT_OBJECT, new ViewerFolderEntry("Objects", "inv_folder_object.tga", FALSE));
- addEntry(LLFolderType::FT_NOTECARD, new ViewerFolderEntry("Notecards", "inv_folder_notecard.tga", FALSE));
- addEntry(LLFolderType::FT_ROOT_INVENTORY, new ViewerFolderEntry("My Inventory", "", FALSE));
- addEntry(LLFolderType::FT_LSL_TEXT, new ViewerFolderEntry("Scripts", "inv_folder_script.tga", FALSE));
- addEntry(LLFolderType::FT_BODYPART, new ViewerFolderEntry("Body Parts", "inv_folder_bodypart.tga", FALSE));
- addEntry(LLFolderType::FT_TRASH, new ViewerFolderEntry("Trash", "inv_folder_trash.tga", TRUE));
- addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, new ViewerFolderEntry("Photo Album", "inv_folder_snapshot.tga", FALSE));
- addEntry(LLFolderType::FT_LOST_AND_FOUND, new ViewerFolderEntry("Lost And Found", "inv_folder_lostandfound.tga", TRUE));
- addEntry(LLFolderType::FT_ANIMATION, new ViewerFolderEntry("Animations", "inv_folder_animation.tga", FALSE));
- addEntry(LLFolderType::FT_GESTURE, new ViewerFolderEntry("Gestures", "inv_folder_gesture.tga", FALSE));
- addEntry(LLFolderType::FT_FAVORITE, new ViewerFolderEntry("Favorites", "inv_folder_plain_closed.tga", FALSE));
+ // NEW CATEGORY NAME FOLDER OPEN FOLDER CLOSED QUIET?
+ // |-------------------------|-----------------------|----------------------|-----------|
+ addEntry(LLFolderType::FT_TEXTURE, new ViewerFolderEntry("Textures", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_SOUND, new ViewerFolderEntry("Sounds", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_CALLINGCARD, new ViewerFolderEntry("Calling Cards", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_LANDMARK, new ViewerFolderEntry("Landmarks", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_CLOTHING, new ViewerFolderEntry("Clothing", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_OBJECT, new ViewerFolderEntry("Objects", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_NOTECARD, new ViewerFolderEntry("Notecards", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_ROOT_INVENTORY, new ViewerFolderEntry("My Inventory", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_LSL_TEXT, new ViewerFolderEntry("Scripts", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_BODYPART, new ViewerFolderEntry("Body Parts", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_TRASH, new ViewerFolderEntry("Trash", "Inv_TrashOpen", "Inv_TrashClosed", TRUE));
+ addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, new ViewerFolderEntry("Photo Album", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_LOST_AND_FOUND, new ViewerFolderEntry("Lost And Found", "Inv_LostOpen", "Inv_LostClosed", TRUE));
+ addEntry(LLFolderType::FT_ANIMATION, new ViewerFolderEntry("Animations", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_GESTURE, new ViewerFolderEntry("Gestures", "Inv_SysOpen", "Inv_SysClosed", FALSE));
+ addEntry(LLFolderType::FT_FAVORITE, new ViewerFolderEntry("Favorites", "Inv_SysOpen", "Inv_SysClosed", FALSE));
- addEntry(LLFolderType::FT_CURRENT_OUTFIT, new ViewerFolderEntry("Current Outfit", "inv_folder_current_outfit.tga",TRUE));
- addEntry(LLFolderType::FT_OUTFIT, new ViewerFolderEntry("New Outfit", "inv_folder_outfit.tga", TRUE));
- addEntry(LLFolderType::FT_MY_OUTFITS, new ViewerFolderEntry("My Outfits", "inv_folder_my_outfits.tga", TRUE));
- addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "inv_folder_inbox.tga", FALSE));
+ addEntry(LLFolderType::FT_CURRENT_OUTFIT, new ViewerFolderEntry("Current Outfit", "Inv_SysOpen", "Inv_SysClosed", TRUE));
+ addEntry(LLFolderType::FT_OUTFIT, new ViewerFolderEntry("New Outfit", "Inv_LookFolderOpen", "Inv_LookFolderClosed", TRUE));
+ addEntry(LLFolderType::FT_MY_OUTFITS, new ViewerFolderEntry("My Outfits", "Inv_SysOpen", "Inv_SysClosed", TRUE));
+ addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "Inv_SysOpen", "Inv_SysClosed", FALSE));
- addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "inv_folder_plain_closed.tga", FALSE));
+ addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_SysOpen", "Inv_SysClosed", FALSE));
}
bool LLViewerFolderDictionary::initEnsemblesFromFile()
@@ -213,12 +217,15 @@ LLFolderType::EType LLViewerFolderType::lookupTypeFromXUIName(const std::string
return LLViewerFolderDictionary::getInstance()->lookup(name);
}
-const std::string &LLViewerFolderType::lookupIconName(LLFolderType::EType folder_type)
+const std::string &LLViewerFolderType::lookupIconName(LLFolderType::EType folder_type, BOOL is_open)
{
const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type);
if (entry)
{
- return entry->mIconName;
+ if (is_open)
+ return entry->mIconNameOpen;
+ else
+ return entry->mIconNameClosed;
}
return badLookup();
}
diff --git a/indra/newview/llviewerfoldertype.h b/indra/newview/llviewerfoldertype.h
index dd9360da90..3744ac20f8 100644
--- a/indra/newview/llviewerfoldertype.h
+++ b/indra/newview/llviewerfoldertype.h
@@ -44,7 +44,7 @@ public:
static const std::string& lookupXUIName(EType folder_type); // name used by the UI
static LLFolderType::EType lookupTypeFromXUIName(const std::string& name);
- static const std::string& lookupIconName(EType folder_type); // folder icon name
+ static const std::string& lookupIconName(EType folder_type, BOOL is_open = FALSE); // folder icon name
static BOOL lookupIsQuietType(EType folder_type); // folder doesn't require UI update when changes have occured
static const std::string& lookupNewCategoryName(EType folder_type); // default name when creating new category
static LLFolderType::EType lookupTypeFromNewCategoryName(const std::string& name); // default name when creating new category