MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / viewMouseOver

Method viewMouseOver

src/Basescape/BasescapeState.cpp:451–471  ·  view source on GitHub ↗

* Displays the name of the facility the mouse is over. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

449 * @param action Pointer to an action.
450 */
451void 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.

Callers

nothing calls this directly

Calls 10

getSelectedFacilityMethod · 0.80
getLanguageMethod · 0.80
argMethod · 0.60
getCraftsMethod · 0.45
getRulesMethod · 0.45
getBuildTimeMethod · 0.45
getTypeMethod · 0.45
getCraftMethod · 0.45
getNameMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected