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

Method handle

src/Battlescape/ActionMenuState.cpp:175–189  ·  view source on GitHub ↗

* Closes the window on right-click. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

173 * @param action Pointer to an action.
174 */
175void ActionMenuState::handle(Action *action)
176{
177 State::handle(action);
178 if (action->getDetails()->type == SDL_MOUSEBUTTONDOWN && action->getDetails()->button.button == SDL_BUTTON_RIGHT)
179 {
180 _game->popState();
181 }
182 else if (action->getDetails()->type == SDL_KEYDOWN &&
183 (action->getDetails()->key.keysym.sym == Options::keyCancel ||
184 action->getDetails()->key.keysym.sym == Options::keyBattleUseLeftHand ||
185 action->getDetails()->key.keysym.sym == Options::keyBattleUseRightHand))
186 {
187 _game->popState();
188 }
189}
190
191/**
192 * Executes the action corresponding to this action menu item.

Callers

nothing calls this directly

Calls 2

getDetailsMethod · 0.80
popStateMethod · 0.45

Tested by

no test coverage detected