diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-16 15:41:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-16 15:41:51 +0300 |
commit | 1b75e974088a94cd28d7a48729545904b2cd908b (patch) | |
tree | d771752fd0da4c58c8ff2d941c47274ead984e42 /src/gui/windows | |
parent | 46087564d4184b28740b0c45c1bac199ab1942ec (diff) | |
download | manaverse-1b75e974088a94cd28d7a48729545904b2cd908b.tar.gz manaverse-1b75e974088a94cd28d7a48729545904b2cd908b.tar.bz2 manaverse-1b75e974088a94cd28d7a48729545904b2cd908b.tar.xz manaverse-1b75e974088a94cd28d7a48729545904b2cd908b.zip |
Remove some useless static methods from theme.
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/inventorywindow.cpp | 8 | ||||
-rw-r--r-- | src/gui/windows/ministatuswindow.cpp | 13 | ||||
-rw-r--r-- | src/gui/windows/statuswindow.cpp | 37 | ||||
-rw-r--r-- | src/gui/windows/statuswindow.h | 6 |
4 files changed, 32 insertions, 32 deletions
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 92b21dfd1..b9bdf6ad9 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -98,8 +98,8 @@ InventoryWindow::InventoryWindow(Inventory *const inventory): mCompactMode(false) { mTextPopup->postInit(); - mSlotsBar->setColor(Theme::getThemeColor(Theme::SLOTS_BAR), - Theme::getThemeColor(Theme::SLOTS_BAR_OUTLINE)); + mSlotsBar->setColor(getThemeColor(Theme::SLOTS_BAR), + getThemeColor(Theme::SLOTS_BAR_OUTLINE)); if (inventory) { @@ -194,8 +194,8 @@ InventoryWindow::InventoryWindow(Inventory *const inventory): mEquipmentButton = new Button(this, _("Equipment"), "equipment", this); mWeightBar = new ProgressBar(this, 0.0F, 100, 0, Theme::PROG_WEIGHT, "weightprogressbar.xml", "weightprogressbar_fill.xml"); - mWeightBar->setColor(Theme::getThemeColor(Theme::WEIGHT_BAR), - Theme::getThemeColor(Theme::WEIGHT_BAR_OUTLINE)); + mWeightBar->setColor(getThemeColor(Theme::WEIGHT_BAR), + getThemeColor(Theme::WEIGHT_BAR_OUTLINE)); place(0, 0, mWeightBar, 4); mSlotsBarCell = &place(4, 0, mSlotsBar, 5); diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index 226132652..939bfb619 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -114,8 +114,8 @@ MiniStatusWindow::MiniStatusWindow() : StatusWindow::updateHPBar(mHpBar); - if (Net::getGameHandler()->canUseMagicBar()) - StatusWindow::updateMPBar(mMpBar); + if (Net::getGameHandler()->canUseMagicBar() && statusWindow) + statusWindow->updateMPBar(mMpBar); const int job = Net::getPlayerHandler()->getJobLocation() && serverConfig.getValueBool("showJob", true); @@ -183,8 +183,7 @@ ProgressBar *MiniStatusWindow::createBar(const float progress, progress, width, height, backColor, skin, skinFill); bar->setActionEventId(name); bar->setId(description); - bar->setColor(Theme::getThemeColor(textColor), - Theme::getThemeColor(textColor + 1)); + bar->setColor(getThemeColor(textColor), getThemeColor(textColor + 1)); mBars.push_back(bar); mBarNames[name] = bar; return bar; @@ -264,7 +263,7 @@ void MiniStatusWindow::processEvent(const Channels channel A_UNUSED, } else if (id == PlayerInfo::MP || id == PlayerInfo::MAX_MP) { - StatusWindow::updateMPBar(mMpBar); + statusWindow->updateMPBar(mMpBar); } else if (id == PlayerInfo::EXP || id == PlayerInfo::EXP_NEEDED) { @@ -282,14 +281,14 @@ void MiniStatusWindow::processEvent(const Channels channel A_UNUSED, } else if (event.getName() == EVENT_UPDATESTAT) { - StatusWindow::updateMPBar(mMpBar); + statusWindow->updateMPBar(mMpBar); StatusWindow::updateJobBar(mJobBar); } } void MiniStatusWindow::updateStatus() { - StatusWindow::updateStatusBar(mStatusBar); + statusWindow->updateStatusBar(mStatusBar); if (mStatusPopup && mStatusPopup->isPopupVisible()) mStatusPopup->update(); } diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp index 05172c9b3..7fb4496cc 100644 --- a/src/gui/windows/statuswindow.cpp +++ b/src/gui/windows/statuswindow.cpp @@ -193,16 +193,16 @@ StatusWindow::StatusWindow() : mHpBar = new ProgressBar(this, static_cast<float>(PlayerInfo::getAttribute( PlayerInfo::HP)) / static_cast<float>(max), 80, 0, Theme::PROG_HP, "hpprogressbar.xml", "hpprogressbar_fill.xml"); - mHpBar->setColor(Theme::getThemeColor(Theme::HP_BAR), - Theme::getThemeColor(Theme::HP_BAR_OUTLINE)); + mHpBar->setColor(getThemeColor(Theme::HP_BAR), + getThemeColor(Theme::HP_BAR_OUTLINE)); max = PlayerInfo::getAttribute(PlayerInfo::EXP_NEEDED); mXpBar = new ProgressBar(this, max ? static_cast<float>(PlayerInfo::getAttribute(PlayerInfo::EXP)) / static_cast<float>(max) : static_cast<float>(0), 80, 0, Theme::PROG_EXP, "xpprogressbar.xml", "xpprogressbar_fill.xml"); - mXpBar->setColor(Theme::getThemeColor(Theme::XP_BAR), - Theme::getThemeColor(Theme::XP_BAR_OUTLINE)); + mXpBar->setColor(getThemeColor(Theme::XP_BAR), + getThemeColor(Theme::XP_BAR_OUTLINE)); const bool magicBar = Net::getGameHandler()->canUseMagicBar(); const int job = Net::getPlayerHandler()->getJobLocation() @@ -222,13 +222,13 @@ StatusWindow::StatusWindow() : useMagic ? "mpprogressbar_fill.xml" : "nompprogressbar_fill.xml"); if (useMagic) { - mMpBar->setColor(Theme::getThemeColor(Theme::MP_BAR), - Theme::getThemeColor(Theme::MP_BAR_OUTLINE)); + mMpBar->setColor(getThemeColor(Theme::MP_BAR), + getThemeColor(Theme::MP_BAR_OUTLINE)); } else { - mMpBar->setColor(Theme::getThemeColor(Theme::NO_MP_BAR), - Theme::getThemeColor(Theme::NO_MP_BAR_OUTLINE)); + mMpBar->setColor(getThemeColor(Theme::NO_MP_BAR), + getThemeColor(Theme::NO_MP_BAR_OUTLINE)); } } else @@ -260,8 +260,8 @@ StatusWindow::StatusWindow() : mJobLabel = new Label(this, _("Job:")); mJobBar = new ProgressBar(this, 0.0F, 80, 0, Theme::PROG_JOB, "jobprogressbar.xml", "jobprogressbar_fill.xml"); - mJobBar->setColor(Theme::getThemeColor(Theme::JOB_BAR), - Theme::getThemeColor(Theme::JOB_BAR_OUTLINE)); + mJobBar->setColor(getThemeColor(Theme::JOB_BAR), + getThemeColor(Theme::JOB_BAR_OUTLINE)); place(3, 0, mJobLvlLabel, 3); place(5, 2, mJobLabel).setPadding(3); @@ -524,7 +524,8 @@ void StatusWindow::updateHPBar(ProgressBar *const bar, const bool showMax) bar->setProgress(prog); } -void StatusWindow::updateMPBar(ProgressBar *const bar, const bool showMax) +void StatusWindow::updateMPBar(ProgressBar *const bar, + const bool showMax) const { if (!bar) return; @@ -542,14 +543,14 @@ void StatusWindow::updateMPBar(ProgressBar *const bar, const bool showMax) if (Net::getPlayerHandler()->canUseMagic()) { - bar->setColor(Theme::getThemeColor(Theme::MP_BAR), - Theme::getThemeColor(Theme::MP_BAR_OUTLINE)); + bar->setColor(getThemeColor(Theme::MP_BAR), + getThemeColor(Theme::MP_BAR_OUTLINE)); bar->setProgressPalette(Theme::PROG_MP); } else { - bar->setColor(Theme::getThemeColor(Theme::NO_MP_BAR), - Theme::getThemeColor(Theme::NO_MP_BAR_OUTLINE)); + bar->setColor(getThemeColor(Theme::NO_MP_BAR), + getThemeColor(Theme::NO_MP_BAR_OUTLINE)); bar->setProgressPalette(Theme::PROG_NO_MP); } @@ -715,7 +716,7 @@ std::string StatusWindow::translateLetter2(std::string letters) } void StatusWindow::updateStatusBar(ProgressBar *const bar, - const bool percent A_UNUSED) + const bool percent A_UNUSED) const { if (!player_node || !viewport) return; @@ -741,9 +742,9 @@ void StatusWindow::updateStatusBar(ProgressBar *const bar, bar->setProgress(50); if (player_node->getDisableGameModifiers()) - bar->setBackgroundColor(Theme::getThemeColor(Theme::STATUSBAR_ON)); + bar->setBackgroundColor(getThemeColor(Theme::STATUSBAR_ON)); else - bar->setBackgroundColor(Theme::getThemeColor(Theme::STATUSBAR_OFF)); + bar->setBackgroundColor(getThemeColor(Theme::STATUSBAR_OFF)); } void StatusWindow::action(const ActionEvent &event) diff --git a/src/gui/windows/statuswindow.h b/src/gui/windows/statuswindow.h index 3b171a25e..35bba74cd 100644 --- a/src/gui/windows/statuswindow.h +++ b/src/gui/windows/statuswindow.h @@ -66,7 +66,7 @@ class StatusWindow final : public Window, static void updateHPBar(ProgressBar *const bar, const bool showMax = false); - static void updateMPBar(ProgressBar *bar, const bool showMax = false); + void updateMPBar(ProgressBar *bar, const bool showMax = false) const; static void updateJobBar(ProgressBar *const bar, const bool percent = true); static void updateXPBar(ProgressBar *const bar, @@ -75,8 +75,8 @@ class StatusWindow final : public Window, static void updateInvSlotsBar(ProgressBar *const bar); static void updateMoneyBar(ProgressBar *const bar); static void updateArrowsBar(ProgressBar *const bar); - static void updateStatusBar(ProgressBar *const bar, - const bool percent = true); + void updateStatusBar(ProgressBar *const bar, + const bool percent = true) const; static void updateProgressBar(ProgressBar *const bar, const int value, const int max, const bool percent); static void updateProgressBar(ProgressBar *const bar, |