-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathccsc.lua
More file actions
38 lines (31 loc) · 1.25 KB
/
ccsc.lua
File metadata and controls
38 lines (31 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
local DATA_PATH = ".special-cases" -- path to the definition file
local DATA_PRIORITY = "low" -- priority to use in case of mod conflicts (one of "low" (should be used for third party translation mods) or "normal" (for all other mods))
if remote then -- running control
local INTERFACE_NAME = "crafting-combinator_init"
local data = require(DATA_PATH)
data.priority = DATA_PRIORITY
local function init() return data; end
local i = 1
while true do
if not (remote.interfaces[INTERFACE_NAME .. i]) then break; end
i = i + 1
end
remote.add_interface(INTERFACE_NAME .. i, {init = init})
else -- running data
crafting_combinator_data = crafting_combinator_data or {}
t_ccsc = require(DATA_PATH)
if crafting_combinator_data.overrides then
for i, v in pairs(t_ccsc.overrides) do
if not (DATA_PRIORITY == "low" and crafting_combinator_data.overrides[i]) then
crafting_combinator_data.overrides[i] = v
end
end
else crafting_combinator_data.overrides = t_ccsc.overrides; end
if crafting_combinator_data.icons then
for i, v in pairs(t_ccsc.icons) do
if not (DATA_PRIORITY == "low" and crafting_combinator_data.icons[i]) then
crafting_combinator_data.icons[i] = v
end
end
else crafting_combinator_data.icons = t_ccsc.icons; end
end