Kux PreEvents


A mod that provides a remote interface to register prioritized event handlers. <a dependency mod for mod developers, not for standalone playing>

13 days ago
2.0
5
Owner:
kuxynator
Source:
N/A
Homepage:
N/A
License:
CC BY-NC-ND 4.0
Created:
13 days ago
Latest Version:
3.0.0 (13 days ago)
Factorio version:
2.0
Downloaded by:
5 users

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)