From 7f090f7bec5264ca9e203c27dfb6b2992bb2bcbd Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Mon, 14 Sep 2009 17:52:41 -0700 Subject: Merged in jacek/next --- linden/indra/newview/llvoavatar.cpp | 115 ++++++++++++++++++++++++++++++++++-- 1 file changed, 111 insertions(+), 4 deletions(-) (limited to 'linden/indra/newview/llvoavatar.cpp') 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 @@ #include "llvoicevisualizer.h" #include "llvoiceclient.h" +// [RLVa:KB] +#include "llstartup.h" +// [/RLVa:KB] + LLXmlTree LLVOAvatar::sXMLTree; LLXmlTree LLVOAvatar::sSkeletonXMLTree; LLVOAvatarSkeletonInfo* LLVOAvatar::sSkeletonInfo = NULL; @@ -2093,9 +2097,15 @@ void LLVOAvatar::buildCharacter() if (attachment->getGroup() == i) { LLMenuItemCallGL* item; +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // We need the userdata param to disable options in this pie menu later on (Left Hand / Right Hand option) item = new LLMenuItemCallGL(attachment->getName(), NULL, - object_selected_and_point_valid); + object_selected_and_point_valid, attachment); +// [/RLVa:KB] +// item = new LLMenuItemCallGL(attachment->getName(), +// NULL, +// object_selected_and_point_valid); item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); gAttachPieMenu->append(item); @@ -2150,9 +2160,15 @@ void LLVOAvatar::buildCharacter() if (attachment->getGroup() == 8) { LLMenuItemCallGL* item; +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // We need the userdata param to disable options in this pie menu later on item = new LLMenuItemCallGL(attachment->getName(), NULL, - object_selected_and_point_valid); + object_selected_and_point_valid, attachment); +// [/RLVa:KB] +// item = new LLMenuItemCallGL(attachment->getName(), +// NULL, +// object_selected_and_point_valid); item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", curiter->first); gAttachScreenPieMenu->append(item); gDetachScreenPieMenu->append(new LLMenuItemCallGL(attachment->getName(), @@ -2171,6 +2187,7 @@ void LLVOAvatar::buildCharacter() { continue; } + // RELEASE-RLVa: random comment because we want know if LL ever changes this to not include "attachment" as userdata LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), NULL, &object_selected_and_point_valid, &attach_label, attachment); @@ -2230,8 +2247,13 @@ void LLVOAvatar::buildCharacter() LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attach_index, (LLViewerJointAttachment*)NULL); if (attachment) { +// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) + // We need the userdata param to disable options in this pie menu later on LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), - NULL, object_selected_and_point_valid); + NULL, object_selected_and_point_valid, attachment); +// [/RLVa:KB] +// LLMenuItemCallGL* item = new LLMenuItemCallGL(attachment->getName(), +// NULL, object_selected_and_point_valid); gAttachBodyPartPieMenus[group]->append(item); item->addListener(gMenuHolder->getListenerByName("Object.AttachToAvatar"), "on_click", attach_index); gDetachBodyPartPieMenus[group]->append(new LLMenuItemCallGL(attachment->getName(), @@ -3089,10 +3111,16 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) const F32 time_visible = mTimeVisible.getElapsedTimeF32(); const F32 NAME_SHOW_TIME = gSavedSettings.getF32("RenderNameShowTime"); // seconds const F32 FADE_DURATION = gSavedSettings.getF32("RenderNameFadeDuration"); // seconds +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b + bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); +// [/RLVa:KB] BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping); BOOL render_name = visible_chat || (visible_avatar && +// [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.0h + ( (!fRlvShowNames) || (RlvSettings::fShowNameTags) ) && +// [/RLVa:KB] ((sRenderName == RENDER_NAME_ALWAYS) || (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME))); // 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) new_name = TRUE; } - if (sRenderGroupTitles != mRenderGroupTitles) +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b + if (fRlvShowNames) + { + if (mRenderGroupTitles) + { + mRenderGroupTitles = FALSE; + new_name = TRUE; + } + } + else if (sRenderGroupTitles != mRenderGroupTitles) +// [/RLVa] + //if (sRenderGroupTitles != mRenderGroupTitles) { mRenderGroupTitles = sRenderGroupTitles; new_name = TRUE; @@ -3218,6 +3257,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) || is_appearance != mNameAppearance) { std::string line; + if (title && title->getString() && title->getString()[0] != '\0') { line += title->getString(); @@ -3232,6 +3272,15 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) line += " "; line += lastname->getString(); + +// [RLVa:KB] + if (fRlvShowNames) + { + // User is not allowed to see who it is, due to RLV settings. + line = gRlvHandler.getAnonym(line); + } +// [/RLVa:KB] + BOOL need_comma = FALSE; if (is_away || is_muted || is_busy) @@ -6328,6 +6377,40 @@ BOOL LLVOAvatar::attachObject(LLViewerObject *viewer_object) { updateAttachmentVisibility(gAgent.getCameraMode()); +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + if (rlv_handler_t::isEnabled()) + { + static bool fRlvFullyLoaded = false; + static LLFrameTimer* pRlvFullyLoadedTimer = NULL; + + // 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 + if (!fRlvFullyLoaded) + { + if (pRlvFullyLoadedTimer) + { + if (pRlvFullyLoadedTimer->getElapsedTimeF32() > 30.0f) + { + fRlvFullyLoaded = true; + delete pRlvFullyLoadedTimer; + pRlvFullyLoadedTimer = NULL; + } + else + { + pRlvFullyLoadedTimer->reset(); + } + } + else if ( (!pRlvFullyLoadedTimer) && + ( (0 == mPendingAttachment.size()) || + ((1 == mPendingAttachment.size()) && (mPendingAttachment[0] == viewer_object)) ) ) + { + pRlvFullyLoadedTimer = new LLFrameTimer(); + } + } + + gRlvHandler.onAttach(attachment, fRlvFullyLoaded); + } +// [/RLVa:KB] + // Then make sure the inventory is in sync with the avatar. gInventory.addChangedMask( LLInventoryObserver::LABEL, attachment->getItemID() ); gInventory.notifyObservers(); @@ -6383,6 +6466,14 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) // only one object per attachment point for now if (attachment->getObject() == viewer_object) { +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + // URGENT-RLV: it looks like LLApp::isExiting() isn't always accurate so find something better (if it exists) + if ( (rlv_handler_t::isEnabled()) && (!LLApp::isExiting()) && (mIsSelf) ) + { + gRlvHandler.onDetach(attachment); + } +// [/RLVa:KB] + LLUUID item_id = attachment->getItemID(); attachment->removeObject(viewer_object); if (mIsSelf) @@ -6441,6 +6532,14 @@ void LLVOAvatar::sitOnObject(LLViewerObject *sit_object) gPipeline.markMoved(mDrawable, TRUE); mIsSitting = TRUE; +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.1d + #ifdef RLV_EXTENSION_STARTLOCATION + if (rlv_handler_t::isEnabled()) + { + RlvSettings::updateLoginLastLocation(); + } + #endif // RLV_EXTENSION_STARTLOCATION +// [/RLVa:KB] mRoot.getXform()->setParent(&sit_object->mDrawable->mXform); // LLVOAvatar::sitOnObject mRoot.setPosition(getPosition()); mRoot.updateWorldMatrixChildren(); @@ -6502,6 +6601,14 @@ void LLVOAvatar::getOffObject() gPipeline.markMoved(mDrawable, TRUE); mIsSitting = FALSE; +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.1d + #ifdef RLV_EXTENSION_STARTLOCATION + if (rlv_handler_t::isEnabled()) + { + RlvSettings::updateLoginLastLocation(); + } + #endif // RLV_EXTENSION_STARTLOCATION +// [/RLVa:KB] mRoot.getXform()->setParent(NULL); // LLVOAvatar::getOffObject mRoot.setPosition(cur_position_world); mRoot.setRotation(cur_rotation_world); -- cgit v1.1