forked from Mirrorlandia_minetest/digilines
Fix channel value getting deleted when quitting without editing the value in LCD, RTC and Light Sensor
This commit is contained in:
parent
fa3f9ce09d
commit
843c68af14
@ -105,7 +105,9 @@ minetest.register_node("digilines_lcd:lcd", {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
|
if (fields.channel) then
|
||||||
minetest.get_meta(pos):set_string("channel", fields.channel)
|
minetest.get_meta(pos):set_string("channel", fields.channel)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
digiline =
|
digiline =
|
||||||
|
@ -50,8 +50,8 @@ minetest.register_node("digilines_lightsensor:lightsensor", {
|
|||||||
meta:set_string("formspec", "field[channel;Channel;${channel}]")
|
meta:set_string("formspec", "field[channel;Channel;${channel}]")
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local meta = minetest.get_meta(pos)
|
if (fields.channel) then
|
||||||
fields.channel = fields.channel or ""
|
minetest.get_meta(pos):set_string("channel", fields.channel)
|
||||||
meta:set_string("channel", fields.channel)
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
@ -46,8 +46,8 @@ minetest.register_node("digilines_rtc:rtc", {
|
|||||||
meta:set_string("formspec", "field[channel;Channel;${channel}]")
|
meta:set_string("formspec", "field[channel;Channel;${channel}]")
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local meta = minetest.get_meta(pos)
|
if (fields.channel) then
|
||||||
fields.channel = fields.channel or ""
|
minetest.get_meta(pos):set_string("channel", fields.channel)
|
||||||
meta:set_string("channel", fields.channel)
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user