ClosureEvents
Sourceplayerevent EVENT_PLAYER_CHAT_FILTER
Source
Use this chat event if you want to access the entered message
function static eventid.toIntId() returns int
Source
function unregisterEvents(int id)
Source
function unregisterEventsForUnit(unit u)
Source
class EventListener
Source
HashMap castMap
Source
OnCastListener array(dimensions = 1) castMapCasters
Source
int eventId
Source
EventListener array(dimensions = 1) generalListenersFirsts
Source
EventListener next
Source
EventListener prev
Source
int uid
Source
EventListener array(dimensions = 1) unitListenersFirsts
Source
boolean useMouseEvents
Source
function add(eventid eventId, EventListener listener) returns EventListener
Source
function add(unit u, eventid eventId, EventListener listener) returns EventListener
Source
function generalEventCallback()
Source
function onCast(unit u, int abilId, OnCastListener listener) returns OnCastListener
Source
function onCast(int abilId, OnCastListener listener) returns OnCastListener
Source
function onCast(unit u, OnCast listener) returns OnCast
Source
function onEvent()
Source
function onPointCast(unit u, int abilId, OnPointCast listener) returns OnPointCast
Source
function onPointCast(int abilId, OnPointCast listener) returns OnPointCast
Source
function onSpellEffect()
Source
function onTargetCast(unit u, int abilId, OnUnitCast listener) returns OnUnitCast
Source
function onTargetCast(int abilId, OnUnitCast listener) returns OnUnitCast
Source
class OnCast
Source
function fire(unit caster)
Source
function fireEx(int id)
Source
class OnCastListener
Source
This package is a comfort wrapper around wc3 events,
for easy global and per-unit event listening via closures.
To listen to an event, simply #add, optionally passing a target unit:
> EventListener.add(EVENT_PLAYER_UNIT_DEATH) ->
>
> EventListener.add(someUnit, EVENT_PLAYER_UNIT_DEATH) ->
>
For spell handling there are comfort wrappers via the `on` prefix:
> EventListener.onCast(MY_SPELL_ID) (caster) ->
>
> EventListener.onCast(myUnit, MY_SPELL_ID) (caster) ->
>
> EventListener.onPointCast(myUnit, MY_SPELL_ID) (caster, target) ->
>
*IMPORTANT**:
Make sure to always use the "EVENT_PLAYER_UNIT_*" variants of the eventids.
Other supported events:
- EVENT_PLAYER_LEAVE
- EVENT_UNIT_DAMAGED
- EVENT_PLAYER_CHAT_FILTER
- EVENT_PLAYER_ARROW_*
int abilId
Source
unit eventUnit
Source
OnCastListener next
Source
OnCastListener prev
Source
function fire(unit caster)
Source
class OnPointCast
Source
function fire(unit caster)
Source
function fireEx(unit caster, 'unknown type'
(the type vec2 could not be found, the containing package might not be imported) target)
Source
class OnUnitCast
Source
function fire(unit caster)
Source
function fireEx(unit caster, unit target)
Source