From 388fcfed2ba5087c292a0cd9896a09ccf7c7e955 Mon Sep 17 00:00:00 2001 From: Daniel Brauer Date: Sat, 15 Feb 2020 00:09:14 +0100 Subject: [PATCH 1/2] Support DiscoScience via new API --- control.lua | 19 +++++++++++++++++++ prototypes/entities/labs.lua | 7 +++++++ 2 files changed, 26 insertions(+) diff --git a/control.lua b/control.lua index ac2c5b1..bd66a99 100644 --- a/control.lua +++ b/control.lua @@ -42,3 +42,22 @@ end) script.on_event(defines.events.on_player_created, function(e) sct.unlockstart(game.players[e.player_index].force) end) + +script.on_configuration_changed( + function () + if remote.interfaces["DiscoScience"] and remote.interfaces["DiscoScience"]["setLabScale"] then + remote.call("DiscoScience", "setLabScale", "sct-lab-t2", 1) + remote.call("DiscoScience", "setLabScale", "sct-lab-t3", 1) + remote.call("DiscoScience", "setLabScale", "sct-lab-t4", 1) + end + if remote.interfaces["DiscoScience"] and remote.interfaces["DiscoScience"]["setIngredientColor"] then + remote.call("DiscoScience", "setIngredientColor", "automation-science-pack", {r = 1.0, g = 0.1, b = 0.1}) + remote.call("DiscoScience", "setIngredientColor", "logistic-science-pack", {r = 0.1, g = 1.0, b = 0.1}) + remote.call("DiscoScience", "setIngredientColor", "chemical-science-pack", {r = 0.1, g = 1.0, b = 1.0}) + remote.call("DiscoScience", "setIngredientColor", "military-science-pack", {r = 1.0, g = 0.6, b = 1.0}) + remote.call("DiscoScience", "setIngredientColor", "production-science-pack", {r = 1.0, g = 0.1, b = 1.0}) + remote.call("DiscoScience", "setIngredientColor", "utility-science-pack", {r = 1.0, g = 1.0, b = 0.1}) + remote.call("DiscoScience", "setIngredientColor", "space-science-pack", {r = 1.0, g = 1.0, b = 1.0}) + end + end +) \ No newline at end of file diff --git a/prototypes/entities/labs.lua b/prototypes/entities/labs.lua index ae85efb..96231af 100644 --- a/prototypes/entities/labs.lua +++ b/prototypes/entities/labs.lua @@ -437,3 +437,10 @@ end if settings.startup["sct-military"].value == "tier2" then sctm.lab_input_add("sct-lab-t2", "military-science-pack") end + +if DiscoScience 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 \ No newline at end of file From 7d5a58c1842ec064ce20de9f06c15b50372054fc Mon Sep 17 00:00:00 2001 From: Daniel Brauer Date: Sat, 15 Feb 2020 00:11:44 +0100 Subject: [PATCH 2/2] Dependency --- info.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/info.json b/info.json index f45b98e..f7e592f 100644 --- a/info.json +++ b/info.json @@ -4,7 +4,13 @@ "factorio_version":"0.18", "title": "ScienceCostTweaker Mod (mexmer)", "author": "mexmer", - "dependencies": ["base >= 0.17.0", "? omnimatter_science >= 3.0.3", "? pycoalprocessing >= 1.2.0", "? bobtech" ], + "dependencies": [ + "base >= 0.17.0", + "? omnimatter_science >= 3.0.3", + "? pycoalprocessing >= 1.2.0", + "? bobtech", + "? DiscoScience >= 1.0.0" + ], "contact": "mexmer@github.com", "homepage": "https://github.com/mexmer/ScienceCostTweakerM", "description": "Allows the cost of research to be tweaked, in terms of count, science packs and time. Edit its configs costs *.lua to tweak the multipliers. - Original mod made by UberWafe, this is adopted 0.18 version"