Difference between revisions of "RegisterEventHandler"

From Legends of Aria Admin and Modding Wiki
Jump to: navigation, search
 
(Prototype)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[http://shardsonline.com/lN2rwhz4jSVambqesEBZ/lua-reference/global.html#registereventhandler_ RegisterEventHandler official Doc]]
+
[http://shardsonline.com/lN2rwhz4jSVambqesEBZ/lua-reference/global.html#registereventhandler_ RegisterEventHandler official Doc]
[[http://shardsonline.com/lN2rwhz4jSVambqesEBZ/lua-reference/global.html#registersingleeventhandler_ RegisterSingleEventHandler official Doc]]
+
<br>[http://shardsonline.com/lN2rwhz4jSVambqesEBZ/lua-reference/global.html#registersingleeventhandler_ RegisterSingleEventHandler official Doc]
[[http://shardsonline.com/lN2rwhz4jSVambqesEBZ/lua-reference/global.html#overrideeventhandler_ OverrideEventHandler official Doc]]
+
<br>[http://shardsonline.com/lN2rwhz4jSVambqesEBZ/lua-reference/global.html#overrideeventhandler_ OverrideEventHandler official Doc]
 
+
<br>
 
== <code>'''RegisterEventHandler(...)'''</code> ===
 
== <code>'''RegisterEventHandler(...)'''</code> ===
 
{|
 
{|
Line 19: Line 19:
 
Parameters:
 
Parameters:
 
{|
 
{|
| (LuaEventType) mEvent: || The event type the handler shall respond to (EventType.Message, EventType.Timer, etc ...)
+
| <code>(LuaEventType) mEvent:</code> || The event type the handler shall respond to (EventType.Message, EventType.Timer, etc ...)described in the [http://shardsonline.com/lN2rwhz4jSVambqesEBZ/lua-reference/events.html Events] section of the documentation
 +
|-
 +
| <code>(string)mEventIdentifier:</code> || Event Identifier of the specific event.
 
|-
 
|-
| (string)mEventIdentifier: || Event Identifier of the specific event (described in the [[http://shardsonline.com/lN2rwhz4jSVambqesEBZ/lua-reference/events.html Events]] section of the documentation
+
| <code>(function)mEventHandler:</code> || Handler function reference. Can be a function name or a function defined inline.
|
 
| (function)mEventHandler: || Handler function reference. Can be a function name or a function defined inline.
 
 
|}
 
|}
Return Values
+
Return Values: none
(boolean) mBool: True on success. False otherwise.
 
  
 
=== Notes and Caveats ===
 
=== Notes and Caveats ===

Latest revision as of 02:00, 21 November 2016

RegisterEventHandler official Doc
RegisterSingleEventHandler official Doc
OverrideEventHandler official Doc

RegisterEventHandler(...) =

Function Type: Engine API
Function Category: Global

Description

Registers an event handler which calls the specified function when the Events fires with a matching event identifier.

Prototype

RegisterEventHandler( (EventType)mEvent, (string)mEventIdentifier, (function)mEventHandler) 

Parameters:

(LuaEventType) mEvent: The event type the handler shall respond to (EventType.Message, EventType.Timer, etc ...)described in the Events section of the documentation
(string)mEventIdentifier: Event Identifier of the specific event.
(function)mEventHandler: Handler function reference. Can be a function name or a function defined inline.

Return Values: none

Notes and Caveats

These handlers are not saved and must be registered every time the object is loaded.