[ilights] Update to Git commit b1f7ccf:

https://github.com/minetest-mods/ilights/commit/b1f7ccf
master
AntumDeluge 2017-05-05 11:43:06 -07:00
commit a63b514d9d
5 changed files with 95 additions and 60 deletions

View File

@ -46,7 +46,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
* [biome_lib][] ([WTFPL](mods/lib/biome_lib/README.md))
* [signs_lib][] ([BSD/WTFPL](mods/lib/signs_lib/copyright.txt))
* lighting/
* [ilights][] ([CC BY-SA][lic.ilights]) -- version [d5f6900 Git][ver.ilights] *2016-03-27* ***UPDT***
* [ilights][] ([CC BY-SA][lic.ilights]) -- version [b1f7ccf Git][ver.ilights] *2017-03-18*
* walking_light ([petermalone fork][walking_light]) ([WTFPL / CC-BY-SA][lic.walking_light]) -- version: [b9de302 Git][ver.walking_light] *2016-09-09* ([patched][patch.walking_light])
* materials/
* [moreores][] ([zlib/CC-BY-SA](mods/materials/moreores/README.md))
@ -364,7 +364,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
[ver.hidename]: https://github.com/AntumDeluge/mtmod-hidename/tree/bb52dbc
[ver.home_gui]: https://github.com/cornernote/minetest-home_gui/tree/f6b5001
[ver.homedecor]: https://github.com/minetest-mods/homedecor_modpack/tree/5fb16c4
[ver.ilights]: https://github.com/minetest-mods/ilights/tree/d5f6900
[ver.ilights]: https://github.com/minetest-mods/ilights/tree/b1f7ccf
[ver.invisibility]: https://github.com/tenplus1/invisibility/tree/bf4156b
[ver.jukebox]: https://github.com/minetest-mods/jukebox/tree/e6a507f
[ver.lightning]: https://github.com/minetest-mods/lightning/tree/39bd36c

View File

@ -1,4 +1,4 @@
default
dye
unifieddyes
intllib?
craft_guide?
craft_guide?

View File

@ -1,5 +1,6 @@
-- Industrial lights mod by DanDuncombe
-- License: CC-By-Sa
-- rewritten by VanessaE to use param2 colorization
ilights = {}
@ -21,69 +22,103 @@ ilights.modpath = minetest.get_modpath("ilights")
-- The important stuff!
ilights.types = {
{"white", "White", "#ffffff" },
{"grey", "Grey", "#a0a0a0" },
{"black", "Black", "#000000" },
{"red", "Red", "#ff0000" },
{"yellow", "Yellow", "#ffff00" },
{"green", "Green", "#00ff00" },
{"cyan", "Cyan", "#00ffff" },
{"blue", "Blue", "#0000ff" },
{"magenta", "Magenta", "#ff00ff" },
{"orange", "Orange", "#ff8000" },
{"violet", "Violet", "#8000ff" },
{"dark_grey", "Dark Grey", "#404040" },
{"dark_green", "Dark Green", "#008000" },
{"pink", "Pink", "#ffb0ff" },
{"brown", "Brown", "#604000" },
}
local lamp_cbox = {
type = "fixed",
fixed = { -11/32, -8/16, -11/32, 11/32, 4/16, 11/32 }
type = "wallmounted",
wall_top = { -11/32, -4/16, -11/32, 11/32, 8/16, 11/32 },
wall_bottom = { -11/32, -8/16, -11/32, 11/32, 4/16, 11/32 },
wall_side = { -8/16, -11/32, -11/32, 4/16, 11/32, 11/32 }
}
for _, row in ipairs(ilights.types) do
local name = row[1]
local desc = row[2]
local colordef = row[3]
minetest.register_node("ilights:light", {
description = "Industrial Light",
drawtype = "mesh",
mesh = "ilights_lamp.obj",
tiles = {
{ name = "ilights_lamp_base.png", color = 0xffffffff },
{ name = "ilights_lamp_cage.png", color = 0xffffffff },
"ilights_lamp_bulb.png",
{ name = "ilights_lamp_bulb_base.png", color = 0xffffffff },
"ilights_lamp_lens.png"
},
use_texture_alpha = true,
groups = {cracky=3, ud_param2_colorable = 1},
paramtype = "light",
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
light_source = 14,
selection_box = lamp_cbox,
node_box = lamp_cbox,
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
after_dig_node = unifieddyes.after_dig_node
})
-- Node Definition
minetest.register_craft({
output = "ilights:light 3",
recipe = {
{ "", "default:steel_ingot", "" },
{ "", "default:glass", "" },
{ "default:steel_ingot", "default:torch", "default:steel_ingot" }
},
})
minetest.register_node("ilights:light_"..name, {
description = desc.." Industrial Light",
drawtype = "mesh",
mesh = "ilights_lamp.obj",
tiles = {
"ilights_lamp_base.png",
"ilights_lamp_cage.png",
"ilights_lamp_bulb.png^[colorize:"..colordef..":200",
"ilights_lamp_bulb_base.png",
"ilights_lamp_lens.png^[colorize:"..colordef.."20:75"
},
use_texture_alpha = true,
groups = {cracky=3},
paramtype = "light",
paramtype2 = "facedir",
light_source = 15,
selection_box = lamp_cbox,
collision_box = lamp_cbox,
on_place = minetest.rotate_node
})
-- convert old static nodes to param2 coloring
if name then
ilights.colors = {
"white",
"grey",
"black",
"red",
"yellow",
"green",
"cyan",
"blue",
"magenta",
"orange",
"violet",
"dark_grey",
"dark_green",
"pink",
"brown"
}
--Choose craft material
minetest.register_craft({
output = "ilights:light_"..name.." 3",
recipe = {
{ "", "default:steel_ingot", "" },
{ "dye:"..name, "default:glass", "dye:"..name },
{ "default:steel_ingot", "default:torch", "default:steel_ingot" }
},
})
ilights.old_static_nodes = {}
end
for _, i in ipairs (ilights.colors) do
table.insert(ilights.old_static_nodes, "ilights:light_"..i)
end
minetest.register_lbm({
name = "ilights:convert",
label = "Convert ilights static nodes to use param2 color",
run_at_every_load = false,
nodenames = ilights.old_static_nodes,
action = function(pos, node)
local name = node.name
local color = string.sub(name, string.find(name, "_") + 1)
local paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted")
local old_fdir = math.floor(node.param2 / 4)
local param2
if old_fdir == 5 then
new_fdir = 0
elseif old_fdir == 1 then
new_fdir = 5
elseif old_fdir == 2 then
new_fdir = 4
elseif old_fdir == 3 then
new_fdir = 3
elseif old_fdir == 4 then
new_fdir = 2
elseif old_fdir == 0 then
new_fdir = 1
end
param2 = paletteidx + new_fdir
minetest.set_node(pos, { name = "ilights:light", param2 = param2 })
local meta = minetest.get_meta(pos)
meta:set_string("dye", "unifieddyes:"..color)
end
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 668 B

After

Width:  |  Height:  |  Size: 492 B