diff options
Diffstat (limited to 'indra/newview/llmoveview.cpp')
-rw-r--r-- | indra/newview/llmoveview.cpp | 60 |
1 files changed, 8 insertions, 52 deletions
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index a73da0940e..4819d5bd10 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -53,22 +53,17 @@ const F32 YAW_NUDGE_RATE = 0.05f; // fraction of normal speed const F32 NUDGE_TIME = 0.25f; // in seconds // -// Global statics -// - -LLFloaterMove* LLFloaterMove::sInstance = NULL; - - -// // Member functions // // protected -LLFloaterMove::LLFloaterMove() +LLFloaterMove::LLFloaterMove(const LLSD& key) : LLFloater("move floater") { setIsChrome(TRUE); - LLUICtrlFactory::getInstance()->buildFloater(this,"floater_moveview.xml"); + + const BOOL DONT_OPEN = FALSE; + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_moveview.xml", NULL, DONT_OPEN); mForwardButton = getChild<LLJoystickAgentTurn>("forward btn"); mForwardButton->setHeldDownDelay(MOVE_BUTTON_DELAY); @@ -99,15 +94,6 @@ LLFloaterMove::LLFloaterMove() childSetAction("move down btn",moveDown,NULL); mMoveDownButton->setHeldDownDelay(MOVE_BUTTON_DELAY); mMoveDownButton->setHeldDownCallback( moveDown ); - - sInstance = this; -} - -// protected -LLFloaterMove::~LLFloaterMove() -{ - // children all deleted by LLView destructor - sInstance = NULL; } // virtual @@ -125,42 +111,12 @@ void LLFloaterMove::onClose(bool app_quitting) // Static member functions // -// static -void LLFloaterMove::show(void*) +void LLFloaterMove::onOpen() { - if (sInstance) - { - sInstance->open(); /*Flawfinder: ignore*/ - } - else - { - LLFloaterMove* f = new LLFloaterMove(); - f->open(); /*Flawfinder: ignore*/ - } - + LLFloater::onOpen(); gSavedSettings.setBOOL("ShowMovementControls", TRUE); } -// static -void LLFloaterMove::toggle(void*) -{ - if (sInstance) - { - sInstance->close(); - } - else - { - show(NULL); - } -} - -// static -BOOL LLFloaterMove::visible(void*) -{ - return (sInstance != NULL); -} - - // protected static F32 LLFloaterMove::getYawRate( F32 time ) { @@ -178,14 +134,14 @@ F32 LLFloaterMove::getYawRate( F32 time ) // protected static void LLFloaterMove::turnLeft(void *) { - F32 time = sInstance->mTurnLeftButton->getHeldDownTime(); + F32 time = getInstance()->mTurnLeftButton->getHeldDownTime(); gAgent.moveYaw( getYawRate( time ) ); } // protected static void LLFloaterMove::turnRight(void *) { - F32 time = sInstance->mTurnRightButton->getHeldDownTime(); + F32 time = getInstance()->mTurnRightButton->getHeldDownTime(); gAgent.moveYaw( -getYawRate( time ) ); } |