<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ABroadcastEvent</id>
	<title>API:BroadcastEvent - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ABroadcastEvent"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:BroadcastEvent&amp;action=history"/>
	<updated>2026-10-17T04:19:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:BroadcastEvent&amp;diff=30185&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:BroadcastEvent&amp;diff=30185&amp;oldid=prev"/>
		<updated>2026-10-16T19:40:35Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Interface}}&lt;br /&gt;
Raises a UI event. The event is queued and delivered to all listeners during the next interface update.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BroadcastEvent(eventId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;eventId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Id of the event, usually a value from &amp;lt;code&amp;gt;SystemData.Events&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The event is not delivered during the call. The id is added to a queue that the client empties during its next interface update.&lt;br /&gt;
* When the queue is emptied, each event is delivered to everything that listens for that id: functions registered with [[API:RegisterEventHandler|RegisterEventHandler]], windows that registered with &amp;lt;code&amp;gt;WindowRegisterEventHandler&amp;lt;/code&amp;gt;, and the client&amp;#039;s own listeners. The stock UI relies on the last group to request actions, for example &amp;lt;code&amp;gt;BroadcastEvent( SystemData.Events.QUIT )&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BroadcastEvent( SystemData.Events.RELOAD_INTERFACE )&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Handlers are called without arguments.&lt;br /&gt;
* Events raised by a handler while the queue is being emptied are delivered in the same update, after the events already queued.&lt;br /&gt;
* The same id queued several times in a row is delivered only once. For example, three &amp;lt;code&amp;gt;BroadcastEvent( SystemData.Events.USER_SETTINGS_CHANGED )&amp;lt;/code&amp;gt; calls in a row within one frame produce a single delivery.&lt;br /&gt;
* Event id 0 is never delivered.&lt;br /&gt;
* The function takes exactly one argument.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; argument check.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Telling the rest of the UI that settings have changed, from &amp;lt;code&amp;gt;ea_backpackwindow/source/backpackutils.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
BroadcastEvent( SystemData.Events.USER_SETTINGS_CHANGED )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_uimodwindow/source/uimodwindow.lua&amp;lt;/code&amp;gt;, after enabling or disabling modules:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for index, modData in ipairs( UiModWindow.modsListData ) do&lt;br /&gt;
    ModuleSetEnabled( modData.name, modData.isEnabled  )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
BroadcastEvent( SystemData.Events.RELOAD_INTERFACE )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:RegisterEventHandler|RegisterEventHandler]]&lt;br /&gt;
* [[API:UnregisterEventHandler|UnregisterEventHandler]]&lt;br /&gt;
* [[API:WindowRegisterEventHandler|WindowRegisterEventHandler]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>