diff options
author | Rider Linden <rider@lindenlab.com> | 2018-11-14 11:19:33 -0800 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-11-14 11:19:33 -0800 |
commit | 1d022e86c84039f88c531e91ce857666acd224a1 (patch) | |
tree | 9a8ba45529cb125a2ae5cd4672b3fd093af9b45c /indra/newview/llviewermenu.cpp | |
parent | 18eb4b497fd890118e7da78dcc2eda4bd84c4ede (diff) | |
parent | 34770cbf2ef34b7901552057a0823e502d42be1d (diff) |
Merge
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 90 |
1 files changed, 78 insertions, 12 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ddd287e6b1..00189f0b11 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -961,7 +961,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t ////////////////// // INFO DISPLAY // ////////////////// -U32 info_display_from_string(std::string info_display) +U64 info_display_from_string(std::string info_display) { if ("verify" == info_display) { @@ -1075,6 +1075,14 @@ U32 info_display_from_string(std::string info_display) { return LLPipeline::RENDER_DEBUG_TEXEL_DENSITY; } + else if ("triangle count" == info_display) + { + return LLPipeline::RENDER_DEBUG_TRIANGLE_COUNT; + } + else if ("impostors" == info_display) + { + return LLPipeline::RENDER_DEBUG_IMPOSTORS; + } else { LL_WARNS() << "unrecognized feature name '" << info_display << "'" << LL_ENDL; @@ -1086,7 +1094,7 @@ class LLAdvancedToggleInfoDisplay : public view_listener_t { bool handleEvent(const LLSD& userdata) { - U32 info_display = info_display_from_string( userdata.asString() ); + U64 info_display = info_display_from_string( userdata.asString() ); LL_INFOS("ViewerMenu") << "toggle " << userdata.asString() << LL_ENDL; @@ -1104,7 +1112,7 @@ class LLAdvancedCheckInfoDisplay : public view_listener_t { bool handleEvent(const LLSD& userdata) { - U32 info_display = info_display_from_string( userdata.asString() ); + U64 info_display = info_display_from_string( userdata.asString() ); bool new_value = false; if ( info_display != 0 ) @@ -1614,7 +1622,24 @@ class LLAdvancedEnableAppearanceToXML : public view_listener_t { bool handleEvent(const LLSD& userdata) { - return gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); + LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (obj && obj->isAnimatedObject() && obj->getControlAvatar()) + { + return gSavedSettings.getBOOL("DebugAnimatedObjects"); + } + else if (obj && obj->isAttachment() && obj->getAvatar()) + { + return gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); + } + else if (obj && obj->isAvatar()) + { + // This has to be a non-control avatar, because control avs are invisible and unclickable. + return gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); + } + else + { + return false; + } } }; @@ -1623,13 +1648,34 @@ class LLAdvancedAppearanceToXML : public view_listener_t bool handleEvent(const LLSD& userdata) { std::string emptyname; - LLVOAvatar* avatar = - find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); - if (!avatar) - { + LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + LLVOAvatar *avatar = NULL; + if (obj) + { + if (obj->isAvatar()) + { + avatar = obj->asAvatar(); + } + else + { + // If there is a selection, find the associated + // avatar. Normally there's only one obvious choice. But + // what should be returned if the object is in an attached + // animated object? getAvatar() will give the skeleton of + // the animated object. getAvatarAncestor() will give the + // actual human-driven avatar. + avatar = obj->getAvatar(); + } + } + else + { + // If no selection, use the self avatar. avatar = gAgentAvatarp; - } - avatar->dumpArchetypeXML(emptyname); + } + if (avatar) + { + avatar->dumpArchetypeXML(emptyname); + } return true; } }; @@ -6055,7 +6101,12 @@ class LLAvatarResetSkeleton: public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); + LLVOAvatar* avatar = NULL; + LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (obj) + { + avatar = obj->getAvatar(); + } if(avatar) { avatar->resetSkeleton(false); @@ -6064,6 +6115,20 @@ class LLAvatarResetSkeleton: public view_listener_t } }; +class LLAvatarEnableResetSkeleton: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (obj && obj->getAvatar()) + { + return true; + } + return false; + } +}; + + class LLAvatarResetSkeletonAndAnimations : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -6897,7 +6962,7 @@ class LLAttachmentEnableDrop : public view_listener_t // Do not enable drop if all faces of object are not enabled if (object && LLSelectMgr::getInstance()->getSelection()->contains(object,SELECT_ALL_TES )) { - S32 attachmentID = ATTACHMENT_ID_FROM_STATE(object->getState()); + S32 attachmentID = ATTACHMENT_ID_FROM_STATE(object->getAttachmentState()); attachment = get_if_there(gAgentAvatarp->mAttachmentPoints, attachmentID, (LLViewerJointAttachment*)NULL); if (attachment) @@ -9105,6 +9170,7 @@ void initialize_menus() view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); view_listener_t::addMenu(new LLAvatarToggleMyProfile(), "Avatar.ToggleMyProfile"); view_listener_t::addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeleton"); + view_listener_t::addMenu(new LLAvatarEnableResetSkeleton(), "Avatar.EnableResetSkeleton"); view_listener_t::addMenu(new LLAvatarResetSkeletonAndAnimations(), "Avatar.ResetSkeletonAndAnimations"); enable.add("Avatar.IsMyProfileOpen", boost::bind(&my_profile_visible)); |