diff options
author | Merov Linden <merov@lindenlab.com> | 2010-08-25 10:58:49 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2010-08-25 10:58:49 -0700 |
commit | 5361e6826f186783c95e01804cec97be37910bec (patch) | |
tree | efe3e329e0c15cc96aeb5ca4df3ac595bd3038ac /indra/newview/llviewermenu.cpp | |
parent | 06148d602e915615039d7bad1d4b7818ee5c4290 (diff) |
VWR-20710 : Sit anywhere, port of SG2.x SNOW-610 patch
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 476e761c28..d02e1fdc8f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3381,8 +3381,21 @@ class LLSelfStandUp : public view_listener_t bool enable_standup_self() { - bool new_value = isAgentAvatarValid() && gAgentAvatarp->isSitting(); - return new_value; + return isAgentAvatarValid() && gAgentAvatarp->isSitting(); +} + +class LLSelfSitDown : public view_listener_t + { + bool handleEvent(const LLSD& userdata) + { + gAgent.sitDown(); + return true; + } + }; + +bool enable_sitdown_self() +{ + return isAgentAvatarValid() && !gAgentAvatarp->isSitting() && !gAgent.getFlying(); } // Used from the login screen to aid in UI work on side tray @@ -8037,11 +8050,13 @@ void initialize_menus() // Admin top level view_listener_t::addMenu(new LLAdminOnSaveState(), "Admin.OnSaveState"); - // Self pie menu + // Self context menu view_listener_t::addMenu(new LLSelfStandUp(), "Self.StandUp"); + enable.add("Self.EnableStandUp", boost::bind(&enable_standup_self)); + view_listener_t::addMenu(new LLSelfSitDown(), "Self.SitDown"); + enable.add("Self.EnableSitDown", boost::bind(&enable_sitdown_self)); view_listener_t::addMenu(new LLSelfRemoveAllAttachments(), "Self.RemoveAllAttachments"); - enable.add("Self.EnableStandUp", boost::bind(&enable_standup_self)); view_listener_t::addMenu(new LLSelfEnableRemoveAllAttachments(), "Self.EnableRemoveAllAttachments"); // we don't use boost::bind directly to delay side tray construction |