* Sets the button as the pressed button if it's part of a group, * and inverts the colors when pressed. * @param action Pointer to an action. * @param state State that the action handlers belong to. */
| 78 | * @param state State that the action handlers belong to. |
| 79 | */ |
| 80 | void ImageButton::mousePress(Action *action, State *state) |
| 81 | { |
| 82 | if (_group != 0) |
| 83 | { |
| 84 | if (action->getDetails()->button.button == SDL_BUTTON_LEFT) |
| 85 | { |
| 86 | (*_group)->invert((*_group)->getColor() + 3); |
| 87 | *_group = this; |
| 88 | invert(_color + 3); |
| 89 | } |
| 90 | } |
| 91 | else if (!_inverted && isButtonPressed() && isButtonHandled(action->getDetails()->button.button)) |
| 92 | { |
| 93 | _inverted = true; |
| 94 | invert(_color + 3); |
| 95 | } |
| 96 | InteractiveSurface::mousePress(action, state); |
| 97 | } |
| 98 | |
| 99 | /* |
| 100 | * Sets the button as the released button if it's part of a group. |
nothing calls this directly
no test coverage detected