EXP-271 FIX Implement slapp functionality for changing avatars

meow-7.2.2
callum 2010-10-21 16:55:15 -07:00
parent 2a2256e8b0
commit a0e3c4380d
1 changed files with 29 additions and 0 deletions

View File

@ -2943,3 +2943,32 @@ void wear_multiple(const uuid_vec_t& ids, bool replace)
}
}
// SLapp for easy-wearing of a stock (library) avatar
//
class LLWearFolderHandler : public LLCommandHandler
{
public:
// not allowed from outside the app
LLWearFolderHandler() : LLCommandHandler("wear_folder", UNTRUSTED_BLOCK) { }
bool handle(const LLSD& tokens, const LLSD& query_map,
LLMediaCtrl* web)
{
LLPointer<LLInventoryCategory> category = new LLInventoryCategory(query_map["folder_id"],
LLUUID::null,
LLFolderType::FT_CLOTHING,
"Quick Appearance");
LLSD::UUID folder_uuid = query_map["folder_id"].asUUID();
if ( gInventory.getCategory( folder_uuid ) != NULL )
{
LLAppearanceMgr::getInstance()->wearInventoryCategory(category, true, false);
// *TODOw: This may not be necessary if initial outfit is chosen already -- josh
gAgent.setGenderChosen(TRUE);
}
return true;
}
};
LLWearFolderHandler gWearFolderHandler;