From 5ef87f0115db707483699af0a468945f022fcfc6 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sun, 6 Sep 2009 18:33:23 -0700 Subject: Ported sit anywhere feature from Emerald viewer --- linden/indra/newview/llviewermenu.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'linden/indra/newview/llviewermenu.cpp') diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 51953b09..727f357 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -7556,6 +7556,32 @@ class LLAdvancedCheckHUDInfo : public view_listener_t }; +////////////////////// +// FORCE GROUND SIT // +////////////////////// + +class LLAdvancedToggleSit: public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + LLChat chat; + chat.mSourceType = CHAT_SOURCE_SYSTEM; + if(!gAgent.getAvatarObject()->mIsSitting) + { + gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); + chat.mText = "Forcing Ground Sit"; + } + else + { + gAgent.setControlFlags(!AGENT_CONTROL_SIT_ON_GROUND); + gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); + chat.mText = "Standing up"; + } + LLFloaterChat::addChat(chat); + return true; + } +}; + /////////////////////// // CLEAR GROUP CACHE // @@ -9572,6 +9598,7 @@ void initialize_menus() addMenu(new LLWorldTeleportHome(), "World.TeleportHome"); addMenu(new LLWorldSetAway(), "World.SetAway"); addMenu(new LLWorldSetBusy(), "World.SetBusy"); + addMenu(new LLAdvancedToggleSit(), "Advanced.ToggleSit"); addMenu(new LLWorldEnableCreateLandmark(), "World.EnableCreateLandmark"); addMenu(new LLWorldEnableSetHomeLocation(), "World.EnableSetHomeLocation"); @@ -9720,6 +9747,7 @@ void initialize_menus() addMenu(new LLAdvancedCheckConsole(), "Advanced.CheckConsole"); addMenu(new LLAdvancedDumpInfoToConsole(), "Advanced.DumpInfoToConsole"); addMenu(new LLAdvancedReloadSettingsOverrides(), "Advanced.ReloadSettingsOverrides"); + addMenu(new LLAdvancedToggleSit(), "Advanced.ToggleSit"); // Advanced > HUD Info addMenu(new LLAdvancedToggleHUDInfo(), "Advanced.ToggleHUDInfo"); -- cgit v1.1