auto-accept to rlv from own objects

meow-7.2.2
livie 2026-01-10 01:37:16 +02:00
parent 5bfe6f57ae
commit b769f3b83c
4 changed files with 35 additions and 6 deletions

View File

@ -764,7 +764,7 @@ void LLSettingsBlender::update(const LLSettingsBase::BlendFactor& blendf)
F64 LLSettingsBlender::setBlendFactor(const LLSettingsBase::BlendFactor& blendf_in) F64 LLSettingsBlender::setBlendFactor(const LLSettingsBase::BlendFactor& blendf_in)
{ {
LLSettingsBase::TrackPosition blendf = (F32)blendf_in; LLSettingsBase::TrackPosition blendf = (F32)blendf_in;
llassert(!isnan(blendf)); llassert(!std::isnan(blendf));
if (blendf >= 1.0) if (blendf >= 1.0)
{ {
triggerComplete(); triggerComplete();

View File

@ -32,6 +32,7 @@
#include <map> #include <map>
#include <vector> #include <vector>
#include <boost/signals2.hpp> #include <boost/signals2.hpp>
#include <cmath>
#include "llsd.h" #include "llsd.h"
#include "llsdutil.h" #include "llsdutil.h"

View File

@ -2,6 +2,17 @@
<llsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <llsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="llsd.xsd"> xsi:noNamespaceSchemaLocation="llsd.xsd">
<map> <map>
<key>FSMeowAutoAcceptRLVFromOwnObjects</key>
<map>
<key>Comment</key>
<string>Allows auto-accepting inventory offers to #RLV from own objects</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<string>1</string>
</map>
<key>FSTrishMouseLookFix</key> <key>FSTrishMouseLookFix</key>
<map> <map>
<key>Comment</key> <key>Comment</key>

View File

@ -224,6 +224,7 @@ void inventory_offer_handler(LLOfferInfo* info)
return; return;
} }
static LLCachedControl<bool> fsMeowAutoAcceptRlvFromOwnObjects(gSavedSettings, "FSMeowAutoAcceptRLVFromOwnObjects");
bool bAutoAccept(false); bool bAutoAccept(false);
// Avoid the Accept/Discard dialog if the user so desires. JC // Avoid the Accept/Discard dialog if the user so desires. JC
@ -236,13 +237,29 @@ void inventory_offer_handler(LLOfferInfo* info)
// </FS:Ansariel> Auto-accept any kind of inventory (FIRE-4128) // </FS:Ansariel> Auto-accept any kind of inventory (FIRE-4128)
// [RLVa:KB] // [RLVa:KB]
// Don't auto-accept give-to-RLV inventory offers // Don't auto-accept give-to-RLV inventory offers
if ( (gSavedSettings.getBOOL("AutoAcceptNewInventory")) && if ( (gSavedSettings.getBOOL("AutoAcceptNewInventory")) )
( (!rlv_handler_t::isEnabled()) || (!RlvInventory::instance().isGiveToRLVOffer(*info)) ) )
// [/RLVa:KB] // [/RLVa:KB]
{ {
// For certain types, just accept the items into the inventory, if (rlv_handler_t::isEnabled() && RlvInventory::instance().isGiveToRLVOffer(*info))
// and possibly open them on receipt depending upon "ShowNewInventory". {
bAutoAccept = true; if (info->mFromObject && info->mFromID == gAgentID && fsMeowAutoAcceptRlvFromOwnObjects && !RlvSettings::getForbidGiveToRLV())
{
bAutoAccept = true;
const LLUUID& idRlvRoot = RlvInventory::instance().getSharedRootID();
if (idRlvRoot.notNull())
info->mFolderID = idRlvRoot;
RlvGiveToRLVTaskOffer* pOfferObserver = new RlvGiveToRLVTaskOffer(info->mTransactionID);
gInventory.addObserver(pOfferObserver);
}
}
else
{
// For certain types, just accept the items into the inventory,
// and possibly open them on receipt depending upon "ShowNewInventory".
bAutoAccept = true;
}
} }
// Strip any SLURL from the message display. (DEV-2754) // Strip any SLURL from the message display. (DEV-2754)