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

Method mouseRelease

src/Engine/InteractiveSurface.cpp:271–285  ·  view source on GitHub ↗

* Called every time there's a mouse release over the surface. * Allows the surface to have custom functionality for this action, * and can be called externally to simulate the action. * @param action Pointer to an action. * @param state State that the action handlers belong to. */

Source from the content-addressed store, hash-verified

269 * @param state State that the action handlers belong to.
270 */
271void InteractiveSurface::mouseRelease(Action *action, State *state)
272{
273 std::map<Uint8, ActionHandler>::iterator allHandler = _release.find(0);
274 std::map<Uint8, ActionHandler>::iterator oneHandler = _release.find(action->getDetails()->button.button);
275 if (allHandler != _release.end())
276 {
277 ActionHandler handler = allHandler->second;
278 (state->*handler)(action);
279 }
280 if (oneHandler != _release.end())
281 {
282 ActionHandler handler = oneHandler->second;
283 (state->*handler)(action);
284 }
285}
286
287/**
288 * Called every time there's a mouse click on the surface.

Callers

nothing calls this directly

Calls 1

getDetailsMethod · 0.80

Tested by

no test coverage detected