Multiple bg images zone (#4005)

This commit is contained in:
fdipilla 2020-08-23 16:55:53 -03:00 committed by GitHub
parent 964207d04f
commit b0c7b9078d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 68 additions and 9 deletions

View file

@ -57,10 +57,9 @@ void TableZone::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*opti
{
QBrush brush = themeManager->getTableBgBrush();
// If the player is other than Player 1
if (player->getId() > 0) {
// The player's id starts with 0 so in order to get the correct image we need to add 1
brush = themeManager->getExtraTableBgBrush(QString::number(player->getId() + 1));
if (player->getZoneId() > 0) {
// If the extra image is not found, load the default one
brush = themeManager->getExtraTableBgBrush(QString::number(player->getZoneId()), brush);
}
painter->fillRect(boundingRect(), brush);