mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 17:14:52 -07:00
[Player] Pull handVisible out of player_info and let graphics_item just determine this on its own. (#6911)
Took 12 minutes Took 15 seconds Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
7a5b2e9f0e
commit
af2f888293
4 changed files with 9 additions and 20 deletions
|
|
@ -158,11 +158,11 @@ void PlayerGraphicsItem::rearrangeZones()
|
|||
if (SettingsCache::instance().getHorizontalHand()) {
|
||||
if (mirrored) {
|
||||
if (player->getHandZone()->contentsKnown()) {
|
||||
player->getPlayerInfo()->setHandVisible(true);
|
||||
handVisible = true;
|
||||
handZoneGraphicsItem->setPos(base);
|
||||
base += QPointF(0, handZoneGraphicsItem->boundingRect().height());
|
||||
} else {
|
||||
player->getPlayerInfo()->setHandVisible(false);
|
||||
handVisible = false;
|
||||
}
|
||||
|
||||
stackZoneGraphicsItem->setPos(base);
|
||||
|
|
@ -176,16 +176,16 @@ void PlayerGraphicsItem::rearrangeZones()
|
|||
base += QPointF(0, tableZoneGraphicsItem->boundingRect().height());
|
||||
|
||||
if (player->getHandZone()->contentsKnown()) {
|
||||
player->getPlayerInfo()->setHandVisible(true);
|
||||
handVisible = true;
|
||||
handZoneGraphicsItem->setPos(base);
|
||||
} else {
|
||||
player->getPlayerInfo()->setHandVisible(false);
|
||||
handVisible = false;
|
||||
}
|
||||
}
|
||||
handZoneGraphicsItem->setWidth(tableZoneGraphicsItem->getWidth() +
|
||||
stackZoneGraphicsItem->boundingRect().width());
|
||||
} else {
|
||||
player->getPlayerInfo()->setHandVisible(true);
|
||||
handVisible = true;
|
||||
|
||||
handZoneGraphicsItem->setPos(base);
|
||||
base += QPointF(handZoneGraphicsItem->boundingRect().width(), 0);
|
||||
|
|
@ -195,7 +195,7 @@ void PlayerGraphicsItem::rearrangeZones()
|
|||
|
||||
tableZoneGraphicsItem->setPos(base);
|
||||
}
|
||||
handZoneGraphicsItem->setVisible(player->getPlayerInfo()->getHandVisible());
|
||||
handZoneGraphicsItem->setVisible(handVisible);
|
||||
handZoneGraphicsItem->updateOrientation();
|
||||
tableZoneGraphicsItem->reorganizeCards();
|
||||
updateBoundingRect();
|
||||
|
|
@ -207,8 +207,7 @@ void PlayerGraphicsItem::updateBoundingRect()
|
|||
prepareGeometryChange();
|
||||
qreal width = CardDimensions::HEIGHT_F + 15 + counterAreaWidth + stackZoneGraphicsItem->boundingRect().width();
|
||||
if (SettingsCache::instance().getHorizontalHand()) {
|
||||
qreal handHeight =
|
||||
player->getPlayerInfo()->getHandVisible() ? handZoneGraphicsItem->boundingRect().height() : 0;
|
||||
qreal handHeight = handVisible ? handZoneGraphicsItem->boundingRect().height() : 0;
|
||||
bRect = QRectF(0, 0, width + tableZoneGraphicsItem->boundingRect().width(),
|
||||
tableZoneGraphicsItem->boundingRect().height() + handHeight);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue