From f31e224bbd8bf522542a16ec116f21de12a397ef Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Wed, 23 Jul 2025 22:21:54 +0800 Subject: Minimal @remoutfit[:]=force implementation Copying from LLEditTakeOff implementation in llviewermenu.cpp. --- indra/newview/rlvdefines.h | 1 + indra/newview/rlvhandler.cpp | 24 ++++++++++++++++++++++++ indra/newview/rlvhelper.cpp | 1 + 3 files changed, 26 insertions(+) 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 @@ -339,6 +339,30 @@ ECmdRet ForceHandler::onCommand(const RlvCommand& rlvCmd) #define RESTRAINED_LOVE_ADD \ LLAppearanceMgr::instance().addCategoryToCurrentOutfit(folderID); +template<> template<> +ECmdRet ForceHandler::onCommand(const RlvCommand& rlvCmd) +{ + std::vector 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::onCommand(const RlvCommand& rlvCmd) { 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("sit")); addEntry(new ForceProcessor("sitground")); addEntry(new ForceProcessor("unsit")); + addEntry(new ForceProcessor("remoutfit")); addEntry(new ForceProcessor("attach")); addEntry(new ForceProcessor("attachover")); addEntry(new ForceProcessor("detach")); -- cgit v1.2.3