Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:CurrentEventsGetList

From RoR Wiki

UI Lua API · LiveEvent functions
Version: WAR 1.4.8

Returns the list of current world events last received from the server (the Current Events window).

events = CurrentEventsGetList()

Arguments

None.

Returns

events
table – Array of event tables, indexed from 1. Empty if there are no events. Nothing is returned if the current-events data is not available.

Each event table:

Key Type Meaning
id number Event id. Pass it to CurrentEventsJumpToEvent.
type number Event type. The stock UI compares it with SystemData.CurrentEventType.PVE and SystemData.CurrentEventType.RVR.
subType number Event subtype. The stock UI uses it as a key into CurrentEvents.SubTypes for the name, text and icon.
subTypeId number –
tier number Tier of the event (0–255). The stock UI groups events by tier 1–4.
zone number –
time number – (not a whole number in general; the stock UI's code that formats it as a time is commented out).

Details

  • Each call builds a new table from the client's stored list. To refresh the stored list from the server, call CurrentEventsUpdate.
  • The stock UI uses the same function, EA_Window_CurrentEvents.OnEventsUpdated, to handle this function's result and the SystemData.Events.CURRENT_EVENTS_LIST_UPDATED event.

Errors

None.

Example

From default/ea_overheadmapwindow/source/overheadmapwindow.lua:

EA_Window_OverheadMap.OnEventsUpdated( CurrentEventsGetList() )
...
WindowSetShowing( "EA_Window_OverheadCurrentEventsButton", #eventsData > 0 )

From default/ea_currenteventswindow/source/currenteventswindow.lua:

for _, data in ipairs( eventsData )
do
    if( data.type == SystemData.CurrentEventType.PVE )
    then
        local insertationIndex = GetTableIndexBasedOnPriority( m_eventsData[ data.tier ].PVE, data, "pvePriority", 1 )
        table.insert( m_eventsData[ data.tier ].PVE, insertationIndex, data )
    ...

See also