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()
|
void TabGame::connectMessageLogToGameEventHandler()
|
||||||
{
|
{
|
||||||
// connect(game->getGameEventHandler(), &GameEventHandler:: , messageLog, &MessageLogWidget::);
|
|
||||||
connect(game->getGameEventHandler(), &GameEventHandler::gameFlooded, messageLog, &MessageLogWidget::logGameFlooded);
|
connect(game->getGameEventHandler(), &GameEventHandler::gameFlooded, messageLog, &MessageLogWidget::logGameFlooded);
|
||||||
connect(game->getGameEventHandler(), &GameEventHandler::containerProcessingStarted, messageLog,
|
connect(game->getGameEventHandler(), &GameEventHandler::containerProcessingStarted, messageLog,
|
||||||
&MessageLogWidget::containerProcessingStarted);
|
&MessageLogWidget::containerProcessingStarted);
|
||||||
|
|
@ -366,7 +365,7 @@ void TabGame::retranslateUi()
|
||||||
QMapIterator<int, Player *> i(game->getPlayerManager()->getPlayers());
|
QMapIterator<int, Player *> i(game->getPlayerManager()->getPlayers());
|
||||||
|
|
||||||
while (i.hasNext())
|
while (i.hasNext())
|
||||||
i.next().value()->retranslateUi();
|
i.next().value()->getGraphicsItem()->retranslateUi();
|
||||||
QMapIterator<int, TabbedDeckViewContainer *> j(deckViewContainers);
|
QMapIterator<int, TabbedDeckViewContainer *> j(deckViewContainers);
|
||||||
while (j.hasNext())
|
while (j.hasNext())
|
||||||
j.next().value()->playerDeckView->retranslateUi();
|
j.next().value()->playerDeckView->retranslateUi();
|
||||||
|
|
|
||||||
|
|
@ -71,19 +71,6 @@ Player::~Player()
|
||||||
delete getPlayerInfo()->userInfo;
|
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()
|
void Player::clear()
|
||||||
{
|
{
|
||||||
clearArrows();
|
clearArrows();
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,6 @@ public slots:
|
||||||
public:
|
public:
|
||||||
Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, Game *_parent);
|
Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, Game *_parent);
|
||||||
~Player() override;
|
~Player() override;
|
||||||
void retranslateUi();
|
|
||||||
|
|
||||||
void initializeZones();
|
void initializeZones();
|
||||||
void updateZones();
|
void updateZones();
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,23 @@ PlayerGraphicsItem::PlayerGraphicsItem(Player *_player) : player(_player)
|
||||||
updateBoundingRect();
|
updateBoundingRect();
|
||||||
|
|
||||||
rearrangeZones();
|
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)
|
void PlayerGraphicsItem::onPlayerActiveChanged(bool _active)
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,7 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void onPlayerActiveChanged(bool _active);
|
void onPlayerActiveChanged(bool _active);
|
||||||
|
void retranslateUi();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void sizeChanged();
|
void sizeChanged();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue