summaryrefslogtreecommitdiff
path: root/indra/newview/rlvhandler.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-07-23 22:31:19 +0800
committerErik Kundiman <erik@megapahit.org>2025-07-23 22:31:19 +0800
commit145ae5aeea43080bbf14de66d3d3886e01b8bb34 (patch)
treeeae8c98ec4990349009f951ea8a4f3fe0abf19e6 /indra/newview/rlvhandler.cpp
parentf31e224bbd8bf522542a16ec116f21de12a397ef (diff)
Reorganise shared macros closer to "attach" codeHEADmain
and reindent the appearance manager functions to call to match how they will be placed on the combining macro.
Diffstat (limited to 'indra/newview/rlvhandler.cpp')
-rw-r--r--indra/newview/rlvhandler.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp
index 8eee7e36a6..2cc06b3bbc 100644
--- a/indra/newview/rlvhandler.cpp
+++ b/indra/newview/rlvhandler.cpp
@@ -307,6 +307,30 @@ ECmdRet ForceHandler<EBehaviour::Unsit>::onCommand(const RlvCommand& rlvCmd)
return ECmdRet::Succeeded;
}
+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;
+}
+
#define RESTRAINED_LOVE_OUTFIT(A) \
auto folderID = gInventory.getRootFolderID();\
LLNameCategoryCollector has_name("#RLV");\
@@ -334,34 +358,10 @@ ECmdRet ForceHandler<EBehaviour::Unsit>::onCommand(const RlvCommand& rlvCmd)
return ECmdRet::Succeeded;
#define RESTRAINED_LOVE_REPLACE \
- LLAppearanceMgr::instance().replaceCurrentOutfit(folderID);
+ LLAppearanceMgr::instance().replaceCurrentOutfit(folderID);
#define RESTRAINED_LOVE_ADD \
- 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;
-}
+ LLAppearanceMgr::instance().addCategoryToCurrentOutfit(folderID);
template<> template<>
ECmdRet ForceHandler<EBehaviour::Attach>::onCommand(const RlvCommand& rlvCmd)