diff options
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rwxr-xr-x | indra/newview/llviewermenu.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 137eeb6a99..1c2cb978c7 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -171,6 +171,7 @@ LLContextMenu *gMenuObject = NULL; LLContextMenu *gMenuAttachmentSelf = NULL; LLContextMenu *gMenuAttachmentOther = NULL; LLContextMenu *gMenuLand = NULL; +LLContextMenu *gMenuMuteParticle = NULL; const std::string SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents"); @@ -427,6 +428,9 @@ void init_menus() gMenuLand = LLUICtrlFactory::createFromFile<LLContextMenu>( "menu_land.xml", gMenuHolder, registry); + gMenuMuteParticle = LLUICtrlFactory::createFromFile<LLContextMenu>( + "menu_mute_particle.xml", gMenuHolder, registry); + /// /// set up the colors /// @@ -2452,6 +2456,9 @@ void cleanup_menus() delete gMenuLand; gMenuLand = NULL; + delete gMenuMuteParticle; + gMenuMuteParticle = NULL; + delete gMenuBarView; gMenuBarView = NULL; @@ -2805,6 +2812,13 @@ bool enable_object_edit() return enable; } +bool enable_mute_particle() +{ + const LLPickInfo& pick = LLToolPie::getInstance()->getPick(); + + return pick.mParticleOwnerID != LLUUID::null && pick.mParticleOwnerID != gAgent.getID(); +} + // mutually exclusive - show either edit option or build in menu bool enable_object_build() { @@ -6222,6 +6236,33 @@ class LLLandEdit : public view_listener_t } }; +class LLMuteParticle : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLUUID id = LLToolPie::getInstance()->getPick().mParticleOwnerID; + + if (id.notNull()) + { + std::string name; + gCacheName->getFullName(id, name); + + LLMute mute(id, name, LLMute::AGENT); + if (LLMuteList::getInstance()->isMuted(mute.mID)) + { + LLMuteList::getInstance()->remove(mute); + } + else + { + LLMuteList::getInstance()->add(mute); + LLPanelBlockedList::showPanelAndSelect(mute.mID); + } + } + + return true; + } +}; + class LLWorldEnableBuyLand : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8715,6 +8756,9 @@ void initialize_menus() view_listener_t::addMenu(new LLLandBuyPass(), "Land.BuyPass"); view_listener_t::addMenu(new LLLandEdit(), "Land.Edit"); + // Particle muting + view_listener_t::addMenu(new LLMuteParticle(), "Particle.Mute"); + view_listener_t::addMenu(new LLLandEnableBuyPass(), "Land.EnableBuyPass"); commit.add("Land.Buy", boost::bind(&handle_buy_land)); @@ -8737,6 +8781,7 @@ void initialize_menus() enable.add("EnablePayObject", boost::bind(&enable_pay_object)); enable.add("EnablePayAvatar", boost::bind(&enable_pay_avatar)); enable.add("EnableEdit", boost::bind(&enable_object_edit)); + enable.add("EnableMuteParticle", boost::bind(&enable_mute_particle)); enable.add("VisibleBuild", boost::bind(&enable_object_build)); commit.add("Pathfinding.Linksets.Select", boost::bind(&LLFloaterPathfindingLinksets::openLinksetsWithSelectedObjects)); enable.add("EnableSelectInPathfindingLinksets", boost::bind(&enable_object_select_in_pathfinding_linksets)); |