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

Method btnRegionListClick

src/Geoscape/GraphsState.cpp:477–494  ·  view source on GitHub ↗

* Handles a click on a region button. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

475 * @param action Pointer to an action.
476 */
477void GraphsState::btnRegionListClick(Action * action)
478{
479 size_t number = (action->getSender()->getY()-_game->getScreen()->getDY())/11;
480 ToggleTextButton *button = 0;
481
482 if ((_regionToggles.size() <= GRAPH_MAX_BUTTONS + 1 && number == _regionToggles.size()-1)||(_regionToggles.size() > GRAPH_MAX_BUTTONS + 1 && number == GRAPH_MAX_BUTTONS))
483 {
484 button = _btnRegionTotal;
485 }
486 else
487 {
488 button = _btnRegions.at(number);
489 }
490
491 _regionToggles.at(number+_butRegionsOffset)->_pushed = button->getPressed();
492
493 drawLines();
494}
495
496/**
497 * Handles a click on a country button.

Callers

nothing calls this directly

Calls 5

getSenderMethod · 0.80
getDYMethod · 0.80
getScreenMethod · 0.80
getPressedMethod · 0.80
getYMethod · 0.45

Tested by

no test coverage detected