diff --git a/PHI-CL/control.lua b/PHI-CL/control.lua index 0a8fe3d..f8acbe7 100644 --- a/PHI-CL/control.lua +++ b/PHI-CL/control.lua @@ -97,24 +97,6 @@ local function inserter_changed(event) end end -local function hidden_recipe_enable(event) - if not settings.startup['PHI-CT'].value then - return - end - - local enable = (event.name == defines.events.on_player_cheat_mode_enabled) - - for _, v in pairs(prototypes.fluid) do - if game.players[event.player_index].force.recipes['super-pump-' .. v.name] then - game.players[event.player_index].force.recipes['super-pump-' .. v.name].enabled = enable - end - end - - for _, v in pairs({'super-radar', 'passive-energy-void', 'active-energy-void', 'linked-chest', 'infinity-chest', 'infinity-cargo-wagon', 'infinity-pipe'}) do - game.players[event.player_index].force.recipes[v].enabled = enable - end -end - -- settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value == 'SAP' local function entity_build(event) if event.entity.type == 'rail-support' then @@ -308,12 +290,6 @@ if settings.startup['PHI-MI'].value or (settings.startup['PHI-GM'].value and set end -if settings.startup['PHI-CT'].value then - script.on_event({defines.events.on_player_cheat_mode_enabled, defines.events.on_player_cheat_mode_disabled}, function(event) - hidden_recipe_enable(event) - end) -end - script.on_nth_tick(1800, function(_) if storage.phi_cl and storage.phi_cl.loop and storage.phi_cl.loop.combinator and game.forces['player'] then storage.phi_cl.combinator.research_progress = math.floor(game.forces['player'].research_progress * 1000) diff --git a/PHI-CL/data/b/ct.lua b/PHI-CL/data/b/ct.lua index 53ab863..eff5c5a 100644 --- a/PHI-CL/data/b/ct.lua +++ b/PHI-CL/data/b/ct.lua @@ -18,7 +18,9 @@ for _, v in pairs({'infinity-chest', 'infinity-cargo-wagon', 'infinity-pipe'}) d type = 'recipe', name = data.raw['item'][v].name, energy_required = 2, - enabled = false, + enabled = true, + hidden = true, + hidden_in_factoriopedia = true, ingredients = {}, results = {{type = 'item', name = data.raw['item'][v].name, amount = 1}}, main_product = data.raw['item'][v].name @@ -44,7 +46,9 @@ if data.raw['linked-container']['linked-chest'] then type = 'recipe', name = 'linked-chest', energy_required = 2, - enabled = false, + enabled = true, + hidden = true, + hidden_in_factoriopedia = true, ingredients = {{type = 'item', name = 'steel-chest', amount = 1}}, results = {{type = 'item', name = 'linked-chest', amount = 1}}, main_product = 'linked-chest' @@ -77,7 +81,9 @@ if data.raw['radar']['radar'] then type = 'recipe', name = item.name, energy_required = 2, - enabled = false, + enabled = true, + hidden = true, + hidden_in_factoriopedia = true, ingredients = {{type = 'item', name = 'electronic-circuit', amount = 5}, {type = 'item', name = 'iron-gear-wheel', amount = 5}, {type = 'item', name = 'iron-plate', amount = 10}}, results = {{type = 'item', name = item.name, amount = 1}}, main_product = item.name, @@ -113,7 +119,9 @@ if data.raw['electric-energy-interface']['electric-energy-interface'] then type = 'recipe', name = item.name, energy_required = 2, - enabled = false, + enabled = true, + hidden = true, + hidden_in_factoriopedia = true, ingredients = {{type = 'item', name = 'accumulator', amount = 1}}, results = {{type = 'item', name = item.name, amount = 1}}, main_product = item.name, diff --git a/PHI-CL/migrations/migrations.lua b/PHI-CL/migrations/migrations.lua index d5e293f..578d14a 100644 --- a/PHI-CL/migrations/migrations.lua +++ b/PHI-CL/migrations/migrations.lua @@ -82,80 +82,47 @@ for _, force in pairs(game.forces) do end end - if settings.startup['PHI-CT'].value then - recipes['electric-boiler'].enabled = true - recipes['electric-boiler'].reload() - - recipes['super-pump'].enabled = true - recipes['super-pump'].reload() - - recipes['super-radar'].enabled = true - recipes['super-radar'].reload() - - recipes['passive-energy-void'].enabled = true - recipes['passive-energy-void'].reload() - - if (not technologies['steel-processing']) or technologies['steel-processing'].researched then + if (settings.startup['PHI-MI'].value and settings.startup['PHI-MI-GENERIC'].value) or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value ~= '') then + if technologies['steel-processing'] and technologies['steel-processing'].researched then if recipes['trash-chest'] then recipes['trash-chest'].enabled = true recipes['trash-chest'].reload() end + + if recipes['linked-chest'] then + recipes['linked-chest'].enabled = true + recipes['linked-chest'].reload() + end end - if (not technologies['automation']) or technologies['automation'].researched and recipes['trash-pipe'] then + if technologies['automation'] and technologies['automation'].researched and recipes['trash-pipe'] then recipes['trash-pipe'].enabled = true recipes['trash-pipe'].reload() end - if (not technologies['heating-tower']) or technologies['heating-tower'].researched and recipes['electric-heating-tower'] then + if technologies['heating-tower'] and technologies['heating-tower'].researched and recipes['electric-heating-tower'] then recipes['electric-heating-tower'].enabled = true recipes['electric-heating-tower'].reload() end - if (not technologies['logistics']) or technologies['logistics'].researched and recipes['underground-belt-a'] then - recipes['underground-belt-a'].enabled = true - recipes['underground-belt-a'].reload() - end + for _, v in pairs({{'logistics', 'underground-belt'}, {'logistics-2', 'fast-underground-belt'}, {'logistics-3', 'express-underground-belt'}, {'turbo-transport-belt', 'turbo-underground-belt'}, {'logistics', 'loader'}, {'logistics-2', 'fast-loader'}, {'logistics-3', 'express-loader'}, {'turbo-transport-belt', 'turbo-loader'}}) do + local vn = v[2] .. '-a' - if (not technologies['logistics-2']) or technologies['logistics-2'].researched and recipes['fast-underground-belt-a'] then - recipes['fast-underground-belt-a'].enabled = true - recipes['fast-underground-belt-a'].reload() + if technologies[v[1]] and technologies[v[1]].researched and recipes[vn] then + recipes[vn].enabled = true + recipes[vn].reload() + end end + end - if (not technologies['logistics-3']) or technologies['logistics-3'].researched and recipes['express-underground-belt-a'] then - recipes['express-underground-belt-a'].enabled = true - recipes['express-underground-belt-a'].reload() - end + if recipes['electric-boiler'] then + recipes['electric-boiler'].enabled = true + recipes['electric-boiler'].reload() + end - if (not technologies['turbo-transport-belt']) or technologies['turbo-transport-belt'].researched and recipes['turbo-underground-belt-a'] then - recipes['turbo-underground-belt-a'].enabled = true - recipes['turbo-underground-belt-a'].reload() - end - - if (not technologies['steel-processing']) or technologies['steel-processing'].researched and recipes['linked-chest'] then - recipes['linked-chest'].enabled = true - recipes['linked-chest'].reload() - end - - if (not technologies['logistics']) or technologies['logistics'].researched and recipes['loader'] then - recipes['loader'].enabled = true - recipes['loader'].reload() - end - - if (not technologies['logistics-2']) or technologies['logistics-2'].researched and recipes['fast-loader'] then - recipes['fast-loader'].enabled = true - recipes['fast-loader'].reload() - end - - if (not technologies['logistics-3']) or technologies['logistics-3'].researched and recipes['express-loader'] then - recipes['express-loader'].enabled = true - recipes['express-loader'].reload() - end - - if (not technologies['turbo-transport-belt']) or technologies['turbo-transport-belt'].researched and recipes['turbo-loader'] then - recipes['turbo-loader'].enabled = true - recipes['turbo-loader'].reload() - end + if recipes['super-pump'] then + recipes['super-pump'].enabled = true + recipes['super-pump'].reload() end if settings.startup['PHI-MB'].value and script.active_mods['space-exploration'] then