File indexing completed on 2024-09-29 06:37:30
0001 /* 0002 SPDX-FileCopyrightText: 2009 Mathias Kraus <k.hias@gmx.de> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "infosidebar.h" 0008 #include "game.h" 0009 #include "gamescene.h" 0010 #include "player.h" 0011 #include "settings.h" 0012 0013 #include <QGraphicsView> 0014 #include <QGraphicsRectItem> 0015 #include <KGameRenderer> 0016 #include <KGameRenderedItem> 0017 0018 InfoSidebar::InfoSidebar (Game* p_game, GameScene* p_scene) : QObject() 0019 { 0020 m_game = p_game; 0021 m_gameScene = p_scene; 0022 m_svgScaleFactor = 1; 0023 m_badBonusSpriteKey = QStringLiteral("bonus_bad_restrain"); 0024 0025 QList <Player*> playerList = m_game->getPlayers(); 0026 int nMaxPlayerNameLength = 0; 0027 int nTop = 0; 0028 int nLeft = 0; 0029 int nWidth = 0; 0030 int nHeight = 0; 0031 0032 //calculate max player name length and top-left position 0033 for(int i = 0; i < playerList.count(); i++) 0034 { 0035 QGraphicsTextItem playerName (playerList[i]->getPlayerName()); 0036 playerName.setFont(QFont(QStringLiteral("Helvetica"), static_cast<int>(Granatier::CellSize * 0.25), QFont::Bold, false)); 0037 if(nMaxPlayerNameLength < playerName.boundingRect().width()) 0038 { 0039 nMaxPlayerNameLength = static_cast<int>(playerName.boundingRect().width()); 0040 } 0041 if(i == playerList.count() - 1) 0042 { 0043 int nAllItemsWidth = static_cast<int>(4 * (Granatier::CellSize / 2 + 4)); 0044 if(nAllItemsWidth > nMaxPlayerNameLength + Granatier::CellSize / 2 + 4) 0045 { 0046 nWidth = nAllItemsWidth; 0047 } 0048 else 0049 { 0050 nWidth = static_cast<int>(nMaxPlayerNameLength + Granatier::CellSize / 2 + 4); 0051 } 0052 nLeft = -(nWidth + 20); 0053 nHeight = static_cast<int>(playerName.boundingRect().height() + Granatier::CellSize / 2); 0054 nTop = static_cast<int>(m_gameScene->sceneRect().y() + m_gameScene->height()/2 - playerList.count()/2 * (nHeight + 4)); 0055 } 0056 } 0057 0058 //create the labels 0059 PlayerInfo* playerInfo; 0060 KGameRenderer* renderer; 0061 for(int i = 0; i < playerList.count(); i++) 0062 { 0063 QPen dimmRectPen; 0064 dimmRectPen.setWidth(0); 0065 dimmRectPen.setColor(QColor(0,0,0,200)); 0066 QBrush dimmRectBrush(QColor(0,0,0,200)); 0067 0068 playerInfo = new PlayerInfo; 0069 playerInfo->name = nullptr; 0070 playerInfo->icon = nullptr; 0071 playerInfo->bonusShield = nullptr; 0072 playerInfo->bonusShieldDimm = nullptr; 0073 playerInfo->bonusThrow = nullptr; 0074 playerInfo->bonusThrowDimm = nullptr; 0075 playerInfo->bonusKick = nullptr; 0076 playerInfo->bonusKickDimm = nullptr; 0077 playerInfo->badBonus = nullptr; 0078 playerInfo->badBonusDimm = nullptr; 0079 0080 //create the player icons 0081 renderer = m_gameScene->renderer(Granatier::Element::PLAYER, playerList[i]); 0082 if(renderer) 0083 { 0084 playerInfo->icon = new KGameRenderedItem(renderer, QStringLiteral("player_0")); 0085 playerInfo->icon->setZValue(1001); 0086 playerInfo->icon->setPos(nLeft, nTop + i * (nHeight + 4)); 0087 m_gameScene->addItem(playerInfo->icon); 0088 } 0089 0090 //create the player names 0091 playerInfo->name = new QGraphicsTextItem(playerList[i]->getPlayerName()); 0092 playerInfo->name->setFont(QFont(QStringLiteral("Helvetica"), static_cast<int>(Granatier::CellSize * 0.25), QFont::Bold, false)); 0093 playerInfo->name->setDefaultTextColor(QColor("#FFFF00")); 0094 playerInfo->name->setZValue(1001); 0095 playerInfo->name->setPos(nLeft + Granatier::CellSize / 2 + 2, nTop + i * (nHeight+4) - 4); 0096 m_gameScene->addItem(playerInfo->name); 0097 0098 renderer = m_gameScene->renderer(Granatier::Element::BONUS); 0099 if(renderer) 0100 { 0101 //create the bonus shield icons 0102 playerInfo->bonusShield = new KGameRenderedItem(renderer, QStringLiteral("bonus_shield")); 0103 playerInfo->bonusShield->setZValue(1001); 0104 playerInfo->bonusShield->setPos(nLeft, nTop + Granatier::CellSize / 2 + 1 + i * (nHeight + 4)); 0105 m_gameScene->addItem(playerInfo->bonusShield); 0106 0107 playerInfo->bonusShieldDimm = new QGraphicsRectItem(); 0108 playerInfo->bonusShieldDimm->setBrush(dimmRectBrush); 0109 playerInfo->bonusShieldDimm->setPen(dimmRectPen); 0110 playerInfo->bonusShieldDimm->setZValue(1002); 0111 playerInfo->bonusShieldDimm->setPos(playerInfo->bonusShield->pos().x()-0.5, playerInfo->bonusShield->pos().y()-0.5); 0112 m_gameScene->addItem(playerInfo->bonusShieldDimm); 0113 0114 //create the bonus throw icons 0115 playerInfo->bonusThrow = new KGameRenderedItem(renderer, QStringLiteral("bonus_throw")); 0116 playerInfo->bonusThrow->setZValue(1001); 0117 playerInfo->bonusThrow->setPos(nLeft + Granatier::CellSize / 2 + 4, nTop + Granatier::CellSize / 2 + 1 + i * (nHeight + 4)); 0118 m_gameScene->addItem(playerInfo->bonusThrow); 0119 0120 playerInfo->bonusThrowDimm = new QGraphicsRectItem(); 0121 playerInfo->bonusThrowDimm->setBrush(dimmRectBrush); 0122 playerInfo->bonusThrowDimm->setPen(dimmRectPen); 0123 playerInfo->bonusThrowDimm->setZValue(1002); 0124 playerInfo->bonusThrowDimm->setPos(playerInfo->bonusThrow->pos().x()-0.5, playerInfo->bonusThrow->pos().y()-0.5); 0125 m_gameScene->addItem(playerInfo->bonusThrowDimm); 0126 0127 //create the bonus kick icons 0128 playerInfo->bonusKick = new KGameRenderedItem(renderer, QStringLiteral("bonus_kick")); 0129 playerInfo->bonusKick->setZValue(1001); 0130 playerInfo->bonusKick->setPos(nLeft + 2 * (Granatier::CellSize / 2 + 4), nTop + Granatier::CellSize / 2 + 1 + i * (nHeight + 4)); 0131 m_gameScene->addItem(playerInfo->bonusKick); 0132 0133 playerInfo->bonusKickDimm = new QGraphicsRectItem(); 0134 playerInfo->bonusKickDimm->setBrush(dimmRectBrush); 0135 playerInfo->bonusKickDimm->setPen(dimmRectPen); 0136 playerInfo->bonusKickDimm->setZValue(1002); 0137 playerInfo->bonusKickDimm->setPos(playerInfo->bonusKick->pos().x()-0.5, playerInfo->bonusKick->pos().y()-0.5); 0138 m_gameScene->addItem(playerInfo->bonusKickDimm); 0139 0140 //create the bad bonus icons 0141 playerInfo->badBonus = new KGameRenderedItem(renderer, m_badBonusSpriteKey); 0142 playerInfo->badBonus->setZValue(1001); 0143 playerInfo->badBonus->setPos(nLeft + 3 * (Granatier::CellSize / 2 + 4), nTop + Granatier::CellSize / 2 + 1 + i * (nHeight + 4)); 0144 m_gameScene->addItem(playerInfo->badBonus); 0145 0146 playerInfo->badBonusDimm = new QGraphicsRectItem(); 0147 playerInfo->badBonusDimm->setBrush(dimmRectBrush); 0148 playerInfo->badBonusDimm->setPen(dimmRectPen); 0149 playerInfo->badBonusDimm->setZValue(1002); 0150 playerInfo->badBonusDimm->setPos(playerInfo->badBonus->pos().x()-0.5, playerInfo->badBonus->pos().y()-0.5); 0151 m_gameScene->addItem(playerInfo->badBonusDimm); 0152 } 0153 0154 m_mapPlayerInfo.insert(playerList[i], playerInfo); 0155 0156 //connect player 0157 connect(playerList[i], &Player::bonusUpdated, this, &InfoSidebar::bonusInfoChanged); 0158 } 0159 0160 m_background = new QGraphicsRectItem(); 0161 m_background->setBrush(QBrush(QColor(0,0,0,175))); 0162 m_background->setZValue(1000); 0163 m_background->setRect(nLeft - 10 , nTop - 10, nWidth + 16, playerList.count() * (nHeight + 4) + 16); 0164 m_gameScene->addItem(m_background); 0165 } 0166 0167 InfoSidebar::~InfoSidebar() 0168 { 0169 //Remove the player infosidebar 0170 QMap <Player*, PlayerInfo*>::iterator iteratorPlayerInfo = m_mapPlayerInfo.begin(); 0171 while (iteratorPlayerInfo != m_mapPlayerInfo.end()) 0172 { 0173 if(iteratorPlayerInfo.value()) 0174 { 0175 //remove the icon 0176 if(m_gameScene->items().contains(iteratorPlayerInfo.value()->icon)) 0177 { 0178 m_gameScene->removeItem(iteratorPlayerInfo.value()->icon); 0179 } 0180 delete iteratorPlayerInfo.value()->icon; 0181 //remove the name 0182 if(m_gameScene->items().contains(iteratorPlayerInfo.value()->name)) 0183 { 0184 m_gameScene->removeItem(iteratorPlayerInfo.value()->name); 0185 } 0186 delete iteratorPlayerInfo.value()->name; 0187 //remove shield bonus 0188 if(m_gameScene->items().contains(iteratorPlayerInfo.value()->bonusShield)) 0189 { 0190 m_gameScene->removeItem(iteratorPlayerInfo.value()->bonusShield); 0191 } 0192 delete iteratorPlayerInfo.value()->bonusShield; 0193 //remove shield bonus dimm 0194 if(m_gameScene->items().contains(iteratorPlayerInfo.value()->bonusShieldDimm)) 0195 { 0196 m_gameScene->removeItem(iteratorPlayerInfo.value()->bonusShieldDimm); 0197 } 0198 delete iteratorPlayerInfo.value()->bonusShieldDimm; 0199 //remove throw bonus 0200 if(m_gameScene->items().contains(iteratorPlayerInfo.value()->bonusThrow)) 0201 { 0202 m_gameScene->removeItem(iteratorPlayerInfo.value()->bonusThrow); 0203 } 0204 delete iteratorPlayerInfo.value()->bonusThrow; 0205 //remove throw bonus dimm 0206 if(m_gameScene->items().contains(iteratorPlayerInfo.value()->bonusThrowDimm)) 0207 { 0208 m_gameScene->removeItem(iteratorPlayerInfo.value()->bonusThrowDimm); 0209 } 0210 delete iteratorPlayerInfo.value()->bonusThrowDimm; 0211 //remove kick bonus 0212 if(m_gameScene->items().contains(iteratorPlayerInfo.value()->bonusKick)) 0213 { 0214 m_gameScene->removeItem(iteratorPlayerInfo.value()->bonusKick); 0215 } 0216 delete iteratorPlayerInfo.value()->bonusKick; 0217 //remove kick bonus dimm 0218 if(m_gameScene->items().contains(iteratorPlayerInfo.value()->bonusKickDimm)) 0219 { 0220 m_gameScene->removeItem(iteratorPlayerInfo.value()->bonusKickDimm); 0221 } 0222 delete iteratorPlayerInfo.value()->bonusKickDimm; 0223 //remove bad bonus 0224 if(m_gameScene->items().contains(iteratorPlayerInfo.value()->badBonus)) 0225 { 0226 m_gameScene->removeItem(iteratorPlayerInfo.value()->badBonus); 0227 } 0228 delete iteratorPlayerInfo.value()->badBonus; 0229 //remove bad bonus dimm 0230 if(m_gameScene->items().contains(iteratorPlayerInfo.value()->badBonusDimm)) 0231 { 0232 m_gameScene->removeItem(iteratorPlayerInfo.value()->badBonusDimm); 0233 } 0234 delete iteratorPlayerInfo.value()->badBonusDimm; 0235 0236 delete iteratorPlayerInfo.value(); 0237 } 0238 iteratorPlayerInfo = m_mapPlayerInfo.erase(iteratorPlayerInfo); 0239 } 0240 0241 //remove the background 0242 if(m_gameScene->items().contains(m_background)) 0243 { 0244 m_gameScene->removeItem(m_background); 0245 } 0246 delete m_background; 0247 0248 m_gameScene = nullptr; 0249 m_game = nullptr; 0250 } 0251 0252 void InfoSidebar::reset() 0253 { 0254 QList <Player*> playerList = m_game->getPlayers(); 0255 for(int i = 0; i < playerList.count(); i++) 0256 { 0257 m_mapPlayerInfo.value(playerList[i])->bonusShieldDimm->setVisible(true); 0258 m_mapPlayerInfo.value(playerList[i])->bonusThrowDimm->setVisible(true); 0259 m_mapPlayerInfo.value(playerList[i])->bonusKickDimm->setVisible(true); 0260 m_mapPlayerInfo.value(playerList[i])->badBonusDimm->setVisible(true); 0261 } 0262 } 0263 0264 QRectF InfoSidebar::rect() 0265 { 0266 return m_background->rect(); 0267 } 0268 0269 void InfoSidebar::themeChanged() 0270 { 0271 KGameRenderer* renderer = m_gameScene->renderer(Granatier::Element::BONUS); 0272 KGameRenderedItem* tempItem; 0273 0274 //update player infosidebar 0275 QMap <Player*, PlayerInfo*>::iterator iteratorPlayerInfo = m_mapPlayerInfo.begin(); 0276 while (iteratorPlayerInfo != m_mapPlayerInfo.end()) 0277 { 0278 tempItem = iteratorPlayerInfo.value()->bonusShield; 0279 if(m_gameScene->items().contains(tempItem)) 0280 { 0281 m_gameScene->removeItem(tempItem); 0282 } 0283 //create the bonus shield 0284 iteratorPlayerInfo.value()->bonusShield = new KGameRenderedItem(renderer, QStringLiteral("bonus_shield")); 0285 iteratorPlayerInfo.value()->bonusShield->setZValue(1001); 0286 iteratorPlayerInfo.value()->bonusShield->setPos(tempItem->pos()); 0287 m_gameScene->addItem(iteratorPlayerInfo.value()->bonusShield); 0288 delete tempItem; 0289 0290 tempItem = iteratorPlayerInfo.value()->bonusThrow; 0291 if(m_gameScene->items().contains(tempItem)) 0292 { 0293 m_gameScene->removeItem(tempItem); 0294 } 0295 //create the bonus throw 0296 iteratorPlayerInfo.value()->bonusThrow = new KGameRenderedItem(renderer, QStringLiteral("bonus_throw")); 0297 iteratorPlayerInfo.value()->bonusThrow->setZValue(1001); 0298 iteratorPlayerInfo.value()->bonusThrow->setPos(tempItem->pos()); 0299 m_gameScene->addItem(iteratorPlayerInfo.value()->bonusThrow); 0300 delete tempItem; 0301 0302 tempItem = iteratorPlayerInfo.value()->bonusKick; 0303 if(m_gameScene->items().contains(tempItem)) 0304 { 0305 m_gameScene->removeItem(tempItem); 0306 } 0307 //create the bonus kick 0308 iteratorPlayerInfo.value()->bonusKick = new KGameRenderedItem(renderer, QStringLiteral("bonus_kick")); 0309 iteratorPlayerInfo.value()->bonusKick->setZValue(1001); 0310 iteratorPlayerInfo.value()->bonusKick->setPos(tempItem->pos()); 0311 m_gameScene->addItem(iteratorPlayerInfo.value()->bonusKick); 0312 delete tempItem; 0313 0314 tempItem = iteratorPlayerInfo.value()->badBonus; 0315 if(m_gameScene->items().contains(tempItem)) 0316 { 0317 m_gameScene->removeItem(tempItem); 0318 } 0319 //create the bad bonus 0320 iteratorPlayerInfo.value()->badBonus = new KGameRenderedItem(renderer, m_badBonusSpriteKey); 0321 iteratorPlayerInfo.value()->badBonus->setZValue(1001); 0322 iteratorPlayerInfo.value()->badBonus->setPos(tempItem->pos()); 0323 m_gameScene->addItem(iteratorPlayerInfo.value()->badBonus); 0324 delete tempItem; 0325 0326 iteratorPlayerInfo++; 0327 } 0328 0329 updateGraphics(m_svgScaleFactor); 0330 } 0331 0332 void InfoSidebar::bonusInfoChanged(Player* player, Granatier::Bonus::Type bonusType, int percentageElapsed) 0333 { 0334 if(m_gameScene->views().isEmpty()) 0335 { 0336 return; 0337 } 0338 0339 switch(static_cast<int>(bonusType)) 0340 { 0341 case Granatier::Bonus::SHIELD: 0342 m_mapPlayerInfo.value(player)->bonusShieldDimm->setVisible(percentageElapsed); 0343 break; 0344 case Granatier::Bonus::THROW: 0345 m_mapPlayerInfo.value(player)->bonusThrowDimm->setVisible(percentageElapsed); 0346 break; 0347 case Granatier::Bonus::KICK: 0348 m_mapPlayerInfo.value(player)->bonusKickDimm->setVisible(percentageElapsed); 0349 break; 0350 case Granatier::Bonus::HYPERACTIVE: 0351 case Granatier::Bonus::SLOW: 0352 case Granatier::Bonus::MIRROR: 0353 case Granatier::Bonus::SCATTY: 0354 case Granatier::Bonus::RESTRAIN: 0355 if(percentageElapsed == 0) 0356 { 0357 //set the new bad bonus icon 0358 KGameRenderer* renderer = m_gameScene->renderer(Granatier::Element::BONUS); 0359 if(renderer) 0360 { 0361 switch(static_cast<int>(bonusType)) 0362 { 0363 case Granatier::Bonus::HYPERACTIVE: 0364 m_badBonusSpriteKey = QStringLiteral("bonus_bad_hyperactive"); 0365 break; 0366 case Granatier::Bonus::SLOW: 0367 m_badBonusSpriteKey = QStringLiteral("bonus_bad_slow"); 0368 break; 0369 case Granatier::Bonus::MIRROR: 0370 m_badBonusSpriteKey = QStringLiteral("bonus_bad_mirror"); 0371 break; 0372 case Granatier::Bonus::SCATTY: 0373 m_badBonusSpriteKey = QStringLiteral("bonus_bad_scatty"); 0374 break; 0375 case Granatier::Bonus::RESTRAIN: 0376 m_badBonusSpriteKey = QStringLiteral("bonus_bad_restrain"); 0377 break; 0378 } 0379 0380 if(renderer->spriteExists(m_badBonusSpriteKey)) 0381 { 0382 m_mapPlayerInfo.value(player)->badBonus->setSpriteKey(m_badBonusSpriteKey); 0383 } 0384 0385 //hide the dimm overlay 0386 m_mapPlayerInfo.value(player)->badBonusDimm->setVisible(false); 0387 0388 //calculate graphics size 0389 QSize renderSize; 0390 QPoint topLeft(0, 0); 0391 topLeft = m_gameScene->views().constFirst()->mapFromScene(topLeft); 0392 QRectF rect; 0393 0394 QPoint bottomRight(static_cast<int>(Granatier::CellSize * 0.5), static_cast<int>(Granatier::CellSize * 0.5)); 0395 bottomRight = m_gameScene->views().constFirst()->mapFromScene(bottomRight); 0396 0397 renderSize.setHeight(bottomRight.y() - topLeft.y()); 0398 renderSize.setWidth(bottomRight.x() - topLeft.x()); 0399 0400 m_mapPlayerInfo.value(player)->badBonus->setRenderSize(renderSize); 0401 m_mapPlayerInfo.value(player)->badBonus->setScale(m_svgScaleFactor); 0402 0403 rect = m_mapPlayerInfo.value(player)->badBonusDimm->rect(); 0404 rect.setWidth(renderSize.width() * m_svgScaleFactor); 0405 rect.setHeight(renderSize.height() * m_svgScaleFactor); 0406 m_mapPlayerInfo.value(player)->badBonusDimm->setRect(rect); 0407 } 0408 } 0409 else 0410 { 0411 m_mapPlayerInfo.value(player)->badBonusDimm->setVisible(true); 0412 QRectF rect = m_mapPlayerInfo.value(player)->badBonusDimm->rect(); 0413 rect.setHeight(rect.width() * percentageElapsed/100.0); 0414 m_mapPlayerInfo.value(player)->badBonusDimm->setRect(rect); 0415 } 0416 break; 0417 } 0418 } 0419 0420 void InfoSidebar::updateGraphics(qreal svgScaleFactor) 0421 { 0422 if(m_gameScene->views().isEmpty()) 0423 { 0424 return; 0425 } 0426 0427 QSize renderSize; 0428 QPoint topLeft(0, 0); 0429 topLeft = m_gameScene->views().constFirst()->mapFromScene(topLeft); 0430 QPoint bottomRight; 0431 QRectF rect; 0432 0433 m_svgScaleFactor = svgScaleFactor; 0434 0435 //update player infosidebar 0436 QMap <Player*, PlayerInfo*>::iterator iteratorPlayerInfo = m_mapPlayerInfo.begin(); 0437 while (iteratorPlayerInfo != m_mapPlayerInfo.end()) 0438 { 0439 bottomRight.setX(static_cast<int>(Granatier::CellSize * 0.45)); 0440 bottomRight.setY(static_cast<int>(Granatier::CellSize * 0.45)); 0441 bottomRight = m_gameScene->views().constFirst()->mapFromScene(bottomRight); 0442 renderSize.setHeight(bottomRight.y() - topLeft.y()); 0443 renderSize.setWidth(bottomRight.x() - topLeft.x()); 0444 0445 iteratorPlayerInfo.value()->icon->setRenderSize(renderSize); 0446 iteratorPlayerInfo.value()->icon->setScale(m_svgScaleFactor); 0447 0448 bottomRight.setX(static_cast<int>(Granatier::CellSize * 0.5)); 0449 bottomRight.setY(static_cast<int>(Granatier::CellSize * 0.5)); 0450 bottomRight = m_gameScene->views().constFirst()->mapFromScene(bottomRight); 0451 renderSize.setHeight(bottomRight.y() - topLeft.y()); 0452 renderSize.setWidth(bottomRight.x() - topLeft.x()); 0453 0454 iteratorPlayerInfo.value()->bonusShield->setRenderSize(renderSize); 0455 iteratorPlayerInfo.value()->bonusShield->setScale(m_svgScaleFactor); 0456 rect = iteratorPlayerInfo.value()->bonusShieldDimm->rect(); 0457 rect.setWidth(renderSize.width() * m_svgScaleFactor); 0458 rect.setHeight(renderSize.height() * m_svgScaleFactor); 0459 iteratorPlayerInfo.value()->bonusShieldDimm->setRect(rect); 0460 0461 iteratorPlayerInfo.value()->bonusThrow->setRenderSize(renderSize); 0462 iteratorPlayerInfo.value()->bonusThrow->setScale(m_svgScaleFactor); 0463 rect = iteratorPlayerInfo.value()->bonusThrowDimm->rect(); 0464 rect.setWidth(renderSize.width() * m_svgScaleFactor); 0465 rect.setHeight(renderSize.height() * m_svgScaleFactor); 0466 iteratorPlayerInfo.value()->bonusThrowDimm->setRect(rect); 0467 0468 iteratorPlayerInfo.value()->bonusKick->setRenderSize(renderSize); 0469 iteratorPlayerInfo.value()->bonusKick->setScale(m_svgScaleFactor); 0470 rect = iteratorPlayerInfo.value()->bonusKickDimm->rect(); 0471 rect.setWidth(renderSize.width() * m_svgScaleFactor); 0472 rect.setHeight(renderSize.height() * m_svgScaleFactor); 0473 iteratorPlayerInfo.value()->bonusKickDimm->setRect(rect); 0474 0475 iteratorPlayerInfo.value()->badBonus->setRenderSize(renderSize); 0476 iteratorPlayerInfo.value()->badBonus->setScale(m_svgScaleFactor); 0477 rect = iteratorPlayerInfo.value()->badBonusDimm->rect(); 0478 rect.setWidth(renderSize.width() * m_svgScaleFactor); 0479 rect.setHeight(renderSize.height() * m_svgScaleFactor); 0480 iteratorPlayerInfo.value()->badBonusDimm->setRect(rect); 0481 0482 iteratorPlayerInfo++; 0483 } 0484 } 0485 0486 #include "moc_infosidebar.cpp"