diff options
Diffstat (limited to 'linden/indra/newview/llfloatercustomize.cpp')
-rw-r--r-- | linden/indra/newview/llfloatercustomize.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/linden/indra/newview/llfloatercustomize.cpp b/linden/indra/newview/llfloatercustomize.cpp index ee83bf9..62ead8f 100644 --- a/linden/indra/newview/llfloatercustomize.cpp +++ b/linden/indra/newview/llfloatercustomize.cpp | |||
@@ -422,6 +422,8 @@ public: | |||
422 | static void onTextureCommit( LLUICtrl* ctrl, void* userdata ); | 422 | static void onTextureCommit( LLUICtrl* ctrl, void* userdata ); |
423 | static void onColorCommit( LLUICtrl* ctrl, void* userdata ); | 423 | static void onColorCommit( LLUICtrl* ctrl, void* userdata ); |
424 | static void onCommitSexChange( LLUICtrl*, void* userdata ); | 424 | static void onCommitSexChange( LLUICtrl*, void* userdata ); |
425 | static void onSelectAutoWearOption(S32 option, void* data); | ||
426 | |||
425 | 427 | ||
426 | 428 | ||
427 | private: | 429 | private: |
@@ -662,6 +664,11 @@ void LLPanelEditWearable::onBtnRevert( void* userdata ) | |||
662 | void LLPanelEditWearable::onBtnCreateNew( void* userdata ) | 664 | void LLPanelEditWearable::onBtnCreateNew( void* userdata ) |
663 | { | 665 | { |
664 | LLPanelEditWearable* self = (LLPanelEditWearable*) userdata; | 666 | LLPanelEditWearable* self = (LLPanelEditWearable*) userdata; |
667 | gViewerWindow->alertXml("AutoWearNewClothing", onSelectAutoWearOption, self); | ||
668 | } | ||
669 | void LLPanelEditWearable::onSelectAutoWearOption(S32 option, void* data) | ||
670 | { | ||
671 | LLPanelEditWearable* self = (LLPanelEditWearable*) data; | ||
665 | LLVOAvatar* avatar = gAgent.getAvatarObject(); | 672 | LLVOAvatar* avatar = gAgent.getAvatarObject(); |
666 | if(avatar) | 673 | if(avatar) |
667 | { | 674 | { |
@@ -673,14 +680,15 @@ void LLPanelEditWearable::onBtnCreateNew( void* userdata ) | |||
673 | // regular UI, items get created in normal folder | 680 | // regular UI, items get created in normal folder |
674 | folder_id = gInventory.findCategoryUUIDForType(asset_type); | 681 | folder_id = gInventory.findCategoryUUIDForType(asset_type); |
675 | 682 | ||
676 | LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback; | 683 | // Only auto wear the new item if the AutoWearNewClothing checkbox is selected. |
684 | LLPointer<LLInventoryCallback> cb = option == 0 ? | ||
685 | new WearOnAvatarCallback : NULL; | ||
677 | create_inventory_item(gAgent.getID(), gAgent.getSessionID(), | 686 | create_inventory_item(gAgent.getID(), gAgent.getSessionID(), |
678 | folder_id, wearable->getTransactionID(), wearable->getName(), wearable->getDescription(), | 687 | folder_id, wearable->getTransactionID(), wearable->getName(), wearable->getDescription(), |
679 | asset_type, LLInventoryType::IT_WEARABLE, wearable->getType(), | 688 | asset_type, LLInventoryType::IT_WEARABLE, wearable->getType(), |
680 | wearable->getPermissions().getMaskNextOwner(), cb); | 689 | wearable->getPermissions().getMaskNextOwner(), cb); |
681 | } | 690 | } |
682 | } | 691 | } |
683 | |||
684 | void LLPanelEditWearable::addColorSwatch( LLVOAvatar::ETextureIndex te, const LLString& name ) | 692 | void LLPanelEditWearable::addColorSwatch( LLVOAvatar::ETextureIndex te, const LLString& name ) |
685 | { | 693 | { |
686 | childSetCommitCallback(name, LLPanelEditWearable::onColorCommit, this); | 694 | childSetCommitCallback(name, LLPanelEditWearable::onColorCommit, this); |