Kux-PreEvents
Early loaded mod to receive events earlier than other mods
Additional you can access data.raw at an early stage before other mods make changes
This mod makes no changes to the data or logic
Usage:
data.lua
KuxPreEvents.custom_input["input-name"] = true
local radar= table.deepcopy(pre_data_raw.radar.radar)
control.lua
local function on_pre_input)
end
local function startup()
-- Check whether the remote interface is available
if remote.interfaces["Kux-PreEvents"] then
remote.add_interface(mod.name, {
["input-name"] = on_pre_input
})
remote.call("Kux-PreEvents", "register_event", "input-name",mod.name,"input-name")
else
error("Kux-PreEvents interface not available!")
end
end
script.on_init(startup)
script.on_load(startup)