2019-09-26 23:32:37 +03:00
|
|
|
--[[
|
|
|
|
|
|
|
|
]]--
|
|
|
|
|
|
|
|
local S = techage.S
|
2023-08-18 18:30:55 +03:00
|
|
|
local M = minetest.get_meta
|
|
|
|
local MP = minetest.get_modpath("techage")
|
2019-09-26 23:32:37 +03:00
|
|
|
|
2023-08-18 18:30:55 +03:00
|
|
|
local settings = {
|
|
|
|
symbol_item = "techage:construction_board",
|
|
|
|
}
|
2019-09-26 23:32:37 +03:00
|
|
|
|
2023-08-18 18:30:55 +03:00
|
|
|
doclib.create_manual("techage", "DE", settings)
|
|
|
|
doclib.create_manual("techage", "EN", settings)
|
2024-02-04 23:39:16 +03:00
|
|
|
doclib.create_manual("techage", "pt-BR", settings)
|
2023-08-18 18:30:55 +03:00
|
|
|
|
|
|
|
local content
|
|
|
|
content = dofile(MP.."/doc/manual_DE.lua")
|
|
|
|
doclib.add_to_manual("techage", "DE", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta1_DE.lua")
|
|
|
|
doclib.add_to_manual("techage", "DE", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta2_DE.lua")
|
|
|
|
doclib.add_to_manual("techage", "DE", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta3_DE.lua")
|
|
|
|
doclib.add_to_manual("techage", "DE", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta4_DE.lua")
|
|
|
|
doclib.add_to_manual("techage", "DE", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta5_DE.lua")
|
|
|
|
doclib.add_to_manual("techage", "DE", content)
|
|
|
|
|
|
|
|
content = dofile(MP.."/doc/manual_EN.lua")
|
|
|
|
doclib.add_to_manual("techage", "EN", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta1_EN.lua")
|
|
|
|
doclib.add_to_manual("techage", "EN", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta2_EN.lua")
|
|
|
|
doclib.add_to_manual("techage", "EN", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta3_EN.lua")
|
|
|
|
doclib.add_to_manual("techage", "EN", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta4_EN.lua")
|
|
|
|
doclib.add_to_manual("techage", "EN", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta5_EN.lua")
|
|
|
|
doclib.add_to_manual("techage", "EN", content)
|
2019-09-26 23:32:37 +03:00
|
|
|
|
2024-02-04 23:39:16 +03:00
|
|
|
content = dofile(MP.."/doc/manual_pt-BR.lua")
|
|
|
|
doclib.add_to_manual("techage", "pt-BR", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta1_pt-BR.lua")
|
|
|
|
doclib.add_to_manual("techage", "pt-BR", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta2_pt-BR.lua")
|
|
|
|
doclib.add_to_manual("techage", "pt-BR", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta3_pt-BR.lua")
|
|
|
|
doclib.add_to_manual("techage", "pt-BR", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta4_pt-BR.lua")
|
|
|
|
doclib.add_to_manual("techage", "pt-BR", content)
|
|
|
|
content = dofile(MP.."/doc/manual_ta5_pt-BR.lua")
|
|
|
|
doclib.add_to_manual("techage", "pt-BR", content)
|
2019-09-26 23:32:37 +03:00
|
|
|
|
|
|
|
local board_box = {
|
|
|
|
type = "wallmounted",
|
|
|
|
wall_side = {-16/32, -11/32, -16/32, -15/32, 6/16, 8/16},
|
|
|
|
}
|
|
|
|
|
|
|
|
minetest.register_node("techage:construction_board", {
|
2020-04-26 22:01:39 +03:00
|
|
|
description = "TA Konstruktionsplan (DE)",
|
2019-09-26 23:32:37 +03:00
|
|
|
inventory_image = 'techage_constr_plan_inv.png',
|
|
|
|
tiles = {"techage_constr_plan.png"},
|
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = board_box,
|
|
|
|
selection_box = board_box,
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-09-26 23:32:37 +03:00
|
|
|
after_place_node = function(pos, placer, itemstack)
|
2023-08-18 18:30:55 +03:00
|
|
|
M(pos):set_string("infotext", "TA Konstruktionsplan (DE)")
|
|
|
|
M(pos):set_string("formspec", doclib.formspec(pos, "techage", "DE"))
|
2019-09-26 23:32:37 +03:00
|
|
|
end,
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-09-26 23:32:37 +03:00
|
|
|
on_receive_fields = function(pos, formname, fields, player)
|
|
|
|
local player_name = player:get_player_name()
|
|
|
|
if minetest.is_protected(pos, player_name) then
|
|
|
|
return
|
|
|
|
end
|
2023-08-18 18:30:55 +03:00
|
|
|
M(pos):set_string("formspec", doclib.formspec(pos, "techage", "DE", fields))
|
2019-09-26 23:32:37 +03:00
|
|
|
end,
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2019-09-26 23:32:37 +03:00
|
|
|
paramtype2 = "wallmounted",
|
|
|
|
paramtype = "light",
|
2021-03-19 22:06:22 +03:00
|
|
|
use_texture_alpha = techage.CLIP,
|
2019-09-26 23:32:37 +03:00
|
|
|
sunlight_propagates = true,
|
|
|
|
is_ground_content = false,
|
|
|
|
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "techage:construction_board",
|
|
|
|
recipe = {
|
|
|
|
{"default:stick", "default:stick", "default:stick"},
|
|
|
|
{"default:paper", "default:paper", "default:paper"},
|
|
|
|
{"default:paper", "default:paper", "default:paper"},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2020-04-26 22:01:39 +03:00
|
|
|
minetest.register_node("techage:construction_board_EN", {
|
|
|
|
description = "TA Construction Board (EN)",
|
|
|
|
inventory_image = 'techage_constr_plan_inv.png',
|
|
|
|
tiles = {"techage_constr_plan.png"},
|
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = board_box,
|
|
|
|
selection_box = board_box,
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-04-26 22:01:39 +03:00
|
|
|
after_place_node = function(pos, placer, itemstack)
|
2024-02-04 23:39:16 +03:00
|
|
|
M(pos):set_string("infotext", "TA Construction Board (EN)")
|
2023-08-18 18:30:55 +03:00
|
|
|
M(pos):set_string("formspec", doclib.formspec(pos, "techage", "EN"))
|
2020-04-26 22:01:39 +03:00
|
|
|
end,
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-04-26 22:01:39 +03:00
|
|
|
on_receive_fields = function(pos, formname, fields, player)
|
|
|
|
local player_name = player:get_player_name()
|
|
|
|
if minetest.is_protected(pos, player_name) then
|
|
|
|
return
|
|
|
|
end
|
2023-08-18 18:30:55 +03:00
|
|
|
M(pos):set_string("formspec", doclib.formspec(pos, "techage", "EN", fields))
|
2020-04-26 22:01:39 +03:00
|
|
|
end,
|
2022-01-03 23:40:31 +03:00
|
|
|
|
2020-04-26 22:01:39 +03:00
|
|
|
paramtype2 = "wallmounted",
|
|
|
|
paramtype = "light",
|
2021-03-19 22:06:22 +03:00
|
|
|
use_texture_alpha = techage.CLIP,
|
2020-04-26 22:01:39 +03:00
|
|
|
sunlight_propagates = true,
|
|
|
|
is_ground_content = false,
|
|
|
|
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "techage:construction_board_EN",
|
|
|
|
recipe = {
|
|
|
|
{"default:stick", "default:paper", "default:stick"},
|
|
|
|
{"default:paper", "default:paper", "default:paper"},
|
|
|
|
{"default:paper", "default:paper", "default:paper"},
|
|
|
|
},
|
|
|
|
})
|
2019-09-26 23:32:37 +03:00
|
|
|
|
2024-02-04 23:39:16 +03:00
|
|
|
minetest.register_node("techage:construction_board_pt_BR", {
|
|
|
|
description = "TA Placa de construção (pt-BR)",
|
|
|
|
inventory_image = 'techage_constr_plan_inv.png',
|
|
|
|
tiles = {"techage_constr_plan.png"},
|
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = board_box,
|
|
|
|
selection_box = board_box,
|
|
|
|
|
|
|
|
after_place_node = function(pos, placer, itemstack)
|
|
|
|
M(pos):set_string("infotext", "TA Placa de construção (pt-BR)")
|
|
|
|
M(pos):set_string("formspec", doclib.formspec(pos, "techage", "pt-BR"))
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_receive_fields = function(pos, formname, fields, player)
|
|
|
|
local player_name = player:get_player_name()
|
|
|
|
if minetest.is_protected(pos, player_name) then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
M(pos):set_string("formspec", doclib.formspec(pos, "techage", "pt-BR", fields))
|
|
|
|
end,
|
|
|
|
|
|
|
|
paramtype2 = "wallmounted",
|
|
|
|
paramtype = "light",
|
|
|
|
use_texture_alpha = techage.CLIP,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
is_ground_content = false,
|
|
|
|
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "techage:construction_board_pt_BR",
|
|
|
|
recipe = {
|
|
|
|
{"default:stick", "default:stick", "default:paper"},
|
|
|
|
{"default:paper", "default:paper", "default:paper"},
|
|
|
|
{"default:paper", "default:paper", "default:paper"},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
2020-06-04 19:56:10 +03:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "shapeless",
|
|
|
|
output = "techage:construction_board_EN",
|
|
|
|
recipe = {"techage:construction_board"},
|
|
|
|
})
|
|
|
|
|
2021-05-16 20:58:06 +03:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "shapeless",
|
|
|
|
output = "techage:construction_board",
|
2024-02-04 23:39:16 +03:00
|
|
|
recipe = {"techage:construction_board_pt_BR"},
|
2022-01-04 21:40:27 +03:00
|
|
|
})
|
2023-08-18 18:30:55 +03:00
|
|
|
|
2024-02-04 23:39:16 +03:00
|
|
|
minetest.register_craft({
|
|
|
|
type = "shapeless",
|
|
|
|
output = "techage:construction_board_pt_BR",
|
|
|
|
recipe = {"techage:construction_board_EN"},
|
|
|
|
})
|
2023-08-18 18:30:55 +03:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Legacy API functions
|
|
|
|
--
|
|
|
|
function techage.add_to_manual(language, titles, texts, items, plans)
|
|
|
|
local content = {titles = titles, texts = texts, images = items or {}, plans = plans or {}}
|
|
|
|
doclib.add_to_manual("techage", language, content)
|
|
|
|
end
|
|
|
|
|
|
|
|
function techage.add_manual_items(table_with_items)
|
|
|
|
for name, image in pairs(table_with_items) do
|
|
|
|
doclib.add_manual_image("techage", "EN", name, image)
|
|
|
|
doclib.add_manual_image("techage", "DE", name, image)
|
2024-02-04 23:39:16 +03:00
|
|
|
doclib.add_manual_image("techage", "pt-BR", name, image)
|
2023-08-18 18:30:55 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function techage.add_manual_plans(table_with_plans)
|
|
|
|
for name, plan in pairs(table_with_plans) do
|
|
|
|
doclib.add_manual_plan("techage", "EN", name, plan)
|
|
|
|
doclib.add_manual_plan("techage", "DE", name, plan)
|
2024-02-04 23:39:16 +03:00
|
|
|
doclib.add_manual_plan("techage", "pt-BR", name, plan)
|
2023-08-18 18:30:55 +03:00
|
|
|
end
|
|
|
|
end
|