1
0
mirror of https://github.com/minetest-mods/3d_armor.git synced 2025-06-28 14:26:18 +02:00

Add support for intllib

This commit is contained in:
stujones11
2017-03-31 19:54:12 +01:00
parent 7fde7c050d
commit 23e4d5114f
8 changed files with 105 additions and 76 deletions

View File

@ -2,6 +2,10 @@ if not minetest.global_exists("unified_inventory") then
minetest.log("warning", "3d_armor_ui: Mod loaded but unused.")
return
end
local S = function(s) return s end
if minetest.global_exists("intllib") then
S = intllib.Getter()
end
if unified_inventory.sfinv_compat_layer then
return
@ -27,17 +31,17 @@ unified_inventory.register_page("armor", {
"label[0,0;Armor]"..
"list[detached:"..name.."_armor;armor;0,"..fy..";2,3;]"..
"image[2.5,"..(fy - 0.25)..";2,4;"..armor.textures[name].preview.."]"..
"label[5.0,"..(fy + 0.0)..";Level: "..armor.def[name].level.."]"..
"label[5.0,"..(fy + 0.5)..";Heal: "..armor.def[name].heal.."]"..
"label[5.0,"..(fy + 0.0)..";"..S("Level")..": "..armor.def[name].level.."]"..
"label[5.0,"..(fy + 0.5)..";"..S("Heal")..": "..armor.def[name].heal.."]"..
"listring[current_player;main]"..
"listring[detached:"..name.."_armor;armor]"
if armor.config.fire_protect then
formspec = formspec.."label[5.0,"..(fy + 1.0)..
";Fire: "..armor.def[name].fire.."]"
formspec = formspec.."label[5.0,"..(fy + 1.0)..";"..
S("Fire")..": "..armor.def[name].fire.."]"
end
if minetest.global_exists("technic") then
formspec = formspec.."label[5.0,"..(fy + 1.5)..
";Radiation: "..armor.def[name].groups["radiation"].."]"
formspec = formspec.."label[5.0,"..(fy + 1.5)..";"..
S("Radiation")..": "..armor.def[name].groups["radiation"].."]"
end
return {formspec=formspec}
end,