Skip to content

Commit

Permalink
Added setting for player boxing (disabled by default)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrolGenhald committed May 18, 2017
1 parent 71b8a72 commit f11b74d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boxing-2",
"version": "2.0.5",
"version": "2.0.6",
"title": "Boxing 2",
"author": "AndrolGenhald",
"description": "Pack items into boxes to store more of them.",
Expand Down
6 changes: 6 additions & 0 deletions locale/en/boxing.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ unbox-*=Unbox __1__
wooden-boxing=Wooden Boxing
steel-boxing=Steel Boxing
tungsten-boxing=Tungsten Boxing

[mod-setting-name]
player-craftable-wooden-boxing=Player boxing

[mod-setting-description]
player-craftable-wooden-boxing=Allow player to box/unbox wooden boxes
9 changes: 5 additions & 4 deletions prototypes/recipe/categories.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ for i,type in pairs(boxing.types) do
type = "recipe-category",
name = "boxing-" .. type.name,
},
});
})

for j,machine in pairs(data.raw["assembling-machine"]) do
if machine.name:sub(1, 18) == "assembling-machine" then
table.insert(machine.crafting_categories, "boxing-" .. type.name);
table.insert(machine.crafting_categories, "boxing-" .. type.name)
end
end
end

-- TODO make player crafting a mod option
table.insert(data.raw.player.player.crafting_categories, "boxing-wooden");
if settings.startup["player-craftable-wooden-boxing"].value then
table.insert(data.raw.player.player.crafting_categories, "boxing-wooden")
end
9 changes: 9 additions & 0 deletions settings.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
data:extend({
{
type = "bool-setting",
name = "player-craftable-wooden-boxing",
setting_type = "startup",
default_value = false,
per_user = false,
},
})

0 comments on commit f11b74d

Please sign in to comment.