Merge branch 'rlva/review' into rlva/development
commit
a1310d5ca5
|
|
@ -48,7 +48,9 @@
|
|||
#include "llviewerobject.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llviewerwindow.h"
|
||||
|
||||
// [RLVa:KB] - @edit
|
||||
#include "rlvactions.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
LLFloaterOpenObject::LLFloaterOpenObject(const LLSD& key)
|
||||
: LLFloater(key),
|
||||
|
|
@ -102,6 +104,16 @@ void LLFloaterOpenObject::refresh()
|
|||
BOOL enabled = FALSE;
|
||||
|
||||
LLSelectNode* node = mObjectSelection->getFirstRootNode();
|
||||
// [RLVa:KB] - @edit and @editobj
|
||||
if ( (RlvActions::isRlvEnabled()) && (node) && (!RlvActions::canEdit(node->getObject())) )
|
||||
{
|
||||
// If the floater was already open before getting edit restricted then a transient selection will allow manipulation
|
||||
// of the object's inventory without it getting selected by LLSelectMgr::deselectIfTooFar().
|
||||
// Killing the selection would result in the user not realizing why their right-click breaks so close the floater instead.
|
||||
closeFloater();
|
||||
return;
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
if (node)
|
||||
{
|
||||
name = node->mName;
|
||||
|
|
|
|||
|
|
@ -685,7 +685,10 @@ bool get_is_item_editable(const LLUUID& inv_item_id)
|
|||
case LLAssetType::AT_CLOTHING:
|
||||
return gAgentWearables.isWearableModifiable(inv_item_id);
|
||||
case LLAssetType::AT_OBJECT:
|
||||
return true;
|
||||
// [RLVa:KB] - @touch*
|
||||
return (!RlvActions::isRlvEnabled()) || ((isAgentAvatarValid()) && (RlvActions::canEdit(gAgentAvatarp->getWornAttachment(inv_item_id))));
|
||||
// [/RLVa:KB]
|
||||
// return true;
|
||||
default:
|
||||
return false;;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -999,7 +999,13 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item, U32 mask)
|
|||
LLUUID new_parent_id = item->getParentUUID();
|
||||
bool update_parent_on_server = false;
|
||||
|
||||
if (new_parent_id.isNull() && !LLApp::isExiting())
|
||||
// if (new_parent_id.isNull() && !LLApp::isExiting())
|
||||
// [SL:KB] - Patch: Appearance-Misc | Checked: Catznip-6.4
|
||||
// The problem seems to be the 'LogoutReply' message so don't reparent anything to the LNF folder
|
||||
// as soon as we've sent out the log out request (since the quitting state is only set >after< we
|
||||
// start processing the logout response)
|
||||
if ( (new_parent_id.isNull()) && (!LLAppViewer::instance()->logoutRequestSent()) && (!LLApp::isExiting()) )
|
||||
// [/SL:KB]
|
||||
{
|
||||
if (old_parent_id.isNull())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1214,11 +1214,11 @@ class LLAdvancedToggleWireframe : public view_listener_t
|
|||
{
|
||||
bool handleEvent(const LLSD& userdata)
|
||||
{
|
||||
// [RLVa:KB] - Checked: RLVa-2.0.0
|
||||
bool fRlvBlockWireframe = gRlvAttachmentLocks.hasLockedHUD();
|
||||
if ( (!gUseWireframe) && (fRlvBlockWireframe) )
|
||||
// [RLVa:KB] - @detach and @viewwireframe
|
||||
const bool fRlvCanViewWireframe = RlvActions::canViewWireframe();
|
||||
if ( (!gUseWireframe) && (!fRlvCanViewWireframe) )
|
||||
RlvUtil::notifyBlocked(RlvStringKeys::Blocked::Wireframe);
|
||||
set_use_wireframe( (!gUseWireframe) && (!fRlvBlockWireframe) );
|
||||
set_use_wireframe( (!gUseWireframe) && (fRlvCanViewWireframe) );
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
@ -2911,7 +2911,10 @@ bool enable_attachment_touch(const LLUUID& inv_item_id)
|
|||
if (isAgentAvatarValid())
|
||||
{
|
||||
const LLViewerObject* attach_obj = gAgentAvatarp->getWornAttachment(gInventory.getLinkedItemID(inv_item_id));
|
||||
return (attach_obj) && (attach_obj->flagHandleTouch());
|
||||
// [RLVa:KB] - @touch*
|
||||
return (attach_obj) && (attach_obj->flagHandleTouch()) && (!RlvActions::isRlvEnabled() || RlvActions::canTouch(attach_obj));
|
||||
// [/RLVa:KB]
|
||||
// return (attach_obj) && (attach_obj->flagHandleTouch());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -8672,8 +8675,8 @@ class LLViewHighlightTransparent : public view_listener_t
|
|||
bool handleEvent(const LLSD& userdata)
|
||||
{
|
||||
// LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha;
|
||||
// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c
|
||||
LLDrawPoolAlpha::sShowDebugAlpha = (!LLDrawPoolAlpha::sShowDebugAlpha) && (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT));
|
||||
// [RLVa:KB] - @edit and @viewtransparent
|
||||
LLDrawPoolAlpha::sShowDebugAlpha = (!LLDrawPoolAlpha::sShowDebugAlpha) && (RlvActions::canHighlightTransparent());
|
||||
// [/RLVa:KB]
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -460,6 +460,15 @@ public:
|
|||
camera_view_text = llformat("CameraAtAxis %f %f %f",
|
||||
(F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ]));
|
||||
|
||||
// [RLVa:KB] - @showloc
|
||||
if (!RlvActions::canShowLocation())
|
||||
{
|
||||
agent_center_text = RlvStrings::getString(RlvStringKeys::Hidden::Generic);
|
||||
agent_root_center_text = RlvStrings::getString(RlvStringKeys::Hidden::Generic);
|
||||
camera_center_text = RlvStrings::getString(RlvStringKeys::Hidden::Generic);
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
addText(xpos, ypos, agent_center_text); ypos += y_inc;
|
||||
addText(xpos, ypos, agent_root_center_text); ypos += y_inc;
|
||||
addText(xpos, ypos, agent_view_text); ypos += y_inc;
|
||||
|
|
|
|||
|
|
@ -584,6 +584,28 @@ bool RlvActions::canShowLocation()
|
|||
return !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// World (General)
|
||||
//
|
||||
|
||||
bool RlvActions::canHighlightTransparent()
|
||||
{
|
||||
// User cannot highlight transparent faces if:
|
||||
// - prevented from editing (exceptions are not taken into account)
|
||||
// - specifically prevented from highlight transparent faces
|
||||
return !gRlvHandler.hasBehaviour(RLV_BHVR_EDIT) && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC);
|
||||
}
|
||||
|
||||
bool RlvActions::canViewWireframe()
|
||||
{
|
||||
// User can use wireframe rendering if:
|
||||
// - no HUD attachment is (remove) locked
|
||||
// - not specifically prevented from using wireframe mode
|
||||
return
|
||||
!gRlvAttachmentLocks.hasLockedHUD() && // Trivial function so no overhead when RLV is not enabled
|
||||
!gRlvHandler.hasBehaviour(RLV_BHVR_VIEWWIREFRAME);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Helper functions
|
||||
//
|
||||
|
|
|
|||
|
|
@ -300,6 +300,20 @@ public:
|
|||
*/
|
||||
static bool canTouch(const LLViewerObject* pObj, const LLVector3& posOffset = LLVector3::zero);
|
||||
|
||||
// ===============
|
||||
// World (General)
|
||||
// ===============
|
||||
public:
|
||||
/*
|
||||
* Returns true if the user can highlight transparent faces
|
||||
*/
|
||||
static bool canHighlightTransparent();
|
||||
|
||||
/*
|
||||
* Returns true if the user can switch to wireframe rendering
|
||||
*/
|
||||
static bool canViewWireframe();
|
||||
|
||||
// ================
|
||||
// Helper functions
|
||||
// ================
|
||||
|
|
|
|||
|
|
@ -157,6 +157,8 @@ enum ERlvBehaviour {
|
|||
RLV_BHVR_BUY, // "buy"
|
||||
RLV_BHVR_EDIT, // "edit"
|
||||
RLV_BHVR_EDITOBJ, // "editobj"
|
||||
RLV_BHVR_VIEWTRANSPARENT,
|
||||
RLV_BHVR_VIEWWIREFRAME,
|
||||
RLV_BHVR_PAY, // "pay"
|
||||
RLV_BHVR_REZ, // "rez"
|
||||
RLV_BHVR_FARTOUCH, // "fartouch"
|
||||
|
|
|
|||
|
|
@ -2592,6 +2592,26 @@ void RlvBehaviourShowSelfToggleHandler::onCommandToggle(ERlvBehaviour eBvhr, boo
|
|||
gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode());
|
||||
}
|
||||
|
||||
// Handles: @viewtransparent toggles
|
||||
template<> template<>
|
||||
void RlvBehaviourToggleHandler<RLV_BHVR_VIEWTRANSPARENT>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
|
||||
{
|
||||
if (fHasBhvr)
|
||||
{
|
||||
LLDrawPoolAlpha::sShowDebugAlpha = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Handles: @viewwireframe toggles
|
||||
template<> template<>
|
||||
void RlvBehaviourToggleHandler<RLV_BHVR_VIEWWIREFRAME>::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr)
|
||||
{
|
||||
if (fHasBhvr)
|
||||
{
|
||||
set_use_wireframe(false);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Command handlers (RLV_TYPE_FORCE)
|
||||
//
|
||||
|
|
|
|||
|
|
@ -101,6 +101,8 @@ RlvBehaviourDictionary::RlvBehaviourDictionary()
|
|||
addEntry(new RlvBehaviourInfo("detachallthis_except", RLV_BHVR_DETACHTHISEXCEPT, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_SUBTREE));
|
||||
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_EDIT, RLV_OPTION_NONE_OR_EXCEPTION>("edit"));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_EXCEPTION>("editobj", RLV_BHVR_EDITOBJ));
|
||||
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_VIEWTRANSPARENT, RLV_OPTION_NONE>("viewtransparent", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
|
||||
addEntry(new RlvBehaviourGenericToggleProcessor<RLV_BHVR_VIEWWIREFRAME, RLV_OPTION_NONE>("viewwireframe", RlvBehaviourInfo::BHVR_EXPERIMENTAL));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("emote", RLV_BHVR_EMOTE));
|
||||
addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_MODIFIER>("fartouch", RLV_BHVR_FARTOUCH));
|
||||
addModifier(RLV_BHVR_FARTOUCH, RLV_MODIFIER_FARTOUCHDIST, new RlvBehaviourModifier("Fartouch Distance", RLV_MODIFIER_FARTOUCH_DEFAULT, true, new RlvBehaviourModifierCompMin));
|
||||
|
|
|
|||
Loading…
Reference in New Issue