summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-10-23 06:20:10 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-10-23 06:20:10 -0400
commitb99d57fbdeda3f012e090bb610f9d3fb44f4248f (patch)
tree52e674e2757374c6e60675b29c878f400714b813
parent920b6de4b1b2234b356258dc7ea1fb108d648cea (diff)
MAINT-4196 WIP, including clearer inventory warnings for attachment errors
-rwxr-xr-xindra/newview/llappearancemgr.cpp7
-rwxr-xr-xindra/newview/llinventorybridge.cpp20
-rwxr-xr-xindra/newview/llviewerinventory.cpp16
-rwxr-xr-xindra/newview/llviewerinventory.h6
-rwxr-xr-xindra/newview/llvoavatarself.cpp18
-rwxr-xr-xindra/newview/llvoavatarself.h2
-rwxr-xr-xindra/newview/llwearableitemslist.cpp10
-rwxr-xr-xindra/newview/skins/default/xui/en/strings.xml8
8 files changed, 64 insertions, 23 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 29534a4382..fba2b9d3a4 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2699,7 +2699,12 @@ void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInve
const LLInventoryItem* item = item_array.at(i).get();
if (item->getIsLinkType() && item->getLinkedUUID() == item_id)
{
- remove_inventory_item(item->getUUID(), cb);
+ bool immediate_delete = false;
+ if (item->getType() == LLAssetType::AT_OBJECT)
+ {
+ immediate_delete = true;
+ }
+ remove_inventory_item(item->getUUID(), cb, immediate_delete);
}
}
}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 33e557cddd..1b44049067 100755
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -5326,16 +5326,20 @@ std::string LLObjectBridge::getLabelSuffix() const
{
return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn");
}
- std::string attachment_point_name = gAgentAvatarp->getAttachedPointName(mUUID);
- if (attachment_point_name == LLStringUtil::null) // Error condition, invalid attach point
+ std::string attachment_point_name;
+ if (gAgentAvatarp->getAttachedPointName(mUUID, attachment_point_name))
{
- attachment_point_name = "Invalid Attachment";
- }
- // e.g. "(worn on ...)" / "(attached to ...)"
- LLStringUtil::format_map_t args;
- args["[ATTACHMENT_POINT]"] = LLTrans::getString(attachment_point_name);
+ LLStringUtil::format_map_t args;
+ args["[ATTACHMENT_POINT]"] = LLTrans::getString(attachment_point_name);
- return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args);
+ return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args);
+ }
+ else
+ {
+ LLStringUtil::format_map_t args;
+ args["[ATTACHMENT_ERROR]"] = LLTrans::getString(attachment_point_name);
+ return LLItemBridge::getLabelSuffix() + LLTrans::getString("AttachmentErrorMessage", args);
+ }
}
return LLItemBridge::getLabelSuffix();
}
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 4e4c3471be..39267e8834 100755
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1450,7 +1450,8 @@ void update_inventory_category(
void remove_inventory_items(
LLInventoryObject::object_list_t& items_to_kill,
- LLPointer<LLInventoryCallback> cb)
+ LLPointer<LLInventoryCallback> cb
+ )
{
for (LLInventoryObject::object_list_t::iterator it = items_to_kill.begin();
it != items_to_kill.end();
@@ -1462,12 +1463,13 @@ void remove_inventory_items(
void remove_inventory_item(
const LLUUID& item_id,
- LLPointer<LLInventoryCallback> cb)
+ LLPointer<LLInventoryCallback> cb,
+ bool immediate_delete)
{
LLPointer<LLInventoryObject> obj = gInventory.getItem(item_id);
if (obj)
{
- remove_inventory_item(obj, cb);
+ remove_inventory_item(obj, cb, immediate_delete);
}
else
{
@@ -1477,7 +1479,8 @@ void remove_inventory_item(
void remove_inventory_item(
LLPointer<LLInventoryObject> obj,
- LLPointer<LLInventoryCallback> cb)
+ LLPointer<LLInventoryCallback> cb,
+ bool immediate_delete)
{
if(obj)
{
@@ -1487,6 +1490,11 @@ void remove_inventory_item(
{
LLPointer<AISCommand> cmd_ptr = new RemoveItemCommand(item_id, cb);
cmd_ptr->run_command();
+
+ if (immediate_delete)
+ {
+ gInventory.onObjectDeletedFromServer(item_id);
+ }
}
else // no cap
{
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index d345c49cfb..ca92565600 100755
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -394,11 +394,13 @@ void remove_inventory_items(
void remove_inventory_item(
LLPointer<LLInventoryObject> obj,
- LLPointer<LLInventoryCallback> cb);
+ LLPointer<LLInventoryCallback> cb,
+ bool immediate_delete = false);
void remove_inventory_item(
const LLUUID& item_id,
- LLPointer<LLInventoryCallback> cb);
+ LLPointer<LLInventoryCallback> cb,
+ bool immediate_delete = false);
void remove_inventory_category(
const LLUUID& cat_id,
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 42a7c2e576..ccc30c448d 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -1093,9 +1093,19 @@ LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id)
return NULL;
}
-const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id) const
+bool LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const
{
+ if (!gInventory.getItem(inv_item_id))
+ {
+ name = "ATTACHMENT_MISSING_ITEM";
+ return false;
+ }
const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id);
+ if (!gInventory.getItem(base_inv_item_id))
+ {
+ name = "ATTACHMENT_MISSING_BASE_ITEM";
+ return false;
+ }
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -1103,11 +1113,13 @@ const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id
const LLViewerJointAttachment* attachment = iter->second;
if (attachment->getAttachedObject(base_inv_item_id))
{
- return attachment->getName();
+ name = attachment->getName();
+ return true;
}
}
- return LLStringUtil::null;
+ name = "ATTACHMENT_NOT_ATTACHED";
+ return false;
}
//virtual
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index e03de9fa0b..369c15d0f9 100755
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -293,7 +293,7 @@ public:
void addAttachmentRequest(const LLUUID& inv_item_id);
void removeAttachmentRequest(const LLUUID& inv_item_id);
LLViewerObject* getWornAttachment(const LLUUID& inv_item_id);
- const std::string getAttachedPointName(const LLUUID& inv_item_id) const;
+ bool getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const;
/*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object);
/*virtual*/ BOOL detachObject(LLViewerObject *viewer_object);
static BOOL detachAttachmentIntoInventory(const LLUUID& item_id);
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index ca60b79f9d..fac0fd63ee 100755
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -364,8 +364,14 @@ void LLPanelAttachmentListItem::updateItem(const std::string& name,
LLViewerInventoryItem* inv_item = getItem();
if (inv_item && isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(inv_item->getLinkedUUID()))
{
- std::string joint = LLTrans::getString(gAgentAvatarp->getAttachedPointName(inv_item->getLinkedUUID()));
- title_joint = title_joint + " (" + joint + ")";
+ std::string found_name;
+ bool found = gAgentAvatarp->getAttachedPointName(inv_item->getLinkedUUID(),found_name);
+ std::string trans_name = LLTrans::getString(found_name);
+ if (!found)
+ {
+ LL_WARNS() << "invalid attachment joint, err " << found_name << LL_ENDL;
+ }
+ title_joint = title_joint + " (" + trans_name + ")";
}
LLPanelInventoryListItemBase::updateItem(title_joint, item_state);
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 5dcb8e2cdf..945a77c071 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2307,6 +2307,7 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors.
<string name="LoadingContents">Loading contents...</string>
<string name="NoContents">No contents</string>
<string name="WornOnAttachmentPoint" value=" (worn on [ATTACHMENT_POINT])" />
+ <string name="AttachmentErrorMessage" value=" ([ATTACHMENT_ERROR])" />
<string name="ActiveGesture" value="[GESLABEL] (active)"/>
<!-- Inventory permissions -->
<string name="PermYes">Yes</string>
@@ -2433,9 +2434,12 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors.
<string name="Stomach">Stomach</string>
<string name="Left Pec">Left Pec</string>
<string name="Right Pec">Right Pec</string>
- <string name="Neck">Neck</string>
- <string name="Avatar Center">Avatar Center</string>
+ <string name="Neck">Neck</string>
+ <string name="Avatar Center">Avatar Center</string>
<string name="Invalid Attachment">Invalid Attachment Point</string>
+ <string name="ATTACHMENT_MISSING_ITEM">Error: missing item</string>
+ <string name="ATTACHMENT_MISSING_BASE_ITEM">Error: missing base item</string>
+ <string name="ATTACHMENT_NOT_ATTACHED">Error: object is in current outfit but not attached</string>
<!-- Avatar age computation, see LLDateUtil::ageFromDate -->
<string name="YearsMonthsOld">[AGEYEARS] [AGEMONTHS] old</string>