summaryrefslogtreecommitdiff
path: root/infrastructure
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2016-01-14 13:50:52 -0600
committercheapie <no-email-for-you@example.com>2016-01-14 13:50:52 -0600
commit0695a956efe168fa7e9349e660f6bc810c4f93ca (patch)
treeb6485b74978c2e4e4ec23de6e2a2c0f3d6ec4d5c /infrastructure
parent425fefd4812356d5a356a6ec0edeefd066fa0616 (diff)
downloadroads-0695a956efe168fa7e9349e660f6bc810c4f93ca.tar
roads-0695a956efe168fa7e9349e660f6bc810c4f93ca.tar.gz
roads-0695a956efe168fa7e9349e660f6bc810c4f93ca.tar.bz2
roads-0695a956efe168fa7e9349e660f6bc810c4f93ca.tar.xz
roads-0695a956efe168fa7e9349e660f6bc810c4f93ca.zip
Convert warning light to animated textures
Diffstat (limited to 'infrastructure')
-rw-r--r--infrastructure/advanced_warning_light.lua140
-rw-r--r--infrastructure/textures/infrastructure_warning_light_front_anim.pngbin0 -> 1219 bytes
-rw-r--r--infrastructure/textures/infrastructure_warning_light_front_bright.pngbin969 -> 0 bytes
-rw-r--r--infrastructure/textures/infrastructure_warning_light_front_dark.pngbin464 -> 0 bytes
4 files changed, 45 insertions, 95 deletions
diff --git a/infrastructure/advanced_warning_light.lua b/infrastructure/advanced_warning_light.lua
index 67ced44..0ed5b62 100644
--- a/infrastructure/advanced_warning_light.lua
+++ b/infrastructure/advanced_warning_light.lua
@@ -1,97 +1,47 @@
-- Warning light
- minetest.register_abm( {
- nodenames = {"infrastructure:warning_light_bright", "infrastructure:warning_light_dark"},
- interval = 2,
- chance = 1,
- action = function(pos, node)
- local node = minetest.env:get_node(pos)
- if node.name == "infrastructure:warning_light_bright" then
- minetest.swap_node(pos, {name = "infrastructure:warning_light_dark", param2 = node.param2})
- elseif node.name == "infrastructure:warning_light_dark" then
- minetest.swap_node(pos, {name = "infrastructure:warning_light_bright", param2 = node.param2})
- end
- end
- })
- minetest.register_node("infrastructure:warning_light_bright", {
- description = "Warning light",
- tiles = {
- "infrastructure_warning_light_top.png",
- "infrastructure_warning_light_bottom.png",
- "infrastructure_warning_light_right.png",
- "infrastructure_warning_light_left.png",
- "infrastructure_warning_light_back.png",
- "infrastructure_warning_light_front_bright.png"
- },
- drawtype = "nodebox",
- paramtype = "light",
- paramtype2 = "facedir",
- groups = {cracky = 1},
- light_source = WARNING_LIGHT_LIGHT_RANGE,
- node_box = {
- type = "fixed",
- fixed = {
- {-5/16, -3/8, 0, 5/16, 0, 0},
-
- {-1/4, -5/16, 0, 0, -1/16, 1/8},
-
- {1/16, -1/2, -1/8, 5/16, -1/4, 1/8},
-
- {-1/16, -1/2, -1/16, 1/16, -3/8, 1/16}
- }
- },
- selection_box = {
- type = "fixed",
- fixed = {
- {-5/16, -3/8, 0, 5/16, 0, 0},
-
- {-1/4, -5/16, 0 + 0.01, 0, -1/16, 1/8},
-
- {1/16, -1/2, -1/8, 5/16, -1/4, 1/8},
-
- {-1/16, -1/2, -1/16, 1/16, -3/8, 1/16}
- }
- }
- })
-
- minetest.register_node("infrastructure:warning_light_dark", {
- tiles = {
- "infrastructure_warning_light_top.png",
- "infrastructure_warning_light_bottom.png",
- "infrastructure_warning_light_right.png",
- "infrastructure_warning_light_left.png",
- "infrastructure_warning_light_back.png",
- "infrastructure_warning_light_front_dark.png"
- },
- drawtype = "nodebox",
- paramtype = "light",
- paramtype2 = "facedir",
- groups = {cracky = 1, not_in_creative_inventory = 1},
- drop = "infrastructure:warning_light_bright",
- node_box = {
- type = "fixed",
- fixed = {
- {-5/16, -3/8, 0, 5/16, 0, 0},
-
- {-1/4, -5/16, 0, 0, -1/16, 1/8},
-
- {1/16, -1/2, -1/8, 5/16, -1/4, 1/8},
-
- {-1/16, -1/2, -1/16, 1/16, -3/8, 1/16}
- }
- },
- selection_box = {
- type = "fixed",
- fixed = {
- {-5/16, -3/8, 0, 5/16, 0, 0},
-
- {-1/4, -5/16, 0 + 0.01, 0, -1/16, 1/8},
-
- {1/16, -1/2, -1/8, 5/16, -1/4, 1/8},
-
- {-1/16, -1/2, -1/16, 1/16, -3/8, 1/16}
- }
- }
- })
-
- minetest.register_alias("infrastructure:warning_light", "infrastructure:warning_light_bright")
+minetest.register_node("infrastructure:warning_light", {
+ description = "Warning light",
+ tiles = {
+ "infrastructure_warning_light_top.png",
+ "infrastructure_warning_light_bottom.png",
+ "infrastructure_warning_light_right.png",
+ "infrastructure_warning_light_left.png",
+ "infrastructure_warning_light_back.png",
+ {name="infrastructure_warning_light_front_anim.png",animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=3}},
+ },
+ drawtype = "nodebox",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ groups = {cracky = 1},
+ light_source = WARNING_LIGHT_LIGHT_RANGE,
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-5/16, -3/8, 0, 5/16, 0, 0},
+
+ {-1/4, -5/16, 0, 0, -1/16, 1/8},
+
+ {1/16, -1/2, -1/8, 5/16, -1/4, 1/8},
+
+ {-1/16, -1/2, -1/16, 1/16, -3/8, 1/16}
+ }
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {-5/16, -3/8, 0, 5/16, 0, 0},
+
+ {-1/4, -5/16, 0 + 0.01, 0, -1/16, 1/8},
+
+ {1/16, -1/2, -1/8, 5/16, -1/4, 1/8},
+
+ {-1/16, -1/2, -1/16, 1/16, -3/8, 1/16}
+ }
+ }
+})
+
+
+
+minetest.register_alias("infrastructure:warning_light_bright", "infrastructure:warning_light")
+minetest.register_alias("infrastructure:warning_light_dark", "infrastructure:warning_light")
diff --git a/infrastructure/textures/infrastructure_warning_light_front_anim.png b/infrastructure/textures/infrastructure_warning_light_front_anim.png
new file mode 100644
index 0000000..601725b
--- /dev/null
+++ b/infrastructure/textures/infrastructure_warning_light_front_anim.png
Binary files differ
diff --git a/infrastructure/textures/infrastructure_warning_light_front_bright.png b/infrastructure/textures/infrastructure_warning_light_front_bright.png
deleted file mode 100644
index 8d9c937..0000000
--- a/infrastructure/textures/infrastructure_warning_light_front_bright.png
+++ /dev/null
Binary files differ
diff --git a/infrastructure/textures/infrastructure_warning_light_front_dark.png b/infrastructure/textures/infrastructure_warning_light_front_dark.png
deleted file mode 100644
index 3496420..0000000
--- a/infrastructure/textures/infrastructure_warning_light_front_dark.png
+++ /dev/null
Binary files differ