summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/chatwindow.cpp2
-rw-r--r--src/gui/windows/ministatuswindow.cpp14
-rw-r--r--src/gui/windows/skilldialog.cpp5
-rw-r--r--src/gui/windows/statuswindow.cpp20
-rw-r--r--src/gui/windows/whoisonline.cpp4
5 files changed, 21 insertions, 24 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 318c89332..bf839e058 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -921,7 +921,7 @@ void ChatWindow::statChanged(const int id,
if (!mShowBattleEvents || !config.getBoolValue("showJobExp"))
return;
- if (id != Net::getPlayerHandler()->getJobLocation())
+ if (id != playerHandler->getJobLocation())
return;
const std::pair<int, int> exp = PlayerInfo::getStatExperience(id);
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index ba4aaf8c7..a02ea3f1e 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -71,13 +71,13 @@ MiniStatusWindow::MiniStatusWindow() :
"hpprogressbar.xml", "hpprogressbar_fill.xml",
"hp bar", _("health bar"))),
mMpBar(gameHandler->canUseMagicBar()
- ? createBar(0, 100, 0, Net::getPlayerHandler()->canUseMagic()
+ ? createBar(0, 100, 0, playerHandler->canUseMagic()
? Theme::MP_BAR : Theme::NO_MP_BAR,
- Net::getPlayerHandler()->canUseMagic()
+ playerHandler->canUseMagic()
? Theme::PROG_MP : Theme::PROG_NO_MP,
- Net::getPlayerHandler()->canUseMagic()
+ playerHandler->canUseMagic()
? "mpprogressbar.xml" : "nompprogressbar.xml",
- Net::getPlayerHandler()->canUseMagic()
+ playerHandler->canUseMagic()
? "mpprogressbar_fill.xml" : "nompprogressbar_fill.xml",
// TRANSLATORS: status bar name
"mp bar", _("mana bar")) : nullptr),
@@ -122,7 +122,7 @@ MiniStatusWindow::MiniStatusWindow() :
if (gameHandler->canUseMagicBar() && statusWindow)
statusWindow->updateMPBar(mMpBar);
- const int job = Net::getPlayerHandler()->getJobLocation()
+ const int job = playerHandler->getJobLocation()
&& serverConfig.getValueBool("showJob", true);
StatusWindow::updateXPBar(mXpBar);
@@ -383,12 +383,12 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
else if (event.getSource() == mJobBar)
{
const std::pair<int, int> exp = PlayerInfo::getStatExperience(
- Net::getPlayerHandler()->getJobLocation());
+ playerHandler->getJobLocation());
// TRANSLATORS: job bar label
const std::string level = strprintf(_("Job level: %d"),
PlayerInfo::getStatBase(
- Net::getPlayerHandler()->getJobLocation()));
+ playerHandler->getJobLocation()));
if (exp.first > exp.second)
{
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index 782dfee70..759efe7cf 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -111,10 +111,7 @@ void SkillDialog::action(const ActionEvent &event)
if (tab)
{
if (const SkillInfo *const info = tab->getSelectedInfo())
- {
- Net::getPlayerHandler()->increaseSkill(
- static_cast<uint16_t>(info->id));
- }
+ playerHandler->increaseSkill(static_cast<uint16_t>(info->id));
}
}
else if (eventId == "sel")
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 08480cdd4..072e915ee 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -129,7 +129,7 @@ StatusWindow::StatusWindow() :
getThemeColor(Theme::XP_BAR_OUTLINE));
const bool magicBar = gameHandler->canUseMagicBar();
- const int job = Net::getPlayerHandler()->getJobLocation()
+ const int job = playerHandler->getJobLocation()
&& serverConfig.getValueBool("showJob", true);
if (magicBar)
@@ -137,7 +137,7 @@ StatusWindow::StatusWindow() :
max = PlayerInfo::getAttribute(Attributes::MAX_MP);
// TRANSLATORS: status window label
mMpLabel = new Label(this, _("MP:"));
- const bool useMagic = Net::getPlayerHandler()->canUseMagic();
+ const bool useMagic = playerHandler->canUseMagic();
mMpBar = new ProgressBar(this, max ? static_cast<float>(
PlayerInfo::getAttribute(Attributes::MAX_MP))
/ static_cast<float>(max) : static_cast<float>(0),
@@ -217,7 +217,7 @@ StatusWindow::StatusWindow() :
place(0, 6, mCharacterPointsLabel, 5);
place(0, 5, mCopyButton);
- if (Net::getPlayerHandler()->canCorrectAttributes())
+ if (playerHandler->canCorrectAttributes())
{
mCorrectionPointsLabel = new Label(this, "C");
place(0, 7, mCorrectionPointsLabel, 5);
@@ -265,7 +265,7 @@ void StatusWindow::statChanged(const int id,
if (blocked)
return;
- if (id == Net::getPlayerHandler()->getJobLocation())
+ if (id == playerHandler->getJobLocation())
{
if (mJobLvlLabel)
{
@@ -462,7 +462,7 @@ void StatusWindow::updateMPBar(ProgressBar *const bar,
if (maxMp > 0)
prog = static_cast<float>(mp) / static_cast<float>(maxMp);
- if (Net::getPlayerHandler()->canUseMagic())
+ if (playerHandler->canUseMagic())
{
bar->setColor(getThemeColor(Theme::MP_BAR),
getThemeColor(Theme::MP_BAR_OUTLINE));
@@ -523,7 +523,7 @@ void StatusWindow::updateJobBar(ProgressBar *const bar, const bool percent)
return;
const std::pair<int, int> exp = PlayerInfo::getStatExperience(
- Net::getPlayerHandler()->getJobLocation());
+ playerHandler->getJobLocation());
updateProgressBar(bar, exp.first, exp.second, percent);
}
@@ -754,7 +754,7 @@ ChangeDisplay::ChangeDisplay(const Widget2 *const widget,
place(6, 0, mInc);
place(7, 0, mPoints);
- if (Net::getPlayerHandler()->canCorrectAttributes())
+ if (playerHandler->canCorrectAttributes())
{
// TRANSLATORS: status window label (minus sign)
mDec = new Button(this, _("-"), "dec", this);
@@ -793,7 +793,7 @@ void ChangeDisplay::setPointsNeeded(const int needed)
void ChangeDisplay::action(const ActionEvent &event)
{
- if (Net::getPlayerHandler()->canCorrectAttributes() &&
+ if (playerHandler->canCorrectAttributes() &&
event.getSource() == mDec)
{
const int newcorrpoints = PlayerInfo::getAttribute(
@@ -807,7 +807,7 @@ void ChangeDisplay::action(const ActionEvent &event)
const int newbase = PlayerInfo::getStatBase(mId) - 1;
PlayerInfo::setStatBase(mId, newbase);
- Net::getPlayerHandler()->decreaseAttribute(mId);
+ playerHandler->decreaseAttribute(mId);
}
else if (event.getSource() == mInc)
{
@@ -828,7 +828,7 @@ void ChangeDisplay::action(const ActionEvent &event)
for (unsigned f = 0; f < mInc->getClickCount(); f ++)
{
- Net::getPlayerHandler()->increaseAttribute(mId);
+ playerHandler->increaseAttribute(mId);
if (cnt != 1)
SDL_Delay(100);
}
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index eb44a0081..a4ea81bfa 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -601,7 +601,7 @@ void WhoIsOnline::download()
else
{
if (PacketLimiter::limitPackets(PACKET_ONLINELIST))
- Net::getPlayerHandler()->requestOnlineList();
+ playerHandler->requestOnlineList();
}
}
@@ -701,7 +701,7 @@ void WhoIsOnline::action(const ActionEvent &event)
if (PacketLimiter::limitPackets(PACKET_ONLINELIST))
{
mUpdateTimer = cur_time;
- Net::getPlayerHandler()->requestOnlineList();
+ playerHandler->requestOnlineList();
}
}
}