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

Method moreUnitClick

src/Basescape/ManufactureInfoState.cpp:416–428  ·  view source on GitHub ↗

* Increases the "units to produce", in the case of a right-click, to infinite, and 1 on left-click. * @param action A pointer to an Action. */

Source from the content-addressed store, hash-verified

414 * @param action A pointer to an Action.
415 */
416void ManufactureInfoState::moreUnitClick(Action * action)
417{
418 if (_production->getInfiniteAmount()) return; // We can't increase over infinite :)
419 if (action->getDetails()->button.button == SDL_BUTTON_RIGHT)
420 {
421 _production->setInfiniteAmount(true);
422 setAssignedEngineer();
423 }
424 else if (action->getDetails()->button.button == SDL_BUTTON_LEFT)
425 {
426 moreUnit(1);
427 }
428}
429
430/**
431 * Removes the given number of units to produce from the project if possible.

Callers

nothing calls this directly

Calls 3

getInfiniteAmountMethod · 0.80
getDetailsMethod · 0.80
setInfiniteAmountMethod · 0.80

Tested by

no test coverage detected