From a991ac6f26ea25d10f88fbb91b538e2d16e508d0 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sat, 14 Mar 2026 23:01:26 +0100 Subject: [PATCH] Fix shortcuts --- factorio-light/data.lua | 20 ++++++++++---------- factorio-light/util.lua | 10 ++++++++-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/factorio-light/data.lua b/factorio-light/data.lua index f042f8e..1c601f9 100644 --- a/factorio-light/data.lua +++ b/factorio-light/data.lua @@ -16,6 +16,16 @@ Recipe:new("spidertron") :replaceIngredient("efficiency-module-3", 50) :addIngredient("speed-module-3", 50) +-- Move wires +table.insert(data.raw.technology["automation-2"].effects, { + type = "unlock-circuit-network", + modifier = true +}) +data.raw.shortcut["give-copper-wire"].technology_to_unlock = "automation-2" +data.raw.shortcut["give-red-wire"].technology_to_unlock = "automation-2" +data.raw.shortcut["give-green-wire"].technology_to_unlock = "automation-2" +data.raw["tips-and-tricks-item"]["circuit-network"].trigger.triggers[1].technology = "automation-2" + -- Clear production/utility science util.removeEverythingRecursivelyByTechnology("uranium-mining", { hideEntities = { "heat-pipe", "nuclear-reactor" } }) util.removeEverythingRecursivelyByTechnology("circuit-network", { skip = { "iron-stick" }, hideEntity = true }) @@ -30,12 +40,6 @@ util.removeEverythingByTechnology("personal-roboport-mk2-equipment") util.removeEverythingByTechnology("battery-mk2-equipment") util.removeEverythingByItem("discharge-defense-remote") --- Add circuit network again -table.insert(data.raw.technology["automation-2"].effects, { - type = "unlock-circuit-network", - modifier = true -}) - -- Move rocket Technology:new("rocket-silo") :removePrerequisite("productivity-module-3") @@ -70,9 +74,6 @@ util.replacePrerequisite("processing-unit", "chemical-science-pack") util.removeEverythingByTechnology("processing-unit", { skip = { "advanced-circuit" } }) -- Remove tips and tricks -data.raw["tips-and-tricks-item"]["spidertron-control"] = nil -data.raw["tips-and-tricks-item"]["copy-paste-spidertron"] = nil -data.raw["tips-and-tricks-item"]["circuit-network"] = nil data.raw["tips-and-tricks-item"]["connect-switch"] = nil -- Remove menu simulations @@ -124,7 +125,6 @@ util.removeEverythingByItem("depleted-uranium-fuel-cell") util.removeEntity("defender", { hideEntity = true }) util.removeEntity("distractor", { hideEntity = true }) util.removeEntity("destroyer", { hideEntity = true }) -util.removeEverythingByItem("spidertron-remote") util.removeEverythingByItem("artillery-targeting-remote") -- Buff rocket silo diff --git a/factorio-light/util.lua b/factorio-light/util.lua index 12d663e..4a3d513 100644 --- a/factorio-light/util.lua +++ b/factorio-light/util.lua @@ -128,8 +128,14 @@ util.removeEverythingByTechnology = function(name, options) data.raw.technology[name] = nil for shortcutName, shortcut in pairs(data.raw.shortcut) do - if shortcut.technology_to_unlock then - data.raw.shortcut[shortcutName] = nil + if shortcut.technology_to_unlock == name then + if options and options.skip then + if not table.contains(options.skip, shortcutName) then + data.raw.shortcut[shortcutName] = nil + end + else + data.raw.shortcut[shortcutName] = nil + end end end end