diff options
| author | Erik Kundiman <erik@megapahit.org> | 2025-07-03 10:31:01 +0800 | 
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2025-07-03 10:31:01 +0800 | 
| commit | 40de4208328bcac51782302e7028ec2dd057224e (patch) | |
| tree | 4525dba29f0f62bdc400341c70bdecfd9123fb2c /indra/newview | |
| parent | a89991feac78b87d784dde742a17e67772856d18 (diff) | |
Partial @detach=<y/n> command implementation
Only greying out the detach option on the contextual menu popped up by
right clicking the attachment in the 3D view/world, and not yet
preventing detachment from the inventory/wearing panels.
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llviewermenu.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llviewerobject.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/llviewerobject.h | 4 | ||||
| -rw-r--r-- | indra/newview/rlvdefines.h | 1 | ||||
| -rw-r--r-- | indra/newview/rlvhandler.cpp | 8 | ||||
| -rw-r--r-- | indra/newview/rlvhelper.cpp | 1 | 
6 files changed, 16 insertions, 0 deletions
| diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index cb2a8a54b7..c3bb8ef4c4 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7700,6 +7700,7 @@ bool enable_detach(const LLSD&)      // Only enable detach if all faces of object are selected      if (!object ||          !object->isAttachment() || +        object->isLocked() ||          !LLSelectMgr::getInstance()->getSelection()->contains(object,SELECT_ALL_TES ))      {          return false; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 8d90187e91..d64c0aa0d5 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -310,6 +310,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe      mAttachmentItemID(LLUUID::null),      mLastUpdateType(OUT_UNKNOWN),      mLastUpdateCached(false), +    mLocked(false),      mCachedMuteListUpdateTime(0),      mCachedOwnerInMuteList(false),      mRiggedAttachedWarned(false) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 2b52ea2076..972f8cf846 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -974,10 +974,14 @@ public:      LLJointRiggingInfoTab mJointRiggingInfoTab; +    bool isLocked() const       { return mLocked; } +    void setLocked(bool locked) { mLocked = locked; } +  private:      LLUUID mAttachmentItemID; // ItemID of the associated object is in user inventory.      EObjectUpdateType   mLastUpdateType;      bool    mLastUpdateCached; +    bool    mLocked;  public:      // reflection probe state diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 132aae9b2c..c6ba135f3e 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -97,6 +97,7 @@ namespace Rlv          Sit,          SitGround,          Unsit, +        Detach,          GetCommand,          Count, diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 122a87ec43..67739ec72f 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -32,6 +32,7 @@  #include "llviewercontrol.h"  #include "llviewermenu.h"  #include "llviewerobject.h" +#include "llviewerobjectlist.h"  #include "rlvcommon.h"  #include "rlvhandler.h" @@ -294,4 +295,11 @@ ECmdRet BehaviourToggleHandler<EBehaviour::Unsit>::onCommand(const RlvCommand& r      return ECmdRet::Succeeded;  } +template<> template<> +ECmdRet BehaviourToggleHandler<EBehaviour::Detach>::onCommand(const RlvCommand& rlvCmd, bool& toggle) +{ +    gObjectList.findObject(rlvCmd.getObjectID())->setLocked(!toggle); +    return ECmdRet::Succeeded; +} +  // ============================================================================ diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index ccb4675cbb..b4abbc04f3 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -63,6 +63,7 @@ BehaviourDictionary::BehaviourDictionary()      // AddRem      addEntry(new BehaviourProcessor<EBehaviour::Sit>("sit"));      addEntry(new BehaviourProcessor<EBehaviour::Unsit>("unsit")); +    addEntry(new BehaviourProcessor<EBehaviour::Detach>("detach"));      // Populate mString2InfoMap (the tuple <behaviour, type> should be unique)      for (const BehaviourInfo* bhvr_info_p : mBhvrInfoList) | 
