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

Method mouseClick

src/Engine/InteractiveSurface.cpp:294–308  ·  view source on GitHub ↗

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

292 * @param state State that the action handlers belong to.
293 */
294void InteractiveSurface::mouseClick(Action *action, State *state)
295{
296 std::map<Uint8, ActionHandler>::iterator allHandler = _click.find(0);
297 std::map<Uint8, ActionHandler>::iterator oneHandler = _click.find(action->getDetails()->button.button);
298 if (allHandler != _click.end())
299 {
300 ActionHandler handler = allHandler->second;
301 (state->*handler)(action);
302 }
303 if (oneHandler != _click.end())
304 {
305 ActionHandler handler = oneHandler->second;
306 (state->*handler)(action);
307 }
308}
309
310/**
311 * Called every time the mouse moves into the surface.

Callers

nothing calls this directly

Calls 1

getDetailsMethod · 0.80

Tested by

no test coverage detected