2022-06-17 02:46:09 +02:00
|
|
|
-- luacheck: read globals unified_inventory
|
|
|
|
|
|
|
|
if not stairsplus.has.unified_inventory then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2022-06-19 01:23:11 +02:00
|
|
|
local api = stairsplus.api
|
|
|
|
|
|
|
|
unified_inventory.register_craft_type("stairsplus:circular_saw", {
|
|
|
|
description = "Stairs+ circular saw",
|
2022-06-20 00:26:05 +02:00
|
|
|
icon = "stairsplus_saw_button.png",
|
2022-06-19 01:23:11 +02:00
|
|
|
width = 1,
|
|
|
|
height = 1,
|
2022-07-24 01:09:08 +02:00
|
|
|
uses_crafting_grid = false,
|
2022-06-19 01:23:11 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
unified_inventory.register_category("stairsplus:cuttable", {
|
|
|
|
symbol = "stairsplus:circular_saw",
|
|
|
|
label = "Cuttable in the circular saw",
|
|
|
|
index = 0,
|
|
|
|
items = {}
|
|
|
|
})
|
|
|
|
|
|
|
|
unified_inventory.register_category("stairsplus:cut_node", {
|
|
|
|
symbol = "stairsplus:circular_saw",
|
|
|
|
label = "Nodes cut in the circular saw",
|
|
|
|
index = 0,
|
|
|
|
items = {}
|
|
|
|
})
|
|
|
|
|
2022-06-27 17:47:36 +02:00
|
|
|
local function on_register_single(node, shaped_name)
|
2022-06-19 01:23:11 +02:00
|
|
|
unified_inventory.register_craft({
|
|
|
|
output = shaped_name,
|
|
|
|
type = "stairsplus:circular_saw",
|
|
|
|
items = {node},
|
|
|
|
width = 1,
|
|
|
|
})
|
|
|
|
|
|
|
|
unified_inventory.add_category_item("stairsplus:cuttable", node)
|
|
|
|
unified_inventory.add_category_item("stairsplus:cut_node", shaped_name)
|
2022-06-27 17:47:36 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
for _, single in ipairs(api.registered_singles) do
|
|
|
|
local node, shaped_name = unpack(single)
|
|
|
|
on_register_single(node, shaped_name)
|
|
|
|
end
|
|
|
|
|
|
|
|
api.register_on_register_single(on_register_single)
|