From c1ab7277ab7a6111b03b5f734c633140eafdacb2 Mon Sep 17 00:00:00 2001 From: codexp Date: Mon, 2 Apr 2018 13:33:36 +0200 Subject: refactor code to use with intllib tool --- api.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'api.lua') diff --git a/api.lua b/api.lua index 2b63922..bcc0848 100644 --- a/api.lua +++ b/api.lua @@ -1,5 +1,5 @@ local S = unified_inventory.gettext -local F = unified_inventory.fgettext +local F = minetest.formspec_escape -- Create detached creative inventory after loading all mods minetest.after(0.01, function() @@ -233,7 +233,7 @@ end unified_inventory.register_craft_type("normal", { - description = F("Crafting"), + description = F(S("Crafting")), icon = "ui_craftgrid_icon.png", width = 3, height = 3, @@ -249,7 +249,7 @@ unified_inventory.register_craft_type("normal", { unified_inventory.register_craft_type("shapeless", { - description = F("Mixing"), + description = F(S("Mixing")), icon = "ui_craftgrid_icon.png", width = 3, height = 3, @@ -264,7 +264,7 @@ unified_inventory.register_craft_type("shapeless", { unified_inventory.register_craft_type("cooking", { - description = F("Cooking"), + description = F(S("Cooking")), icon = "default_furnace_front.png", width = 1, height = 1, @@ -272,7 +272,7 @@ unified_inventory.register_craft_type("cooking", { unified_inventory.register_craft_type("digging", { - description = F("Digging"), + description = F(S("Digging")), icon = "default_tool_steelpick.png", width = 1, height = 1, -- cgit v1.2.3 From edd00f222c02f2e0f42f0c9bf52de74c41bf12b9 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sat, 23 Jun 2018 14:56:27 +0200 Subject: Replace deprecated function names, unify creative check --- api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api.lua') diff --git a/api.lua b/api.lua index 2b63922..42fc167 100644 --- a/api.lua +++ b/api.lua @@ -303,6 +303,6 @@ end function unified_inventory.is_creative(playername) return minetest.check_player_privs(playername, {creative=true}) - or minetest.setting_getbool("creative_mode") + or minetest.settings:get_bool("creative_mode") end -- cgit v1.2.3