summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2009-12-01 19:21:39 -0500
committerNyx (Neal Orman) <nyx@lindenlab.com>2009-12-01 19:21:39 -0500
commit5642d7d0122da91d8ef23f8adb069cc82e0c4ed4 (patch)
tree08d70da6b706304fe0e32fc0949d27504340728c
parentdd6fa93d84a267c6367f83c2d7581207e6dd878d (diff)
EXT-2749 Appearance editor still uses the name for items that have been renamed.
The name stored in an LLWearable object is not always in sync with the LLInventoryItem name. Since we reference these by asset id, which does not change when you rename something (only the LLInventoryItem changes). Fixed by refreshing the name from the LLInventoryItem every time we wear the object. If we are already wearing the object, the wearable's name is already explicitly updated. Code reviewed by Bigpapi --HG-- branch : avatar-pipeline
-rw-r--r--indra/newview/llagentwearables.cpp1
-rw-r--r--indra/newview/llwearable.cpp10
-rw-r--r--indra/newview/llwearable.h4
3 files changed, 15 insertions, 0 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index b52b58f9e2..907b92d478 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -704,6 +704,7 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl
void LLAgentWearables::wearableUpdated(LLWearable *wearable)
{
mAvatarObject->wearableUpdated(wearable->getType(), TRUE);
+ wearable->refreshName();
wearable->setLabelUpdated();
// Hack pt 2. If the wearable we just loaded has definition version 24,
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index 3cb0ec4bad..0405b9d28b 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -1094,6 +1094,16 @@ void LLWearable::setLabelUpdated() const
gInventory.addChangedMask(LLInventoryObserver::LABEL, getItemID());
}
+void LLWearable::refreshName()
+{
+ LLUUID item_id = getItemID();
+ LLInventoryItem* item = gInventory.getItem(item_id);
+ if( item )
+ {
+ mName = item->getName();
+ }
+}
+
struct LLWearableSaveData
{
EWearableType mType;
diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h
index 43ffa12420..82d388ab7e 100644
--- a/indra/newview/llwearable.h
+++ b/indra/newview/llwearable.h
@@ -133,6 +133,10 @@ public:
// Something happened that requires the wearable's label to be updated (e.g. worn/unworn).
void setLabelUpdated() const;
+ // the wearable was worn. make sure the name of the wearable object matches the LLViewerInventoryItem,
+ // not the wearable asset itself.
+ void refreshName();
+
private:
typedef std::map<S32, LLLocalTextureObject*> te_map_t;
typedef std::map<S32, LLVisualParam *> visual_param_index_map_t;