diff --git a/README.md b/README.md index 0a108e8..b501b29 100644 --- a/README.md +++ b/README.md @@ -22,3 +22,4 @@ See changelog.txt - [S3BA](https://github.com/S3BA-pl) (pl) - [x2605](https://github.com/x2605) (ko) - [Pergamum663](https://github.com/Pergamum663) (ru) +- [RiCZrd](https://mods.factorio.com/user/RiCZrd) (cs) diff --git a/changelog.txt b/changelog.txt index 3dc64bb..9935e88 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,7 @@ --------------------------------------------------------------------------------------------------- Version: 1.2.10 -Date: 2022-07-11 - Features +Date: 2022-07-22 + Features: - cs (Czech) locale updates thanks to RiCZrd Fixes: - Fix in-game changelog diff --git a/data-util.lua b/data-util.lua index 37f09b8..58eac3d 100644 --- a/data-util.lua +++ b/data-util.lua @@ -111,11 +111,16 @@ function util.add_effect(technology_name, effect) end end +-- Add an effect to a given technology to unlock recipe +function util.add_unlock(technology_name, recipe) + util.add_effect(technology_name, {type="unlock-recipe", recipe=recipe}) +end + -- remove recipe unlock effect from a given technology function util.remove_recipe_effect(technology_name, recipe_name) local technology = data.raw.technology[technology_name] local index = -1 - if technology then + if technology and technology.effects then for i, effect in pairs(technology.effects) do if effect.type == "unlock-recipe" and effect.recipe == recipe_name then index = i @@ -144,6 +149,14 @@ function util.set_enabled(recipe_name, enabled) end end +function util.set_hidden(recipe_name) + if data.raw.recipe[recipe_name] then + if data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].normal.hidden = true end + if data.raw.recipe[recipe_name].expensive then data.raw.recipe[recipe_name].expensive.hidden = true end + if not data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].hidden = true end + end +end + -- Add a given quantity of ingredient to a given recipe function util.add_or_add_to_ingredient(recipe_name, ingredient, quantity) if me.bypass[recipe_name] then return end