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

Method mousePress

src/Interface/ImageButton.cpp:80–97  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

78 * @param state State that the action handlers belong to.
79 */
80void 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.

Callers

nothing calls this directly

Calls 3

getDetailsMethod · 0.80
invertMethod · 0.80
getColorMethod · 0.45

Tested by

no test coverage detected