From a408bac29378072fbf36864164149458c978cfcc Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:59 -0500 Subject: Second Life viewer sources 1.17.1.0 --- linden/indra/newview/llfloatercustomize.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'linden/indra/newview/llfloatercustomize.cpp') 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: static void onTextureCommit( LLUICtrl* ctrl, void* userdata ); static void onColorCommit( LLUICtrl* ctrl, void* userdata ); static void onCommitSexChange( LLUICtrl*, void* userdata ); + static void onSelectAutoWearOption(S32 option, void* data); + private: @@ -662,6 +664,11 @@ void LLPanelEditWearable::onBtnRevert( void* userdata ) void LLPanelEditWearable::onBtnCreateNew( void* userdata ) { LLPanelEditWearable* self = (LLPanelEditWearable*) userdata; + gViewerWindow->alertXml("AutoWearNewClothing", onSelectAutoWearOption, self); +} +void LLPanelEditWearable::onSelectAutoWearOption(S32 option, void* data) +{ + LLPanelEditWearable* self = (LLPanelEditWearable*) data; LLVOAvatar* avatar = gAgent.getAvatarObject(); if(avatar) { @@ -673,14 +680,15 @@ void LLPanelEditWearable::onBtnCreateNew( void* userdata ) // regular UI, items get created in normal folder folder_id = gInventory.findCategoryUUIDForType(asset_type); - LLPointer cb = new WearOnAvatarCallback; + // Only auto wear the new item if the AutoWearNewClothing checkbox is selected. + LLPointer cb = option == 0 ? + new WearOnAvatarCallback : NULL; create_inventory_item(gAgent.getID(), gAgent.getSessionID(), folder_id, wearable->getTransactionID(), wearable->getName(), wearable->getDescription(), asset_type, LLInventoryType::IT_WEARABLE, wearable->getType(), wearable->getPermissions().getMaskNextOwner(), cb); } } - void LLPanelEditWearable::addColorSwatch( LLVOAvatar::ETextureIndex te, const LLString& name ) { childSetCommitCallback(name, LLPanelEditWearable::onColorCommit, this); -- cgit v1.1