diff options
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 102 |
1 files changed, 10 insertions, 92 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 053a8d19e5..55b1fa6b49 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7449,52 +7449,10 @@ class LLEditEnableTakeOff : public view_listener_t bool handleEvent(const LLSD& userdata) { std::string clothing = userdata.asString(); - bool new_value = false; - if (clothing == "shirt") - { - new_value = LLAgentWearables::selfHasWearable(WT_SHIRT); - } - if (clothing == "pants") - { - new_value = LLAgentWearables::selfHasWearable(WT_PANTS); - } - if (clothing == "shoes") - { - new_value = LLAgentWearables::selfHasWearable(WT_SHOES); - } - if (clothing == "socks") - { - new_value = LLAgentWearables::selfHasWearable(WT_SOCKS); - } - if (clothing == "jacket") - { - new_value = LLAgentWearables::selfHasWearable(WT_JACKET); - } - if (clothing == "gloves") - { - new_value = LLAgentWearables::selfHasWearable(WT_GLOVES); - } - if (clothing == "undershirt") - { - new_value = LLAgentWearables::selfHasWearable(WT_UNDERSHIRT); - } - if (clothing == "underpants") - { - new_value = LLAgentWearables::selfHasWearable(WT_UNDERPANTS); - } - if (clothing == "skirt") - { - new_value = LLAgentWearables::selfHasWearable(WT_SKIRT); - } - if (clothing == "alpha") - { - new_value = LLAgentWearables::selfHasWearable(WT_ALPHA); - } - if (clothing == "tattoo") - { - new_value = LLAgentWearables::selfHasWearable(WT_TATTOO); - } - return new_value; + EWearableType type = LLWearableDictionary::typeNameToType(clothing); + if (type >= WT_SHAPE && type < WT_COUNT) + return LLAgentWearables::selfHasWearable(type); + return false; } }; @@ -7503,53 +7461,13 @@ class LLEditTakeOff : public view_listener_t bool handleEvent(const LLSD& userdata) { std::string clothing = userdata.asString(); - if (clothing == "shirt") - { - LLAgentWearables::userRemoveWearable((void*)WT_SHIRT); - } - else if (clothing == "pants") - { - LLAgentWearables::userRemoveWearable((void*)WT_PANTS); - } - else if (clothing == "shoes") - { - LLAgentWearables::userRemoveWearable((void*)WT_SHOES); - } - else if (clothing == "socks") - { - LLAgentWearables::userRemoveWearable((void*)WT_SOCKS); - } - else if (clothing == "jacket") - { - LLAgentWearables::userRemoveWearable((void*)WT_JACKET); - } - else if (clothing == "gloves") - { - LLAgentWearables::userRemoveWearable((void*)WT_GLOVES); - } - else if (clothing == "undershirt") - { - LLAgentWearables::userRemoveWearable((void*)WT_UNDERSHIRT); - } - else if (clothing == "underpants") - { - LLAgentWearables::userRemoveWearable((void*)WT_UNDERPANTS); - } - else if (clothing == "skirt") - { - LLAgentWearables::userRemoveWearable((void*)WT_SKIRT); - } - else if (clothing == "alpha") - { - LLAgentWearables::userRemoveWearable((void*)WT_ALPHA); - } - else if (clothing == "tattoo") - { - LLAgentWearables::userRemoveWearable((void*)WT_TATTOO); - } - else if (clothing == "all") + if (clothing == "all") + LLAgentWearables::userRemoveAllClothes(); + else { - LLAgentWearables::userRemoveAllClothes(NULL); + EWearableType type = LLWearableDictionary::typeNameToType(clothing); + if (type >= WT_SHAPE && type < WT_COUNT) + LLAgentWearables::userRemoveWearable(type); } return true; } |