From 1866bc2af39189c17b636970d4df7edc983c1830 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 9 Oct 2010 03:27:47 -0700 Subject: Applied RLVa-1.1.2-Imprudence.patch by Kitty Barnett --- linden/indra/llxml/llcontrol.cpp | 9 + linden/indra/newview/CMakeLists.txt | 3 +- linden/indra/newview/app_settings/settings.xml | 55 +- linden/indra/newview/llagent.cpp | 119 +- linden/indra/newview/llagent.h | 4 - linden/indra/newview/llappviewer.cpp | 14 +- linden/indra/newview/llchatbar.cpp | 15 +- linden/indra/newview/llfirstuse.cpp | 15 - linden/indra/newview/llfirstuse.h | 4 - linden/indra/newview/llfloaterabout.cpp | 6 +- linden/indra/newview/llfloateractivespeakers.cpp | 6 +- linden/indra/newview/llfloateranimpreview.cpp | 1 + linden/indra/newview/llfloateravatarpicker.cpp | 4 + linden/indra/newview/llfloaterbeacons.cpp | 4 +- linden/indra/newview/llfloaterchat.cpp | 4 + linden/indra/newview/llfloaterinspect.cpp | 4 +- linden/indra/newview/llfloaterland.cpp | 4 + linden/indra/newview/llfloatermap.cpp | 4 + linden/indra/newview/llfloaterobjectiminfo.cpp | 4 +- linden/indra/newview/llfloaterproperties.cpp | 5 +- linden/indra/newview/llfloaterregioninfo.cpp | 4 + linden/indra/newview/llfloaterreporter.cpp | 6 +- linden/indra/newview/llfloatersettingsdebug.cpp | 4 +- linden/indra/newview/llfloaterteleporthistory.cpp | 30 +- linden/indra/newview/llfloaterworldmap.cpp | 12 +- linden/indra/newview/llgesturemgr.cpp | 1 + linden/indra/newview/llglsandbox.cpp | 8 +- linden/indra/newview/llhoverview.cpp | 20 +- linden/indra/newview/llhudeffectlookat.cpp | 5 +- linden/indra/newview/llhudtext.cpp | 3 + linden/indra/newview/llimpanel.cpp | 14 +- linden/indra/newview/llimview.cpp | 6 +- linden/indra/newview/llinventoryactions.cpp | 9 + linden/indra/newview/llinventorybridge.cpp | 66 +- linden/indra/newview/llinventorybridge.h | 35 + linden/indra/newview/llinventorymodel.cpp | 4 + linden/indra/newview/llinventoryview.cpp | 4 + linden/indra/newview/llmaniptranslate.cpp | 4 + linden/indra/newview/llnetmap.cpp | 8 +- linden/indra/newview/llnotify.cpp | 2 +- linden/indra/newview/lloverlaybar.cpp | 4 + linden/indra/newview/llpanelavatar.cpp | 4 + linden/indra/newview/llpanelclassified.cpp | 4 + linden/indra/newview/llpanelcontents.cpp | 4 +- linden/indra/newview/llpaneldisplay.cpp | 4 + linden/indra/newview/llpanelinventory.cpp | 17 +- linden/indra/newview/llpanelland.cpp | 4 + linden/indra/newview/llpanellogin.cpp | 4 +- linden/indra/newview/llpanelobject.cpp | 4 +- linden/indra/newview/llpanelpermissions.cpp | 6 +- linden/indra/newview/llpanelpick.cpp | 4 + linden/indra/newview/llprefsim.cpp | 4 + linden/indra/newview/llpreviewscript.cpp | 3 + linden/indra/newview/llselectmgr.cpp | 15 + linden/indra/newview/llstartup.cpp | 14 +- linden/indra/newview/llstatusbar.cpp | 6 +- linden/indra/newview/lltoolbar.cpp | 4 + linden/indra/newview/lltooldraganddrop.cpp | 28 +- linden/indra/newview/lltoolface.cpp | 9 +- linden/indra/newview/lltoolgrab.cpp | 28 +- linden/indra/newview/lltoolpie.cpp | 117 +- linden/indra/newview/lltoolplacer.cpp | 8 +- linden/indra/newview/lltoolselect.cpp | 5 +- linden/indra/newview/lltracker.cpp | 11 +- linden/indra/newview/llviewercontrol.cpp | 20 - linden/indra/newview/llviewerdisplay.cpp | 4 + linden/indra/newview/llviewermenu.cpp | 102 +- linden/indra/newview/llviewermessage.cpp | 127 +- linden/indra/newview/llviewerobject.cpp | 22 + linden/indra/newview/llviewertexteditor.cpp | 12 +- linden/indra/newview/llviewerwindow.cpp | 36 +- linden/indra/newview/llvoavatar.cpp | 58 +- linden/indra/newview/llvoavatar.h | 3 + linden/indra/newview/llvovolume.cpp | 4 + linden/indra/newview/llworldmapview.cpp | 7 +- linden/indra/newview/panelradar.cpp | 6 +- linden/indra/newview/pipeline.cpp | 4 + linden/indra/newview/rlvdefines.h | 217 +- linden/indra/newview/rlvevent.h | 227 -- linden/indra/newview/rlvextensions.cpp | 109 +- linden/indra/newview/rlvextensions.h | 33 +- linden/indra/newview/rlvfloaterbehaviour.cpp | 17 + linden/indra/newview/rlvfloaterbehaviour.h | 18 +- linden/indra/newview/rlvhandler.cpp | 3737 ++++++++++---------- linden/indra/newview/rlvhandler.h | 321 +- linden/indra/newview/rlvhelper.cpp | 649 +++- linden/indra/newview/rlvhelper.h | 206 +- linden/indra/newview/rlvmultistringsearch.cpp | 16 + linden/indra/newview/rlvmultistringsearch.h | 16 + .../skins/default/xui/en-us/menu_viewer.xml | 8 +- 90 files changed, 3941 insertions(+), 2878 deletions(-) delete mode 100644 linden/indra/newview/rlvevent.h diff --git a/linden/indra/llxml/llcontrol.cpp b/linden/indra/llxml/llcontrol.cpp index 1d1f024..452167e 100644 --- a/linden/indra/llxml/llcontrol.cpp +++ b/linden/indra/llxml/llcontrol.cpp @@ -1099,6 +1099,15 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v } */ +// [RLVa:KB] - Checked: 2010-06-20 (RLVa-1.1.2a) | Added: RLVa-1.1.2a + // HACK-RLVa: bad code but it's just a temporary measure to provide a smooth changeover from the old to the new rebranded settings + if ( (name.length() >= 14) && (0 == name.find("RestrainedLife")) ) + { + // Transparently convert the old settings name to the new one while preserving the user override + name = "RestrainedLove" + name.substr(14); + } +// [/RLVa:KB] + // If the control exists just set the value from the input file. LLControlVariable* existing_control = getControl(name); if(existing_control) diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index 9260b75..9ac2d57 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt @@ -486,6 +486,7 @@ set(viewer_SOURCE_FILES primbackup.cpp rlvhandler.cpp rlvhelper.cpp + rlvcommon.cpp rlvmultistringsearch.cpp rlvextensions.cpp rlvfloaterbehaviour.cpp @@ -937,9 +938,9 @@ set(viewer_HEADER_FILES primbackup.h randgauss.h rlvdefines.h - rlvevent.h rlvhandler.h rlvhelper.h + rlvcommon.h rlvmultistringsearch.h rlvextensions.h rlvfloaterbehaviour.h diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index d33285d..3be4ed4 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -1784,10 +1784,10 @@ - RestrainedLife + RestrainedLove Comment - Toggles the RestrainedLife features (BDSM lockable toys support). Needs a restart of the viewer. + Toggles the RestrainedLove features (BDSM lockable toys support). Needs a restart of the viewer. Persist 1 Type @@ -1795,10 +1795,10 @@ Value 0 - RestrainedLifeDebug + RestrainedLoveDebug Comment - Toggles the RestrainedLife debug mode (displays the commands when in debug mode). + Toggles the RestrainedLove debug mode (displays the commands when in debug mode). Persist 1 Type @@ -1806,10 +1806,10 @@ Value 0 - RestrainedLifeNoSetEnv + RestrainedLoveNoSetEnv Comment - When TRUE, forbids to set the environment (time of day and Windlight settings) via RestrainedLife. Needs a restart of the viewer. + When TRUE, forbids to set the environment (time of day and Windlight settings) via RestrainedLove. Needs a restart of the viewer. Persist 1 Type @@ -1817,10 +1817,10 @@ Value 0 - RestrainedLifeForbidGiveToRLV + RestrainedLoveForbidGiveToRLV Comment - When FALSE, allows to give sub-folders to the #RLV RestrainedLife folder. + When FALSE, allows to give sub-folders to the #RLV RestrainedLove folder. Persist 1 Type @@ -1828,6 +1828,17 @@ Value 1 + RLVaEnableCompositeFolders + + Comment + Enables composite folders for shared inventory + Persist + 1 + Type + Boolean + Value + 0 + RLVaEnableLegacyNaming Comment @@ -1842,7 +1853,7 @@ RLVaEnableWear Comment - When TRUE, enables the "Wear" option on the inventory item context menu for attachments. + Enables the "Wear" option on the inventory item context menu for attachments Persist 1 Type @@ -1850,10 +1861,21 @@ Value 1 + RLVaEnableSharedWear + + Comment + Attachments in the shared #RLV folder can be force-attached without needing to specify an attachment point (as long as no attachment is non-detachable) + Persist + 1 + Type + Boolean + Value + 0 + RLVaHideLockedLayers Comment - When TRUE, hides worn but "remove outfit" restricted clothing layers from @getoufit + Hides "remove outfit" restricted worn clothing layers from @getoufit Persist 1 Type @@ -1864,7 +1886,7 @@ RLVaHideLockedAttachments Comment - When TRUE, hides worn but "no detach" restricted attachments from @getattach + Hides non-detachable worn attachments from @getattach Persist 1 Type @@ -1872,6 +1894,17 @@ Value 0 + RLVaSharedInvAutoRename + + Comment + Automatically renames shared inventory items when worn + Persist + 1 + Type + Boolean + Value + 1 + RLVaShowNameTags Comment diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index fc12f33..eb5cf9b 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp @@ -136,6 +136,10 @@ #include "llviewerjoystick.h" #include "llfollowcam.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + using namespace LLVOAvatarDefines; extern LLMenuBarGL* gMenuBarView; @@ -4878,7 +4882,15 @@ void LLAgent::onAnimStop(const LLUUID& id) } else if (id == ANIM_AGENT_AWAY) { + //clearAFK(); +// [RLVa:KB] - Checked: 2009-10-19 (RLVa-1.1.0g) | Added: RLVa-1.1.0g +#ifdef RLV_EXTENSION_CMD_ALLOWIDLE + if (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) + clearAFK(); +#else clearAFK(); +#endif // RLV_EXTENSION_CMD_ALLOWIDLE +// [/RLVa:KB] } else if (id == ANIM_AGENT_STANDUP) { @@ -5220,7 +5232,7 @@ void LLAgent::buildLocationString(std::string& str) // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { - str = rlv_handler_t::cstrHidden; + str = RlvStrings::getString(RLV_STRING_HIDDEN); return; } // [/RLVa:KB] @@ -6223,14 +6235,21 @@ void LLAgent::teleportCancel() void LLAgent::teleportViaLocation(const LLVector3d& pos_global) { -// [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-07-07 (RLVa-1.0.0d) - // If we're getting teleported due to @tpto we should disregard any @tploc=n or @unsit=n restrictions from the same object - if ( (rlv_handler_t::isEnabled()) && - ( (gRlvHandler.hasBehaviourExcept(RLV_BHVR_TPLOC, gRlvHandler.getCurrentObject())) || - ( (mAvatarObject.notNull()) && (mAvatarObject->mIsSitting) && - (gRlvHandler.hasBehaviourExcept(RLV_BHVR_UNSIT, gRlvHandler.getCurrentObject()))) ) ) +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2010-03-02 (RLVa-1.1.1a) | Modified: RLVa-1.2.0a + if (rlv_handler_t::isEnabled()) { - return; + // If we're getting teleported due to @tpto we should disregard any @tploc=n or @unsit=n restrictions from the same object + if ( (gRlvHandler.hasBehaviourExcept(RLV_BHVR_TPLOC, gRlvHandler.getCurrentObject())) || + ( (mAvatarObject.notNull()) && (mAvatarObject->mIsSitting) && + (gRlvHandler.hasBehaviourExcept(RLV_BHVR_UNSIT, gRlvHandler.getCurrentObject()))) ) + { + return; + } + + if ( (gRlvHandler.getCurrentCommand()) && (RLV_BHVR_TPTO == gRlvHandler.getCurrentCommand()->getBehaviourType()) ) + { + gRlvHandler.setCanCancelTp(false); + } } // [/RLVa:KB] @@ -6300,7 +6319,7 @@ void LLAgent::setTeleportState(ETeleportState state) // We're outa here. Save "back" slurl. mTeleportSourceSLURL = getSLURL(); } -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Version: 1.23.4 | Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b if ( (rlv_handler_t::isEnabled()) && (TELEPORT_NONE == mTeleportState) ) { gRlvHandler.setCanCancelTp(true); @@ -6943,14 +6962,14 @@ void LLAgent::processAgentInitialWearablesUpdate( LLMessageSystem* mesgsys, void } // now that we have the asset ids...request the wearable assets -// [RLVa:KB] - Checked: 2009-08-08 (RLVa-1.0.1g) | Added: RLVa-1.0.1g +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-08-08 (RLVa-1.0.1g) | Added: RLVa-1.0.1g LLInventoryFetchObserver::item_ref_t rlvItems; // [/RLVa:KB] for( i = 0; i < WT_COUNT; i++ ) { if( !gAgent.mWearableEntry[i].mItemID.isNull() ) { -// [RLVa:KB] - Checked: 2009-08-08 (RLVa-1.0.1g) | Added: RLVa-1.0.1g +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-08-08 (RLVa-1.0.1g) | Added: RLVa-1.0.1g if (rlv_handler_t::isEnabled()) rlvItems.push_back(gAgent.mWearableEntry[i].mItemID); // [/RLVa:KB] @@ -6962,7 +6981,7 @@ void LLAgent::processAgentInitialWearablesUpdate( LLMessageSystem* mesgsys, void } } -// [RLVa:KB] - Checked: 2009-08-08 (RLVa-1.0.1g) | Added: RLVa-1.0.1g +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-08-08 (RLVa-1.0.1g) | Added: RLVa-1.0.1g // TODO-RLVa: checking that we're in STATE_STARTED is probably not needed, but leave it until we can be absolutely sure if ( (rlv_handler_t::isEnabled()) && (LLStartUp::getStartupState() == STATE_STARTED) ) { @@ -7949,93 +7968,37 @@ void LLAgent::userRemoveAllAttachments( void* userdata ) return; } -// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a - // NOTE-RLVa: This function is called from inside RlvHandler as well, hence the rather heavy modifications - std::list rlvAttachments; - // TODO-RLVa: Once we have the improved "removeWearable" logic implemented we can just get rid of the whole "rlvCompFolders" hassle - #ifdef RLV_EXPERIMENTAL_COMPOSITES - std::list rlvCompFolders; - #endif // RLV_EXPERIMENTAL_COMPOSITES - - for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); - iter != avatarp->mAttachmentPoints.end(); ) +// [RLVa:KB] - Checked: 2009-11-24 (RLVa-1.1.0f) | Modified: RLVa-1.1.0e + std::list LocalIDs; + for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); iter != avatarp->mAttachmentPoints.end(); ) { LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; LLViewerObject* objectp = attachment->getObject(); if (objectp) { - if (rlv_handler_t::isEnabled()) - { - if (gRlvHandler.isLockedAttachment(curiter->first, RLV_LOCK_REMOVE)) - continue; - - // Check if we're being called in response to an RLV command (that would be @detach=force) - if ( (gRlvHandler.getCurrentCommand()) && (attachment->getItemID().notNull()) ) - { - if (!gRlvHandler.isStrippable(attachment->getItemID())) // "nostrip" can be taken off by the user but not @detach - continue; - - #ifdef RLV_EXPERIMENTAL_COMPOSITES - LLViewerInventoryCategory* pFolder; - if (gRlvHandler.getCompositeInfo(attachment->getItemID(), NULL, &pFolder)) - { - #ifdef RLV_EXPERIMENTAL_COMPOSITE_LOCKING - if (!gRlvHandler.canTakeOffComposite(pFolder)) - continue; - #endif // RLV_EXPERIMENTAL_COMPOSITE_LOCKING - - // The attachment belongs to a composite folder so there may be additional things we need to take off - if (std::find(rlvCompFolders.begin(), rlvCompFolders.end(), pFolder->getUUID()) != rlvCompFolders.end()) - rlvCompFolders.push_back(pFolder->getUUID()); - } - #endif // RLV_EXPERIMENTAL_COMPOSITES - } - } - rlvAttachments.push_back(objectp->getLocalID()); + if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.isLockedAttachment(curiter->first, RLV_LOCK_REMOVE)) ) + continue; + LocalIDs.push_back(objectp->getLocalID()); } } // Only send the message if we actually have something to detach - if (rlvAttachments.size() > 0) + if (LocalIDs.size() > 0) { gMessageSystem->newMessage("ObjectDetach"); gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - for (std::list::const_iterator itAttach = rlvAttachments.begin(); itAttach != rlvAttachments.end(); ++itAttach) + for (std::list::const_iterator itLocalID = LocalIDs.begin(); itLocalID != LocalIDs.end(); ++itLocalID) { gMessageSystem->nextBlockFast(_PREHASH_ObjectData); - gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, *itAttach); + gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, *itLocalID); } - gMessageSystem->sendReliable( gAgent.getRegionHost() ); + gMessageSystem->sendReliable(gAgent.getRegionHost()); } - - #ifdef RLV_EXPERIMENTAL_COMPOSITES - if (rlv_handler_t::isEnabled) - { - // If we encountered any composite folders then we need to @detach all of them - for (std::list::const_iterator itFolder = rlvCompFolders.begin(); itFolder != rlvCompFolders.end(); ++itFolder) - { - std::string strFolder = gRlvHandler.getSharedPath(*itFolder); - - // It shouldn't happen but make absolutely sure that we don't issue @detach:=force and reenter this function - if (!strFolder.empty()) - { - std::string strCmd = "detach:" + strFolder + "=force"; - #ifdef RLV_DEBUG - RLV_INFOS << "\t- detaching composite folder: @" << strCmd << LL_ENDL; - #endif // RLV_DEBUG - - // HACK-RLV: executing a command while another command is currently executing isn't the best thing to do, however - // in this specific case it is safe (and still better than making processForceCommand public) - gRlvHandler.processCommand(gRlvHandler.getCurrentObject(), strCmd); - } - } - } - #endif // RLV_EXPERIMENTAL_COMPOSITES // [/RLVa:KB] } diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h index f1cad9c..141c72c 100644 --- a/linden/indra/newview/llagent.h +++ b/linden/indra/newview/llagent.h @@ -69,10 +69,6 @@ #include "llfollowcam.h" // end Ventrella -// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) -#include "rlvhandler.h" -// [/RLVa:KB] - const U8 AGENT_STATE_TYPING = 0x04; // Typing indication const U8 AGENT_STATE_EDITING = 0x10; // Set when agent has objects selected diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 96fc451..76488fb 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -178,6 +178,10 @@ #include "hippoLimits.h" #include "hippoUpdate.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + // *FIX: These extern globals should be cleaned up. // The globals either represent state/config/resource-storage of either // this app, or another 'component' of the viewer. App globals should be @@ -328,7 +332,15 @@ static std::string gHelperURI; void idle_afk_check() { // check idle timers + //if (gAllowIdleAFK && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getF32("AFKTimeout"))) +// [RLVa:KB] - Checked: 2009-10-19 (RLVa-1.1.0g) | Added: RLVa-1.1.0g +#ifdef RLV_EXTENSION_CMD_ALLOWIDLE + if ( (gAllowIdleAFK || gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) && + (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getF32("AFKTimeout"))) +#else if (gAllowIdleAFK && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getF32("AFKTimeout"))) +#endif // RLV_EXTENSION_CMD_ALLOWIDLE +// [/RLVa:KB] { gAgent.setAFK(); } @@ -4230,7 +4242,7 @@ void LLAppViewer::handleLoginComplete() } writeDebugInfo(); -// [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e // NOTE: this function isn't called in Imprudence so any changes need to go in idle_startup() instead gRlvHandler.initLookupTables(); diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp index a22fd8f..19ac2ab 100644 --- a/linden/indra/newview/llchatbar.cpp +++ b/linden/indra/newview/llchatbar.cpp @@ -88,6 +88,9 @@ void toggleChatHistory(void* user_data); void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channel); // [/RLVa:KB] +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] class LLChatBarGestureObserver : public LLGestureManagerObserver { @@ -788,7 +791,7 @@ void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL utf8_text = utf8str_truncate(utf8_text, MAX_STRING - 1); } -// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | Modified: RLVa-0.2.0b +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.1.1a) | Modified: RLVa-1.2.0b if ( (0 == channel) && (rlv_handler_t::isEnabled()) ) { // Adjust the (public) chat "volume" on chat and gestures (also takes care of playing the proper animation) @@ -799,7 +802,7 @@ void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL else if ( (CHAT_TYPE_WHISPER == type) && (gRlvHandler.hasBehaviour(RLV_BHVR_CHATWHISPER)) ) type = CHAT_TYPE_NORMAL; - animate &= !gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT); + animate &= !gRlvHandler.hasBehaviour( (!rlvIsEmote(utf8_text)) ? RLV_BHVR_REDIRCHAT : RLV_BHVR_REDIREMOTE ); } // [/RLVa:KB] @@ -843,7 +846,7 @@ void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channel) // [/RLVa:KB] { -// [RLVa:KB] - Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.1.1a) | Modified: RLVa-1.2.0a // Only process chat messages (ie not CHAT_TYPE_START, CHAT_TYPE_STOP, etc) if ( (rlv_handler_t::isEnabled()) && ( (CHAT_TYPE_WHISPER == type) || (CHAT_TYPE_NORMAL == type) || (CHAT_TYPE_SHOUT == type) ) ) { @@ -864,8 +867,8 @@ void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channe return; } - // Filter public chat if sendchat restricted (and filter anything that redirchat didn't redirect) - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHAT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_REDIRCHAT)) ) + // Filter public chat if sendchat restricted + if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHAT)) gRlvHandler.filterChat(utf8_out_text, true); } else @@ -875,7 +878,7 @@ void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channe return; // Don't allow chat on debug channel if @sendchat, @redirchat or @rediremote restricted (shows as public chat on viewers) - if (channel >= CHAT_CHANNEL_DEBUG) + if (CHAT_CHANNEL_DEBUG == channel) { bool fIsEmote = rlvIsEmote(utf8_out_text); if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHAT)) || diff --git a/linden/indra/newview/llfirstuse.cpp b/linden/indra/newview/llfirstuse.cpp index e82aa96..0b777ea 100644 --- a/linden/indra/newview/llfirstuse.cpp +++ b/linden/indra/newview/llfirstuse.cpp @@ -328,21 +328,6 @@ void LLFirstUse::showRlvFirstUseNotification(const std::string& strName) } } -void LLFirstUse::warnRlvGiveToRLV() -{ - if ( (gSavedSettings.getWarning(RLV_SETTING_FIRSTUSE_GIVETORLV)) && (RlvSettings::getForbidGiveToRLV()) ) - LLNotifications::instance().add(RLV_SETTING_FIRSTUSE_GIVETORLV, LLSD(), LLSD(), &LLFirstUse::onRlvGiveToRLVConfirmation); -} - -void LLFirstUse::onRlvGiveToRLVConfirmation(const LLSD& notification, const LLSD& response) -{ - gSavedSettings.setWarning(RLV_SETTING_FIRSTUSE_GIVETORLV, FALSE); - - S32 idxOption = LLNotification::getSelectedOption(notification, response); - if ( (0 == idxOption) || (1 == idxOption) ) - gSavedSettings.setBOOL(RLV_SETTING_FORBIDGIVETORLV, (idxOption == 1)); -} - // [/RLVa:KB] void LLFirstUse::callbackClientTags(const LLSD& notification, const LLSD& response) diff --git a/linden/indra/newview/llfirstuse.h b/linden/indra/newview/llfirstuse.h index b0bf05f..42443ff 100644 --- a/linden/indra/newview/llfirstuse.h +++ b/linden/indra/newview/llfirstuse.h @@ -127,10 +127,6 @@ public: static void useRlvDetach() { showRlvFirstUseNotification(RLV_SETTING_FIRSTUSE_DETACH); } static void useRlvEnableWear() { showRlvFirstUseNotification(RLV_SETTING_FIRSTUSE_ENABLEWEAR); } static void useRlvFartouch() { showRlvFirstUseNotification(RLV_SETTING_FIRSTUSE_FARTOUCH); } - - static void warnRlvGiveToRLV(); -protected: - static void onRlvGiveToRLVConfirmation(const LLSD& notification, const LLSD& response); // [/RLVa:KB] }; diff --git a/linden/indra/newview/llfloaterabout.cpp b/linden/indra/newview/llfloaterabout.cpp index 900f6e7..9870cf0 100644 --- a/linden/indra/newview/llfloaterabout.cpp +++ b/linden/indra/newview/llfloaterabout.cpp @@ -61,6 +61,10 @@ #include "llwindow.h" #include "viewerversion.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + #if LL_WINDOWS #include "lldxhardware.h" #endif @@ -142,7 +146,7 @@ LLFloaterAbout::LLFloaterAbout() // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { - support.append(rlv_handler_t::cstrHidden); + support.append(RlvStrings::getString(RLV_STRING_HIDDEN)); support.append("\n\n"); } else if (region) diff --git a/linden/indra/newview/llfloateractivespeakers.cpp b/linden/indra/newview/llfloateractivespeakers.cpp index 51e7b89..59de717 100644 --- a/linden/indra/newview/llfloateractivespeakers.cpp +++ b/linden/indra/newview/llfloateractivespeakers.cpp @@ -51,6 +51,10 @@ #include "llworld.h" #include "llappviewer.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + const F32 SPEAKER_TIMEOUT = 10.f; // seconds of not being on voice channel before removed from list of active speakers const F32 RESORT_TIMEOUT = 5.f; // seconds of mouse inactivity before it's ok to sort regardless of mouse-in-view. const LLColor4 INACTIVE_COLOR(0.3f, 0.3f, 0.3f, 0.5f); @@ -103,7 +107,7 @@ void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, c // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-1.0.0g // TODO-RLVa: this seems to get called per frame which is very likely an LL bug that will eventuall get fixed if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) - speaker_ptr->mDisplayName = gRlvHandler.getAnonym(speaker_ptr->mDisplayName); + speaker_ptr->mDisplayName = RlvStrings::getAnonym(speaker_ptr->mDisplayName); // [/RLVa:KB] } } diff --git a/linden/indra/newview/llfloateranimpreview.cpp b/linden/indra/newview/llfloateranimpreview.cpp index da1d5fc..09d3b2c 100644 --- a/linden/indra/newview/llfloateranimpreview.cpp +++ b/linden/indra/newview/llfloateranimpreview.cpp @@ -60,6 +60,7 @@ #include "lltoolmgr.h" #include "llui.h" #include "llviewercamera.h" +#include "llviewercontrol.h" #include "llviewerobjectlist.h" #include "llviewerwindow.h" #include "llviewermenufile.h" // upload_new_resource() diff --git a/linden/indra/newview/llfloateravatarpicker.cpp b/linden/indra/newview/llfloateravatarpicker.cpp index 4eca8af..1788481 100644 --- a/linden/indra/newview/llfloateravatarpicker.cpp +++ b/linden/indra/newview/llfloateravatarpicker.cpp @@ -48,6 +48,10 @@ #include "llviewercontrol.h" #include "llworld.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + const S32 MIN_WIDTH = 200; const S32 MIN_HEIGHT = 340; const LLRect FLOATER_RECT(0, 380, 240, 0); diff --git a/linden/indra/newview/llfloaterbeacons.cpp b/linden/indra/newview/llfloaterbeacons.cpp index 5a5de77..aa89780 100644 --- a/linden/indra/newview/llfloaterbeacons.cpp +++ b/linden/indra/newview/llfloaterbeacons.cpp @@ -38,8 +38,8 @@ #include "llcheckboxctrl.h" #include "pipeline.h" -// [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) -#include "llagent.h" +// [RLVa:KB] +#include "rlvhandler.h" // [/RLVa:KB] LLFloaterBeacons::LLFloaterBeacons(const LLSD& seed) diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index 59f4d70..3f0b184 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp @@ -91,6 +91,10 @@ const F32 CHAT_MSG_SIZE = 8.0f; const LLColor4 MUTED_MSG_COLOR(0.5f, 0.5f, 0.5f, 1.f); const S32 MAX_CHATTER_COUNT = 16; +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + // // Global statics // diff --git a/linden/indra/newview/llfloaterinspect.cpp b/linden/indra/newview/llfloaterinspect.cpp index 4822bb0..51c7835 100644 --- a/linden/indra/newview/llfloaterinspect.cpp +++ b/linden/indra/newview/llfloaterinspect.cpp @@ -43,7 +43,7 @@ #include "llviewerobject.h" #include "lluictrlfactory.h" -// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) +// [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -241,7 +241,7 @@ void LLFloaterInspect::refresh() if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { // TODO-RLVa: shouldn't filter if this is a group-owned prim (will show "(nobody)") - owner_name = gRlvHandler.getAnonym(owner_name); + owner_name = RlvStrings::getAnonym(owner_name); } // [/RLVa:KB] gCacheName->getFullName(obj->mPermissions->getCreator(), creator_name); diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp index 066b739..7dd4f8d 100644 --- a/linden/indra/newview/llfloaterland.cpp +++ b/linden/indra/newview/llfloaterland.cpp @@ -78,6 +78,10 @@ #include "hippoGridManager.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + static std::string OWNER_ONLINE = "0"; static std::string OWNER_OFFLINE = "1"; static std::string OWNER_GROUP = "2"; diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp index b56fb5f..c15678d 100644 --- a/linden/indra/newview/llfloatermap.cpp +++ b/linden/indra/newview/llfloatermap.cpp @@ -46,6 +46,10 @@ #include "panelradar.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + LLFloaterMap::LLFloaterMap(const LLSD& key) : LLFloater(std::string("minimap")), diff --git a/linden/indra/newview/llfloaterobjectiminfo.cpp b/linden/indra/newview/llfloaterobjectiminfo.cpp index fa7964c..06e6213 100644 --- a/linden/indra/newview/llfloaterobjectiminfo.cpp +++ b/linden/indra/newview/llfloaterobjectiminfo.cpp @@ -47,7 +47,7 @@ #include "llurldispatcher.h" #include "llviewercontrol.h" -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-0.2.0g +// [RLVa:KB] - Version: 1.23.4 #include "rlvhandler.h" // [/RLVa:KB] @@ -190,7 +190,7 @@ void LLFloaterObjectIMInfo::nameCallback(const LLUUID& id, const std::string& fi // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g if ( (!is_group) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(id)) ) { - self->mOwnerName = gRlvHandler.getAnonym(self->mOwnerName); + self->mOwnerName = RlvStrings::getAnonym(self->mOwnerName); } // [/RLVa:KB] diff --git a/linden/indra/newview/llfloaterproperties.cpp b/linden/indra/newview/llfloaterproperties.cpp index 7dc6e42..40b293a 100644 --- a/linden/indra/newview/llfloaterproperties.cpp +++ b/linden/indra/newview/llfloaterproperties.cpp @@ -61,6 +61,9 @@ #include "hippoGridManager.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLPropertiesObserver @@ -362,7 +365,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { - name = gRlvHandler.getAnonym(name); + name = RlvStrings::getAnonym(name); } // [/RLVa:KB] } diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp index 08d845b..deee0f6 100644 --- a/linden/indra/newview/llfloaterregioninfo.cpp +++ b/linden/indra/newview/llfloaterregioninfo.cpp @@ -81,6 +81,10 @@ #include "llviewerwindow.h" #include "llvlcomposition.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + #define ELAR_ENABLED 0 // Enable when server support is implemented const S32 TERRAIN_TEXTURE_COUNT = 4; diff --git a/linden/indra/newview/llfloaterreporter.cpp b/linden/indra/newview/llfloaterreporter.cpp index a7f41ea..50e2480 100644 --- a/linden/indra/newview/llfloaterreporter.cpp +++ b/linden/indra/newview/llfloaterreporter.cpp @@ -84,6 +84,10 @@ #include "llassetuploadresponders.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + const U32 INCLUDE_SCREENSHOT = 0x01 << 0; //----------------------------------------------------------------------------- @@ -319,7 +323,7 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id) // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) { - childSetText("sim_field", rlv_handler_t::cstrHiddenRegion); + childSetText("sim_field", RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); } // [/RLVa:KB] LLVector3d global_pos; diff --git a/linden/indra/newview/llfloatersettingsdebug.cpp b/linden/indra/newview/llfloatersettingsdebug.cpp index fd6c47b..0aa0607 100644 --- a/linden/indra/newview/llfloatersettingsdebug.cpp +++ b/linden/indra/newview/llfloatersettingsdebug.cpp @@ -40,7 +40,7 @@ #include "llcolorswatch.h" #include "llviewercontrol.h" -// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0g) +// [RLVa:KB] #include "rlvhandler.h" #include "rlvextensions.h" // [/RLVa:KB] @@ -258,7 +258,7 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) fEnable &= !((gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) && (("VertexShaderEnable" == controlp->getName()) || ("WindLightUseAtmosShaders" == controlp->getName()))); #ifdef RLV_EXTENSION_STARTLOCATION - // Don't allow toggling RestrainedLifeLoginLastLocation + // Don't allow toggling RLVaLoginLastLocation fEnable &= !(RLV_SETTING_LOGINLASTLOCATION == controlp->getName()); #endif // RLV_EXTENSION_STARTLOCATION diff --git a/linden/indra/newview/llfloaterteleporthistory.cpp b/linden/indra/newview/llfloaterteleporthistory.cpp index 70a2d71..65675fa 100644 --- a/linden/indra/newview/llfloaterteleporthistory.cpp +++ b/linden/indra/newview/llfloaterteleporthistory.cpp @@ -204,23 +204,13 @@ void LLFloaterTeleportHistory::addEntry(std::string regionName, S16 x, S16 y, S1 value["columns"][4]["value"] = simString; value["out"]=outList; -// [RLVa:KB] - Alternate: Emerald-370 +// [RLVa:KB] - Alternate: Imprudence-1.4 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { - // TODO: This is the original code from Emerald. It - // uses the class RlvStrings, defined in rlvcommon.cpp - // to load localized strings. For Imprudence we use the - // old fashioned way via RlvHandler with English - // strings only! - // value["columns"][0]["value"] = RlvStrings::getString(RLV_STRING_HIDDEN_REGION); - // value["columns"][1]["value"] = RlvStrings::getString(RLV_STRING_HIDDEN); - // value["columns"][3]["value"] = RlvStrings::getString(RLV_STRING_HIDDEN); - // value["columns"][4]["value"] = RlvStrings::getString(RLV_STRING_HIDDEN); - - value["columns"][0]["value"] = RlvHandler::cstrHiddenRegion; - value["columns"][1]["value"] = RlvHandler::cstrHidden; - value["columns"][3]["value"] = RlvHandler::cstrHidden; - value["columns"][4]["value"] = RlvHandler::cstrHidden; + value["columns"][0]["value"] = RlvStrings::getString(RLV_STRING_HIDDEN_REGION); + value["columns"][1]["value"] = RlvStrings::getString(RLV_STRING_HIDDEN); + value["columns"][3]["value"] = RlvStrings::getString(RLV_STRING_HIDDEN); + value["columns"][4]["value"] = RlvStrings::getString(RLV_STRING_HIDDEN); } // [/RLVa:KB] saveEntry(value); @@ -238,16 +228,10 @@ void LLFloaterTeleportHistory::addEntry(std::string regionName, S16 x, S16 y, S1 void LLFloaterTeleportHistory::setButtonsEnabled(BOOL on) { -// [RLVa:KB] - Alternate: Emerald-370 +// [RLVa:KB] - Alternate: Imprudence-1.4 if (rlv_handler_t::isEnabled()) { - // TODO: This is the original code from Emerald. It - // uses the class RlvStrings, defined in rlvcommon.cpp - // to load localized strings. For Imprudence we use the - // old fashioned way via RlvHandler with English - // strings only! - //if ( (pItem) && (pItem->getColumn(4)) && (RlvStrings::getString(RLV_STRING_HIDDEN) == pItem->getColumn(4)->getValue().asString()) ) - if ( (pItem) && (pItem->getColumn(4)) && (RlvHandler::cstrHidden == pItem->getColumn(4)->getValue().asString()) ) + if ( (pItem) && (pItem->getColumn(4)) && (RlvStrings::getString(RLV_STRING_HIDDEN) == pItem->getColumn(4)->getValue().asString()) ) { on = FALSE; } diff --git a/linden/indra/newview/llfloaterworldmap.cpp b/linden/indra/newview/llfloaterworldmap.cpp index 781cf4d..0a01ca7 100644 --- a/linden/indra/newview/llfloaterworldmap.cpp +++ b/linden/indra/newview/llfloaterworldmap.cpp @@ -72,6 +72,10 @@ #include "hippoLimits.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + //--------------------------------------------------------------------------- // Constants //--------------------------------------------------------------------------- @@ -661,8 +665,8 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); std::string full_name = llformat("%s (%d, %d, %d)", // sim_name.c_str(), -// [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-07-04 (RLVa-1.0.0a) - (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? sim_name.c_str() : rlv_handler_t::cstrHiddenRegion.c_str(), +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-04 (RLVa-1.0.0a) + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? sim_name.c_str() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION).c_str(), // [/RLVa:KB] llround(region_x), llround(region_y), @@ -721,7 +725,7 @@ void LLFloaterWorldMap::updateLocation() // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { - childSetValue("location", rlv_handler_t::cstrHiddenRegion); + childSetValue("location", RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); mSLURL.clear(); } // [/RLVa:KB] @@ -771,7 +775,7 @@ void LLFloaterWorldMap::updateLocation() // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { - childSetValue("location", rlv_handler_t::cstrHiddenRegion); + childSetValue("location", RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); mSLURL.clear(); } // [/RLVa:KB] diff --git a/linden/indra/newview/llgesturemgr.cpp b/linden/indra/newview/llgesturemgr.cpp index 2203452..c3f7b93 100644 --- a/linden/indra/newview/llgesturemgr.cpp +++ b/linden/indra/newview/llgesturemgr.cpp @@ -58,6 +58,7 @@ #include "llpreviewtexture.h" #include "llviewermessage.h" #include "llvoavatar.h" +#include "llviewercontrol.h" #include "llviewerimagelist.h" #include "llviewerstats.h" #include "llweb.h" diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp index 3acfbf3..a487150 100644 --- a/linden/indra/newview/llglsandbox.cpp +++ b/linden/indra/newview/llglsandbox.cpp @@ -69,6 +69,10 @@ #include "pipeline.h" #include "llspatialpartition.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + BOOL LLAgent::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVector3 position) { if(object && object->isAttachment()) @@ -168,8 +172,8 @@ extern BOOL gDebugSelect; // Returns true if you got at least one object void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) { -// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0b) - if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT))) ) { return; } diff --git a/linden/indra/newview/llhoverview.cpp b/linden/indra/newview/llhoverview.cpp index 6367380..120bbaa 100644 --- a/linden/indra/newview/llhoverview.cpp +++ b/linden/indra/newview/llhoverview.cpp @@ -75,6 +75,10 @@ #include "hippoGridManager.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + // // Constants // @@ -251,7 +255,7 @@ void LLHoverView::updateText() // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { - line = gRlvHandler.getAnonym(line.append(firstname->getString()).append(1, ' ').append(lastname->getString())); + line = RlvStrings::getAnonym(line.append(firstname->getString()).append(1, ' ').append(lastname->getString())); } else { @@ -350,7 +354,7 @@ void LLHoverView::updateText() // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { - name = gRlvHandler.getAnonym(name); + name = RlvStrings::getAnonym(name); } // [/RLVa:KB] @@ -538,7 +542,8 @@ void LLHoverView::updateText() if (hover_parcel) { // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-0.2.0b - line.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? hover_parcel->getName() : rlv_handler_t::cstrHiddenParcel ); + line.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + ? hover_parcel->getName() : RlvStrings::getString(RLV_STRING_HIDDEN_PARCEL) ); // [/RLVa:KB] //line.append(hover_parcel->getName()); } @@ -570,7 +575,7 @@ void LLHoverView::updateText() else if(gCacheName->getFullName(owner, name)) { // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b - line.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? name : gRlvHandler.getAnonym(name)); + line.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? name : RlvStrings::getAnonym(name)); // [/RLVa:KB] //line.append(name); } @@ -683,7 +688,14 @@ void LLHoverView::draw() // To toggle off hover tips, you have to just suppress the draw. // The picking is still needed to do cursor changes over physical // and scripted objects. JC +// if (!sShowHoverTips) +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l +#ifdef RLV_EXTENSION_CMD_INTERACT + if ( (!sShowHoverTips) || (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) ) +#else if (!sShowHoverTips) +#endif // RLV_EXTENSION_CMD_INTERACT +// [/RLVa:KB] { return; } diff --git a/linden/indra/newview/llhudeffectlookat.cpp b/linden/indra/newview/llhudeffectlookat.cpp index 2c0431b..75e2f30 100644 --- a/linden/indra/newview/llhudeffectlookat.cpp +++ b/linden/indra/newview/llhudeffectlookat.cpp @@ -48,6 +48,9 @@ #include "llselectmgr.h" #include "llglheaders.h" #include "llresmgr.h" +// [RLVa:KB] - Imprudence-1.3.0 +#include "rlvhandler.h" +// [/RLVa:KB] #include "llxmltree.h" @@ -599,7 +602,7 @@ void LLHUDEffectLookAt::render() // Show anonyms in place of actual names when @shownames=n restricted if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { - text = gRlvHandler.getAnonym(text); + text = RlvStrings::getAnonym(text); } // [/RLVa:KB] diff --git a/linden/indra/newview/llhudtext.cpp b/linden/indra/newview/llhudtext.cpp index 7d9f7f9..7c0c469 100644 --- a/linden/indra/newview/llhudtext.cpp +++ b/linden/indra/newview/llhudtext.cpp @@ -57,6 +57,9 @@ #include "pipeline.h" #include +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] const F32 SPRING_STRENGTH = 0.7f; const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f; diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index 808a2c9..d9e822f 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp @@ -79,6 +79,10 @@ #include "llstylemap.h" #include +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + // // Constants // @@ -2115,18 +2119,18 @@ void LLFloaterIMPanel::sendMsg() // Truncate and convert to UTF8 for transport utf8_text = utf8str_truncate(utf8_text, MAX_MSG_BUF_SIZE - 1); -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g if (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) { if (IM_NOTHING_SPECIAL == mDialog) // One-on-one IM: allow if recipient is a sendim exception { if (!gRlvHandler.isException(RLV_BHVR_SENDIM, mOtherParticipantUUID)) - utf8_text = rlv_handler_t::cstrBlockedSendIM; + utf8_text = RlvStrings::getString(RLV_STRING_BLOCKED_SENDIM); } else if (gAgent.isInGroup(mSessionUUID)) // Group chat: allow if recipient is a sendim exception { if (!gRlvHandler.isException(RLV_BHVR_SENDIM, mSessionUUID)) - utf8_text = rlv_handler_t::cstrBlockedSendIM; + utf8_text = RlvStrings::getString(RLV_STRING_BLOCKED_SENDIM); } else if (mSpeakers) // Conference chat: allow if all participants are sendim exceptions { @@ -2139,14 +2143,14 @@ void LLFloaterIMPanel::sendMsg() LLSpeaker* pSpeaker = *itSpeaker; if ( (gAgent.getID() != pSpeaker->mID) && (!gRlvHandler.isException(RLV_BHVR_SENDIM, pSpeaker->mID)) ) { - utf8_text = rlv_handler_t::cstrBlockedSendIM; + utf8_text = RlvStrings::getString(RLV_STRING_BLOCKED_SENDIM); break; } } } else // Catch all fall-through { - utf8_text = rlv_handler_t::cstrBlockedSendIM; + utf8_text = RlvStrings::getString(RLV_STRING_BLOCKED_SENDIM); } } // [/RLVa:KB] diff --git a/linden/indra/newview/llimview.cpp b/linden/indra/newview/llimview.cpp index a6eaeb3..5061197 100644 --- a/linden/indra/newview/llimview.cpp +++ b/linden/indra/newview/llimview.cpp @@ -71,6 +71,10 @@ #include "llfirstuse.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + // // Globals // @@ -1682,7 +1686,7 @@ public: return; } else if (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) - message = message.substr(0, message_offset) + rlv_handler_t::cstrBlockedRecvIM; + message = message.substr(0, message_offset) + RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM); } // [/RLVa:KB] diff --git a/linden/indra/newview/llinventoryactions.cpp b/linden/indra/newview/llinventoryactions.cpp index f3277ad..7ae96ad 100644 --- a/linden/indra/newview/llinventoryactions.cpp +++ b/linden/indra/newview/llinventoryactions.cpp @@ -89,6 +89,9 @@ // Defined in llinventorybridge.cpp void wear_attachments_on_avatar(const std::set& item_ids, BOOL remove); +// Defined in llinventorybridge.cpp +void wear_attachments_on_avatar(const std::set& item_ids, BOOL remove); + const std::string NEW_LSL_NAME = "New Script"; // *TODO:Translate? (probably not) const std::string NEW_NOTECARD_NAME = "New Note"; // *TODO:Translate? (probably not) const std::string NEW_GESTURE_NAME = "New Gesture"; // *TODO:Translate? (probably not) @@ -125,6 +128,12 @@ bool doToSelected(LLFolderView* folder, std::string action) return true; } + if ( ("attach" == action) && (selected_items.size() > 1) ) + { + wear_attachments_on_avatar(selected_items, FALSE); + return true; + } + LLMultiPreview* multi_previewp = NULL; LLMultiProperties* multi_propertiesp = NULL; diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index 0f999fc..b1627b5 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp @@ -94,6 +94,10 @@ #include "llfloateropenobject.h" #include "llwlparammanager.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + // Helpers // bug in busy count inc/dec right now, logic is complex... do we really need it? void inc_busy_count() @@ -164,7 +168,9 @@ struct LLWearInfo BOOL mAppend; }; -BOOL gAddToOutfit = FALSE; +// [RLVa:KB] - Made this part of LLWearableHoldingPattern +//BOOL gAddToOutfit = FALSE; +// [/RLVa:KB] // +=================================================+ // | LLInvFVBridge | @@ -498,14 +504,14 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Open")); items.push_back(std::string("Properties")); -// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Modified: RLVa-1.0.5c +// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a if (rlv_handler_t::isEnabled()) { LLInventoryObject* pItem = (mInventoryPanel->getModel()) ? mInventoryPanel->getModel()->getObject(mUUID) : NULL; if ( (pItem) && ( ((LLAssetType::AT_NOTECARD == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE))) || ((LLAssetType::AT_LSL_TEXT == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT))) || - ((LLAssetType::AT_NOTECARD == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE))) ) ) + ((LLAssetType::AT_TEXTURE == pItem->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE))) ) ) { disabled_items.push_back(std::string("Open")); } @@ -2503,9 +2509,10 @@ void open_texture(const LLUUID& item_id, const LLUUID& source_id, BOOL take_focus) { -// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Added: RLVa-1.0.5c +// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE)) { + RlvNotifications::notifyBlockedViewTexture(); return; } // [/RLVa:KB] @@ -3008,9 +3015,10 @@ void open_notecard(LLViewerInventoryItem* inv_item, const LLUUID& source_id, BOOL take_focus) { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) ) +// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a + if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) { + RlvNotifications::notifyBlockedViewNote(); return; } // [/RLVa:KB] @@ -3867,9 +3875,10 @@ LLUIImagePtr LLLSLTextBridge::getIcon() const void LLLSLTextBridge::openItem() { -// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Modified: RLVa-1.0.5c +// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT)) { + RlvNotifications::notifyBlockedViewScript(); return; } // [/RLVa:KB] @@ -3917,6 +3926,9 @@ void wear_inventory_item_on_avatar( LLInventoryItem* item ) } } +// [RLVa:KB] - Checked: 2009-12-18 (RLVa-1.1.0i) | Added: RLVa-1.1.0i +// Moved to llinventorybridge.h because we need it in RlvForceWear +/* struct LLFoundData { LLFoundData(const LLUUID& item_id, @@ -3948,7 +3960,8 @@ struct LLWearableHoldingPattern found_list_t mFoundList; S32 mResolved; }; - +*/ +// [/RLVa:KB] class LLOutfitObserver : public LLInventoryFetchObserver { @@ -4376,7 +4389,10 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) // wearables can be resolved immediately, then the // callback will be called (and this object deleted) // before the final getNextData(). - LLWearableHoldingPattern* holder = new LLWearableHoldingPattern; +// LLWearableHoldingPattern* holder = new LLWearableHoldingPattern; +// [RLVa:KB] - Checked: 2009-12-18 (RLVa-1.1.0i) | Added: RLVa-1.1.0i + LLWearableHoldingPattern* holder = new LLWearableHoldingPattern(wear_info->mAppend); +// [/RLVa:KB] LLFoundData* found; LLDynamicArray found_container; for(i = 0; i < wearable_count; ++i) @@ -4390,7 +4406,9 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) } for(i = 0; i < wearable_count; ++i) { - gAddToOutfit = wear_info->mAppend; +// [RLVa:KB] - Part of LLWearableHoldingPattern +// gAddToOutfit = wear_info->mAppend; +// [/RLVa:KB] found = found_container.get(i); gWearableList.getAsset(found->mAssetID, @@ -4422,7 +4440,9 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) void wear_inventory_category_on_avatar_loop(LLWearable* wearable, void* data) { LLWearableHoldingPattern* holder = (LLWearableHoldingPattern*)data; - BOOL append= gAddToOutfit; +// [RLVa:KB] - Part of LLWearableHoldingPattern +// BOOL append= gAddToOutfit; +// [/RLVa:KB] if(wearable) { @@ -4440,7 +4460,10 @@ void wear_inventory_category_on_avatar_loop(LLWearable* wearable, void* data) holder->mResolved += 1; if(holder->mResolved >= (S32)holder->mFoundList.size()) { - wear_inventory_category_on_avatar_step3(holder, append); +// wear_inventory_category_on_avatar_step3(holder, append); +// [RLVa:KB] - Checked: 2009-12-18 (RLVa-1.1.0i) | Added: RLVa-1.1.0i + wear_inventory_category_on_avatar_step3(holder, holder->mAddToOutfit); +// [/RLVa:KB] } } @@ -4595,7 +4618,7 @@ void wear_attachments_on_avatar(const LLInventoryModel::item_array_t& items, BOO msg->nextBlockFast(_PREHASH_HeaderData); msg->addUUIDFast(_PREHASH_CompoundMsgID, compound_msg_id ); msg->addU8Fast(_PREHASH_TotalObjects, count ); -// msg->addBOOLFast(_PREHASH_FirstDetachAll, remove ); +// msg->addBOOLFast(_PREHASH_FirstDetachAll, !wear_info->mAppend ); // [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Added: RLVa-1.0.5a // This really should just *always* be FALSE since TRUE can result in loss of the current asset state msg->addBOOLFast(_PREHASH_FirstDetachAll, @@ -4608,11 +4631,22 @@ void wear_attachments_on_avatar(const LLInventoryModel::item_array_t& items, BOO msg->addUUIDFast(_PREHASH_ItemID, item->getUUID() ); msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner()); // msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point -// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Added: RLVa-1.0.5a +// [RLVa:KB] - Checked: 2009-11-16 (RLVa-1.1.0c) | Modified: RLVa-1.1.0c + // We'll attach to the default attachment point if: + // - RLV isn't enabled (or nothing is currently locked on) + // - "Enable Default Wear" is checked and the current attach isn't the direct result of an RLV command + // - "Enable Shared Wear" is checked and the current attach is the direct result of an RLV command + // RELEASE-RLVa: make sure the above assertions are still valid msg->addU8Fast(_PREHASH_AttachmentPt, - ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) ) + ( (!rlv_handler_t::isEnabled()) || (!gRlvHandler.hasLockedAttachment(RLV_LOCK_ANY)) || +#ifndef RLV_WORKAROUND_REZMULTIPLEATTACH + ( (!gRlvHandler.getCurrentCommand()) && (RlvSettings::getEnableWear()) ) || + ( (gRlvHandler.getCurrentCommand()) && (RlvSettings::getEnableSharedWear()) ) ) +#else + (RlvSettings::getEnableWear()) ) +#endif // RLV_WORKAROUND_REZMULTIPLEATTACH ? 0 - : gRlvHandler.getAttachPointIndex(gRlvHandler.getAttachPoint(item, true))); + : gRlvHandler.getAttachPointIndex(gRlvHandler.getAttachPoint(item, true)) ); // [/RLVa:KB] pack_permissions_slam(msg, item->getFlags(), item->getPermissions()); msg->addStringFast(_PREHASH_Name, item->getName()); diff --git a/linden/indra/newview/llinventorybridge.h b/linden/indra/newview/llinventorybridge.h index d6001b7..45486ed 100644 --- a/linden/indra/newview/llinventorybridge.h +++ b/linden/indra/newview/llinventorybridge.h @@ -94,6 +94,41 @@ struct LLAttachmentRezAction S32 mAttachPt; }; +// [RLVa:KB] - Checked: 2009-12-18 (RLVa-1.1.0i) | Added: RLVa-1.1.0i +// Moved from llinventorybridge.cpp because we need it in RlvForceWear +struct LLFoundData +{ + LLFoundData(const LLUUID& item_id, + const LLUUID& asset_id, + const std::string& name, + LLAssetType::EType asset_type) : + mItemID(item_id), + mAssetID(asset_id), + mName(name), + mAssetType(asset_type), + mWearable( NULL ) {} + + LLUUID mItemID; + LLUUID mAssetID; + std::string mName; + LLAssetType::EType mAssetType; + LLWearable* mWearable; +}; + +struct LLWearableHoldingPattern +{ + LLWearableHoldingPattern(BOOL fAddToOutfit) : mResolved(0), mAddToOutfit(fAddToOutfit) {} + ~LLWearableHoldingPattern() + { + for_each(mFoundList.begin(), mFoundList.end(), DeletePointer()); + mFoundList.clear(); + } + typedef std::list found_list_t; + found_list_t mFoundList; + S32 mResolved; + BOOL mAddToOutfit; +}; +// [/RLVa:KB] //helper functions class LLShowProps diff --git a/linden/indra/newview/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp index c066a04..1c7a049 100644 --- a/linden/indra/newview/llinventorymodel.cpp +++ b/linden/indra/newview/llinventorymodel.cpp @@ -61,6 +61,10 @@ #include "llsdutil.h" #include +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + //#define DIFF_INVENTORY_FILES #ifdef DIFF_INVENTORY_FILES #include "process.h" diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index 939d50b..f8fb439 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp @@ -86,6 +86,10 @@ #include "llsdserialize.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + static LLRegisterWidget r("inventory_panel"); LLDynamicArray LLInventoryView::sActiveViews; diff --git a/linden/indra/newview/llmaniptranslate.cpp b/linden/indra/newview/llmaniptranslate.cpp index 1362f0a..01fe6f8 100644 --- a/linden/indra/newview/llmaniptranslate.cpp +++ b/linden/indra/newview/llmaniptranslate.cpp @@ -68,6 +68,10 @@ #include "hippoLimits.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + const S32 NUM_AXES = 3; const S32 MOUSE_DRAG_SLOP = 2; // pixels const F32 HANDLE_HIDE_ANGLE = 0.15f; // radians diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index 8a12ff3..dc4456a 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp @@ -73,6 +73,10 @@ #include "hippoLimits.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + const F32 MAP_SCALE_MIN = 32; const F32 MAP_SCALE_MID = 1024; //const F32 MAP_SCALE_MAX = 4096; Now uses the max height value from hippo limits @@ -640,14 +644,14 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rec { // msg.append(fullname); // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b - msg.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : gRlvHandler.getAnonym(fullname) ); + msg.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname) ); // [/RLVa:KB] msg.append("\n"); } // msg.append( region->getName() ); // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-0.2.0b - msg.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? region->getName() : rlv_handler_t::cstrHidden ); + msg.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? region->getName() : RlvStrings::getString(RLV_STRING_HIDDEN) ); // [/RLVa:KB] msg.append("\n"); gSavedSettings.getBOOL( "MiniMapTeleport" ) ? diff --git a/linden/indra/newview/llnotify.cpp b/linden/indra/newview/llnotify.cpp index 1a7b247..b0f5f91 100644 --- a/linden/indra/newview/llnotify.cpp +++ b/linden/indra/newview/llnotify.cpp @@ -57,7 +57,7 @@ #include "hippoGridManager.h" -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-10 (RLVa-1.0.0e) | Added: RLVa-0.2.0b +// [RLVa:KB] - Version: 1.23.4 #include "rlvhandler.h" // [/RLVa:KB] diff --git a/linden/indra/newview/lloverlaybar.cpp b/linden/indra/newview/lloverlaybar.cpp index 14ae3ff..5ca5905 100644 --- a/linden/indra/newview/lloverlaybar.cpp +++ b/linden/indra/newview/lloverlaybar.cpp @@ -67,6 +67,10 @@ #include "llwindlightremotectrl.h" #include "llselectmgr.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + // // Globals // diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index e88a16a..f4501be 100644 --- a/linden/indra/newview/llpanelavatar.cpp +++ b/linden/indra/newview/llpanelavatar.cpp @@ -81,6 +81,10 @@ #include "roles_constants.h" #include "lluictrlfactory.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + // Statics std::list LLPanelAvatar::sAllPanels; BOOL LLPanelAvatar::sAllowFirstLife = FALSE; diff --git a/linden/indra/newview/llpanelclassified.cpp b/linden/indra/newview/llpanelclassified.cpp index 36fc86d..2249479 100644 --- a/linden/indra/newview/llpanelclassified.cpp +++ b/linden/indra/newview/llpanelclassified.cpp @@ -72,6 +72,10 @@ #include "hippoGridManager.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ const S32 MATURE_UNDEFINED = -1; const S32 MATURE_CONTENT = 1; diff --git a/linden/indra/newview/llpanelcontents.cpp b/linden/indra/newview/llpanelcontents.cpp index e5c4f79..02befea 100644 --- a/linden/indra/newview/llpanelcontents.cpp +++ b/linden/indra/newview/llpanelcontents.cpp @@ -68,8 +68,8 @@ #include "lltoolcomp.h" #include "llpanelinventory.h" -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) -#include "llvoavatar.h" +// [RLVa:KB] +#include "rlvhandler.h" // [/RLVa:KB] // diff --git a/linden/indra/newview/llpaneldisplay.cpp b/linden/indra/newview/llpaneldisplay.cpp index e17ba2b..15b4615 100644 --- a/linden/indra/newview/llpaneldisplay.cpp +++ b/linden/indra/newview/llpaneldisplay.cpp @@ -83,6 +83,10 @@ // parent #include "llfloaterpreference.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + #include const F32 MAX_USER_FAR_CLIP = 512.f; diff --git a/linden/indra/newview/llpanelinventory.cpp b/linden/indra/newview/llpanelinventory.cpp index 333b83f..41ba513 100644 --- a/linden/indra/newview/llpanelinventory.cpp +++ b/linden/indra/newview/llpanelinventory.cpp @@ -84,8 +84,8 @@ #include "hippoGridManager.h" -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) -#include "llvoavatar.h" +// [RLVa:KB] +#include "rlvhandler.h" // [/RLVa:KB] ///---------------------------------------------------------------------------- @@ -750,13 +750,13 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { disabled_items.push_back(std::string("Task Open")); } -// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Modified: RLVa-1.0.5c +// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a else if (rlv_handler_t::isEnabled()) { bool fLocked = gRlvHandler.isLockedAttachment(gObjectList.findObject(mPanel->getTaskUUID()), RLV_LOCK_REMOVE); if ( ((LLAssetType::AT_LSL_TEXT == item->getType()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT)) || (fLocked))) || ((LLAssetType::AT_NOTECARD == item->getType()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) || (fLocked))) || - ((LLAssetType::AT_NOTECARD == item->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE))) ) + ((LLAssetType::AT_TEXTURE == item->getType()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE))) ) { disabled_items.push_back(std::string("Task Open")); } @@ -986,9 +986,10 @@ LLUIImagePtr LLTaskTextureBridge::getIcon() const void LLTaskTextureBridge::openItem() { -// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Added: RLVa-1.0.5c +// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE)) { + RlvNotifications::notifyBlockedViewTexture(); return; } // [/RLVa:KB] @@ -1274,11 +1275,12 @@ LLTaskLSLBridge::LLTaskLSLBridge( void LLTaskLSLBridge::openItem() { -// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Modified: RLVa-1.0.5c +// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_VIEWSCRIPT)) || (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE))) ) { + RlvNotifications::notifyBlockedViewScript(); return; } // [/RLVa:KB] @@ -1401,10 +1403,11 @@ void LLTaskNotecardBridge::openItem() { return; } -// [RLVa:KB] - Checked: 2009-10-10 (RLVa-1.0.5a) | Modified: RLVa-1.0.5a +// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a if ( (rlv_handler_t::isEnabled()) && ( (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) || (gRlvHandler.isLockedAttachment(object, RLV_LOCK_REMOVE)) ) ) { + RlvNotifications::notifyBlockedViewNote(); return; } // [/RLVa:KB] diff --git a/linden/indra/newview/llpanelland.cpp b/linden/indra/newview/llpanelland.cpp index 7c9faaf..ea6a557 100644 --- a/linden/indra/newview/llpanelland.cpp +++ b/linden/indra/newview/llpanelland.cpp @@ -51,6 +51,10 @@ #include "hippoGridManager.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + LLPanelLandSelectObserver* LLPanelLandInfo::sObserver = NULL; LLPanelLandInfo* LLPanelLandInfo::sInstance = NULL; diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index 23b7785..69539c7 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp @@ -83,7 +83,7 @@ #include "llglheaders.h" -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) +// [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -737,7 +737,7 @@ void LLPanelLogin::refreshLocation( bool force_visible ) if ( ! force_visible ) show_start = gSavedSettings.getBOOL("ShowStartLocation"); -// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-08 (RLVa-1.0.0e) // TODO-RLVa: figure out some way to make this work with RLV_EXTENSION_STARTLOCATION #ifndef RLV_EXTENSION_STARTLOCATION if (rlv_handler_t::isEnabled()) diff --git a/linden/indra/newview/llpanelobject.cpp b/linden/indra/newview/llpanelobject.cpp index 10cd0bd..706f98e 100644 --- a/linden/indra/newview/llpanelobject.cpp +++ b/linden/indra/newview/llpanelobject.cpp @@ -78,8 +78,8 @@ #include "hippoLimits.h" -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) -#include "llvoavatar.h" +// [RLVa:KB] +#include "rlvhandler.h" // [/RLVa:KB] // diff --git a/linden/indra/newview/llpanelpermissions.cpp b/linden/indra/newview/llpanelpermissions.cpp index fc05744..8492988 100644 --- a/linden/indra/newview/llpanelpermissions.cpp +++ b/linden/indra/newview/llpanelpermissions.cpp @@ -70,6 +70,10 @@ #include "hippoGridManager.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + ///---------------------------------------------------------------------------- /// Class llpanelpermissions ///---------------------------------------------------------------------------- @@ -349,7 +353,7 @@ void LLPanelPermissions::refresh() // Only filter the owner name if: the selection is all owned by the same avie and not group owned if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) ) { - owner_name = gRlvHandler.getAnonym(owner_name); + owner_name = RlvStrings::getAnonym(owner_name); fRlvEnableOwner = false; } } diff --git a/linden/indra/newview/llpanelpick.cpp b/linden/indra/newview/llpanelpick.cpp index 9c2638f..3417b17 100644 --- a/linden/indra/newview/llpanelpick.cpp +++ b/linden/indra/newview/llpanelpick.cpp @@ -59,6 +59,10 @@ #include "llviewerregion.h" #include "llviewerwindow.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + //static std::list LLPanelPick::sAllPanels; diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp index e7c39e2..2c8ef4d 100644 --- a/linden/indra/newview/llprefsim.cpp +++ b/linden/indra/newview/llprefsim.cpp @@ -50,6 +50,10 @@ #include "hippoGridManager.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + class LLPrefsIMImpl : public LLPanel { public: diff --git a/linden/indra/newview/llpreviewscript.cpp b/linden/indra/newview/llpreviewscript.cpp index bde7242..98a5d8f 100644 --- a/linden/indra/newview/llpreviewscript.cpp +++ b/linden/indra/newview/llpreviewscript.cpp @@ -89,6 +89,9 @@ #include "llpanelinventory.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] const std::string HELLO_LSL = "default\n" diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp index 1634950..f154de9 100644 --- a/linden/indra/newview/llselectmgr.cpp +++ b/linden/indra/newview/llselectmgr.cpp @@ -87,6 +87,10 @@ #include "llglheaders.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + LLViewerObject* getSelectedParentObject(LLViewerObject *object) ; // // Consts @@ -3446,6 +3450,17 @@ void LLSelectMgr::deselectAllIfTooFar() return; } +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l +#ifdef RLV_EXTENSION_CMD_INTERACT + // [Fall-back code] Don't allow an active selection (except for HUD attachments - see above) when @interact=n restricted + if (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) + { + deselectAll(); + return; + } +#endif // RLV_EXTENSION_CMD_INTERACT +// [/RLVa:KB] + // HACK: Don't deselect when we're navigating to rate an object's // owner or creator. JC if (gPieObject->getVisible()) diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index b70253e..e997e5f 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp @@ -201,6 +201,10 @@ #include "llmozlib.h" #endif // LL_LIBXUL_ENABLED +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + #if LL_WINDOWS #include "llwindebug.h" #include "lldxhardware.h" @@ -2426,6 +2430,14 @@ bool idle_startup() LLInventoryView::toggleVisibility(NULL); } +// [RLVa:KB] - Checked: 2009-11-27 (RLVa-1.1.0f) | Added: RLVa-1.1.0f + if (rlv_handler_t::isEnabled()) + { + // Regularly process a select subset of retained commands during logon + gIdleCallbacks.addFunction(RlvHandler::onIdleStartup, new LLTimer()); + } +// [/RLVa:KB] + LLStartUp::setStartupState( STATE_MISC ); return FALSE; } @@ -2828,7 +2840,7 @@ bool idle_startup() // reset keyboard focus to sane state of pointing at world gFocusMgr.setKeyboardFocus(NULL); -// [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e // RELEASE-RLVa: this should go in LLAppViewer::handleLoginComplete() but Imprudence doesn't call that function gRlvHandler.initLookupTables(); diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp index fbb99f0..e88d6dc 100644 --- a/linden/indra/newview/llstatusbar.cpp +++ b/linden/indra/newview/llstatusbar.cpp @@ -93,6 +93,9 @@ LLStatusBar *gStatusBar = NULL; S32 STATUS_BAR_HEIGHT = 0; extern S32 MENU_BAR_HEIGHT; +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] // TODO: these values ought to be in the XML too const S32 MENU_PARCEL_SPACING = 1; // Distance from right of menu item to parcel information @@ -539,7 +542,8 @@ void LLStatusBar::refresh() { // TODO-RLVa: find out whether the LCD code is still used because if so then we need to filter that as well location_name = llformat("%s (%s) - %s", - rlv_handler_t::cstrHiddenRegion.c_str(), region->getSimAccessString().c_str(), rlv_handler_t::cstrHidden.c_str()); + RlvStrings::getString(RLV_STRING_HIDDEN_REGION).c_str(), region->getSimAccessString().c_str(), + RlvStrings::getString(RLV_STRING_HIDDEN).c_str()); } // [/RLVa:KB] diff --git a/linden/indra/newview/lltoolbar.cpp b/linden/indra/newview/lltoolbar.cpp index 645d29a..e961a9b 100644 --- a/linden/indra/newview/lltoolbar.cpp +++ b/linden/indra/newview/lltoolbar.cpp @@ -67,6 +67,10 @@ #include "llimpanel.h" #include "llscrolllistctrl.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + #if LL_DARWIN #include "llresizehandle.h" diff --git a/linden/indra/newview/lltooldraganddrop.cpp b/linden/indra/newview/lltooldraganddrop.cpp index a3ed16b..2bc6e3e 100644 --- a/linden/indra/newview/lltooldraganddrop.cpp +++ b/linden/indra/newview/lltooldraganddrop.cpp @@ -72,6 +72,9 @@ #include "llparcel.h" // RezWithLandGroup #include "llviewerparcelmgr.h" // RezWithLandGroup +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES // or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a @@ -2183,8 +2186,8 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { -// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) - if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT))) ) { return ACCEPT_NO_LOCKED; } @@ -2253,9 +2256,12 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { -// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) - // NOTE: if (mask & MASK_CONTROL) then it's a drop rather than a rez, so we let that pass through - if ( !(mask & MASK_CONTROL) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + // NOTE: if (mask & MASK_CONTROL) then it's a drop rather than a rez, so we let that pass through when @rez=n restricted + // (but not when @interact=n restricted unless the drop target is a HUD attachment) + if ( (rlv_handler_t::isEnabled()) && + ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && ((mask & MASK_CONTROL) == 0) ) || + ( (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) && (((mask & MASK_CONTROL) == 0) || (!obj->isHUDAttachment())) ) ) ) { return ACCEPT_NO_LOCKED; } @@ -2844,9 +2850,9 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventoryCategory( EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { -// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) - // NOTE: it looks like this is only ever called from LLToolDragAndDrop::dad3dRezObjectOnLand() making this a bit redundant - if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + // [Fall-back code] Looks like this is only ever called from LLToolDragAndDrop::dad3dRezObjectOnObject() + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT))) ) { return ACCEPT_NO_LOCKED; } @@ -2873,9 +2879,9 @@ EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand( EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnObject( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { -// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) - // NOTE: it looks like this is only ever called from LLToolDragAndDrop::dad3dRezObjectOnObject) making this a bit redundant - if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + // [Fall-back code] Looks like this is only ever called from LLToolDragAndDrop::dad3dRezObjectOnObject() + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT))) ) { return ACCEPT_NO_LOCKED; } diff --git a/linden/indra/newview/lltoolface.cpp b/linden/indra/newview/lltoolface.cpp index 3cddba7..735ecd9 100644 --- a/linden/indra/newview/lltoolface.cpp +++ b/linden/indra/newview/lltoolface.cpp @@ -48,6 +48,10 @@ #include "llviewerwindow.h" #include "llfloatertools.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + // // Member functions // @@ -100,11 +104,10 @@ void LLToolFace::pickCallback(const LLPickInfo& pick_info) return; } -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l if ( (rlv_handler_t::isEnabled()) && ( (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) || - ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!hit_obj->isAttachment()) || (!hit_obj->permYouOwner())) && - (dist_vec_squared(gAgent.getPositionAgent(), hit_obj->getPositionRegion() + pick_info.mObjectOffset) > 1.5f * 1.5f) ))) + ((gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (!gRlvHandler.canTouch(hit_obj, pick_info.mObjectOffset))) ) ) { return; } diff --git a/linden/indra/newview/lltoolgrab.cpp b/linden/indra/newview/lltoolgrab.cpp index 260d533..9b6d6f7 100644 --- a/linden/indra/newview/lltoolgrab.cpp +++ b/linden/indra/newview/lltoolgrab.cpp @@ -66,6 +66,10 @@ #include "hippoLimits.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + const S32 SLOP_DIST_SQ = 4; // Override modifier key behavior with these buttons @@ -160,7 +164,11 @@ void LLToolGrab::pickCallback(const LLPickInfo& pick_info) } // if not over object, do nothing - if (!objectp) +// if (!objectp) +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Added: RLVa-1.1.0l + // Block initiating a drag operation on an object that can't be touched + if ( (!objectp) || ((rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(objectp, pick_info.mObjectOffset))) ) +// [/RLVa:KB] { LLToolGrab::getInstance()->setMouseCapture(TRUE); LLToolGrab::getInstance()->mMode = GRAB_NOOBJECT; @@ -188,12 +196,7 @@ BOOL LLToolGrab::handleObjectHit(const LLPickInfo& info) return FALSE; } - //if (objectp->isAvatar()) -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f - if ( (objectp->isAvatar()) || - ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!objectp->isAttachment()) || (!objectp->permYouOwner())) && - (dist_vec_squared(gAgent.getPositionAgent(), mGrabPick.mIntersection) > 1.5f * 1.5f) ) ) -// [/RLVa:KB] + if (objectp->isAvatar()) { if (gGrabTransientTool) { @@ -428,12 +431,10 @@ BOOL LLToolGrab::handleHover(S32 x, S32 y, MASK mask) return TRUE; } -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f - // Don't allow dragging beyond 1.5m under @fartouch=n - LLViewerObject* pObj; - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (GRAB_INACTIVE != mMode) && (hasMouseCapture()) && - ((pObj = mGrabPick.getObject()) != NULL) && (!pObj->isDead()) && (!pObj->isHUDAttachment()) && - (dist_vec_squared(gAgent.getPositionAgent(), pObj->getPositionRegion() + mGrabPick.mObjectOffset) > 1.5f * 1.5f) ) +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + // Block dragging an object beyond touch range when @fartouch=n restricted + if ( (rlv_handler_t::isEnabled()) && (GRAB_INACTIVE != mMode) && (GRAB_NOOBJECT != mMode) && (hasMouseCapture()) && + (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (!gRlvHandler.canTouch(mGrabPick.getObject(), mGrabPick.mObjectOffset)) ) { if (gGrabTransientTool) { @@ -442,6 +443,7 @@ BOOL LLToolGrab::handleHover(S32 x, S32 y, MASK mask) gGrabTransientTool = NULL; } setMouseCapture(FALSE); + return TRUE; } // [/RLVa:KB] diff --git a/linden/indra/newview/lltoolpie.cpp b/linden/indra/newview/lltoolpie.cpp index 2b63a24..02ad008 100644 --- a/linden/indra/newview/lltoolpie.cpp +++ b/linden/indra/newview/lltoolpie.cpp @@ -68,6 +68,10 @@ #include "llui.h" #include "llweb.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + extern void handle_buy(void*); extern BOOL gDebugClicks; @@ -167,10 +171,10 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) // If it's a left-click, and we have a special action, do it. if (useClickAction(always_show, mask, object, parent)) { -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f - // Block left-click special actions (fallback code really since LLToolSelect::handleObjectSelection() wouldn't select it anyway) - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && - (dist_vec_squared(gAgent.getPositionAgent(), mPick.mIntersection) > 1.5f * 1.5f) ) +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + // Block left-click special actions when fartouch restricted + if ( (rlv_handler_t::isEnabled()) && + (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (!gRlvHandler.canTouch(object, mPick.mObjectOffset)) ) { return TRUE; } @@ -253,6 +257,14 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) ((object->usePhysics() || (parent && !parent->isAvatar() && parent->usePhysics())) || touchable) && !always_show) { +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + // Triggered by left-clicking on a touchable object + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object, mPick.mObjectOffset)) ) + { + return LLTool::handleMouseDown(x, y, mask); + } +// [/RLVa:KB] + gGrabTransientTool = this; LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() ); return LLToolGrab::getInstance()->handleObjectHit( mPick ); @@ -377,20 +389,17 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) } // gPieAvatar->show(x, y, mPieMouseButtonDown); -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f - #ifdef RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK - // If we have an empty selection under @fartouch=n don't show the pie menu but play the "operation block" sound - if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) || (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) ) - { - #endif // RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK - gPieAvatar->show(x, y, mPieMouseButtonDown); - #ifdef RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK - } - else - { - make_ui_sound("UISndInvalidOp"); - } - #endif // RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + // Don't show the pie menu on empty selection when fartouch/interaction restricted [see LLToolSelect::handleObjectSelection()] + if ( (!rlv_handler_t::isEnabled()) || (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) || + (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) ) + { + gPieAvatar->show(x, y, mPieMouseButtonDown); + } + else + { + make_ui_sound("UISndInvalidOp"); + } // [/RLVa:KB] } else if (object->isAttachment() && !object->isHUDAttachment()) @@ -421,31 +430,28 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) //gMuteObjectPieMenu->setLabel("Mute"); } -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f - #ifdef RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK - // If we have an empty selection under @fartouch=n don't show the pie menu but play the "operation block" sound - // (not entirely accurate in case of Tools / Select Only XXX [see LLToolSelect::handleObjectSelection()] - if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) || (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) ) - { - #endif // RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + // Don't show the pie menu on empty selection when fartouch/interaction restricted + // (not entirely accurate in case of Tools / Select Only XXX [see LLToolSelect::handleObjectSelection()] + if ( (!rlv_handler_t::isEnabled()) || (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) || + (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) ) + { // [/RLVa:KB] - gPieObject->show(x, y, mPieMouseButtonDown); - - // VEFFECT: ShowPie object - // Don't show when you click on someone else, it freaks them - // out. - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE); - effectp->setPositionGlobal(mPick.mPosGlobal); - effectp->setColor(LLColor4U(gAgent.getEffectColor())); - effectp->setDuration(0.25f); + gPieObject->show(x, y, mPieMouseButtonDown); + + // VEFFECT: ShowPie object + // Don't show when you click on someone else, it freaks them + // out. + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE); + effectp->setPositionGlobal(mPick.mPosGlobal); + effectp->setColor(LLColor4U(gAgent.getEffectColor())); + effectp->setDuration(0.25f); // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f - #ifdef RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK - } - else - { - make_ui_sound("UISndInvalidOp"); - } - #endif // RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK + } + else + { + make_ui_sound("UISndInvalidOp"); + } // [/RLVa:KB] } } @@ -514,7 +520,11 @@ ECursorType cursor_from_object(LLViewerObject* object) switch(click_action) { case CLICK_ACTION_SIT: - if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting)) // not already sitting? +// if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting)) // not already sitting? +// [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j + if ( ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->mIsSitting)) && // not already sitting? + ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canSit(object, gViewerWindow->getHoverPick().mObjectOffset))) ) +// [/RLVa:KB] { cursor = UI_CURSOR_TOOLSIT; } @@ -619,7 +629,21 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) LLViewerObject *parent = NULL; if (gHoverView) { - object = gViewerWindow->getHoverPick().getObject(); +// object = gViewerWindow->getHoverPick().getObject(); +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + // Block all special click action cursors when: + // - @fartouch=n restricted and the object is out of range + // - @interact=n restricted and the object isn't a HUD attachment + const LLPickInfo& pick = gViewerWindow->getHoverPick(); + object = pick.getObject(); + if ( (object) && (rlv_handler_t::isEnabled()) && + ( ((gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))) && (!gRlvHandler.canTouch(object, pick.mObjectOffset)) || + ((gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) && (!object->isHUDAttachment())) ) ) + { + gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); + return TRUE; + } +// [/RLVa:KB] } if (object) @@ -633,6 +657,13 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) gViewerWindow->getWindow()->setCursor(cursor); lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPie (inactive)" << llendl; } +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Added: RLVa-1.1.0l + else if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object)) ) + { + // Block showing the "grab" or "touch" cursor if we can't touch the object (@fartouch=n is handled above) + gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); + } +// [/RLVa:KB] else if ((object && !object->isAvatar() && object->usePhysics()) || (parent && !parent->isAvatar() && parent->usePhysics())) { diff --git a/linden/indra/newview/lltoolplacer.cpp b/linden/indra/newview/lltoolplacer.cpp index 00b0c9f..477dbca 100644 --- a/linden/indra/newview/lltoolplacer.cpp +++ b/linden/indra/newview/lltoolplacer.cpp @@ -69,6 +69,10 @@ #include "llviewerparcelmgr.h" // RezWithLandGroup #include "roles_constants.h" // Ele: Land Group Override +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + const LLVector3 DEFAULT_OBJECT_SCALE(0.5f, 0.5f, 0.5f); //static @@ -556,8 +560,8 @@ BOOL LLToolPlacer::placeObject(S32 x, S32 y, MASK mask) { BOOL added = TRUE; -// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) - if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) || (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT))) ) { return TRUE; // Callers seem to expect a "did you handle it?" so we return TRUE rather than FALSE } diff --git a/linden/indra/newview/lltoolselect.cpp b/linden/indra/newview/lltoolselect.cpp index 02755d7..1e412de 100644 --- a/linden/indra/newview/lltoolselect.cpp +++ b/linden/indra/newview/lltoolselect.cpp @@ -51,7 +51,8 @@ #include "llvoavatar.h" #include "llworld.h" -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) +// [RLVa:KB] +#include "rlvhandler.h" #include "llfloatertools.h" // [/RLVa:KB] @@ -88,7 +89,7 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi object = object->getRootEdit(); } -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l if (rlv_handler_t::isEnabled()) { if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) diff --git a/linden/indra/newview/lltracker.cpp b/linden/indra/newview/lltracker.cpp index 654510d..43fd4c0 100644 --- a/linden/indra/newview/lltracker.cpp +++ b/linden/indra/newview/lltracker.cpp @@ -65,6 +65,10 @@ #include "llworldmapview.h" #include "llviewercontrol.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + const F32 DESTINATION_REACHED_RADIUS = 3.0f; const F32 DESTINATION_VISITED_RADIUS = 6.0f; @@ -185,7 +189,7 @@ void LLTracker::render3D() // instance()->mBeaconText, instance()->mTrackedLocationName ); // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a renderBeacon(instance()->mTrackedPositionGlobal, gTrackColor, instance()->mBeaconText, - (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? instance()->mTrackedLocationName : rlv_handler_t::cstrHidden); + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? instance()->mTrackedLocationName : RlvStrings::getString(RLV_STRING_HIDDEN)); // [/RLVa:KB] } } @@ -231,7 +235,8 @@ void LLTracker::render3D() // instance()->mBeaconText, instance()->mTrackedLandmarkName ); // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a renderBeacon( instance()->mTrackedPositionGlobal, gTrackColor, instance()->mBeaconText, - (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? instance()->mTrackedLandmarkName : rlv_handler_t::cstrHidden); + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? instance()->mTrackedLandmarkName + : RlvStrings::getString(RLV_STRING_HIDDEN)); // [/RLVa:KB] } } @@ -264,7 +269,7 @@ void LLTracker::render3D() // instance()->mBeaconText, av_tracker.getName() ); // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-1.0.0a renderBeacon( av_tracker.getGlobalPos(), gTrackColor, instance()->mBeaconText, - (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? av_tracker.getName() : rlv_handler_t::cstrHidden); + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? av_tracker.getName() : RlvStrings::getString(RLV_STRING_HIDDEN)); // [/RLVa:KB] } } diff --git a/linden/indra/newview/llviewercontrol.cpp b/linden/indra/newview/llviewercontrol.cpp index 50224ad..88ea904 100644 --- a/linden/indra/newview/llviewercontrol.cpp +++ b/linden/indra/newview/llviewercontrol.cpp @@ -520,19 +520,6 @@ bool handleSliderScrollWheelMultiplierChanged(const LLSD& newvalue) return true; } -// [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.1h -bool rlvHandleEnableLegacyNamingChanged(const LLSD& newvalue) -{ - rlv_handler_t::fLegacyNaming = newvalue.asBoolean(); - return true; -} - -bool rlvHandleShowNameTagsChanged(const LLSD& newvalue) -{ - RlvSettings::fShowNameTags = newvalue.asBoolean(); - return true; -} -// [/RLVa:KB] //////////////////////////////////////////////////////////////////////////// @@ -677,13 +664,6 @@ void settings_setup_listeners() gSavedSettings.getControl("MediaDebugLevel")->getSignal()->connect(boost::bind(&handleMediaDebugLevelChanged, _1)); gSavedSettings.getControl("SliderScrollWheelMultiplier")->getSignal()->connect(boost::bind(&handleSliderScrollWheelMultiplierChanged, _1)); gSavedSettings.getControl("TranslateChat")->getSignal()->connect(boost::bind(&handleTranslateChatPrefsChanged, _1)); - -// [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.1h - if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) - gSavedSettings.getControl(RLV_SETTING_ENABLELEGACYNAMING)->getSignal()->connect(boost::bind(&rlvHandleEnableLegacyNamingChanged, _1)); - if (gSavedSettings.controlExists(RLV_SETTING_SHOWNAMETAGS)) - gSavedSettings.getControl(RLV_SETTING_SHOWNAMETAGS)->getSignal()->connect(boost::bind(&rlvHandleShowNameTagsChanged, _1)); -// [/RLVa:KB] } template <> eControlType get_control_type(const U32& in, LLSD& out) diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp index 5316337..78940cc 100644 --- a/linden/indra/newview/llviewerdisplay.cpp +++ b/linden/indra/newview/llviewerdisplay.cpp @@ -83,6 +83,10 @@ #include "llwaterparammanager.h" #include "llpostprocess.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + extern LLPointer gStartImageGL; LLPointer gDisconnectedImagep = NULL; diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 6ec7e46..524654a 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -241,10 +241,8 @@ void init_debug_ui_menu(LLMenuGL* menu); void init_debug_xui_menu(LLMenuGL* menu); void init_debug_avatar_menu(LLMenuGL* menu); void init_debug_baked_texture_menu(LLMenuGL* menu); -// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) -#ifdef RLV_DEBUG_TESTS - #include "rlvtest.h" -#endif // RLV_DEBUG_TESTS +// [RLVa:KB] +#include "rlvhandler.h" #include "rlvfloaterbehaviour.h" void init_debug_rlva_menu(LLMenuGL* menu); // [/RLVa:KB] @@ -860,7 +858,7 @@ void init_client_menu(LLMenuGL* menu) init_debug_world_menu(sub_menu); menu->appendMenu(sub_menu); -// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.1b +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.1b #ifdef RLV_ADVANCED_MENU if (rlv_handler_t::isEnabled()) { @@ -970,7 +968,7 @@ void init_client_menu(LLMenuGL* menu) // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0e #ifdef RLV_ADVANCED_TOGGLE_RLVA if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) - menu->append(new LLMenuItemCheckGL("Restrained Life API", &rlvToggleEnabled, NULL, &rlvGetEnabled, NULL)); + menu->append(new LLMenuItemCheckGL("RestrainedLove API", &rlvToggleEnabled, NULL, &rlvGetEnabled, NULL)); #endif // RLV_ADVANCED_TOGGLE_RLVA // [/RLVa:KB] @@ -1433,7 +1431,7 @@ void init_debug_baked_texture_menu(LLMenuGL* menu) menu->createJumpKeys(); } -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g +// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-11-17 (RLVa-1.1.0d) | Modified: RLVa-1.1.0d void init_debug_rlva_menu(LLMenuGL* menu) { // Debug options @@ -1442,26 +1440,31 @@ void init_debug_rlva_menu(LLMenuGL* menu) if (gSavedSettings.controlExists(RLV_SETTING_DEBUG)) pDbgMenu->append(new LLMenuItemCheckGL("Show Debug Messages", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_DEBUG)); + pDbgMenu->append(new LLMenuItemCallGL("Dump Attachment Locks", RlvHandler::dumpAttachmentLocks, NULL, NULL)); pDbgMenu->appendSeparator(); if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) pDbgMenu->append(new LLMenuItemCheckGL("Enable Legacy Naming", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLELEGACYNAMING)); + if (gSavedSettings.controlExists(RLV_SETTING_SHAREDINVAUTORENAME)) + pDbgMenu->append(new LLMenuItemCheckGL("Rename Shared Items on Wear", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_SHAREDINVAUTORENAME)); menu->appendMenu(pDbgMenu); menu->appendSeparator(); } - #ifdef RLV_EXTENSION_ENABLE_WEAR - if (gSavedSettings.controlExists(RLV_SETTING_ENABLEWEAR)) - menu->append(new LLMenuItemCheckGL("Enable Wear", menu_toggle_control, rlvEnableWearEnabler, menu_check_control, (void*)RLV_SETTING_ENABLEWEAR)); - menu->appendSeparator(); - #endif // RLV_EXTENSION_ENABLE_WEAR + if (gSavedSettings.controlExists(RLV_SETTING_ENABLEWEAR)) + menu->append(new LLMenuItemCheckGL("Enable Default Wear", menu_toggle_control, rlvEnableWearEnabler, menu_check_control, (void*)RLV_SETTING_ENABLEWEAR)); +#ifndef RLV_WORKAROUND_REZMULTIPLEATTACH + if (gSavedSettings.controlExists(RLV_SETTING_ENABLESHAREDWEAR)) + menu->append(new LLMenuItemCheckGL("Enable Shared Wear", menu_toggle_control, rlvEnableSharedWearEnabler, menu_check_control, (void*)RLV_SETTING_ENABLESHAREDWEAR)); +#endif // RLV_WORKAROUND_REZMULTIPLEATTACH + menu->appendSeparator(); #ifdef RLV_EXTENSION_HIDELOCKED if ( (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDLAYER)) && (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDATTACH)) ) { - menu->append(new LLMenuItemCheckGL("Hide locked layers", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDLAYER)); - menu->append(new LLMenuItemCheckGL("Hide locked attachments", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDATTACH)); + menu->append(new LLMenuItemCheckGL("Hide Locked Layers", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDLAYER)); + menu->append(new LLMenuItemCheckGL("Hide Locked Attachments", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDATTACH)); //sub_menu->append(new LLMenuItemToggleGL("Hide locked inventory", &rlv_handler_t::fHideLockedInventory)); menu->appendSeparator(); } @@ -1662,13 +1665,10 @@ class LLObjectTouch : public view_listener_t LLPickInfo pick = LLToolPie::getInstance()->getPick(); -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f - // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for - // [msg->addVector3("Position", pick.mIntersection) <- see llDetectedTouchPos()] - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!object->isAttachment()) || (!object->permYouOwner())) && - (dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > 1.5f * 1.5f) ) +// [RLVa:KB] - Checked: 2010-01-01 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object, pick.mObjectOffset)) ) { - return true; // Can't touch in-world objects (or other avie's attachments) farther than 1.5m away under @fartouch=n + return true; } // [/RLVa:KB] @@ -1720,12 +1720,10 @@ class LLObjectEnableTouch : public view_listener_t { LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); bool new_value = obj && obj->flagHandleTouch(); -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-10 (RLVa-1.0.0g) | Added: RLVa-0.2.0f - // TODO-RLVa: this code is rather redundant since we'll never get an active selection to show a pie menu for - if ( (new_value) && (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!obj->isAttachment()) || (!obj->permYouOwner())) && - (dist_vec_squared(gAgent.getPositionAgent(), LLToolPie::getInstance()->getPick().mIntersection) > 1.5f * 1.5f) ) +// [RLVa:KB] - Version: 1.23.4 | Checked: 2010-01-01 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + if ( (new_value) && (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(obj, LLToolPie::getInstance()->getPick().mObjectOffset)) ) { - new_value = false; // Can't touch in-world objects (or other avie's attachments) farther than 1.5m away under @fartouch=n + new_value = false; } // [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); @@ -2681,7 +2679,7 @@ class LLAvatarFreeze : public view_listener_t LLSD args; // args["AVATAR_NAME"] = fullname; // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) - args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : gRlvHandler.getAnonym(fullname); + args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname); // [/RLVa:KB] LLNotifications::instance().add("FreezeAvatarFullname", args, @@ -2810,7 +2808,7 @@ class LLAvatarEject : public view_listener_t // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!fullname.empty()) ) { - fullname = gRlvHandler.getAnonym(fullname); + fullname = RlvStrings::getAnonym(fullname); } // [/RLVa:KB] @@ -3418,10 +3416,9 @@ bool handle_sit_or_stand() return true; } -// [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && - ( ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) && (gAgent.getAvatarObject()->mIsSitting)) || - (gRlvHandler.hasBehaviour(RLV_BHVR_SIT)) ) ) +// [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Modified: RLVa-1.1.0j + // Block if we can't sit on the selected object (also handles sitting and prevented from standing up) + if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canSit(object, pick.mObjectOffset)) ) { return true; } @@ -3437,15 +3434,6 @@ bool handle_sit_or_stand() if (object && object->getPCode() == LL_PCODE_VOLUME) { -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0g - if ( (rlv_handler_t::isEnabled()) && - ((gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) || (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH))) && - (dist_vec_squared(gAgent.getPositionGlobal(), object->getPositionGlobal() + LLVector3d(pick.mObjectOffset)) > 1.5f * 1.5f) ) - { - return true; // Don't allow sitting farther away than 1.5m under @sittp=n or @fartouch=n - } -// [/RLVa:KB] - gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); @@ -3483,8 +3471,8 @@ class LLLandSit : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) - if (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) +// [RLVa:KB] - Checked: 2010-03-31 (RLVa-1.1.1a) | Modified: RLVa-1.2.0c + if ( (rlv_handler_t::isEnabled()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SIT))) ) { return true; } @@ -5800,7 +5788,9 @@ class LLObjectEnableSitOrStand : public view_listener_t new_value = true; } } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); +// [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j +// gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); +// [/RLVa:KB] // Update label std::string label; @@ -5816,6 +5806,9 @@ class LLObjectEnableSitOrStand : public view_listener_t if (sitting_on_selection()) { label = stand_text; +// [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j + new_value &= !gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT); +// [/RLVa:KB] } else { @@ -5828,8 +5821,22 @@ class LLObjectEnableSitOrStand : public view_listener_t { label = sit_text; } +// [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j + if ( (rlv_handler_t::isEnabled()) && (new_value) ) + { + // RELEASE-RLVa: [2009-12-22] make sure we examine the same object that handle_sit_or_stand() will request a sit for + const LLPickInfo& pick = LLToolPie::getInstance()->getPick(); + if (pick.mObjectID.notNull()) + { + new_value = gRlvHandler.canSit(pick.getObject(), pick.mObjectOffset); + } + } +// [/RLVa:KB] } gMenuHolder->childSetText("Object Sit", label); +// [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); +// [/RLVa:KB] return true; } @@ -7569,6 +7576,9 @@ class LLWorldEnableTeleportHome : public view_listener_t LLViewerRegion* regionp = gAgent.getRegion(); bool agent_on_prelude = (regionp && regionp->isPrelude()); bool enable_teleport_home = gAgent.isGodlike() || !agent_on_prelude; +// [RLVa:KB] - Checked: 2009-12-22 (RLVa-1.1.0k) | Added: RLVa-1.1.0j + enable_teleport_home &= !gRlvHandler.hasBehaviour(RLV_BHVR_TPLM); +// [/RLVa:KB] gMenuHolder->findControl(userdata["control"].asString())->setValue(enable_teleport_home); return true; } @@ -11420,4 +11430,10 @@ void initialize_menus() addMenu(new RLVaBehaviorsShow(), "RLVa.Behaviors.Show"); // [/RLVa:KB] +// [RLVa:KB] - Checked: 2010-01-18 (RLVa-1.1.0m) | Added: RLVa-1.1.0m + if (rlv_handler_t::isEnabled()) + { + addMenu(new RlvEnableIfNot(), "RLV.EnableIfNot"); + } +// [/RLVa:KB] } diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 52113ce..a512a66 100755 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -143,6 +143,10 @@ #include "panelradarentry.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + #include #include // Boost Reg Expresions @@ -1130,7 +1134,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& std::string full_name = first_name + " " + last_name; if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(mFromID)) ) { - full_name = gRlvHandler.getAnonym(full_name); + full_name = RlvStrings::getAnonym(full_name); } from_string = std::string("An object named '") + mFromName + "' owned by " + full_name; chatHistory_string = mFromName + " owned by " + full_name; @@ -1199,6 +1203,23 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // This is an offer from an agent. In this case, the back // end has already copied the items into your inventory, // so we can fetch it out of our inventory. +// [RLVa:KB] - Checked: 2010-01-01 (RLVa-1.1.0l) | Added: RLVa-1.1.0l +#ifdef RLV_EXTENSION_GIVETORLV_A2A + if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getForbidGiveToRLV()) && + (LLAssetType::AT_CATEGORY == mType) && (mDesc.find(RLV_PUTINV_PREFIX) == 0) ) + { + RlvGiveToRLVAgentOffer* pOffer = new RlvGiveToRLVAgentOffer(); + LLInventoryFetchComboObserver::folder_ref_t folders; + folders.push_back(mObjectID); + pOffer->fetchDescendents(folders); + if (pOffer->isEverythingComplete()) + pOffer->done(); + else + gInventory.addObserver(pOffer); + } +#endif // RLV_EXTENSION_GIVETORLV_A2A +// [/RLVa:KB] + LLInventoryFetchObserver::item_ref_t items; items.push_back(mObjectID); LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(from_string); @@ -1389,7 +1410,7 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) { - first_name = gRlvHandler.getAnonym(first_name.append(" ").append(last_name)); + first_name = RlvStrings::getAnonym(first_name.append(" ").append(last_name)); last_name.clear(); } // [/RLVa:KB] @@ -1415,7 +1436,7 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(info->mFromID)) ) { - args["NAME"] = gRlvHandler.getAnonym(info->mFromName); + args["NAME"] = RlvStrings::getAnonym(info->mFromName); } // [/RLVa:KB] p.name = "UserGiveItem"; @@ -1840,7 +1861,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) else if ( (rlv_handler_t::isEnabled()) && (offline == IM_ONLINE) && ("@version" == message) ) { - rlvSendBusyMessage(from_id, gRlvHandler.getVersionString(), session_id); + rlvSendBusyMessage(from_id, RlvStrings::getVersion(), session_id); // We won't receive a typing stop message, so do that manually (see comment at the end of LLFloaterIMPanel::sendMsg) LLPointer im_info = new LLIMInfo(gMessageSystem); gIMMgr->processIMTypingStop(im_info); @@ -1916,7 +1937,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) gRlvHandler.filterLocation(message); if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { - name = gRlvHandler.getAnonym(name); + name = RlvStrings::getAnonym(name); gRlvHandler.filterNames(message); } } @@ -1940,9 +1961,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) { - rlvSendBusyMessage(from_id, rlv_handler_t::cstrMsgRecvIM, session_id); - - message = message.substr(0, message_offset) + rlv_handler_t::cstrBlockedRecvIM; + if (!is_muted) + rlvSendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM_REMOTE), session_id); + message = message.substr(0, message_offset) + RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM); } // [/RLVa:KB] @@ -2167,7 +2188,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(from_id)) ) { - name = gRlvHandler.getAnonym(name); + name = RlvStrings::getAnonym(name); } // [/RLVa:KB] } @@ -2207,11 +2228,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else { -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-09-10 (RLVa-1.0.3a) - if ( (rlv_handler_t::isEnabled()) && (dialog == IM_TASK_INVENTORY_OFFERED) && - (info->mDesc.find(RLV_PUTINV_PREFIX) == 1) && (gRlvHandler.getSharedRoot()) ) +// [RLVa:KB] - Version: 1.23.4 | Checked: 2010-01-02 (RLVa-1.1.0l) | Modified: RLVa-1.1.0l + if ( (rlv_handler_t::isEnabled()) && + ( + ((IM_TASK_INVENTORY_OFFERED == dialog) && (info->mDesc.find(RLV_PUTINV_PREFIX) == 1)) +#ifdef RLV_EXTENSION_GIVETORLV_A2A + || ((IM_INVENTORY_OFFERED == dialog) && (info->mDesc.find(RLV_PUTINV_PREFIX) == 0)) +#endif // RLV_EXTENSION_GIVETORLV_A2A + ) && + (gRlvHandler.getSharedRoot()) ) { - LLFirstUse::warnRlvGiveToRLV(); + RlvNotifications::warnGiveToRLV(); } // [/RLVa:KB] @@ -2225,7 +2252,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(from_id)) && (!gAvatarInfoInstances.checkData(from_id)); - args["NAME"] = (!fRlvObfuscate) ? name : gRlvHandler.getAnonym(name); + args["NAME"] = (!fRlvObfuscate) ? name : RlvStrings::getAnonym(name); // [/RLVa:KB] //args["NAME"] = name; LLNotifications::instance().add("InventoryAccepted", args); @@ -2236,7 +2263,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b bool fRlvObfuscate = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (gRlvHandler.isAgentNearby(from_id)) && (!gAvatarInfoInstances.checkData(from_id)); - args["NAME"] = (!fRlvObfuscate) ? name : gRlvHandler.getAnonym(name); + args["NAME"] = (!fRlvObfuscate) ? name : RlvStrings::getAnonym(name); // [/RLVa:KB] //args["NAME"] = name; LLNotifications::instance().add("InventoryDeclined", args); @@ -2285,7 +2312,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) else { if ( (from_id != gAgent.getID()) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) - message = message.substr(0, message_offset) + rlv_handler_t::cstrBlockedRecvIM; + message = message.substr(0, message_offset) + RlvStrings::getString(RLV_STRING_BLOCKED_RECVIM); } } // [/RLVa:KB] @@ -2453,7 +2480,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) && (!gRlvHandler.isException(RLV_BHVR_TPLURE, from_id)) ) || ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (pAvatar) && (pAvatar->mIsSitting) ) ) { - rlvSendBusyMessage(from_id, rlv_handler_t::cstrMsgTpLure); + rlvSendBusyMessage(from_id, RlvStrings::getString(RLV_STRING_BLOCKED_TPLURE_REMOTE)); return; } @@ -2461,7 +2488,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if ( ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) && (!gRlvHandler.isException(RLV_BHVR_RECVIM, from_id)) ) || (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) { - message = rlv_handler_t::cstrHidden; + message = RlvStrings::getString(RLV_STRING_HIDDEN); } } // [/RLVa:KB] @@ -2945,7 +2972,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) if (CHAT_SOURCE_AGENT == chat.mSourceType) { if (chat.mFromID != gAgent.getID()) - from_name = gRlvHandler.getAnonym(from_name); + from_name = RlvStrings::getAnonym(from_name); } else { @@ -3045,7 +3072,8 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) verb = " " + LLTrans::getString("whisper") + " "; break; case CHAT_TYPE_OWNER: -// [RLVa:KB] - Checked: 2009-08-28 (RLVa-1.0.2a) | Modified: RLVa-1.0.2a +// [RLVa:KB] - Checked: 2009-11-25 (RLVa-1.1.0f) | Modified: RLVa-1.1.0f + // TODO-RLVa: [2009-11-25] this could really use some rewriting if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) && (CHAT_TYPE_OWNER == chat.mChatType) ) { mesg.erase(0, 1); @@ -3054,24 +3082,33 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) std::string strExecuted, strFailed, strRetained, *pstr; boost_tokenizer tokens(mesg, boost::char_separator(",", "", boost::drop_empty_tokens)); - for (boost_tokenizer::const_iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) + for (boost_tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) { - if (LLStartUp::getStartupState() == STATE_STARTED) + std::string strCmd = *itToken; + + ERlvCmdRet eRet = gRlvHandler.processCommand(from_id, strCmd, true); + if (RlvSettings::getDebug()) { - if (gRlvHandler.processCommand(from_id, *itToken, true)) + if ( RLV_RET_SUCCESS == (eRet & RLV_RET_SUCCESS) ) pstr = &strExecuted; + else if ( RLV_RET_FAILED == (eRet & RLV_RET_FAILED) ) + pstr = &strFailed; + else if (RLV_RET_RETAINED == eRet) + pstr = &strRetained; else + { + RLV_ASSERT(false); pstr = &strFailed; - } - else - { - gRlvHandler.retainCommand(from_name, from_id, *itToken); - pstr = &strRetained; - } + } - if (!pstr->empty()) - pstr->push_back(','); - pstr->append(*itToken); + const char* pstrSuffix = RlvStrings::getStringFromReturnCode(eRet); + if (pstrSuffix) + strCmd.append(" (").append(pstrSuffix).append(")"); + + if (!pstr->empty()) + pstr->push_back(','); + pstr->append(strCmd); + } } if (!RlvSettings::getDebug()) @@ -3079,11 +3116,20 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // Silly people want comprehensive debug messages, blah :p if ( (!strExecuted.empty()) && (strFailed.empty()) && (strRetained.empty()) ) + { verb = " executes: @"; + mesg = strExecuted; + } else if ( (strExecuted.empty()) && (!strFailed.empty()) && (strRetained.empty()) ) + { verb = " failed: @"; + mesg = strFailed; + } else if ( (strExecuted.empty()) && (strFailed.empty()) && (!strRetained.empty()) ) + { verb = " retained: @"; + mesg = strRetained; + } else { verb = ": @"; @@ -3098,9 +3144,9 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) break; } // [/RLVa:KB] -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) +// [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Checked: 2009-07-10 (RLVa-1.0.0g) // Copy/paste from above - if ( (chatter) && (chat.mChatType != CHAT_TYPE_DEBUG_MSG) ) + if ( (chatter) && (chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mChatType != CHAT_TYPE_DEBUG_MSG) ) { LLPointer psc = new LLViewerPartSourceChat(chatter->getPositionAgent()); psc->setSourceObject(chatter); @@ -5361,7 +5407,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ) { - notice.setArg("[REGIONNAME]", rlv_handler_t::cstrHiddenRegion); + notice.setArg("[REGIONNAME]", RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); } // [/RLVa:KB] std::string formatpos = llformat("%.1f, %.1f,%.1f", objpos[VX], objpos[VY], objpos[VZ]); @@ -5588,12 +5634,12 @@ void process_script_question(LLMessageSystem *msg, void **user_data) LLViewerObject* pObj = gObjectList.findObject(taskid); if (pObj) { - if (pObj->permYouOwner()) - { +// if (pObj->permYouOwner()) +// { // PERMISSION_TAKE_CONTROLS and PERMISSION_ATTACH are only auto-granted to objects this avie owns rlvQuestionsOther &= ~(LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_TAKE_CONTROLS] | LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_ATTACH]); - } +// } } } @@ -5944,7 +5990,7 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response) { if (!gRlvHandler.isException(RLV_BHVR_SENDIM, it->asUUID())) { - text = rlv_handler_t::cstrHidden; + text = RlvStrings::getString(RLV_STRING_HIDDEN); break; } } @@ -5984,7 +6030,8 @@ void handle_lure(LLDynamicArray& ids) { LLSD edit_args; // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) - edit_args["REGION"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : rlv_handler_t::cstrHidden; + edit_args["REGION"] = + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : RlvStrings::getString(RLV_STRING_HIDDEN); // [/RLVa:KB] //edit_args["REGION"] = gAgent.getRegion()->getName(); diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp index cbd0472..1b79cd6 100644 --- a/linden/indra/newview/llviewerobject.cpp +++ b/linden/indra/newview/llviewerobject.cpp @@ -98,6 +98,10 @@ #include "llvowlsky.h" #include "llmanip.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + //#define DEBUG_UPDATE_TYPE BOOL gVelocityInterpolate = TRUE; @@ -1616,6 +1620,24 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, gObjectList.killObject(this); return retval; } +// [RLVa:KB] - Checked: 2009-12-27 (RLVa-1.1.0k) | Added: RLVa-1.1.0k + if ( (rlv_handler_t::isEnabled()) && (sent_parentp->isAvatar()) && (sent_parentp->getID() == gAgent.getID()) ) + { + // Rezzed object that's being worn as an attachment (we're assuming this will be due to llAttachToAvatar()) + S32 idxAttachPt = ATTACHMENT_ID_FROM_STATE(getState()); + if (gRlvHandler.isLockedAttachment(idxAttachPt, RLV_LOCK_ANY)) + { + // If this will end up on an "add locked" attachment point then treat the attach as a user action + LLNameValue* nvItem = getNVPair("AttachItemID"); + if (nvItem) + { + LLUUID idItem(nvItem->getString()); + if (idItem.notNull()) + gRlvHandler.onWearAttachment(idItem); + } + } + } +// [/RLVa:KB] sent_parentp->addChild(this); // make sure this object gets a non-damped update if (sent_parentp->mDrawable.notNull()) diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp index 981c9bc..1616b97 100644 --- a/linden/indra/newview/llviewertexteditor.cpp +++ b/linden/indra/newview/llviewertexteditor.cpp @@ -63,6 +63,10 @@ #include "llappviewer.h" // for gPacificDaylightTime #include "viewertime.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + static LLRegisterWidget r("text_editor"); ///---------------------------------------------------------------------------- @@ -97,9 +101,10 @@ public: } else { -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) - if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) ) +// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a + if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) { + RlvNotifications::notifyBlockedViewNote(); return; } // [/RLVa:KB] @@ -1388,9 +1393,10 @@ BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item, llwchar wc) void LLViewerTextEditor::openEmbeddedTexture( LLInventoryItem* item, llwchar wc ) { -// [RLVa:KB] - Checked: 2009-10-13 (RLVa-1.0.5c) | Added: RLVa-1.0.5c +// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWTEXTURE)) { + RlvNotifications::notifyBlockedViewTexture(); return; } // [/RLVa:KB] diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index 3a68f0f..401e62d 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp @@ -187,6 +187,10 @@ #include "llfloatertest.h" // HACK! #include "llfloaternotificationsconsole.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + #if LL_WINDOWS #include // For Unicode conversion methods #endif @@ -3473,17 +3477,41 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de } else // check ALL objects - { + { found = gPipeline.lineSegmentIntersectInHUD(mouse_hud_start, mouse_hud_end, pick_transparent, face_hit, intersection, uv, normal, binormal); - if (!found) // if not found in HUD, look in world: +// [RLVa:KB] - Checked: 2009-12-28 (RLVa-1.1.0k) | Modified: RLVa-1.1.0k + if ( (rlv_handler_t::isEnabled()) && (LLToolCamera::getInstance()->hasMouseCapture()) && (gKeyboard->currentMask(TRUE) & MASK_ALT) ) + { + found = NULL; + } +// [/RLVa:KB] - { + if (!found) // if not found in HUD, look in world: + { found = gPipeline.lineSegmentIntersectInWorld(mouse_world_start, mouse_world_end, pick_transparent, face_hit, intersection, uv, normal, binormal); - } +// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Added: RLVa-1.1.0l +#ifdef RLV_EXTENSION_CMD_INTERACT + if ( (rlv_handler_t::isEnabled()) && (found) && (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) ) + { + // Allow picking if: + // - the drag-and-drop tool is active (allows inventory offers) + // - the camera tool is active + // - the pie tool is active *and* we picked our own avie (allows "mouse steering" and the self pie menu) + LLTool* pCurTool = LLToolMgr::getInstance()->getCurrentTool(); + if ( (LLToolDragAndDrop::getInstance() != pCurTool) && + (!LLToolCamera::getInstance()->hasMouseCapture()) && + ((LLToolPie::getInstance() != pCurTool) || (gAgent.getID() != found->getID())) ) + { + found = NULL; + } + } +#endif // RLV_EXTENSION_CMD_INTERACT +// [/RLVa:KB] + } } return found; diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 3be166e..d2aa3d8 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -96,7 +96,7 @@ #include "hippoLimits.h"// getMaxPrimScale // [RLVa:KB] -#include "llstartup.h" +#include "rlvhandler.h" // [/RLVa:KB] using namespace LLVOAvatarDefines; @@ -3473,10 +3473,10 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) BOOL render_name = visible_chat || (visible_avatar && // [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.0h - ( (!fRlvShowNames) || (RlvSettings::fShowNameTags) ) && + ( (!fRlvShowNames) || (RlvSettings::getShowNameTags()) ) && // [/RLVa:KB] ((sRenderName == RENDER_NAME_ALWAYS) || - (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME))); + (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME))); // If it's your own avatar, don't draw in mouselook, and don't // draw if we're specifically hiding our own name. if (mIsSelf) @@ -3506,7 +3506,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } else if (sRenderGroupTitles != mRenderGroupTitles) // [/RLVa] - //if (sRenderGroupTitles != mRenderGroupTitles) +// if (sRenderGroupTitles != mRenderGroupTitles) { mRenderGroupTitles = sRenderGroupTitles; new_name = TRUE; @@ -3662,7 +3662,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } else { - line = gRlvHandler.getAnonym(line.assign(firstname->getString()).append(" ").append(lastname->getString())); + line = RlvStrings::getAnonym(line.assign(firstname->getString()).append(" ").append(lastname->getString())); } // [/RLVa:KB] @@ -6746,14 +6746,6 @@ void LLVOAvatar::sitOnObject(LLViewerObject *sit_object) gPipeline.markMoved(mDrawable, TRUE); mIsSitting = TRUE; LLFloaterAO::ChangeStand(); -// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.1d - #ifdef RLV_EXTENSION_STARTLOCATION - if (rlv_handler_t::isEnabled()) - { - RlvSettings::updateLoginLastLocation(); - } - #endif // RLV_EXTENSION_STARTLOCATION -// [/RLVa:KB] mRoot.getXform()->setParent(&sit_object->mDrawable->mXform); // LLVOAvatar::sitOnObject mRoot.setPosition(getPosition()); mRoot.updateWorldMatrixChildren(); @@ -6762,6 +6754,15 @@ void LLVOAvatar::sitOnObject(LLViewerObject *sit_object) if (mIsSelf) { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.1d + #ifdef RLV_EXTENSION_STARTLOCATION + if (rlv_handler_t::isEnabled()) + { + RlvSettings::updateLoginLastLocation(); + } + #endif // RLV_EXTENSION_STARTLOCATION +// [/RLVa:KB] + // Might be first sit LLFirstUse::useSit(); @@ -6815,14 +6816,6 @@ void LLVOAvatar::getOffObject() gPipeline.markMoved(mDrawable, TRUE); mIsSitting = FALSE; -// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.1d - #ifdef RLV_EXTENSION_STARTLOCATION - if (rlv_handler_t::isEnabled()) - { - RlvSettings::updateLoginLastLocation(); - } - #endif // RLV_EXTENSION_STARTLOCATION -// [/RLVa:KB] mRoot.getXform()->setParent(NULL); // LLVOAvatar::getOffObject mRoot.setPosition(cur_position_world); mRoot.setRotation(cur_rotation_world); @@ -6833,6 +6826,15 @@ void LLVOAvatar::getOffObject() if (mIsSelf) { +// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.1d + #ifdef RLV_EXTENSION_STARTLOCATION + if (rlv_handler_t::isEnabled()) + { + RlvSettings::updateLoginLastLocation(); + } + #endif // RLV_EXTENSION_STARTLOCATION +// [/RLVa:KB] + LLQuaternion av_rot = gAgent.getFrameAgent().getQuaternion(); LLQuaternion obj_rot = sit_object ? sit_object->getRenderRotation() : LLQuaternion::DEFAULT; av_rot = av_rot * obj_rot; @@ -6908,6 +6910,20 @@ LLViewerObject* LLVOAvatar::getWornAttachment( const LLUUID& inv_item_id ) return NULL; } +// [RLVa:KB] - Checked: 2009-12-18 (RLVa-1.1.0i) | Added: RLVa-1.1.0i +LLViewerJointAttachment* LLVOAvatar::getWornAttachmentPoint(const LLUUID& inv_item_id) +{ + for (attachment_map_t::const_iterator itAttach = mAttachmentPoints.begin(); + itAttach != mAttachmentPoints.end(); ++itAttach) + { + LLViewerJointAttachment* pAttachPt = itAttach->second; + if (pAttachPt->getItemID() == inv_item_id) + return pAttachPt; + } + return NULL; +} +// [/RLVa:KB] + const std::string LLVOAvatar::getAttachedPointName(const LLUUID& inv_item_id) { for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); diff --git a/linden/indra/newview/llvoavatar.h b/linden/indra/newview/llvoavatar.h index 0c32244..50ce53a 100644 --- a/linden/indra/newview/llvoavatar.h +++ b/linden/indra/newview/llvoavatar.h @@ -288,6 +288,9 @@ public: BOOL isWearingAttachment( const LLUUID& inv_item_id ); LLViewerObject* getWornAttachment( const LLUUID& inv_item_id ); +// [RLVa:KB] - Checked: 2009-12-18 (RLVa-1.1.0i) | Added: RLVa-1.1.0i + LLViewerJointAttachment* getWornAttachmentPoint(const LLUUID& inv_item_id); +// [/RLVa:KB] const std::string getAttachedPointName(const LLUUID& inv_item_id); static LLVOAvatar* findAvatarFromAttachment( LLViewerObject* obj ); diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp index bed3e13..f3b8447 100644 --- a/linden/indra/newview/llvovolume.cpp +++ b/linden/indra/newview/llvovolume.cpp @@ -64,6 +64,10 @@ #include "llselectmgr.h" #include "pipeline.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + const S32 MIN_QUIET_FRAMES_COALESCE = 30; const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; const F32 FORCE_CULL_AREA = 8.f; diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp index e12bd08..443ee74 100644 --- a/linden/indra/newview/llworldmapview.cpp +++ b/linden/indra/newview/llworldmapview.cpp @@ -64,6 +64,9 @@ #include "lltexturefetch.h" #include "llappviewer.h" // Only for constants! #include "lltrans.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] #include "llglheaders.h" @@ -696,7 +699,7 @@ void LLWorldMapView::draw() // [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-07-04 (RLVa-1.0.0a) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { - mesg = rlv_handler_t::cstrHidden; + mesg = RlvStrings::getString(RLV_STRING_HIDDEN); } else if (info->mAccess == SIM_ACCESS_DOWN) // [/RLVa:KB] @@ -1285,7 +1288,7 @@ BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* stic // [RLVa:KB] - Alternate: Snowglobe-1.0 | Checked: 2009-07-04 (RLVa-1.0.0a) std::string message = llformat("%s (%s)", - (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? info->mName.c_str() : rlv_handler_t::cstrHidden.c_str(), + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? info->mName.c_str() : RlvStrings::getString(RLV_STRING_HIDDEN).c_str(), LLViewerRegion::accessToString(info->mAccess).c_str()); // [/RLVa:KB] diff --git a/linden/indra/newview/panelradar.cpp b/linden/indra/newview/panelradar.cpp index ce91da2..8ff5fad 100644 --- a/linden/indra/newview/panelradar.cpp +++ b/linden/indra/newview/panelradar.cpp @@ -57,7 +57,9 @@ #include "llvoavatar.h" #include "llworld.h" #include "panelradarentry.h" - +// [RLVa:KB] - Alternate: Imprudence-1.2.0 +#include "rlvhandler.h" +// [/RLVa:KB] PanelRadar::PanelRadar() : @@ -303,7 +305,7 @@ void PanelRadar::updateRadarDisplay() // [RLVa:KB] - Alternate: Imprudence-1.2.0 element["columns"][0]["value"] = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) - ? gRlvHandler.getAnonym(entry->getName()) + ? RlvStrings::getAnonym(entry->getName()) : typing + entry->getName() + " " + mute_text; // [/RLVa:KB] element["columns"][1]["column"] = "avatar_distance"; diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index 0ca94dc..cf766e0 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp @@ -102,6 +102,10 @@ #include "llspatialpartition.h" #include "llmutelist.h" +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + #ifdef _DEBUG // Debug indices is disabled for now for debug performance - djs 4/24/02 //#define DEBUG_INDICES diff --git a/linden/indra/newview/rlvdefines.h b/linden/indra/newview/rlvdefines.h index 21d7105..df67a55 100644 --- a/linden/indra/newview/rlvdefines.h +++ b/linden/indra/newview/rlvdefines.h @@ -1,3 +1,19 @@ +/** + * + * Copyright (c) 2009-2010, Kitty Barnett + * + * The source code in this file is provided to you under the terms of the + * GNU General Public License, version 2.0, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. Terms of the GPL can be found in doc/GPL-license.txt + * in this distribution, or online at http://www.gnu.org/licenses/gpl-2.0.txt + * + * By copying, modifying or distributing this software, you acknowledge that + * you have read and understood your obligations described above, and agree to + * abide by those obligations. + * + */ + #ifndef RLV_DEFINES_H #define RLV_DEFINES_H @@ -10,8 +26,7 @@ // Comment out if you provide your own way to enable/disable RLVa #define RLV_ADVANCED_TOGGLE_RLVA -// Provides access to "advanced" feature through the RLVa debug menu -#define RLV_EXTENSION_ENABLE_WEAR // "Enable Wear" +// Provides access to "advanced" features through the RLVa debug menu #define RLV_EXTENSION_FLOATER_RESTRICTIONS // Enables the Advanced / RLVa / Restrictions... floater #define RLV_EXTENSION_HIDELOCKED // "Hide locked layers", "Hide locked attachments" and "Hide locked inventory" @@ -19,41 +34,56 @@ #define RLV_EXTENSION_CMD_GETSETDEBUG_EX // Extends the debug variables accessible through @getdebug_xxx/@setdebug_xxx #define RLV_EXTENSION_CMD_FINDFOLDERS // @findfolders: