More infortext tweaks

This commit is contained in:
Vanessa Ezekowitz 2013-06-21 01:59:03 -04:00
parent 1259fe77c8
commit e00a0c66a4

View File

@ -146,7 +146,7 @@ minetest.register_node("homedecor:microwave_oven_active", {
if listname == "fuel" then if listname == "fuel" then
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
if inv:is_empty("src") then if inv:is_empty("src") then
meta:set_string("infotext",S("Oven is empty")) meta:set_string("infotext",S("Microwave is empty"))
end end
return stack:get_count() return stack:get_count()
else else
@ -165,7 +165,7 @@ minetest.register_node("homedecor:microwave_oven_active", {
if to_list == "fuel" then if to_list == "fuel" then
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
if inv:is_empty("src") then if inv:is_empty("src") then
meta:set_string("infotext",S("Oven is empty")) meta:set_string("infotext",S("Microwave is empty"))
end end
return count return count
else else
@ -243,7 +243,7 @@ minetest.register_abm({
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
local percent = math.floor(meta:get_float("fuel_time") / local percent = math.floor(meta:get_float("fuel_time") /
meta:get_float("fuel_totaltime") * 100) meta:get_float("fuel_totaltime") * 100)
meta:set_string("infotext",S("Oven active: %d%%"):format(percent)) meta:set_string("infotext",S("Microwave active: %d%%"):format(percent))
hacky_swap_node(pos,"homedecor:microwave_oven_active") hacky_swap_node(pos,"homedecor:microwave_oven_active")
meta:set_string("formspec", meta:set_string("formspec",
"size[8,9]".. "size[8,9]"..
@ -270,7 +270,7 @@ minetest.register_abm({
end end
if fuel.time <= 0 then if fuel.time <= 0 then
meta:set_string("infotext",S("Oven out of fuel")) meta:set_string("infotext",S("Microwave out of fuel"))
hacky_swap_node(pos,"homedecor:microwave_oven") hacky_swap_node(pos,"homedecor:microwave_oven")
meta:set_string("formspec", mw_oven_inactive_formspec) meta:set_string("formspec", mw_oven_inactive_formspec)
return return
@ -278,7 +278,7 @@ minetest.register_abm({
if cooked.item:is_empty() then if cooked.item:is_empty() then
if was_active then if was_active then
meta:set_string("infotext",S("Oven is empty")) meta:set_string("infotext",S("Microwave is empty"))
hacky_swap_node(pos,"homedecor:microwave_oven") hacky_swap_node(pos,"homedecor:microwave_oven")
meta:set_string("formspec", mw_oven_inactive_formspec) meta:set_string("formspec", mw_oven_inactive_formspec)
end end
@ -286,7 +286,7 @@ minetest.register_abm({
end end
if not inv:room_for_item("dst",cooked.item) then if not inv:room_for_item("dst",cooked.item) then
meta:set_string("infotext", S("Oven output bins are full")) meta:set_string("infotext", S("Microwave output bins are full"))
hacky_swap_node(pos, "homedecor:microwave_oven") hacky_swap_node(pos, "homedecor:microwave_oven")
meta:set_string("formspec", mw_oven_inactive_formspec) meta:set_string("formspec", mw_oven_inactive_formspec)
return return