summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llagentwearables.cpp25
-rw-r--r--indra/newview/llagentwearables.h1
-rw-r--r--indra/newview/llavataractions.cpp21
-rw-r--r--indra/newview/llavataractions.h5
-rw-r--r--indra/newview/llfloatertools.cpp10
-rw-r--r--indra/newview/llpanelavatar.cpp6
-rw-r--r--indra/newview/llpanelavatar.h5
-rw-r--r--indra/newview/llpanelimcontrolpanel.cpp8
-rw-r--r--indra/newview/llpanelpeople.cpp4
-rw-r--r--indra/newview/llvoavatar.cpp22
-rw-r--r--indra/newview/llvoavatarself.cpp10
-rw-r--r--indra/newview/llvovolume.cpp12
-rw-r--r--indra/newview/llvovolume.h2
-rw-r--r--indra/newview/llwearable.cpp12
-rw-r--r--indra/newview/llwearable.h2
-rw-r--r--indra/newview/skins/default/xui/en/menu_profile_overflow.xml7
-rw-r--r--indra/newview/skins/default/xui/en/panel_im_control_panel.xml4
-rw-r--r--indra/newview/skins/default/xui/en/sidepanel_inventory.xml11
18 files changed, 105 insertions, 62 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index cfa3f4ae02..574b449d23 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -675,7 +675,7 @@ void LLAgentWearables::setWearable(const EWearableType type, U32 index, LLWearab
{
wearable_vec[index] = wearable;
old_wearable->setLabelUpdated();
- mAvatarObject->wearableUpdated(wearable->getType());
+ wearableUpdated(wearable);
}
}
@@ -690,13 +690,32 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl
if (type < WT_COUNT || mWearableDatas[type].size() < MAX_WEARABLES_PER_TYPE)
{
mWearableDatas[type].push_back(wearable);
- mAvatarObject->wearableUpdated(wearable->getType());
- wearable->setLabelUpdated();
+ wearableUpdated(wearable);
return mWearableDatas[type].size()-1;
}
return MAX_WEARABLES_PER_TYPE;
}
+void LLAgentWearables::wearableUpdated(LLWearable *wearable)
+{
+ mAvatarObject->wearableUpdated(wearable->getType());
+ wearable->setLabelUpdated();
+
+ // Hack pt 2. If the wearable we just loaded has definition version 24,
+ // then force a re-save of this wearable after slamming the version number to 22.
+ // This number was incorrectly incremented for internal builds before release, and
+ // this fix will ensure that the affected wearables are re-saved with the right version number.
+ // the versions themselves are compatible. This code can be removed before release.
+ if( wearable->getDefinitionVersion() == 24 )
+ {
+ wearable->setDefinitionVersion(22);
+ U32 index = getWearableIndex(wearable);
+ llinfos << "forcing werable type " << wearable->getType() << " to version 22 from 24" << llendl;
+ saveWearable(wearable->getType(),index,TRUE);
+ }
+
+}
+
void LLAgentWearables::popWearable(LLWearable *wearable)
{
if (wearable == NULL)
diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h
index 8f3a16501e..b4f58674af 100644
--- a/indra/newview/llagentwearables.h
+++ b/indra/newview/llagentwearables.h
@@ -107,6 +107,7 @@ private:
// Low-level data structure setter - public access is via setWearableItem, etc.
void setWearable(const EWearableType type, U32 index, LLWearable *wearable);
U32 pushWearable(const EWearableType type, LLWearable *wearable);
+ void wearableUpdated(LLWearable *wearable);
void popWearable(LLWearable *wearable);
void popWearable(const EWearableType type, U32 index);
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 0844cca766..89a774fd2b 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -324,6 +324,27 @@ void LLAvatarActions::pay(const LLUUID& id)
}
}
+//static
+void LLAvatarActions::share(const LLUUID& id)
+{
+ LLSD key;
+ LLSideTray::getInstance()->showPanel("sidepanel_inventory", key);
+
+
+ LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL,id);
+
+ if (!gIMMgr->hasSession(session_id))
+ {
+ startIM(id);
+ }
+
+ if (gIMMgr->hasSession(session_id))
+ {
+ // we should always get here, but check to verify anyways
+ LLIMModel::getInstance()->addMessage(session_id, SYSTEM_FROM, LLUUID::null, LLTrans::getString("share_alert"), false);
+ }
+}
+
// static
void LLAvatarActions::toggleBlock(const LLUUID& id)
{
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index d9dab95a77..4c9851a48d 100644
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -104,6 +104,11 @@ public:
static void pay(const LLUUID& id);
/**
+ * Share items with the avatar.
+ */
+ static void share(const LLUUID& id);
+
+ /**
* Block/unblock the avatar.
*/
static void toggleBlock(const LLUUID& id);
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 9854d2594b..b4d248bc40 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -563,7 +563,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
mBtnEdit ->setToggleState( edit_visible );
mRadioGroupEdit->setVisible( edit_visible );
- childSetVisible("RenderingCost", edit_visible || focus_visible || move_visible);
+ bool linked_parts = gSavedSettings.getBOOL("EditLinkedParts");
+ childSetVisible("RenderingCost", !linked_parts && (edit_visible || focus_visible || move_visible));
if (mCheckSelectIndividual)
{
@@ -975,6 +976,8 @@ void LLFloaterTools::onClickGridOptions()
S32 LLFloaterTools::calcRenderCost()
{
S32 cost = 0;
+ std::set<LLUUID> textures;
+
for (LLObjectSelection::iterator selection_iter = LLSelectMgr::getInstance()->getSelection()->begin();
selection_iter != LLSelectMgr::getInstance()->getSelection()->end();
++selection_iter)
@@ -985,11 +988,14 @@ S32 LLFloaterTools::calcRenderCost()
LLVOVolume *viewer_volume = (LLVOVolume*)select_node->getObject();
if (viewer_volume)
{
- cost += viewer_volume->getRenderCost();
+ cost += viewer_volume->getRenderCost(textures);
+ cost += textures.size() * 5;
+ textures.clear();
}
}
}
+
return cost;
}
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 2254684f21..a822897c7e 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -339,6 +339,7 @@ BOOL LLPanelAvatarProfile::postBuild()
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
registrar.add("Profile.Pay", boost::bind(&LLPanelAvatarProfile::pay, this));
+ registrar.add("Profile.Share", boost::bind(&LLPanelAvatarProfile::share, this));
mProfileMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_profile_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
@@ -525,6 +526,11 @@ void LLPanelAvatarProfile::pay()
LLAvatarActions::pay(getAvatarId());
}
+void LLPanelAvatarProfile::share()
+{
+ LLAvatarActions::share(getAvatarId());
+}
+
void LLPanelAvatarProfile::onUrlTextboxClicked(const std::string& url)
{
LLWeb::loadURL(url);
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index a0caf0c915..587b9cabe9 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -172,6 +172,11 @@ protected:
*/
void pay();
+ /**
+ * opens inventory and IM for sharing items
+ */
+ void share();
+
void onUrlTextboxClicked(const std::string& url);
void onHomepageTextboxClicked();
void onAddFriendButtonClick();
diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp
index 40319d949d..fa6d16cfb1 100644
--- a/indra/newview/llpanelimcontrolpanel.cpp
+++ b/indra/newview/llpanelimcontrolpanel.cpp
@@ -160,13 +160,7 @@ void LLPanelIMControlPanel::onAddFriendButtonClicked()
void LLPanelIMControlPanel::onShareButtonClicked()
{
- LLSD key;
- LLSideTray::getInstance()->showPanel("sidepanel_inventory", key);
-
- if (gIMMgr->hasSession(getSessionId()))
- {
- LLIMModel::getInstance()->addMessage(getSessionId(), SYSTEM_FROM, LLUUID::null, LLTrans::getString("share_alert"), false);
- }
+ LLAvatarActions::share(mAvatarID);
}
void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id)
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 4dc8872557..c332776010 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -758,7 +758,7 @@ void LLPanelPeople::updateButtons()
buttonSetEnabled("view_profile_btn", item_selected);
buttonSetEnabled("im_btn", multiple_selected); // allow starting the friends conference for multiple selection
buttonSetEnabled("call_btn", multiple_selected);
- buttonSetEnabled("share_btn", item_selected && false); // not implemented yet
+ buttonSetEnabled("share_btn", item_selected); // not implemented yet
bool none_group_selected = item_selected && selected_id.isNull();
buttonSetEnabled("group_info_btn", !none_group_selected);
@@ -1211,7 +1211,7 @@ void LLPanelPeople::onTeleportButtonClicked()
void LLPanelPeople::onShareButtonClicked()
{
- // *TODO: not implemented yet
+ LLAvatarActions::share(getCurrentItemID());
}
void LLPanelPeople::onMoreButtonClicked()
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 75e35e5221..9e75d7853d 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -7636,15 +7636,19 @@ void LLVOAvatar::idleUpdateRenderCost()
return;
}
- U32 shame = 0;
+ U32 cost = 0;
+ std::set<LLUUID> textures;
for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
{
const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index);
ETextureIndex tex_index = baked_dict->mTextureIndex;
- if (isTextureVisible(tex_index))
+ if ((tex_index != TEX_SKIRT_BAKED) || (isWearingWearableType(WT_SKIRT)))
{
- shame +=20;
+ if (isTextureVisible(tex_index))
+ {
+ cost +=20;
+ }
}
}
@@ -7663,20 +7667,22 @@ void LLVOAvatar::idleUpdateRenderCost()
const LLDrawable* drawable = attached_object->mDrawable;
if (drawable)
{
- shame += 10;
+ cost += 10;
const LLVOVolume* volume = drawable->getVOVolume();
if (volume)
{
- shame += volume->getRenderCost();
+ cost += volume->getRenderCost(textures);
}
}
}
}
}
- setDebugText(llformat("%d", shame));
- F32 green = 1.f-llclamp(((F32) shame-1024.f)/1024.f, 0.f, 1.f);
- F32 red = llmin((F32) shame/1024.f, 1.f);
+ cost += textures.size() * 5;
+
+ setDebugText(llformat("%d", cost));
+ F32 green = 1.f-llclamp(((F32) cost-1024.f)/1024.f, 0.f, 1.f);
+ F32 red = llmin((F32) cost/1024.f, 1.f);
mText->setColor(LLColor4(red,green,0,1));
}
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index d9c5e932a2..843cba7860 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -318,11 +318,6 @@ BOOL LLVOAvatarSelf::buildMenus()
}
}
-
- if (!attachment_found)
- {
- gAttachPieMenu->addSeparator();
- }
}
if (gDetachBodyPartPieMenus[i])
@@ -362,11 +357,6 @@ BOOL LLVOAvatarSelf::buildMenus()
break;
}
}
-
- if (!attachment_found)
- {
- gDetachPieMenu->addSeparator();
- }
}
}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index e5531a1497..1f49cd30c7 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -2541,7 +2541,11 @@ const LLMatrix4 LLVOVolume::getRenderMatrix() const
return mDrawable->getWorldMatrix();
}
-U32 LLVOVolume::getRenderCost() const
+// Returns a base cost and adds textures to passed in set.
+// total cost is returned value + 5 * size of the resulting set.
+// Cannot include cost of textures, as they may be re-used in linked
+// children, and cost should only be increased for unique textures -Nyx
+U32 LLVOVolume::getRenderCost(std::set<LLUUID> &textures) const
{
U32 shame = 0;
@@ -2574,7 +2578,7 @@ U32 LLVOVolume::getRenderCost() const
{
const LLSculptParams *sculpt_params = (LLSculptParams *) getParameterEntry(LLNetworkData::PARAMS_SCULPT);
LLUUID sculpt_id = sculpt_params->getSculptTexture();
- shame += 5;
+ textures.insert(sculpt_id);
}
for (S32 i = 0; i < drawablep->getNumFaces(); ++i)
@@ -2583,7 +2587,7 @@ U32 LLVOVolume::getRenderCost() const
const LLTextureEntry* te = face->getTextureEntry();
const LLViewerTexture* img = face->getTexture();
- shame += 5;
+ textures.insert(img->getID());
if (face->getPoolType() == LLDrawPool::POOL_ALPHA)
{
@@ -2633,7 +2637,7 @@ U32 LLVOVolume::getRenderCost() const
const LLVOVolume* child_volumep = child_drawablep->getVOVolume();
if (child_volumep)
{
- shame += child_volumep->getRenderCost();
+ shame += child_volumep->getRenderCost(textures);
}
}
}
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index fb543efc04..6bad245e19 100644
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -120,7 +120,7 @@ public:
const LLMatrix4& getRelativeXform() const { return mRelativeXform; }
const LLMatrix3& getRelativeXformInvTrans() const { return mRelativeXformInvTrans; }
/*virtual*/ const LLMatrix4 getRenderMatrix() const;
- U32 getRenderCost() const;
+ U32 getRenderCost(std::set<LLUUID> &textures) const;
/*virtual*/ BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end,
S32 face = -1, // which face to check, -1 = ALL_SIDES
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index ced0b64896..d92da4ef44 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -421,18 +421,6 @@ BOOL LLWearable::importFile( LLFILE* file )
// copy all saved param values to working params
revertValues();
- // Hack pt 2. If the wearable we just loaded has definition version 24,
- // then force a re-save of this wearable after slamming the version number to 22.
- // This number was incorrectly incremented for internal builds before release, and
- // this fix will ensure that the affected wearables are re-saved with the right version number.
- // the versions themselves are compatible. This code can be removed before release.
- if( mDefinitionVersion == 24 )
- {
- mDefinitionVersion = 22;
- U32 index = gAgentWearables.getWearableIndex(this);
- gAgentWearables.saveWearable(mType,index,TRUE);
- }
-
return TRUE;
}
diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h
index 0863adb7f5..43ffa12420 100644
--- a/indra/newview/llwearable.h
+++ b/indra/newview/llwearable.h
@@ -82,6 +82,8 @@ public:
const std::string& getTypeName() const;
LLAssetType::EType getAssetType() const;
LLLocalTextureObject* getLocalTextureObject(S32 index) const;
+ S32 getDefinitionVersion() const { return mDefinitionVersion; }
+ void setDefinitionVersion( S32 new_version ) { mDefinitionVersion = new_version; }
public:
typedef std::vector<LLVisualParam*> visual_param_vec_t;
diff --git a/indra/newview/skins/default/xui/en/menu_profile_overflow.xml b/indra/newview/skins/default/xui/en/menu_profile_overflow.xml
index 7b52fecef7..d0128d1c9a 100644
--- a/indra/newview/skins/default/xui/en/menu_profile_overflow.xml
+++ b/indra/newview/skins/default/xui/en/menu_profile_overflow.xml
@@ -12,4 +12,11 @@
<menu_item_call.on_click
function="Profile.Pay" />
</menu_item_call>
+ <menu_item_call
+ label="Share"
+ layout="topleft"
+ name="share">
+ <menu_item_call.on_click
+ function="Profile.Share" />
+ </menu_item_call>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
index 73d843e6dd..0a5812882d 100644
--- a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
+++ b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml
@@ -38,12 +38,12 @@
label="Teleport"
name="teleport_btn"
width="100" />
- <!-- <button
+ <button
follows="left|top"
height="20"
label="Share"
name="share_btn"
- width="100" />-->
+ width="100" />
<!--Removing pay button to save space - will update spec - verified by Erica/Steve -->
<!-- <button
follows="left|top"
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index b8b3d993bd..bb29397ef6 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -50,17 +50,6 @@
top="0"
width="60" />
<button
- enabled="true"
- follows="bottom|left"
- font="SansSerifSmall"
- height="25"
- label="Share"
- layout="topleft"
- left_pad="5"
- name="share_btn"
- top="0"
- width="60" />
- <button
enabled="false"
follows="bottom|left"
font="SansSerifSmall"