ItemFactory: change params for registerNodesByShortDef: remove titile & description params

This commit is contained in:
Van
2026-01-06 14:12:15 +03:00
parent 562ff7d24c
commit 1c5038ff14
2 changed files with 12 additions and 14 deletions

View File

@@ -39,16 +39,14 @@ local defMerge = function(...)
return table.merge(...) return table.merge(...)
end end
---@param shortNodeDefs table Table of the form `{ {name, title, description, tiles}, {name, title, description, tiles}, ...}` ---@param shortNodeDefs [string, (string[]|TileDefinition[])?][] Format list {{name, tiles}, {name, tiles}, ...}
function ItemFactory:registerNodesByShortDef(shortNodeDefs) function ItemFactory:registerNodesByShortDef(shortNodeDefs)
for _, shortNodeDef in ipairs(shortNodeDefs) do for _, shortNodeDef in ipairs(shortNodeDefs) do
---@type Node.NodeDefinition ---@type Node.NodeDefinition
local nodeDef = { local nodeDef = {
settings = { settings = {
name = shortNodeDef[1], name = shortNodeDef[1],
title = shortNodeDef[2], tiles = shortNodeDef[2]
description = shortNodeDef[3],
tiles = shortNodeDef[4]
} }
} }

View File

@@ -25,14 +25,14 @@ local rockFactory = defaultRock:getFactory()
local ts = TileSheet:new("rocks_sheet.png", 16, 16) local ts = TileSheet:new("rocks_sheet.png", 16, 16)
rockFactory:registerNodesByShortDef({ rockFactory:registerNodesByShortDef({
{"sylite", "Sylite", nil, {ts:t(0, 0)}}, {"sylite", {ts:t(0, 0)}},
{"tauitite", "Tauitite", nil, {ts:t(0, 2)}}, {"tauitite", {ts:t(0, 2)}},
{"iyellite", "Iyellite", nil, {ts:t(0, 4)}}, {"iyellite", {ts:t(0, 4)}},
{"falmyte", "Falmyte", nil, {ts:t(0, 6)}}, {"falmyte", {ts:t(0, 6)}},
{"hapcoryte", "Hapcoryte", nil, {ts:t(0, 8)}}, {"hapcoryte", {ts:t(0, 8)}},
{"burcite", "Burcite", nil, {ts:t(0, 10)}}, {"burcite", {ts:t(0, 10)}},
{"felhor", "Felhor", nil, {ts:t(0, 12)}}, {"felhor", {ts:t(0, 12)}},
{"malachite", "malachite", nil, {ts:t(0, 14)}} {"malachite", {ts:t(0, 14)}}
}) })
--[[ --[[