| 280 | } |
| 281 | |
| 282 | void JoinMenu::updateTeamTexture() { |
| 283 | TextureManager& tm = TextureManager::instance(); |
| 284 | FontManager& fm = FontManager::instance(); |
| 285 | |
| 286 | // load the appropriate texture |
| 287 | std::string texture; |
| 288 | if (getTeam() == AutomaticTeam) { |
| 289 | texture = "automatic_"; |
| 290 | } |
| 291 | else { |
| 292 | texture = Team::getImagePrefix(getTeam()); |
| 293 | } |
| 294 | texture += "icon"; |
| 295 | int id = tm.getTextureID(texture); |
| 296 | teamIcon->setTexture(id); |
| 297 | |
| 298 | // leave the icon the same size as the text so it doesn't overlap other lines |
| 299 | const float iconSize = team->getFontSize(); |
| 300 | teamIcon->setSize(iconSize, iconSize); |
| 301 | |
| 302 | // put it at the end of the text |
| 303 | Bundle* bdl = BundleMgr::getCurrentBundle(); |
| 304 | const float x = team->getX() + fm.getStringWidth(team->getFontFace()->getFMFace(), |
| 305 | team->getFontSize(), |
| 306 | std::string(bdl->getLocalString(team->getList()[team->getIndex()]) + "x")); |
| 307 | teamIcon->setPosition(x, team->getY()); |
| 308 | } |
| 309 | |
| 310 | void JoinMenu::resize(int _width, int _height) { |
| 311 | HUDDialog::resize(_width, _height); |
no test coverage detected