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

Method onMouseClick

src/Engine/InteractiveSurface.cpp:410–420  ·  view source on GitHub ↗

* Sets a function to be called every time the surface is mouse clicked. * @param handler Action handler. * @param button Mouse button to check for. Set to 0 for any button. */

Source from the content-addressed store, hash-verified

408 * @param button Mouse button to check for. Set to 0 for any button.
409 */
410void InteractiveSurface::onMouseClick(ActionHandler handler, Uint8 button)
411{
412 if (handler != 0)
413 {
414 _click[button] = handler;
415 }
416 else
417 {
418 _click.erase(button);
419 }
420}
421
422/**
423 * Sets a function to be called every time the surface is mouse pressed.

Callers 15

ActionMenuStateMethod · 0.80
InfoboxOKStateMethod · 0.80
InventoryStateMethod · 0.80
BriefingStateMethod · 0.80
NoContainmentStateMethod · 0.80
MiniMapStateMethod · 0.80
PrimeGrenadeStateMethod · 0.80
ScannerStateMethod · 0.80
DebriefingStateMethod · 0.80
MedikitStateMethod · 0.80
AliensCrashStateMethod · 0.80
BattlescapeStateMethod · 0.80

Calls

no outgoing calls

Tested by 2

ResearchCompleteStateMethod · 0.64