diff options
Diffstat (limited to 'indra/newview/llmoveview.cpp')
-rw-r--r-- | indra/newview/llmoveview.cpp | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 36ec2c779a..963be61d93 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -38,12 +38,14 @@ #include "indra_constants.h" // Viewer includes + #include "llagent.h" -#include "llviewercontrol.h" #include "llbutton.h" -#include "llviewerwindow.h" +#include "llfloaterreg.h" #include "lljoystickbutton.h" #include "lluictrlfactory.h" +#include "llviewerwindow.h" +#include "llviewercontrol.h" // // Constants @@ -59,28 +61,19 @@ const F32 NUDGE_TIME = 0.25f; // in seconds // protected LLFloaterMove::LLFloaterMove(const LLSD& key) -: LLFloater() +: LLFloater(key) { - setIsChrome(TRUE); - const BOOL DONT_OPEN = FALSE; - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_moveview.xml", DONT_OPEN); +// LLUICtrlFactory::getInstance()->buildFloater(this,"floater_moveview.xml", DONT_OPEN); } // virtual -void LLFloaterMove::onClose(bool app_quitting) -{ - destroy(); - - if (!app_quitting) - { - gSavedSettings.setBOOL("ShowMovementControls", FALSE); - } -} -// virtual BOOL LLFloaterMove::postBuild() { + setIsChrome(TRUE); + + mForwardButton = getChild<LLJoystickAgentTurn>("forward btn"); mForwardButton->setHeldDownDelay(MOVE_BUTTON_DELAY); @@ -116,11 +109,6 @@ BOOL LLFloaterMove::postBuild() // Static member functions // -void LLFloaterMove::onOpen(const LLSD& key) -{ - gSavedSettings.setBOOL("ShowMovementControls", TRUE); -} - // protected static F32 LLFloaterMove::getYawRate( F32 time ) { @@ -138,14 +126,20 @@ F32 LLFloaterMove::getYawRate( F32 time ) // protected static void LLFloaterMove::turnLeft(void *) { - F32 time = getInstance()->mTurnLeftButton->getHeldDownTime(); + LLFloaterMove* instance = LLFloaterReg::getTypedInstance<LLFloaterMove>("moveview"); + if(!instance) return; + + F32 time = instance->mTurnLeftButton->getHeldDownTime(); gAgent.moveYaw( getYawRate( time ) ); } // protected static void LLFloaterMove::turnRight(void *) { - F32 time = getInstance()->mTurnRightButton->getHeldDownTime(); + LLFloaterMove* instance = LLFloaterReg::getTypedInstance<LLFloaterMove>("moveview"); + if(!instance) return; + + F32 time = instance->mTurnRightButton->getHeldDownTime(); gAgent.moveYaw( -getYawRate( time ) ); } |