From 671625695fc44adc430a7ddf3be158ce26a61cc6 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 2 Jun 2010 20:46:16 +0300 Subject: EXT-6726 WIP Added more menus to the Appearance SP. Done: - Implemented creating new wearables via My Outfits gear menu. - Implemented renaming/removing/editing an outfit via My Outfits context menu. - Implemented "Attach to..." / "Attach to HUD..." context submenus. - Now disabling (instead of hiding) irrelevant wearable context menu items. - Added "Take Off / Detach" context menu item that's shown for clothes and attachments. Useful if you selected a bunch of items and want to take them all off. - Fixed taking off an outfit (not all wearables were taken off because of a wrong inventory collector). - Fixed crash when editing a skirt (reference to a missing string). - In LLWearableItemsList::ContextMenu::updateItemsVisibility renamed variables and introduced MASK_UNKNOWN per Nyx's request. Known issues: - "Attach to..." context menus may be displayed partially off-screen (there is the same bug in the inventory panel). - The way we invoke wearable editing panel after the wearable gets created is currently a hack. TODO: - Wear / take off / rename / delete an outfit via My Outfits gear menu (currently not implemented because of missing selection support in My Outfits). - Add "Create new..." to body part / clothing context menu in Edit Outfit. - Add "Create new..." submenus to the Edit Outfit gear menu. Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/466/ --HG-- branch : product-engine --- indra/newview/llagentwearables.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index e5796f8e63..d2a01aba16 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1973,6 +1973,32 @@ bool LLAgentWearables::moveWearable(const LLViewerInventoryItem* item, bool clos return false; } +// static +void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, const LLUUID& parent_id) +{ + LLWearable* wearable = LLWearableList::instance().createNewWearable(type); + LLAssetType::EType asset_type = wearable->getAssetType(); + LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE; + LLPointer cb = wear ? new WearOnAvatarCallback : NULL; + LLUUID folder_id; + + if (parent_id.notNull()) + { + folder_id = parent_id; + } + else + { + LLFolderType::EType folder_type = LLFolderType::assetTypeToFolderType(asset_type); + folder_id = gInventory.findCategoryUUIDForType(folder_type); + } + + create_inventory_item(gAgent.getID(), gAgent.getSessionID(), + folder_id, wearable->getTransactionID(), wearable->getName(), + wearable->getDescription(), asset_type, inv_type, wearable->getType(), + wearable->getPermissions().getMaskNextOwner(), + cb); +} + // static void LLAgentWearables::editWearable(const LLUUID& item_id) { -- cgit v1.2.3