1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-04 09:42:30 +02:00

moved loaders to redmew_qol

This commit is contained in:
grilledham 2019-01-15 15:10:31 +00:00
parent 441293f045
commit cdde0d6967
4 changed files with 22 additions and 27 deletions

View File

@ -214,11 +214,9 @@ global.config = {
-- gives locos placed a random color
random_train_color = true,
-- gives players entity ghosts (from destruction like biter attacks) before the required research is complete
ghosts_before_research = true
},
-- adds craftable loaders.
loaders = {
enabled = true
ghosts_before_research = true,
-- adds craftable loaders.
loaders = true
}
}

View File

@ -67,10 +67,6 @@ if config.redmew_qol.enabled then
require 'features.redmew_qol'
end
if config.loaders.enabled then
require 'features.loaders'
end
-- GUIs the order determines the order they appear from left to right.
-- These can be safely disabled if you want less GUI items.
-- Some map presets will add GUI modules themselves.

View File

@ -1,18 +0,0 @@
local Event = require 'utils.event'
local technology_map = {
['logistics'] = 'loader',
['logistics-2'] = 'fast-loader',
['logistics-3'] = 'express-loader'
}
Event.add(
defines.events.on_research_finished,
function(event)
local research = event.research
local recipe = technology_map[research.name]
if recipe then
research.force.recipes[recipe].enabled = true
end
end
)

View File

@ -99,6 +99,21 @@ local change_backer_name =
end
)
local loaders_technology_map = {
['logistics'] = 'loader',
['logistics-2'] = 'fast-loader',
['logistics-3'] = 'express-loader'
}
-- Enables loaders when prerequisite technology is researched.
local function enable_loaders(event)
local research = event.research
local recipe = loaders_technology_map[research.name]
if recipe then
research.force.recipes[recipe].enabled = true
end
end
-- Event registers
local function register_random_train_color()
@ -211,4 +226,8 @@ if config.backer_name then
register_change_backer_name()
end
if config.loaders then
Event.add(defines.events.on_research_finished, enable_loaders)
end
return Public