summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rwxr-xr-xindra/newview/llviewermenu.cpp65
1 files changed, 63 insertions, 2 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index e1faf3b29b..dc8a27c5c8 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -1073,8 +1073,6 @@ class LLAdvancedCheckInfoDisplay : public view_listener_t
U32 info_display = info_display_from_string( userdata.asString() );
bool new_value = false;
- LL_INFOS("ViewerMenu") << "check " << userdata.asString() << LL_ENDL;
-
if ( info_display != 0 )
{
new_value = LLPipeline::toggleRenderDebugControl( (void*)info_display );
@@ -2930,6 +2928,67 @@ bool enable_object_unmute()
}
}
+
+// 0 = normal, 1 = always, 2 = never
+class LLAvatarCheckImpostorMode : 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 LLAvatarSetImpostorMode : 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);
+ break;
+ case 1:
+ avatar->setVisualMuteSettings(LLVOAvatar::ALWAYS_VISUAL_MUTE);
+ break;
+ case 2:
+ avatar->setVisualMuteSettings(LLVOAvatar::NEVER_VISUAL_MUTE);
+ break;
+ default:
+ return false;
+ }
+
+ avatar->forceUpdateVisualMuteSettings();
+ LLVOAvatar::cullAvatarsByPixelArea();
+ return true;
+ } // handleEvent()
+};
+
+
class LLObjectMute : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@@ -8682,6 +8741,8 @@ void initialize_menus()
view_listener_t::addMenu( new LLCheckPanelPeopleTab(), "SideTray.CheckPanelPeopleTab");
// Avatar pie menu
+ view_listener_t::addMenu(new LLAvatarCheckImpostorMode(), "Avatar.CheckImpostorMode");
+ view_listener_t::addMenu(new LLAvatarSetImpostorMode(), "Avatar.SetImpostorMode");
view_listener_t::addMenu(new LLObjectMute(), "Avatar.Mute");
view_listener_t::addMenu(new LLAvatarAddFriend(), "Avatar.AddFriend");
view_listener_t::addMenu(new LLAvatarAddContact(), "Avatar.AddContact");