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

Method viewClick

src/Basescape/PlaceStartFacilityState.cpp:61–77  ·  view source on GitHub ↗

* Processes clicking on facilities. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

59 * @param action Pointer to an action.
60 */
61void PlaceStartFacilityState::viewClick(Action *)
62{
63 if (!_view->isPlaceable(_rule))
64 {
65 _game->popState();
66 _game->pushState(new ErrorMessageState(_game, "STR_CANNOT_BUILD_HERE", _palette, Palette::blockOffset(15)+1, "BACK01.SCR", 6));
67 }
68 else
69 {
70 BaseFacility *fac = new BaseFacility(_rule, _base);
71 fac->setX(_view->getGridX());
72 fac->setY(_view->getGridY());
73 _base->getFacilities()->push_back(fac);
74 _game->popState();
75 _select->facilityBuilt();
76 }
77}
78
79}

Callers

nothing calls this directly

Calls 9

isPlaceableMethod · 0.80
pushStateMethod · 0.80
getGridXMethod · 0.80
getGridYMethod · 0.80
getFacilitiesMethod · 0.80
facilityBuiltMethod · 0.80
popStateMethod · 0.45
setXMethod · 0.45
setYMethod · 0.45

Tested by

no test coverage detected