From 8e54ae95d1417f51edd6c68c389fd6cd7322ca52 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 20 Mar 2013 15:25:14 -0700 Subject: Prototype code for "simple imposter" mode rendering of avatars. Reviewed by Kelly --- indra/newview/llviewermenu.cpp | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 4c99e65c99..aab4d93882 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2934,6 +2934,63 @@ bool enable_object_unmute() } } + +// 0 = normal, 1 = always, 2 = never +class LLAvatarCheckImposterMode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (!object) return false; + + LLVOAvatar* avatar = find_avatar_from_object(object); + if (!avatar) return false; + + U32 mode = userdata.asInteger(); + switch (mode) + { + case 0: + return (avatar->getVisualMuteSettings() == LLVOAvatar::VISUAL_MUTE_NOT_SET); + case 1: + return (avatar->getVisualMuteSettings() == LLVOAvatar::ALWAYS_VISUAL_MUTE); + case 2: + return (avatar->getVisualMuteSettings() == LLVOAvatar::NEVER_VISUAL_MUTE); + default: + return false; + } + } // handleEvent() +}; + +// 0 = normal, 1 = always, 2 = never +class LLAvatarSetImposterMode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + if (!object) return false; + + LLVOAvatar* avatar = find_avatar_from_object(object); + if (!avatar) return false; + + U32 mode = userdata.asInteger(); + switch (mode) + { + case 0: + avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); + return true; + case 1: + avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); + return true; + case 2: + avatar->setVisualMuteSettings(LLVOAvatar::NEVER_VISUAL_MUTE); + return true; + default: + return false; + } + } // handleEvent() +}; + + class LLObjectMute : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8644,6 +8701,8 @@ void initialize_menus() view_listener_t::addMenu( new LLCheckPanelPeopleTab(), "SideTray.CheckPanelPeopleTab"); // Avatar pie menu + view_listener_t::addMenu(new LLAvatarCheckImposterMode(), "Avatar.CheckImposterMode"); + view_listener_t::addMenu(new LLAvatarSetImposterMode(), "Avatar.SetImposterMode"); view_listener_t::addMenu(new LLObjectMute(), "Avatar.Mute"); view_listener_t::addMenu(new LLAvatarAddFriend(), "Avatar.AddFriend"); view_listener_t::addMenu(new LLAvatarAddContact(), "Avatar.AddContact"); -- cgit v1.2.3 From 395f8baf03622f3a36b03b8e31679e3b594b1757 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 22 Mar 2013 14:03:39 -0700 Subject: Fix simple bug in LLAvatarSetImposterMode::handleEvent() --- indra/newview/llviewermenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index aab4d93882..2d18600540 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2979,7 +2979,7 @@ class LLAvatarSetImposterMode : public view_listener_t avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); return true; case 1: - avatar->setVisualMuteSettings(LLVOAvatar::VISUAL_MUTE_NOT_SET); + avatar->setVisualMuteSettings(LLVOAvatar::ALWAYS_VISUAL_MUTE); return true; case 2: avatar->setVisualMuteSettings(LLVOAvatar::NEVER_VISUAL_MUTE); -- cgit v1.2.3