From 0ad49798faae14641827ab7a1e57358cdf99a9cc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 27 Jul 2013 23:47:03 +0300 Subject: allow buy protected items. --- src/gui/widgets/shoplistbox.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/gui/widgets/shoplistbox.cpp') diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index e6cbdae4e..b0f58bd5f 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -50,10 +50,11 @@ ShopListBox::ShopListBox(const Widget2 *const widget, mShopItems(nullptr), mItemPopup(new ItemPopup), mRowHeight(getFont()->getHeight()), - mPriceCheck(true), mHighlightColor(getThemeColor(Theme::HIGHLIGHT)), mBackgroundColor(getThemeColor(Theme::BACKGROUND)), - mWarningColor(getThemeColor(Theme::SHOP_WARNING)) + mWarningColor(getThemeColor(Theme::SHOP_WARNING)), + mPriceCheck(true), + mProtectItems(false) { mForegroundColor = getThemeColor(Theme::LISTBOX); } @@ -66,10 +67,11 @@ ShopListBox::ShopListBox(const Widget2 *const widget, mShopItems(shopListModel), mItemPopup(new ItemPopup), mRowHeight(std::max(getFont()->getHeight(), ITEM_ICON_SIZE)), - mPriceCheck(true), mHighlightColor(getThemeColor(Theme::HIGHLIGHT)), mBackgroundColor(getThemeColor(Theme::BACKGROUND)), - mWarningColor(getThemeColor(Theme::SHOP_WARNING)) + mWarningColor(getThemeColor(Theme::SHOP_WARNING)), + mPriceCheck(true), + mProtectItems(false) { mForegroundColor = getThemeColor(Theme::LISTBOX); } @@ -109,7 +111,8 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics) ShopItem *const item = mShopItems->at(i); if (item && ((mShopItems && mPlayerMoney < item->getPrice() - && mPriceCheck) || PlayerInfo::isItemProtected(item->getId()))) + && mPriceCheck) + || (mProtectItems && PlayerInfo::isItemProtected(item->getId())))) { if (i != mSelected) { -- cgit v1.2.3-60-g2f50