diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-11 01:00:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-11 01:00:01 +0300 |
commit | 2f768a34f72560ee8b2934228f548a4909533887 (patch) | |
tree | 0849395dea15a851fcec1a6236c29648cb41add7 /src/gui | |
parent | 05edba87ab0dae7ac4480c86655afe59cd1dd3bd (diff) | |
download | manaverse-2f768a34f72560ee8b2934228f548a4909533887.tar.gz manaverse-2f768a34f72560ee8b2934228f548a4909533887.tar.bz2 manaverse-2f768a34f72560ee8b2934228f548a4909533887.tar.xz manaverse-2f768a34f72560ee8b2934228f548a4909533887.zip |
Rename player_relations into playerRelations.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/models/ignorechoiceslistmodel.h | 4 | ||||
-rw-r--r-- | src/gui/models/playertablemodel.cpp | 6 | ||||
-rw-r--r-- | src/gui/popups/beingpopup.cpp | 2 | ||||
-rw-r--r-- | src/gui/popups/popupmenu.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_relations.cpp | 52 | ||||
-rw-r--r-- | src/gui/widgets/tabs/socialfriendstab.h | 2 | ||||
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 6 | ||||
-rw-r--r-- | src/gui/windows/shopwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/socialwindow.cpp | 4 | ||||
-rw-r--r-- | src/gui/windows/tradewindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/whoisonline.cpp | 2 |
11 files changed, 44 insertions, 44 deletions
diff --git a/src/gui/models/ignorechoiceslistmodel.h b/src/gui/models/ignorechoiceslistmodel.h index b0010df31..ef537a5c7 100644 --- a/src/gui/models/ignorechoiceslistmodel.h +++ b/src/gui/models/ignorechoiceslistmodel.h @@ -45,7 +45,7 @@ class IgnoreChoicesListModel final : public ListModel int getNumberOfElements() override final { - return CAST_S32(player_relations. + return CAST_S32(playerRelations. getPlayerIgnoreStrategies()->size()); } @@ -54,7 +54,7 @@ class IgnoreChoicesListModel final : public ListModel if (i >= getNumberOfElements() || i < 0) return "???"; - return (*player_relations.getPlayerIgnoreStrategies()) + return (*playerRelations.getPlayerIgnoreStrategies()) [i]->mDescription; } }; diff --git a/src/gui/models/playertablemodel.cpp b/src/gui/models/playertablemodel.cpp index 9c8526e0d..417fafcbc 100644 --- a/src/gui/models/playertablemodel.cpp +++ b/src/gui/models/playertablemodel.cpp @@ -95,7 +95,7 @@ void PlayerTableModel::playerRelationsUpdated() signalBeforeUpdate(); freeWidgets(); - StringVect *const player_names = player_relations.getPlayers(); + StringVect *const player_names = playerRelations.getPlayers(); delete mPlayers; mPlayers = player_names; @@ -109,7 +109,7 @@ void PlayerTableModel::playerRelationsUpdated() DropDown *const choicebox = new DropDown(this, mListModel); choicebox->setSelected(CAST_S32( - player_relations.getRelation(name))); + playerRelations.getRelation(name))); mWidgets.push_back(choicebox); } @@ -122,7 +122,7 @@ void PlayerTableModel::updateModelInRow(const int row) const getElementAt(row, RELATION_CHOICE_COLUMN)); if (choicebox == nullptr) return; - player_relations.setRelation(getPlayerAt(row), + playerRelations.setRelation(getPlayerAt(row), static_cast<RelationT>( choicebox->getSelected())); } diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp index 1834fcbe9..4cafcca27 100644 --- a/src/gui/popups/beingpopup.cpp +++ b/src/gui/popups/beingpopup.cpp @@ -103,7 +103,7 @@ void BeingPopup::show(const int x, const int y, Being *const b) mBeingName->setCaption(b->getName() + b->getGenderSignWithSpace()); if (gui != nullptr) { - if (player_relations.isGoodName(b)) + if (playerRelations.isGoodName(b)) mBeingName->setFont(boldFont); else mBeingName->setFont(gui->getSecureFont()); diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 0dbcaac2f..a01ab6bf8 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -2400,7 +2400,7 @@ void PopupMenu::addNormalRelations() void PopupMenu::addPlayerRelation(const std::string &name) { - switch (player_relations.getRelation(name)) + switch (playerRelations.getRelation(name)) { case Relation::NEUTRAL: // TRANSLATORS: popup menu item @@ -2501,7 +2501,7 @@ void PopupMenu::addFollow() void PopupMenu::addBuySell(const Being *const being) { - if ((player_relations.getDefault() & PlayerRelation::TRADE) != 0u) + if ((playerRelations.getDefault() & PlayerRelation::TRADE) != 0u) { mBrowserBox->addRow("##3---"); const bool haveVending = @@ -2535,7 +2535,7 @@ void PopupMenu::addBuySell(const Being *const being) void PopupMenu::addBuySellDefault() { - if ((player_relations.getDefault() & PlayerRelation::TRADE) != 0u) + if ((playerRelations.getDefault() & PlayerRelation::TRADE) != 0u) { mBrowserBox->addRow("##3---"); // TRANSLATORS: popup menu item diff --git a/src/gui/widgets/tabs/setup_relations.cpp b/src/gui/widgets/tabs/setup_relations.cpp index d81bca9a9..4cc81a300 100644 --- a/src/gui/widgets/tabs/setup_relations.cpp +++ b/src/gui/widgets/tabs/setup_relations.cpp @@ -70,10 +70,10 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : mPlayerScrollArea(new ScrollArea(this, mPlayerTable)), // TRANSLATORS: relation dialog button mDefaultTrading(new CheckBox(this, _("Allow trading"), - (player_relations.getDefault() & PlayerRelation::TRADE) != 0u)), + (playerRelations.getDefault() & PlayerRelation::TRADE) != 0u)), // TRANSLATORS: relation dialog button mDefaultWhisper(new CheckBox(this, _("Allow whispers"), - (player_relations.getDefault() & PlayerRelation::WHISPER) != 0u)), + (playerRelations.getDefault() & PlayerRelation::WHISPER) != 0u)), // TRANSLATORS: relation dialog button mDeleteButton(new Button(this, _("Delete"), ACTION_DELETE, this)), mIgnoreActionChoicesModel(new IgnoreChoicesListModel), @@ -112,10 +112,10 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : int ignore_strategy_index = 0; // safe default - if (player_relations.getPlayerIgnoreStrategy() != nullptr) + if (playerRelations.getPlayerIgnoreStrategy() != nullptr) { - ignore_strategy_index = player_relations.getPlayerIgnoreStrategyIndex( - player_relations.getPlayerIgnoreStrategy()->mShortName); + ignore_strategy_index = playerRelations.getPlayerIgnoreStrategyIndex( + playerRelations.getPlayerIgnoreStrategy()->mShortName); if (ignore_strategy_index < 0) ignore_strategy_index = 0; } @@ -136,14 +136,14 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : place(3, 6, mDefaultTrading, 3); place(3, 7, mDefaultWhisper, 3); - player_relations.addListener(this); + playerRelations.addListener(this); setDimension(Rect(0, 0, 500, 350)); } Setup_Relations::~Setup_Relations() { - player_relations.removeListener(this); + playerRelations.removeListener(this); delete2(mIgnoreActionChoicesModel); } @@ -152,13 +152,13 @@ void Setup_Relations::reset() { // We now have to search through the list of ignore choices to find the // current selection. We could use an index into the table of config - // options in player_relations instead of strategies to sidestep this. + // options in playerRelations instead of strategies to sidestep this. int selection = 0; - for (size_t i = 0, sz = player_relations.getPlayerIgnoreStrategies() + for (size_t i = 0, sz = playerRelations.getPlayerIgnoreStrategies() ->size(); i < sz; ++ i) { - if ((*player_relations.getPlayerIgnoreStrategies())[i] == - player_relations.getPlayerIgnoreStrategy()) + if ((*playerRelations.getPlayerIgnoreStrategies())[i] == + playerRelations.getPlayerIgnoreStrategy()) { selection = CAST_S32(i); break; @@ -169,11 +169,11 @@ void Setup_Relations::reset() void Setup_Relations::apply() { - player_relations.store(); + playerRelations.store(); - const unsigned int old_default_relations = player_relations.getDefault() & + const unsigned int old_default_relations = playerRelations.getDefault() & ~(PlayerRelation::TRADE | PlayerRelation::WHISPER); - player_relations.setDefault(old_default_relations + playerRelations.setDefault(old_default_relations | (mDefaultTrading->isSelected() ? PlayerRelation::TRADE : 0) | (mDefaultWhisper->isSelected() ? PlayerRelation::WHISPER : 0)); @@ -197,13 +197,13 @@ void Setup_Relations::action(const ActionEvent &event) // so there is no need for asynchronous updates. (In fact, thouse // might destroy the widet that triggered them, which would be rather // embarrassing.) - player_relations.removeListener(this); + playerRelations.removeListener(this); const int row = mPlayerTable->getSelectedRow(); if (row >= 0) mPlayerTableModel->updateModelInRow(row); - player_relations.addListener(this); + playerRelations.addListener(this); } else if (eventId == ACTION_DELETE) { @@ -212,7 +212,7 @@ void Setup_Relations::action(const ActionEvent &event) if (player_index < 0) return; - player_relations.removePlayer(mPlayerTableModel->getPlayerAt( + playerRelations.removePlayer(mPlayerTableModel->getPlayerAt( player_index)); } else if (eventId == ACTION_STRATEGY) @@ -221,9 +221,9 @@ void Setup_Relations::action(const ActionEvent &event) if (sel < 0) return; PlayerIgnoreStrategy *const s = - (*player_relations.getPlayerIgnoreStrategies())[sel]; + (*playerRelations.getPlayerIgnoreStrategies())[sel]; - player_relations.setPlayerIgnoreStrategy(s); + playerRelations.setPlayerIgnoreStrategy(s); } } @@ -231,9 +231,9 @@ void Setup_Relations::updatedPlayer(const std::string &name A_UNUSED) { mPlayerTableModel->playerRelationsUpdated(); mDefaultTrading->setSelected( - (player_relations.getDefault() & PlayerRelation::TRADE) != 0u); + (playerRelations.getDefault() & PlayerRelation::TRADE) != 0u); mDefaultWhisper->setSelected( - (player_relations.getDefault() & PlayerRelation::WHISPER) != 0u); + (playerRelations.getDefault() & PlayerRelation::WHISPER) != 0u); if (localPlayer != nullptr) localPlayer->updateName(); } @@ -246,10 +246,10 @@ void Setup_Relations::updateAll() mPlayerTableModel = model; int ignore_strategy_index = 0; // safe default - if (player_relations.getPlayerIgnoreStrategy() != nullptr) + if (playerRelations.getPlayerIgnoreStrategy() != nullptr) { - ignore_strategy_index = player_relations.getPlayerIgnoreStrategyIndex( - player_relations.getPlayerIgnoreStrategy()->mShortName); + ignore_strategy_index = playerRelations.getPlayerIgnoreStrategyIndex( + playerRelations.getPlayerIgnoreStrategy()->mShortName); if (ignore_strategy_index < 0) ignore_strategy_index = 0; } @@ -260,7 +260,7 @@ void Setup_Relations::updateAll() void Setup_Relations::externalUpdated() { mDefaultTrading->setSelected( - (player_relations.getDefault() & PlayerRelation::TRADE) != 0u); + (playerRelations.getDefault() & PlayerRelation::TRADE) != 0u); mDefaultWhisper->setSelected( - (player_relations.getDefault() & PlayerRelation::WHISPER) != 0u); + (playerRelations.getDefault() & PlayerRelation::WHISPER) != 0u); } diff --git a/src/gui/widgets/tabs/socialfriendstab.h b/src/gui/widgets/tabs/socialfriendstab.h index dfae61090..9c9525cd3 100644 --- a/src/gui/widgets/tabs/socialfriendstab.h +++ b/src/gui/widgets/tabs/socialfriendstab.h @@ -85,7 +85,7 @@ class SocialFriendsTab final : public SocialTab avatars->clear(); const StringVect *const players - = player_relations.getPlayersByRelation(Relation::FRIEND); + = playerRelations.getPlayersByRelation(Relation::FRIEND); const std::set<std::string> &players2 = whoIsOnline->getOnlineNicks(); diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 88d4d3fc5..80c24af0a 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -636,10 +636,10 @@ void ChatWindow::ignoreAllWhispers() WhisperTab *const tab = iter->second; if (tab != nullptr) { - if (player_relations.getRelation(tab->getNick()) + if (playerRelations.getRelation(tab->getNick()) != Relation::IGNORED) { - player_relations.setRelation(tab->getNick(), + playerRelations.setRelation(tab->getNick(), Relation::IGNORED); } tab->handleCommand("close", ""); @@ -1200,7 +1200,7 @@ WhisperTab *ChatWindow::addWhisperTab(const std::string &caption, else { ret = new WhisperTab(this, caption, nick); - if ((gui != nullptr) && !player_relations.isGoodName(nick)) + if ((gui != nullptr) && !playerRelations.isGoodName(nick)) ret->setLabelFont(gui->getSecureFont()); mWhispers[tempNick] = ret; if (config.getBoolValue("showChatHistory")) diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index 9f4872e62..54656a66b 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -260,7 +260,7 @@ void ShopWindow::action(const ActionEvent &event) } else if (eventId == "ignore") { - player_relations.ignoreTrade(mTradeNick); + playerRelations.ignoreTrade(mTradeNick); mTradeNick.clear(); } else if (eventId == "announce") diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index 11207d47f..b3f3317a3 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -143,12 +143,12 @@ void SocialWindow::postInit() enableVisibleSound(true); updateButtons(); - player_relations.addListener(this); + playerRelations.addListener(this); } SocialWindow::~SocialWindow() { - player_relations.removeListener(this); + playerRelations.removeListener(this); if (mGuildAcceptDialog != nullptr) { mGuildAcceptDialog->close(); diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index 295f60a7d..b86d86aa3 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -508,7 +508,7 @@ void TradeWindow::initTrade(const std::string &nick) } } clear(); - if (!player_relations.isGoodName(nick)) + if (!playerRelations.isGoodName(nick)) setCaptionFont(gui->getSecureFont()); } diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index e5040077a..966807e58 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -288,7 +288,7 @@ void WhoIsOnline::handlerPlayerRelation(const std::string &nick, { if (player == nullptr) return; - switch (player_relations.getRelation(nick)) + switch (playerRelations.getRelation(nick)) { case Relation::NEUTRAL: default: |