summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-30 12:25:16 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-30 12:25:16 +0300
commit1680d159ecbf75591d2dab1416ff8144c27d4de5 (patch)
treecd34ad27487036265f08d7aa63476c160280d899 /src/gui/windows
parent9913b4b481ddcaf0fa8499f3554c85bb588be7f0 (diff)
downloadplus-1680d159ecbf75591d2dab1416ff8144c27d4de5.tar.gz
plus-1680d159ecbf75591d2dab1416ff8144c27d4de5.tar.bz2
plus-1680d159ecbf75591d2dab1416ff8144c27d4de5.tar.xz
plus-1680d159ecbf75591d2dab1416ff8144c27d4de5.zip
Rename player_node variable into localPlayer.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/botcheckerwindow.cpp2
-rw-r--r--src/gui/windows/chatwindow.cpp34
-rw-r--r--src/gui/windows/debugwindow.cpp8
-rw-r--r--src/gui/windows/equipmentwindow.cpp2
-rw-r--r--src/gui/windows/killstats.cpp14
-rw-r--r--src/gui/windows/minimap.cpp22
-rw-r--r--src/gui/windows/ministatuswindow.cpp4
-rw-r--r--src/gui/windows/questswindow.cpp4
-rw-r--r--src/gui/windows/shopwindow.cpp20
-rw-r--r--src/gui/windows/skilldialog.cpp10
-rw-r--r--src/gui/windows/socialwindow.cpp20
-rw-r--r--src/gui/windows/statuswindow.cpp12
-rw-r--r--src/gui/windows/tradewindow.cpp2
-rw-r--r--src/gui/windows/whoisonline.cpp12
14 files changed, 83 insertions, 83 deletions
diff --git a/src/gui/windows/botcheckerwindow.cpp b/src/gui/windows/botcheckerwindow.cpp
index e4ab62b1a..d0130ed7a 100644
--- a/src/gui/windows/botcheckerwindow.cpp
+++ b/src/gui/windows/botcheckerwindow.cpp
@@ -194,7 +194,7 @@ void BotCheckerWindow::reset()
Being *const being = dynamic_cast<Being*>(*i);
if (being && being->getType() == ActorType::PLAYER
- && being != player_node && being->getName() != "")
+ && being != localPlayer && being->getName() != "")
{
being->resetCounters();
}
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index d4ae8ed14..3bf1366f5 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -182,7 +182,7 @@ ChatWindow::ChatWindow() :
updateTabsMargin();
fillCommands();
- if (player_node && player_node->isGM())
+ if (localPlayer && localPlayer->isGM())
loadGMCommands();
initTradeFilter();
loadCustomList();
@@ -998,10 +998,10 @@ void ChatWindow::addWhisper(const std::string &restrict nick,
const std::string &restrict mes,
const ChatMsgType::Type own)
{
- if (mes.empty() || !player_node)
+ if (mes.empty() || !localPlayer)
return;
- std::string playerName = player_node->getName();
+ std::string playerName = localPlayer->getName();
std::string tempNick = nick;
toLower(playerName);
@@ -1062,7 +1062,7 @@ void ChatWindow::addWhisper(const std::string &restrict nick,
{
tab->chatLog(nick, mes);
}
- player_node->afkRespond(tab, nick);
+ localPlayer->afkRespond(tab, nick);
}
}
else if (localChatTab)
@@ -1079,8 +1079,8 @@ void ChatWindow::addWhisper(const std::string &restrict nick,
{
localChatTab->chatLog(std::string(nick).append(
" : ").append(mes), ChatMsgType::ACT_WHISPER, false);
- if (player_node)
- player_node->afkRespond(nullptr, nick);
+ if (localPlayer)
+ localPlayer->afkRespond(nullptr, nick);
}
}
}
@@ -1088,10 +1088,10 @@ void ChatWindow::addWhisper(const std::string &restrict nick,
WhisperTab *ChatWindow::addWhisperTab(const std::string &nick,
const bool switchTo)
{
- if (!player_node)
+ if (!localPlayer)
return nullptr;
- std::string playerName = player_node->getName();
+ std::string playerName = localPlayer->getName();
std::string tempNick = nick;
toLower(playerName);
@@ -1125,10 +1125,10 @@ WhisperTab *ChatWindow::addWhisperTab(const std::string &nick,
WhisperTab *ChatWindow::getWhisperTab(const std::string &nick) const
{
- if (!player_node)
+ if (!localPlayer)
return nullptr;
- std::string playerName = player_node->getName();
+ std::string playerName = localPlayer->getName();
std::string tempNick = nick;
toLower(playerName);
@@ -1566,10 +1566,10 @@ void ChatWindow::updateOnline(const std::set<std::string> &onlinePlayers) const
{
const Party *party = nullptr;
const Guild *guild = nullptr;
- if (player_node)
+ if (localPlayer)
{
- party = player_node->getParty();
- guild = player_node->getGuild();
+ party = localPlayer->getParty();
+ guild = localPlayer->getGuild();
}
FOR_EACH (TabMap::const_iterator, iter, mWhispers)
{
@@ -1740,25 +1740,25 @@ void ChatWindow::displayAwayLog() const
void ChatWindow::parseHighlights()
{
mHighlights.clear();
- if (!player_node)
+ if (!localPlayer)
return;
splitToStringVector(mHighlights, config.getStringValue(
"highlightWords"), ',');
- mHighlights.push_back(player_node->getName());
+ mHighlights.push_back(localPlayer->getName());
}
void ChatWindow::parseGlobalsFilter()
{
mGlobalsFilter.clear();
- if (!player_node)
+ if (!localPlayer)
return;
splitToStringVector(mGlobalsFilter, config.getStringValue(
"globalsFilter"), ',');
- mHighlights.push_back(player_node->getName());
+ mHighlights.push_back(localPlayer->getName());
}
bool ChatWindow::findHighlight(const std::string &str)
diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp
index c12fb962b..6ddeaea8b 100644
--- a/src/gui/windows/debugwindow.cpp
+++ b/src/gui/windows/debugwindow.cpp
@@ -110,8 +110,8 @@ void DebugWindow::slowLogic()
break;
}
- if (player_node)
- player_node->tryPingRequest();
+ if (localPlayer)
+ localPlayer->tryPingRequest();
BLOCK_END("DebugWindow::slowLogic")
}
@@ -120,9 +120,9 @@ void DebugWindow::draw(Graphics *g)
BLOCK_START("DebugWindow::draw")
Window::draw(g);
- if (player_node)
+ if (localPlayer)
{
- const Being *const target = player_node->getTarget();
+ const Being *const target = localPlayer->getTarget();
if (target)
{
target->draw(g, -target->getPixelX() + mapTileSize / 2
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp
index 7ec505160..8a558236a 100644
--- a/src/gui/windows/equipmentwindow.cpp
+++ b/src/gui/windows/equipmentwindow.cpp
@@ -381,7 +381,7 @@ void EquipmentWindow::mouseReleased(MouseEvent &event)
{
return;
}
- Inventory *const inventory = player_node
+ Inventory *const inventory = localPlayer
? PlayerInfo::getInventory() : nullptr;
if (!inventory)
return;
diff --git a/src/gui/windows/killstats.cpp b/src/gui/windows/killstats.cpp
index b5189b455..6ec3df5a0 100644
--- a/src/gui/windows/killstats.cpp
+++ b/src/gui/windows/killstats.cpp
@@ -127,7 +127,7 @@ KillStats::KillStats() :
// TRANSLATORS: kill stats window label
mLine1 = new Label(this, strprintf(_("Level: %d at %f%%"),
- player_node->getLevel(), static_cast<double>(xp)
+ localPlayer->getLevel(), static_cast<double>(xp)
/ static_cast<double>(xpNextLevel) * 100.0));
// TRANSLATORS: kill stats window label
@@ -240,7 +240,7 @@ void KillStats::gainXp(int xp)
const int exp = PlayerInfo::getAttribute(Attributes::EXP);
// TRANSLATORS: kill stats window label
mLine1->setCaption(strprintf(_("Level: %d at %f%%"),
- player_node->getLevel(), static_cast<double>(exp)
+ localPlayer->getLevel(), static_cast<double>(exp)
/ static_cast<double>(xpNextLevel) * 100.0));
// TRANSLATORS: kill stats window label
@@ -468,7 +468,7 @@ void KillStats::jackoAlive(const int id)
void KillStats::validateJacko()
{
- if (!actorManager || !player_node)
+ if (!actorManager || !localPlayer)
return;
const Map *const currentMap = Game::instance()->getCurrentMap();
@@ -477,10 +477,10 @@ void KillStats::validateJacko()
if (currentMap->getProperty("_realfilename") == "018-1"
|| currentMap->getProperty("_realfilename") == "maps/018-1.tmx")
{
- if (player_node->getTileX() >= 167
- && player_node->getTileX() <= 175
- && player_node->getTileY() >= 21
- && player_node->getTileY() <= 46)
+ if (localPlayer->getTileX() >= 167
+ && localPlayer->getTileX() <= 175
+ && localPlayer->getTileY() >= 21
+ && localPlayer->getTileY() <= 46)
{
const Being *const dstBeing
= actorManager->findBeingByName(
diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp
index 859d45b9e..f8eaddd4b 100644
--- a/src/gui/windows/minimap.cpp
+++ b/src/gui/windows/minimap.cpp
@@ -242,7 +242,7 @@ void Minimap::draw(Graphics *graphics)
BLOCK_START("Minimap::draw")
Window::draw(graphics);
- if (!userPalette || !player_node || !viewport)
+ if (!userPalette || !localPlayer || !viewport)
{
BLOCK_END("Minimap::draw")
return;
@@ -268,7 +268,7 @@ void Minimap::draw(Graphics *graphics)
const int h = rect.h;
if (w > a.width || h > a.height)
{
- const Vector &p = player_node->getPosition();
+ const Vector &p = localPlayer->getPosition();
mMapOriginX = (a.width / 2) - (p.x + static_cast<float>(
viewport->getCameraRelativeX()) * mWidthProportion) / 32;
@@ -304,7 +304,7 @@ void Minimap::draw(Graphics *graphics)
int dotSize = 2;
int type = UserPalette::PC;
- if (being == player_node)
+ if (being == localPlayer)
{
type = UserPalette::SELF;
dotSize = 3;
@@ -313,8 +313,8 @@ void Minimap::draw(Graphics *graphics)
{
type = UserPalette::GM;
}
- else if (being->getGuild() == player_node->getGuild()
- || being->getGuildName() == player_node->getGuildName())
+ else if (being->getGuild() == localPlayer->getGuild()
+ || being->getGuildName() == localPlayer->getGuildName())
{
type = UserPalette::GUILD;
}
@@ -357,13 +357,13 @@ void Minimap::draw(Graphics *graphics)
+ mMapOriginY - offsetHeight, dotSize, dotSize));
}
- if (player_node->isInParty())
+ if (localPlayer->isInParty())
{
- const Party *const party = player_node->getParty();
+ const Party *const party = localPlayer->getParty();
if (party)
{
const PartyMember *const m = party->getMember(
- player_node->getName());
+ localPlayer->getName());
const Party::MemberList *const members = party->getMembers();
if (m && members)
{
@@ -401,7 +401,7 @@ void Minimap::draw(Graphics *graphics)
}
}
- const Vector &pos = player_node->getPosition();
+ const Vector &pos = localPlayer->getPosition();
const int gw = graphics->getWidth();
const int gh = graphics->getHeight();
@@ -442,7 +442,7 @@ void Minimap::mouseReleased(MouseEvent &event)
{
Window::mouseReleased(event);
- if (!player_node || !viewport)
+ if (!localPlayer || !viewport)
return;
if (event.getButton() == MouseButton::LEFT)
@@ -451,7 +451,7 @@ void Minimap::mouseReleased(MouseEvent &event)
int y = event.getY();
screenToMap(x, y);
- player_node->navigateTo(x, y);
+ localPlayer->navigateTo(x, y);
}
else if (event.getButton() == MouseButton::RIGHT)
{
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index 7196a8df7..61d3f4cab 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -339,12 +339,12 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
else if (event.getSource() == mXpBar)
{
std::string level;
- if (player_node && player_node->isGM())
+ if (localPlayer && localPlayer->isGM())
{
// TRANSLATORS: status bar label
level = strprintf(_("Level: %d (GM %d)"),
PlayerInfo::getAttribute(Attributes::LEVEL),
- player_node->getGMLevel());
+ localPlayer->getGMLevel());
}
else
{
diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp
index 69c890c4e..9b8d1aa61 100644
--- a/src/gui/windows/questswindow.cpp
+++ b/src/gui/windows/questswindow.cpp
@@ -382,11 +382,11 @@ void QuestsWindow::rebuild(const bool playSound)
switch (newCompleteStatus)
{
case 0:
- effectManager->trigger(mNewQuestEffectId, player_node);
+ effectManager->trigger(mNewQuestEffectId, localPlayer);
break;
case 1:
effectManager->trigger(mCompleteQuestEffectId,
- player_node);
+ localPlayer);
break;
default:
break;
diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp
index eac966fa8..96ac002fa 100644
--- a/src/gui/windows/shopwindow.cpp
+++ b/src/gui/windows/shopwindow.cpp
@@ -238,15 +238,15 @@ void ShopWindow::action(const ActionEvent &event)
&& mBuyShopItemList->getSelected() >= 0)
{
mBuyShopItems->del(mBuyShopItemList->getSelected());
- if (isShopEmpty() && player_node)
- player_node->updateStatus();
+ if (isShopEmpty() && localPlayer)
+ localPlayer->updateStatus();
}
else if (eventId == "delete sell" && mSellShopItemList
&& mSellShopItemList->getSelected() >= 0)
{
mSellShopItems->del(mSellShopItemList->getSelected());
- if (isShopEmpty() && player_node)
- player_node->updateStatus();
+ if (isShopEmpty() && localPlayer)
+ localPlayer->updateStatus();
}
else if (eventId == "announce buy" && mBuyShopItems
&& mBuyShopItems->getNumberOfElements() > 0)
@@ -345,8 +345,8 @@ void ShopWindow::addBuyItem(const Item *const item, const int amount,
const bool emp = isShopEmpty();
mBuyShopItems->addItemNoDup(item->getId(),
item->getColor(), amount, price);
- if (emp && player_node)
- player_node->updateStatus();
+ if (emp && localPlayer)
+ localPlayer->updateStatus();
updateButtonsAndLabels();
}
@@ -359,8 +359,8 @@ void ShopWindow::addSellItem(const Item *const item, const int amount,
const bool emp = isShopEmpty();
mSellShopItems->addItemNoDup(item->getId(),
item->getColor(), amount, price);
- if (emp && player_node)
- player_node->updateStatus();
+ if (emp && localPlayer)
+ localPlayer->updateStatus();
updateButtonsAndLabels();
}
@@ -701,7 +701,7 @@ void ShopWindow::showList(const std::string &nick, std::string data)
void ShopWindow::processRequest(const std::string &nick, std::string data,
const int mode)
{
- if (!player_node || !mTradeNick.empty() || PlayerInfo::isTrading()
+ if (!localPlayer || !mTradeNick.empty() || PlayerInfo::isTrading()
|| !actorManager
|| !actorManager->findBeingByName(nick, ActorType::PLAYER))
{
@@ -857,7 +857,7 @@ bool ShopWindow::findShopItem(const ShopItem *const shopItem,
int ShopWindow::sumAmount(const Item *const shopItem)
{
- if (!player_node || !shopItem)
+ if (!localPlayer || !shopItem)
return 0;
const Inventory *const inv = PlayerInfo::getInventory();
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index f90f0a84c..5cd79c600 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -151,9 +151,9 @@ void SkillDialog::action(const ActionEvent &event)
if (tab)
{
const SkillInfo *const info = tab->getSelectedInfo();
- if (info && player_node && player_node->getTarget())
+ if (info && localPlayer && localPlayer->getTarget())
{
- const Being *const being = player_node->getTarget();
+ const Being *const being = localPlayer->getTarget();
if (being)
{
Net::getSkillHandler()->useBeing(info->level,
@@ -420,9 +420,9 @@ void SkillDialog::useItem(const int itemId) const
return;
const SkillInfo *const info = (*it).second;
- if (info && player_node && player_node->getTarget())
+ if (info && localPlayer && localPlayer->getTarget())
{
- const Being *const being = player_node->getTarget();
+ const Being *const being = localPlayer->getTarget();
if (being)
{
Net::getSkillHandler()->useBeing(info->level,
@@ -477,6 +477,6 @@ void SkillDialog::playUpdateEffect(const int id) const
if (it != mSkills.end())
{
if (it->second)
- effectManager->trigger(effectId, player_node);
+ effectManager->trigger(effectId, localPlayer);
}
}
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index d5ef89d0c..bbfa91a81 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -148,11 +148,11 @@ void SocialWindow::postInit()
mPickupFilter = nullptr;
}
- if (player_node && player_node->getParty())
- addTab(player_node->getParty());
+ if (localPlayer && localPlayer->getParty())
+ addTab(localPlayer->getParty());
- if (player_node && player_node->getGuild())
- addTab(player_node->getGuild());
+ if (localPlayer && localPlayer->getGuild())
+ addTab(localPlayer->getGuild());
enableVisibleSound(true);
updateButtons();
@@ -488,10 +488,10 @@ void SocialWindow::showPartyInvite(const std::string &restrict partyName,
void SocialWindow::showPartyCreate()
{
- if (!player_node)
+ if (!localPlayer)
return;
- if (player_node->getParty())
+ if (localPlayer->getParty())
{
// TRANSLATORS: party creation message
new OkDialog(_("Create Party"),
@@ -623,10 +623,10 @@ void SocialWindow::updatePickupFilter()
void SocialWindow::updateParty()
{
- if (!player_node)
+ if (!localPlayer)
return;
- Party *const party = player_node->getParty();
+ Party *const party = localPlayer->getParty();
if (party)
{
PartyMap::iterator it = mParties.find(party);
@@ -657,10 +657,10 @@ void SocialWindow::setCounter(const SocialTab *const tab,
void SocialWindow::updateGuildCounter(const int online, const int total)
{
- if (!player_node)
+ if (!localPlayer)
return;
- Guild *const guild = player_node->getGuild();
+ Guild *const guild = localPlayer->getGuild();
if (guild)
{
GuildMap::iterator it = mGuilds.find(guild);
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index c5f2b29d3..6fa51c568 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -65,7 +65,7 @@
StatusWindow *statusWindow = nullptr;
StatusWindow::StatusWindow() :
- Window(player_node ? player_node->getName() :
+ Window(localPlayer ? localPlayer->getName() :
"?", false, nullptr, "status.xml"),
ActionListener(),
AttributeListener(),
@@ -105,10 +105,10 @@ StatusWindow::StatusWindow() :
setDefaultSize((windowContainer->getWidth() - 480) / 2,
(windowContainer->getHeight() - 500) / 2, 480, 500);
- if (player_node && !player_node->getRaceName().empty())
+ if (localPlayer && !localPlayer->getRaceName().empty())
{
- setCaption(strprintf("%s (%s)", player_node->getName().c_str(),
- player_node->getRaceName().c_str()));
+ setCaption(strprintf("%s (%s)", localPlayer->getName().c_str(),
+ localPlayer->getRaceName().c_str()));
}
int max = PlayerInfo::getAttribute(Attributes::MAX_HP);
@@ -242,12 +242,12 @@ StatusWindow::StatusWindow() :
PlayerInfo::getAttribute(Attributes::CHAR_POINTS)));
mCharacterPointsLabel->adjustSize();
- if (player_node && player_node->isGM())
+ if (localPlayer && localPlayer->isGM())
{
// TRANSLATORS: status window label
mLvlLabel->setCaption(strprintf(_("Level: %d (GM %d)"),
PlayerInfo::getAttribute(Attributes::LEVEL),
- player_node->getGMLevel()));
+ localPlayer->getGMLevel()));
}
else
{
diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp
index 21144b341..7707bf360 100644
--- a/src/gui/windows/tradewindow.cpp
+++ b/src/gui/windows/tradewindow.cpp
@@ -439,7 +439,7 @@ void TradeWindow::addAutoMoney(const std::string &nick, const int money)
void TradeWindow::initTrade(const std::string &nick)
{
- if (!player_node)
+ if (!localPlayer)
return;
if (!mAutoAddToNick.empty() && mAutoAddToNick == nick)
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index 00187a31d..fc4c8cbc4 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -194,7 +194,7 @@ void WhoIsOnline::handleLink(const std::string& link, MouseEvent *event)
}
else if (event->getButton() == MouseButton::RIGHT)
{
- if (player_node && link == player_node->getName())
+ if (localPlayer && link == localPlayer->getName())
return;
if (viewport)
@@ -751,17 +751,17 @@ void WhoIsOnline::setNeutralColor(OnlinePlayer *const player)
if (!player)
return;
- if (actorManager && player_node)
+ if (actorManager && localPlayer)
{
const std::string &nick = player->getNick();
- if (nick == player_node->getName())
+ if (nick == localPlayer->getName())
{
player->setText("s");
return;
}
- if (player_node->isInParty())
+ if (localPlayer->isInParty())
{
- const Party *const party = player_node->getParty();
+ const Party *const party = localPlayer->getParty();
if (party)
{
if (party->getMember(nick))
@@ -775,7 +775,7 @@ void WhoIsOnline::setNeutralColor(OnlinePlayer *const player)
const Being *const being = actorManager->findBeingByName(nick);
if (being)
{
- const Guild *const guild2 = player_node->getGuild();
+ const Guild *const guild2 = localPlayer->getGuild();
if (guild2)
{
const Guild *const guild1 = being->getGuild();