Ok here is what I've got at the moment (sorry Dragonling for hijacking this thread but my hope is that it will lead to more compatibility with mods such as CB Science)
Mods need an optional dependency on DiscoScience. If they're just registering new ingredient colours it looks like this in control:
script.on_configuration_changed(
function ()
if remote.interfaces["Disco Science"] and remote.interfaces["Disco Science"]["setIngredientColor"] then
remote.call("Disco Science", "setIngredientColor", "automation-science-pack", {r = 1.0, g = 0.1, b = 0.1})
remote.call("Disco Science", "setIngredientColor", "logistic-science-pack", {r = 0.1, g = 1.0, b = 0.1})
remote.call("Disco Science", "setIngredientColor", "chemical-science-pack", {r = 0.1, g = 1.0, b = 1.0})
remote.call("Disco Science", "setIngredientColor", "military-science-pack", {r = 1.0, g = 0.6, b = 1.0})
remote.call("Disco Science", "setIngredientColor", "production-science-pack", {r = 1.0, g = 0.1, b = 1.0})
remote.call("Disco Science", "setIngredientColor", "utility-science-pack", {r = 1.0, g = 1.0, b = 0.1})
remote.call("Disco Science", "setIngredientColor", "space-science-pack", {r = 1.0, g = 1.0, b = 1.0})
end
end
)
If they're registering new labs that use the standard lab graphics then they need to be prepared in the data stage:
if DiscoScience and DiscoScience.prepareLab then
DiscoScience.prepareLab(data.raw["lab"]["lab"])
DiscoScience.prepareLab(data.raw["lab"]["sct-lab-t2"])
DiscoScience.prepareLab(data.raw["lab"]["sct-lab-t3"])
DiscoScience.prepareLab(data.raw["lab"]["sct-lab-t4"])
end
...and something like this in control:
script.on_configuration_changed(
function ()
if remote.interfaces["Disco Science"] and remote.interfaces["Disco Science"]["setLabScale"] then
remote.call("Disco Science", "setLabScale", "sct-lab-t2", 1)
remote.call("Disco Science", "setLabScale", "sct-lab-t3", 1)
remote.call("Disco Science", "setLabScale", "sct-lab-t4", 1)
end
end
)
What do you think?