Make cut nodes translatable ... somewhat
This commit is contained in:
parent
22df1519a0
commit
a364b74045
@ -69,8 +69,8 @@ local function xdecor_stairs_alternative(nodename, def)
|
|||||||
stairs.register_stair_and_slab(name,nodename,
|
stairs.register_stair_and_slab(name,nodename,
|
||||||
def.groups,
|
def.groups,
|
||||||
def.tiles,
|
def.tiles,
|
||||||
("%s Stair"):format(def.description),
|
S("@1 Stair", def.description),
|
||||||
("%s Slab"):format(def.description),
|
S("@1 Slab", def.description),
|
||||||
def.sounds
|
def.sounds
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -16,22 +16,22 @@ end
|
|||||||
|
|
||||||
-- Nodeboxes definitions
|
-- Nodeboxes definitions
|
||||||
workbench.defs = {
|
workbench.defs = {
|
||||||
-- Name YieldX YZ WH L
|
-- Name Yield Nodeboxes (X Y Z W H L) Description
|
||||||
{"nanoslab", 16, { 0, 0, 0, 8, 1, 8 }},
|
{"nanoslab", 16, {{ 0, 0, 0, 8, 1, 8 }}, S("Nanoslab")},
|
||||||
{"micropanel", 16, { 0, 0, 0, 16, 1, 8 }},
|
{"micropanel", 16, {{ 0, 0, 0, 16, 1, 8 }}, S("Micropanel")},
|
||||||
{"microslab", 8, { 0, 0, 0, 16, 1, 16 }},
|
{"microslab", 8, {{ 0, 0, 0, 16, 1, 16 }}, S("Microslab")},
|
||||||
{"thinstair", 8, { 0, 7, 0, 16, 1, 8 },
|
{"thinstair", 8, {{ 0, 7, 0, 16, 1, 8 },
|
||||||
{ 0, 15, 8, 16, 1, 8 }},
|
{ 0, 15, 8, 16, 1, 8 }}, S("Thin Stair")},
|
||||||
{"cube", 4, { 0, 0, 0, 8, 8, 8 }},
|
{"cube", 4, {{ 0, 0, 0, 8, 8, 8 }}, S("Cube")},
|
||||||
{"panel", 4, { 0, 0, 0, 16, 8, 8 }},
|
{"panel", 4, {{ 0, 0, 0, 16, 8, 8 }}, S("Panel")},
|
||||||
{"slab", 2, nil },
|
{"slab", 2, nil, S("Slab") },
|
||||||
{"doublepanel", 2, { 0, 0, 0, 16, 8, 8 },
|
{"doublepanel", 2, {{ 0, 0, 0, 16, 8, 8 },
|
||||||
{ 0, 8, 8, 16, 8, 8 }},
|
{ 0, 8, 8, 16, 8, 8 }}, S("Double Panel")},
|
||||||
{"halfstair", 2, { 0, 0, 0, 8, 8, 16 },
|
{"halfstair", 2, {{ 0, 0, 0, 8, 8, 16 },
|
||||||
{ 0, 8, 8, 8, 8, 8 }},
|
{ 0, 8, 8, 8, 8, 8 }}, S("Half-Stair")},
|
||||||
{"stair_outer", 1, nil },
|
{"stair_outer", 1, nil, S("Outer Stair")},
|
||||||
{"stair", 1, nil },
|
{"stair", 1, nil, S("Stair")},
|
||||||
{"stair_inner", 1, nil }
|
{"stair_inner", 1, nil, S("Inner Stair")},
|
||||||
}
|
}
|
||||||
|
|
||||||
local repairable_tools = {"pick", "axe", "shovel", "sword", "hoe", "armor", "shield"}
|
local repairable_tools = {"pick", "axe", "shovel", "sword", "hoe", "armor", "shield"}
|
||||||
@ -295,16 +295,15 @@ for i = 1, #nodes do
|
|||||||
tiles = {def.tile_images[1]}
|
tiles = {def.tile_images[1]}
|
||||||
end
|
end
|
||||||
|
|
||||||
--TODO: Translation support for Stairs/Slab
|
|
||||||
if not minetest.registered_nodes["stairs:slab_" .. item_name] then
|
if not minetest.registered_nodes["stairs:slab_" .. item_name] then
|
||||||
stairs.register_stair_and_slab(item_name, node,
|
stairs.register_stair_and_slab(item_name, node,
|
||||||
groups, tiles, def.description .. " Stair",
|
groups, tiles, S("@1 Stair", def.description),
|
||||||
def.description .. " Slab", def.sounds)
|
S("@1 Slab", def.description), def.sounds)
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node(":" .. node .. "_" .. d[1], {
|
minetest.register_node(":" .. node .. "_" .. d[1], {
|
||||||
--TODO: Translation support
|
-- @1: Base node description (e.g. "Stone"); @2: modifier (e.g. "Nanoslab")
|
||||||
description = def.description .. " " .. d[1]:gsub("^%l", string.upper),
|
description = S("@1 @2", def.description, d[4]),
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
@ -312,8 +311,7 @@ for i = 1, #nodes do
|
|||||||
tiles = tiles,
|
tiles = tiles,
|
||||||
use_texture_alpha = def.use_texture_alpha,
|
use_texture_alpha = def.use_texture_alpha,
|
||||||
groups = groups,
|
groups = groups,
|
||||||
-- `unpack` has been changed to `table.unpack` in newest Lua versions
|
node_box = xdecor.pixelbox(16, d[3]),
|
||||||
node_box = xdecor.pixelbox(16, {unpack(d, 3)}),
|
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
on_place = minetest.rotate_node
|
on_place = minetest.rotate_node
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user