First commit
authorPierre-Yves Rollo <dev@pyrollo.com>
Wed, 11 Nov 2015 13:26:39 +0000 (14:26 +0100)
committerPierre-Yves Rollo <dev@pyrollo.com>
Wed, 11 Nov 2015 13:26:39 +0000 (14:26 +0100)
143 files changed:
.gitignore [new file with mode: 0644]
README.md [new file with mode: 0644]
display_lib/API.md [new file with mode: 0644]
display_lib/LICENSE.txt [new file with mode: 0644]
display_lib/README.md [new file with mode: 0644]
display_lib/depends.txt [new file with mode: 0644]
display_lib/init.lua [new file with mode: 0644]
modpack.txt [new file with mode: 0644]
ontime_clocks/LICENSE.txt [new file with mode: 0644]
ontime_clocks/README.md [new file with mode: 0644]
ontime_clocks/common.lua [new file with mode: 0644]
ontime_clocks/crafts.lua [new file with mode: 0644]
ontime_clocks/depends.txt [new file with mode: 0644]
ontime_clocks/init.lua [new file with mode: 0644]
ontime_clocks/nodes.lua [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_digital.png [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_digital_background.png [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_digital_digit.png [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_frameless.png [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_frameless_inventory.png [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_green_digital_inventory.png [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_needle_h36.png [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_needle_h48.png [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_needle_m36.png [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_needle_m48.png [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_red_digital_inventory.png [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_white.png [new file with mode: 0644]
ontime_clocks/textures/ontime_clocks_white_inventory.png [new file with mode: 0644]
signs/LICENSE.txt [new file with mode: 0644]
signs/README.md [new file with mode: 0644]
signs/common.lua [new file with mode: 0644]
signs/crafts.lua [new file with mode: 0644]
signs/depends.txt [new file with mode: 0644]
signs/font.lua [new file with mode: 0644]
signs/init.lua [new file with mode: 0644]
signs/nodes.lua [new file with mode: 0644]
signs/textures/signs_20.png [new file with mode: 0644]
signs/textures/signs_21.png [new file with mode: 0644]
signs/textures/signs_22.png [new file with mode: 0644]
signs/textures/signs_23.png [new file with mode: 0644]
signs/textures/signs_24.png [new file with mode: 0644]
signs/textures/signs_25.png [new file with mode: 0644]
signs/textures/signs_26.png [new file with mode: 0644]
signs/textures/signs_27.png [new file with mode: 0644]
signs/textures/signs_28.png [new file with mode: 0644]
signs/textures/signs_29.png [new file with mode: 0644]
signs/textures/signs_2a.png [new file with mode: 0644]
signs/textures/signs_2b.png [new file with mode: 0644]
signs/textures/signs_2c.png [new file with mode: 0644]
signs/textures/signs_2d.png [new file with mode: 0644]
signs/textures/signs_2e.png [new file with mode: 0644]
signs/textures/signs_2f.png [new file with mode: 0644]
signs/textures/signs_30.png [new file with mode: 0644]
signs/textures/signs_31.png [new file with mode: 0644]
signs/textures/signs_32.png [new file with mode: 0644]
signs/textures/signs_33.png [new file with mode: 0644]
signs/textures/signs_34.png [new file with mode: 0644]
signs/textures/signs_35.png [new file with mode: 0644]
signs/textures/signs_36.png [new file with mode: 0644]
signs/textures/signs_37.png [new file with mode: 0644]
signs/textures/signs_38.png [new file with mode: 0644]
signs/textures/signs_39.png [new file with mode: 0644]
signs/textures/signs_3a.png [new file with mode: 0644]
signs/textures/signs_3b.png [new file with mode: 0644]
signs/textures/signs_3c.png [new file with mode: 0644]
signs/textures/signs_3d.png [new file with mode: 0644]
signs/textures/signs_3e.png [new file with mode: 0644]
signs/textures/signs_3f.png [new file with mode: 0644]
signs/textures/signs_40.png [new file with mode: 0644]
signs/textures/signs_41.png [new file with mode: 0644]
signs/textures/signs_42.png [new file with mode: 0644]
signs/textures/signs_43.png [new file with mode: 0644]
signs/textures/signs_44.png [new file with mode: 0644]
signs/textures/signs_45.png [new file with mode: 0644]
signs/textures/signs_46.png [new file with mode: 0644]
signs/textures/signs_47.png [new file with mode: 0644]
signs/textures/signs_48.png [new file with mode: 0644]
signs/textures/signs_49.png [new file with mode: 0644]
signs/textures/signs_4a.png [new file with mode: 0644]
signs/textures/signs_4b.png [new file with mode: 0644]
signs/textures/signs_4c.png [new file with mode: 0644]
signs/textures/signs_4d.png [new file with mode: 0644]
signs/textures/signs_4e.png [new file with mode: 0644]
signs/textures/signs_4f.png [new file with mode: 0644]
signs/textures/signs_50.png [new file with mode: 0644]
signs/textures/signs_51.png [new file with mode: 0644]
signs/textures/signs_52.png [new file with mode: 0644]
signs/textures/signs_53.png [new file with mode: 0644]
signs/textures/signs_54.png [new file with mode: 0644]
signs/textures/signs_55.png [new file with mode: 0644]
signs/textures/signs_56.png [new file with mode: 0644]
signs/textures/signs_57.png [new file with mode: 0644]
signs/textures/signs_58.png [new file with mode: 0644]
signs/textures/signs_59.png [new file with mode: 0644]
signs/textures/signs_5a.png [new file with mode: 0644]
signs/textures/signs_5b.png [new file with mode: 0644]
signs/textures/signs_5c.png [new file with mode: 0644]
signs/textures/signs_5d.png [new file with mode: 0644]
signs/textures/signs_5e.png [new file with mode: 0644]
signs/textures/signs_5f.png [new file with mode: 0644]
signs/textures/signs_60.png [new file with mode: 0644]
signs/textures/signs_61.png [new file with mode: 0644]
signs/textures/signs_62.png [new file with mode: 0644]
signs/textures/signs_63.png [new file with mode: 0644]
signs/textures/signs_64.png [new file with mode: 0644]
signs/textures/signs_65.png [new file with mode: 0644]
signs/textures/signs_66.png [new file with mode: 0644]
signs/textures/signs_67.png [new file with mode: 0644]
signs/textures/signs_68.png [new file with mode: 0644]
signs/textures/signs_69.png [new file with mode: 0644]
signs/textures/signs_6a.png [new file with mode: 0644]
signs/textures/signs_6b.png [new file with mode: 0644]
signs/textures/signs_6c.png [new file with mode: 0644]
signs/textures/signs_6d.png [new file with mode: 0644]
signs/textures/signs_6e.png [new file with mode: 0644]
signs/textures/signs_6f.png [new file with mode: 0644]
signs/textures/signs_70.png [new file with mode: 0644]
signs/textures/signs_71.png [new file with mode: 0644]
signs/textures/signs_72.png [new file with mode: 0644]
signs/textures/signs_73.png [new file with mode: 0644]
signs/textures/signs_74.png [new file with mode: 0644]
signs/textures/signs_75.png [new file with mode: 0644]
signs/textures/signs_76.png [new file with mode: 0644]
signs/textures/signs_77.png [new file with mode: 0644]
signs/textures/signs_78.png [new file with mode: 0644]
signs/textures/signs_79.png [new file with mode: 0644]
signs/textures/signs_7a.png [new file with mode: 0644]
signs/textures/signs_7b.png [new file with mode: 0644]
signs/textures/signs_7c.png [new file with mode: 0644]
signs/textures/signs_7d.png [new file with mode: 0644]
signs/textures/signs_7e.png [new file with mode: 0644]
signs/textures/signs_black_inventory.png [new file with mode: 0644]
signs/textures/signs_black_left.png [new file with mode: 0644]
signs/textures/signs_black_right.png [new file with mode: 0644]
signs/textures/signs_blue_street.png [new file with mode: 0644]
signs/textures/signs_blue_street_inventory.png [new file with mode: 0644]
signs/textures/signs_green_street.png [new file with mode: 0644]
signs/textures/signs_green_street_inventory.png [new file with mode: 0644]
signs/textures/signs_poster.png [new file with mode: 0644]
signs/textures/signs_poster_inventory.png [new file with mode: 0644]
signs/textures/signs_wooden_inventory.png [new file with mode: 0644]
signs/textures/signs_wooden_left.png [new file with mode: 0644]
signs/textures/signs_wooden_right.png [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..c6f5712
--- /dev/null
@@ -0,0 +1,3 @@
+*~
+_*
+
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..addcc78
--- /dev/null
+++ b/README.md
@@ -0,0 +1,8 @@
+# Display Modpack
+
+This modpack provides mods with dynamic display. Mods are :
+
+- **display_lib**: A library for adding display entities to nodes;
+- **ontime_clocks**: A mod providing clocks which display the ingame time;
+- **signs**: A mod providing signs and direction signs displaying text;
+
diff --git a/display_lib/API.md b/display_lib/API.md
new file mode 100644 (file)
index 0000000..7bfaaef
--- /dev/null
@@ -0,0 +1,77 @@
+# Display Lib API
+This document describes Display Lib API. Display Lib allows to add a dynamic display on a node. Node must be wallmounted and Display Lib limits its rotation to vertical positions. 
+## Provided methods
+### update\_entities
+**display\_lib.update\_entities(pos)**
+
+This method triggers entities update for the display node at pos. Actual entity update is made by **on\_display\_update** callback associated to the entity.
+
+**pos**: Position of the node
+### register\_display\_entity
+**display\_lib.register\_display\_entity(entity_name)**
+
+This is a helper to register entities used for display. 
+
+**entity_name**: Name of the entity to register.
+## Provided callback implementations
+### on_place
+**display\_lib.on\_place(itemstack, placer, pointed\_thing)**
+
+**On_place** node callback implementation. Display nodes should have this callback (avoid placement of horizontal display node).
+### on_construct
+**display\_lib.on\_construct(pos)**
+
+**On_construct** node callback implementation. Display nodes should have this callback (creates, places and updates display entities on node construction).
+### on_destruct
+**display\_lib.on_destruct(pos)**
+
+**On_destruct** node callback implementation. Display nodes should have this callback (removes display entities on node destruction). 
+### on_rotate
+**display\_lib.on\_rotate(pos, node, user, mode, new_param2)**
+
+**On_rotate** node callback implementation. Display nodes should have this callback (restricts rotations and rotates display entities associated with node).
+### on_activate
+**display\_lib.on_activate(entity, staticdata)**
+
+**On_activate** entity callback implementation for display entities. No need of this method if display entities have been registered using **register\_display\_entity** (callback is already set). 
+## Howto register a display node
+* Register display entities with **register\_display\_entity**
+* Register node with :
+       - **on\_place**, **on\_construct**, **on\_destruct** and **on\_rotate** callbacks using **display\_lib** callbacks.
+       - a **display\_entities** field in node definition containing a entity name indexed table. For each entity, two fields : **depth** indicates the entity position (-0.5 to 0.5) and **on_display_update** is a callback in charge of setting up entity texture.
+
+### Example
+
+               display_lib.register_display_entity("mymod:entity1")
+               display_lib.register_display_entity("mymod:entity2")
+
+               function my_display_update1(pos, objref) 
+                       objref:set_properties({ textures= {"mytexture1.png"},
+                                                                       visual_size = {x=1, y=1} })
+               end
+
+               function my_display_update2(pos, objref) 
+                       objref:set_properties({ textures= {"mytexture2.png"},
+                                                                       visual_size = {x=1, y=1} })
+               end
+
+               minetest.register_node("mymod:test_display_node", {
+                       ...
+                       paramtype2 = "wallmounted",
+                       ...
+                       display_entities = {
+                               ["mymod:entity1"] = { depth = -0.3, 
+                                       on_display_update = my_display_update1},
+                               ["mymod:entity1"] = { depth = -0.2, 
+                                       on_display_update = my_display_update2},
+                       },
+                       ...
+                       on_place = display_lib.on_place,
+                       on_construct = display_lib.on_construct,
+                       on_destruct = display_lib.on_destruct,
+                       on_rotate = display_lib.on_rotate,
+                       ...
+               })
+
+
+
diff --git a/display_lib/LICENSE.txt b/display_lib/LICENSE.txt
new file mode 100644 (file)
index 0000000..bc06764
--- /dev/null
@@ -0,0 +1,13 @@
+          DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+                   Version 2, December 2004
+Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
+Everyone is permitted to copy and distribute verbatim or modified
+copies of this license document, and changing it is allowed as long
+as the name is changed.
+           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
diff --git a/display_lib/README.md b/display_lib/README.md
new file mode 100644 (file)
index 0000000..7ca97b2
--- /dev/null
@@ -0,0 +1,11 @@
+# Dislpay Lib
+
+This library's purpose is to ease creation of wallmounted nodes with a display on front side. For example, signs and clocks. Display can be dynamic and/or different for each node instance.
+
+**Limitations**: This lib uses entities to draw display. This means display has to be vertical. So display nodes are only wallmounted vertically.
+
+**Dependancies**:default
+
+**License**: WTFPL
+
+**API**: See API.md document please.
diff --git a/display_lib/depends.txt b/display_lib/depends.txt
new file mode 100644 (file)
index 0000000..4ad96d5
--- /dev/null
@@ -0,0 +1 @@
+default
diff --git a/display_lib/init.lua b/display_lib/init.lua
new file mode 100644 (file)
index 0000000..eaddfd3
--- /dev/null
@@ -0,0 +1,156 @@
+-- Display lib mod by P.Y. Rollo
+--
+-- License: WTFPL
+
+display_lib = {}
+
+-- Miscelaneous values depending on wallmounted param2
+local wallmounted_values = {
+       [0]={dx=0,  dz=0,  lx=0, lz=0,  yaw=0,          rotate=0}, -- Should never be used
+               {dx=1,  dz=0,  lx=0, lz=0,  yaw=0,          rotate=1}, -- Should never be used 
+               {dx=1,  dz=0,  lx=0, lz=-1, yaw=-math.pi/2, rotate=4},
+               {dx=-1, dz=0,  lx=0, lz=1,  yaw=math.pi/2,  rotate=5},
+               {dx=0,  dz=1,  lx=1, lz=0,  yaw=0,          rotate=3},
+               {dx=0,  dz=-1, lx=-1, lz=0, yaw=math.pi,    rotate=2}
+}
+
+--- Gets the display entities attached with a node. Removes extra ones
+local function get_entities(pos)
+       local objrefs = {}
+       local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
+       if ndef and ndef.display_entities then
+               for _, objref in ipairs(minetest.get_objects_inside_radius(pos, 0.5)) do
+                       local entity = objref:get_luaentity()
+                   if entity and ndef.display_entities[entity.name] then
+                               if objrefs[entity.name] then
+                                   objref:remove()
+                               else
+                                       objrefs[entity.name] = objref
+                               end
+                   end
+               end
+       end
+       return objrefs
+end
+
+local function clip_pos_prop(posprop)
+       if posprop then
+               return math.max(-0.5, math.min(0.5, posprop))
+       else
+               return 0
+       end
+end
+
+--- (Create and) place display entities according to the node orientation
+local function place_entities(pos)
+       local node = minetest.get_node(pos)
+       local ndef = minetest.registered_nodes[node.name]
+       local values = wallmounted_values[node.param2]
+       local objrefs = get_entities(pos)
+
+       if ndef and ndef.display_entities then
+               for entity_name, props in pairs(ndef.display_entities) do
+                       local depth = clip_pos_prop(props.depth)
+                       local top = clip_pos_prop(props.top)
+                       local left = clip_pos_prop(props.left)
+                       
+                       if not objrefs[entity_name] then
+                               objrefs[entity_name] = minetest.add_entity(pos, entity_name)
+                       end
+
+                       objrefs[entity_name]:setpos({
+                               x = pos.x - values.dx * depth + values.lx * left,
+                               y = pos.y + top,
+                               z = pos.z - values.dz * depth + values.lz * left})
+
+                       objrefs[entity_name]:setyaw(values.yaw)
+               end
+       end
+       return objrefs
+end
+
+--- Call on_display_update callback of a node for one of its display entities
+local function call_node_on_display_update(pos, objref)
+       local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
+       local entity = objref:get_luaentity()
+       if ndef and ndef.display_entities and entity and ndef.display_entities[entity.name] then
+               ndef.display_entities[entity.name].on_display_update(pos, objref)
+       end     
+end
+
+--- Force entity update
+function display_lib.update_entities(pos)
+       local objrefs = place_entities(pos)
+       for _, objref in pairs(objrefs) do
+               call_node_on_display_update(pos, objref)
+    end
+end
+
+--- On_activate callback for display_lib entities. Calls on_display_update callbacks 
+--- of corresponding node for each entity.
+function display_lib.on_activate(entity, staticdata)
+       if entity then
+               call_node_on_display_update(entity.object:getpos(), entity.object)
+       end
+end
+
+--- On_place callback for display_lib items. Does nothing more than preventing item
+--- from being placed on ceiling or ground 
+function display_lib.on_place(itemstack, placer, pointed_thing)
+       local above = pointed_thing.above
+       local under = pointed_thing.under
+       local dir = {x = under.x - above.x,
+                                y = under.y - above.y,
+                                z = under.z - above.z}
+       local wdir = minetest.dir_to_wallmounted(dir)
+
+       if wdir == 0 or wdir == 1 then
+               dir = placer:get_look_dir()
+               dir.y = 0
+               wdir = minetest.dir_to_wallmounted(dir)
+       end
+       return minetest.item_place(itemstack, placer, pointed_thing, wdir) 
+end
+
+--- On_construct callback for display_lib items. Creates entities and update them.
+function display_lib.on_construct(pos)
+       display_lib.update_entities(pos)
+end
+
+--- On_destruct callback for display_lib items. Removes entities.
+function display_lib.on_destruct(pos)
+       local objrefs = get_entities(pos)
+       
+       for _, objref in pairs(objrefs) do 
+               objref:remove()
+       end
+end
+
+
+-- On_rotate (screwdriver) callback for display_lib items. Prevents axis rotation and reorients entities.
+function display_lib.on_rotate(pos, node, user, mode, new_param2)
+       if mode ~= screwdriver.ROTATE_FACE then return false end
+
+       if wallmounted_values[node.param2] then
+               minetest.swap_node(pos, {name = node.name, param1 = node.param1, param2 = wallmounted_values[node.param2].rotate})
+               place_entities(pos)
+               return true
+       else
+               return false
+       end
+end
+
+--- Creates display entity with some fields and the on_activate callback
+function display_lib.register_display_entity(entity_name)
+       if not minetest.registered_entity then
+               minetest.register_entity(':'..entity_name, {
+                       collisionbox = { 0, 0, 0, 0, 0, 0 },
+                       visual = "upright_sprite",
+                       textures = {},
+                       on_activate = display_lib.on_activate,
+               })
+       end
+end
+
+
+
diff --git a/modpack.txt b/modpack.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/ontime_clocks/LICENSE.txt b/ontime_clocks/LICENSE.txt
new file mode 100644 (file)
index 0000000..bc06764
--- /dev/null
@@ -0,0 +1,13 @@
+          DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+                   Version 2, December 2004
+Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
+Everyone is permitted to copy and distribute verbatim or modified
+copies of this license document, and changing it is allowed as long
+as the name is changed.
+           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
diff --git a/ontime_clocks/README.md b/ontime_clocks/README.md
new file mode 100644 (file)
index 0000000..b62c01a
--- /dev/null
@@ -0,0 +1,47 @@
+# Ontime Clocks
+
+This mod provides clocks that display real ingame time.
+
+**Dependancies**: display_lib, default
+
+**License**: WTFPL
+
+## Recipes
+
+**Green and red digital clocks**
+
+               - D -
+               G M G
+               - - -
+
+G = Glass, D = Dye, M = Mese Crystal, - = Empty
+
+Green dye for green clock, red dye for red clock
+
+**White clock**
+
+               S P S
+               - M -
+               - - -
+
+P = Paper, S = Steel Ingot, M = Mese Crystal, - = Empty
+
+
+**Frameless clock**
+
+               S D S
+               - M -
+               - - -
+
+D = Dye, S = Steel Ingot, M = Mese Crystal, - = Empty
+
+Black dye for black clock, White dye for white clock
+
+**Gold frameless clock**
+
+               G - G
+               - M -
+               - - -
+
+G = Gold Ingot, M = Mese Crystal, - = Empty
+
diff --git a/ontime_clocks/common.lua b/ontime_clocks/common.lua
new file mode 100644 (file)
index 0000000..6a9681c
--- /dev/null
@@ -0,0 +1,41 @@
+-- Entity for time display
+display_lib.register_display_entity("ontime_clocks:display")
+
+function ontime_clocks.get_h24()
+       return math.floor(minetest.get_timeofday()*24)%24
+end
+
+function ontime_clocks.get_h12()
+       return math.floor(minetest.get_timeofday()*24)%12
+end
+
+function ontime_clocks.get_m12()
+       return math.floor(minetest.get_timeofday()*288)%12
+end
+
+function ontime_clocks.get_digital_properties(color_off, color_on, hour, minute)
+       return 
+       {
+               textures={"ontime_clocks_digital_background.png^[colorize:"..color_off
+                       .."^([combine:21x7"
+                       ..":0,"..(-7*(math.floor(hour/10))).."=ontime_clocks_digital_digit.png"
+                       ..":5,"..(-7*(hour%10)).."=ontime_clocks_digital_digit.png"
+                       ..":9,-70=ontime_clocks_digital_digit.png"
+                       ..":12,"..(-7*(math.floor(minute/2))).."=ontime_clocks_digital_digit.png"
+                       ..":17,"..(-35*(minute%2)).."=ontime_clocks_digital_digit.png"
+                       .."^[colorize:"..color_on..")"},
+               visual_size = {x=21/32, y=7/32}
+       }
+end
+
+function ontime_clocks.get_needles_properties(color, size, hour, minute)
+       return
+       {
+               textures={"[combine:"..size.."x"..size  
+                       ..":0,"..(-size*hour).."=ontime_clocks_needle_h"..size..".png"
+                       ..":0,"..(-size*minute).."=ontime_clocks_needle_m"..size..".png"
+                       .."^[colorize:"..color},
+               visual_size = {x=size/64, y=size/64}
+       }
+end
+
diff --git a/ontime_clocks/crafts.lua b/ontime_clocks/crafts.lua
new file mode 100644 (file)
index 0000000..c7e1ab6
--- /dev/null
@@ -0,0 +1,56 @@
+
+minetest.register_craft({
+       output = 'ontime_clocks:green_digital',
+       recipe = {
+               {'', 'dye:green', ''},
+               {'default:glass', 'default:mese_crystal', 'default:glass'},
+               {'', '', ''},
+       }
+})
+
+minetest.register_craft({
+       output = 'ontime_clocks:red_digital',
+       recipe = {
+               {'', 'dye:red', ''},
+               {'default:glass', 'default:mese_crystal', 'default:glass'},
+               {'', '', ''},
+       }
+})
+
+minetest.register_craft({
+       output = 'ontime_clocks:white',
+       recipe = {
+               {'default:steel_ingot', 'default:paper', 'default:steel_ingot'},
+               {'', 'default:mese_crystal', ''},
+               {'', '', ''},
+       }
+})
+
+minetest.register_craft({
+       output = 'ontime_clocks:frameless_black',
+       recipe = {
+               {'default:steel_ingot', 'dye:black', 'default:steel_ingot'},
+               {'', 'default:mese_crystal', ''},
+               {'', '', ''},
+       }
+})
+
+minetest.register_craft({
+       output = 'ontime_clocks:frameless_gold',
+       recipe = {
+               {'default:gold_ingot', '', 'default:gold_ingot'},
+               {'', 'default:mese_crystal', ''},
+               {'', '', ''},
+       }
+})
+
+minetest.register_craft({
+       output = 'ontime_clocks:frameless_white',
+       recipe = {
+               {'default:steel_ingot', 'dye:white', 'default:steel_ingot'},
+               {'', 'default:mese_crystal', ''},
+               {'', '', ''},
+       }
+})
+
+
diff --git a/ontime_clocks/depends.txt b/ontime_clocks/depends.txt
new file mode 100644 (file)
index 0000000..c1feb90
--- /dev/null
@@ -0,0 +1,3 @@
+default
+display_lib
+
diff --git a/ontime_clocks/init.lua b/ontime_clocks/init.lua
new file mode 100644 (file)
index 0000000..5210aef
--- /dev/null
@@ -0,0 +1,14 @@
+-- On time clocks mod by P.Y. Rollo
+--
+-- License: WTFPL
+
+ontime_clocks = {}
+ontime_clocks.path = minetest.get_modpath("ontime_clocks")
+
+dofile(ontime_clocks.path.."/common.lua")
+dofile(ontime_clocks.path.."/nodes.lua")
+dofile(ontime_clocks.path.."/crafts.lua")
+
+
+
+
diff --git a/ontime_clocks/nodes.lua b/ontime_clocks/nodes.lua
new file mode 100644 (file)
index 0000000..4a184e8
--- /dev/null
@@ -0,0 +1,224 @@
+-- Green digital clock
+minetest.register_node("ontime_clocks:green_digital", {
+       description = "Green digital clock",
+       inventory_image = "ontime_clocks_green_digital_inventory.png",
+       wield_image = "ontime_clocks_green_digital_inventory.png",
+       paramtype = "light",
+       paramtype2 = "wallmounted",
+       drawtype = "nodebox",
+       node_box = {
+               type = "wallmounted",
+               wall_side = { -0.5, -3/16, -7/16, -13/32, 7/32, 7/16 },
+               wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },    
+               wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } 
+       },
+       tiles = {"ontime_clocks_digital.png"},
+       groups = {oddly_breakable_by_hand=1},
+       display_entities = {
+               ["ontime_clocks:display"] = {
+                       depth = -13/32 + 0.01, 
+                       on_display_update = function(pos, objref)
+                               objref:set_properties(
+                                       ontime_clocks.get_digital_properties(
+                                               "#040", "#0F0", ontime_clocks.get_h24(), ontime_clocks.get_m12()))
+                       end },
+       },
+       on_place = display_lib.on_place,
+       on_construct = display_lib.on_construct,
+       on_destruct = display_lib.on_destruct,
+       on_rotate = display_lib.on_rotate,
+})
+
+minetest.register_abm({
+       nodenames = {"ontime_clocks:green_digital"},
+       interval = 5,
+       chance = 1,
+       action = display_lib.update_entities,
+})
+
+-- Red digital clock
+minetest.register_node("ontime_clocks:red_digital", {
+       description = "Red digital clock",
+       inventory_image = "ontime_clocks_red_digital_inventory.png",
+       wield_image = "ontime_clocks_red_digital_inventory.png",
+       paramtype = "light",
+       paramtype2 = "wallmounted",
+       drawtype = "nodebox",
+       node_box = {
+               type = "wallmounted",
+               wall_side = { -0.5, -3/16, -7/16, -13/32, 7/32, 7/16 },
+               wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },    
+               wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } 
+       },
+       tiles = {"ontime_clocks_digital.png"},
+       groups = {oddly_breakable_by_hand=1},
+       display_entities = {
+               ["ontime_clocks:display"] = {
+                       depth = -13/32 + 0.01, 
+                       on_display_update = function(pos, objref)
+                               objref:set_properties(
+                                       ontime_clocks.get_digital_properties(
+                                               "#400", "#F00", ontime_clocks.get_h24(), ontime_clocks.get_m12()))
+                       end },
+       },
+       on_place = display_lib.on_place,
+       on_construct = display_lib.on_construct,
+       on_destruct = display_lib.on_destruct,
+       on_rotate = display_lib.on_rotate,
+})
+
+minetest.register_abm({
+       nodenames = {"ontime_clocks:red_digital"},
+       interval = 5,
+       chance = 1,
+       action = display_lib.update_entities,
+})
+
+
+minetest.register_node("ontime_clocks:white", {
+       description = "White clock",
+       inventory_image = "ontime_clocks_white_inventory.png",
+       wield_image = "ontime_clocks_white_inventory.png",
+       paramtype = "light",
+       paramtype2 = "wallmounted",
+       drawtype = "nodebox",
+       node_box = {
+               type = "wallmounted",
+               wall_side = { -0.5, -7/16, -7/16, -6/16, 7/16, 7/16},
+               wall_bottom = { -7/16, -0.5, -7/16, 7/16, -7/16, 7/16},    
+               wall_top = { -7/16, 0.5, -7/16, 7/16, 7/16, 7/16},    
+       },
+       tiles = {"ontime_clocks_white.png"},
+       groups = {choppy=1,oddly_breakable_by_hand=1},
+       display_entities = { 
+               ["ontime_clocks:display"] = {
+                       depth = -6/16+0.01,
+                       on_display_update = function(pos, objref)
+                               objref:set_properties(
+                                       ontime_clocks.get_needles_properties(
+                                               "#000", 36, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
+                       end },
+       },
+       on_place = display_lib.on_place,
+       on_construct = display_lib.on_construct,
+       on_destruct = display_lib.on_destruct,
+       on_rotate = display_lib.on_rotate,
+})
+
+minetest.register_abm({
+       nodenames = {"ontime_clocks:white"},
+       interval = 5,
+       chance = 1,
+       action = display_lib.update_entities,
+})
+
+minetest.register_node("ontime_clocks:frameless_black", {
+       description = "Frameless clock",
+       inventory_image = "ontime_clocks_frameless_inventory.png",
+       wield_image = "ontime_clocks_frameless_inventory.png",
+       paramtype = "light",
+       paramtype2 = "wallmounted",
+       drawtype = "nodebox",
+       node_box = {
+               type = "wallmounted",
+               wall_side = { -0.5, -7/16, -7/16, -0.45, 7/16, 7/16 },
+               wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },    
+               wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } 
+       },
+       tiles = {"ontime_clocks_frameless.png"},
+       groups = {choppy=1,oddly_breakable_by_hand=1},
+       display_entities = { 
+               ["ontime_clocks:display"] = {
+                       depth = -7/16,
+                       on_display_update = function(pos, objref)
+                               objref:set_properties(
+                                       ontime_clocks.get_needles_properties(
+                                               "#000", 48, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
+                       end },
+       },
+       on_place = display_lib.on_place,
+       on_construct = display_lib.on_construct,
+       on_destruct = display_lib.on_destruct,
+       on_rotate = display_lib.on_rotate,
+})
+
+minetest.register_abm({
+       nodenames = {"ontime_clocks:frameless_black"},
+       interval = 5,
+       chance = 1,
+       action = display_lib.update_entities,
+})
+
+minetest.register_node("ontime_clocks:frameless_gold", {
+       description = "Frameless gold clock",
+       inventory_image = "ontime_clocks_frameless_inventory.png^[colorize:#FF0",
+       wield_image = "ontime_clocks_frameless_inventory.png^[colorize:#FF0",
+       paramtype = "light",
+       paramtype2 = "wallmounted",
+       drawtype = "nodebox",
+       node_box = {
+               type = "wallmounted",
+               wall_side = { -0.5, -7/16, -7/16, -0.45, 7/16, 7/16 },
+               wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },    
+               wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } 
+       },
+       tiles = {"ontime_clocks_frameless.png^[colorize:#FF0"},
+       groups = {choppy=1,oddly_breakable_by_hand=1},
+       display_entities = { 
+               ["ontime_clocks:display"] = {
+                       depth = -7/16,
+                       on_display_update = function(pos, objref)
+                               objref:set_properties(
+                                       ontime_clocks.get_needles_properties(
+                                               "#FF0", 48, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
+                       end },
+       },
+       on_place = display_lib.on_place,
+       on_construct = display_lib.on_construct,
+       on_destruct = display_lib.on_destruct,
+       on_rotate = display_lib.on_rotate,
+})
+
+minetest.register_abm({
+       nodenames = {"ontime_clocks:frameless_gold"},
+       interval = 5,
+       chance = 1,
+       action = display_lib.update_entities,
+})
+
+minetest.register_node("ontime_clocks:frameless_white", {
+       description = "Frameless white clock",
+       inventory_image = "ontime_clocks_frameless_inventory.png^[colorize:#FFF",
+       wield_image = "ontime_clocks_frameless_inventory.png^[colorize:#FFF",
+       paramtype = "light",
+       paramtype2 = "wallmounted",
+       drawtype = "nodebox",
+       node_box = {
+               type = "wallmounted",
+               wall_side = { -0.5, -7/16, -7/16, -0.45, 7/16, 7/16 },
+               wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },    
+               wall_top = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } 
+       },
+       tiles = {"ontime_clocks_frameless.png^[colorize:#FFF"},
+       groups = {choppy=1,oddly_breakable_by_hand=1},
+       display_entities = { 
+               ["ontime_clocks:display"] = {
+                       depth = -7/16,
+                       on_display_update = function(pos, objref)
+                               objref:set_properties(
+                                       ontime_clocks.get_needles_properties(
+                                               "#FFF", 48, ontime_clocks.get_h12(), ontime_clocks.get_m12()))
+                       end },
+       },
+       on_place = display_lib.on_place,
+       on_construct = display_lib.on_construct,
+       on_destruct = display_lib.on_destruct,
+       on_rotate = display_lib.on_rotate,
+})
+
+minetest.register_abm({
+       nodenames = {"ontime_clocks:frameless_white"},
+       interval = 5,
+       chance = 1,
+       action = display_lib.update_entities,
+})
diff --git a/ontime_clocks/textures/ontime_clocks_digital.png b/ontime_clocks/textures/ontime_clocks_digital.png
new file mode 100644 (file)
index 0000000..4b79679
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_digital.png differ
diff --git a/ontime_clocks/textures/ontime_clocks_digital_background.png b/ontime_clocks/textures/ontime_clocks_digital_background.png
new file mode 100644 (file)
index 0000000..6731145
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_digital_background.png differ
diff --git a/ontime_clocks/textures/ontime_clocks_digital_digit.png b/ontime_clocks/textures/ontime_clocks_digital_digit.png
new file mode 100644 (file)
index 0000000..7bbc4a9
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_digital_digit.png differ
diff --git a/ontime_clocks/textures/ontime_clocks_frameless.png b/ontime_clocks/textures/ontime_clocks_frameless.png
new file mode 100644 (file)
index 0000000..07c0001
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_frameless.png differ
diff --git a/ontime_clocks/textures/ontime_clocks_frameless_inventory.png b/ontime_clocks/textures/ontime_clocks_frameless_inventory.png
new file mode 100644 (file)
index 0000000..b91c93c
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_frameless_inventory.png differ
diff --git a/ontime_clocks/textures/ontime_clocks_green_digital_inventory.png b/ontime_clocks/textures/ontime_clocks_green_digital_inventory.png
new file mode 100644 (file)
index 0000000..3318f10
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_green_digital_inventory.png differ
diff --git a/ontime_clocks/textures/ontime_clocks_needle_h36.png b/ontime_clocks/textures/ontime_clocks_needle_h36.png
new file mode 100644 (file)
index 0000000..bc1845d
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_needle_h36.png differ
diff --git a/ontime_clocks/textures/ontime_clocks_needle_h48.png b/ontime_clocks/textures/ontime_clocks_needle_h48.png
new file mode 100644 (file)
index 0000000..c894ac5
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_needle_h48.png differ
diff --git a/ontime_clocks/textures/ontime_clocks_needle_m36.png b/ontime_clocks/textures/ontime_clocks_needle_m36.png
new file mode 100644 (file)
index 0000000..90bd878
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_needle_m36.png differ
diff --git a/ontime_clocks/textures/ontime_clocks_needle_m48.png b/ontime_clocks/textures/ontime_clocks_needle_m48.png
new file mode 100644 (file)
index 0000000..4c4a13c
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_needle_m48.png differ
diff --git a/ontime_clocks/textures/ontime_clocks_red_digital_inventory.png b/ontime_clocks/textures/ontime_clocks_red_digital_inventory.png
new file mode 100644 (file)
index 0000000..cfe4fe0
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_red_digital_inventory.png differ
diff --git a/ontime_clocks/textures/ontime_clocks_white.png b/ontime_clocks/textures/ontime_clocks_white.png
new file mode 100644 (file)
index 0000000..577f2d1
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_white.png differ
diff --git a/ontime_clocks/textures/ontime_clocks_white_inventory.png b/ontime_clocks/textures/ontime_clocks_white_inventory.png
new file mode 100644 (file)
index 0000000..03f7b58
Binary files /dev/null and b/ontime_clocks/textures/ontime_clocks_white_inventory.png differ
diff --git a/signs/LICENSE.txt b/signs/LICENSE.txt
new file mode 100644 (file)
index 0000000..bc06764
--- /dev/null
@@ -0,0 +1,13 @@
+          DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+                   Version 2, December 2004
+Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
+Everyone is permitted to copy and distribute verbatim or modified
+copies of this license document, and changing it is allowed as long
+as the name is changed.
+           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
diff --git a/signs/README.md b/signs/README.md
new file mode 100644 (file)
index 0000000..586dbff
--- /dev/null
@@ -0,0 +1,52 @@
+# Signs
+
+This mod provides various signs with text display. Text is locked if area is protected.
+
+**Dependancies**: display_lib, default
+
+**License**: WTFPL
+
+## Recipes
+
+**Blue Street Sign**
+
+               B W S
+               S S S
+               - - -
+
+B = Blue Dye, W = White Dye, S = Steel Ingot
+
+**Green Street Sign**
+
+               G W S
+               S S S 
+               - - -
+
+G = Green Dye, W = White Dye, S = Steel Ingot
+
+**Poster**
+
+               P P -
+               P P -
+               P P -
+
+P = Paper
+
+Poster displays only title, much more text can be read by right-clicking on it.
+
+**Wooden direction sigh**
+
+               W W W
+               W W -
+               - - -
+
+W = Wooden Plank (group)
+
+**Black direction sign**
+
+               B W S
+               S S -
+               - - -
+
+B = Black Dye, W = White Dye, S = Steel Ingot
+
diff --git a/signs/common.lua b/signs/common.lua
new file mode 100644 (file)
index 0000000..0433223
--- /dev/null
@@ -0,0 +1,217 @@
+local font = {}
+signs.font_height = 10
+
+-- Get png width, suposing png width is less than 256 (it is the case for all font textures)
+local function get_png_width(filename)
+       local file=assert(io.open(filename,"rb"))
+       -- All font png are smaller than 256x256 --> read only last byte
+       file:seek("set",19)
+       local w = file:read(1)
+       file:close()
+       return w:byte()
+end
+
+-- Computes line width for a given font height and text
+function signs.get_line_width(text)
+       local char
+       local width = 0
+
+       for p=1,#text
+       do
+               char = text:sub(p,p):byte()
+               if font[char] then
+                       width = width + font[char].width
+               end
+       end
+
+       return width
+end
+
+--- Builds texture part for a text line
+-- @param text Text to be rendered
+-- @param x Starting x position in texture
+-- @param width Width of the texture (extra text is not rendered)
+-- @param y Vertical position of the line in texture
+-- @return Texture string
+function signs.make_line_texture(text, x, width, y)
+       local char
+
+       local texture = ""
+
+       for p=1,#text
+       do
+               char = text:sub(p,p):byte()
+               if font[char] then
+                       -- Add image only if it is visible (at least partly)
+                       if x + font[char].width >= 0 and x <= width then
+                               texture = texture..string.format(":%d,%d=%s", x, y, font[char].filename)
+                       end
+                       x = x + font[char].width
+               end
+       end
+       return texture
+end
+
+local function split_lines(text, maxlines)
+       local splits = text:split("\n")
+       if maxlines then
+               local lines = {}
+               for num = 1,maxlines do
+                       lines[num] = splits[num]
+               end
+               return lines
+       else
+               return splits
+       end
+end
+
+function signs.on_display_update(pos, objref)
+       local meta = minetest.get_meta(pos)
+       local text = meta:get_string("display_text")
+
+       local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
+       if ndef and ndef.sign_model then
+               local model = signs.sign_models[ndef.sign_model]
+               local lines = split_lines(text, model.maxlines)
+
+               local texturew = model.width/model.xscale
+               local textureh = model.height/model.yscale
+
+               local texture = ""
+
+               local y
+               if model.valing == "top" then
+                       y = signs.font_height / 2
+               else            
+                       y = (textureh - signs.font_height * #lines) / 2 + 1 
+               end
+
+               for _, line in pairs(lines) do
+                       texture = texture..signs.make_line_texture(line, 
+                               (texturew - signs.get_line_width(line)) / 2, 
+                               texturew, y)
+                       y = y + signs.font_height
+               end
+
+               local texture = string.format("[combine:%dx%d", texturew, textureh)..texture
+               if model.color then texture = texture.."^[colorize:"..model.color end
+
+               objref:set_properties({ textures={texture}, visual_size = {x=model.width, y=model.height}})
+       end
+end
+
+function signs.set_formspec(pos)
+       local meta = minetest.get_meta(pos)
+       local ndef = minetest.registered_nodes[minetest.get_node(pos).name]
+       if ndef and ndef.sign_model then
+               local model = signs.sign_models[ndef.sign_model]
+               local formspec
+
+               if model.maxlines == 1 then
+                       formspec = "size[6,3]"..
+                               "field[0.5,0.7;5.5,1;display_text;Displayed text;${display_text}]"..
+                               "button_exit[2,2;2,1;ok;Write]"
+               else
+                       local extralabel = ""
+                       if model.maxlines then
+                               extralabel = " (first "..model.maxlines.." lines only)"
+                       end
+
+                       formspec = "size[6,4]"..
+                               "textarea[0.5,0.7;5.5,2;display_text;Displayed text"..extralabel..";${display_text}]"..
+                               "button_exit[2,3;2,1;ok;Write]"
+               end
+
+               meta:set_string("formspec", formspec)
+       end
+end
+
+function signs.on_receive_fields(pos, formname, fields, player)
+       if not minetest.is_protected(pos, player:get_player_name()) then
+               local meta = minetest.get_meta(pos)
+               if fields and fields.ok then
+                       meta:set_string("display_text", fields.display_text)
+                       meta:set_string("infotext", "\""..fields.display_text.."\"")
+                       display_lib.update_entities(pos)
+               end
+       end
+end
+
+-- On place callback for direction signs 
+-- (chooses which sign according to look direction)
+function signs.on_place_direction(itemstack, placer, pointed_thing)
+       local above = pointed_thing.above
+       local under = pointed_thing.under
+       local wdir = minetest.dir_to_wallmounted(
+                               {x = under.x - above.x,
+                                y = under.y - above.y,
+                                z = under.z - above.z})
+       
+       local dir = placer:get_look_dir()
+
+       if wdir == 0 or wdir == 1 then
+               wdir = minetest.dir_to_wallmounted({x=dir.x, y=0, z=dir.z})
+       end
+
+       local name = itemstack:get_name()
+
+       -- Only for direction signs (ending with _right)
+       if name:sub(-string.len("_right")) == "_right" then
+               name = name:sub(1, -string.len("_right"))
+
+               local test = {0, dir.z, -dir.z, -dir.x, dir.x}
+               if test[wdir] > 0 then
+                       itemstack:set_name(name.."left")
+               end
+               itemstack = minetest.item_place(itemstack, placer, pointed_thing, wdir)
+               itemstack:set_name(name.."right")
+
+               return itemstack
+       else
+               return minetest.item_place(itemstack, placer, pointed_thing, wdir)
+       end
+end
+
+-- On_rotate (screwdriver) callback for direction signs
+function signs.on_rotate_direction(pos, node, user, mode, new_param2)
+       if mode == screwdriver.ROTATE_AXIS then 
+               local name
+               if node.name:sub(-string.len("_right")) == "_right" then
+                       name = node.name:sub(1, -string.len("_right")).."left"
+               end
+               if node.name:sub(-string.len("_left")) == "_left" then
+                       name = node.name:sub(1, -string.len("_left")).."right"
+               end
+
+               if name then
+                       minetest.swap_node(pos, {name = name, param1 = node.param1, param2 = node.param2})
+               end
+               return false
+       else
+               return display_lib.on_rotate(pos, node, user, mode, new_param2)
+       end
+end
+
+-- Populate fonts table
+local w, filename
+for charnum=32,126 do
+       filename = string.format("signs_%02x.png", charnum)
+       w = get_png_width(signs.path.."/textures/"..filename)
+       font[charnum] = {filename=filename, width=w}
+end
+
+-- Generic callback for show_formspec displayed formspecs
+minetest.register_on_player_receive_fields(function(player, formname, fields)
+       local found, mod, node_name, pos
+       found, _, mod, node_name, pos = formname:find("([%w_]+):([%w_]+)@(.+)")
+
+       if found then
+               if mod ~= 'signs' then return end
+
+               local ndef = minetest.registered_nodes[mod..":"..node_name]
+
+               if ndef and ndef.on_receive_fields then
+                       ndef.on_receive_fields(minetest.string_to_pos(pos), formname, fields, player)
+               end
+       end
+end)
diff --git a/signs/crafts.lua b/signs/crafts.lua
new file mode 100644 (file)
index 0000000..16b873d
--- /dev/null
@@ -0,0 +1,45 @@
+minetest.register_craft({
+       output = 'signs:blue_street',
+       recipe = {
+               {'dye:blue', 'dye:white', 'default:steel_ingot'},
+               {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
+               {'', '', ''},
+       }
+})
+
+minetest.register_craft({
+       output = 'signs:green_street',
+       recipe = {
+               {'dye:green', 'dye:white', 'default:steel_ingot'},
+               {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
+               {'', '', ''},
+       }
+})
+
+minetest.register_craft({
+       output = 'signs:wooden_right',
+       recipe = {
+               {'group:wood', 'group:wood', 'group:wood'},
+               {'group:wood', 'group:wood', ''},
+               {'', '', ''},
+       }
+})
+
+minetest.register_craft({
+       output = 'signs:black_right',
+       recipe = {
+               {'dye:black', 'dye:white', 'default:steel_ingot'},
+               {'default:steel_ingot', 'default:steel_ingot', ''},
+               {'', '', ''},
+       }
+})
+
+minetest.register_craft({
+       output = 'signs:poster',
+       recipe = {
+               {'default:paper', 'default:paper', ''},
+               {'default:paper', 'default:paper', ''},
+               {'default:paper', 'default:paper', ''},
+       }
+})
+
diff --git a/signs/depends.txt b/signs/depends.txt
new file mode 100644 (file)
index 0000000..c1feb90
--- /dev/null
@@ -0,0 +1,3 @@
+default
+display_lib
+
diff --git a/signs/font.lua b/signs/font.lua
new file mode 100644 (file)
index 0000000..2da6611
--- /dev/null
@@ -0,0 +1,63 @@
+
+local font = {}
+signs.font_height = 10
+
+-- Get png width, suposing png width is less than 256 (it is the case for all font textures)
+local function get_png_width(filename)
+       local file=assert(io.open(filename,"rb"))
+       -- All font png are smaller than 256x256 --> read only last byte
+       file:seek("set",19)
+       local w = file:read(1)
+       file:close()
+       return w:byte()
+end
+
+-- Computes line width for a given font height and text
+function signs.get_line_width(text)
+       local char
+       local width = 0
+
+       for p=1,#text
+       do
+               char = text:sub(p,p):byte()
+               if font[char] then
+                       width = width + font[char].width
+               end
+       end
+
+       return width
+end
+
+--- Builds texture part for a text line
+-- @param text Text to be rendered
+-- @param x Starting x position in texture
+-- @param width Width of the texture (extra text is not rendered)
+-- @param y Vertical position of the line in texture
+-- @return Texture string
+function signs.make_line_texture(text, x, width, y)
+       local char
+
+       local texture = ""
+
+       for p=1,#text
+       do
+               char = text:sub(p,p):byte()
+               if font[char] then
+                       -- Add image only if it is visible (at least partly)
+                       if x + font[char].width >= 0 and x <= width then
+                               texture = texture..string.format(":%d,%d=%s", x, y, font[char].filename)
+                       end
+                       x = x + font[char].width
+               end
+       end
+       return texture
+end
+
+-- Populate fonts table
+local w, filename
+for charnum=32,126 do
+       filename = string.format("signs_%02x.png", charnum)
+       w = get_png_width(signs.path.."/textures/"..filename)
+       font[charnum] = {filename=filename, width=w}
+end
+
diff --git a/signs/init.lua b/signs/init.lua
new file mode 100644 (file)
index 0000000..81d3a5b
--- /dev/null
@@ -0,0 +1,15 @@
+-- Signs mod by P.Y. Rollo
+--
+-- License: WTFPL
+
+signs = {}
+signs.path = minetest.get_modpath("signs")
+
+dofile(signs.path.."/common.lua")
+dofile(signs.path.."/nodes.lua")
+dofile(signs.path.."/crafts.lua")
+
+
+
+
+
diff --git a/signs/nodes.lua b/signs/nodes.lua
new file mode 100644 (file)
index 0000000..77d8925
--- /dev/null
@@ -0,0 +1,203 @@
+-- Poster specific formspec
+local function on_rightclick_poster(pos, node, player)
+       local formspec
+       local meta = minetest.get_meta(pos)
+       if not minetest.is_protected(pos, player:get_player_name()) then
+               formspec =
+                       "size[6.5,7.5]"..
+                       "field[0.5,0.7;6,1;display_text;Title;"..minetest.formspec_escape(meta:get_string("display_text")).."]"..
+                       "textarea[0.5,1.7;6,6;text;Text;"..minetest.formspec_escape(meta:get_string("text")).."]"..
+                       "button_exit[2,7;2,1;ok;Write]"
+               minetest.show_formspec(player:get_player_name(),
+                       "signs:poster@"..minetest.pos_to_string(pos),
+                       formspec)
+       else
+               formspec = "size[8,9]"..
+                       "size[6.5,7.5]"..
+                       "label[0.5,0;"..minetest.formspec_escape(meta:get_string("display_text")).."]"..
+                       "textarea[0.5,1;6,7;;"..minetest.formspec_escape(meta:get_string("text"))..";]"..
+                       "bgcolor[#111]"..
+                       "button_exit[2,7;2,1;ok;Close]"
+               minetest.show_formspec(player:get_player_name(),
+                       "",
+                       formspec)
+       end
+
+end
+
+-- Poster specific on_receive_fields callback
+local function on_receive_fields_poster(pos, formname, fields, player)
+       local meta = minetest.get_meta(pos)
+       if not minetest.is_protected(pos, player:get_player_name()) then
+               if fields and fields.ok then
+                       meta:set_string("display_text", fields.display_text)
+                       meta:set_string("text", fields.text)
+                       meta:set_string("infotext", "\""..fields.display_text
+                                       .."\"\n(right-click to read more text)")
+                       display_lib.update_entities(pos)
+               end
+       end
+end
+
+signs.sign_models = {
+       blue_street={
+               depth=1/16,
+               width=14/16,
+               height=12/16,
+               color="#fff",
+               maxlines = 3,
+               xscale = 1/144,
+               yscale = 1/64,
+               fields = {
+                       description="Blue street sign",
+                       tiles={"signs_blue_street.png"},
+                       inventory_image="signs_blue_street_inventory.png",
+               },
+       },
+       green_street={
+               depth=1/32,
+               width=1,
+               height=6/16,
+               color="#fff",
+               maxlines = 1,
+               xscale = 1/96,
+               yscale = 1/64,
+               fields = {
+                       description="Green street sign",
+                       tiles={"signs_green_street.png"},
+                       inventory_image="signs_green_street_inventory.png",
+               },
+       },
+       wooden_right={
+               depth=1/16,
+               width=14/16,
+               height=7/16,
+               color="#000",
+               maxlines = 2,
+               xscale = 1/112,
+               yscale = 1/64,
+               fields = {
+                       description="Wooden direction sign",
+                       tiles={"signs_wooden_right.png"},
+                       inventory_image="signs_wooden_inventory.png",
+                       on_place=signs.on_place_direction,
+                       on_rotate=signs.on_rotate_direction,
+
+               },
+       },
+       wooden_left={
+               depth=1/16,
+               width=14/16,
+               height=7/16,
+               color="#000",
+               maxlines = 2,
+               xscale = 1/112,
+               yscale = 1/64,
+               fields = {
+                       description="Wooden direction sign",
+                       tiles={"signs_wooden_left.png"},
+                       inventory_image="signs_wooden_inventory.png",
+                       groups={choppy=1,oddly_breakable_by_hand=1,not_in_creative_inventory=1},
+                       drop="signs:wooden_right",
+                       on_place=signs.on_place_direction,
+                       on_rotate=signs.on_rotate_direction,
+               },
+       },
+       black_right={
+               depth=1/32,
+               width=1,
+               height=0.5,
+               color="#000",
+               maxlines = 1,
+               xscale = 1/96,
+               yscale = 1/64,
+               fields = {
+                       description="Black direction sign",
+                       tiles={"signs_black_right.png"},
+                       inventory_image="signs_black_inventory.png",
+                       on_place=signs.on_place_direction,
+                       on_rotate=signs.on_rotate_direction,
+               },
+       },
+       black_left={
+               depth=1/32,
+               width=1,
+               height=0.5,
+               color="#000",
+               maxlines = 1,
+               xscale = 1/96,
+               yscale = 1/64,
+               fields = {
+                       description="Black direction sign",
+                       tiles={"signs_black_left.png"},
+                       inventory_image="signs_black_inventory.png",
+                       groups={choppy=1,oddly_breakable_by_hand=1,not_in_creative_inventory=1},
+                       drop="signs:black_right",
+                       on_place=signs.on_place_direction,
+                       on_rotate=signs.on_rotate_direction,
+               },
+       },
+       poster={
+               depth=1/32,
+               width=26/32,
+               height=30/32,
+               color="#000",
+               valing="top",
+               maxlines = 1,
+               xscale = 1/144,
+               yscale = 1/64,
+               fields = {
+                       description="Poster",
+                       tiles={"signs_poster.png"},
+                       inventory_image="signs_poster_inventory.png",
+                       on_construct=display_lib.on_construct,
+                       on_rightclick=on_rightclick_poster,
+                       on_receive_fields=on_receive_fields_poster,
+               },
+       },
+}
+
+display_lib.register_display_entity("signs:text")
+
+for model_name, model in pairs(signs.sign_models)
+do
+       local fields = {
+               sunlight_propagates = true,
+               paramtype = "light",
+               paramtype2 = "wallmounted",
+               drawtype = "nodebox",
+               node_box = {
+                       type = "wallmounted",
+                       wall_side = {-0.5, -model.height/2, -model.width/2, 
+                                            -0.5 + model.depth, model.height/2, model.width/2},
+                       wall_bottom = {-model.width/2, -0.5, -model.height/2,
+                                                  model.width/2, -0.5 + model.depth, model.height/2},
+                       wall_top = {-model.width/2, 0.5, -model.height/2,
+                                                  model.width/2, 0.5 - model.depth, model.height/2}, 
+               },
+               groups = {choppy=1,oddly_breakable_by_hand=1},
+               sign_model = model_name,
+               display_entities = { 
+                       ["signs:text"] = {
+                                       depth = model.depth-0.499,
+                                       on_display_update = signs.on_display_update },
+               },
+               on_place = display_lib.on_place,
+               on_construct =  function(pos)
+                                                       signs.set_formspec(pos)
+                                                       display_lib.on_construct(pos)
+                                               end,
+               on_destruct = display_lib.on_destruct,
+               on_rotate = display_lib.on_rotate,
+               on_receive_fields = signs.on_receive_fields,
+       }
+
+       for key, value in pairs(model.fields) do
+               fields[key] = value
+       end
+
+       if not fields.wield_image then fields.wield_image = fields.inventory_image end
+
+       minetest.register_node("signs:"..model_name, fields)
+end
+
diff --git a/signs/textures/signs_20.png b/signs/textures/signs_20.png
new file mode 100644 (file)
index 0000000..43df9d1
Binary files /dev/null and b/signs/textures/signs_20.png differ
diff --git a/signs/textures/signs_21.png b/signs/textures/signs_21.png
new file mode 100644 (file)
index 0000000..b927105
Binary files /dev/null and b/signs/textures/signs_21.png differ
diff --git a/signs/textures/signs_22.png b/signs/textures/signs_22.png
new file mode 100644 (file)
index 0000000..fae7109
Binary files /dev/null and b/signs/textures/signs_22.png differ
diff --git a/signs/textures/signs_23.png b/signs/textures/signs_23.png
new file mode 100644 (file)
index 0000000..0995756
Binary files /dev/null and b/signs/textures/signs_23.png differ
diff --git a/signs/textures/signs_24.png b/signs/textures/signs_24.png
new file mode 100644 (file)
index 0000000..18b37d9
Binary files /dev/null and b/signs/textures/signs_24.png differ
diff --git a/signs/textures/signs_25.png b/signs/textures/signs_25.png
new file mode 100644 (file)
index 0000000..83737d3
Binary files /dev/null and b/signs/textures/signs_25.png differ
diff --git a/signs/textures/signs_26.png b/signs/textures/signs_26.png
new file mode 100644 (file)
index 0000000..94357c4
Binary files /dev/null and b/signs/textures/signs_26.png differ
diff --git a/signs/textures/signs_27.png b/signs/textures/signs_27.png
new file mode 100644 (file)
index 0000000..cd4426c
Binary files /dev/null and b/signs/textures/signs_27.png differ
diff --git a/signs/textures/signs_28.png b/signs/textures/signs_28.png
new file mode 100644 (file)
index 0000000..66fd16e
Binary files /dev/null and b/signs/textures/signs_28.png differ
diff --git a/signs/textures/signs_29.png b/signs/textures/signs_29.png
new file mode 100644 (file)
index 0000000..324d1d2
Binary files /dev/null and b/signs/textures/signs_29.png differ
diff --git a/signs/textures/signs_2a.png b/signs/textures/signs_2a.png
new file mode 100644 (file)
index 0000000..27bafea
Binary files /dev/null and b/signs/textures/signs_2a.png differ
diff --git a/signs/textures/signs_2b.png b/signs/textures/signs_2b.png
new file mode 100644 (file)
index 0000000..28a8c7f
Binary files /dev/null and b/signs/textures/signs_2b.png differ
diff --git a/signs/textures/signs_2c.png b/signs/textures/signs_2c.png
new file mode 100644 (file)
index 0000000..16bf1e4
Binary files /dev/null and b/signs/textures/signs_2c.png differ
diff --git a/signs/textures/signs_2d.png b/signs/textures/signs_2d.png
new file mode 100644 (file)
index 0000000..b555ad6
Binary files /dev/null and b/signs/textures/signs_2d.png differ
diff --git a/signs/textures/signs_2e.png b/signs/textures/signs_2e.png
new file mode 100644 (file)
index 0000000..cdfa677
Binary files /dev/null and b/signs/textures/signs_2e.png differ
diff --git a/signs/textures/signs_2f.png b/signs/textures/signs_2f.png
new file mode 100644 (file)
index 0000000..e76fdf4
Binary files /dev/null and b/signs/textures/signs_2f.png differ
diff --git a/signs/textures/signs_30.png b/signs/textures/signs_30.png
new file mode 100644 (file)
index 0000000..5a57af3
Binary files /dev/null and b/signs/textures/signs_30.png differ
diff --git a/signs/textures/signs_31.png b/signs/textures/signs_31.png
new file mode 100644 (file)
index 0000000..3b8ebf0
Binary files /dev/null and b/signs/textures/signs_31.png differ
diff --git a/signs/textures/signs_32.png b/signs/textures/signs_32.png
new file mode 100644 (file)
index 0000000..9a869a8
Binary files /dev/null and b/signs/textures/signs_32.png differ
diff --git a/signs/textures/signs_33.png b/signs/textures/signs_33.png
new file mode 100644 (file)
index 0000000..0bbaf59
Binary files /dev/null and b/signs/textures/signs_33.png differ
diff --git a/signs/textures/signs_34.png b/signs/textures/signs_34.png
new file mode 100644 (file)
index 0000000..f6dfe63
Binary files /dev/null and b/signs/textures/signs_34.png differ
diff --git a/signs/textures/signs_35.png b/signs/textures/signs_35.png
new file mode 100644 (file)
index 0000000..71a9883
Binary files /dev/null and b/signs/textures/signs_35.png differ
diff --git a/signs/textures/signs_36.png b/signs/textures/signs_36.png
new file mode 100644 (file)
index 0000000..6553bed
Binary files /dev/null and b/signs/textures/signs_36.png differ
diff --git a/signs/textures/signs_37.png b/signs/textures/signs_37.png
new file mode 100644 (file)
index 0000000..53b9541
Binary files /dev/null and b/signs/textures/signs_37.png differ
diff --git a/signs/textures/signs_38.png b/signs/textures/signs_38.png
new file mode 100644 (file)
index 0000000..0933814
Binary files /dev/null and b/signs/textures/signs_38.png differ
diff --git a/signs/textures/signs_39.png b/signs/textures/signs_39.png
new file mode 100644 (file)
index 0000000..94dae88
Binary files /dev/null and b/signs/textures/signs_39.png differ
diff --git a/signs/textures/signs_3a.png b/signs/textures/signs_3a.png
new file mode 100644 (file)
index 0000000..09b4793
Binary files /dev/null and b/signs/textures/signs_3a.png differ
diff --git a/signs/textures/signs_3b.png b/signs/textures/signs_3b.png
new file mode 100644 (file)
index 0000000..8f9076b
Binary files /dev/null and b/signs/textures/signs_3b.png differ
diff --git a/signs/textures/signs_3c.png b/signs/textures/signs_3c.png
new file mode 100644 (file)
index 0000000..a5313c9
Binary files /dev/null and b/signs/textures/signs_3c.png differ
diff --git a/signs/textures/signs_3d.png b/signs/textures/signs_3d.png
new file mode 100644 (file)
index 0000000..153c272
Binary files /dev/null and b/signs/textures/signs_3d.png differ
diff --git a/signs/textures/signs_3e.png b/signs/textures/signs_3e.png
new file mode 100644 (file)
index 0000000..ced7868
Binary files /dev/null and b/signs/textures/signs_3e.png differ
diff --git a/signs/textures/signs_3f.png b/signs/textures/signs_3f.png
new file mode 100644 (file)
index 0000000..3dfc73b
Binary files /dev/null and b/signs/textures/signs_3f.png differ
diff --git a/signs/textures/signs_40.png b/signs/textures/signs_40.png
new file mode 100644 (file)
index 0000000..65dc19f
Binary files /dev/null and b/signs/textures/signs_40.png differ
diff --git a/signs/textures/signs_41.png b/signs/textures/signs_41.png
new file mode 100644 (file)
index 0000000..0d74cdb
Binary files /dev/null and b/signs/textures/signs_41.png differ
diff --git a/signs/textures/signs_42.png b/signs/textures/signs_42.png
new file mode 100644 (file)
index 0000000..7432e5f
Binary files /dev/null and b/signs/textures/signs_42.png differ
diff --git a/signs/textures/signs_43.png b/signs/textures/signs_43.png
new file mode 100644 (file)
index 0000000..5a2e165
Binary files /dev/null and b/signs/textures/signs_43.png differ
diff --git a/signs/textures/signs_44.png b/signs/textures/signs_44.png
new file mode 100644 (file)
index 0000000..f2c4d07
Binary files /dev/null and b/signs/textures/signs_44.png differ
diff --git a/signs/textures/signs_45.png b/signs/textures/signs_45.png
new file mode 100644 (file)
index 0000000..de77e41
Binary files /dev/null and b/signs/textures/signs_45.png differ
diff --git a/signs/textures/signs_46.png b/signs/textures/signs_46.png
new file mode 100644 (file)
index 0000000..a19af77
Binary files /dev/null and b/signs/textures/signs_46.png differ
diff --git a/signs/textures/signs_47.png b/signs/textures/signs_47.png
new file mode 100644 (file)
index 0000000..30c6818
Binary files /dev/null and b/signs/textures/signs_47.png differ
diff --git a/signs/textures/signs_48.png b/signs/textures/signs_48.png
new file mode 100644 (file)
index 0000000..e49cee4
Binary files /dev/null and b/signs/textures/signs_48.png differ
diff --git a/signs/textures/signs_49.png b/signs/textures/signs_49.png
new file mode 100644 (file)
index 0000000..534500b
Binary files /dev/null and b/signs/textures/signs_49.png differ
diff --git a/signs/textures/signs_4a.png b/signs/textures/signs_4a.png
new file mode 100644 (file)
index 0000000..5575e6d
Binary files /dev/null and b/signs/textures/signs_4a.png differ
diff --git a/signs/textures/signs_4b.png b/signs/textures/signs_4b.png
new file mode 100644 (file)
index 0000000..0afb35d
Binary files /dev/null and b/signs/textures/signs_4b.png differ
diff --git a/signs/textures/signs_4c.png b/signs/textures/signs_4c.png
new file mode 100644 (file)
index 0000000..99af40d
Binary files /dev/null and b/signs/textures/signs_4c.png differ
diff --git a/signs/textures/signs_4d.png b/signs/textures/signs_4d.png
new file mode 100644 (file)
index 0000000..14648ed
Binary files /dev/null and b/signs/textures/signs_4d.png differ
diff --git a/signs/textures/signs_4e.png b/signs/textures/signs_4e.png
new file mode 100644 (file)
index 0000000..57abfbb
Binary files /dev/null and b/signs/textures/signs_4e.png differ
diff --git a/signs/textures/signs_4f.png b/signs/textures/signs_4f.png
new file mode 100644 (file)
index 0000000..06e0c8d
Binary files /dev/null and b/signs/textures/signs_4f.png differ
diff --git a/signs/textures/signs_50.png b/signs/textures/signs_50.png
new file mode 100644 (file)
index 0000000..fba27a0
Binary files /dev/null and b/signs/textures/signs_50.png differ
diff --git a/signs/textures/signs_51.png b/signs/textures/signs_51.png
new file mode 100644 (file)
index 0000000..081e272
Binary files /dev/null and b/signs/textures/signs_51.png differ
diff --git a/signs/textures/signs_52.png b/signs/textures/signs_52.png
new file mode 100644 (file)
index 0000000..12fe421
Binary files /dev/null and b/signs/textures/signs_52.png differ
diff --git a/signs/textures/signs_53.png b/signs/textures/signs_53.png
new file mode 100644 (file)
index 0000000..7e1bbe0
Binary files /dev/null and b/signs/textures/signs_53.png differ
diff --git a/signs/textures/signs_54.png b/signs/textures/signs_54.png
new file mode 100644 (file)
index 0000000..f50a8b8
Binary files /dev/null and b/signs/textures/signs_54.png differ
diff --git a/signs/textures/signs_55.png b/signs/textures/signs_55.png
new file mode 100644 (file)
index 0000000..4682223
Binary files /dev/null and b/signs/textures/signs_55.png differ
diff --git a/signs/textures/signs_56.png b/signs/textures/signs_56.png
new file mode 100644 (file)
index 0000000..c8a55c4
Binary files /dev/null and b/signs/textures/signs_56.png differ
diff --git a/signs/textures/signs_57.png b/signs/textures/signs_57.png
new file mode 100644 (file)
index 0000000..419191c
Binary files /dev/null and b/signs/textures/signs_57.png differ
diff --git a/signs/textures/signs_58.png b/signs/textures/signs_58.png
new file mode 100644 (file)
index 0000000..1175a0e
Binary files /dev/null and b/signs/textures/signs_58.png differ
diff --git a/signs/textures/signs_59.png b/signs/textures/signs_59.png
new file mode 100644 (file)
index 0000000..9a52397
Binary files /dev/null and b/signs/textures/signs_59.png differ
diff --git a/signs/textures/signs_5a.png b/signs/textures/signs_5a.png
new file mode 100644 (file)
index 0000000..64c1c4f
Binary files /dev/null and b/signs/textures/signs_5a.png differ
diff --git a/signs/textures/signs_5b.png b/signs/textures/signs_5b.png
new file mode 100644 (file)
index 0000000..c360403
Binary files /dev/null and b/signs/textures/signs_5b.png differ
diff --git a/signs/textures/signs_5c.png b/signs/textures/signs_5c.png
new file mode 100644 (file)
index 0000000..08cf8b6
Binary files /dev/null and b/signs/textures/signs_5c.png differ
diff --git a/signs/textures/signs_5d.png b/signs/textures/signs_5d.png
new file mode 100644 (file)
index 0000000..2309ee8
Binary files /dev/null and b/signs/textures/signs_5d.png differ
diff --git a/signs/textures/signs_5e.png b/signs/textures/signs_5e.png
new file mode 100644 (file)
index 0000000..60a1dbd
Binary files /dev/null and b/signs/textures/signs_5e.png differ
diff --git a/signs/textures/signs_5f.png b/signs/textures/signs_5f.png
new file mode 100644 (file)
index 0000000..e7a4d90
Binary files /dev/null and b/signs/textures/signs_5f.png differ
diff --git a/signs/textures/signs_60.png b/signs/textures/signs_60.png
new file mode 100644 (file)
index 0000000..cd2b1ef
Binary files /dev/null and b/signs/textures/signs_60.png differ
diff --git a/signs/textures/signs_61.png b/signs/textures/signs_61.png
new file mode 100644 (file)
index 0000000..874433d
Binary files /dev/null and b/signs/textures/signs_61.png differ
diff --git a/signs/textures/signs_62.png b/signs/textures/signs_62.png
new file mode 100644 (file)
index 0000000..f29b709
Binary files /dev/null and b/signs/textures/signs_62.png differ
diff --git a/signs/textures/signs_63.png b/signs/textures/signs_63.png
new file mode 100644 (file)
index 0000000..6d46292
Binary files /dev/null and b/signs/textures/signs_63.png differ
diff --git a/signs/textures/signs_64.png b/signs/textures/signs_64.png
new file mode 100644 (file)
index 0000000..30e4497
Binary files /dev/null and b/signs/textures/signs_64.png differ
diff --git a/signs/textures/signs_65.png b/signs/textures/signs_65.png
new file mode 100644 (file)
index 0000000..8644032
Binary files /dev/null and b/signs/textures/signs_65.png differ
diff --git a/signs/textures/signs_66.png b/signs/textures/signs_66.png
new file mode 100644 (file)
index 0000000..5d4f4b9
Binary files /dev/null and b/signs/textures/signs_66.png differ
diff --git a/signs/textures/signs_67.png b/signs/textures/signs_67.png
new file mode 100644 (file)
index 0000000..990e8e3
Binary files /dev/null and b/signs/textures/signs_67.png differ
diff --git a/signs/textures/signs_68.png b/signs/textures/signs_68.png
new file mode 100644 (file)
index 0000000..6b936aa
Binary files /dev/null and b/signs/textures/signs_68.png differ
diff --git a/signs/textures/signs_69.png b/signs/textures/signs_69.png
new file mode 100644 (file)
index 0000000..3251e2e
Binary files /dev/null and b/signs/textures/signs_69.png differ
diff --git a/signs/textures/signs_6a.png b/signs/textures/signs_6a.png
new file mode 100644 (file)
index 0000000..1e0082c
Binary files /dev/null and b/signs/textures/signs_6a.png differ
diff --git a/signs/textures/signs_6b.png b/signs/textures/signs_6b.png
new file mode 100644 (file)
index 0000000..788c3df
Binary files /dev/null and b/signs/textures/signs_6b.png differ
diff --git a/signs/textures/signs_6c.png b/signs/textures/signs_6c.png
new file mode 100644 (file)
index 0000000..534500b
Binary files /dev/null and b/signs/textures/signs_6c.png differ
diff --git a/signs/textures/signs_6d.png b/signs/textures/signs_6d.png
new file mode 100644 (file)
index 0000000..fca6d31
Binary files /dev/null and b/signs/textures/signs_6d.png differ
diff --git a/signs/textures/signs_6e.png b/signs/textures/signs_6e.png
new file mode 100644 (file)
index 0000000..10930a1
Binary files /dev/null and b/signs/textures/signs_6e.png differ
diff --git a/signs/textures/signs_6f.png b/signs/textures/signs_6f.png
new file mode 100644 (file)
index 0000000..f4aef64
Binary files /dev/null and b/signs/textures/signs_6f.png differ
diff --git a/signs/textures/signs_70.png b/signs/textures/signs_70.png
new file mode 100644 (file)
index 0000000..dac5f79
Binary files /dev/null and b/signs/textures/signs_70.png differ
diff --git a/signs/textures/signs_71.png b/signs/textures/signs_71.png
new file mode 100644 (file)
index 0000000..cc31972
Binary files /dev/null and b/signs/textures/signs_71.png differ
diff --git a/signs/textures/signs_72.png b/signs/textures/signs_72.png
new file mode 100644 (file)
index 0000000..d8dbcee
Binary files /dev/null and b/signs/textures/signs_72.png differ
diff --git a/signs/textures/signs_73.png b/signs/textures/signs_73.png
new file mode 100644 (file)
index 0000000..60911df
Binary files /dev/null and b/signs/textures/signs_73.png differ
diff --git a/signs/textures/signs_74.png b/signs/textures/signs_74.png
new file mode 100644 (file)
index 0000000..079e2f1
Binary files /dev/null and b/signs/textures/signs_74.png differ
diff --git a/signs/textures/signs_75.png b/signs/textures/signs_75.png
new file mode 100644 (file)
index 0000000..c86aaad
Binary files /dev/null and b/signs/textures/signs_75.png differ
diff --git a/signs/textures/signs_76.png b/signs/textures/signs_76.png
new file mode 100644 (file)
index 0000000..5101584
Binary files /dev/null and b/signs/textures/signs_76.png differ
diff --git a/signs/textures/signs_77.png b/signs/textures/signs_77.png
new file mode 100644 (file)
index 0000000..d2bdb98
Binary files /dev/null and b/signs/textures/signs_77.png differ
diff --git a/signs/textures/signs_78.png b/signs/textures/signs_78.png
new file mode 100644 (file)
index 0000000..20927d9
Binary files /dev/null and b/signs/textures/signs_78.png differ
diff --git a/signs/textures/signs_79.png b/signs/textures/signs_79.png
new file mode 100644 (file)
index 0000000..15a76a7
Binary files /dev/null and b/signs/textures/signs_79.png differ
diff --git a/signs/textures/signs_7a.png b/signs/textures/signs_7a.png
new file mode 100644 (file)
index 0000000..43a1f05
Binary files /dev/null and b/signs/textures/signs_7a.png differ
diff --git a/signs/textures/signs_7b.png b/signs/textures/signs_7b.png
new file mode 100644 (file)
index 0000000..08c27a1
Binary files /dev/null and b/signs/textures/signs_7b.png differ
diff --git a/signs/textures/signs_7c.png b/signs/textures/signs_7c.png
new file mode 100644 (file)
index 0000000..db5bdb3
Binary files /dev/null and b/signs/textures/signs_7c.png differ
diff --git a/signs/textures/signs_7d.png b/signs/textures/signs_7d.png
new file mode 100644 (file)
index 0000000..52a64af
Binary files /dev/null and b/signs/textures/signs_7d.png differ
diff --git a/signs/textures/signs_7e.png b/signs/textures/signs_7e.png
new file mode 100644 (file)
index 0000000..8a9a865
Binary files /dev/null and b/signs/textures/signs_7e.png differ
diff --git a/signs/textures/signs_black_inventory.png b/signs/textures/signs_black_inventory.png
new file mode 100644 (file)
index 0000000..4b10ee3
Binary files /dev/null and b/signs/textures/signs_black_inventory.png differ
diff --git a/signs/textures/signs_black_left.png b/signs/textures/signs_black_left.png
new file mode 100644 (file)
index 0000000..8837dcb
Binary files /dev/null and b/signs/textures/signs_black_left.png differ
diff --git a/signs/textures/signs_black_right.png b/signs/textures/signs_black_right.png
new file mode 100644 (file)
index 0000000..0951da0
Binary files /dev/null and b/signs/textures/signs_black_right.png differ
diff --git a/signs/textures/signs_blue_street.png b/signs/textures/signs_blue_street.png
new file mode 100644 (file)
index 0000000..540a390
Binary files /dev/null and b/signs/textures/signs_blue_street.png differ
diff --git a/signs/textures/signs_blue_street_inventory.png b/signs/textures/signs_blue_street_inventory.png
new file mode 100644 (file)
index 0000000..a702669
Binary files /dev/null and b/signs/textures/signs_blue_street_inventory.png differ
diff --git a/signs/textures/signs_green_street.png b/signs/textures/signs_green_street.png
new file mode 100644 (file)
index 0000000..b5c653d
Binary files /dev/null and b/signs/textures/signs_green_street.png differ
diff --git a/signs/textures/signs_green_street_inventory.png b/signs/textures/signs_green_street_inventory.png
new file mode 100644 (file)
index 0000000..6c2a52c
Binary files /dev/null and b/signs/textures/signs_green_street_inventory.png differ
diff --git a/signs/textures/signs_poster.png b/signs/textures/signs_poster.png
new file mode 100644 (file)
index 0000000..92a3144
Binary files /dev/null and b/signs/textures/signs_poster.png differ
diff --git a/signs/textures/signs_poster_inventory.png b/signs/textures/signs_poster_inventory.png
new file mode 100644 (file)
index 0000000..e73a85b
Binary files /dev/null and b/signs/textures/signs_poster_inventory.png differ
diff --git a/signs/textures/signs_wooden_inventory.png b/signs/textures/signs_wooden_inventory.png
new file mode 100644 (file)
index 0000000..e93ebe2
Binary files /dev/null and b/signs/textures/signs_wooden_inventory.png differ
diff --git a/signs/textures/signs_wooden_left.png b/signs/textures/signs_wooden_left.png
new file mode 100644 (file)
index 0000000..a3b6600
Binary files /dev/null and b/signs/textures/signs_wooden_left.png differ
diff --git a/signs/textures/signs_wooden_right.png b/signs/textures/signs_wooden_right.png
new file mode 100644 (file)
index 0000000..8d62376
Binary files /dev/null and b/signs/textures/signs_wooden_right.png differ