Dynamic Window Response

From Legends of Aria Admin and Modding Wiki
Jump to: navigation, search

When presenting your Dynamic Window to a user, you can also pass in the GameObj that should receive the DynamicWindowResponse events with the second parameter, if this parameter is left out then Module the DynamicWindow was created on will receive the event.

To capture the DynamicWindowResponse we Register an Event Handler:

RegisterEventHandler(EventType.DynamicWindowResponse, "WindowId", function(user, useType)
	if ( useType == "clickbutton" ) then
		-- do something about it
		return
	end
	if ( useType == "clickbutton2" ) then
		-- do something else about it
		return
	end
	-- window was closed or a useType we don't handle was sent.
end)