summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-30 15:18:19 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-30 15:18:19 +0300
commitaa86dbe6a7c966a4bfa7aa6c81218fe58f0bf92d (patch)
treed67adc2c432802949a4c43b6f1f476f878c8e6d4 /src/gui/windows
parent07121956f882dce22235868a25e0c2df96fb828a (diff)
downloadplus-aa86dbe6a7c966a4bfa7aa6c81218fe58f0bf92d.tar.gz
plus-aa86dbe6a7c966a4bfa7aa6c81218fe58f0bf92d.tar.bz2
plus-aa86dbe6a7c966a4bfa7aa6c81218fe58f0bf92d.tar.xz
plus-aa86dbe6a7c966a4bfa7aa6c81218fe58f0bf92d.zip
Move theme progress colors enum into separate file.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/inventorywindow.cpp12
-rw-r--r--src/gui/windows/ministatuswindow.cpp24
-rw-r--r--src/gui/windows/statuswindow.cpp18
-rw-r--r--src/gui/windows/updaterwindow.cpp4
4 files changed, 33 insertions, 25 deletions
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 8b46f5e55..ed3742c9b 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -26,10 +26,12 @@
#include "item.h"
#include "units.h"
-#include "being/playerinfo.h"
-
#include "enums/being/attributes.h"
+#include "enums/gui/progresscolorid.h"
+
+#include "being/playerinfo.h"
+
#include "input/inputmanager.h"
#include "gui/gui.h"
@@ -92,7 +94,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
mRetrieveButton(nullptr),
mInvCloseButton(nullptr),
mWeightBar(nullptr),
- mSlotsBar(new ProgressBar(this, 0.0F, 100, 0, Theme::PROG_INVY_SLOTS,
+ mSlotsBar(new ProgressBar(this, 0.0F, 100, 0, ProgressColorId::PROG_INVY_SLOTS,
"slotsprogressbar.xml", "slotsprogressbar_fill.xml")),
mFilter(nullptr),
mSortModel(new SortListModelInv),
@@ -215,7 +217,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
// TRANSLATORS: inventory equipment button
mEquipmentButton = new Button(this, _("E"), "equipment", this);
mWeightBar = new ProgressBar(this, 0.0F, 100, 0,
- Theme::PROG_WEIGHT,
+ ProgressColorId::PROG_WEIGHT,
"weightprogressbar.xml", "weightprogressbar_fill.xml");
mWeightBar->setColor(getThemeColor(ThemeColorId::WEIGHT_BAR),
getThemeColor(ThemeColorId::WEIGHT_BAR_OUTLINE));
@@ -284,7 +286,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
mInvCloseButton = new Button(this, _("Close"), "close", this);
mWeightBar = new ProgressBar(this, 0.0F, 100, 0,
- Theme::PROG_WEIGHT,
+ ProgressColorId::PROG_WEIGHT,
"weightprogressbar.xml", "weightprogressbar_fill.xml");
mWeightBar->setColor(getThemeColor(ThemeColorId::WEIGHT_BAR),
getThemeColor(ThemeColorId::WEIGHT_BAR_OUTLINE));
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index 4af6467fb..96901249e 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -26,11 +26,13 @@
#include "configuration.h"
#include "inventory.h"
+#include "enums/being/attributes.h"
+
+#include "enums/gui/progresscolorid.h"
+
#include "being/localplayer.h"
#include "being/playerinfo.h"
-#include "enums/being/attributes.h"
-
#include "gui/popupmanager.h"
#include "gui/skin.h"
@@ -67,45 +69,45 @@ MiniStatusWindow::MiniStatusWindow() :
mBarNames(),
mIcons(),
// TRANSLATORS: status bar name
- mHpBar(createBar(0, 100, 0, ThemeColorId::HP_BAR, Theme::PROG_HP,
+ mHpBar(createBar(0, 100, 0, ThemeColorId::HP_BAR, ProgressColorId::PROG_HP,
"hpprogressbar.xml", "hpprogressbar_fill.xml",
"hp bar", _("health bar"))),
mMpBar(gameHandler->canUseMagicBar()
? createBar(0, 100, 0, playerHandler->canUseMagic()
? ThemeColorId::MP_BAR : ThemeColorId::NO_MP_BAR,
playerHandler->canUseMagic()
- ? Theme::PROG_MP : Theme::PROG_NO_MP,
+ ? ProgressColorId::PROG_MP : ProgressColorId::PROG_NO_MP,
playerHandler->canUseMagic()
? "mpprogressbar.xml" : "nompprogressbar.xml",
playerHandler->canUseMagic()
? "mpprogressbar_fill.xml" : "nompprogressbar_fill.xml",
// TRANSLATORS: status bar name
"mp bar", _("mana bar")) : nullptr),
- mXpBar(createBar(0, 100, 0, ThemeColorId::XP_BAR, Theme::PROG_EXP,
+ mXpBar(createBar(0, 100, 0, ThemeColorId::XP_BAR, ProgressColorId::PROG_EXP,
"xpprogressbar.xml", "xpprogressbar_fill.xml",
// TRANSLATORS: status bar name
"xp bar", _("experience bar"))),
mJobBar(nullptr),
- mWeightBar(createBar(0, 140, 0, ThemeColorId::WEIGHT_BAR, Theme::PROG_WEIGHT,
+ mWeightBar(createBar(0, 140, 0, ThemeColorId::WEIGHT_BAR, ProgressColorId::PROG_WEIGHT,
"weightprogressbar.xml", "weightprogressbar_fill.xml",
// TRANSLATORS: status bar name
"weight bar", _("weight bar"))),
mInvSlotsBar(createBar(0, 45, 0,
- ThemeColorId::SLOTS_BAR, Theme::PROG_INVY_SLOTS,
+ ThemeColorId::SLOTS_BAR, ProgressColorId::PROG_INVY_SLOTS,
"slotsprogressbar.xml", "slotsprogressbar_fill.xml",
"inventory slots bar",
// TRANSLATORS: status bar name
_("inventory slots bar"))),
- mMoneyBar(createBar(0, 130, 0, ThemeColorId::MONEY_BAR, Theme::PROG_MONEY,
+ mMoneyBar(createBar(0, 130, 0, ThemeColorId::MONEY_BAR, ProgressColorId::PROG_MONEY,
"moneyprogressbar.xml", "moneyprogressbar_fill.xml",
// TRANSLATORS: status bar name
"money bar", _("money bar"))),
- mArrowsBar(createBar(0, 50, 0, ThemeColorId::ARROWS_BAR, Theme::PROG_ARROWS,
+ mArrowsBar(createBar(0, 50, 0, ThemeColorId::ARROWS_BAR, ProgressColorId::PROG_ARROWS,
"arrowsprogressbar.xml", "arrowsprogressbar_fill.xml",
// TRANSLATORS: status bar name
"arrows bar", _("arrows bar"))),
mStatusBar(createBar(100, (config.getIntValue("fontSize") > 16
- ? 250 : 165), 0, ThemeColorId::STATUS_BAR, Theme::PROG_STATUS,
+ ? 250 : 165), 0, ThemeColorId::STATUS_BAR, ProgressColorId::PROG_STATUS,
"statusprogressbar.xml", "statusprogressbar_fill.xml",
// TRANSLATORS: status bar name
"status bar", _("status bar"))),
@@ -128,7 +130,7 @@ MiniStatusWindow::MiniStatusWindow() :
if (job)
{
- mJobBar = createBar(0, 100, 0, ThemeColorId::JOB_BAR, Theme::PROG_JOB,
+ mJobBar = createBar(0, 100, 0, ThemeColorId::JOB_BAR, ProgressColorId::PROG_JOB,
// TRANSLATORS: status bar name
"jobprogressbar.xml", "jobprogressbar_fill.xml",
"job bar", _("job bar"));
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 5e5dcff33..39dfaa7e2 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -28,12 +28,14 @@
#include "settings.h"
#include "units.h"
-#include "gui/windows/chatwindow.h"
+#include "enums/being/attributes.h"
+
+#include "enums/gui/progresscolorid.h"
#include "being/localplayer.h"
#include "being/playerinfo.h"
-#include "enums/being/attributes.h"
+#include "gui/windows/chatwindow.h"
#include "gui/windows/equipmentwindow.h"
#include "gui/windows/setupwindow.h"
@@ -111,7 +113,7 @@ StatusWindow::StatusWindow() :
max = 1;
mHpBar = new ProgressBar(this, static_cast<float>(PlayerInfo::getAttribute(
- Attributes::HP)) / static_cast<float>(max), 80, 0, Theme::PROG_HP,
+ Attributes::HP)) / static_cast<float>(max), 80, 0, ProgressColorId::PROG_HP,
"hpprogressbar.xml", "hpprogressbar_fill.xml");
mHpBar->setColor(getThemeColor(ThemeColorId::HP_BAR),
getThemeColor(ThemeColorId::HP_BAR_OUTLINE));
@@ -120,7 +122,7 @@ StatusWindow::StatusWindow() :
mXpBar = new ProgressBar(this, max ?
static_cast<float>(PlayerInfo::getAttribute(Attributes::EXP))
/ static_cast<float>(max) : static_cast<float>(0), 80, 0,
- Theme::PROG_EXP, "xpprogressbar.xml", "xpprogressbar_fill.xml");
+ ProgressColorId::PROG_EXP, "xpprogressbar.xml", "xpprogressbar_fill.xml");
mXpBar->setColor(getThemeColor(ThemeColorId::XP_BAR),
getThemeColor(ThemeColorId::XP_BAR_OUTLINE));
@@ -136,7 +138,7 @@ StatusWindow::StatusWindow() :
mMpBar = new ProgressBar(this, max ? static_cast<float>(
PlayerInfo::getAttribute(Attributes::MAX_MP))
/ static_cast<float>(max) : static_cast<float>(0),
- 80, 0, useMagic ? Theme::PROG_MP : Theme::PROG_NO_MP,
+ 80, 0, useMagic ? ProgressColorId::PROG_MP : ProgressColorId::PROG_NO_MP,
useMagic ? "mpprogressbar.xml" : "nompprogressbar.xml",
useMagic ? "mpprogressbar_fill.xml" : "nompprogressbar_fill.xml");
if (useMagic)
@@ -177,7 +179,7 @@ StatusWindow::StatusWindow() :
mJobLvlLabel = new Label(this, strprintf(_("Job: %d"), 0));
// TRANSLATORS: status window label
mJobLabel = new Label(this, _("Job:"));
- mJobBar = new ProgressBar(this, 0.0F, 80, 0, Theme::PROG_JOB,
+ mJobBar = new ProgressBar(this, 0.0F, 80, 0, ProgressColorId::PROG_JOB,
"jobprogressbar.xml", "jobprogressbar_fill.xml");
mJobBar->setColor(getThemeColor(ThemeColorId::JOB_BAR),
getThemeColor(ThemeColorId::JOB_BAR_OUTLINE));
@@ -468,13 +470,13 @@ void StatusWindow::updateMPBar(ProgressBar *const bar,
{
bar->setColor(getThemeColor(ThemeColorId::MP_BAR),
getThemeColor(ThemeColorId::MP_BAR_OUTLINE));
- bar->setProgressPalette(Theme::PROG_MP);
+ bar->setProgressPalette(ProgressColorId::PROG_MP);
}
else
{
bar->setColor(getThemeColor(ThemeColorId::NO_MP_BAR),
getThemeColor(ThemeColorId::NO_MP_BAR_OUTLINE));
- bar->setProgressPalette(Theme::PROG_NO_MP);
+ bar->setProgressPalette(ProgressColorId::PROG_NO_MP);
}
bar->setProgress(prog);
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index 48a3b4ebe..4f8b4dc48 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -26,6 +26,8 @@
#include "configuration.h"
#include "settings.h"
+#include "enums/gui/progresscolorid.h"
+
#include "enums/net/updatetype.h"
#include "input/inputaction.h"
@@ -190,7 +192,7 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost,
mCancelButton(new Button(this, _("Cancel"), "cancel", this)),
// TRANSLATORS: updater window button
mPlayButton(new Button(this, _("Play"), "play", this)),
- mProgressBar(new ProgressBar(this, 0.0, 310, 0, Theme::PROG_UPDATE,
+ mProgressBar(new ProgressBar(this, 0.0, 310, 0, ProgressColorId::PROG_UPDATE,
"updateprogressbar.xml", "updateprogressbar_fill.xml")),
mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true,
"browserbox.xml")),