void onTakeOff() { // Take off selected items if there are any if (mOutfitList->hasItemSelected()) { uuid_vec_t selected_uuids; mOutfitList->getSelectedItemsUUIDs(selected_uuids); for (uuid_vec_t::const_iterator it=selected_uuids.begin(); it != selected_uuids.end(); ++it) { if (get_is_item_worn(*it)) { LLAppearanceMgr::instance().removeItemFromAvatar(*it); } } } else // or take off the whole selected outfit if no items specified. { const LLUUID& selected_outfit_id = getSelectedOutfitID(); if (selected_outfit_id.notNull()) { LLAppearanceMgr::instance().takeOffOutfit(selected_outfit_id); } } }
void onRename() { const LLUUID& selected_outfit_id = getSelectedOutfitID(); if (selected_outfit_id.notNull()) { LLAppearanceMgr::instance().renameOutfit(selected_outfit_id); } }
void onDelete() { const LLUUID& selected_outfit_id = getSelectedOutfitID(); if (selected_outfit_id.notNull()) { remove_category(&gInventory, selected_outfit_id); } }
void onTakeOff() { // Take off selected outfit. const LLUUID& selected_outfit_id = getSelectedOutfitID(); if (selected_outfit_id.notNull()) { LLAppearanceMgr::instance().takeOffOutfit(selected_outfit_id); } }
void onAdd() { const LLUUID& selected_id = getSelectedOutfitID(); if (selected_id.notNull()) { LLAppearanceMgr::getInstance()->addCategoryToCurrentOutfit(selected_id); } }
void updateItemsVisibility() { if (!mMenu) return; bool have_selection = getSelectedOutfitID().notNull(); mMenu->setItemVisible("sepatator1", have_selection); mMenu->setItemVisible("sepatator2", have_selection); mMenu->arrangeAndClear(); // update menu height }
//-TT Patch: ReplaceWornItemsOnly void onReplaceItems() { const LLUUID& selected_id = getSelectedOutfitID(); if (selected_id.notNull()) { //LLAppearanceMgr::getInstance()->replaceCategoryInCurrentOutfit(selected_id); } }
LLViewerInventoryCategory* getSelectedOutfit() { const LLUUID& selected_outfit_id = getSelectedOutfitID(); if (selected_outfit_id.isNull()) { return NULL; } LLViewerInventoryCategory* cat = gInventory.getCategory(selected_outfit_id); return cat; }
bool onVisible(LLSD::String param) { const LLUUID& selected_outfit_id = getSelectedOutfitID(); if (selected_outfit_id.isNull()) // no selection or invalid outfit selected { return false; } // *TODO This condition leads to menu item behavior inconsistent with // "Wear" button behavior and should be modified or removed. bool is_worn = LLAppearanceMgr::instance().getBaseOutfitUUID() == selected_outfit_id; if ("wear" == param) { return !is_worn; } return true; }