void LLFloaterMove::onOpen(const LLSD& key) { if (gAgent.getFlying()) { setFlyingMode(TRUE); showModeButtons(FALSE); } if (isAgentAvatarValid() && gAgentAvatarp->isSitting()) { setSittingMode(TRUE); showModeButtons(FALSE); } sUpdateFlyingStatus(); }
void LLFloaterMove::setMovementMode(const EMovementMode mode) { mCurrentMode = mode; gAgent.setFlying(MM_FLY == mode); // attempts to set avatar flying can not set it real flying in some cases. // For ex. when avatar fell down & is standing up. // So, no need to continue processing FLY mode. See EXT-1079 if (MM_FLY == mode && !gAgent.getFlying()) { return; } switch (mode) { case MM_RUN: gAgent.setAlwaysRun(); gAgent.setRunning(); //MK if (gRRenabled) { if (gAgent.mRRInterface.mContainsRun || gAgent.mRRInterface.mContainsAlwaysRun) { gAgent.clearRunning(); gAgent.clearAlwaysRun(); } } //mk break; case MM_WALK: gAgent.clearAlwaysRun(); gAgent.clearRunning(); break; default: //do nothing for other modes (MM_FLY) break; } // tell the simulator. gAgent.sendWalkRun(gAgent.getAlwaysRun()); updateButtonsWithMovementMode(mode); //MK if (gRRenabled && mode == MM_RUN) { if (gAgent.mRRInterface.mContainsRun || gAgent.mRRInterface.mContainsAlwaysRun) { updateButtonsWithMovementMode(MM_WALK); } } //mk bool bHideModeButtons = MM_FLY == mode || (isAgentAvatarValid() && gAgentAvatarp->isSitting()); showModeButtons(!bHideModeButtons); }
// virtual void LLFloaterMove::setEnabled(BOOL enabled) { //we need to enable/disable only buttons, EXT-1061. // is called before postBuild() - use findChild here. LLPanel *panel_actions = findChild<LLPanel>("panel_actions"); if (panel_actions) panel_actions->setEnabled(enabled); showModeButtons(enabled); }
void LLFloaterMove::onOpen(const LLSD& key) { if (gAgent.getFlying()) { setFlyingMode(TRUE); showModeButtons(FALSE); } if (isAgentAvatarValid() && gAgentAvatarp->isSitting()) { setSittingMode(TRUE); showModeButtons(FALSE); } // sUpdateFlyingStatus(); // [RLVa:KB] - Checked: 2011-05-27 (RLVa-1.4.0a) | Added: RLVa-1.4.0a sUpdateMovementStatus(); // [/RLVa:KB] }
void LLFloaterMove::onOpen(const LLSD& key) { LLButton *anchor_panel = LLBottomTray::getInstance()->getChild<LLButton>("movement_btn"); if (gAgent.getFlying()) { setFlyingMode(TRUE); showModeButtons(FALSE); } if (gAgent.getAvatarObject() && gAgent.getAvatarObject()->isSitting()) { setSittingMode(TRUE); showModeButtons(FALSE); } setDockControl(new LLDockControl( anchor_panel, this, getDockTongue(), LLDockControl::TOP)); sUpdateFlyingStatus(); }
void LLFloaterMove::initMovementMode() { EMovementMode initMovementMode = gAgent.getAlwaysRun() ? MM_RUN : MM_WALK; if (gAgent.getFlying()) { initMovementMode = MM_FLY; } setMovementMode(initMovementMode); if (isAgentAvatarValid()) { showModeButtons(!gAgentAvatarp->isSitting()); } }
void LLFloaterMove::setMovementMode(const EMovementMode mode) { mCurrentMode = mode; gAgent.setFlying(MM_FLY == mode); // attempts to set avatar flying can not set it real flying in some cases. // For ex. when avatar fell down & is standing up. // So, no need to continue processing FLY mode. See EXT-1079 if (MM_FLY == mode && !gAgent.getFlying()) { return; } switch (mode) { case MM_RUN: gAgent.setAlwaysRun(); // gAgent.setRunning(); break; case MM_WALK: gAgent.clearAlwaysRun(); // gAgent.clearRunning(); break; default: //do nothing for other modes (MM_FLY) break; } // tell the simulator. // gAgent.sendWalkRun(gAgent.getAlwaysRun()); // // updateButtonsWithMovementMode(mode); // // bool bHideModeButtons = MM_FLY == mode // || (isAgentAvatarValid() && gAgentAvatarp->isSitting()); // [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i // Running may have been restricted so update walk-vs-run from the agent's actual running state if ( (MM_WALK == mode) || (MM_RUN == mode) ) mCurrentMode = (gAgent.getRunning()) ? MM_RUN : MM_WALK; updateButtonsWithMovementMode(mCurrentMode); bool bHideModeButtons = (MM_FLY == mCurrentMode) || (isAgentAvatarValid() && gAgentAvatarp->isSitting()); // [/RLVa:KB] showModeButtons(!bHideModeButtons); }