summaryrefslogtreecommitdiff
path: root/unified_inventory/register.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-08-11 18:39:55 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-08-11 18:39:55 -0400
commit92f49e3096dc37b9b802994d287c47dc7f583c24 (patch)
tree9480515a27630d8009dffb87de93124966fb1015 /unified_inventory/register.lua
parentf9cae7314e08fbeeef509c5c6ca095822fec1747 (diff)
downloaddreambuilder_modpack-92f49e3096dc37b9b802994d287c47dc7f583c24.tar
dreambuilder_modpack-92f49e3096dc37b9b802994d287c47dc7f583c24.tar.gz
dreambuilder_modpack-92f49e3096dc37b9b802994d287c47dc7f583c24.tar.bz2
dreambuilder_modpack-92f49e3096dc37b9b802994d287c47dc7f583c24.tar.xz
dreambuilder_modpack-92f49e3096dc37b9b802994d287c47dc7f583c24.zip
updated boost_cart, plantlife, castle, homedecor, fake_fire,
glooptest, quartz, unified_inventory, inbox, mesecons, and worldedit mods
Diffstat (limited to 'unified_inventory/register.lua')
-rw-r--r--unified_inventory/register.lua40
1 files changed, 21 insertions, 19 deletions
diff --git a/unified_inventory/register.lua b/unified_inventory/register.lua
index 7042849..cc789a7 100644
--- a/unified_inventory/register.lua
+++ b/unified_inventory/register.lua
@@ -1,12 +1,13 @@
local S = unified_inventory.gettext
+local F = unified_inventory.fgettext
minetest.register_privilege("creative", {
- description = "Can use the creative inventory",
+ description = S("Can use the creative inventory"),
give_to_singleplayer = false,
})
minetest.register_privilege("ui_full", {
- description = "Forces UI to display in Full mode when Lite mode is configured globally",
+ description = S("Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally"),
give_to_singleplayer = false,
})
@@ -135,7 +136,7 @@ unified_inventory.register_button("clear_inv", {
return
end
player:get_inventory():set_list("main", {})
- minetest.chat_send_player(player_name, 'Inventory Cleared!')
+ minetest.chat_send_player(player_name, S('Inventory cleared!'))
minetest.sound_play("trash_all",
{to_player=player_name, gain = 1.0})
end,
@@ -150,16 +151,16 @@ unified_inventory.register_page("craft", {
local player_name = player:get_player_name()
local formspec = "background[2,"..formspecy..";6,3;ui_crafting_form.png]"
formspec = formspec.."background[0,"..(formspecy + 3.5)..";8,4;ui_main_inventory.png]"
- formspec = formspec.."label[0,"..formheadery..";Crafting]"
+ formspec = formspec.."label[0,"..formheadery..";" ..F("Crafting").."]"
formspec = formspec.."listcolors[#00000000;#00000000]"
formspec = formspec.."list[current_player;craftpreview;6,"..formspecy..";1,1;]"
formspec = formspec.."list[current_player;craft;2,"..formspecy..";3,3;]"
- formspec = formspec.."label[7,"..(formspecy + 1.5)..";" .. S("Trash:") .. "]"
+ formspec = formspec.."label[7,"..(formspecy + 1.5)..";" .. F("Trash:") .. "]"
formspec = formspec.."list[detached:trash;main;7,"..(formspecy + 2)..";1,1;]"
formspec = formspec.."listring[current_name;craft]"
formspec = formspec.."listring[current_player;main]"
if unified_inventory.is_creative(player_name) then
- formspec = formspec.."label[0,"..(formspecy + 1.5)..";" .. S("Refill:") .. "]"
+ formspec = formspec.."label[0,"..(formspecy + 1.5)..";" .. F("Refill:") .. "]"
formspec = formspec.."list[detached:"..minetest.formspec_escape(player_name).."refill;main;0,"..(formspecy +2)..";1,1;]"
end
return {formspec=formspec}
@@ -195,8 +196,8 @@ local function stack_image_button(x, y, w, h, buttonname_prefix, item)
end
local recipe_text = {
- recipe = "Recipe",
- usage = "Usage",
+ recipe = "Recipe %d of %d",
+ usage = "Usage %d of %d",
}
local no_recipe_text = {
recipe = "No recipes",
@@ -223,10 +224,12 @@ unified_inventory.register_page("craftguide", {
local player_privs = minetest.get_player_privs(player_name)
local formspec = ""
formspec = formspec.."background[0,"..(formspecy + 3.5)..";8,4;ui_main_inventory.png]"
- formspec = formspec.."label[0,"..formheadery..";" .. S("Crafting Guide") .. "]"
+ formspec = formspec.."label[0,"..formheadery..";" .. F("Crafting Guide") .. "]"
formspec = formspec.."listcolors[#00000000;#00000000]"
local item_name = unified_inventory.current_item[player_name]
if not item_name then return {formspec=formspec} end
+ local displayed_name = minetest.registered_items[item_name].description
+ if not displayed_name then displayed_name = item_name end
local dir = unified_inventory.current_craft_direction[player_name]
local rdir
@@ -242,20 +245,20 @@ unified_inventory.register_page("craftguide", {
formspec = formspec.."background[0.5,"..(formspecy + 0.2)..";8,3;ui_craftguide_form.png]"
formspec = formspec.."textarea["..craftresultx..","..craftresulty
- ..";10,1;;"..minetest.formspec_escape(role_text[dir]..": "..item_name)..";]"
+ ..";10,1;;"..minetest.formspec_escape(F(role_text[dir])..": "..displayed_name)..";]"
formspec = formspec..stack_image_button(0, formspecy, 1.1, 1.1, "item_button_"
.. rdir .. "_", ItemStack(item_name))
if not craft then
formspec = formspec.."label[5.5,"..(formspecy + 2.35)..";"
- ..minetest.formspec_escape(no_recipe_text[dir]).."]"
+ ..minetest.formspec_escape(F(no_recipe_text[dir])).."]"
local no_pos = dir == "recipe" and 4.5 or 6.5
local item_pos = dir == "recipe" and 6.5 or 4.5
formspec = formspec.."image["..no_pos..","..formspecy..";1.1,1.1;ui_no.png]"
formspec = formspec..stack_image_button(item_pos, formspecy, 1.1, 1.1, "item_button_"
..other_dir[dir].."_", ItemStack(item_name))
if player_privs.give == true then
- formspec = formspec.."label[0,"..(formspecy + 2.10)..";" .. S("Give me:") .. "]"
+ formspec = formspec.."label[0,"..(formspecy + 2.10)..";" .. F("Give me:") .. "]"
.."button[0, "..(formspecy + 2.7)..";0.6,0.5;craftguide_giveme_1;1]"
.."button[0.6,"..(formspecy + 2.7)..";0.7,0.5;craftguide_giveme_10;10]"
.."button[1.3,"..(formspecy + 2.7)..";0.8,0.5;craftguide_giveme_99;99]"
@@ -297,23 +300,22 @@ unified_inventory.register_page("craftguide", {
end
if craft_type.uses_crafting_grid then
- formspec = formspec.."label[0,"..(formspecy + 0.9)..";" .. S("To craft grid:") .. "]"
+ formspec = formspec.."label[0,"..(formspecy + 0.9)..";" .. F("To craft grid:") .. "]"
.."button[0, "..(formspecy + 1.5)..";0.6,0.5;craftguide_craft_1;1]"
.."button[0.6,"..(formspecy + 1.5)..";0.7,0.5;craftguide_craft_10;10]"
- .."button[1.3,"..(formspecy + 1.5)..";0.8,0.5;craftguide_craft_max;" .. S("All") .. "]"
+ .."button[1.3,"..(formspecy + 1.5)..";0.8,0.5;craftguide_craft_max;" .. F("All") .. "]"
end
if player_privs.give then
- formspec = formspec.."label[0,"..(formspecy + 2.1)..";" .. S("Give me:") .. "]"
+ formspec = formspec.."label[0,"..(formspecy + 2.1)..";" .. F("Give me:") .. "]"
.."button[0, "..(formspecy + 2.7)..";0.6,0.5;craftguide_giveme_1;1]"
.."button[0.6,"..(formspecy + 2.7)..";0.7,0.5;craftguide_giveme_10;10]"
.."button[1.3,"..(formspecy + 2.7)..";0.8,0.5;craftguide_giveme_99;99]"
end
if alternates and alternates > 1 then
- formspec = formspec.."label[5.5,"..(formspecy + 1.6)..";"..recipe_text[dir].." "
- ..tostring(alternate).." of "
- ..tostring(alternates).."]"
- .."button[5.5,"..(formspecy + 2)..";2,1;alternate;" .. S("Alternate") .. "]"
+ formspec = formspec.."label[5.5,"..(formspecy + 1.6)..";"
+ ..string.format(F(recipe_text[dir]), alternate, alternates).."]"
+ .."button[5.5,"..(formspecy + 2)..";2,1;alternate;" .. F("Alternate") .. "]"
end
return {formspec = formspec}
end,