diff options
Diffstat (limited to 'indra/newview/lloutfitgallery.cpp')
-rw-r--r-- | indra/newview/lloutfitgallery.cpp | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index b1b9f69f4f..7482890d1e 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -739,13 +739,16 @@ void LLOutfitGallery::onFilterSubStringChanged(const std::string& new_string, co void LLOutfitGallery::onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id) { - if (mOutfitMap[base_id]) + auto base_it = mOutfitMap.find(base_id); + if (base_it != mOutfitMap.end()) { - mOutfitMap[base_id]->setOutfitWorn(true); + base_it->second->setOutfitWorn(true); } - if (mOutfitMap[prev_id]) + + auto prev_it = mOutfitMap.find(prev_id); + if (prev_it != mOutfitMap.end()) { - mOutfitMap[prev_id]->setOutfitWorn(false); + prev_it->second->setOutfitWorn(false); } } @@ -859,13 +862,16 @@ void LLOutfitGallery::onChangeOutfitSelection(LLWearableItemsList* list, const L { if (mSelectedOutfitUUID == category_id) return; - if (mOutfitMap[mSelectedOutfitUUID]) + + auto selected_it = mOutfitMap.find(mSelectedOutfitUUID); + if (selected_it != mOutfitMap.end()) { - mOutfitMap[mSelectedOutfitUUID]->setSelected(false); + selected_it->second->setSelected(false); } - if (mOutfitMap[category_id]) + auto category_it = mOutfitMap.find(category_id); + if (category_it != mOutfitMap.end()) { - mOutfitMap[category_id]->setSelected(true); + category_it->second->setSelected(true); } // mSelectedOutfitUUID will be set in LLOutfitListBase::ChangeOutfitSelection } @@ -887,9 +893,10 @@ bool LLOutfitGallery::canWearSelected() bool LLOutfitGallery::hasDefaultImage(const LLUUID& outfit_cat_id) { - if (mOutfitMap[outfit_cat_id]) + auto outfit_it = mOutfitMap.find(outfit_cat_id); + if (outfit_it != mOutfitMap.end()) { - return mOutfitMap[outfit_cat_id]->isDefaultImage(); + return outfit_it->second->isDefaultImage(); } return false; } @@ -937,6 +944,7 @@ LLOutfitGalleryItem::~LLOutfitGalleryItem() bool LLOutfitGalleryItem::postBuild() { + mPreviewIcon = getChild<LLIconCtrl>("preview_outfit"); setDefaultImage(); mOutfitNameText = getChild<LLTextBox>("outfit_name"); @@ -952,10 +960,12 @@ void LLOutfitGalleryItem::draw() LLPanel::draw(); // Draw border - LLUIColor border_color = LLUIColorTable::instance().getColor(mSelected ? "OutfitGalleryItemSelected" : "OutfitGalleryItemUnselected", LLColor4::white); - LLRect border = getChildView("preview_outfit")->getRect(); + static LLUIColor selected_color = LLUIColorTable::instance().getColor("OutfitGalleryItemSelected", LLColor4::white); + static LLUIColor unselected_color = LLUIColorTable::instance().getColor("OutfitGalleryItemUnselected", LLColor4::white); + const LLColor4& border_color = mSelected ? selected_color : unselected_color; + LLRect border = mPreviewIcon->getRect(); border.mRight = border.mRight + 1; - gl_rect_2d(border, border_color.get(), false); + gl_rect_2d(border, border_color, false); // If the floater is focused, don't apply its alpha to the texture (STORM-677). const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); @@ -1111,7 +1121,7 @@ bool LLOutfitGalleryItem::setImageAssetId(LLUUID image_asset_id) { mImageAssetId = image_asset_id; mTexturep = texture; - getChildView("preview_outfit")->setVisible(false); + mPreviewIcon->setVisible(false); mDefaultImage = false; mImageUpdatePending = (texture->getDiscardLevel() == -1); return true; @@ -1128,7 +1138,7 @@ void LLOutfitGalleryItem::setDefaultImage() { mTexturep = NULL; mImageAssetId.setNull(); - getChildView("preview_outfit")->setVisible(true); + mPreviewIcon->setVisible(true); mDefaultImage = true; mImageUpdatePending = false; } |