mirror of
https://github.com/mt-mods/basic_signs.git
synced 2025-06-28 22:46:04 +02:00
Compare commits
12 Commits
2019-09-12
...
2019-09-21
Author | SHA1 | Date | |
---|---|---|---|
c4f0b331c0 | |||
2f6943495a | |||
7f4bf6daf1 | |||
7c235ec779 | |||
9317f1563a | |||
486423286a | |||
2ccb449550 | |||
854b94349f | |||
a0b8560101 | |||
f55c39acae | |||
a2fa20881a | |||
0bdd8322e3 |
69
crafting.lua
69
crafting.lua
@ -10,7 +10,7 @@ minetest.register_craft({
|
|||||||
-- craft recipes for the metal signs
|
-- craft recipes for the metal signs
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_green",
|
output = "basic_signs:sign_wall_steel_green",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:dark_green", "dye:white", "dye:dark_green" },
|
{ "dye:dark_green", "dye:white", "dye:dark_green" },
|
||||||
{ "", "default:sign_wall_steel", "" }
|
{ "", "default:sign_wall_steel", "" }
|
||||||
@ -18,7 +18,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_green 2",
|
output = "basic_signs:sign_wall_steel_green 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:dark_green", "dye:white", "dye:dark_green" },
|
{ "dye:dark_green", "dye:white", "dye:dark_green" },
|
||||||
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
||||||
@ -26,7 +26,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_yellow",
|
output = "basic_signs:sign_wall_steel_yellow",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:yellow", "dye:black", "dye:yellow" },
|
{ "dye:yellow", "dye:black", "dye:yellow" },
|
||||||
{ "", "default:sign_wall_steel", "" }
|
{ "", "default:sign_wall_steel", "" }
|
||||||
@ -34,7 +34,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_yellow 2",
|
output = "basic_signs:sign_wall_steel_yellow 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:yellow", "dye:black", "dye:yellow" },
|
{ "dye:yellow", "dye:black", "dye:yellow" },
|
||||||
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
||||||
@ -42,7 +42,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_red",
|
output = "basic_signs:sign_wall_steel_red",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:red", "dye:white", "dye:red" },
|
{ "dye:red", "dye:white", "dye:red" },
|
||||||
{ "", "default:sign_wall_steel", "" }
|
{ "", "default:sign_wall_steel", "" }
|
||||||
@ -50,7 +50,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_red 2",
|
output = "basic_signs:sign_wall_steel_red 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:red", "dye:white", "dye:red" },
|
{ "dye:red", "dye:white", "dye:red" },
|
||||||
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
||||||
@ -58,7 +58,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_white_red",
|
output = "basic_signs:sign_wall_steel_white_red",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:white", "dye:red", "dye:white" },
|
{ "dye:white", "dye:red", "dye:white" },
|
||||||
{ "", "default:sign_wall_steel", "" }
|
{ "", "default:sign_wall_steel", "" }
|
||||||
@ -66,7 +66,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_white_red 2",
|
output = "basic_signs:sign_wall_steel_white_red 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:white", "dye:red", "dye:white" },
|
{ "dye:white", "dye:red", "dye:white" },
|
||||||
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
||||||
@ -74,7 +74,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_white_black",
|
output = "basic_signs:sign_wall_steel_white_black",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:white", "dye:black", "dye:white" },
|
{ "dye:white", "dye:black", "dye:white" },
|
||||||
{ "", "default:sign_wall_steel", "" }
|
{ "", "default:sign_wall_steel", "" }
|
||||||
@ -82,7 +82,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_white_black 2",
|
output = "basic_signs:sign_wall_steel_white_black 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:white", "dye:black", "dye:white" },
|
{ "dye:white", "dye:black", "dye:white" },
|
||||||
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
||||||
@ -90,7 +90,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_orange",
|
output = "basic_signs:sign_wall_steel_orange",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:orange", "dye:black", "dye:orange" },
|
{ "dye:orange", "dye:black", "dye:orange" },
|
||||||
{ "", "default:sign_wall_steel", "" }
|
{ "", "default:sign_wall_steel", "" }
|
||||||
@ -98,7 +98,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_orange 2",
|
output = "basic_signs:sign_wall_steel_orange 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:orange", "dye:black", "dye:orange" },
|
{ "dye:orange", "dye:black", "dye:orange" },
|
||||||
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
||||||
@ -106,7 +106,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_blue",
|
output = "basic_signs:sign_wall_steel_blue",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:blue", "dye:white", "dye:blue" },
|
{ "dye:blue", "dye:white", "dye:blue" },
|
||||||
{ "", "default:sign_wall_steel", "" }
|
{ "", "default:sign_wall_steel", "" }
|
||||||
@ -114,7 +114,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_blue 2",
|
output = "basic_signs:sign_wall_steel_blue 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:blue", "dye:white", "dye:blue" },
|
{ "dye:blue", "dye:white", "dye:blue" },
|
||||||
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
||||||
@ -122,7 +122,7 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_brown",
|
output = "basic_signs:sign_wall_steel_brown",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:brown", "dye:white", "dye:brown" },
|
{ "dye:brown", "dye:white", "dye:brown" },
|
||||||
{ "", "default:sign_wall_steel", "" }
|
{ "", "default:sign_wall_steel", "" }
|
||||||
@ -130,9 +130,46 @@ minetest.register_craft( {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
output = "basic_signs:sign_wall_brown 2",
|
output = "basic_signs:sign_wall_steel_brown 2",
|
||||||
recipe = {
|
recipe = {
|
||||||
{ "dye:brown", "dye:white", "dye:brown" },
|
{ "dye:brown", "dye:white", "dye:brown" },
|
||||||
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
{ "steel:sheet_metal", "steel:sheet_metal", "steel:sheet_metal" }
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_signs:sign_wall_glass 8",
|
||||||
|
recipe = {
|
||||||
|
{ "default:glass", "default:glass", "default:glass" },
|
||||||
|
{ "default:glass", "default:glass", "default:glass" },
|
||||||
|
{ "", "default:glass", "" }
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_signs:sign_wall_obsidian_glass 8",
|
||||||
|
recipe = {
|
||||||
|
{ "default:obsidian_glass", "default:obsidian_glass", "default:obsidian_glass" },
|
||||||
|
{ "default:obsidian_glass", "default:obsidian_glass", "default:obsidian_glass" },
|
||||||
|
{ "", "default:obsidian_glass", "" }
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_signs:sign_wall_glass 3",
|
||||||
|
recipe = {
|
||||||
|
{ "xpanes:pane_flat", "xpanes:pane_flat", "xpanes:pane_flat" },
|
||||||
|
{ "xpanes:pane_flat", "xpanes:pane_flat", "xpanes:pane_flat" },
|
||||||
|
{ "", "xpanes:pane_flat", "" }
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "basic_signs:sign_wall_obsidian_glass 3",
|
||||||
|
recipe = {
|
||||||
|
{ "xpanes:obsidian_pane_flat", "xpanes:obsidian_pane_flat", "xpanes:obsidian_pane_flat" },
|
||||||
|
{ "xpanes:obsidian_pane_flat", "xpanes:obsidian_pane_flat", "xpanes:obsidian_pane_flat" },
|
||||||
|
{ "", "xpanes:obsidian_pane_flat", "" }
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
339
init.lua
339
init.lua
@ -9,9 +9,118 @@ dofile(basic_signs.path .. "/crafting.lua")
|
|||||||
local S, NS = dofile(basic_signs.path .. "/intllib.lua")
|
local S, NS = dofile(basic_signs.path .. "/intllib.lua")
|
||||||
basic_signs.gettext = S
|
basic_signs.gettext = S
|
||||||
|
|
||||||
local cbox
|
function basic_signs.check_for_floor(pointed_thing)
|
||||||
|
if pointed_thing.above.x == pointed_thing.under.x
|
||||||
|
and pointed_thing.above.z == pointed_thing.under.z
|
||||||
|
and pointed_thing.above.y > pointed_thing.under.y then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function basic_signs.determine_sign_type(pos, placer, itemstack, pointed_thing)
|
||||||
|
|
||||||
|
local playername = placer:get_player_name()
|
||||||
|
local pt_name = minetest.get_node(pointed_thing.under).name
|
||||||
|
local node = minetest.get_node(pos) -- since we're in after-place, this will be the wall sign itself
|
||||||
|
|
||||||
|
if minetest.is_protected(pointed_thing.under, playername) then
|
||||||
|
minetest.record_protection_violation(pointed_thing.under, playername)
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
|
||||||
|
local newparam2 = minetest.dir_to_facedir(placer:get_look_dir())
|
||||||
|
|
||||||
|
if minetest.registered_nodes[pt_name] and
|
||||||
|
minetest.registered_nodes[pt_name].on_rightclick and
|
||||||
|
not placer:get_player_control().sneak then
|
||||||
|
return minetest.registered_nodes[pt_name].on_rightclick(pos, node, placer, itemstack, pointed_thing)
|
||||||
|
elseif signs_lib.check_for_pole(pos, pointed_thing) then
|
||||||
|
minetest.swap_node(pos, {name = "default:sign_wall_wood_onpole", param2 = node.param2})
|
||||||
|
elseif signs_lib.check_for_horizontal_pole(pos, pointed_thing) then
|
||||||
|
minetest.swap_node(pos, {name = "default:sign_wall_wood_onpole_horiz", param2 = node.param2})
|
||||||
|
elseif signs_lib.check_for_ceiling(pointed_thing) then
|
||||||
|
minetest.swap_node(pos, {name = "default:sign_wall_wood_hanging", param2 = newparam2})
|
||||||
|
elseif basic_signs.check_for_floor(pointed_thing) then
|
||||||
|
minetest.swap_node(pos, {name = "basic_signs:yard_sign", param2 = newparam2})
|
||||||
|
end
|
||||||
|
signs_lib.update_sign(pos)
|
||||||
|
|
||||||
|
if not creative.is_enabled_for(playername) then
|
||||||
|
itemstack:take_item()
|
||||||
|
end
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
|
||||||
|
local def
|
||||||
|
|
||||||
|
local wgroups = table.copy(signs_lib.standard_wood_groups)
|
||||||
|
wgroups.not_in_creative_inventory = 1
|
||||||
|
|
||||||
|
local sgroups = table.copy(signs_lib.standard_steel_groups)
|
||||||
|
sgroups.not_in_creative_inventory = 1
|
||||||
|
|
||||||
|
minetest.override_item("default:sign_wall_wood", {
|
||||||
|
after_place_node = basic_signs.determine_sign_type
|
||||||
|
})
|
||||||
|
|
||||||
|
signs_lib.register_sign("basic_signs:sign_wall_locked", {
|
||||||
|
description = S("Locked Sign"),
|
||||||
|
tiles = {
|
||||||
|
"basic_signs_sign_wall_locked.png",
|
||||||
|
"signs_lib_sign_wall_steel_edges.png",
|
||||||
|
},
|
||||||
|
inventory_image = "basic_signs_sign_wall_locked_inv.png",
|
||||||
|
locked = true,
|
||||||
|
entity_info = "standard",
|
||||||
|
allow_hanging = true,
|
||||||
|
allow_widefont = true,
|
||||||
|
allow_onpole = true,
|
||||||
|
allow_onpole_horizontal = true
|
||||||
|
})
|
||||||
|
|
||||||
|
signs_lib.register_sign("basic_signs:sign_wall_glass", {
|
||||||
|
description = S("Glass Sign"),
|
||||||
|
tiles = {
|
||||||
|
{ name = "basic_signs_sign_wall_glass.png", backface_culling = true},
|
||||||
|
"basic_signs_sign_wall_glass_edges.png",
|
||||||
|
},
|
||||||
|
inventory_image = "basic_signs_sign_wall_glass_inv.png",
|
||||||
|
default_color = "c",
|
||||||
|
locked = true,
|
||||||
|
entity_info = "standard",
|
||||||
|
sounds = default.node_sound_glass_defaults(),
|
||||||
|
groups = {cracky = 3, oddly_breakable_by_hand = 3},
|
||||||
|
allow_hanging = true,
|
||||||
|
allow_widefont = true,
|
||||||
|
allow_onpole = true,
|
||||||
|
allow_onpole_horizontal = true,
|
||||||
|
use_texture_alpha = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
signs_lib.register_sign("basic_signs:sign_wall_obsidian_glass", {
|
||||||
|
description = S("Obsidian Glass Sign"),
|
||||||
|
tiles = {
|
||||||
|
{ name = "basic_signs_sign_wall_obsidian_glass.png", backface_culling = true},
|
||||||
|
"basic_signs_sign_wall_obsidian_glass_edges.png",
|
||||||
|
},
|
||||||
|
inventory_image = "basic_signs_sign_wall_obsidian_glass_inv.png",
|
||||||
|
default_color = "c",
|
||||||
|
locked = true,
|
||||||
|
entity_info = "standard",
|
||||||
|
sounds = default.node_sound_glass_defaults(),
|
||||||
|
groups = {cracky = 3},
|
||||||
|
allow_hanging = true,
|
||||||
|
allow_widefont = true,
|
||||||
|
allow_onpole = true,
|
||||||
|
allow_onpole_horizontal = true,
|
||||||
|
use_texture_alpha = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_alias("locked_sign:sign_wall_locked", "basic_signs:sign_wall_locked")
|
||||||
|
|
||||||
|
|
||||||
-- array : color, translated color, default text color
|
-- array : color, translated color, default text color
|
||||||
|
|
||||||
local sign_colors = {
|
local sign_colors = {
|
||||||
{"green", S("green"), "f"},
|
{"green", S("green"), "f"},
|
||||||
{"yellow", S("yellow"), "0"},
|
{"yellow", S("yellow"), "0"},
|
||||||
@ -23,169 +132,40 @@ local sign_colors = {
|
|||||||
{"brown", S("brown"), "f"},
|
{"brown", S("brown"), "f"},
|
||||||
}
|
}
|
||||||
|
|
||||||
function basic_signs.determine_sign_type(pos, placer, itemstack, pointed_thing)
|
local cbox = signs_lib.make_selection_boxes(35, 25, true, 0, 0, 0, true)
|
||||||
local playername = placer:get_player_name()
|
|
||||||
local pt_name = minetest.get_node(pointed_thing.under).name
|
|
||||||
local node = minetest.get_node(pos) -- since we're in after-place, this will be the wall sign itself
|
|
||||||
|
|
||||||
if minetest.is_protected(pointed_thing.under, playername) then
|
|
||||||
minetest.record_protection_violation(pointed_thing.under, playername)
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
|
|
||||||
if minetest.registered_nodes[pt_name] and
|
|
||||||
minetest.registered_nodes[pt_name].on_rightclick and
|
|
||||||
not placer:get_player_control().sneak then
|
|
||||||
return minetest.registered_nodes[pt_name].on_rightclick(pos, node, placer, itemstack, pointed_thing)
|
|
||||||
elseif signs_lib.check_for_pole(pos, pointed_thing) then
|
|
||||||
minetest.swap_node(pos, {name = "default:sign_wall_wood_onpole", param2 = node.param2})
|
|
||||||
else
|
|
||||||
local lookdir = placer:get_look_dir()
|
|
||||||
print(dump(lookdir))
|
|
||||||
local newparam2 = minetest.dir_to_facedir(lookdir)
|
|
||||||
|
|
||||||
if node.param2 == 0 then
|
|
||||||
minetest.swap_node(pos, {name = "basic_signs:hanging_sign", param2 = newparam2})
|
|
||||||
elseif node.param2 == 1 then
|
|
||||||
minetest.swap_node(pos, {name = "basic_signs:yard_sign", param2 = newparam2})
|
|
||||||
end
|
|
||||||
signs_lib.update_sign(pos)
|
|
||||||
end
|
|
||||||
if not creative.is_enabled_for(playername) then
|
|
||||||
itemstack:take_item()
|
|
||||||
end
|
|
||||||
return itemstack
|
|
||||||
end
|
|
||||||
|
|
||||||
for _, onpole in ipairs({"", "_onpole"}) do
|
|
||||||
|
|
||||||
local nci = nil
|
|
||||||
local pole_mount_tex = nil
|
|
||||||
|
|
||||||
if onpole == "_onpole" then
|
|
||||||
nci = 1
|
|
||||||
pole_mount_tex = "signs_lib_pole_mount.png" -- the metal straps on back, if needed
|
|
||||||
end
|
|
||||||
|
|
||||||
local wood_groups = table.copy(signs_lib.standard_wood_groups)
|
|
||||||
wood_groups.not_in_creative_inventory = nci
|
|
||||||
local steel_groups = table.copy(signs_lib.standard_steel_groups)
|
|
||||||
steel_groups.not_in_creative_inventory = nci
|
|
||||||
|
|
||||||
cbox = signs_lib.make_selection_boxes(35, 25, onpole)
|
|
||||||
|
|
||||||
minetest.override_item("default:sign_wall_wood"..onpole, {
|
|
||||||
after_place_node = basic_signs.determine_sign_type
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("basic_signs:sign_wall_locked"..onpole, {
|
|
||||||
description = S("Locked Sign"),
|
|
||||||
paramtype = "light",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype2 = "wallmounted",
|
|
||||||
drawtype = "mesh",
|
|
||||||
node_box = cbox,
|
|
||||||
selection_box = cbox,
|
|
||||||
mesh = "signs_lib_standard_wall_sign"..onpole..".obj",
|
|
||||||
tiles = {
|
|
||||||
"basic_signs_sign_wall_locked.png",
|
|
||||||
"signs_lib_sign_wall_steel_edges.png",
|
|
||||||
pole_mount_tex
|
|
||||||
},
|
|
||||||
inventory_image = "basic_signs_sign_wall_locked_inv.png",
|
|
||||||
wield_image = "basic_signs_sign_wall_locked_inv.png",
|
|
||||||
groups = wood_groups,
|
|
||||||
default_color = "0",
|
|
||||||
on_construct = signs_lib.construct_sign,
|
|
||||||
on_destruct = signs_lib.destruct_sign,
|
|
||||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
|
||||||
signs_lib.after_place_node(pos, placer, itemstack, pointed_thing, true)
|
|
||||||
end,
|
|
||||||
on_receive_fields = signs_lib.receive_fields,
|
|
||||||
on_punch = signs_lib.update_sign,
|
|
||||||
can_dig = signs_lib.can_modify,
|
|
||||||
on_rotate = signs_lib.wallmounted_rotate,
|
|
||||||
number_of_lines = signs_lib.standard_lines,
|
|
||||||
horiz_scaling = signs_lib.standard_hscale,
|
|
||||||
vert_scaling = signs_lib.standard_vscale,
|
|
||||||
line_spacing = signs_lib.standard_lspace,
|
|
||||||
font_size = signs_lib.standard_fsize,
|
|
||||||
x_offset = signs_lib.standard_xoffs,
|
|
||||||
y_offset = signs_lib.standard_yoffs,
|
|
||||||
chars_per_line = signs_lib.standard_cpl,
|
|
||||||
entity_info = {
|
|
||||||
mesh = "signs_lib_standard_wall_sign_entity"..onpole..".obj",
|
|
||||||
yaw = signs_lib.wallmounted_yaw
|
|
||||||
},
|
|
||||||
drop = "basic_signs:sign_wall_locked"
|
|
||||||
})
|
|
||||||
table.insert(signs_lib.lbm_restore_nodes, "basic_signs:sign_wall_locked"..onpole)
|
|
||||||
table.insert(signs_lib.lbm_restore_nodes, "locked_sign:sign_wall_locked"..onpole)
|
|
||||||
|
|
||||||
minetest.register_alias("locked_sign:sign_wall_locked", "basic_signs:sign_wall_locked")
|
|
||||||
|
|
||||||
cbox = signs_lib.make_selection_boxes(35, 25, onpole, 0, 0, 0, true)
|
|
||||||
|
|
||||||
for i, color in ipairs(sign_colors) do
|
for i, color in ipairs(sign_colors) do
|
||||||
minetest.register_node("basic_signs:sign_wall_steel_"..color[1]..onpole, {
|
signs_lib.register_sign("basic_signs:sign_wall_steel_"..color[1], {
|
||||||
description = S("Sign (@1, steel)", color[2]),
|
description = S("Sign (@1, steel)", color[2]),
|
||||||
paramtype = "light",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
drawtype = "mesh",
|
|
||||||
node_box = cbox,
|
|
||||||
selection_box = cbox,
|
selection_box = cbox,
|
||||||
mesh = "signs_lib_standard_wall_sign_facedir"..onpole..".obj",
|
mesh = "signs_lib_standard_wall_sign_facedir.obj",
|
||||||
tiles = {
|
tiles = {
|
||||||
"basic_signs_steel_"..color[1]..".png",
|
"basic_signs_steel_"..color[1]..".png",
|
||||||
"signs_lib_sign_wall_steel_edges.png",
|
"signs_lib_sign_wall_steel_edges.png",
|
||||||
pole_mount_tex
|
|
||||||
},
|
},
|
||||||
inventory_image = "basic_signs_steel_"..color[1].."_inv.png",
|
inventory_image = "basic_signs_steel_"..color[1].."_inv.png",
|
||||||
wield_image = "basic_signs_steel_"..color[1].."_inv.png",
|
groups = signs_lib.standard_steel_groups,
|
||||||
groups = steel_groups,
|
sounds = signs_lib.standard_steel_sign_sounds,
|
||||||
default_color = color[3],
|
default_color = color[3],
|
||||||
on_construct = signs_lib.construct_sign,
|
|
||||||
on_destruct = signs_lib.destruct_sign,
|
|
||||||
after_place_node = signs_lib.after_place_node,
|
|
||||||
on_receive_fields = signs_lib.receive_fields,
|
|
||||||
on_punch = signs_lib.update_sign,
|
|
||||||
on_rotate = signs_lib.facedir_rotate,
|
|
||||||
number_of_lines = signs_lib.standard_lines,
|
|
||||||
horiz_scaling = signs_lib.standard_hscale,
|
|
||||||
vert_scaling = signs_lib.standard_vscale,
|
|
||||||
line_spacing = signs_lib.standard_lspace,
|
|
||||||
font_size = signs_lib.standard_fsize,
|
|
||||||
x_offset = signs_lib.standard_xoffs,
|
|
||||||
y_offset = signs_lib.standard_yoffs,
|
|
||||||
chars_per_line = signs_lib.standard_cpl,
|
|
||||||
entity_info = {
|
entity_info = {
|
||||||
mesh = "signs_lib_standard_wall_sign_entity"..onpole..".obj",
|
mesh = "signs_lib_standard_wall_sign_entity.obj",
|
||||||
yaw = signs_lib.standard_yaw
|
yaw = signs_lib.standard_yaw
|
||||||
},
|
},
|
||||||
drop = "basic_signs:sign_wall_steel_"..color[1]
|
allow_hanging = true,
|
||||||
|
allow_widefont = true,
|
||||||
|
allow_onpole = true,
|
||||||
|
allow_onpole_horizontal = true
|
||||||
})
|
})
|
||||||
table.insert(signs_lib.lbm_restore_nodes, "basic_signs:sign_wall_steel_"..color[1]..onpole)
|
|
||||||
table.insert(signs_lib.lbm_restore_nodes, "signs:sign_wall_"..color[1]..onpole)
|
|
||||||
|
|
||||||
|
table.insert(signs_lib.lbm_restore_nodes, "signs:sign_wall_"..color[1])
|
||||||
minetest.register_alias("signs:sign_wall_"..color[1], "basic_signs:sign_wall_steel_"..color[1])
|
minetest.register_alias("signs:sign_wall_"..color[1], "basic_signs:sign_wall_steel_"..color[1])
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
cbox = signs_lib.make_selection_boxes(35, 34.5, false, 0, -1.25, -19.69, true)
|
signs_lib.register_sign("basic_signs:yard_sign", {
|
||||||
|
|
||||||
local nci_wood_groups = table.copy(signs_lib.standard_wood_groups)
|
|
||||||
nci_wood_groups.not_in_creative_inventory = 1
|
|
||||||
|
|
||||||
minetest.register_node("basic_signs:yard_sign", {
|
|
||||||
description = "Wooden yard sign",
|
description = "Wooden yard sign",
|
||||||
paramtype = "light",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
drawtype = "mesh",
|
selection_box = signs_lib.make_selection_boxes(35, 34.5, false, 0, -1.25, -19.69, true),
|
||||||
node_box = cbox,
|
|
||||||
selection_box = cbox,
|
|
||||||
mesh = "basic_signs_yard_sign.obj",
|
mesh = "basic_signs_yard_sign.obj",
|
||||||
tiles = {
|
tiles = {
|
||||||
"signs_lib_sign_wall_wooden.png",
|
"signs_lib_sign_wall_wooden.png",
|
||||||
@ -193,79 +173,14 @@ minetest.register_node("basic_signs:yard_sign", {
|
|||||||
"default_wood.png"
|
"default_wood.png"
|
||||||
},
|
},
|
||||||
inventory_image = "default_sign_wood.png",
|
inventory_image = "default_sign_wood.png",
|
||||||
wield_image = "default_sign_wood.png",
|
|
||||||
groups = nci_wood_groups,
|
|
||||||
default_color = "0",
|
|
||||||
on_construct = signs_lib.construct_sign,
|
|
||||||
on_destruct = signs_lib.destruct_sign,
|
|
||||||
after_place_node = signs_lib.after_place_node,
|
|
||||||
on_receive_fields = signs_lib.receive_fields,
|
|
||||||
on_punch = signs_lib.update_sign,
|
|
||||||
on_rotate = signs_lib.facedir_rotate,
|
|
||||||
number_of_lines = signs_lib.standard_lines,
|
|
||||||
horiz_scaling = signs_lib.standard_hscale,
|
|
||||||
vert_scaling = signs_lib.standard_vscale,
|
|
||||||
line_spacing = signs_lib.standard_lspace,
|
|
||||||
font_size = signs_lib.standard_fsize,
|
|
||||||
x_offset = signs_lib.standard_xoffs,
|
|
||||||
y_offset = signs_lib.standard_yoffs,
|
|
||||||
chars_per_line = signs_lib.standard_cpl,
|
|
||||||
entity_info = {
|
entity_info = {
|
||||||
mesh = "basic_signs_yard_sign_entity.obj",
|
mesh = "basic_signs_yard_sign_entity.obj",
|
||||||
yaw = signs_lib.standard_yaw
|
yaw = signs_lib.standard_yaw
|
||||||
},
|
},
|
||||||
drop = "default:sign_wall_wood"
|
groups = wgroups,
|
||||||
|
drop = "default:sign_wall_wood",
|
||||||
|
allow_widefont = true
|
||||||
})
|
})
|
||||||
table.insert(signs_lib.lbm_restore_nodes, "basic_signs:yard_sign")
|
|
||||||
table.insert(signs_lib.lbm_restore_nodes, "signs:sign_yard")
|
table.insert(signs_lib.lbm_restore_nodes, "signs:sign_yard")
|
||||||
minetest.register_alias("signs:sign_yard", "basic_signs:yard_sign")
|
minetest.register_alias("signs:sign_yard", "basic_signs:yard_sign")
|
||||||
|
|
||||||
cbox = signs_lib.make_selection_boxes(35, 32, false, 0, 3, -18.5, true)
|
|
||||||
|
|
||||||
minetest.register_node("basic_signs:hanging_sign", {
|
|
||||||
description = "Wooden sign, hanging",
|
|
||||||
paramtype = "light",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
drawtype = "mesh",
|
|
||||||
node_box = cbox,
|
|
||||||
selection_box = cbox,
|
|
||||||
mesh = "basic_signs_hanging_sign.obj",
|
|
||||||
tiles = {
|
|
||||||
"signs_lib_sign_wall_wooden.png",
|
|
||||||
"signs_lib_sign_wall_wooden_edges.png",
|
|
||||||
"basic_signs_ceiling_hangers.png"
|
|
||||||
},
|
|
||||||
inventory_image = "default_sign_wood.png",
|
|
||||||
wield_image = "default_sign_wood.png",
|
|
||||||
groups = nci_wood_groups,
|
|
||||||
default_color = "0",
|
|
||||||
on_construct = signs_lib.construct_sign,
|
|
||||||
on_destruct = signs_lib.destruct_sign,
|
|
||||||
after_place_node = signs_lib.after_place_node,
|
|
||||||
on_receive_fields = signs_lib.receive_fields,
|
|
||||||
on_punch = signs_lib.update_sign,
|
|
||||||
on_rotate = signs_lib.facedir_rotate,
|
|
||||||
number_of_lines = signs_lib.standard_lines,
|
|
||||||
horiz_scaling = signs_lib.standard_hscale,
|
|
||||||
vert_scaling = signs_lib.standard_vscale,
|
|
||||||
line_spacing = signs_lib.standard_lspace,
|
|
||||||
font_size = signs_lib.standard_fsize,
|
|
||||||
x_offset = signs_lib.standard_xoffs,
|
|
||||||
y_offset = signs_lib.standard_yoffs,
|
|
||||||
chars_per_line = signs_lib.standard_cpl,
|
|
||||||
entity_info = {
|
|
||||||
mesh = "basic_signs_hanging_sign_entity.obj",
|
|
||||||
yaw = signs_lib.standard_yaw
|
|
||||||
},
|
|
||||||
drop = "default:sign_wall_wood"
|
|
||||||
})
|
|
||||||
table.insert(signs_lib.lbm_restore_nodes, "basic_signs:hanging_sign")
|
|
||||||
table.insert(signs_lib.lbm_restore_nodes, "signs:sign_hanging")
|
|
||||||
minetest.register_alias("signs:sign_hanging", "basic_signs:hanging_sign")
|
|
||||||
|
|
||||||
-- insert the old wood sign-on-fencepost into signs_lib's conversion LBM
|
|
||||||
|
|
||||||
table.insert(signs_lib.old_fenceposts_with_signs, "signs:sign_post")
|
|
||||||
signs_lib.old_fenceposts["signs:sign_post"] = "default:fence_wood"
|
|
||||||
signs_lib.old_fenceposts_replacement_signs["signs:sign_post"] = "default:sign_wall_wood_onpole"
|
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
# Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden hanging sign.blend'
|
|
||||||
# www.blender.org
|
|
||||||
o Cube
|
|
||||||
v 0.437500 -0.312500 0.031250
|
|
||||||
v 0.437500 -0.312500 -0.031250
|
|
||||||
v 0.437500 0.312500 0.031250
|
|
||||||
v 0.437500 0.312500 -0.031250
|
|
||||||
v -0.437500 -0.312500 0.031250
|
|
||||||
v -0.437500 -0.312500 -0.031250
|
|
||||||
v -0.437500 0.312500 0.031250
|
|
||||||
v -0.437500 0.312500 -0.031250
|
|
||||||
v 0.437500 -0.312500 0.031250
|
|
||||||
v 0.437500 -0.312500 -0.031250
|
|
||||||
v 0.437500 0.312500 0.031250
|
|
||||||
v 0.437500 0.312500 -0.031250
|
|
||||||
v -0.437500 -0.312500 0.031250
|
|
||||||
v -0.437500 -0.312500 -0.031250
|
|
||||||
v -0.437500 0.312500 0.031250
|
|
||||||
v -0.437500 0.312500 -0.031250
|
|
||||||
v 0.500000 0.312500 0.000000
|
|
||||||
v 0.500000 0.500000 0.000000
|
|
||||||
v -0.500000 0.312500 0.000000
|
|
||||||
v -0.500000 0.500000 0.000000
|
|
||||||
vt 0.468750 0.812500
|
|
||||||
vt 0.031250 0.812500
|
|
||||||
vt 0.031250 0.187500
|
|
||||||
vt 0.468750 0.187500
|
|
||||||
vt 0.531250 0.812500
|
|
||||||
vt 0.968750 0.812500
|
|
||||||
vt 0.968750 0.187500
|
|
||||||
vt 0.531250 0.187500
|
|
||||||
vt 0.234375 0.000000
|
|
||||||
vt 0.234375 1.000000
|
|
||||||
vt 0.015625 1.000000
|
|
||||||
vt 0.015625 -0.000000
|
|
||||||
vt 0.609375 -0.000000
|
|
||||||
vt 0.609375 1.000000
|
|
||||||
vt 0.390625 1.000000
|
|
||||||
vt 0.390625 -0.000000
|
|
||||||
vt 0.765625 0.000000
|
|
||||||
vt 0.765625 1.000000
|
|
||||||
vt 1.000000 0.812500
|
|
||||||
vt 1.000000 1.000000
|
|
||||||
vt 0.000000 1.000000
|
|
||||||
vt -0.000000 0.812500
|
|
||||||
vn 0.0000 0.0000 -1.0000
|
|
||||||
vn 0.0000 -0.0000 1.0000
|
|
||||||
vn 0.0000 -1.0000 0.0000
|
|
||||||
vn 0.0000 1.0000 0.0000
|
|
||||||
vn 1.0000 0.0000 0.0000
|
|
||||||
vn -1.0000 0.0000 0.0000
|
|
||||||
g Cube_Cube_front-back
|
|
||||||
s off
|
|
||||||
f 8/1/1 4/2/1 2/3/1 6/4/1
|
|
||||||
f 3/5/2 7/6/2 5/7/2 1/8/2
|
|
||||||
g Cube_Cube_edges
|
|
||||||
f 13/9/3 14/10/3 10/11/3 9/12/3
|
|
||||||
f 11/13/4 12/14/4 16/15/4 15/16/4
|
|
||||||
f 11/13/5 9/17/5 10/18/5 12/14/5
|
|
||||||
f 13/9/6 15/16/6 16/15/6 14/10/6
|
|
||||||
g Cube_Cube_hangers
|
|
||||||
f 19/19/1 20/20/1 18/21/1 17/22/1
|
|
@ -1,15 +0,0 @@
|
|||||||
# Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden hanging sign.blend'
|
|
||||||
# www.blender.org
|
|
||||||
o Plane
|
|
||||||
v 0.406250 -0.281250 -0.039062
|
|
||||||
v -0.406250 -0.281250 -0.039062
|
|
||||||
v 0.406250 0.281250 -0.039063
|
|
||||||
v -0.406250 0.281250 -0.039063
|
|
||||||
vt 0.000000 0.000000
|
|
||||||
vt 1.000000 0.000000
|
|
||||||
vt 1.000000 1.000000
|
|
||||||
vt 0.000000 1.000000
|
|
||||||
vn 0.0000 -0.0000 -1.0000
|
|
||||||
g Plane_Plane_None
|
|
||||||
s off
|
|
||||||
f 1/1/1 2/2/1 4/3/1 3/4/1
|
|
@ -1,10 +1,10 @@
|
|||||||
# Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden yard sign.blend'
|
# Blender v2.79 (sub 0) OBJ File: 'basic_signs wooden yard sign.blend'
|
||||||
# www.blender.org
|
# www.blender.org
|
||||||
o Plane
|
o Plane
|
||||||
v 0.406250 -0.218750 -0.070312
|
v 0.406250 -0.218750 -0.074219
|
||||||
v -0.406250 -0.218750 -0.070312
|
v -0.406250 -0.218750 -0.074219
|
||||||
v 0.406250 0.343750 -0.070313
|
v 0.406250 0.343750 -0.074219
|
||||||
v -0.406250 0.343750 -0.070313
|
v -0.406250 0.343750 -0.074219
|
||||||
vt 0.000000 0.000000
|
vt 0.000000 0.000000
|
||||||
vt 1.000000 0.000000
|
vt 1.000000 0.000000
|
||||||
vt 1.000000 1.000000
|
vt 1.000000 1.000000
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 155 B |
BIN
textures/basic_signs_sign_wall_glass.png
Normal file
BIN
textures/basic_signs_sign_wall_glass.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
textures/basic_signs_sign_wall_glass_edges.png
Normal file
BIN
textures/basic_signs_sign_wall_glass_edges.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 178 B |
BIN
textures/basic_signs_sign_wall_obsidian_glass.png
Normal file
BIN
textures/basic_signs_sign_wall_obsidian_glass.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 592 B |
BIN
textures/basic_signs_sign_wall_obsidian_glass_edges.png
Normal file
BIN
textures/basic_signs_sign_wall_obsidian_glass_edges.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 156 B |
Reference in New Issue
Block a user