diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 2c0943974d7240227df6df6bfd5847fa6f3d58d7..fb58407f62d4e0cae3894a1f7fe641c570d98ef1 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -171,7 +171,10 @@ LLAgent::LLAgent() : mDoubleTapRunMode(DOUBLETAP_NONE), mbAlwaysRun(false), - mbRunning(false), +// mbRunning(false), +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + mbTempRun(false), +// [/RLVa:KB] mbTeleportKeepsLookAt(false), mAgentAccess(gSavedSettings), @@ -2602,7 +2605,36 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request) sendReliableMessage(); } -void LLAgent::sendWalkRun(bool running) +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i +void LLAgent::setAlwaysRun() +{ + mbAlwaysRun = (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasBehaviour(RLV_BHVR_ALWAYSRUN)); + sendWalkRun(); +} + +void LLAgent::setTempRun() +{ + mbTempRun = (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasBehaviour(RLV_BHVR_TEMPRUN)); + sendWalkRun(); +} + +void LLAgent::clearAlwaysRun() +{ + mbAlwaysRun = false; + sendWalkRun(); +} + +void LLAgent::clearTempRun() +{ + mbTempRun = false; + sendWalkRun(); +} +// [/RLVa:KB] + +//void LLAgent::sendWalkRun(bool running) +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i +void LLAgent::sendWalkRun() +// [/RLVa:KB] { LLMessageSystem* msgsys = gMessageSystem; if (msgsys) @@ -2611,7 +2643,10 @@ void LLAgent::sendWalkRun(bool running) msgsys->nextBlockFast(_PREHASH_AgentData); msgsys->addUUIDFast(_PREHASH_AgentID, getID()); msgsys->addUUIDFast(_PREHASH_SessionID, getSessionID()); - msgsys->addBOOLFast(_PREHASH_AlwaysRun, BOOL(running) ); +// msgsys->addBOOLFast(_PREHASH_AlwaysRun, BOOL(running) ); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + msgsys->addBOOLFast(_PREHASH_AlwaysRun, BOOL(getRunning()) ); +// [/RLVa:KB] sendReliableMessage(); } } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 896408c0dd6a9cc0417ece00063cf1664dcd64a0..ea3fa3ce6475fc88ecb88fc34be6a57eced42626 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -330,19 +330,31 @@ class LLAgent : public LLOldEvents::LLObservable DOUBLETAP_SLIDERIGHT }; - void setAlwaysRun() { mbAlwaysRun = true; } - void clearAlwaysRun() { mbAlwaysRun = false; } - void setRunning() { mbRunning = true; } - void clearRunning() { mbRunning = false; } - void sendWalkRun(bool running); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + void setAlwaysRun(); + void setTempRun(); + void clearAlwaysRun(); + void clearTempRun(); + void sendWalkRun(); + bool getTempRun() { return mbTempRun; } + bool getRunning() const { return (mbAlwaysRun) || (mbTempRun); } +// [/RLVa:KB] +// void setAlwaysRun() { mbAlwaysRun = true; } +// void clearAlwaysRun() { mbAlwaysRun = false; } +// void setRunning() { mbRunning = true; } +// void clearRunning() { mbRunning = false; } +// void sendWalkRun(bool running); bool getAlwaysRun() const { return mbAlwaysRun; } - bool getRunning() const { return mbRunning; } +// bool getRunning() const { return mbRunning; } public: LLFrameTimer mDoubleTapRunTimer; EDoubleTapRunMode mDoubleTapRunMode; private: bool mbAlwaysRun; // Should the avatar run by default rather than walk? - bool mbRunning; // Is the avatar trying to run right now? +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + bool mbTempRun; +// [/RLVa:KB] +// bool mbRunning; // Is the avatar trying to run right now? bool mbTeleportKeepsLookAt; // Try to keep look-at after teleport is complete //-------------------------------------------------------------------- diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index c7b187612a957304dbd71eb357ac05044c473e56..d7168ef55b165446d98ee1249b7974f11258a282 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -326,23 +326,32 @@ void LLFloaterMove::setMovementMode(const EMovementMode mode) { case MM_RUN: gAgent.setAlwaysRun(); - gAgent.setRunning(); +// gAgent.setRunning(); break; case MM_WALK: gAgent.clearAlwaysRun(); - gAgent.clearRunning(); +// gAgent.clearRunning(); break; default: //do nothing for other modes (MM_FLY) break; } // tell the simulator. - gAgent.sendWalkRun(gAgent.getAlwaysRun()); - - updateButtonsWithMovementMode(mode); +// 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; - bool bHideModeButtons = MM_FLY == mode - || (isAgentAvatarValid() && gAgentAvatarp->isSitting()); + updateButtonsWithMovementMode(mCurrentMode); + + bool bHideModeButtons = (MM_FLY == mCurrentMode) || (isAgentAvatarValid() && gAgentAvatarp->isSitting()); +// [/RLVa:KB] showModeButtons(!bHideModeButtons); diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index e1dd72dddcc3acefc2fc8cac4bd3dba0f54ccd46..b7dccd08d60b1d863888943668815861603c80b1 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -329,8 +329,11 @@ void LLViewerJoystick::handleRun(F32 inc) if (1 == mJoystickRun) { ++mJoystickRun; - gAgent.setRunning(); - gAgent.sendWalkRun(gAgent.getRunning()); +// gAgent.setRunning(); +// gAgent.sendWalkRun(gAgent.getRunning()); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + gAgent.setTempRun(); +// [/RLVa:KB] } else if (0 == mJoystickRun) { @@ -345,8 +348,11 @@ void LLViewerJoystick::handleRun(F32 inc) --mJoystickRun; if (0 == mJoystickRun) { - gAgent.clearRunning(); - gAgent.sendWalkRun(gAgent.getRunning()); +// gAgent.clearRunning(); +// gAgent.sendWalkRun(gAgent.getRunning()); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + gAgent.clearTempRun(); +// [/RLVa:KB] } } } diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 1aa9fd8a45d5a52db01e09a736a06aa4cbcdc78b..6f4f449e46389c5d8f48d1df86e151abaad06e5b 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -41,6 +41,9 @@ #include "llvoavatarself.h" #include "llfloatercamera.h" #include "llinitparam.h" +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i +#include "rlvhandler.h" +// [/RLVa:KB] // // Constants @@ -91,14 +94,18 @@ static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode m { if (KEYSTATE_UP == s) { - if (gAgent.mDoubleTapRunMode == mode && - gAgent.getRunning() && - !gAgent.getAlwaysRun()) - { - // Turn off temporary running. - gAgent.clearRunning(); - gAgent.sendWalkRun(gAgent.getRunning()); - } +// if (gAgent.mDoubleTapRunMode == mode && +// gAgent.getRunning() && +// !gAgent.getAlwaysRun()) +// { +// // Turn off temporary running. +// gAgent.clearRunning(); +// gAgent.sendWalkRun(gAgent.getRunning()); +// } +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + if ( (gAgent.mDoubleTapRunMode == mode) && (gAgent.getTempRun()) ) + gAgent.clearTempRun(); +// [/RLVa:KB] } else if (gSavedSettings.getBOOL("AllowTapTapHoldRun") && KEYSTATE_DOWN == s && @@ -109,8 +116,11 @@ static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode m { // Same walk-key was pushed again quickly; this is a // double-tap so engage temporary running. - gAgent.setRunning(); - gAgent.sendWalkRun(gAgent.getRunning()); +// gAgent.setRunning(); +// gAgent.sendWalkRun(gAgent.getRunning()); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + gAgent.setTempRun(); +// [/RLVa:KB] } // Pressing any walk-key resets the double-tap timer diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 2bef71da1a106f80a4c335e845481f5b20e4d2be..2957a60da20b8187320ecbd492ad6e01f611098d 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5317,16 +5317,16 @@ class LLWorldAlwaysRun : public view_listener_t if (gAgent.getAlwaysRun()) { gAgent.clearAlwaysRun(); - gAgent.clearRunning(); +// gAgent.clearRunning(); } else { gAgent.setAlwaysRun(); - gAgent.setRunning(); +// gAgent.setRunning(); } // tell the simulator. - gAgent.sendWalkRun(gAgent.getAlwaysRun()); +// gAgent.sendWalkRun(gAgent.getAlwaysRun()); // Update Movement Controls according to AlwaysRun mode LLFloaterMove::setAlwaysRunMode(gAgent.getAlwaysRun()); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 091e520af697c81e40d5c42f490a04e1fb75f7ae..f34f18d4f330caa73aa62e15f37e1d9f2b74a794 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4233,7 +4233,10 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) } // send walk-vs-run status - gAgent.sendWalkRun(gAgent.getRunning() || gAgent.getAlwaysRun()); +// gAgent.sendWalkRun(gAgent.getRunning() || gAgent.getAlwaysRun()); +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + gAgent.sendWalkRun(); +// [/RLVa:KB] // If the server version has changed, display an info box and offer // to display the release notes, unless this is the initial log in. diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 6ca7eb4db6a75f8d9c23cf3cf2dd7affbc5a4367..4042c244d90c1ecb7e3bc33b24f5f806abc04a7a 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -191,6 +191,8 @@ enum ERlvBehaviour { RLV_BHVR_STANDTP, // "standtp" RLV_BHVR_SETDEBUG, // "setdebug" RLV_BHVR_SETENV, // "setenv" + RLV_BHVR_ALWAYSRUN, // "alwaysrun" + RLV_BHVR_TEMPRUN, // "temprun RLV_BHVR_DETACHME, // "detachme" RLV_BHVR_ATTACHOVER, // "attachover" RLV_BHVR_ATTACHTHIS, // "attachthis" diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index cefa691075611be049e89153faa398ebcf98aa3e..20a0b7e882686190ccaa20e47162d3242e25fa7a 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -1106,6 +1106,22 @@ ERlvCmdRet RlvHandler::processAddRemCommand(const RlvCommand& rlvCmd) pObj->mText->setString( (RLV_TYPE_ADD == eType) ? "" : pObj->mText->getObjectText()); } break; + case RLV_BHVR_ALWAYSRUN: // @alwaysrun=n|y - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + { + VERIFY_OPTION_REF(strOption.empty()); + + if (RLV_TYPE_ADD == eType) + gAgent.clearAlwaysRun(); + } + break; + case RLV_BHVR_TEMPRUN: // @temprun=n|y - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + { + VERIFY_OPTION_REF(strOption.empty()); + + if (RLV_TYPE_ADD == eType) + gAgent.clearTempRun(); + } + break; // The following block is only valid if there's no option case RLV_BHVR_SHOWLOC: // @showloc=n|y - Checked: 2009-12-05 (RLVa-1.1.0h) | Modified: RLVa-1.1.0h case RLV_BHVR_SHOWNAMES: // @shownames=n|y - Checked: 2009-12-05 (RLVa-1.1.0h) | Modified: RLVa-1.1.0h diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 672d5d53d13e5ab711c62c1456636f9e6c5e7fc8..458cc773cacad0aab08de0bad17232632f3a1198 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -156,11 +156,11 @@ void RlvCommand::initLookupTable() "tplm", "tploc", "tplure", "viewnote", "viewscript", "viewtexture", "acceptpermission", "accepttp", "allowidle", "displayname", "edit", "editobj", "rez", "fartouch", "interact", "touchobj", "touchattach", "touchattachself", "touchattachother", "touchhud", "touchworld", "touchall", "fly", "unsit", "sit", "sittp", "standtp", "setdebug", "setenv", - "detachme", "attachover", "attachthis", "attachthisover", "detachthis", "attachall", "attachallover", "detachall", - "attachallthis", "attachallthisover", "detachallthis", "tpto", "version", "versionnew", "versionnum", "getattach", - "getattachnames", "getaddattachnames", "getremattachnames", "getoutfit", "getoutfitnames", "getaddoutfitnames", - "getremoutfitnames", "findfolder", "findfolders", "getpath", "getpathnew", "getinv", "getinvworn", "getsitid", - "getcommand", "getstatus", "getstatusall" + "alwaysrun", "temprun", "detachme", "attachover", "attachthis", "attachthisover", "detachthis", "attachall", "attachallover", + "detachall", "attachallthis", "attachallthisover", "detachallthis", "tpto", "version", "versionnew", "versionnum", + "getattach", "getattachnames", "getaddattachnames", "getremattachnames", "getoutfit", "getoutfitnames", + "getaddoutfitnames", "getremoutfitnames", "findfolder", "findfolders", "getpath", "getpathnew", "getinv", "getinvworn", + "getsitid", "getcommand", "getstatus", "getstatusall" }; for (int idxBvhr = 0; idxBvhr < RLV_BHVR_COUNT; idxBvhr++)