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

Method btnPrevClick

src/Battlescape/UnitInfoState.cpp:651–670  ·  view source on GitHub ↗

* Selects the previous unit. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

649 * @param action Pointer to an action.
650 */
651void UnitInfoState::btnPrevClick(Action *action)
652{
653 if (_parent)
654 { // so we are here from a Battlescape Game
655 _parent->selectPreviousPlayerUnit(false, false, _fromInventory);
656 }
657 else
658 { // so we are here from the Craft Equipment screen
659 _battleGame->selectPreviousPlayerUnit(false, false, true);
660 }
661 _unit = _battleGame->getSelectedUnit();
662 if (_unit != 0)
663 {
664 init();
665 }
666 else
667 {
668 exitClick(action);
669 }
670}
671
672/**
673 * Selects the next unit.

Callers

nothing calls this directly

Calls 3

initFunction · 0.85
getSelectedUnitMethod · 0.80

Tested by

no test coverage detected