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

Method mousePress

src/Engine/InteractiveSurface.cpp:248–262  ·  view source on GitHub ↗

* Called every time there's a mouse press 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

246 * @param state State that the action handlers belong to.
247 */
248void InteractiveSurface::mousePress(Action *action, State *state)
249{
250 std::map<Uint8, ActionHandler>::iterator allHandler = _press.find(0);
251 std::map<Uint8, ActionHandler>::iterator oneHandler = _press.find(action->getDetails()->button.button);
252 if (allHandler != _press.end())
253 {
254 ActionHandler handler = allHandler->second;
255 (state->*handler)(action);
256 }
257 if (oneHandler != _press.end())
258 {
259 ActionHandler handler = oneHandler->second;
260 (state->*handler)(action);
261 }
262}
263
264/**
265 * Called every time there's a mouse release over the surface.

Callers

nothing calls this directly

Calls 1

getDetailsMethod · 0.80

Tested by

no test coverage detected