mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
PlayerGraphicsItem is responsible for retranslateUi, not Player.
Took 14 seconds
This commit is contained in:
parent
de1986c1fb
commit
45eaf3f072
5 changed files with 19 additions and 17 deletions
|
|
@ -169,7 +169,6 @@ void TabGame::connectToGameEventHandler()
|
|||
|
||||
void TabGame::connectMessageLogToGameEventHandler()
|
||||
{
|
||||
// connect(game->getGameEventHandler(), &GameEventHandler:: , messageLog, &MessageLogWidget::);
|
||||
connect(game->getGameEventHandler(), &GameEventHandler::gameFlooded, messageLog, &MessageLogWidget::logGameFlooded);
|
||||
connect(game->getGameEventHandler(), &GameEventHandler::containerProcessingStarted, messageLog,
|
||||
&MessageLogWidget::containerProcessingStarted);
|
||||
|
|
@ -366,7 +365,7 @@ void TabGame::retranslateUi()
|
|||
QMapIterator<int, Player *> i(game->getPlayerManager()->getPlayers());
|
||||
|
||||
while (i.hasNext())
|
||||
i.next().value()->retranslateUi();
|
||||
i.next().value()->getGraphicsItem()->retranslateUi();
|
||||
QMapIterator<int, TabbedDeckViewContainer *> j(deckViewContainers);
|
||||
while (j.hasNext())
|
||||
j.next().value()->playerDeckView->retranslateUi();
|
||||
|
|
|
|||
|
|
@ -71,19 +71,6 @@ Player::~Player()
|
|||
delete getPlayerInfo()->userInfo;
|
||||
}
|
||||
|
||||
void Player::retranslateUi()
|
||||
{
|
||||
QMapIterator<QString, CardZoneLogic *> zoneIterator(zones);
|
||||
while (zoneIterator.hasNext()) {
|
||||
emit zoneIterator.next().value()->retranslateUi();
|
||||
}
|
||||
|
||||
QMapIterator<int, AbstractCounter *> counterIterator(counters);
|
||||
while (counterIterator.hasNext()) {
|
||||
counterIterator.next().value()->retranslateUi();
|
||||
}
|
||||
}
|
||||
|
||||
void Player::clear()
|
||||
{
|
||||
clearArrows();
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ public slots:
|
|||
public:
|
||||
Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, Game *_parent);
|
||||
~Player() override;
|
||||
void retranslateUi();
|
||||
|
||||
void initializeZones();
|
||||
void updateZones();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,23 @@ PlayerGraphicsItem::PlayerGraphicsItem(Player *_player) : player(_player)
|
|||
updateBoundingRect();
|
||||
|
||||
rearrangeZones();
|
||||
// retranslateUi();
|
||||
retranslateUi();
|
||||
}
|
||||
|
||||
void PlayerGraphicsItem::retranslateUi()
|
||||
{
|
||||
player->getPlayerMenu()->retranslateUi();
|
||||
|
||||
QMapIterator<QString, CardZoneLogic *> zoneIterator(player->getZones());
|
||||
while (zoneIterator.hasNext()) {
|
||||
emit zoneIterator.next().value()->retranslateUi();
|
||||
}
|
||||
|
||||
QMapIterator<int, AbstractCounter *> counterIterator(player->getCounters());
|
||||
while (counterIterator.hasNext()) {
|
||||
counterIterator.next().value()->retranslateUi();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void PlayerGraphicsItem::onPlayerActiveChanged(bool _active)
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ public:
|
|||
|
||||
public slots:
|
||||
void onPlayerActiveChanged(bool _active);
|
||||
void retranslateUi();
|
||||
|
||||
signals:
|
||||
void sizeChanged();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue