summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r--indra/newview/llviewerinventory.cpp79
1 files changed, 69 insertions, 10 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 49748c59e8..face7124c2 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -39,6 +39,7 @@
#include "llagent.h"
#include "llagentcamera.h"
+#include "llagentwearables.h"
#include "llviewerfoldertype.h"
#include "llfolderview.h"
#include "llviewercontrol.h"
@@ -61,9 +62,9 @@
#include "llviewerwindow.h"
#include "lltrans.h"
#include "llappearancemgr.h"
-#include "llfloatercustomize.h"
#include "llcommandhandler.h"
#include "llviewermessage.h"
+#include "llsidepanelappearance.h"
///----------------------------------------------------------------------------
/// Helper class to store special inventory item names
@@ -95,6 +96,42 @@ public:
mInventoryItemsDict["New Script"] = LLTrans::getString("New Script");
mInventoryItemsDict["New Folder"] = LLTrans::getString("New Folder");
mInventoryItemsDict["Contents"] = LLTrans::getString("Contents");
+
+ mInventoryItemsDict["Gesture"] = LLTrans::getString("Gesture");
+ mInventoryItemsDict["Male Gestures"] = LLTrans::getString("Male Gestures");
+ mInventoryItemsDict["Female Gestures"] = LLTrans::getString("Female Gestures");
+ mInventoryItemsDict["Other Gestures"] = LLTrans::getString("Other Gestures");
+ mInventoryItemsDict["Speech Gestures"] = LLTrans::getString("Speech Gestures");
+ mInventoryItemsDict["Common Gestures"] = LLTrans::getString("Common Gestures");
+
+ //predefined gestures
+
+ //male
+ mInventoryItemsDict["Male - Excuse me"] = LLTrans::getString("Male - Excuse me");
+ mInventoryItemsDict["Male - Get lost"] = LLTrans::getString("Male - Get lost");
+ mInventoryItemsDict["Male - Blow kiss"] = LLTrans::getString("Male - Blow kiss");
+ mInventoryItemsDict["Male - Boo"] = LLTrans::getString("Male - Boo");
+ mInventoryItemsDict["Male - Bored"] = LLTrans::getString("Male - Bored");
+ mInventoryItemsDict["Male - Hey"] = LLTrans::getString("Male - Hey");
+ mInventoryItemsDict["Male - Laugh"] = LLTrans::getString("Male - Laugh");
+ mInventoryItemsDict["Male - Repulsed"] = LLTrans::getString("Male - Repulsed");
+ mInventoryItemsDict["Male - Shrug"] = LLTrans::getString("Male - Shrug");
+ mInventoryItemsDict["Male - Stick tougue out"] = LLTrans::getString("Male - Stick tougue out");
+ mInventoryItemsDict["Male - Wow"] = LLTrans::getString("Male - Wow");
+
+ //female
+ mInventoryItemsDict["Female - Excuse me"] = LLTrans::getString("Female - Excuse me");
+ mInventoryItemsDict["Female - Get lost"] = LLTrans::getString("Female - Get lost");
+ mInventoryItemsDict["Female - Blow kiss"] = LLTrans::getString("Female - Blow kiss");
+ mInventoryItemsDict["Female - Boo"] = LLTrans::getString("Female - Boo");
+ mInventoryItemsDict["Female - Bored"] = LLTrans::getString("Female - Bored");
+ mInventoryItemsDict["Female - Hey"] = LLTrans::getString("Female - Hey");
+ mInventoryItemsDict["Female - Laugh"] = LLTrans::getString("Female - Laugh");
+ mInventoryItemsDict["Female - Repulsed"] = LLTrans::getString("Female - Repulsed");
+ mInventoryItemsDict["Female - Shrug"] = LLTrans::getString("Female - Shrug");
+ mInventoryItemsDict["Female - Stick tougue out"]= LLTrans::getString("Female - Stick tougue out");
+ mInventoryItemsDict["Female - Wow"] = LLTrans::getString("Female - Wow");
+
}
};
@@ -570,6 +607,7 @@ bool LLViewerInventoryCategory::fetch()
if((VERSION_UNKNOWN == mVersion)
&& mDescendentsRequested.hasExpired()) //Expired check prevents multiple downloads.
{
+ LL_DEBUGS("InventoryFetch") << "Fetching category children: " << mName << ", UUID: " << mUUID << LL_ENDL;
const F32 FETCH_TIMER_EXPIRY = 10.0f;
mDescendentsRequested.reset();
mDescendentsRequested.setTimerExpirySec(FETCH_TIMER_EXPIRY);
@@ -837,19 +875,29 @@ void WearOnAvatarCallback::fire(const LLUUID& inv_item)
LLViewerInventoryItem *item = gInventory.getItem(inv_item);
if (item)
{
- wear_inventory_item_on_avatar(item);
+ LLAppearanceMgr::instance().wearItemOnAvatar(inv_item, true, mReplace);
}
}
void ModifiedCOFCallback::fire(const LLUUID& inv_item)
{
LLAppearanceMgr::instance().updateAppearanceFromCOF();
- if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgentCamera.getCameraMode() )
+
+ if (LLSideTray::getInstance()->isPanelActive("sidepanel_appearance"))
+ {
+ // *HACK: Edit the wearable that has just been worn
+ // only if the Appearance SP is currently opened.
+ LLAgentWearables::editWearable(inv_item);
+ }
+
+ // TODO: camera mode may not be changed if a debug setting is tweaked
+ if( gAgentCamera.cameraCustomizeAvatar() )
{
// If we're in appearance editing mode, the current tab may need to be refreshed
- if (gFloaterCustomize)
+ LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(LLSideTray::getInstance()->getPanel("sidepanel_appearance"));
+ if (panel)
{
- gFloaterCustomize->switchToDefaultSubpart();
+ panel->showDefaultSubpart();
}
}
}
@@ -1202,10 +1250,8 @@ void menu_create_inventory_item(LLFolderView* root, LLFolderBridge *bridge, cons
LLWearableType::EType wearable_type = LLWearableType::typeNameToType(type_name);
if (wearable_type >= LLWearableType::WT_SHAPE && wearable_type < LLWearableType::WT_COUNT)
{
- LLAssetType::EType asset_type = LLWearableType::getAssetType(wearable_type);
- LLFolderType::EType folder_type = LLFolderType::assetTypeToFolderType(asset_type);
- const LLUUID parent_id = bridge ? bridge->getUUID() : gInventory.findCategoryUUIDForType(folder_type);
- LLFolderBridge::createWearable(parent_id, wearable_type);
+ const LLUUID parent_id = bridge ? bridge->getUUID() : LLUUID::null;
+ LLAgentWearables::createWearable(wearable_type, false, parent_id);
}
else
{
@@ -1544,7 +1590,6 @@ LLWearableType::EType LLViewerInventoryItem::getWearableType() const
{
if (!isWearableType())
{
- llwarns << "item is not a wearable" << llendl;
return LLWearableType::WT_INVALID;
}
return LLWearableType::EType(getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK);
@@ -1653,6 +1698,20 @@ bool LLViewerInventoryItem::checkPermissionsSet(PermissionMask mask) const
return ((curr_mask & mask) == mask);
}
+PermissionMask LLViewerInventoryItem::getPermissionMask() const
+{
+ const LLPermissions& permissions = getPermissions();
+
+ BOOL copy = permissions.allowCopyBy(gAgent.getID());
+ BOOL mod = permissions.allowModifyBy(gAgent.getID());
+ BOOL xfer = permissions.allowOperationBy(PERM_TRANSFER, gAgent.getID());
+ PermissionMask perm_mask = 0;
+ if (copy) perm_mask |= PERM_COPY;
+ if (mod) perm_mask |= PERM_MODIFY;
+ if (xfer) perm_mask |= PERM_TRANSFER;
+ return perm_mask;
+}
+
//----------
void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std::string& first_name, const std::string& last_name)