diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index f16409e32..f655834c1 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -94,6 +94,7 @@ #include "hippogridmanager.h" // [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvactions.h" #include "rlvhandler.h" // [/RLVa:KB] @@ -661,7 +662,7 @@ bool LLSelectMgr::enableLinkObjects() } } // [RLVa:KB] - Checked: 2011-03-19 (RLVa-1.3.0f) | Modified: RLVa-0.2.0g - if ( (new_value) && ((rlv_handler_t::isEnabled()) && (!gRlvHandler.canStand())) ) + if ( (new_value) && ((rlv_handler_t::isEnabled()) && (!RlvActions::canStand())) ) { // Allow only if the avie isn't sitting on any of the selected objects LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection(); @@ -683,7 +684,7 @@ bool LLSelectMgr::enableUnlinkObjects() !first_editable_object->isAttachment() && !first_editable_object->isPermanentEnforced() && ((root_object == NULL) || !root_object->isPermanentEnforced()); // [RLVa:KB] - Checked: 2011-03-19 (RLVa-1.3.0f) | Modified: RLVa-0.2.0g - if ( (new_value) && ((rlv_handler_t::isEnabled()) && (!gRlvHandler.canStand())) ) + if ( (new_value) && ((rlv_handler_t::isEnabled()) && (!RlvActions::canStand())) ) { // Allow only if the avie isn't sitting on any of the selected objects LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection(); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 1bfc7ca9e..602aa594b 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -95,7 +95,8 @@ #include "hippogridmanager.h" // [RLVa:KB] -#include "rlvhandler.h" +#include "rlvactions.h" +#include "rlvcommon.h" // [/RLVa:KB] // @@ -595,7 +596,7 @@ void LLStatusBar::refresh() } // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-1.0.0a - if ( (region) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) // region == NULL if we lose our connection to the grid + if ( (region) && (RlvActions::hasBehaviour(RLV_BHVR_SHOWLOC)) ) // region == NULL if we lose our connection to the grid { location_name = llformat("%s (%s) - %s", RlvStrings::getString(RLV_STRING_HIDDEN_REGION).c_str(), region->getSimAccessString().c_str(), @@ -923,7 +924,7 @@ static void onClickScripts(void*) static void onClickBuyLand(void*) { // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) + if (RlvActions::isRlvEnabled() && RlvActions::hasBehaviour(RLV_BHVR_SHOWLOC)) { return; } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 051a96329..729dd9418 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -207,7 +207,8 @@ void init_debug_rendering_menu(LLMenuGL* menu); void init_debug_ui_menu(LLMenuGL* menu); void init_debug_xui_menu(LLMenuGL* menu); void init_debug_avatar_menu(LLMenuGL* menu); -// [RLVa:KB] +// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvactions.h" #include "rlvhandler.h" #include "rlvfloaters.h" #include "rlvlocks.h" @@ -3974,7 +3975,7 @@ class LLLandSit : public view_listener_t bool handleEvent(LLPointer event, const LLSD& userdata) { // [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.2.1f - if ( (rlv_handler_t::isEnabled()) && ((!gRlvHandler.canStand()) || (gRlvHandler.hasBehaviour(RLV_BHVR_SIT))) ) + if ( (rlv_handler_t::isEnabled()) && ((!RlvActions::canStand()) || (gRlvHandler.hasBehaviour(RLV_BHVR_SIT))) ) return true; // [/RLVa:KB] @@ -4670,7 +4671,7 @@ void handle_take_copy() if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return; // [RLVa:KB] - Checked: 2010-03-07 (RLVa-1.2.0c) | Modified: RLVa-1.2.0a - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canStand()) ) + if ( (rlv_handler_t::isEnabled()) && (!RlvActions::canStand()) ) { // Allow only if the avie isn't sitting on any of the selected objects LLObjectSelectionHandle hSel = LLSelectMgr::getInstance()->getSelection(); @@ -6279,7 +6280,7 @@ bool enable_object_stand_up() // 'Object Stand Up' menu item is enabled when agent is sitting on selection // return sitting_on_selection(); // [RLVa:KB] - Checked: 2010-07-24 (RLVa-1.2.0g) | Added: RLVa-1.2.0g - return sitting_on_selection() && ( (!rlv_handler_t::isEnabled()) || (gRlvHandler.canStand()) ); + return sitting_on_selection() && ( (!rlv_handler_t::isEnabled()) || (RlvActions::canStand()) ); // [/RLVa:KB] } diff --git a/indra/newview/rlvactions.cpp b/indra/newview/rlvactions.cpp index 41ba2d756..284813638 100644 --- a/indra/newview/rlvactions.cpp +++ b/indra/newview/rlvactions.cpp @@ -16,6 +16,7 @@ #include "llviewerprecompiledheaders.h" #include "llimview.h" +#include "llvoavatarself.h" #include "rlvactions.h" #include "rlvhandler.h" @@ -83,6 +84,13 @@ bool RlvActions::autoAcceptTeleportRequest(const LLUUID& idRequester) return ((idRequester.notNull()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTPREQUEST, idRequester))) || (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTPREQUEST)); } +// Checked: 2010-03-07 (RLVa-1.2.0) +bool RlvActions::canStand() +{ + // NOTE: return FALSE only if we're @unsit=n restricted and the avie is currently sitting on something and TRUE for everything else + return (!gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || ((isAgentAvatarValid()) && (!gAgentAvatarp->isSitting())); +} + // Checked: 2013-05-10 (RLVa-1.4.9) bool RlvActions::hasBehaviour(ERlvBehaviour eBhvr) { diff --git a/indra/newview/rlvactions.h b/indra/newview/rlvactions.h index 3f744f874..9b77ed4b6 100644 --- a/indra/newview/rlvactions.h +++ b/indra/newview/rlvactions.h @@ -70,6 +70,15 @@ public: */ static bool autoAcceptTeleportRequest(const LLUUID& idRequester); + // ================= + // World interaction + // ================= +public: + /* + * Returns true if the user can stand up (returns true if the user isn't currently sitting) + */ + static bool canStand(); + // ================ // Helper functions // ================ diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index b8cb2c05b..9892c4e3c 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -20,16 +20,16 @@ #include "llavatarnamecache.h" #include "llinstantmessage.h" #include "llnotificationsutil.h" +#include "llsdserialize.h" #include "lluictrlfactory.h" -#include "sgversion.h" #include "llviewermenu.h" #include "llviewerparcelmgr.h" #include "llviewermenu.h" #include "llviewerregion.h" #include "llviewerstats.h" -#include "llvoavatar.h" #include "llworld.h" +#include "rlvactions.h" #include "rlvcommon.h" #include "rlvhelper.h" #include "rlvhandler.h" @@ -117,7 +117,7 @@ void RlvSettings::initClass() { if ( (!LLApp::isQuitting()) && (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) ) { - BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || (!gRlvHandler.canStand()); + BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || (!RlvActions::canStand()); if (gSavedPerAccountSettings.getBOOL(RLV_SETTING_LOGINLASTLOCATION) != fValue) { gSavedPerAccountSettings.setBOOL(RLV_SETTING_LOGINLASTLOCATION, fValue); diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 5461c62c3..9c5b0c332 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -672,13 +672,6 @@ bool RlvHandler::canSit(LLViewerObject* pObj, const LLVector3& posOffset /*= LLV (dist_vec_squared(gAgent.getPositionGlobal(), pObj->getPositionGlobal() + LLVector3d(posOffset)) < 1.5f * 1.5f) ); } -// Checked: 2010-03-07 (RLVa-1.2.0c) | Added: RLVa-1.2.0a -bool RlvHandler::canStand() const -{ - // NOTE: return FALSE only if we're @unsit=n restricted and the avie is currently sitting on something and TRUE for everything else - return (!hasBehaviour(RLV_BHVR_UNSIT)) || ((isAgentAvatarValid()) && (!gAgentAvatarp->isSitting())); -} - // Checked: 2010-04-11 (RLVa-1.3.0h) | Modified: RLVa-1.3.0h bool RlvHandler::canTouch(const LLViewerObject* pObj, const LLVector3& posOffset /*=LLVector3::zero*/) const { diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h index c5905c5ea..c672608e9 100644 --- a/indra/newview/rlvhandler.h +++ b/indra/newview/rlvhandler.h @@ -97,7 +97,6 @@ public: bool canEdit(const LLViewerObject* pObj) const; // @edit and @editobj bool canShowHoverText(const LLViewerObject* pObj) const; // @showhovertext* command family bool canSit(LLViewerObject* pObj, const LLVector3& posOffset = LLVector3::zero) const; - bool canStand() const; bool canTouch(const LLViewerObject* pObj, const LLVector3& posOffset = LLVector3::zero) const; // @touch bool filterChat(std::string& strUTF8Text, bool fFilterEmote) const; // @sendchat, @recvchat and @redirchat bool redirectChatOrEmote(const std::string& strUTF8Test) const; // @redirchat and @rediremote