0
0
Fork 0

Remove infotexts

This commit is contained in:
Wuzzy 2017-01-12 22:14:32 +01:00
parent 2ed9e9f0bb
commit ccac208ee3
4 changed files with 8 additions and 38 deletions

View File

@ -98,7 +98,6 @@ minetest.register_node("3d_armor_stand:armor_stand", {
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("formspec", armor_stand_formspec) meta:set_string("formspec", armor_stand_formspec)
meta:set_string("infotext", "Armor Stand")
local inv = meta:get_inventory() local inv = meta:get_inventory()
for _, element in pairs(elements) do for _, element in pairs(elements) do
inv:set_size("armor_"..element, 1) inv:set_size("armor_"..element, 1)

View File

@ -1359,7 +1359,6 @@ minetest.register_node("default:chest", {
"listring[nodemeta:"..p.x..","..p.y..","..p.z..";main]".. "listring[nodemeta:"..p.x..","..p.y..","..p.z..";main]"..
"listring[current_player;main]".. "listring[current_player;main]"..
"listring[current_name;main]") "listring[current_name;main]")
meta:set_string("infotext", "Large Chest")
hacky_swap_node(p, "default:chest_left", param2) hacky_swap_node(p, "default:chest_left", param2)
local m = minetest.get_meta(p) local m = minetest.get_meta(p)
m:set_string("formspec", m:set_string("formspec",
@ -1372,7 +1371,6 @@ minetest.register_node("default:chest", {
"listring[current_name;main]".. "listring[current_name;main]"..
"listring[current_player;main]".. "listring[current_player;main]"..
"listring[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main]") "listring[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main]")
m:set_string("infotext", "Large Chest")
elseif minetest.get_node(get_chest_neighborpos(pos, param2, "left")).name == "default:chest" then elseif minetest.get_node(get_chest_neighborpos(pos, param2, "left")).name == "default:chest" then
minetest.set_node(pos, {name="default:chest_left",param2=param2}) minetest.set_node(pos, {name="default:chest_left",param2=param2})
local p = get_chest_neighborpos(pos, param2, "left") local p = get_chest_neighborpos(pos, param2, "left")
@ -1386,7 +1384,6 @@ minetest.register_node("default:chest", {
"listring[current_name;main]".. "listring[current_name;main]"..
"listring[current_player;main]".. "listring[current_player;main]"..
"listring[nodemeta:"..p.x..","..p.y..","..p.z..";main]") "listring[nodemeta:"..p.x..","..p.y..","..p.z..";main]")
meta:set_string("infotext", "Large Chest")
hacky_swap_node(p, "default:chest_right", param2) hacky_swap_node(p, "default:chest_right", param2)
local m = minetest.get_meta(p) local m = minetest.get_meta(p)
m:set_string("formspec", m:set_string("formspec",
@ -1399,7 +1396,6 @@ minetest.register_node("default:chest", {
"listring[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main]".. "listring[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main]"..
"listring[current_player;main]".. "listring[current_player;main]"..
"listring[current_name;main]") "listring[current_name;main]")
m:set_string("infotext", "Large Chest")
else else
meta:set_string("formspec", meta:set_string("formspec",
"size[9,8.75]".. "size[9,8.75]"..
@ -1410,7 +1406,6 @@ minetest.register_node("default:chest", {
"list[current_player;main;0,7.74;9,1;]".. "list[current_player;main;0,7.74;9,1;]"..
"listring[current_name;main]".. "listring[current_name;main]"..
"listring[current_player;main]") "listring[current_player;main]")
meta:set_string("infotext", "Chest")
end end
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size("main", 9*3) inv:set_size("main", 9*3)
@ -1452,13 +1447,13 @@ minetest.register_node("default:chest_left", {
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_destruct = function(pos) on_destruct = function(pos)
local m = minetest.get_meta(pos) local n = minetest.get_node(pos)
if m:get_string("infotext") == "Chest" then if n.name == "deault:chest" then
return return
end end
local param2 = minetest.get_node(pos).param2 local param2 = n.param2
local p = get_chest_neighborpos(pos, param2, "left") local p = get_chest_neighborpos(pos, param2, "left")
if not p or minetest.get_node(p).name ~= "default:chest_right" then if not p or n.name ~= "default:chest_right" then
return return
end end
local meta = minetest.get_meta(p) local meta = minetest.get_meta(p)
@ -1471,7 +1466,6 @@ minetest.register_node("default:chest_left", {
"list[current_player;main;0,7.74;9,1;]".. "list[current_player;main;0,7.74;9,1;]"..
"listring[current_name;main]".. "listring[current_name;main]"..
"listring[current_player;main]") "listring[current_player;main]")
meta:set_string("infotext", "Chest")
hacky_swap_node(p, "default:chest") hacky_swap_node(p, "default:chest")
end, end,
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
@ -1511,13 +1505,13 @@ minetest.register_node("default:chest_right", {
is_ground_content = false, is_ground_content = false,
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_destruct = function(pos) on_destruct = function(pos)
local m = minetest.get_meta(pos) local n = minetest.get_node(pos)
if m:get_string("infotext") == "Chest" then if n.name == "default:chest" then
return return
end end
local param2 = minetest.get_node(pos).param2 local param2 = n.param2
local p = get_chest_neighborpos(pos, param2, "right") local p = get_chest_neighborpos(pos, param2, "right")
if not p or minetest.get_node(p).name ~= "default:chest_left" then if not p or n.name ~= "default:chest_left" then
return return
end end
local meta = minetest.get_meta(p) local meta = minetest.get_meta(p)
@ -1530,7 +1524,6 @@ minetest.register_node("default:chest_right", {
"list[current_player;main;0,7.74;9,1;]".. "list[current_player;main;0,7.74;9,1;]"..
"listring[current_name;main]".. "listring[current_name;main]"..
"listring[current_player;main]") "listring[current_player;main]")
meta:set_string("infotext", "Chest")
hacky_swap_node(p, "default:chest") hacky_swap_node(p, "default:chest")
end, end,
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
@ -1590,7 +1583,6 @@ minetest.register_node("default:furnace", {
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("formspec", default.furnace_inactive_formspec) meta:set_string("formspec", default.furnace_inactive_formspec)
meta:set_string("infotext", "Furnace")
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size("fuel", 1) inv:set_size("fuel", 1)
inv:set_size("src", 1) inv:set_size("src", 1)
@ -1613,9 +1605,6 @@ minetest.register_node("default:furnace", {
local inv = meta:get_inventory() local inv = meta:get_inventory()
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
meta:set_string("infotext","Furnace is empty")
end
return stack:get_count() return stack:get_count()
else else
return 0 return 0
@ -1632,9 +1621,6 @@ minetest.register_node("default:furnace", {
local stack = inv:get_stack(from_list, from_index) local stack = inv:get_stack(from_list, from_index)
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
meta:set_string("infotext","Furnace is empty")
end
return count return count
else else
return 0 return 0
@ -1660,7 +1646,6 @@ minetest.register_node("default:furnace_active", {
on_construct = function(pos) on_construct = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("formspec", default.furnace_inactive_formspec) meta:set_string("formspec", default.furnace_inactive_formspec)
meta:set_string("infotext", "Furnace");
local inv = meta:get_inventory() local inv = meta:get_inventory()
inv:set_size("fuel", 1) inv:set_size("fuel", 1)
inv:set_size("src", 1) inv:set_size("src", 1)
@ -1683,9 +1668,6 @@ minetest.register_node("default:furnace_active", {
local inv = meta:get_inventory() local inv = meta:get_inventory()
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
meta:set_string("infotext","Furnace is empty")
end
return stack:get_count() return stack:get_count()
else else
return 0 return 0
@ -1702,9 +1684,6 @@ minetest.register_node("default:furnace_active", {
local stack = inv:get_stack(from_list, from_index) local stack = inv:get_stack(from_list, from_index)
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
meta:set_string("infotext","Furnace is empty")
end
return count return count
else else
return 0 return 0
@ -1781,7 +1760,6 @@ 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","Furnace active: "..percent.."%")
hacky_swap_node(pos,"default:furnace_active") hacky_swap_node(pos,"default:furnace_active")
meta:set_string("formspec", meta:set_string("formspec",
"size[9,8.75]".. "size[9,8.75]"..
@ -1817,7 +1795,6 @@ minetest.register_abm({
end end
if fuel.time <= 0 then if fuel.time <= 0 then
meta:set_string("infotext","Furnace out of fuel")
hacky_swap_node(pos,"default:furnace") hacky_swap_node(pos,"default:furnace")
meta:set_string("formspec", default.furnace_inactive_formspec) meta:set_string("formspec", default.furnace_inactive_formspec)
return return
@ -1825,7 +1802,6 @@ 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","Furnace is empty")
hacky_swap_node(pos,"default:furnace") hacky_swap_node(pos,"default:furnace")
meta:set_string("formspec", default.furnace_inactive_formspec) meta:set_string("formspec", default.furnace_inactive_formspec)
end end

View File

@ -55,9 +55,6 @@ local function initialize_data(meta)
else else
owner = "owned by " .. owner owner = "owned by " .. owner
end end
meta:set_string("infotext", "Command Block\n" ..
"(" .. owner .. ")\n" ..
"Commands: "..commands)
end end
local function construct(pos) local function construct(pos)

View File

@ -37,7 +37,6 @@ local sign_groups = {choppy=2, dig_immediate=2}
local construct_sign = function(pos) local construct_sign = function(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("formspec", "field[text;;${text}]") meta:set_string("formspec", "field[text;;${text}]")
meta:set_string("infotext", "")
end end
local destruct_sign = function(pos) local destruct_sign = function(pos)
@ -52,7 +51,6 @@ end
local update_sign = function(pos, fields, sender) local update_sign = function(pos, fields, sender)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local owner = meta:get_string("owner") local owner = meta:get_string("owner")
meta:set_string("infotext", "")
local text = meta:get_string("text") local text = meta:get_string("text")
if fields and sender:get_player_name() == owner or text == "" and fields then if fields and sender:get_player_name() == owner or text == "" and fields then
meta:set_string("text", fields.text) meta:set_string("text", fields.text)