summaryrefslogtreecommitdiff
path: root/src/gui/shoplistbox.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2006-11-05 01:47:44 +0000
committerYohann Ferreira <bertram@cegetel.net>2006-11-05 01:47:44 +0000
commit9e70df3a6ac53f9900f7e4cbf6dbe40e53e0ddc1 (patch)
treeba0bf36049b125030e0bb2e26e7f755fe8f98723 /src/gui/shoplistbox.cpp
parent6a1702f014db23b5330e9b93e773b652d03c2ed1 (diff)
downloadMana-9e70df3a6ac53f9900f7e4cbf6dbe40e53e0ddc1.tar.gz
Mana-9e70df3a6ac53f9900f7e4cbf6dbe40e53e0ddc1.tar.bz2
Mana-9e70df3a6ac53f9900f7e4cbf6dbe40e53e0ddc1.tar.xz
Mana-9e70df3a6ac53f9900f7e4cbf6dbe40e53e0ddc1.zip
Added item's pictures in sell dialogs, and precisions about the total money in it.
Diffstat (limited to 'src/gui/shoplistbox.cpp')
-rw-r--r--src/gui/shoplistbox.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/shoplistbox.cpp b/src/gui/shoplistbox.cpp
index 0aec33ed..6ddf863e 100644
--- a/src/gui/shoplistbox.cpp
+++ b/src/gui/shoplistbox.cpp
@@ -42,7 +42,7 @@ ShopListBox::ShopListBox(gcn::ListModel *listModel):
mPlayerMoney(0)
{
mRowHeight = getFont()->getHeight();
-
+ mPriceCheck = true;
}
ShopListBox::ShopListBox(gcn::ListModel *listModel, ShopItems *shopListModel):
@@ -53,6 +53,7 @@ ShopListBox::ShopListBox(gcn::ListModel *listModel, ShopItems *shopListModel):
{
mRowHeight = (getFont()->getHeight() > ITEM_SPRITE_HEIGHT ?
getFont()->getHeight() : ITEM_SPRITE_HEIGHT);
+ mPriceCheck = true;
}
@@ -75,7 +76,7 @@ void ShopListBox::draw(gcn::Graphics *graphics)
graphics->setColor(gcn::Color(0xffffff));
if (mShopItems)
{
- if(mPlayerMoney < mShopItems->at(i).price)
+ if(mPlayerMoney < mShopItems->at(i).price && mPriceCheck)
{
graphics->setColor(gcn::Color(0x919191));
}
@@ -142,6 +143,9 @@ void ShopListBox::mousePress(int x, int y, int button)
else // Old Behaviour
enoughMoney = true;
+ if (!mPriceCheck)
+ enoughMoney = true;
+
if (enoughMoney)
{
setSelected(y / mRowHeight);
@@ -189,3 +193,8 @@ void ShopListBox::adjustSize()
setHeight(mRowHeight * mListModel->getNumberOfElements());
}
}
+
+void ShopListBox::setPriceCheck(bool check)
+{
+ mPriceCheck = check;
+}