summaryrefslogtreecommitdiff
path: root/indra/newview/lloverlaybar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lloverlaybar.cpp')
-rw-r--r--indra/newview/lloverlaybar.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp
index 7162c2e925..f311732e46 100644
--- a/indra/newview/lloverlaybar.cpp
+++ b/indra/newview/lloverlaybar.cpp
@@ -50,6 +50,7 @@
#include "llui.h"
#include "llviewercontrol.h"
#include "llviewerimagelist.h"
+#include "llviewerjoystick.h"
#include "llviewermedia.h"
#include "llviewermenu.h" // handle_reset_view()
#include "llviewermedia.h"
@@ -122,6 +123,7 @@ BOOL LLOverlayBar::postBuild()
childSetAction("Set Not Busy",onClickSetNotBusy,this);
childSetAction("Mouselook",onClickMouselook,this);
childSetAction("Stand Up",onClickStandUp,this);
+ childSetAction("Flycam",onClickFlycam,this);
childSetVisible("chat_bar", gSavedSettings.getBOOL("ChatVisible"));
setFocusRoot(TRUE);
@@ -209,6 +211,16 @@ void LLOverlayBar::refresh()
buttons_changed = TRUE;
}
+ BOOL flycam = LLViewerJoystick::getInstance()->getOverrideCamera();
+ button = getChild<LLButton>("Flycam");
+ if (button && button->getVisible() != flycam)
+ {
+ button->setVisible(flycam);
+ sendChildToFront(button);
+ moveChildToBackOfTabGroup(button);
+ buttons_changed = TRUE;
+ }
+
BOOL mouselook_grabbed;
mouselook_grabbed = gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX)
|| gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX);
@@ -284,6 +296,12 @@ void LLOverlayBar::onClickSetNotBusy(void*)
// static
+void LLOverlayBar::onClickFlycam(void*)
+{
+ LLViewerJoystick::getInstance()->toggleFlycam();
+}
+
+// static
void LLOverlayBar::onClickResetView(void* data)
{
handle_reset_view();