Compare commits
5 Commits
v4.3
...
nalc-1.2.0
Author | SHA1 | Date | |
---|---|---|---|
9c385319cb | |||
c38e63e3a2 | |||
f180f7246d | |||
7d93f60b74 | |||
4a3efd37e4 |
13
README.md
Normal file
13
README.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# README #
|
||||||
|
|
||||||
|
This mod adds arrow signs (wood and steel) that can used for showing the goal of a road.
|
||||||
|
|
||||||
|
### Installation ###
|
||||||
|
Install it like each other mod for minetest.
|
||||||
|
See: http://wiki.minetest.net/Installing_Mods
|
||||||
|
|
||||||
|
### Craft rezieps ###
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
48
init.lua
48
init.lua
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
arrow_signs={}
|
arrow_signs={}
|
||||||
|
|
||||||
arrow_signs.formspec = "field[text;Sign text: (Hint: Use / or | to create a new line);${text}]";
|
arrow_signs.formspec = "size[6,2]real_coordinates[true]field[0.375,0.5;5.25,0.8;text;Sign text: (Hit 'Enter' key to validate);${text}]label[0.375,1.5;(Hint: Use / or | to create a new line)]";
|
||||||
|
|
||||||
arrow_signs.on_place = function(itemstack, placer, pointed_thing)
|
arrow_signs.on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
|
||||||
@ -94,6 +94,50 @@ arrow_signs.on_place = function(itemstack, placer, pointed_thing)
|
|||||||
return minetest.item_place_node(itemstack, placer, pointed_thing, param2)
|
return minetest.item_place_node(itemstack, placer, pointed_thing, param2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local matrix = {
|
||||||
|
-- Mounted on Ground (-Y)
|
||||||
|
[10]=19,
|
||||||
|
[19]=4,
|
||||||
|
[4]=13,
|
||||||
|
[13]=10,
|
||||||
|
|
||||||
|
-- Mounted on Top (+Y)
|
||||||
|
[8]=17,
|
||||||
|
[17]=6,
|
||||||
|
[6]=15,
|
||||||
|
[15]=8,
|
||||||
|
|
||||||
|
-- Mounted at South (-Z)
|
||||||
|
[2]=18, -- down
|
||||||
|
[18]=22, -- left
|
||||||
|
[22]=14, -- up
|
||||||
|
[14]=2, -- right
|
||||||
|
|
||||||
|
-- Mounted at North (+Z)
|
||||||
|
[0]=12, -- down
|
||||||
|
[12]=20, -- left
|
||||||
|
[20]=16, -- up
|
||||||
|
[16]=0, -- right
|
||||||
|
|
||||||
|
-- Mounted at West (-X)
|
||||||
|
[3]=7, -- down
|
||||||
|
[7]=21, -- left
|
||||||
|
[21]=11, -- up
|
||||||
|
[11]=3, -- right
|
||||||
|
|
||||||
|
-- Mounted at East (+X)
|
||||||
|
[1]=9, -- down
|
||||||
|
[9]=23, -- left
|
||||||
|
[23]=5, -- up
|
||||||
|
[5]=1, -- right
|
||||||
|
}
|
||||||
|
|
||||||
|
arrow_signs.on_rotate = function(pos, node, player, mode, new_param2)
|
||||||
|
node.param2 = matrix[node.param2] or 0 --in case of error
|
||||||
|
minetest.swap_node(pos,node)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
arrow_signs.savetext = function(pos, formname, fields, sender)
|
arrow_signs.savetext = function(pos, formname, fields, sender)
|
||||||
if fields.text then
|
if fields.text then
|
||||||
local playername = sender:get_player_name() or ""
|
local playername = sender:get_player_name() or ""
|
||||||
@ -148,3 +192,5 @@ dofile(MODPATH.."/steel.lua")
|
|||||||
if minetest.get_modpath("locks") then
|
if minetest.get_modpath("locks") then
|
||||||
dofile(MODPATH.."/shared_locked.lua")
|
dofile(MODPATH.."/shared_locked.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
minetest.log("action", "[arrow_signs] loaded.")
|
||||||
|
@ -10,7 +10,7 @@ minetest.register_node("arrow_signs:shared_locked", {
|
|||||||
node_box = arrow_signs.nodebox,
|
node_box = arrow_signs.nodebox,
|
||||||
selection_box = arrow_signs.selection_box,
|
selection_box = arrow_signs.selection_box,
|
||||||
tiles = {"arrow_signs_wood.png^arrow_signs_wood_border.png"},
|
tiles = {"arrow_signs_wood.png^arrow_signs_wood_border.png"},
|
||||||
inventory_image = "arrow_signs_wood.png",
|
inventory_image = "arrow_signs_wood.png^[transformR90",
|
||||||
wield_image = "arrow_signs_wood.png",
|
wield_image = "arrow_signs_wood.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
@ -24,7 +24,7 @@ minetest.register_node("arrow_signs:shared_locked", {
|
|||||||
locks:lock_set_owner( pointed_thing.above, placer, "Shared locked sign");
|
locks:lock_set_owner( pointed_thing.above, placer, "Shared locked sign");
|
||||||
return itemstack
|
return itemstack
|
||||||
end,
|
end,
|
||||||
|
on_rotate = arrow_signs.on_rotate,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
-- prepare the lock of the sign
|
-- prepare the lock of the sign
|
||||||
@ -40,7 +40,7 @@ minetest.register_node("arrow_signs:shared_locked", {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
|
if not locks:lock_handle_input(pos, formname, fields, sender) then
|
||||||
-- if the user already has the right to use this and did input text
|
-- if the user already has the right to use this and did input text
|
||||||
if( fields.text
|
if( fields.text
|
||||||
and ( not(fields.locks_sent_lock_command)
|
and ( not(fields.locks_sent_lock_command)
|
||||||
@ -62,7 +62,7 @@ minetest.register_node("arrow_signs:shared_locked", {
|
|||||||
--a warning message is also printed by the locks mod
|
--a warning message is also printed by the locks mod
|
||||||
--arrow_signs.savetext( pos, formname, fields, sender );
|
--arrow_signs.savetext( pos, formname, fields, sender );
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ minetest.register_node("arrow_signs:steel", {
|
|||||||
node_box = arrow_signs.nodebox,
|
node_box = arrow_signs.nodebox,
|
||||||
selection_box = arrow_signs.selection_box,
|
selection_box = arrow_signs.selection_box,
|
||||||
tiles = {"arrow_signs_steel.png^arrow_signs_steel_border.png"},
|
tiles = {"arrow_signs_steel.png^arrow_signs_steel_border.png"},
|
||||||
inventory_image = "arrow_signs_steel.png",
|
inventory_image = "arrow_signs_steel.png^[transformR90",
|
||||||
wield_image = "arrow_signs_steel.png",
|
wield_image = "arrow_signs_steel.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
@ -20,6 +20,7 @@ minetest.register_node("arrow_signs:steel", {
|
|||||||
groups = {cracky = 2},
|
groups = {cracky = 2},
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
on_place = arrow_signs.on_place,
|
on_place = arrow_signs.on_place,
|
||||||
|
on_rotate = arrow_signs.on_rotate,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec", arrow_signs.formspec)
|
meta:set_string("formspec", arrow_signs.formspec)
|
||||||
|
3
wood.lua
3
wood.lua
@ -11,7 +11,7 @@ minetest.register_node("arrow_signs:wall", {
|
|||||||
node_box = arrow_signs.nodebox,
|
node_box = arrow_signs.nodebox,
|
||||||
selection_box = arrow_signs.selection_box,
|
selection_box = arrow_signs.selection_box,
|
||||||
tiles = {"arrow_signs_wood.png^arrow_signs_wood_border.png"},
|
tiles = {"arrow_signs_wood.png^arrow_signs_wood_border.png"},
|
||||||
inventory_image = "arrow_signs_wood.png",
|
inventory_image = "arrow_signs_wood.png^[transformR90",
|
||||||
wield_image = "arrow_signs_wood.png",
|
wield_image = "arrow_signs_wood.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
@ -20,6 +20,7 @@ minetest.register_node("arrow_signs:wall", {
|
|||||||
groups = {choppy = 2, flammable = 2, oddly_breakable_by_hand = 3},
|
groups = {choppy = 2, flammable = 2, oddly_breakable_by_hand = 3},
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
on_place = arrow_signs.on_place,
|
on_place = arrow_signs.on_place,
|
||||||
|
on_rotate = arrow_signs.on_rotate,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
--local n = minetest.get_node(pos)
|
--local n = minetest.get_node(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
Reference in New Issue
Block a user