aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llvoavatar.cpp')
-rw-r--r--linden/indra/newview/llvoavatar.cpp115
1 files changed, 111 insertions, 4 deletions
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index 3d2523e..158977e 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -125,6 +125,10 @@
125#include "llvoicevisualizer.h" 125#include "llvoicevisualizer.h"
126#include "llvoiceclient.h" 126#include "llvoiceclient.h"
127 127
128// [RLVa:KB]
129#include "llstartup.h"
130// [/RLVa:KB]
131
128LLXmlTree LLVOAvatar::sXMLTree; 132LLXmlTree LLVOAvatar::sXMLTree;
129LLXmlTree LLVOAvatar::sSkeletonXMLTree; 133LLXmlTree LLVOAvatar::sSkeletonXMLTree;
130LLVOAvatarSkeletonInfo* LLVOAvatar::sSkeletonInfo = NULL; 134LLVOAvatarSkeletonInfo* LLVOAvatar::sSkeletonInfo = NULL;
@@ -2093,9 +2097,15 @@ void LLVOAvatar::buildCharacter()
2093 if (attachment->getGroup() == i) 2097 if (attachment->getGroup() == i)
2094 { 2098 {
2095 LLMenuItemCallGL* item; 2099 LLMenuItemCallGL* item;
2100// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c)
2101 // We need the userdata param to disable options in this pie menu later on (Left Hand / Right Hand option)
2096 item = new LLMenuItemCallGL(attachment->getName(), 2102 item = new LLMenuItemCallGL(attachment->getName(),
2097 NULL, 2103 NULL,
2098 object_selected_and_point_valid); 2104 object_selected_and_point_valid, attachment);
2105// [/RLVa:KB]
2106// item = new LLMenuItemCallGL(attachment->getName(),
2107// NULL,
2108// object_selected_and_point_valid);
2099 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); 2109 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first);
2100 2110
2101 gAttachPieMenu->append(item); 2111 gAttachPieMenu->append(item);
@@ -2150,9 +2160,15 @@ void LLVOAvatar::buildCharacter()
2150 if (attachment->getGroup() == 8) 2160 if (attachment->getGroup() == 8)
2151 { 2161 {
2152 LLMenuItemCallGL* item; 2162 LLMenuItemCallGL* item;
2163// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c)
2164 // We need the userdata param to disable options in this pie menu later on
2153 item = new LLMenuItemCallGL(attachment->getName(), 2165 item = new LLMenuItemCallGL(attachment->getName(),
2154 NULL, 2166 NULL,
2155 object_selected_and_point_valid); 2167 object_selected_and_point_valid, attachment);
2168// [/RLVa:KB]
2169// item = new LLMenuItemCallGL(attachment->getName(),
2170// NULL,
2171// object_selected_and_point_valid);
2156 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); 2172 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first);
2157 gAttachScreenPieMenu->append(item); 2173 gAttachScreenPieMenu->append(item);
2158 gDetachScreenPieMenu->append(new LLMenuItemCallGL(attachment->getName(), 2174 gDetachScreenPieMenu->append(new LLMenuItemCallGL(attachment->getName(),
@@ -2171,6 +2187,7 @@ void LLVOAvatar::buildCharacter()
2171 { 2187 {
2172 continue; 2188 continue;
2173 } 2189 }
2190 // RELEASE-RLVa: random comment because we want know if LL ever changes this to not include "attachment" as userdata
2174 LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), 2191 LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(),
2175 NULL, &object_selected_and_point_valid, 2192 NULL, &object_selected_and_point_valid,
2176 &attach_label, attachment); 2193 &attach_label, attachment);
@@ -2230,8 +2247,13 @@ void LLVOAvatar::buildCharacter()
2230 LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attach_index, (LLViewerJointAttachment*)NULL); 2247 LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attach_index, (LLViewerJointAttachment*)NULL);
2231 if (attachment) 2248 if (attachment)
2232 { 2249 {
2250// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c)
2251 // We need the userdata param to disable options in this pie menu later on
2233 LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), 2252 LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(),
2234 NULL, object_selected_and_point_valid); 2253 NULL, object_selected_and_point_valid, attachment);
2254// [/RLVa:KB]
2255// LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(),
2256// NULL, object_selected_and_point_valid);
2235 gAttachBodyPartPieMenus[group]->append(item); 2257 gAttachBodyPartPieMenus[group]->append(item);
2236 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", attach_index); 2258 item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", attach_index);
2237 gDetachBodyPartPieMenus[group]->append(new LLMenuItemCallGL(attachment->getName(), 2259 gDetachBodyPartPieMenus[group]->append(new LLMenuItemCallGL(attachment->getName(),
@@ -3089,10 +3111,16 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
3089 const F32 time_visible = mTimeVisible.getElapsedTimeF32(); 3111 const F32 time_visible = mTimeVisible.getElapsedTimeF32();
3090 const F32 NAME_SHOW_TIME = gSavedSettings.getF32("RenderNameShowTime"); // seconds 3112 const F32 NAME_SHOW_TIME = gSavedSettings.getF32("RenderNameShowTime"); // seconds
3091 const F32 FADE_DURATION = gSavedSettings.getF32("RenderNameFadeDuration"); // seconds 3113 const F32 FADE_DURATION = gSavedSettings.getF32("RenderNameFadeDuration"); // seconds
3114// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b
3115 bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
3116// [/RLVa:KB]
3092 BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; 3117 BOOL visible_avatar = isVisible() || mNeedsAnimUpdate;
3093 BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping); 3118 BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping);
3094 BOOL render_name = visible_chat || 3119 BOOL render_name = visible_chat ||
3095 (visible_avatar && 3120 (visible_avatar &&
3121// [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.0h
3122 ( (!fRlvShowNames) || (RlvSettings::fShowNameTags) ) &&
3123// [/RLVa:KB]
3096 ((sRenderName == RENDER_NAME_ALWAYS) || 3124 ((sRenderName == RENDER_NAME_ALWAYS) ||
3097 (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME))); 3125 (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME)));
3098 // If it's your own avatar, don't draw in mouselook, and don't 3126 // If it's your own avatar, don't draw in mouselook, and don't
@@ -3113,7 +3141,18 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
3113 new_name = TRUE; 3141 new_name = TRUE;
3114 } 3142 }
3115 3143
3116 if (sRenderGroupTitles != mRenderGroupTitles) 3144// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b
3145 if (fRlvShowNames)
3146 {
3147 if (mRenderGroupTitles)
3148 {
3149 mRenderGroupTitles = FALSE;
3150 new_name = TRUE;
3151 }
3152 }
3153 else if (sRenderGroupTitles != mRenderGroupTitles)
3154// [/RLVa]
3155 //if (sRenderGroupTitles != mRenderGroupTitles)
3117 { 3156 {
3118 mRenderGroupTitles = sRenderGroupTitles; 3157 mRenderGroupTitles = sRenderGroupTitles;
3119 new_name = TRUE; 3158 new_name = TRUE;
@@ -3218,6 +3257,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
3218 || is_appearance != mNameAppearance) 3257 || is_appearance != mNameAppearance)
3219 { 3258 {
3220 std::string line; 3259 std::string line;
3260
3221 if (title && title->getString() && title->getString()[0] != '\0') 3261 if (title && title->getString() && title->getString()[0] != '\0')
3222 { 3262 {
3223 line += title->getString(); 3263 line += title->getString();
@@ -3232,6 +3272,15 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
3232 3272
3233 line += " "; 3273 line += " ";
3234 line += lastname->getString(); 3274 line += lastname->getString();
3275
3276// [RLVa:KB]
3277 if (fRlvShowNames)
3278 {
3279 // User is not allowed to see who it is, due to RLV settings.
3280 line = gRlvHandler.getAnonym(line);
3281 }
3282// [/RLVa:KB]
3283
3235 BOOL need_comma = FALSE; 3284 BOOL need_comma = FALSE;
3236 3285
3237 if (is_away || is_muted || is_busy) 3286 if (is_away || is_muted || is_busy)
@@ -6328,6 +6377,40 @@ BOOL LLVOAvatar::attachObject(LLViewerObject *viewer_object)
6328 { 6377 {
6329 updateAttachmentVisibility(gAgent.getCameraMode()); 6378 updateAttachmentVisibility(gAgent.getCameraMode());
6330 6379
6380// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
6381 if (rlv_handler_t::isEnabled())
6382 {
6383 static bool fRlvFullyLoaded = false;
6384 static LLFrameTimer* pRlvFullyLoadedTimer = NULL;
6385
6386 // There's no way to know when we're done reattaching what was attached at log-off but this ugly evil bad hack tries anyway
6387 if (!fRlvFullyLoaded)
6388 {
6389 if (pRlvFullyLoadedTimer)
6390 {
6391 if (pRlvFullyLoadedTimer->getElapsedTimeF32() > 30.0f)
6392 {
6393 fRlvFullyLoaded = true;
6394 delete pRlvFullyLoadedTimer;
6395 pRlvFullyLoadedTimer = NULL;
6396 }
6397 else
6398 {
6399 pRlvFullyLoadedTimer->reset();
6400 }
6401 }
6402 else if ( (!pRlvFullyLoadedTimer) &&
6403 ( (0 == mPendingAttachment.size()) ||
6404 ((1 == mPendingAttachment.size()) && (mPendingAttachment[0] == viewer_object)) ) )
6405 {
6406 pRlvFullyLoadedTimer = new LLFrameTimer();
6407 }
6408 }
6409
6410 gRlvHandler.onAttach(attachment, fRlvFullyLoaded);
6411 }
6412// [/RLVa:KB]
6413
6331 // Then make sure the inventory is in sync with the avatar. 6414 // Then make sure the inventory is in sync with the avatar.
6332 gInventory.addChangedMask( LLInventoryObserver::LABEL, attachment->getItemID() ); 6415 gInventory.addChangedMask( LLInventoryObserver::LABEL, attachment->getItemID() );
6333 gInventory.notifyObservers(); 6416 gInventory.notifyObservers();
@@ -6383,6 +6466,14 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
6383 // only one object per attachment point for now 6466 // only one object per attachment point for now
6384 if (attachment->getObject() == viewer_object) 6467 if (attachment->getObject() == viewer_object)
6385 { 6468 {
6469// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g)
6470 // URGENT-RLV: it looks like LLApp::isExiting() isn't always accurate so find something better (if it exists)
6471 if ( (rlv_handler_t::isEnabled()) && (!LLApp::isExiting()) && (mIsSelf) )
6472 {
6473 gRlvHandler.onDetach(attachment);
6474 }
6475// [/RLVa:KB]
6476
6386 LLUUID item_id = attachment->getItemID(); 6477 LLUUID item_id = attachment->getItemID();
6387 attachment->removeObject(viewer_object); 6478 attachment->removeObject(viewer_object);
6388 if (mIsSelf) 6479 if (mIsSelf)
@@ -6441,6 +6532,14 @@ void LLVOAvatar::sitOnObject(LLViewerObject *sit_object)
6441 6532
6442 gPipeline.markMoved(mDrawable, TRUE); 6533 gPipeline.markMoved(mDrawable, TRUE);
6443 mIsSitting = TRUE; 6534 mIsSitting = TRUE;
6535// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.1d
6536 #ifdef RLV_EXTENSION_STARTLOCATION
6537 if (rlv_handler_t::isEnabled())
6538 {
6539 RlvSettings::updateLoginLastLocation();
6540 }
6541 #endif // RLV_EXTENSION_STARTLOCATION
6542// [/RLVa:KB]
6444 mRoot.getXform()->setParent(&sit_object->mDrawable->mXform); // LLVOAvatar::sitOnObject 6543 mRoot.getXform()->setParent(&sit_object->mDrawable->mXform); // LLVOAvatar::sitOnObject
6445 mRoot.setPosition(getPosition()); 6544 mRoot.setPosition(getPosition());
6446 mRoot.updateWorldMatrixChildren(); 6545 mRoot.updateWorldMatrixChildren();
@@ -6502,6 +6601,14 @@ void LLVOAvatar::getOffObject()
6502 gPipeline.markMoved(mDrawable, TRUE); 6601 gPipeline.markMoved(mDrawable, TRUE);
6503 6602
6504 mIsSitting = FALSE; 6603 mIsSitting = FALSE;
6604// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.1d
6605 #ifdef RLV_EXTENSION_STARTLOCATION
6606 if (rlv_handler_t::isEnabled())
6607 {
6608 RlvSettings::updateLoginLastLocation();
6609 }
6610 #endif // RLV_EXTENSION_STARTLOCATION
6611// [/RLVa:KB]
6505 mRoot.getXform()->setParent(NULL); // LLVOAvatar::getOffObject 6612 mRoot.getXform()->setParent(NULL); // LLVOAvatar::getOffObject
6506 mRoot.setPosition(cur_position_world); 6613 mRoot.setPosition(cur_position_world);
6507 mRoot.setRotation(cur_rotation_world); 6614 mRoot.setRotation(cur_rotation_world);