diff options
Diffstat (limited to 'unified_inventory')
66 files changed, 316 insertions, 145 deletions
diff --git a/unified_inventory/api.lua b/unified_inventory/api.lua index 872ce32..936ee72 100644 --- a/unified_inventory/api.lua +++ b/unified_inventory/api.lua @@ -1,4 +1,5 @@ local S = unified_inventory.gettext +local F = unified_inventory.fgettext -- Create detached creative inventory after loading all mods minetest.after(0.01, function() @@ -44,6 +45,7 @@ minetest.after(0.01, function() print("Unified Inventory. inventory size: "..unified_inventory.items_list_size) for _, name in ipairs(unified_inventory.items_list) do local def = minetest.registered_items[name] + -- Simple drops if type(def.drop) == "string" then local dstack = ItemStack(def.drop) if not dstack:is_empty() and dstack:get_name() ~= name then @@ -55,6 +57,77 @@ minetest.after(0.01, function() }) end + -- Complex drops. Yes, it's really complex! + elseif type(def.drop) == "table" then + --[[ Extract single items from the table and save them into dedicated tables + to register them later, in order to avoid duplicates. These tables counts + the total number of guaranteed drops and drops by chance (“maybes”) for each item. + For “maybes”, the final count is the theoretical maximum number of items, not + neccessarily the actual drop count. ]] + local drop_guaranteed = {} + local drop_maybe = {} + -- This is for catching an obscure corner case: If the top items table has + -- only items with rarity = 1, but max_items is set, then only the first + -- max_items will be part of the drop, any later entries are logically + -- impossible, so this variable is for keeping track of this + local max_items_left = def.drop.max_items + -- For checking whether we still encountered only guaranteed only so far; + -- for the first “maybe” item it will become false which will cause ALL + -- later items to be considered “maybes”. + -- A common idiom is: + -- { max_items 1, { items = { + -- { items={"example:1"}, rarity = 5 }, + -- { items={"example:2"}, rarity = 1 }, }}} + -- example:2 must be considered a “maybe” because max_items is set and it + -- appears after a “maybe” + local max_start = true + -- Let's iterate through the items madness! + for i=1,#def.drop.items do + if max_items_left ~= nil and max_items_left <= 0 then break end + local itit = def.drop.items[i] + for j=1,#itit.items do + local dstack = ItemStack(itit.items[j]) + if not dstack:is_empty() and dstack:get_name() ~= name then + local dname = dstack:get_name() + local dcount = dstack:get_count() + -- Guaranteed drops AND we are not yet in “maybe mode” + if #itit.items == 1 and itit.rarity == 1 and max_start then + if drop_guaranteed[dname] == nil then + drop_guaranteed[dname] = 0 + end + drop_guaranteed[dname] = drop_guaranteed[dname] + dcount + + if max_items_left ~= nil then + max_items_left = max_items_left - 1 + if max_items_left <= 0 then break end + end + -- Drop was a “maybe” + else + if max_items_left ~= nil then max_start = false end + if drop_maybe[dname] == nil then + drop_maybe[dname] = 0 + end + drop_maybe[dname] = drop_maybe[dname] + dcount + end + end + end + end + for itemstring, count in pairs(drop_guaranteed) do + unified_inventory.register_craft({ + type = "digging", + items = {name}, + output = itemstring .. " " .. count, + width = 0, + }) + end + for itemstring, count in pairs(drop_maybe) do + unified_inventory.register_craft({ + type = "digging_chance", + items = {name}, + output = itemstring .. " " .. count, + width = 0, + }) + end end end for _, recipes in pairs(unified_inventory.crafts_for.recipe) do @@ -158,7 +231,7 @@ end unified_inventory.register_craft_type("normal", { - description = "Crafting", + description = F("Crafting"), icon = "ui_craftgrid_icon.png", width = 3, height = 3, @@ -174,7 +247,7 @@ unified_inventory.register_craft_type("normal", { unified_inventory.register_craft_type("shapeless", { - description = "Mixing", + description = F("Mixing"), icon = "ui_craftgrid_icon.png", width = 3, height = 3, @@ -189,7 +262,7 @@ unified_inventory.register_craft_type("shapeless", { unified_inventory.register_craft_type("cooking", { - description = "Cooking", + description = F("Cooking"), icon = "default_furnace_front.png", width = 1, height = 1, @@ -197,12 +270,18 @@ unified_inventory.register_craft_type("cooking", { unified_inventory.register_craft_type("digging", { - description = "Digging", + description = F("Digging"), icon = "default_tool_steelpick.png", width = 1, height = 1, }) +unified_inventory.register_craft_type("digging_chance", { + description = "Digging (by chance)", + icon = "default_tool_steelpick.png^[transformFY.png", + width = 1, + height = 1, +}) function unified_inventory.register_page(name, def) unified_inventory.pages[name] = def diff --git a/unified_inventory/bags.lua b/unified_inventory/bags.lua index 3b86544..7e925db 100644 --- a/unified_inventory/bags.lua +++ b/unified_inventory/bags.lua @@ -4,16 +4,17 @@ -- License: GPLv3 local S = unified_inventory.gettext +local F = unified_inventory.fgettext unified_inventory.register_page("bags", { get_formspec = function(player) local player_name = player:get_player_name() local formspec = "background[0.06,0.99;7.92,7.52;ui_bags_main_form.png]" - formspec = formspec.."label[0,0;"..S("Bags").."]" - formspec = formspec.."button[0,2;2,0.5;bag1;Bag 1]" - formspec = formspec.."button[2,2;2,0.5;bag2;Bag 2]" - formspec = formspec.."button[4,2;2,0.5;bag3;Bag 3]" - formspec = formspec.."button[6,2;2,0.5;bag4;Bag 4]" + formspec = formspec.."label[0,0;"..F("Bags").."]" + formspec = formspec.."button[0,2;2,0.5;bag1;"..F("Bag 1").."]" + formspec = formspec.."button[2,2;2,0.5;bag2;"..F("Bag 2").."]" + formspec = formspec.."button[4,2;2,0.5;bag3;"..F("Bag 3").."]" + formspec = formspec.."button[6,2;2,0.5;bag4;"..F("Bag 4").."]" formspec = formspec.."listcolors[#00000000;#00000000]" formspec = formspec.."list[detached:"..minetest.formspec_escape(player_name).."_bags;bag1;0.5,1;1,1;]" formspec = formspec.."list[detached:"..minetest.formspec_escape(player_name).."_bags;bag2;2.5,1;1,1;]" @@ -36,7 +37,7 @@ unified_inventory.register_button("bags", { local stack = player:get_inventory():get_stack("bag1", 1) local image = stack:get_definition().inventory_image local formspec = "image[7,0;1,1;"..image.."]" - formspec = formspec.."label[0,0;Bag 1]" + formspec = formspec.."label[0,0;"..F("Bag 1").."]" formspec = formspec.."listcolors[#00000000;#00000000]" formspec = formspec.."list[current_player;bag1contents;0,1;8,3;]" formspec = formspec.."listring[current_name;bag1contents]" @@ -57,7 +58,7 @@ unified_inventory.register_button("bags", { local stack = player:get_inventory():get_stack("bag2", 1) local image = stack:get_definition().inventory_image local formspec = "image[7,0;1,1;"..image.."]" - formspec = formspec.."label[0,0;Bag 2]" + formspec = formspec.."label[0,0;"..F("Bag 2").."]" formspec = formspec.."listcolors[#00000000;#00000000]" formspec = formspec.."list[current_player;bag2contents;0,1;8,3;]" formspec = formspec.."listring[current_name;bag2contents]" @@ -78,7 +79,7 @@ unified_inventory.register_button("bags", { local stack = player:get_inventory():get_stack("bag3", 1) local image = stack:get_definition().inventory_image local formspec = "image[7,0;1,1;"..image.."]" - formspec = formspec.."label[0,0;Bag 3]" + formspec = formspec.."label[0,0;"..F("Bag 3").."]" formspec = formspec.."listcolors[#00000000;#00000000]" formspec = formspec.."list[current_player;bag3contents;0,1;8,3;]" formspec = formspec.."listring[current_name;bag3contents]" @@ -99,7 +100,7 @@ unified_inventory.register_button("bags", { local stack = player:get_inventory():get_stack("bag4", 1) local image = stack:get_definition().inventory_image local formspec = "image[7,0;1,1;"..image.."]" - formspec = formspec.."label[0,0;Bag 4]" + formspec = formspec.."label[0,0;"..F("Bag 4").."]" formspec = formspec.."listcolors[#00000000;#00000000]" formspec = formspec.."list[current_player;bag4contents;0,1;8,3;]" formspec = formspec.."listring[current_name;bag4contents]" @@ -144,11 +145,36 @@ minetest.register_on_joinplayer(function(player) player:get_inventory():set_stack(listname, index, nil) end, allow_put = function(inv, listname, index, stack, player) - if stack:get_definition().groups.bagslots then - return 1 - else - return 0 + local new_slots = stack:get_definition().groups.bagslots + if new_slots then + local player_inv = player:get_inventory() + local old_slots = player_inv:get_size(listname.."contents") + + if new_slots >= old_slots then + return 1 + else + -- using a smaller bag, make sure it fits + local old_list = player_inv:get_list(listname.."contents") + local new_list = {} + local slots_used = 0 + local use_new_list = false + + for i, v in ipairs(old_list) do + if v and not v:is_empty() then + slots_used = slots_used + 1 + use_new_list = i > new_slots + new_list[slots_used] = v + end + end + if new_slots >= slots_used then + if use_new_list then + player_inv:set_list(listname.."contents", new_list) + end + return 1 + end + end end + return 0 end, allow_take = function(inv, listname, index, stack, player) if player:get_inventory():is_empty(listname.."contents") then @@ -189,30 +215,31 @@ minetest.register_tool("unified_inventory:bag_large", { }) -- register bag crafts -minetest.register_craft({ - output = "unified_inventory:bag_small", - recipe = { - {"", "farming:cotton", ""}, - {"group:wool", "group:wool", "group:wool"}, - {"group:wool", "group:wool", "group:wool"}, - }, -}) - -minetest.register_craft({ - output = "unified_inventory:bag_medium", - recipe = { - {"", "", ""}, - {"farming:cotton", "unified_inventory:bag_small", "farming:cotton"}, - {"farming:cotton", "unified_inventory:bag_small", "farming:cotton"}, - }, -}) +if minetest.get_modpath("farming") ~= nil then + minetest.register_craft({ + output = "unified_inventory:bag_small", + recipe = { + {"", "farming:cotton", ""}, + {"group:wool", "group:wool", "group:wool"}, + {"group:wool", "group:wool", "group:wool"}, + }, + }) -minetest.register_craft({ - output = "unified_inventory:bag_large", - recipe = { - {"", "", ""}, - {"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"}, - {"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"}, - }, -}) + minetest.register_craft({ + output = "unified_inventory:bag_medium", + recipe = { + {"", "", ""}, + {"farming:cotton", "unified_inventory:bag_small", "farming:cotton"}, + {"farming:cotton", "unified_inventory:bag_small", "farming:cotton"}, + }, + }) + minetest.register_craft({ + output = "unified_inventory:bag_large", + recipe = { + {"", "", ""}, + {"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"}, + {"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"}, + }, + }) +end diff --git a/unified_inventory/callbacks.lua b/unified_inventory/callbacks.lua index 392e855..9387154 100644 --- a/unified_inventory/callbacks.lua +++ b/unified_inventory/callbacks.lua @@ -187,3 +187,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) unified_inventory.current_page[player_name]) end) +if minetest.delete_detached_inventory then + minetest.register_on_leaveplayer(function(player) + local player_name = player:get_player_name() + minetest.delete_detached_inventory(player_name.."_bags") + minetest.delete_detached_inventory(player_name.."craftrecipe") + minetest.delete_detached_inventory(player_name.."refill") + end) +end diff --git a/unified_inventory/depends.txt b/unified_inventory/depends.txt index a1ea556..3879b2c 100644 --- a/unified_inventory/depends.txt +++ b/unified_inventory/depends.txt @@ -1,4 +1,4 @@ creative? intllib? datastorage? - +farming? diff --git a/unified_inventory/init.lua b/unified_inventory/init.lua index d311ace..e24fff2 100644 --- a/unified_inventory/init.lua +++ b/unified_inventory/init.lua @@ -2,6 +2,7 @@ local modpath = minetest.get_modpath(minetest.get_current_modname()) local worldpath = minetest.get_worldpath() +local mygettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end -- Data tables definitions unified_inventory = { @@ -31,7 +32,8 @@ unified_inventory = { default = "craft", -- intllib - gettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end, + gettext = mygettext, + fgettext = function(s) return minetest.formspec_escape(mygettext(s)) end, -- "Lite" mode lite_mode = minetest.setting_getbool("unified_inventory_lite"), diff --git a/unified_inventory/internal.lua b/unified_inventory/internal.lua index b99cf72..8319191 100644 --- a/unified_inventory/internal.lua +++ b/unified_inventory/internal.lua @@ -1,4 +1,5 @@ local S = unified_inventory.gettext +local F = unified_inventory.fgettext -- This pair of encoding functions is used where variable text must go in -- button names, where the text might contain formspec metacharacters. @@ -135,39 +136,39 @@ function unified_inventory.get_formspec(player, page) formspec[n] = "image_button[" .. (start_x + 0.6 * 0) .. ",9;.8,.8;ui_skip_backward_icon.png;start_list;]" - .. "tooltip[start_list;" .. minetest.formspec_escape(S("First page")) .. "]" + .. "tooltip[start_list;" .. F("First page") .. "]" .. "image_button[" .. (start_x + 0.6 * 1) .. ",9;.8,.8;ui_doubleleft_icon.png;rewind3;]" - .. "tooltip[rewind3;" .. minetest.formspec_escape(S("Back three pages")) .. "]" + .. "tooltip[rewind3;" .. F("Back three pages") .. "]" .. "image_button[" .. (start_x + 0.6 * 2) .. ",9;.8,.8;ui_left_icon.png;rewind1;]" - .. "tooltip[rewind1;" .. minetest.formspec_escape(S("Back one page")) .. "]" + .. "tooltip[rewind1;" .. F("Back one page") .. "]" .. "image_button[" .. (start_x + 0.6 * 3) .. ",9;.8,.8;ui_right_icon.png;forward1;]" - .. "tooltip[forward1;" .. minetest.formspec_escape(S("Forward one page")) .. "]" + .. "tooltip[forward1;" .. F("Forward one page") .. "]" .. "image_button[" .. (start_x + 0.6 * 4) .. ",9;.8,.8;ui_doubleright_icon.png;forward3;]" - .. "tooltip[forward3;" .. minetest.formspec_escape(S("Forward three pages")) .. "]" + .. "tooltip[forward3;" .. F("Forward three pages") .. "]" .. "image_button[" .. (start_x + 0.6 * 5) .. ",9;.8,.8;ui_skip_forward_icon.png;end_list;]" - .. "tooltip[end_list;" .. minetest.formspec_escape(S("Last page")) .. "]" + .. "tooltip[end_list;" .. F("Last page") .. "]" else formspec[n] = "image_button[" .. (8.2 + 0.65 * 0) .. ",5.8;.8,.8;ui_skip_backward_icon.png;start_list;]" - .. "tooltip[start_list;" .. minetest.formspec_escape(S("First page")) .. "]" + .. "tooltip[start_list;" .. F("First page") .. "]" .. "image_button[" .. (8.2 + 0.65 * 1) .. ",5.8;.8,.8;ui_left_icon.png;rewind1;]" - .. "tooltip[rewind1;" .. minetest.formspec_escape(S("Back one page")) .. "]" + .. "tooltip[rewind1;" .. F("Back one page") .. "]" .. "image_button[" .. (8.2 + 0.65 * 2) .. ",5.8;.8,.8;ui_right_icon.png;forward1;]" - .. "tooltip[forward1;" .. minetest.formspec_escape(S("Forward one page")) .. "]" + .. "tooltip[forward1;" .. F("Forward one page") .. "]" .. "image_button[" .. (8.2 + 0.65 * 3) .. ",5.8;.8,.8;ui_skip_forward_icon.png;end_list;]" - .. "tooltip[end_list;" .. minetest.formspec_escape(S("Last page")) .. "]" + .. "tooltip[end_list;" .. F("Last page") .. "]" end n = n+1 @@ -177,12 +178,12 @@ function unified_inventory.get_formspec(player, page) formspec[n] = "field[9.5,8.325;3,1;searchbox;;" .. minetest.formspec_escape(unified_inventory.current_searchbox[player_name]) .. "]" formspec[n+1] = "image_button[12.2,8.1;.8,.8;ui_search_icon.png;searchbutton;]" - .. "tooltip[searchbutton;" ..S("Search") .. "]" + .. "tooltip[searchbutton;" ..F("Search") .. "]" else formspec[n] = "field[8.5,5.225;2.2,1;searchbox;;" .. minetest.formspec_escape(unified_inventory.current_searchbox[player_name]) .. "]" formspec[n+1] = "image_button[10.3,5;.8,.8;ui_search_icon.png;searchbutton;]" - .. "tooltip[searchbutton;" ..S("Search") .. "]" + .. "tooltip[searchbutton;" ..F("Search") .. "]" end n = n+2 @@ -193,7 +194,7 @@ function unified_inventory.get_formspec(player, page) -- Items list if #unified_inventory.filtered_items_list[player_name] == 0 then - formspec[n] = "label[8.2,"..ui_peruser.form_header_y..";" .. S(no_matches) .. "]" + formspec[n] = "label[8.2,"..ui_peruser.form_header_y..";" .. F(no_matches) .. "]" else local dir = unified_inventory.active_search_direction[player_name] local list_index = unified_inventory.current_index[player_name] @@ -206,6 +207,18 @@ function unified_inventory.get_formspec(player, page) for x = 0, ui_peruser.pagecols - 1 do local name = unified_inventory.filtered_items_list[player_name][list_index] if minetest.registered_items[name] then + -- Clicked on current item: Flip crafting direction + if name == unified_inventory.current_item[player_name] then + local cdir = unified_inventory.current_craft_direction[player_name] + if cdir == "recipe" then + dir = "usage" + elseif cdir == "usage" then + dir = "recipe" + end + else + -- Default: use active search direction by default + dir = unified_inventory.active_search_direction[player_name] + end formspec[n] = "item_image_button[" ..(8.2 + x * 0.7).."," ..(ui_peruser.formspec_y + ui_peruser.page_y + y * 0.7)..";.81,.81;" @@ -216,13 +229,13 @@ function unified_inventory.get_formspec(player, page) end end end - formspec[n] = "label[8.2,"..ui_peruser.form_header_y..";"..S("Page") .. ": " + formspec[n] = "label[8.2,"..ui_peruser.form_header_y..";"..F("Page") .. ": " .. S("%s of %s"):format(page,pagemax).."]" end n= n+1 if unified_inventory.activefilter[player_name] ~= "" then - formspec[n] = "label[8.2,"..(ui_peruser.form_header_y + 0.4)..";" .. S("Filter") .. ":]" + formspec[n] = "label[8.2,"..(ui_peruser.form_header_y + 0.4)..";" .. F("Filter") .. ":]" formspec[n+1] = "label[9.1,"..(ui_peruser.form_header_y + 0.4)..";"..minetest.formspec_escape(unified_inventory.activefilter[player_name]).."]" end return table.concat(formspec, "") diff --git a/unified_inventory/locale/de.txt b/unified_inventory/locale/de.txt index d678b68..e652e49 100644 --- a/unified_inventory/locale/de.txt +++ b/unified_inventory/locale/de.txt @@ -1,71 +1,90 @@ # Translation mostly by Xanthin +### api.lua ### +Digging (by chance) = Graben (durch Zufall) + ### bags.lua ### -Bags = Rucksaecke -Bag 1 = Rucksack 1 -Bag 2 = Rucksack 2 -Bag 3 = Rucksack 3 -Bag 4 = Rucksack 4 -Small Bag = Rucksack (klein) -Medium Bag = Rucksack (mittel) -Large Bag = Rucksack (gross) +Bags = Taschen +Bag 1 = Tasche 1 +Bag 2 = Tasche 2 +Bag 3 = Tasche 3 +Bag 4 = Tasche 4 +Small Bag = Kleine Tasche +Medium Bag = Mittelgroße Tasche +Large Bag = Große Tasche ### inernal.lua ### First page = Erste Seite -Back three pages = Drei Seiten zurueckblaettern -Back one page = Eine Seiten zurueckblaettern -Forward one page = Eine Seiten vorblaettern -Forward three pages = Drei Seiten vorblaettern +Back three pages = Drei Seiten zurueckblättern +Back one page = Eine Seite zurueckblättern +Forward one page = Eine Seite vorblättern +Forward three pages = Drei Seiten vorblättern Last page = Letzte Seite No matching items = Keine passenden Gegenstände Page = Seite %s of %s = %s von %s -Filter = Suche +Filter = Filter Search = Suchen ### register.lua ### Can use the creative inventory = Kann das Kreativinventar nutzen -Home position set to: %s = Ausgangsposition nach: %s gesetzt -Time of day set to 6am = Tageszeit auf 6 Uhr morgens geaendert -You don't have the settime privilege! = Du hast nicht das "settime" Privileg! -Time of day set to 9pm = Tageszeit auf 9 Uhr abends geaendert -This button has been disabled outside of creative mode to prevent accidental inventory trashing. Use the trash slot instead. = Diese Funktion ist ausserhalb des Kreativmodus deaktiviert um ein versehentliches Loeschen des ganzen Inventars zu verhindern.\nNutze stattdessen das Muellfeld. -Inventory Cleared! = Inventar geleert! -Crafting = Bauen -Trash: = Muell: -Refill: = Nachfuellen: -Crafting Guide = Bauanleitung +Home position set to: %s = Heimatposition nach: %s gesetzt +Time of day set to 6am = Tageszeit auf 6 Uhr geändert +You don't have the settime privilege! = Du hast nicht das „settime“-Privileg! +Time of day set to 9pm = Tageszeit auf 21 Uhr geändert +This button has been disabled outside of creative mode to prevent accidental inventory trashing. Use the trash slot instead. = Diese Funktion ist außerhalb des Kreativmodus deaktiviert, um ein versehentliches Löschen des ganzen Inventars zu verhindern.\nNutze stattdessen das Müllfeld. +Inventory cleared! = Inventar geleert! +Crafting = Fertigung +Digging = Graben +Cooking = Kochen +Mixing = Mischen +Trash: = Müll: +Refill: = Nachfüllen: +Crafting Guide = Fertigungsführer Method: = Methode: Result: %s = Ergebnis: %s crafting = Bauen -shapeless crafting = Formloses Bauen +shapeless crafting = Formlose Fertigung cooking = Kochen alloy cooking = Legierung Kochen -Copy to craft grid: = Kopiere ins Baufeld: +Copy to craft grid: = Ins Fertigungsraster kopieren: All = Alles -Recipe %s of %s = Rezept %s von %s Alternate = Alternative -Crafting Grid = +Crafting Grid = Fertigungsraster +Recipe %d of %d = Rezept %d von %d +Usage %d of %d = Verwendung %d von %d +No recipes = Keine Rezepte +No usages = Keine Verwendungen +Result = Ergebnis +Ingredient = Zutat +Set time to day = Zur Tageszeit wechseln +Set time to night = Zur Nachtzeit wechseln +Set home position = Heimatposition setzen +Go home = Nach Hause gehen +Clear inventory = Inventar leeren +Give me: = Gib mir: +To craft grid: = Ins Fertigungsraster: ### waypoints.lua ### White = Weiß Yellow = Gelb Red = Rot -Green = Gruen +Green = Grün Blue = Blau -Waypoints = Markierungen -Waypoint active = Markierung aktiv -Waypoint inactive = Markierung inaktiv -World position = Welt Position -Name = -HUD text color = -Edit waypoint name = Name der Markierung aendern -Rename waypoint = Markierung umbenennen -Change color of waypoint display = Farbe der Darstellung der Markierung aendern -Set waypoint to current location = Setze Markierung zur derzeitigen Position -Make waypoint visible = Markierung sichtbar machen -Make waypoint invisible = Markierung verstecken -Disable display of waypoint coordinates = -Enable display of waypoint coordinates = -Finish editing = -Select Waypoint #%d = +Waypoints = Wegpunkte +Waypoint %d = Wegpunkt Nr. %d +Waypoint active = Wegpunkt aktiv +Waypoint inactive = Wegpunkt inaktiv +World position = Weltposition +Name = Name +HUD text color = HUD-Textfarbe +Edit waypoint name = Name des Wegpunkts ändern +Rename waypoint = Wegpunkt umbenennen +Change color of waypoint display = Farbe der Darstellung der Wegpunkte ändern +Set waypoint to current location = Setze Wegpunkt zur derzeitigen Position +Make waypoint visible = Wegpunkt sichtbar machen +Make waypoint invisible = Wegpunkt verstecken +Disable display of waypoint coordinates = Anzeige der Wegpunktkoordinaten deaktivieren +Enable display of waypoint coordinates = Anzeige der Wegpunktkoordinaten aktivieren +Finish editing = Bearbeitung abschließen +Select Waypoint #%d = Wegpunkt Nr. %d auswählen diff --git a/unified_inventory/locale/es.txt b/unified_inventory/locale/es.txt index 9382c79..26508fb 100644 --- a/unified_inventory/locale/es.txt +++ b/unified_inventory/locale/es.txt @@ -31,7 +31,7 @@ Time of day set to 6am = Hora del día cambiada a 6AM You don't have the settime priviledge! = ¡No tienes el privilegio `settime'! Time of day set to 9pm = Hora del día cambiada a 9PM This button has been disabled outside of creative mode to prevent accidental inventory trashing. Use the trash slot instead. = Éste botón ha sido deshabilitado para prevenir la destrucción accidental del inventario.\nUsa la ranura para basura en su lugar. -Inventory Cleared! = ¡Inventario limpio! +Inventory cleared! = ¡Inventario limpio! Crafting = Elaboración Trash: = Basura: Refill: = Rellenar: diff --git a/unified_inventory/locale/fr.txt b/unified_inventory/locale/fr.txt index 01e975e..e4923a0 100644 --- a/unified_inventory/locale/fr.txt +++ b/unified_inventory/locale/fr.txt @@ -31,7 +31,7 @@ Time of day set to 6am = Heure fixée à 6h You don't have the settime priviledge! = Vous n'avez pas le privilège 'settime' ! Time of day set to 9pm = Heure fixée à 21h This button has been disabled outside of creative mode to prevent accidental inventory trashing.\nUse the trash slot instead. = Ce bouton a été désactivé en dehors du mode créatif pour éviter des saccages dans l'inventaire.\nUtilisez plutôt la case poubelle. -Inventory Cleared! = Inventaire vidé ! +Inventory cleared! = Inventaire vidé ! Crafting = Création Trash: = Poubelle : Refill: = Remplir : diff --git a/unified_inventory/locale/pl.txt b/unified_inventory/locale/pl.txt index 33003d8..6173a5f 100644 --- a/unified_inventory/locale/pl.txt +++ b/unified_inventory/locale/pl.txt @@ -30,7 +30,7 @@ Time of day set to 6am = Czas ustawiony na 6:00 You don't have the settime priviledge! = Nie masz uprawnien do zmiany czasu (settime)! Time of day set to 9pm = Czas ustawiony na 21:00 This button has been disabled outside of creative mode to prevent accidental inventory trashing.\nUse the trash slot instead. = -Inventory Cleared! = +Inventory cleared! = Crafting = Trash: = Smietnik: Refill: = Uzupelnianie: diff --git a/unified_inventory/locale/ru.txt b/unified_inventory/locale/ru.txt index 1948155..821f2b1 100644 --- a/unified_inventory/locale/ru.txt +++ b/unified_inventory/locale/ru.txt @@ -31,7 +31,7 @@ Time of day set to 6am = Установлено время 6 утра You don't have the settime priviledge! = Вам не разрешено устанавливать время! Time of day set to 9pm = Установлено время 9 вечера This button has been disabled outside of creative mode to prevent accidental inventory trashing.\nUse the trash slot instead. = Эта кнопка отключена вне творческого режима, чтобы предотвратить случайное уничтожение предметов.\nИспользуйте слот корзины вместо нее. -Inventory Cleared! = Инвентарь очищен! +Inventory cleared! = Инвентарь очищен! Crafting = Крафт Trash: = Корзина: Refill: = Размножить: diff --git a/unified_inventory/locale/template.txt b/unified_inventory/locale/template.txt index ae382e3..e0e50f6 100644 --- a/unified_inventory/locale/template.txt +++ b/unified_inventory/locale/template.txt @@ -1,5 +1,8 @@ # Translation by +### api.lua ### +Digging (by chance) = + # Template ### bags.lua ### Bags = @@ -26,13 +29,17 @@ Search = ### register.lua ### Can use the creative inventory = +Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally = Home position set to: %s = Time of day set to 6am = You don't have the settime priviledge! = Time of day set to 9pm = This button has been disabled outside of creative mode to prevent accidental inventory trashing.\nUse the trash slot instead. = -Inventory Cleared! = +Inventory cleared! = Crafting = +Digging = +Cooking = +Mixing = Trash: = Refill: = Crafting Guide = @@ -44,9 +51,21 @@ cooking = alloy cooking = Copy to craft grid: = All = -Recipe %s of %s = Alternate = Crafting Grid = +Recipe %d of %d = +Usage %d of %d = +No recipes = +No usages = +Result = +Ingredient = +Set time to day = +Set time to night = +Set home position = +Go home = +Clear inventory = +Give me: = +To craft grid: = ### waypoints.lua ### White = @@ -55,6 +74,7 @@ Red = Green = Blue = Waypoints = +Waypoint %d = Waypoint active = Waypoint inactive = World position = diff --git a/unified_inventory/locale/tr.txt b/unified_inventory/locale/tr.txt index c1d3207..138e66c 100644 --- a/unified_inventory/locale/tr.txt +++ b/unified_inventory/locale/tr.txt @@ -31,7 +31,7 @@ Time of day set to 6am = Saat 06:00 olarak ayarlandı You don't have the settime priviledge = Saati düzenleme yetkiniz yok! Time of day set to 9pm = Saat 19:00 olarak ayarlandı This button has been disabled outside of creative mode to prevent accidental inventory trashing.\nUse the trash slot instead. = Yaratıcı modu dışında iken bu tuş kullanılamaz. -Inventory Cleared! = Envanter temizlendi! +Inventory cleared! = Envanter temizlendi! Crafting = Üretim Trash: = Çöp Refill: = Doldur 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, diff --git a/unified_inventory/screenshot.png b/unified_inventory/screenshot.png Binary files differindex 023ecdd..972cbb4 100644 --- a/unified_inventory/screenshot.png +++ b/unified_inventory/screenshot.png diff --git a/unified_inventory/textures/bags_large.png b/unified_inventory/textures/bags_large.png Binary files differindex 38cf6bc..6d56299 100644 --- a/unified_inventory/textures/bags_large.png +++ b/unified_inventory/textures/bags_large.png diff --git a/unified_inventory/textures/bags_medium.png b/unified_inventory/textures/bags_medium.png Binary files differindex f048690..59ba11d 100644 --- a/unified_inventory/textures/bags_medium.png +++ b/unified_inventory/textures/bags_medium.png diff --git a/unified_inventory/textures/bags_small.png b/unified_inventory/textures/bags_small.png Binary files differindex bf6fe6a..d48ffcb 100644 --- a/unified_inventory/textures/bags_small.png +++ b/unified_inventory/textures/bags_small.png diff --git a/unified_inventory/textures/ui_1_icon.png b/unified_inventory/textures/ui_1_icon.png Binary files differindex 43605e0..f4e85a0 100644 --- a/unified_inventory/textures/ui_1_icon.png +++ b/unified_inventory/textures/ui_1_icon.png diff --git a/unified_inventory/textures/ui_2_icon.png b/unified_inventory/textures/ui_2_icon.png Binary files differindex dd64510..96175a6 100644 --- a/unified_inventory/textures/ui_2_icon.png +++ b/unified_inventory/textures/ui_2_icon.png diff --git a/unified_inventory/textures/ui_3_icon.png b/unified_inventory/textures/ui_3_icon.png Binary files differindex 132dc3a..1db2916 100644 --- a/unified_inventory/textures/ui_3_icon.png +++ b/unified_inventory/textures/ui_3_icon.png diff --git a/unified_inventory/textures/ui_4_icon.png b/unified_inventory/textures/ui_4_icon.png Binary files differindex 9b7e430..f344af4 100644 --- a/unified_inventory/textures/ui_4_icon.png +++ b/unified_inventory/textures/ui_4_icon.png diff --git a/unified_inventory/textures/ui_5_icon.png b/unified_inventory/textures/ui_5_icon.png Binary files differindex 699e08b..e5dc4b0 100644 --- a/unified_inventory/textures/ui_5_icon.png +++ b/unified_inventory/textures/ui_5_icon.png diff --git a/unified_inventory/textures/ui_bags_icon.png b/unified_inventory/textures/ui_bags_icon.png Binary files differindex 38cf6bc..6d56299 100644 --- a/unified_inventory/textures/ui_bags_icon.png +++ b/unified_inventory/textures/ui_bags_icon.png diff --git a/unified_inventory/textures/ui_bags_lg_form.png b/unified_inventory/textures/ui_bags_lg_form.png Binary files differindex 15f511d..713cacc 100644 --- a/unified_inventory/textures/ui_bags_lg_form.png +++ b/unified_inventory/textures/ui_bags_lg_form.png diff --git a/unified_inventory/textures/ui_bags_main_form.png b/unified_inventory/textures/ui_bags_main_form.png Binary files differindex 26e6938..37450f3 100644 --- a/unified_inventory/textures/ui_bags_main_form.png +++ b/unified_inventory/textures/ui_bags_main_form.png diff --git a/unified_inventory/textures/ui_bags_med_form.png b/unified_inventory/textures/ui_bags_med_form.png Binary files differindex f786806..33e922e 100644 --- a/unified_inventory/textures/ui_bags_med_form.png +++ b/unified_inventory/textures/ui_bags_med_form.png diff --git a/unified_inventory/textures/ui_bags_sm_form.png b/unified_inventory/textures/ui_bags_sm_form.png Binary files differindex c77ff7c..b3b66bb 100644 --- a/unified_inventory/textures/ui_bags_sm_form.png +++ b/unified_inventory/textures/ui_bags_sm_form.png diff --git a/unified_inventory/textures/ui_blank_image.png b/unified_inventory/textures/ui_blank_image.png Binary files differindex f9bcda2..a8735b8 100644 --- a/unified_inventory/textures/ui_blank_image.png +++ b/unified_inventory/textures/ui_blank_image.png diff --git a/unified_inventory/textures/ui_blue_icon_background.png b/unified_inventory/textures/ui_blue_icon_background.png Binary files differindex b4fa356..9434217 100644 --- a/unified_inventory/textures/ui_blue_icon_background.png +++ b/unified_inventory/textures/ui_blue_icon_background.png diff --git a/unified_inventory/textures/ui_circular_arrows_icon.png b/unified_inventory/textures/ui_circular_arrows_icon.png Binary files differindex 968e404..d687bbf 100644 --- a/unified_inventory/textures/ui_circular_arrows_icon.png +++ b/unified_inventory/textures/ui_circular_arrows_icon.png diff --git a/unified_inventory/textures/ui_craft_icon.png b/unified_inventory/textures/ui_craft_icon.png Binary files differindex 8884c61..fbe4cc7 100644 --- a/unified_inventory/textures/ui_craft_icon.png +++ b/unified_inventory/textures/ui_craft_icon.png diff --git a/unified_inventory/textures/ui_craftgrid_icon.png b/unified_inventory/textures/ui_craftgrid_icon.png Binary files differindex 5b8025a..6731327 100644 --- a/unified_inventory/textures/ui_craftgrid_icon.png +++ b/unified_inventory/textures/ui_craftgrid_icon.png diff --git a/unified_inventory/textures/ui_craftguide_form.png b/unified_inventory/textures/ui_craftguide_form.png Binary files differindex 72572b5..3cd8643 100644 --- a/unified_inventory/textures/ui_craftguide_form.png +++ b/unified_inventory/textures/ui_craftguide_form.png diff --git a/unified_inventory/textures/ui_craftguide_icon.png b/unified_inventory/textures/ui_craftguide_icon.png Binary files differindex d5b76d2..5866b7b 100644 --- a/unified_inventory/textures/ui_craftguide_icon.png +++ b/unified_inventory/textures/ui_craftguide_icon.png diff --git a/unified_inventory/textures/ui_crafting_form.png b/unified_inventory/textures/ui_crafting_form.png Binary files differindex 420323c..02d337d 100644 --- a/unified_inventory/textures/ui_crafting_form.png +++ b/unified_inventory/textures/ui_crafting_form.png diff --git a/unified_inventory/textures/ui_doubleleft_icon.png b/unified_inventory/textures/ui_doubleleft_icon.png Binary files differindex ca1f66f..587bb25 100644 --- a/unified_inventory/textures/ui_doubleleft_icon.png +++ b/unified_inventory/textures/ui_doubleleft_icon.png diff --git a/unified_inventory/textures/ui_doubleright_icon.png b/unified_inventory/textures/ui_doubleright_icon.png Binary files differindex 995b565..f552acc 100644 --- a/unified_inventory/textures/ui_doubleright_icon.png +++ b/unified_inventory/textures/ui_doubleright_icon.png diff --git a/unified_inventory/textures/ui_form_bg.png b/unified_inventory/textures/ui_form_bg.png Binary files differindex 37683f0..74a6a3b 100644 --- a/unified_inventory/textures/ui_form_bg.png +++ b/unified_inventory/textures/ui_form_bg.png diff --git a/unified_inventory/textures/ui_gohome_icon.png b/unified_inventory/textures/ui_gohome_icon.png Binary files differindex 1141055..b3397ef 100644 --- a/unified_inventory/textures/ui_gohome_icon.png +++ b/unified_inventory/textures/ui_gohome_icon.png diff --git a/unified_inventory/textures/ui_green_icon_background.png b/unified_inventory/textures/ui_green_icon_background.png Binary files differindex 21b4f41..b06c29c 100644 --- a/unified_inventory/textures/ui_green_icon_background.png +++ b/unified_inventory/textures/ui_green_icon_background.png diff --git a/unified_inventory/textures/ui_group.png b/unified_inventory/textures/ui_group.png Binary files differindex d7f5dce..2e4714a 100644 --- a/unified_inventory/textures/ui_group.png +++ b/unified_inventory/textures/ui_group.png diff --git a/unified_inventory/textures/ui_home_icon.png b/unified_inventory/textures/ui_home_icon.png Binary files differindex eeb4e04..e44419d 100644 --- a/unified_inventory/textures/ui_home_icon.png +++ b/unified_inventory/textures/ui_home_icon.png diff --git a/unified_inventory/textures/ui_left_icon.png b/unified_inventory/textures/ui_left_icon.png Binary files differindex 14ad064..68cffb8 100644 --- a/unified_inventory/textures/ui_left_icon.png +++ b/unified_inventory/textures/ui_left_icon.png diff --git a/unified_inventory/textures/ui_main_inventory.png b/unified_inventory/textures/ui_main_inventory.png Binary files differindex b65dabb..3d380de 100644 --- a/unified_inventory/textures/ui_main_inventory.png +++ b/unified_inventory/textures/ui_main_inventory.png diff --git a/unified_inventory/textures/ui_misc_form.png b/unified_inventory/textures/ui_misc_form.png Binary files differindex d34d326..e74a605 100644 --- a/unified_inventory/textures/ui_misc_form.png +++ b/unified_inventory/textures/ui_misc_form.png diff --git a/unified_inventory/textures/ui_moon_icon.png b/unified_inventory/textures/ui_moon_icon.png Binary files differindex 0595a6c..b2d7b44 100644 --- a/unified_inventory/textures/ui_moon_icon.png +++ b/unified_inventory/textures/ui_moon_icon.png diff --git a/unified_inventory/textures/ui_no.png b/unified_inventory/textures/ui_no.png Binary files differindex ad9470b..aa98ed6 100644 --- a/unified_inventory/textures/ui_no.png +++ b/unified_inventory/textures/ui_no.png diff --git a/unified_inventory/textures/ui_off_icon.png b/unified_inventory/textures/ui_off_icon.png Binary files differindex 1933742..319fc6e 100644 --- a/unified_inventory/textures/ui_off_icon.png +++ b/unified_inventory/textures/ui_off_icon.png diff --git a/unified_inventory/textures/ui_ok_icon.png b/unified_inventory/textures/ui_ok_icon.png Binary files differindex e22b2bc..dcbda1d 100644 --- a/unified_inventory/textures/ui_ok_icon.png +++ b/unified_inventory/textures/ui_ok_icon.png diff --git a/unified_inventory/textures/ui_on_icon.png b/unified_inventory/textures/ui_on_icon.png Binary files differindex bb34ceb..a9884cf 100644 --- a/unified_inventory/textures/ui_on_icon.png +++ b/unified_inventory/textures/ui_on_icon.png diff --git a/unified_inventory/textures/ui_pencil_icon.png b/unified_inventory/textures/ui_pencil_icon.png Binary files differindex ab5ed5e..a73b740 100644 --- a/unified_inventory/textures/ui_pencil_icon.png +++ b/unified_inventory/textures/ui_pencil_icon.png diff --git a/unified_inventory/textures/ui_red_icon_background.png b/unified_inventory/textures/ui_red_icon_background.png Binary files differindex c925689..67f5dcc 100644 --- a/unified_inventory/textures/ui_red_icon_background.png +++ b/unified_inventory/textures/ui_red_icon_background.png diff --git a/unified_inventory/textures/ui_right_icon.png b/unified_inventory/textures/ui_right_icon.png Binary files differindex ab0195c..1f11868 100644 --- a/unified_inventory/textures/ui_right_icon.png +++ b/unified_inventory/textures/ui_right_icon.png diff --git a/unified_inventory/textures/ui_search_icon.png b/unified_inventory/textures/ui_search_icon.png Binary files differindex c64900e..b529e43 100644 --- a/unified_inventory/textures/ui_search_icon.png +++ b/unified_inventory/textures/ui_search_icon.png diff --git a/unified_inventory/textures/ui_sethome_icon.png b/unified_inventory/textures/ui_sethome_icon.png Binary files differindex b047102..5c56d64 100644 --- a/unified_inventory/textures/ui_sethome_icon.png +++ b/unified_inventory/textures/ui_sethome_icon.png diff --git a/unified_inventory/textures/ui_skip_backward_icon.png b/unified_inventory/textures/ui_skip_backward_icon.png Binary files differindex 92e9e8c..fde4fea 100644 --- a/unified_inventory/textures/ui_skip_backward_icon.png +++ b/unified_inventory/textures/ui_skip_backward_icon.png diff --git a/unified_inventory/textures/ui_skip_forward_icon.png b/unified_inventory/textures/ui_skip_forward_icon.png Binary files differindex f046b4f..182e7ed 100644 --- a/unified_inventory/textures/ui_skip_forward_icon.png +++ b/unified_inventory/textures/ui_skip_forward_icon.png diff --git a/unified_inventory/textures/ui_sun_icon.png b/unified_inventory/textures/ui_sun_icon.png Binary files differindex 5bd24fb..262b1f3 100644 --- a/unified_inventory/textures/ui_sun_icon.png +++ b/unified_inventory/textures/ui_sun_icon.png diff --git a/unified_inventory/textures/ui_trash_icon.png b/unified_inventory/textures/ui_trash_icon.png Binary files differindex 412573c..081bac7 100644 --- a/unified_inventory/textures/ui_trash_icon.png +++ b/unified_inventory/textures/ui_trash_icon.png diff --git a/unified_inventory/textures/ui_waypoint_set_icon.png b/unified_inventory/textures/ui_waypoint_set_icon.png Binary files differindex ee44c4c..6eb9d19 100644 --- a/unified_inventory/textures/ui_waypoint_set_icon.png +++ b/unified_inventory/textures/ui_waypoint_set_icon.png diff --git a/unified_inventory/textures/ui_waypoints_icon.png b/unified_inventory/textures/ui_waypoints_icon.png Binary files differindex e0281af..530c1d7 100644 --- a/unified_inventory/textures/ui_waypoints_icon.png +++ b/unified_inventory/textures/ui_waypoints_icon.png diff --git a/unified_inventory/textures/ui_xyz_icon.png b/unified_inventory/textures/ui_xyz_icon.png Binary files differindex dabea81..9b48acb 100644 --- a/unified_inventory/textures/ui_xyz_icon.png +++ b/unified_inventory/textures/ui_xyz_icon.png diff --git a/unified_inventory/textures/ui_xyz_off_icon.png b/unified_inventory/textures/ui_xyz_off_icon.png Binary files differindex 8e45946..3c1836e 100644 --- a/unified_inventory/textures/ui_xyz_off_icon.png +++ b/unified_inventory/textures/ui_xyz_off_icon.png diff --git a/unified_inventory/textures/ui_xyz_on_icon.png b/unified_inventory/textures/ui_xyz_on_icon.png Binary files differindex dabea81..9b48acb 100644 --- a/unified_inventory/textures/ui_xyz_on_icon.png +++ b/unified_inventory/textures/ui_xyz_on_icon.png diff --git a/unified_inventory/waypoints.lua b/unified_inventory/waypoints.lua index a8e4762..3ab7eb7 100644 --- a/unified_inventory/waypoints.lua +++ b/unified_inventory/waypoints.lua @@ -1,4 +1,5 @@ local S = unified_inventory.gettext +local F = unified_inventory.fgettext local hud_colors = { {"#FFFFFF", 0xFFFFFF, S("White")}, @@ -24,7 +25,7 @@ unified_inventory.register_page("waypoints", { local waypoints = datastorage.get(player_name, "waypoints") local formspec = "background[0,4.5;8,4;ui_main_inventory.png]" .. "image[0,0;1,1;ui_waypoints_icon.png]" .. - "label[1,0;" .. S("Waypoints") .. "]" + "label[1,0;" .. F("Waypoints") .. "]" -- Tabs buttons: for i = 1, 5, 1 do @@ -34,13 +35,13 @@ unified_inventory.register_page("waypoints", { "ui_" .. i .. "_icon.png;" .. "select_waypoint" .. i .. ";]" .. "tooltip[select_waypoint" .. i .. ";" - .. minetest.formspec_escape(S("Select Waypoint #%d"):format(i)).."]" + .. (S("Select Waypoint #%d"):format(i)).."]" end local i = waypoints.selected or 1 local waypoint = waypoints[i] or {} local temp = waypoints_temp[player_name][i] or {} - local default_name = "Waypoint "..i + local default_name = string.format(S("Waypoint %d"), i) -- Main buttons: formspec = formspec .. @@ -48,43 +49,43 @@ unified_inventory.register_page("waypoints", { "ui_waypoint_set_icon.png;".. "set_waypoint"..i..";]".. "tooltip[set_waypoint" .. i .. ";" - .. minetest.formspec_escape(S("Set waypoint to current location")).."]" + .. F("Set waypoint to current location").."]" formspec = formspec .. "image_button[5.2,3.7;.8,.8;".. (waypoint.active and "ui_on_icon.png" or "ui_off_icon.png")..";".. "toggle_waypoint"..i..";]".. "tooltip[toggle_waypoint" .. i .. ";" - .. minetest.formspec_escape(S("Make waypoint " - ..(waypoint.active and "invisible" or "visible"))).."]" + .. F("Make waypoint " + ..(waypoint.active and "invisible" or "visible")).."]" formspec = formspec .. "image_button[5.9,3.7;.8,.8;".. (waypoint.display_pos and "ui_green_icon_background.png" or "ui_red_icon_background.png").."^ui_xyz_icon.png;".. "toggle_display_pos" .. i .. ";]".. "tooltip[toggle_display_pos" .. i .. ";" - .. minetest.formspec_escape(S((waypoint.display_pos and "Disable" or "Enable") - .." display of waypoint coordinates")).."]" + .. F((waypoint.display_pos and "Disable" or "Enable") + .." display of waypoint coordinates").."]" formspec = formspec .. "image_button[6.6,3.7;.8,.8;".. "ui_circular_arrows_icon.png;".. "toggle_color"..i..";]".. "tooltip[toggle_color" .. i .. ";" - .. minetest.formspec_escape(S("Change color of waypoint display")).."]" + .. F("Change color of waypoint display").."]" formspec = formspec .. "image_button[7.3,3.7;.8,.8;".. "ui_pencil_icon.png;".. "rename_waypoint"..i..";]".. "tooltip[rename_waypoint" .. i .. ";" - .. minetest.formspec_escape(S("Edit waypoint name")).."]" + .. F("Edit waypoint name").."]" -- Waypoint's info: if waypoint.active then - formspec = formspec .. "label[1,0.8;"..S("Waypoint active").."]" + formspec = formspec .. "label[1,0.8;"..F("Waypoint active").."]" else - formspec = formspec .. "label[1,0.8;"..S("Waypoint inactive").."]" + formspec = formspec .. "label[1,0.8;"..F("Waypoint inactive").."]" end if temp.edit then @@ -95,13 +96,13 @@ unified_inventory.register_page("waypoints", { "ui_ok_icon.png;".. "confirm_rename"..i.. ";]".. "tooltip[confirm_rename" .. i .. ";" - .. minetest.formspec_escape(S("Finish editing")).."]" + .. F("Finish editing").."]" end - formspec = formspec .. "label[1,1.3;"..S("World position")..": " .. + formspec = formspec .. "label[1,1.3;"..F("World position")..": " .. minetest.pos_to_string(waypoint.world_pos or vector.new()) .. "]" .. - "label[1,1.8;"..S("Name")..": ".. (waypoint.name or default_name) .. "]" .. - "label[1,2.3;"..S("HUD text color")..": " .. + "label[1,1.8;"..F("Name")..": ".. (waypoint.name or default_name) .. "]" .. + "label[1,2.3;"..F("HUD text color")..": " .. hud_colors[waypoint.color or 1][3] .. "]" return {formspec=formspec} |