summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-07-23 22:21:54 +0800
committerErik Kundiman <erik@megapahit.org>2025-07-23 22:21:54 +0800
commitf31e224bbd8bf522542a16ec116f21de12a397ef (patch)
tree6078d8eae43d9c835ba3e57d1149d7a8b0992855
parent4ad9d65514374006a9474c9fd42254c95680458f (diff)
Minimal @remoutfit[:<part>]=force implementation
Copying from LLEditTakeOff implementation in llviewermenu.cpp.
-rw-r--r--indra/newview/rlvdefines.h1
-rw-r--r--indra/newview/rlvhandler.cpp24
-rw-r--r--indra/newview/rlvhelper.cpp1
3 files changed, 26 insertions, 0 deletions
diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h
index 649aa75d14..4437adcf1b 100644
--- a/indra/newview/rlvdefines.h
+++ b/indra/newview/rlvdefines.h
@@ -98,6 +98,7 @@ namespace Rlv
SitGround,
Unsit,
Detach,
+ RemOutfit,
GetInv,
Attach,
AttachOver,
diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp
index 14343143cd..8eee7e36a6 100644
--- a/indra/newview/rlvhandler.cpp
+++ b/indra/newview/rlvhandler.cpp
@@ -340,6 +340,30 @@ ECmdRet ForceHandler<EBehaviour::Unsit>::onCommand(const RlvCommand& rlvCmd)
LLAppearanceMgr::instance().addCategoryToCurrentOutfit(folderID);
template<> template<>
+ECmdRet ForceHandler<EBehaviour::RemOutfit>::onCommand(const RlvCommand& rlvCmd)
+{
+ std::vector<std::string> optionList;
+ auto option = rlvCmd.getOption();
+ if (option.empty())
+ {
+ LLAppearanceMgr::instance().removeAllClothesFromAvatar();
+ }
+ else
+ {
+ LLWearableType::EType type = LLWearableType::getInstance()->typeNameToType(option);
+ if (type >= LLWearableType::WT_SHAPE
+ && type < LLWearableType::WT_COUNT
+ && (gAgentWearables.getWearableCount(type) > 0))
+ {
+ U32 wearable_index = gAgentWearables.getWearableCount(type) - 1;
+ LLUUID item_id = gAgentWearables.getWearableItemID(type,wearable_index);
+ LLAppearanceMgr::instance().removeItemFromAvatar(item_id);
+ }
+ }
+ return ECmdRet::Succeeded;
+}
+
+template<> template<>
ECmdRet ForceHandler<EBehaviour::Attach>::onCommand(const RlvCommand& rlvCmd)
{
RESTRAINED_LOVE_OUTFIT(RESTRAINED_LOVE_REPLACE);
diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp
index 53f07b9bd3..2c14434194 100644
--- a/indra/newview/rlvhelper.cpp
+++ b/indra/newview/rlvhelper.cpp
@@ -60,6 +60,7 @@ BehaviourDictionary::BehaviourDictionary()
addEntry(new ForceProcessor<EBehaviour::Sit>("sit"));
addEntry(new ForceProcessor<EBehaviour::SitGround>("sitground"));
addEntry(new ForceProcessor<EBehaviour::Unsit>("unsit"));
+ addEntry(new ForceProcessor<EBehaviour::RemOutfit>("remoutfit"));
addEntry(new ForceProcessor<EBehaviour::Attach>("attach"));
addEntry(new ForceProcessor<EBehaviour::AttachOver>("attachover"));
addEntry(new ForceProcessor<EBehaviour::Detach>("detach"));