summaryrefslogtreecommitdiff
path: root/src/gui/inventorywindow.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-03-04 22:41:19 -0700
committerJared Adams <jaxad0127@gmail.com>2010-03-12 14:49:27 -0700
commit781b3c9f17708cc5fe08eb3c9ee38d596364d97c (patch)
tree833797c9b9168ab58864ffe4cf8ed028060e44a2 /src/gui/inventorywindow.cpp
parent96b64757954f07d196599b3c1131a6603982c930 (diff)
downloadmana-781b3c9f17708cc5fe08eb3c9ee38d596364d97c.tar.gz
mana-781b3c9f17708cc5fe08eb3c9ee38d596364d97c.tar.bz2
mana-781b3c9f17708cc5fe08eb3c9ee38d596364d97c.tar.xz
mana-781b3c9f17708cc5fe08eb3c9ee38d596364d97c.zip
Split Palette into Theme and UserPalette
Themes can now control the colors they use. Colors in the Viewport (being names, particles, etc) can still be changed by the user. Also make ProgressBars more easily colored. DyePalette was made more flexible in the process. Also fixes comparing strings of different lengths insensitively. Reviewed-by: Thorbjørn Lindeijer
Diffstat (limited to 'src/gui/inventorywindow.cpp')
-rw-r--r--src/gui/inventorywindow.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index ed008e63..701558a9 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -30,6 +30,7 @@
#include "gui/itemamount.h"
#include "gui/setup.h"
#include "gui/sdlinput.h"
+#include "gui/theme.h"
#include "gui/viewport.h"
#include "gui/widgets/button.h"
@@ -96,8 +97,8 @@ InventoryWindow::InventoryWindow(int invSize):
mSlotsLabel = new Label(_("Slots:"));
mWeightLabel = new Label(_("Weight:"));
- mSlotsBar = new ProgressBar(0.0f, 100, 20, gcn::Color(225, 200, 25));
- mWeightBar = new ProgressBar(0.0f, 100, 20, gcn::Color(0, 0, 255));
+ mSlotsBar = new ProgressBar(0.0f, 100, 20, Theme::PROG_INVY_SLOTS);
+ mWeightBar = new ProgressBar(0.0f, 100, 20, Theme::PROG_WEIGHT);
place(0, 0, mWeightLabel).setPadding(3);
place(1, 0, mWeightBar, 3);
@@ -140,14 +141,6 @@ void InventoryWindow::logic()
mMaxWeight = player_node->getMaxWeight();
mUsedSlots = usedSlots;
- // Weight Bar coloration
- if (mTotalWeight < (mMaxWeight / 3))
- mWeightBar->setColor(0, 0, 255); // Blue
- else if (mTotalWeight < ((mMaxWeight * 2) / 3))
- mWeightBar->setColor(255, 255, 0); // Yellow
- else
- mWeightBar->setColor(255, 0, 0); // Red
-
// Adjust progress bars
mSlotsBar->setProgress((float) mUsedSlots / mMaxSlots);
mWeightBar->setProgress((float) mTotalWeight / mMaxWeight);