summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/rlvdefines.h1
-rw-r--r--indra/newview/rlvhandler.cpp27
-rw-r--r--indra/newview/rlvhelper.cpp1
3 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h
index 5161e9241c..5de428d093 100644
--- a/indra/newview/rlvdefines.h
+++ b/indra/newview/rlvdefines.h
@@ -99,6 +99,7 @@ namespace Rlv
Unsit,
Detach,
GetInv,
+ Attach,
GetCommand,
Count,
diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp
index 413d3758e4..f3306b0f21 100644
--- a/indra/newview/rlvhandler.cpp
+++ b/indra/newview/rlvhandler.cpp
@@ -304,6 +304,33 @@ ECmdRet ForceHandler<EBehaviour::Unsit>::onCommand(const RlvCommand& rlvCmd)
return ECmdRet::Succeeded;
}
+template<> template<>
+ECmdRet ForceHandler<EBehaviour::Attach>::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().replaceCurrentOutfit(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 9f71d81206..bba1c4c6fd 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::Attach>("attach"));
// AddRem
addEntry(new BehaviourProcessor<EBehaviour::Sit>("sit"));