diff options
-rw-r--r-- | indra/newview/rlvdefines.h | 1 | ||||
-rw-r--r-- | indra/newview/rlvhandler.cpp | 27 | ||||
-rw-r--r-- | indra/newview/rlvhelper.cpp | 1 |
3 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 5de428d093..649aa75d14 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -100,6 +100,7 @@ namespace Rlv Detach, GetInv, Attach, + AttachOver, GetCommand, Count, diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index f3306b0f21..066543987f 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -331,6 +331,33 @@ ECmdRet ForceHandler<EBehaviour::Attach>::onCommand(const RlvCommand& rlvCmd) return ECmdRet::Succeeded; } +template<> template<> +ECmdRet ForceHandler<EBehaviour::AttachOver>::onCommand(const RlvCommand& rlvCmd) +{ + auto rlvFolderID = findDescendentCategoryIDByName(gInventory.getRootFolderID(), "#RLV"); + if (rlvFolderID == LLUUID::null) + return ECmdRet::FailedNoSharedRoot; + std::vector<std::string> optionList; + auto option = rlvCmd.getOption(); + if (!option.empty()) + { + auto folderID = findDescendentCategoryIDByName(rlvFolderID, option); + if (folderID == LLUUID::null) + { + Util::parseStringList(option, optionList, "/"); + auto iter = optionList.begin(); + for(; optionList.end() != iter; ++iter) + { + auto name = *iter; + if (!name.empty()) + folderID = findDescendentCategoryIDByName(folderID, name); + } + } + LLAppearanceMgr::instance().addCategoryToCurrentOutfit(folderID); + } + return ECmdRet::Succeeded; +} + // AddRem ECmdRet CommandHandlerBaseImpl<EParamType::AddRem>::processCommand(const RlvCommand& rlvCmd, BhvrHandlerFunc* pHandler, BhvrToggleHandlerFunc* pToggleHandler) diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index bba1c4c6fd..4a0b394acb 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -61,6 +61,7 @@ BehaviourDictionary::BehaviourDictionary() addEntry(new ForceProcessor<EBehaviour::SitGround>("sitground")); addEntry(new ForceProcessor<EBehaviour::Unsit>("unsit")); addEntry(new ForceProcessor<EBehaviour::Attach>("attach")); + addEntry(new ForceProcessor<EBehaviour::AttachOver>("attachover")); // AddRem addEntry(new BehaviourProcessor<EBehaviour::Sit>("sit")); |