* Displays the name of the facility the mouse is over. * @param action Pointer to an action. */
| 449 | * @param action Pointer to an action. |
| 450 | */ |
| 451 | void BasescapeState::viewMouseOver(Action *) |
| 452 | { |
| 453 | BaseFacility *f = _view->getSelectedFacility(); |
| 454 | std::wostringstream ss; |
| 455 | if (f != 0) |
| 456 | { |
| 457 | if (f->getRules()->getCrafts() == 0 || f->getBuildTime() > 0) |
| 458 | { |
| 459 | ss << tr(f->getRules()->getType()); |
| 460 | } |
| 461 | else |
| 462 | { |
| 463 | ss << tr(f->getRules()->getType()); |
| 464 | if (f->getCraft() != 0) |
| 465 | { |
| 466 | ss << L" " << tr("STR_CRAFT_").arg(f->getCraft()->getName(_game->getLanguage())); |
| 467 | } |
| 468 | } |
| 469 | } |
| 470 | _txtFacility->setText(ss.str()); |
| 471 | } |
| 472 | |
| 473 | /** |
| 474 | * Clears the facility name. |
nothing calls this directly
no test coverage detected