Skip to content

Commit

Permalink
Added function set_category
Browse files Browse the repository at this point in the history
  • Loading branch information
KiwiHawk committed Jul 12, 2023
1 parent 5fccc2b commit a1d7230
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion boblibrary/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Version: 1.2.0
Date: ??. ??. ????
Changes:
- Added function bobmods.migration.ensure_unlocked(tech_name, recipe_name) #120
- Added function bobmods.lib.recipe.set_category(recipe_name, category)
---------------------------------------------------------------------------------------------------
Version: 1.1.6
Date: 01. 01. 2023
Expand All @@ -16,7 +17,7 @@ Date: 01. 01. 2023
- Renamed function recipe.hide_recipe to recipe.hide #60
- Added function bobmods.lib.tech.ignore_tech_cost_multiplier(technology_name, ignore) #62
- Added function bobmods.lib.item.set_subgroup(item_name, subgroup) #96
- Added function bobmods.lib.recipe.set_subgroup(item_name, subgroup) #96
- Added function bobmods.lib.recipe.set_subgroup(recipe_name, subgroup) #96
---------------------------------------------------------------------------------------------------
Version: 1.1.5
Date: 06. 06. 2022
Expand Down
12 changes: 12 additions & 0 deletions boblibrary/recipe-functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -654,3 +654,15 @@ function bobmods.lib.recipe.set_subgroup(recipe_name, subgroup)
bobmods.lib.error.recipe(recipe_name)
end
end

function bobmods.lib.recipe.set_category(recipe_name, category)
if type(recipe_name) == "string" and type(category) == "string" then
local recipe = data.raw.recipe[recipe_name]
if recipe then
recipe.category = category
end
else
log(debug.traceback())
bobmods.lib.error.recipe(recipe_name)
end
end

0 comments on commit a1d7230

Please sign in to comment.