mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
Add settings and all prototypes to the export of data done. Settings are needed for a settings GUI to function, while prototype data would be useful to display any sort of information about things from the game.
12 lines
335 B
Lua
12 lines
335 B
Lua
local function send_json(channel, data)
|
|
data = game.table_to_json(data)
|
|
print("\f$ipc:" .. channel .. "?j" .. data)
|
|
end
|
|
|
|
script.on_init(function()
|
|
send_json("mod_list", game.active_mods)
|
|
for name, mod_setting in pairs(game.mod_setting_prototypes) do
|
|
send_json("mod_setting_mod", { name = name, mod = mod_setting.mod })
|
|
end
|
|
end)
|