* Closes the window on right-click. * @param action Pointer to an action. */
| 173 | * @param action Pointer to an action. |
| 174 | */ |
| 175 | void 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. |
nothing calls this directly
no test coverage detected