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

Method lstProdClick

src/Basescape/NewManufactureListState.cpp:118–133  ·  view source on GitHub ↗

* Opens the Production settings screen. * @param action A pointer to an Action. */

Source from the content-addressed store, hash-verified

116 * @param action A pointer to an Action.
117*/
118void NewManufactureListState::lstProdClick (Action *)
119{
120 RuleManufacture *rule = _possibleProductions[_lstManufacture->getSelectedRow()];
121 if (rule->getCategory() == "STR_CRAFT" && _base->getAvailableHangars() - _base->getUsedHangars() == 0)
122 {
123 _game->pushState(new ErrorMessageState(_game, "STR_NO_FREE_HANGARS_FOR_CRAFT_PRODUCTION", _palette, Palette::blockOffset(15)+1, "BACK17.SCR", 6));
124 }
125 else if (rule->getRequiredSpace() > _base->getFreeWorkshops())
126 {
127 _game->pushState(new ErrorMessageState(_game, "STR_NOT_ENOUGH_WORK_SPACE", _palette, Palette::blockOffset(15)+1, "BACK17.SCR", 6));
128 }
129 else
130 {
131 _game->pushState(new ManufactureStartState(_game, _base, rule));
132 }
133}
134
135
136/**

Callers

nothing calls this directly

Calls 7

getSelectedRowMethod · 0.80
getCategoryMethod · 0.80
getAvailableHangarsMethod · 0.80
getUsedHangarsMethod · 0.80
pushStateMethod · 0.80
getRequiredSpaceMethod · 0.80
getFreeWorkshopsMethod · 0.80

Tested by

no test coverage detected