Codebase list minetest-mod-unified-inventory / 3d6c00e
Import upstream version 20180810+git20210525.1.afd38e0 Debian Janitor 2 years ago
100 changed file(s) with 3347 addition(s) and 3340 deletion(s). Raw diff Collapse all Expand all
0 on: [push, pull_request]
1 name: Check & Release
2 jobs:
3 lint:
4 runs-on: ubuntu-latest
5 steps:
6 - uses: actions/checkout@master
7 - name: lint
8 uses: Roang-zero1/factorio-mod-luacheck@master
9 with:
10 luacheckrc_url: https://raw.githubusercontent.com/minetest-mods/unified_inventory/master/.luacheckrc
0 unused_args = false
1 allow_defined_top = true
2 max_line_length = 999
3
4 globals = {
5 "unified_inventory",
6 }
7
8 read_globals = {
9 string = {fields = {"split", "trim"}},
10 table = {fields = {"copy", "getn"}},
11
12 "minetest", "vector",
13 "ItemStack", "datastorage",
14
15 "hb",
16 "doors",
17 }
18
19 files["callbacks.lua"].ignore = { "player", "draw_lite_mode" }
20 files["bags.lua"].ignore = { "player" }
0 Unified Inventory for Minetest
1 Copyright (C) 2012-2014 Maciej Kasatkin (RealBadAngel)
2
3 This library is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Library General Public
5 License as published by the Free Software Foundation; either
6 version 2 of the License, or (at your option) any later version.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public
14 License along with this library; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
17 Contact information:
18 Examine a git patch to get the contributor's email address.
0 Unified inventory
1 =================
0 # Unified Inventory
1
2 [![](https://github.com/minetest-mods/unified_inventory/workflows/Check%20&%20Release/badge.svg)](https://github.com/minetest-mods/unified_inventory/actions)
3
4 ![Screenshot](screenshot.png)
25
36 Unified Inventory replaces the default survival and creative inventory.
4 It adds a nicer interface and a number of features, such as a crafting guide.
57
6 License
7 =======
8
9 ## Features
10
11 * Node, item and tool browser
12 * Crafting guide
13 * Can copy the recipe to the crafting grid
14 * Recipe search function by ingredients
15 * Up to four bags with up to 24 slots each
16 * Home function to teleport
17 * Trash slot
18 * Lite mode: reduces the item browser width
19 * `minetest.conf` setting `unified_inventory_lite = true`
20 * Mod API for modders: see [mod_api.txt](doc/mod_api.txt)
21 * Setting-determinated features: see [settingtypes.txt](settingtypes.txt)
22
23
24 ## Requirements
25
26 * Minetest 5.4.0+
27
28 # Licenses
829
930 Copyright (C) 2012-2014 Maciej Kasatkin (RealBadAngel)
1031
11 Unified inventory code is licensed under the GNU LGPLv2+.
32 Copyright (C) 2012-? Various minetest-mods contributors
1233
13 Licenses for textures:
34
35 ## Code
36
37 GNU LGPLv2+, see [license notice](LICENSE.txt)
38
39
40 ## Textures
1441
1542 VanessaE: (CC-BY-4.0)
43
1644 * `ui_group.png`
1745
1846 Tango Project: (Public Domain, CC-BY-4.0)
47
1948 * [`ui_reset_icon.png`](https://commons.wikimedia.org/wiki/File:Edit-clear.svg)
2049 * [`ui_doubleleft_icon.png`](http://commons.wikimedia.org/wiki/File:Media-seek-backward.svg)
2150 * [`ui_doubleright_icon.png`](http://commons.wikimedia.org/wiki/File:Media-seek-forward.svg)
2453 * [`ui_skip_forward_icon.png`](http://commons.wikimedia.org/wiki/File:Media-skip-forward.svg)
2554
2655 From http://www.clker.com (Public Domain, CC-BY-4.0):
56
2757 * [`bags_small.png`](http://www.clker.com/clipart-moneybag-empty.html)
2858 * [`bags_medium.png`](http://www.clker.com/clipart-backpack-1.html)
2959 * [`bags_large.png` / `ui_bags_icon.png`](http://www.clker.com/clipart-backpack-green-brown.html)
3666 * [`ui_waypoint_set_icon.png`](http://www.clker.com/clipart-larger-flag.html)
3767
3868 Everaldo Coelho (YellowIcon) (LGPL v2.1+):
69
3970 * [`ui_craftguide_icon.png` / `ui_craft_icon.png`](http://commons.wikimedia.org/wiki/File:Advancedsettings.png)
4071
4172 Gregory H. Revera: (CC-BY-SA 3.0)
73
4274 * [`ui_moon_icon.png`](http://commons.wikimedia.org/wiki/File:FullMoon2010.jpg)
4375
4476 Thomas Bresson: (CC-BY 3.0)
77
4578 * [`ui_sun_icon.png`](http://commons.wikimedia.org/wiki/File:2012-10-13_15-29-35-sun.jpg)
4679
4780 Fibonacci: (Public domain, CC-BY 4.0)
81
4882 * [`ui_xyz_off_icon.png`](http://commons.wikimedia.org/wiki/File:No_sign.svg)
4983
5084 Gregory Maxwell: (Public domain, CC-BY 4.0)
85
5186 * [`ui_ok_icon.png`](http://commons.wikimedia.org/wiki/File:Yes_check.svg)
5287
5388 Adrien Facélina: (LGPL v2.1+)
89
5490 * [`inventory_plus_worldedit_gui.png`](http://commons.wikimedia.org/wiki/File:Erioll_world_2.svg)
5591
5692 Other files from Wikimedia Commons:
93
5794 * [`ui_gohome_icon.png` / `ui_home_icon.png` / `ui_sethome_icon.png`](http://commons.wikimedia.org/wiki/File:Home_256x256.png) (GPL v2+)
5895
5996 RealBadAngel: (CC-BY-4.0)
60 * Everything else.
97
98 * Everything else.
0 local S = unified_inventory.gettext
0 local S = minetest.get_translator("unified_inventory")
11 local F = minetest.formspec_escape
2 local ui = unified_inventory
23
34 -- Create detached creative inventory after loading all mods
45 minetest.after(0.01, function()
78 if not rev_aliases[target] then rev_aliases[target] = {} end
89 table.insert(rev_aliases[target], source)
910 end
10 unified_inventory.items_list = {}
11 ui.items_list = {}
1112 for name, def in pairs(minetest.registered_items) do
1213 if (not def.groups.not_in_creative_inventory or
1314 def.groups.not_in_creative_inventory == 0) and
1415 def.description and def.description ~= "" then
15 table.insert(unified_inventory.items_list, name)
16 table.insert(ui.items_list, name)
1617 local all_names = rev_aliases[name] or {}
1718 table.insert(all_names, name)
18 for _, name in ipairs(all_names) do
19 local recipes = minetest.get_all_craft_recipes(name)
19 for _, player_name in ipairs(all_names) do
20 local recipes = minetest.get_all_craft_recipes(player_name)
2021 if recipes then
2122 for _, recipe in ipairs(recipes) do
2223
2526 for _,chk in pairs(recipe.items) do
2627 local groupchk = string.find(chk, "group:")
2728 if (not groupchk and not minetest.registered_items[chk])
28 or (groupchk and not unified_inventory.get_group_item(string.gsub(chk, "group:", "")).item)
29 or (groupchk and not ui.get_group_item(string.gsub(chk, "group:", "")).item)
2930 or minetest.get_item_group(chk, "not_in_craft_guide") ~= 0 then
3031 unknowns = true
3132 end
3233 end
3334
3435 if not unknowns then
35 unified_inventory.register_craft(recipe)
36 ui.register_craft(recipe)
3637 end
3738 end
3839 end
3940 end
4041 end
4142 end
42 table.sort(unified_inventory.items_list)
43 unified_inventory.items_list_size = #unified_inventory.items_list
44 print("Unified Inventory. inventory size: "..unified_inventory.items_list_size)
45 for _, name in ipairs(unified_inventory.items_list) do
43 table.sort(ui.items_list)
44 ui.items_list_size = #ui.items_list
45 print("Unified Inventory. inventory size: "..ui.items_list_size)
46 for _, name in ipairs(ui.items_list) do
4647 local def = minetest.registered_items[name]
4748 -- Simple drops
4849 if type(def.drop) == "string" then
4950 local dstack = ItemStack(def.drop)
5051 if not dstack:is_empty() and dstack:get_name() ~= name then
51 unified_inventory.register_craft({
52 ui.register_craft({
5253 type = "digging",
5354 items = {name},
5455 output = def.drop,
114115 end
115116 end
116117 for itemstring, count in pairs(drop_guaranteed) do
117 unified_inventory.register_craft({
118 ui.register_craft({
118119 type = "digging",
119120 items = {name},
120121 output = itemstring .. " " .. count,
122123 })
123124 end
124125 for itemstring, count in pairs(drop_maybe) do
125 unified_inventory.register_craft({
126 ui.register_craft({
126127 type = "digging_chance",
127128 items = {name},
128129 output = itemstring .. " " .. count,
131132 end
132133 end
133134 end
134 for _, recipes in pairs(unified_inventory.crafts_for.recipe) do
135 for _, recipes in pairs(ui.crafts_for.recipe) do
135136 for _, recipe in ipairs(recipes) do
136137 local ingredient_items = {}
137138 for _, spec in pairs(recipe.items) do
138 local matches_spec = unified_inventory.canonical_item_spec_matcher(spec)
139 for _, name in ipairs(unified_inventory.items_list) do
139 local matches_spec = ui.canonical_item_spec_matcher(spec)
140 for _, name in ipairs(ui.items_list) do
140141 if matches_spec(name) then
141142 ingredient_items[name] = true
142143 end
143144 end
144145 end
145146 for name, _ in pairs(ingredient_items) do
146 if unified_inventory.crafts_for.usage[name] == nil then
147 unified_inventory.crafts_for.usage[name] = {}
147 if ui.crafts_for.usage[name] == nil then
148 ui.crafts_for.usage[name] = {}
148149 end
149 table.insert(unified_inventory.crafts_for.usage[name], recipe)
150 table.insert(ui.crafts_for.usage[name], recipe)
150151 end
151152 end
152153 end
155156
156157 -- load_home
157158 local function load_home()
158 local input = io.open(unified_inventory.home_filename, "r")
159 local input = io.open(ui.home_filename, "r")
159160 if not input then
160 unified_inventory.home_pos = {}
161 ui.home_pos = {}
161162 return
162163 end
163164 while true do
166167 local y = input:read("*n")
167168 local z = input:read("*n")
168169 local name = input:read("*l")
169 unified_inventory.home_pos[name:sub(2)] = {x = x, y = y, z = z}
170 ui.home_pos[name:sub(2)] = {x = x, y = y, z = z}
170171 end
171172 io.close(input)
172173 end
173174 load_home()
174175
175 function unified_inventory.set_home(player, pos)
176 function ui.set_home(player, pos)
176177 local player_name = player:get_player_name()
177 unified_inventory.home_pos[player_name] = vector.round(pos)
178 ui.home_pos[player_name] = vector.round(pos)
179
178180 -- save the home data from the table to the file
179 local output = io.open(unified_inventory.home_filename, "w")
180 for k, v in pairs(unified_inventory.home_pos) do
181 local output = io.open(ui.home_filename, "w")
182 if not output then
183 minetest.log("warning", "[unified_inventory] Failed to save file: "
184 .. ui.home_filename)
185 return
186 end
187 for k, v in pairs(ui.home_pos) do
181188 output:write(v.x.." "..v.y.." "..v.z.." "..k.."\n")
182189 end
183190 io.close(output)
184191 end
185192
186 function unified_inventory.go_home(player)
187 local pos = unified_inventory.home_pos[player:get_player_name()]
193 function ui.go_home(player)
194 local pos = ui.home_pos[player:get_player_name()]
188195 if pos then
189 player:setpos(pos)
190 end
196 player:set_pos(pos)
197 return true
198 end
199 return false
191200 end
192201
193202 -- register_craft
194 function unified_inventory.register_craft(options)
203 function ui.register_craft(options)
195204 if not options.output then
196205 return
197206 end
202211 if options.type == "normal" and options.width == 0 then
203212 options = { type = "shapeless", items = options.items, output = options.output, width = 0 }
204213 end
205 if not unified_inventory.crafts_for.recipe[itemstack:get_name()] then
206 unified_inventory.crafts_for.recipe[itemstack:get_name()] = {}
207 end
208 table.insert(unified_inventory.crafts_for.recipe[itemstack:get_name()],options)
214 if not ui.crafts_for.recipe[itemstack:get_name()] then
215 ui.crafts_for.recipe[itemstack:get_name()] = {}
216 end
217 table.insert(ui.crafts_for.recipe[itemstack:get_name()],options)
209218 end
210219
211220
216225 }
217226
218227
219 function unified_inventory.craft_type_defaults(name, options)
228 function ui.craft_type_defaults(name, options)
220229 if not options.description then
221230 options.description = name
222231 end
225234 end
226235
227236
228 function unified_inventory.register_craft_type(name, options)
229 unified_inventory.registered_craft_types[name] =
230 unified_inventory.craft_type_defaults(name, options)
231 end
232
233
234 unified_inventory.register_craft_type("normal", {
237 function ui.register_craft_type(name, options)
238 ui.registered_craft_types[name] =
239 ui.craft_type_defaults(name, options)
240 end
241
242
243 ui.register_craft_type("normal", {
235244 description = F(S("Crafting")),
236245 icon = "ui_craftgrid_icon.png",
237246 width = 3,
247256 })
248257
249258
250 unified_inventory.register_craft_type("shapeless", {
259 ui.register_craft_type("shapeless", {
251260 description = F(S("Mixing")),
252261 icon = "ui_craftgrid_icon.png",
253262 width = 3,
262271 })
263272
264273
265 unified_inventory.register_craft_type("cooking", {
274 ui.register_craft_type("cooking", {
266275 description = F(S("Cooking")),
267276 icon = "default_furnace_front.png",
268277 width = 1,
270279 })
271280
272281
273 unified_inventory.register_craft_type("digging", {
282 ui.register_craft_type("digging", {
274283 description = F(S("Digging")),
275284 icon = "default_tool_steelpick.png",
276285 width = 1,
277286 height = 1,
278287 })
279288
280 unified_inventory.register_craft_type("digging_chance", {
289 ui.register_craft_type("digging_chance", {
281290 description = "Digging (by chance)",
282291 icon = "default_tool_steelpick.png^[transformFY.png",
283292 width = 1,
284293 height = 1,
285294 })
286295
287 function unified_inventory.register_page(name, def)
288 unified_inventory.pages[name] = def
289 end
290
291
292 function unified_inventory.register_button(name, def)
296 function ui.register_page(name, def)
297 ui.pages[name] = def
298 end
299
300
301 function ui.register_button(name, def)
293302 if not def.action then
294303 def.action = function(player)
295 unified_inventory.set_inventory_formspec(player, name)
304 ui.set_inventory_formspec(player, name)
296305 end
297306 end
298307 def.name = name
299 table.insert(unified_inventory.buttons, def)
300 end
301
302
303 function unified_inventory.is_creative(playername)
308 table.insert(ui.buttons, def)
309 end
310
311 function ui.is_creative(playername)
304312 return minetest.check_player_privs(playername, {creative=true})
305313 or minetest.settings:get_bool("creative_mode")
306314 end
307315
316 function ui.single_slot(xpos, ypos, bright)
317 return string.format("background9[%f,%f;%f,%f;ui_single_slot%s.png;false;16]",
318 xpos, ypos, ui.imgscale, ui.imgscale, (bright and "_bright" or "") )
319 end
320
321 function ui.make_trash_slot(xpos, ypos)
322 return
323 ui.single_slot(xpos, ypos)..
324 "image["..xpos..","..ypos..";1.25,1.25;ui_trash_slot_icon.png]"..
325 "list[detached:trash;main;"..(xpos + ui.list_img_offset)..","..(ypos + ui.list_img_offset)..";1,1;]"
326 end
327
328 function ui.make_inv_img_grid(xpos, ypos, width, height, bright)
329 local tiled = {}
330 local n=1
331 for y = 0, (height - 1) do
332 for x = 0, (width -1) do
333 tiled[n] = ui.single_slot(xpos + (ui.imgscale * x), ypos + (ui.imgscale * y), bright)
334 n = n + 1
335 end
336 end
337 return table.concat(tiled)
338 end
0 -- Bags for Minetest
1
2 -- Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com>
3 -- License: GPLv3
4
5 local S = unified_inventory.gettext
0 --[[
1 Bags for Minetest
2
3 Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com>
4 License: GPLv3
5 --]]
6
7 local S = minetest.get_translator("unified_inventory")
68 local F = minetest.formspec_escape
7
8 unified_inventory.register_page("bags", {
9 local ui = unified_inventory
10
11 ui.register_page("bags", {
912 get_formspec = function(player)
1013 local player_name = player:get_player_name()
11 local formspec = "background[0.06,0.99;7.92,7.52;ui_bags_main_form.png]"
12 formspec = formspec.."label[0,0;"..F(S("Bags")).."]"
13 formspec = formspec.."button[0,2;2,0.5;bag1;"..F(S("Bag @1", 1)).."]"
14 formspec = formspec.."button[2,2;2,0.5;bag2;"..F(S("Bag @1", 2)).."]"
15 formspec = formspec.."button[4,2;2,0.5;bag3;"..F(S("Bag @1", 3)).."]"
16 formspec = formspec.."button[6,2;2,0.5;bag4;"..F(S("Bag @1", 4)).."]"
17 formspec = formspec.."listcolors[#00000000;#00000000]"
18 formspec = formspec.."list[detached:"..F(player_name).."_bags;bag1;0.5,1;1,1;]"
19 formspec = formspec.."list[detached:"..F(player_name).."_bags;bag2;2.5,1;1,1;]"
20 formspec = formspec.."list[detached:"..F(player_name).."_bags;bag3;4.5,1;1,1;]"
21 formspec = formspec.."list[detached:"..F(player_name).."_bags;bag4;6.5,1;1,1;]"
22 return {formspec=formspec}
14 return { formspec = table.concat({
15 ui.style_full.standard_inv_bg,
16 ui.single_slot(0.925, 1.5),
17 ui.single_slot(3.425, 1.5),
18 ui.single_slot(5.925, 1.5),
19 ui.single_slot(8.425, 1.5),
20 "label["..ui.style_full.form_header_x..","..ui.style_full.form_header_y..";" .. F(S("Bags")) .. "]",
21 "button[0.6125,2.75;1.875,0.75;bag1;" .. F(S("Bag @1", 1)) .. "]",
22 "button[3.1125,2.75;1.875,0.75;bag2;" .. F(S("Bag @1", 2)) .. "]",
23 "button[5.6125,2.75;1.875,0.75;bag3;" .. F(S("Bag @1", 3)) .. "]",
24 "button[8.1125,2.75;1.875,0.75;bag4;" .. F(S("Bag @1", 4)) .. "]",
25 "listcolors[#00000000;#00000000]",
26 "list[detached:" .. F(player_name) .. "_bags;bag1;1.075,1.65;1,1;]",
27 "list[detached:" .. F(player_name) .. "_bags;bag2;3.575,1.65;1,1;]",
28 "list[detached:" .. F(player_name) .. "_bags;bag3;6.075,1.65;1,1;]",
29 "list[detached:" .. F(player_name) .. "_bags;bag4;8.575,1.65;1,1;]"
30 }) }
2331 end,
2432 })
2533
26 unified_inventory.register_button("bags", {
34 ui.register_button("bags", {
2735 type = "image",
2836 image = "ui_bags_icon.png",
2937 tooltip = S("Bags"),
3745 }):get_stack("bag" .. i, 1)
3846 end
3947
40 for i = 1, 4 do
41 local bi = i
42 unified_inventory.register_page("bag"..bi, {
48 for bag_i = 1, 4 do
49 ui.register_page("bag" .. bag_i, {
4350 get_formspec = function(player)
44 local stack = get_player_bag_stack(player, bi)
51 local stack = get_player_bag_stack(player, bag_i)
4552 local image = stack:get_definition().inventory_image
46 local formspec = ("image[7,0;1,1;"..image.."]"
47 .."label[0,0;"..F(S("Bag @1", bi)).."]"
48 .."listcolors[#00000000;#00000000]"
49 .."list[current_player;bag"..bi.."contents;0,1;8,3;]"
50 .."listring[current_name;bag"..bi.."contents]"
51 .."listring[current_player;main]")
5253 local slots = stack:get_definition().groups.bagslots
53 if slots == 8 then
54 formspec = formspec.."background[0.06,0.99;7.92,7.52;ui_bags_sm_form.png]"
55 elseif slots == 16 then
56 formspec = formspec.."background[0.06,0.99;7.92,7.52;ui_bags_med_form.png]"
57 elseif slots == 24 then
58 formspec = formspec.."background[0.06,0.99;7.92,7.52;ui_bags_lg_form.png]"
59 end
54
55 local formspec = {
56 ui.style_full.standard_inv_bg,
57 ui.make_inv_img_grid(0.3, 1.5, 8, slots/8),
58 "image[9.2,0.4;1,1;" .. image .. "]",
59 "label[0.3,0.65;" .. F(S("Bag @1", bag_i)) .. "]",
60 "listcolors[#00000000;#00000000]",
61 "listring[current_player;main]",
62 string.format("list[current_player;bag%icontents;%f,%f;8,3;]",
63 bag_i, 0.3 + ui.list_img_offset, 1.5 + ui.list_img_offset),
64 "listring[current_name;bag" .. bag_i .. "contents]",
65 }
66 local n = #formspec + 1
67
6068 local player_name = player:get_player_name() -- For if statement.
61 if unified_inventory.trash_enabled or unified_inventory.is_creative(player_name) or minetest.get_player_privs(player_name).give then
62 formspec = (formspec.."background[6.06,0;0.92,0.92;ui_bags_trash.png]"
63 .."list[detached:trash;main;6,0.1;1,1;]")
69 if ui.trash_enabled
70 or ui.is_creative(player_name)
71 or minetest.get_player_privs(player_name).give then
72 formspec[n] = ui.make_trash_slot(7.8, 0.25)
73 n = n + 1
6474 end
6575 local inv = player:get_inventory()
6676 for i = 1, 4 do
6777 local def = get_player_bag_stack(player, i):get_definition()
68 local button
6978 if def.groups.bagslots then
70 local list_name = "bag"..i.."contents"
79 local list_name = "bag" .. i .. "contents"
7180 local size = inv:get_size(list_name)
7281 local used = 0
7382 for si = 1, size do
7786 end
7887 end
7988 local img = def.inventory_image
80 local label = F(S("Bag @1", i)).."\n"..used.."/"..size
81 button = "image_button["..(i+1)..",0;1,1;"..img..";bag"..i..";"..label.."]"
82 else
83 button = ""
89 local label = F(S("Bag @1", i)) .. "\n" .. used .. "/" .. size
90 formspec[n] = string.format("image_button[%f,0.4;1,1;%s;bag%i;%s]",
91 (i + 1.35)*1.25, img, i, label)
92 n = n + 1
8493 end
85 formspec = formspec..button
86 end
87 return {formspec=formspec}
94 end
95 return { formspec = table.concat(formspec) }
8896 end,
8997 })
9098 end
94102 return
95103 end
96104 for i = 1, 4 do
97 if fields["bag"..i] then
105 if fields["bag" .. i] then
98106 local stack = get_player_bag_stack(player, i)
99107 if not stack:get_definition().groups.bagslots then
100108 return
101109 end
102 unified_inventory.set_inventory_formspec(player, "bag"..i)
110 ui.set_inventory_formspec(player, "bag" .. i)
103111 return
104112 end
105113 end
109117 local is_empty = true
110118 local bags = {}
111119 for i = 1, 4 do
112 local bag = "bag"..i
120 local bag = "bag" .. i
113121 if not bags_inv:is_empty(bag) then
114122 -- Stack limit is 1, otherwise use stack:to_string()
115123 bags[i] = bags_inv:get_stack(bag, 1):get_name()
116124 is_empty = false
117125 end
118126 end
127 local meta = player:get_meta()
119128 if is_empty then
120 player:set_attribute("unified_inventory:bags", nil)
129 meta:set_string("unified_inventory:bags", nil)
121130 else
122 player:set_attribute("unified_inventory:bags",
131 meta:set_string("unified_inventory:bags",
123132 minetest.serialize(bags))
124133 end
125134 end
126135
127136 local function load_bags_metadata(player, bags_inv)
128137 local player_inv = player:get_inventory()
129 local bags_meta = player:get_attribute("unified_inventory:bags")
138 local meta = player:get_meta()
139 local bags_meta = meta:get("unified_inventory:bags")
130140 local bags = bags_meta and minetest.deserialize(bags_meta) or {}
131141 local dirty_meta = false
132142 if not bags_meta then
133143 -- Backwards compatiblity
134144 for i = 1, 4 do
135 local bag = "bag"..i
145 local bag = "bag" .. i
136146 if not player_inv:is_empty(bag) then
137147 -- Stack limit is 1, otherwise use stack:to_string()
138148 bags[i] = player_inv:get_stack(bag, 1):get_name()
142152 end
143153 -- Fill detached slots
144154 for i = 1, 4 do
145 local bag = "bag"..i
155 local bag = "bag" .. i
146156 bags_inv:set_size(bag, 1)
147157 bags_inv:set_stack(bag, 1, bags[i] or "")
148158 end
154164
155165 -- Clean up deprecated garbage after saving
156166 for i = 1, 4 do
157 local bag = "bag"..i
167 local bag = "bag" .. i
158168 player_inv:set_size(bag, 0)
159169 end
160170 end
161171
162172 minetest.register_on_joinplayer(function(player)
163 local player_inv = player:get_inventory()
164173 local player_name = player:get_player_name()
165 local bags_inv = minetest.create_detached_inventory(player_name.."_bags",{
174 local bags_inv = minetest.create_detached_inventory(player_name .. "_bags",{
166175 on_put = function(inv, listname, index, stack, player)
167 player:get_inventory():set_size(listname.."contents",
176 player:get_inventory():set_size(listname .. "contents",
168177 stack:get_definition().groups.bagslots)
169178 save_bags_metadata(player, inv)
170179 end,
174183 return 0
175184 end
176185 local player_inv = player:get_inventory()
177 local old_slots = player_inv:get_size(listname.."contents")
186 local old_slots = player_inv:get_size(listname .. "contents")
178187
179188 if new_slots >= old_slots then
180189 return 1
181190 end
182191
183192 -- using a smaller bag, make sure it fits
184 local old_list = player_inv:get_list(listname.."contents")
193 local old_list = player_inv:get_list(listname .. "contents")
185194 local new_list = {}
186195 local slots_used = 0
187196 local use_new_list = false
195204 end
196205 if new_slots >= slots_used then
197206 if use_new_list then
198 player_inv:set_list(listname.."contents", new_list)
207 player_inv:set_list(listname .. "contents", new_list)
199208 end
200209 return 1
201210 end
203212 return 0
204213 end,
205214 allow_take = function(inv, listname, index, stack, player)
206 if player:get_inventory():is_empty(listname.."contents") then
215 if player:get_inventory():is_empty(listname .. "contents") then
207216 return stack:get_count()
208217 end
209218 return 0
210219 end,
211220 on_take = function(inv, listname, index, stack, player)
212 player:get_inventory():set_size(listname.."contents", 0)
221 player:get_inventory():set_size(listname .. "contents", 0)
213222 save_bags_metadata(player, inv)
214223 end,
215224 allow_move = function()
244253 minetest.register_craft({
245254 output = "unified_inventory:bag_small",
246255 recipe = {
247 {"", "farming:cotton", ""},
256 {"", "farming:string", ""},
248257 {"group:wool", "group:wool", "group:wool"},
249258 {"group:wool", "group:wool", "group:wool"},
250259 },
254263 output = "unified_inventory:bag_medium",
255264 recipe = {
256265 {"", "", ""},
257 {"farming:cotton", "unified_inventory:bag_small", "farming:cotton"},
258 {"farming:cotton", "unified_inventory:bag_small", "farming:cotton"},
266 {"farming:string", "unified_inventory:bag_small", "farming:string"},
267 {"farming:string", "unified_inventory:bag_small", "farming:string"},
259268 },
260269 })
261270
263272 output = "unified_inventory:bag_large",
264273 recipe = {
265274 {"", "", ""},
266 {"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"},
267 {"farming:cotton", "unified_inventory:bag_medium", "farming:cotton"},
275 {"farming:string", "unified_inventory:bag_medium", "farming:string"},
276 {"farming:string", "unified_inventory:bag_medium", "farming:string"},
268277 },
269278 })
270279 end
1818 unified_inventory.active_search_direction[player_name] = "nochange"
1919 unified_inventory.apply_filter(player, "", "nochange")
2020 unified_inventory.current_searchbox[player_name] = ""
21 unified_inventory.current_category[player_name] = "all"
22 unified_inventory.current_category_scroll[player_name] = 0
2123 unified_inventory.alternate[player_name] = 1
2224 unified_inventory.current_item[player_name] = nil
2325 unified_inventory.current_craft_direction[player_name] = "recipe"
2729 -- Refill slot
2830 local refill = minetest.create_detached_inventory(player_name.."refill", {
2931 allow_put = function(inv, listname, index, stack, player)
30 local player_name = player:get_player_name()
3132 if unified_inventory.is_creative(player_name) then
3233 return stack:get_count()
3334 else
3536 end
3637 end,
3738 on_put = function(inv, listname, index, stack, player)
38 local player_name = player:get_player_name()
3939 local handle_refill = (minetest.registered_items[stack:get_name()] or {}).on_refill or default_refill
4040 stack = handle_refill(stack)
4141 inv:set_stack(listname, index, stack)
4646 refill:set_size("main", 1)
4747 end)
4848
49 local function apply_new_filter(player, search_text, new_dir)
50 local player_name = player:get_player_name()
51 minetest.sound_play("click", {to_player=player_name, gain = 0.1})
52 unified_inventory.apply_filter(player, search_text, new_dir)
53 unified_inventory.current_searchbox[player_name] = search_text
54 unified_inventory.set_inventory_formspec(player,
55 unified_inventory.current_page[player_name])
56 end
57
4958 minetest.register_on_player_receive_fields(function(player, formname, fields)
5059 local player_name = player:get_player_name()
5160
5968 if fields.searchbox
6069 and fields.searchbox ~= unified_inventory.current_searchbox[player_name] then
6170 unified_inventory.current_searchbox[player_name] = fields.searchbox
62 unified_inventory.set_inventory_formspec(player, unified_inventory.current_page[player_name])
71 end
72
73
74 local clicked_category
75 for name, value in pairs(fields) do
76 local category_name = string.match(name, "^category_(.+)$")
77 if category_name then
78 clicked_category = category_name
79 break
80 end
81 end
82
83 if clicked_category
84 and clicked_category ~= unified_inventory.current_category[player_name] then
85 unified_inventory.current_category[player_name] = clicked_category
86 unified_inventory.apply_filter(player, unified_inventory.current_searchbox[player_name], "nochange")
87 unified_inventory.set_inventory_formspec(player,
88 unified_inventory.current_page[player_name])
89 end
90
91 if fields.next_category then
92 local scroll = math.min(#unified_inventory.category_list-ui_peruser.pagecols, unified_inventory.current_category_scroll[player_name] + 1)
93 if scroll ~= unified_inventory.current_category_scroll[player_name] then
94 unified_inventory.current_category_scroll[player_name] = scroll
95 unified_inventory.set_inventory_formspec(player,
96 unified_inventory.current_page[player_name])
97 end
98 end
99 if fields.prev_category then
100 local scroll = math.max(0, unified_inventory.current_category_scroll[player_name] - 1)
101 if scroll ~= unified_inventory.current_category_scroll[player_name] then
102 unified_inventory.current_category_scroll[player_name] = scroll
103 unified_inventory.set_inventory_formspec(player,
104 unified_inventory.current_page[player_name])
105 end
63106 end
64107
65108 for i, def in pairs(unified_inventory.buttons) do
111154 unified_inventory.current_page[player_name])
112155 end
113156
157 -- Check clicked item image button
114158 local clicked_item
115159 for name, value in pairs(fields) do
116 if string.sub(name, 1, 12) == "item_button_" then
117 local new_dir, mangled_item = string.match(name, "^item_button_([a-z]+)_(.*)$")
160 local new_dir, mangled_item = string.match(name, "^item_button_([a-z]+)_(.*)$")
161 if new_dir and mangled_item then
118162 clicked_item = unified_inventory.demangle_for_formspec(mangled_item)
119163 if string.sub(clicked_item, 1, 6) == "group:" then
120 minetest.sound_play("click", {to_player=player_name, gain = 0.1})
121 unified_inventory.apply_filter(player, clicked_item, new_dir)
122 unified_inventory.current_searchbox[player_name] = clicked_item
123 unified_inventory.set_inventory_formspec(player,
124 unified_inventory.current_page[player_name])
164 -- Change search filter to this group
165 unified_inventory.current_category[player_name] = "all"
166 apply_new_filter(player, clicked_item, new_dir)
125167 return
126168 end
127 if new_dir == "recipe"
128 or new_dir == "usage" then
169 if new_dir == "recipe" or new_dir == "usage" then
129170 unified_inventory.current_craft_direction[player_name] = new_dir
130171 end
131172 break
144185 unified_inventory.alternate[player_name] = 1
145186 unified_inventory.set_inventory_formspec(player, "craftguide")
146187 elseif player_creative then
188 -- Creative page: Add entire stack to inventory
147189 local inv = player:get_inventory()
148190 local stack = ItemStack(clicked_item)
149191 stack:set_count(stack:get_stack_max())
161203 minetest.sound_play("paperflip2",
162204 {to_player=player_name, gain = 1.0})
163205 elseif fields.searchresetbutton then
164 unified_inventory.apply_filter(player, "", "nochange")
165 unified_inventory.current_searchbox[player_name] = ""
166 unified_inventory.set_inventory_formspec(player,
167 unified_inventory.current_page[player_name])
168 minetest.sound_play("click",
169 {to_player=player_name, gain = 0.1})
206 apply_new_filter(player, "", "nochange")
170207 end
171208
172209 -- alternate buttons
0 local S = minetest.get_translator("unified_inventory")
1
2 unified_inventory.registered_categories = {}
3 unified_inventory.registered_category_items = {}
4 unified_inventory.category_list = {}
5
6 local function char_to_sort_index(char_code)
7 if char_code <= 32 then
8 -- Command codes, no thanks
9 return 0
10 end
11 if char_code <= 64 then
12 -- Sorts numbers, and some punctuation, after letters
13 return char_code
14 end
15 if char_code >= 158 then
16 -- Out of sortable range
17 return 0
18 end
19 if char_code > 122 then
20 -- Avoids overlap with {, |, } and ~
21 return char_code - 58
22 end
23 if char_code > 96 then
24 -- Normalises lowercase with uppercase
25 return char_code - 96
26 end
27 return char_code - 64
28 end
29
30 local function string_to_sort_index(str)
31 local max_chars = 5
32 local power = 100
33 local index = 0
34 for i=1,math.min(#str, max_chars) do
35 index = index + (char_to_sort_index(string.byte(str, i))/(power^i))
36 end
37 return index
38 end
39
40 function update_category_list()
41 local category_list = {}
42 table.insert(category_list, {
43 name = "all",
44 label = S("All Items"),
45 symbol = "ui_category_all.png",
46 index = -2,
47 })
48 table.insert(category_list, {
49 name = "uncategorized",
50 label = S("Misc. Items"),
51 symbol = "ui_category_none.png",
52 index = -1,
53 })
54 for category, def in pairs(unified_inventory.registered_categories) do
55 table.insert(category_list, {
56 name = category,
57 label = def.label or category,
58 symbol = def.symbol,
59 index = def.index or -- sortby defined order
60 string_to_sort_index(category) -- or do a rudimentary alphabetical sort
61 })
62 end
63 table.sort(category_list, function (a,b)
64 return a.index < b.index
65 end)
66 unified_inventory.category_list = category_list
67 end
68
69 local function ensure_category_exists(category_name)
70 if not unified_inventory.registered_categories[category_name] then
71 unified_inventory.registered_categories[category_name] = {
72 symbol = "default:stick",
73 label = category_name
74 }
75 end
76 if not unified_inventory.registered_category_items[category_name] then
77 unified_inventory.registered_category_items[category_name] = {}
78 end
79 end
80
81 function unified_inventory.register_category(category_name, config)
82 ensure_category_exists(category_name)
83 if config and config.symbol then
84 unified_inventory.set_category_symbol(category_name, config.symbol)
85 end
86 if config and config.label then
87 unified_inventory.set_category_label(category_name, config.label)
88 end
89 if config and config.index then
90 unified_inventory.set_category_index(category_name, config.index)
91 end
92 if config and config.items then
93 unified_inventory.add_category_items(category_name, config.items)
94 end
95 update_category_list()
96 end
97 function unified_inventory.set_category_symbol(category_name, symbol)
98 ensure_category_exists(category_name)
99 unified_inventory.registered_categories[category_name].symbol = symbol
100 update_category_list()
101 end
102 function unified_inventory.set_category_label(category_name, label)
103 ensure_category_exists(category_name)
104 unified_inventory.registered_categories[category_name].label = label
105 update_category_list()
106 end
107 function unified_inventory.set_category_index(category_name, index)
108 ensure_category_exists(category_name)
109 unified_inventory.registered_categories[category_name].index = index
110 update_category_list()
111 end
112 function unified_inventory.add_category_item(category_name, item)
113 ensure_category_exists(category_name)
114 unified_inventory.registered_category_items[category_name][item] = true
115 end
116 function unified_inventory.add_category_items(category_name, items)
117 for _,item in ipairs(items) do
118 unified_inventory.add_category_item(category_name, item)
119 end
120 end
121
122 function unified_inventory.remove_category_item(category_name, item)
123 unified_inventory.registered_category_items[category_name][item] = nil
124 end
125 function unified_inventory.remove_category(category_name)
126 unified_inventory.registered_categories[category_name] = nil
127 unified_inventory.registered_category_items[category_name] = nil
128 update_category_list()
129 end
130
131 function unified_inventory.find_category(item)
132 -- Returns the first category the item exists in
133 -- Best for checking if an item has any category at all
134 for category, items in pairs(unified_inventory.registered_category_items) do
135 if items[item] then return category end
136 end
137 end
138 function unified_inventory.find_categories(item)
139 -- Returns all the categories the item exists in
140 -- Best for listing all categories
141 local categories = {}
142 for category, items in pairs(unified_inventory.registered_category_items) do
143 if items[item] then
144 table.insert(categories, category)
145 end
146 end
147 return categories
148 end
0 local S = minetest.get_translator("unified_inventory")
1
2 unified_inventory.register_category('plants', {
3 symbol = "flowers:tulip",
4 label = S("Plant Life")
5 })
6 unified_inventory.register_category('building', {
7 symbol = "default:brick",
8 label = S("Building Materials")
9 })
10 unified_inventory.register_category('tools', {
11 symbol = "default:pick_diamond",
12 label = S("Tools")
13 })
14 unified_inventory.register_category('minerals', {
15 symbol = "default:iron_lump",
16 label = S("Minerals and Metals")
17 })
18 unified_inventory.register_category('environment', {
19 symbol = "default:dirt_with_grass",
20 label = S("Environment and Worldgen")
21 })
22 unified_inventory.register_category('lighting', {
23 symbol = "default:torch",
24 label = S("Lighting")
25 })
26
27
28 if unified_inventory.automatic_categorization then
29 minetest.register_on_mods_loaded(function()
30
31 -- Add biome nodes to environment category
32 for _,def in pairs(minetest.registered_biomes) do
33 local env_nodes = {
34 def.node_riverbed, def.node_top, def.node_filler, def.node_dust,
35 }
36 for i,node in pairs(env_nodes) do
37 if node then
38 unified_inventory.add_category_item('environment', node)
39 end
40 end
41 end
42
43 -- Add minable ores to minerals and everything else (pockets of stone & sand variations) to environment
44 for _,item in pairs(minetest.registered_ores) do
45 if item.ore_type == "scatter" then
46 local drop = minetest.registered_nodes[item.ore].drop
47 if drop and drop ~= "" then
48 unified_inventory.add_category_item('minerals', item.ore)
49 unified_inventory.add_category_item('minerals', drop)
50 else
51 unified_inventory.add_category_item('environment', item.ore)
52 end
53 else
54 unified_inventory.add_category_item('environment', item.ore)
55 end
56 end
57
58 -- Add items by item definition
59 for name, def in pairs(minetest.registered_items) do
60 local group = def.groups or {}
61 if not group.not_in_creative_inventory then
62 if group.stair or
63 group.slab or
64 group.wall or
65 group.fence then
66 unified_inventory.add_category_item('building', name)
67 elseif group.flora or
68 group.flower or
69 group.seed or
70 group.leaves or
71 group.sapling or
72 group.tree then
73 unified_inventory.add_category_item('plants', name)
74 elseif def.type == 'tool' then
75 unified_inventory.add_category_item('tools', name)
76 elseif def.liquidtype == 'source' then
77 unified_inventory.add_category_item('environment', name)
78 elseif def.light_source and def.light_source > 0 then
79 unified_inventory.add_category_item('lighting', name)
80 elseif group.door or
81 minetest.global_exists("doors") and (
82 doors.registered_doors and doors.registered_doors[name..'_a'] or
83 doors.registered_trapdoors and doors.registered_trapdoors[name]
84 ) then
85 unified_inventory.add_category_item('building', name)
86 end
87 end
88 end
89 end)
90 end
91
92 -- [[
93 unified_inventory.add_category_items('plants', {
94 "default:dry_grass_5",
95 "default:acacia_sapling",
96 "default:blueberry_bush_sapling",
97 "default:grass_2",
98 "default:pine_bush_stem",
99 "default:leaves",
100 "default:pine_needles",
101 "default:cactus",
102 "default:junglegrass",
103 "default:pine_sapling",
104 "default:sapling",
105 "default:bush_stem",
106 "default:dry_grass_2",
107 "default:fern_1",
108 "default:grass_3",
109 "default:marram_grass_1",
110 "default:pine_tree",
111 "default:dry_grass_3",
112 "default:dry_shrub",
113 "default:grass_4",
114 "default:marram_grass_2",
115 "default:jungleleaves",
116 "default:apple",
117 "default:tree",
118 "default:aspen_tree",
119 "default:bush_sapling",
120 "default:grass_5",
121 "default:blueberry_bush_leaves_with_berries",
122 "default:acacia_bush_sapling",
123 "default:grass_1",
124 "default:aspen_leaves",
125 "default:marram_grass_3",
126 "default:large_cactus_seedling",
127 "default:junglesapling",
128 "default:dry_grass_4",
129 "default:acacia_bush_stem",
130 "default:papyrus",
131 "default:pine_bush_needles",
132 "default:bush_leaves",
133 "default:fern_3",
134 "default:aspen_sapling",
135 "default:acacia_tree",
136 "default:apple_mark",
137 "default:acacia_leaves",
138 "default:jungletree",
139 "default:dry_grass_1",
140 "default:acacia_bush_leaves",
141 "default:emergent_jungle_sapling",
142 "default:fern_2",
143 "default:blueberries",
144 "default:sand_with_kelp",
145 "default:blueberry_bush_leaves",
146 "default:pine_bush_sapling",
147
148 "farming:cotton",
149 "farming:cotton_1",
150 "farming:cotton_2",
151 "farming:cotton_3",
152 "farming:cotton_4",
153 "farming:cotton_5",
154 "farming:cotton_6",
155 "farming:cotton_7",
156 "farming:cotton_8",
157 "farming:cotton_wild",
158 "farming:seed_cotton",
159 "farming:seed_wheat",
160 "farming:straw",
161 "farming:wheat",
162 "farming:wheat_1",
163 "farming:wheat_2",
164 "farming:wheat_3",
165 "farming:wheat_4",
166 "farming:wheat_5",
167 "farming:wheat_6",
168 "farming:wheat_7",
169 "farming:wheat_8",
170
171 "flowers:chrysanthemum_green",
172 "flowers:dandelion_white",
173 "flowers:dandelion_yellow",
174 "flowers:geranium",
175 "flowers:mushroom_brown",
176 "flowers:mushroom_red",
177 "flowers:rose",
178 "flowers:tulip",
179 "flowers:tulip_black",
180 "flowers:viola",
181 "flowers:waterlily",
182 "flowers:waterlily_waving",
183 })
184
185 unified_inventory.add_category_items('tools', {
186 "default:sword_diamond",
187 "default:axe_diamond",
188 "default:shovel_diamond",
189 "default:axe_steel",
190 "default:shovel_mese",
191 "default:sword_wood",
192 "default:pick_bronze",
193 "default:axe_stone",
194 "default:sword_stone",
195 "default:pick_stone",
196 "default:shovel_stone",
197 "default:sword_mese",
198 "default:shovel_bronze",
199 "default:sword_bronze",
200 "default:axe_bronze",
201 "default:shovel_steel",
202 "default:sword_steel",
203 "default:axe_mese",
204 "default:shovel_wood",
205 "default:pick_mese",
206 "default:axe_wood",
207 "default:pick_diamond",
208 "default:pick_wood",
209 "default:pick_steel",
210
211 "farming:hoe_bronze",
212 "farming:hoe_diamond",
213 "farming:hoe_mese",
214 "farming:hoe_steel",
215 "farming:hoe_stone",
216 "farming:hoe_wood",
217
218 "fire:flint_and_steel",
219 "map:mapping_kit",
220 "screwdriver:screwdriver",
221
222 "fireflies:bug_net",
223 "bucket:bucket_empty",
224
225 "binoculars:binoculars",
226 "default:skeleton_key",
227 })
228
229 unified_inventory.add_category_items('minerals', {
230 "default:stone_with_copper",
231 "default:stone_with_gold",
232 "default:stone_with_iron",
233 "default:copper_ingot",
234 "default:copper_lump",
235 "default:gold_lump",
236 "default:diamondblock",
237 "default:stone_with_diamond",
238 "default:stone_with_mese",
239 "default:steel_ingot",
240 "default:gold_ingot",
241 "default:iron_lump",
242 "default:tinblock",
243 "default:tin_lump",
244 "default:stone_with_tin",
245 "default:mese_crystal",
246 "default:diamond",
247 "default:bronze_ingot",
248 "default:mese",
249 "default:mese_crystal_fragment",
250 "default:copperblock",
251 "default:stone_with_coal",
252 "default:steelblock",
253 "default:tin_ingot",
254 "default:coalblock",
255 "default:coal_lump",
256 "default:bronzeblock",
257 "default:goldblock",
258
259 "stairs:slab_bronzeblock",
260 "stairs:slab_copperblock",
261 "stairs:slab_steelblock",
262 "stairs:slab_tinblock",
263 "stairs:stair_bronzeblock",
264 "stairs:stair_copperblock",
265 "stairs:stair_inner_bronzeblock",
266 "stairs:stair_inner_copperblock",
267 "stairs:stair_inner_steelblock",
268 "stairs:stair_inner_tinblock",
269 "stairs:stair_outer_bronzeblock",
270 "stairs:stair_outer_copperblock",
271 "stairs:stair_outer_steelblock",
272 "stairs:stair_outer_tinblock",
273 "stairs:stair_steelblock",
274 "stairs:stair_tinblock",
275 })
276
277 unified_inventory.add_category_items('building', {
278 "default:fence_rail_aspen_wood",
279 "default:fence_rail_acacia_wood",
280 "default:fence_junglewood",
281 "default:fence_rail_junglewood",
282 "default:fence_aspen_wood",
283 "default:fence_pine_wood",
284 "default:fence_rail_wood",
285 "default:fence_rail_pine_wood",
286 "default:fence_acacia_wood",
287 "default:junglewood",
288 "default:acacia_wood",
289 "default:aspen_wood",
290 "default:fence_wood",
291 "default:pine_wood",
292 "default:silver_sandstone",
293 "default:desert_sandstone",
294 "default:sandstone_block",
295 "default:desert_sandstone_brick",
296 "default:stone_block",
297 "default:stonebrick",
298 "default:obsidian_glass",
299 "default:desert_sandstone_block",
300 "default:silver_sandstone_brick",
301 "default:brick",
302 "default:obsidianbrick",
303 "default:sandstonebrick",
304 "default:sandstone",
305 "default:desert_stone_block",
306 "default:silver_sandstone_block",
307 "default:wood",
308 "default:obsidian_block",
309 "default:glass",
310 "default:clay_brick",
311 "default:desert_stonebrick",
312 "default:desert_cobble",
313 "default:cobble",
314 "default:mossycobble",
315
316 "doors:door_glass",
317 "doors:door_glass_a",
318 "doors:door_glass_b",
319 "doors:door_glass_c",
320 "doors:door_glass_d",
321 "doors:door_obsidian_glass",
322 "doors:door_obsidian_glass_a",
323 "doors:door_obsidian_glass_b",
324 "doors:door_obsidian_glass_c",
325 "doors:door_obsidian_glass_d",
326 "doors:door_steel",
327 "doors:door_steel_a",
328 "doors:door_steel_b",
329 "doors:door_steel_c",
330 "doors:door_steel_d",
331 "doors:door_wood",
332 "doors:door_wood_a",
333 "doors:door_wood_b",
334 "doors:door_wood_c",
335 "doors:door_wood_d",
336 "doors:gate_acacia_wood_closed",
337 "doors:gate_acacia_wood_open",
338 "doors:gate_aspen_wood_closed",
339 "doors:gate_aspen_wood_open",
340 "doors:gate_junglewood_closed",
341 "doors:gate_junglewood_open",
342 "doors:gate_pine_wood_closed",
343 "doors:gate_pine_wood_open",
344 "doors:gate_wood_closed",
345 "doors:gate_wood_open",
346 "doors:hidden",
347 "doors:trapdoor",
348 "doors:trapdoor_open",
349 "doors:trapdoor_steel",
350 "doors:trapdoor_steel_open",
351
352 "stairs:slab_bronzeblock",
353 "stairs:slab_copperblock",
354 "stairs:slab_steelblock",
355 "stairs:slab_tinblock",
356 "stairs:stair_bronzeblock",
357 "stairs:stair_copperblock",
358 "stairs:stair_inner_bronzeblock",
359 "stairs:stair_inner_copperblock",
360 "stairs:stair_inner_steelblock",
361 "stairs:stair_inner_tinblock",
362 "stairs:stair_outer_bronzeblock",
363 "stairs:stair_outer_copperblock",
364 "stairs:stair_outer_steelblock",
365 "stairs:stair_outer_tinblock",
366 "stairs:stair_steelblock",
367 "stairs:stair_tinblock",
368
369 "stairs:slab_acacia_wood",
370 "stairs:slab_aspen_wood",
371 "stairs:slab_brick",
372 "stairs:slab_cobble",
373 "stairs:slab_desert_cobble",
374 "stairs:slab_desert_sandstone",
375 "stairs:slab_desert_sandstone_block",
376 "stairs:slab_desert_sandstone_brick",
377 "stairs:slab_desert_stone",
378 "stairs:slab_desert_stone_block",
379 "stairs:slab_desert_stonebrick",
380 "stairs:slab_glass",
381 "stairs:slab_goldblock",
382 "stairs:slab_ice",
383 "stairs:slab_junglewood",
384 "stairs:slab_mossycobble",
385 "stairs:slab_obsidian",
386 "stairs:slab_obsidian_block",
387 "stairs:slab_obsidian_glass",
388 "stairs:slab_obsidianbrick",
389 "stairs:slab_pine_wood",
390 "stairs:slab_sandstone",
391 "stairs:slab_sandstone_block",
392 "stairs:slab_sandstonebrick",
393 "stairs:slab_silver_sandstone",
394 "stairs:slab_silver_sandstone_block",
395 "stairs:slab_silver_sandstone_brick",
396 "stairs:slab_snowblock",
397 "stairs:slab_stone",
398 "stairs:slab_stone_block",
399 "stairs:slab_stonebrick",
400 "stairs:slab_straw",
401 "stairs:slab_wood",
402 "stairs:stair_acacia_wood",
403 "stairs:stair_aspen_wood",
404 "stairs:stair_brick",
405 "stairs:stair_cobble",
406 "stairs:stair_desert_cobble",
407 "stairs:stair_desert_sandstone",
408 "stairs:stair_desert_sandstone_block",
409 "stairs:stair_desert_sandstone_brick",
410 "stairs:stair_desert_stone",
411 "stairs:stair_desert_stone_block",
412 "stairs:stair_desert_stonebrick",
413 "stairs:stair_glass",
414 "stairs:stair_goldblock",
415 "stairs:stair_ice",
416 "stairs:stair_inner_acacia_wood",
417 "stairs:stair_inner_aspen_wood",
418 "stairs:stair_inner_brick",
419 "stairs:stair_inner_cobble",
420 "stairs:stair_inner_desert_cobble",
421 "stairs:stair_inner_desert_sandstone",
422 "stairs:stair_inner_desert_sandstone_block",
423 "stairs:stair_inner_desert_sandstone_brick",
424 "stairs:stair_inner_desert_stone",
425 "stairs:stair_inner_desert_stone_block",
426 "stairs:stair_inner_desert_stonebrick",
427 "stairs:stair_inner_glass",
428 "stairs:stair_inner_goldblock",
429 "stairs:stair_inner_ice",
430 "stairs:stair_inner_junglewood",
431 "stairs:stair_inner_mossycobble",
432 "stairs:stair_inner_obsidian",
433 "stairs:stair_inner_obsidian_block",
434 "stairs:stair_inner_obsidian_glass",
435 "stairs:stair_inner_obsidianbrick",
436 "stairs:stair_inner_pine_wood",
437 "stairs:stair_inner_sandstone",
438 "stairs:stair_inner_sandstone_block",
439 "stairs:stair_inner_sandstonebrick",
440 "stairs:stair_inner_silver_sandstone",
441 "stairs:stair_inner_silver_sandstone_block",
442 "stairs:stair_inner_silver_sandstone_brick",
443 "stairs:stair_inner_snowblock",
444 "stairs:stair_inner_stone",
445 "stairs:stair_inner_stone_block",
446 "stairs:stair_inner_stonebrick",
447 "stairs:stair_inner_straw",
448 "stairs:stair_inner_wood",
449 "stairs:stair_junglewood",
450 "stairs:stair_mossycobble",
451 "stairs:stair_obsidian",
452 "stairs:stair_obsidian_block",
453 "stairs:stair_obsidian_glass",
454 "stairs:stair_obsidianbrick",
455 "stairs:stair_outer_acacia_wood",
456 "stairs:stair_outer_aspen_wood",
457 "stairs:stair_outer_brick",
458 "stairs:stair_outer_cobble",
459 "stairs:stair_outer_desert_cobble",
460 "stairs:stair_outer_desert_sandstone",
461 "stairs:stair_outer_desert_sandstone_block",
462 "stairs:stair_outer_desert_sandstone_brick",
463 "stairs:stair_outer_desert_stone",
464 "stairs:stair_outer_desert_stone_block",
465 "stairs:stair_outer_desert_stonebrick",
466 "stairs:stair_outer_glass",
467 "stairs:stair_outer_goldblock",
468 "stairs:stair_outer_ice",
469 "stairs:stair_outer_junglewood",
470 "stairs:stair_outer_mossycobble",
471 "stairs:stair_outer_obsidian",
472 "stairs:stair_outer_obsidian_block",
473 "stairs:stair_outer_obsidian_glass",
474 "stairs:stair_outer_obsidianbrick",
475 "stairs:stair_outer_pine_wood",
476 "stairs:stair_outer_sandstone",
477 "stairs:stair_outer_sandstone_block",
478 "stairs:stair_outer_sandstonebrick",
479 "stairs:stair_outer_silver_sandstone",
480 "stairs:stair_outer_silver_sandstone_block",
481 "stairs:stair_outer_silver_sandstone_brick",
482 "stairs:stair_outer_snowblock",
483 "stairs:stair_outer_stone",
484 "stairs:stair_outer_stone_block",
485 "stairs:stair_outer_stonebrick",
486 "stairs:stair_outer_straw",
487 "stairs:stair_outer_wood",
488 "stairs:stair_pine_wood",
489 "stairs:stair_sandstone",
490 "stairs:stair_sandstone_block",
491 "stairs:stair_sandstonebrick",
492 "stairs:stair_silver_sandstone",
493 "stairs:stair_silver_sandstone_block",
494 "stairs:stair_silver_sandstone_brick",
495 "stairs:stair_snowblock",
496 "stairs:stair_stone",
497 "stairs:stair_stone_block",
498 "stairs:stair_stonebrick",
499 "stairs:stair_straw",
500 "stairs:stair_wood",
501
502 "xpanes:bar",
503 "xpanes:bar_flat",
504 "xpanes:door_steel_bar",
505 "xpanes:door_steel_bar_a",
506 "xpanes:door_steel_bar_b",
507 "xpanes:door_steel_bar_c",
508 "xpanes:door_steel_bar_d",
509 "xpanes:obsidian_pane",
510 "xpanes:obsidian_pane_flat",
511 "xpanes:pane",
512 "xpanes:pane_flat",
513 "xpanes:trapdoor_steel_bar",
514 "xpanes:trapdoor_steel_bar_open",
515
516 "walls:cobble",
517 "walls:desertcobble",
518 "walls:mossycobble",
519 })
520
521 unified_inventory.add_category_items('environment', {
522 "air",
523 "default:cave_ice",
524 "default:dirt_with_rainforest_litter",
525 "default:gravel",
526 "default:dry_dirt_with_dry_grass",
527 "default:permafrost",
528 "default:desert_stone",
529 "default:ice",
530 "default:dry_dirt",
531 "default:obsidian",
532 "default:sand",
533 "default:river_water_source",
534 "default:dirt_with_snow",
535 "default:dirt_with_grass",
536 "default:water_flowing",
537 "default:dirt",
538 "default:desert_sand",
539 "default:permafrost_with_moss",
540 "default:dirt_with_coniferous_litter",
541 "default:water_source",
542 "default:dirt_with_dry_grass",
543 "default:river_water_flowing",
544 "default:stone",
545 "default:snow",
546 "default:lava_flowing",
547 "default:lava_source",
548 "default:permafrost_with_stones",
549 "default:dirt_with_grass_footsteps",
550 "default:silver_sand",
551 "default:snowblock",
552 "default:clay",
553
554 "farming:desert_sand_soil",
555 "farming:desert_sand_soil_wet",
556 "farming:dry_soil",
557 "farming:dry_soil_wet",
558 "farming:soil",
559 "farming:soil_wet",
560 })
561
562 unified_inventory.add_category_items('lighting', {
563 "default:mese_post_light_junglewood",
564 "default:torch_ceiling",
565 "default:meselamp",
566 "default:torch",
567 "default:mese_post_light_acacia_wood",
568 "default:mese_post_light",
569 "default:torch_wall",
570 "default:mese_post_light_pine_wood",
571 "default:mese_post_light_aspen_wood"
572 })
573 --]]
574
575
576 --[[ UNCATEGORISED
577
578 "farming:string",
579
580 "beds:bed_bottom",
581 "beds:bed_top",
582 "beds:fancy_bed_bottom",
583 "beds:fancy_bed_top",
584 "boats:boat",
585 "bones:bones",
586
587 "bucket:bucket_lava",
588 "bucket:bucket_river_water",
589 "bucket:bucket_water",
590
591 "butterflies:butterfly_red",
592 "butterflies:butterfly_violet",
593 "butterflies:butterfly_white",
594 "butterflies:hidden_butterfly_red",
595 "butterflies:hidden_butterfly_violet",
596 "butterflies:hidden_butterfly_white",
597
598 "carts:brakerail",
599 "carts:cart",
600 "carts:powerrail",
601 "carts:rail",
602
603 "default:book",
604 "default:book_written",
605 "default:bookshelf",
606 "default:chest",
607 "default:chest_locked",
608 "default:chest_locked_open",
609 "default:chest_open",
610 "default:clay_lump",
611 "default:cloud",
612 "default:coral_brown",
613 "default:coral_cyan",
614 "default:coral_green",
615 "default:coral_orange",
616 "default:coral_pink",
617 "default:coral_skeleton",
618 "default:flint",
619 "default:furnace",
620 "default:furnace_active",
621 "default:key",
622 "default:ladder_steel",
623 "default:ladder_wood",
624 "default:obsidian_shard",
625 "default:paper",
626 "default:sign_wall_steel",
627 "default:sign_wall_wood",
628 "default:stick",
629
630 "fire:basic_flame",
631 "fire:permanent_flame",
632 "fireflies:firefly",
633 "fireflies:firefly_bottle",
634 "fireflies:hidden_firefly",
635
636 "ignore",
637 "unknown",
638
639 "tnt:boom",
640 "tnt:gunpowder",
641 "tnt:gunpowder_burning",
642 "tnt:tnt",
643 "tnt:tnt_burning",
644 "tnt:tnt_stick",
645
646 "vessels:drinking_glass",
647 "vessels:glass_bottle",
648 "vessels:glass_fragments",
649 "vessels:shelf",
650 "vessels:steel_bottle",
651
652 "dye:black",
653 "dye:blue",
654 "dye:brown",
655 "dye:cyan",
656 "dye:dark_green",
657 "dye:dark_grey",
658 "dye:green",
659 "dye:grey",
660 "dye:magenta",
661 "dye:orange",
662 "dye:pink",
663 "dye:red",
664 "dye:violet",
665 "dye:white",
666 "dye:yellow",
667
668 "wool:black",
669 "wool:blue",
670 "wool:brown",
671 "wool:cyan",
672 "wool:dark_green",
673 "wool:dark_grey",
674 "wool:green",
675 "wool:grey",
676 "wool:magenta",
677 "wool:orange",
678 "wool:pink",
679 "wool:red",
680 "wool:violet",
681 "wool:white",
682 "wool:yellow",
683
684 "unified_inventory:bag_large",
685 "unified_inventory:bag_medium",
686 "unified_inventory:bag_small",
687 --]]
688
689 --[[ LIST UNCATEGORIZED AFTER LOAD
690 minetest.register_on_mods_loaded(function()
691 minetest.after(1, function ( )
692 local l = {}
693 for name,_ in pairs(minetest.registered_items) do
694 if not unified_inventory.find_category(name) then
695 -- minetest.log("error", minetest.serialize(minetest.registered_items[name]))
696 table.insert(l, name)
697 end
698 end
699 table.sort(l)
700 minetest.log(table.concat(l, '",'.."\n"..'"'))
701 end)
702 end)
703 --]]
+0
-6
depends.txt less more
0 default
1 creative?
2 sfinv?
3 intllib?
4 datastorage?
5 farming?
+0
-1
description.txt less more
0 Unified Inventory replaces the default survival and creative inventory. It adds a nicer interface and a number of features, such as a crafting guide.
0 unified_inventory API
1 =====================
2
3 This file provides information about the API of unified_inventory.
4
5 API revisions within unified_inventory can be checked using:
6
7 (unified_inventory.version or 1)
8
9 **Revision history**
10
11 * Version `1`: Classic formspec layout (no real_coordinates)
12 * Version `2`: Force formspec version 4 (includes real_coordinates)
13
14 Misc functions
15 --------------
16 Grouped by use-case, afterwards sorted alphabetically.
17
18 * `unified_inventory.is_creative(name)`
19 * Checks whether creative is enabled or the player has `creative`
20
21
22 Pages
23 -----
24
25 Register a new page: The callback inside this function is called on user input.
26
27 unified_inventory.register_page("pagename", {
28 get_formspec = function(player)
29 -- ^ `player` is an `ObjectRef`
30 -- Compute the formspec string here
31 return {
32 formspec = "button[2,2;2,1;mybutton;Press me]",
33 -- ^ Final form of the formspec to display
34 draw_inventory = false, -- default `true`
35 -- ^ Optional. Hides the player's `main` inventory list
36 draw_item_list = false, -- default `true`
37 -- ^ Optional. Hides the item list on the right side
38 formspec_prepend = false, -- default `false`
39 -- ^ Optional. When `false`: Disables the formspec prepend
40 }
41 end,
42 })
43
44
45 Buttons
46 -------
47
48 Register a new button for the bottom row:
49
50 unified_inventory.register_button("skins", {
51 type = "image",
52 image = "skins_skin_button.png",
53 tooltip = "Skins",
54 hide_lite = true
55 -- ^ Button is hidden when following two conditions are met:
56 -- Configuration line `unified_inventory_lite = true`
57 -- Player does not have the privilege `ui_full`
58 })
59
60
61
62 Crafting
63 --------
64
65 The code blocks below document each possible parameter using exemplary values.
66
67 Provide information to display custom craft types:
68
69 unified_inventory.register_craft_type("mytype", {
70 -- ^ Unique identifier for `register_craft`
71 description = "Sample Craft",
72 -- ^ Text shown below the crafting arrow
73 icon = "dummy.png",
74 -- ^ Image shown above the crafting arrow
75 width = 3,
76 height = 3,
77 -- ^ Maximal input dimensions of the recipes
78 dynamic_display_size = function(craft)
79 -- ^ `craft` is the definition from `register_craft`
80 return {
81 width = 2,
82 height = 3
83 }
84 end,
85 -- ^ Optional callback to change the displayed recipe size
86 uses_crafting_grid = true,
87 })
88
89 Register a non-standard craft recipe:
90
91 unified_inventory.register_craft({
92 output = "default:foobar",
93 type = "mytype",
94 -- ^ Standard craft type or custom (see `register_craft_type`)
95 items = {
96 { "default:foo" },
97 { "default:bar" }
98 },
99 width = 3,
100 -- ^ Same as `minetest.register_recipe`
101 })
102
103
104 Categories
105 ----------
106
107 Register a new category:
108 The config table (second argument) is optional, and all its members are optional
109 See the unified_inventory.set_category_* functions for more details on the members of the config table
110
111 unified_inventory.register_category("category_name", {
112 symbol = "mod_name:item_name" or "texture.png",
113 label = "Human Readable Label",
114 index = 5,
115 items = {
116 "mod_name:item_name",
117 "another_mod:different_item"
118 }
119 })
120
121 Add / override the symbol for a category:
122 The category does not need to exist first
123 The symbol can be an item name or a texture image
124 If unset this will default to "default:stick"
125
126 unified_inventory.set_category_symbol("category_name", "mod_name:item_name" or "texture.png")
127
128 Add / override the human readable label for a category:
129 If unset this will default to the category name
130
131 unified_inventory.set_category_label("category_name", "Human Readable Label")
132
133 Add / override the sorting index of the category:
134 Must be a number, can also be negative (-5) or fractional (2.345)
135 This determines the position the category appears in the list of categories
136 The "all" meta-category has index -2, the "misc"/"uncategorized" meta-category has index -1, use a negative number smaller than these to make a category appear before these in the list
137 By default categories are sorted alphabetically with an index between 0.0101(AA) and 0.2626(ZZ)
138
139 unified_inventory.set_category_index("category_name", 5)
140
141 Add a single item to a category:
142
143 unified_inventory.add_category_item("category_name", "mod_name:item_name")
144
145 Add multiple items to a category:
146
147 unified_inventory.add_category_items("category_name", {
148 "mod_name:item_name",
149 "another_mod:different_item"
150 })
151
152 Remove an item from a category:
153
154 unified_inventory.remove_category_item("category_name", "mod_name:item_name")
155
156 Remove a category entirely:
157
158 unified_inventory.remove_category("category_name")
159
160 Finding existing items in categories:
161 This will find the first category an item exists in
162 It should be used for checking if an item is catgorised
163 Returns "category_name" or nil
164
165 unified_inventory.find_category("mod_name:item_name")
166
167
168 This will find all the categories an item exists in
169 Returns a number indexed table (list) of category names
170
171 unified_inventory.find_categories("mod_name:item_name")
0 local S = unified_inventory.gettext
0 local S = minetest.get_translator("unified_inventory")
11
22 function unified_inventory.canonical_item_spec_matcher(spec)
33 local specname = ItemStack(spec):get_name()
4 if specname:sub(1, 6) == "group:" then
5 local group_names = specname:sub(7):split(",")
4 if specname:sub(1, 6) ~= "group:" then
65 return function (itemname)
7 local itemdef = minetest.registered_items[itemname]
8 for _, group_name in ipairs(group_names) do
9 if (itemdef.groups[group_name] or 0) == 0 then
10 return false
11 end
6 return itemname == specname
7 end
8 end
9
10 local group_names = specname:sub(7):split(",")
11 return function (itemname)
12 local itemdef = minetest.registered_items[itemname]
13 for _, group_name in ipairs(group_names) do
14 if (itemdef.groups[group_name] or 0) == 0 then
15 return false
1216 end
13 return true
1417 end
15 else
16 return function (itemname) return itemname == specname end
18 return true
1719 end
1820 end
1921
2426
2527 function unified_inventory.extract_groupnames(groupname)
2628 local specname = ItemStack(groupname):get_name()
27 if specname:sub(1, 6) == "group:" then
28 local group_names = specname:sub(7):split(",")
29 if #group_names == 1 then
30 return group_names[1], 1
31 end
32 local s = ""
33 for g=1,#group_names do
34 if g > 1 then
35 -- List connector
36 s = s .. S(" and ")
37 end
38 s = s .. group_names[g]
39 end
40 return s, #group_names
41 else
29 if specname:sub(1, 6) ~= "group:" then
4230 return nil, 0
4331 end
32 local group_names = specname:sub(7):split(",")
33 return table.concat(group_names, S(" and ")), #group_names
4434 end
4535
4636 unified_inventory.registered_group_items = {
11
22 local modpath = minetest.get_modpath(minetest.get_current_modname())
33 local worldpath = minetest.get_worldpath()
4
5 -- Intllib
6 local S, NS = dofile(modpath .. "/intllib.lua")
74
85 -- Data tables definitions
96 unified_inventory = {
129 alternate = {},
1310 current_page = {},
1411 current_searchbox = {},
12 current_category = {},
13 current_category_scroll = {},
1514 current_index = {},
1615 current_item = {},
1716 current_craft_direction = {},
3231 -- Default inventory page
3332 default = "craft",
3433
35 -- intllib
36 gettext = S,
37
3834 -- "Lite" mode
3935 lite_mode = minetest.settings:get_bool("unified_inventory_lite"),
4036
37 -- Items automatically added to categories based on item definitions
38 automatic_categorization = (minetest.settings:get_bool("unified_inventory_automatic_categorization") ~= false),
39
4140 -- Trash enabled
4241 trash_enabled = (minetest.settings:get_bool("unified_inventory_trash") ~= false),
42 imgscale = 1.25,
43 list_img_offset = 0.13,
44 standard_background = "background9[0,0;1,1;ui_formbg_9_sliced.png;true;16]",
45 version = 2
46 }
4347
48 local ui = unified_inventory
49
50 -- These tables establish position and layout for the two UI styles.
51 -- UI doesn't use formspec_[xy] anymore, but other mods may need them.
52
53 ui.style_full = {
54 formspec_x = 1,
55 formspec_y = 1,
56 formw = 17.75,
57 formh = 12.25,
4458 pagecols = 8,
45 pagerows = 10,
46 page_y = 0,
47 formspec_y = 1,
48 main_button_x = 0,
49 main_button_y = 9,
50 craft_result_x = 0.3,
51 craft_result_y = 0.5,
52 form_header_y = 0
59 pagerows = 9,
60 page_x = 10.75,
61 page_y = 2.30,
62 craft_x = 2.8,
63 craft_y = 1.15,
64 craftresult_x = 7.8,
65 craft_arrow_x = 6.55,
66 craft_guide_x = 3.3,
67 craft_guide_y = 1.15,
68 craft_guide_arrow_x = 7.05,
69 craft_guide_result_x = 8.3,
70 craft_guide_resultstr_x = 0.3,
71 craft_guide_resultstr_y = 0.6,
72 give_btn_x = 0.25,
73 main_button_x = 0.4,
74 main_button_y = 11.0,
75 page_buttons_x = 11.60,
76 page_buttons_y = 10.15,
77 searchwidth = 3.4,
78 form_header_x = 0.4,
79 form_header_y = 0.4,
80 btn_spc = 0.85,
81 btn_size = 0.75,
82 std_inv_x = 0.3,
83 std_inv_y = 5.75,
5384 }
85
86 ui.style_lite = {
87 formspec_x = 0.6,
88 formspec_y = 0.6,
89 formw = 14,
90 formh = 9.75,
91 pagecols = 4,
92 pagerows = 5,
93 page_x = 10.5,
94 page_y = 2.15,
95 craft_x = 2.6,
96 craft_y = 0.75,
97 craftresult_x = 5.75,
98 craft_arrow_x = 6.35,
99 craft_guide_x = 3.1,
100 craft_guide_y = 0.75,
101 craft_guide_arrow_x = 7.05,
102 craft_guide_result_x = 8.3,
103 craft_guide_resultstr_x = 0.15,
104 craft_guide_resultstr_y = 0.35,
105 give_btn_x = 0.15,
106 main_button_x = 10.5,
107 main_button_y = 8.15,
108 page_buttons_x = 10.5,
109 page_buttons_y = 6.15,
110 searchwidth = 1.6,
111 form_header_x = 0.2,
112 form_header_y = 0.2,
113 btn_spc = 0.8,
114 btn_size = 0.7,
115 std_inv_x = 0.1,
116 std_inv_y = 4.6,
117 }
118
119 dofile(modpath.."/api.lua")
120
121 for _, style in ipairs({ui.style_full, ui.style_lite}) do
122 style.items_per_page = style.pagecols * style.pagerows
123 style.standard_inv = string.format("list[current_player;main;%f,%f;8,4;]",
124 style.std_inv_x + ui.list_img_offset, style.std_inv_y + ui.list_img_offset)
125
126 style.standard_inv_bg = ui.make_inv_img_grid(style.std_inv_x, style.std_inv_y, 8, 1, true)..
127 ui.make_inv_img_grid(style.std_inv_x, style.std_inv_y + ui.imgscale, 8, 3)
128
129 style.craft_grid = table.concat({
130 ui.make_inv_img_grid(style.craft_x, style.craft_y, 3, 3),
131 ui.single_slot(style.craft_x + ui.imgscale*4, style.craft_y), -- the craft result slot
132 string.format("image[%f,%f;%f,%f;ui_crafting_arrow.png]",
133 style.craft_arrow_x, style.craft_y, ui.imgscale, ui.imgscale),
134 string.format("list[current_player;craft;%f,%f;3,3;]",
135 style.craft_x + ui.list_img_offset, style.craft_y + ui.list_img_offset),
136 string.format("list[current_player;craftpreview;%f,%f;1,1;]",
137 style.craftresult_x + ui.list_img_offset, style.craft_y + ui.list_img_offset)
138 })
139 end
54140
55141 -- Disable default creative inventory
56142 local creative = rawget(_G, "creative") or rawget(_G, "creative_inventory")
67153 end
68154
69155 dofile(modpath.."/group.lua")
70 dofile(modpath.."/api.lua")
156 dofile(modpath.."/category.lua")
157 dofile(modpath.."/default-categories.lua")
71158 dofile(modpath.."/internal.lua")
72159 dofile(modpath.."/callbacks.lua")
160 dofile(modpath.."/match_craft.lua")
73161 dofile(modpath.."/register.lua")
74162
75163 if minetest.settings:get_bool("unified_inventory_bags") ~= false then
0 local S = unified_inventory.gettext
0 local S = minetest.get_translator("unified_inventory")
11 local F = minetest.formspec_escape
2 local ui = unified_inventory
23
34 -- This pair of encoding functions is used where variable text must go in
45 -- button names, where the text might contain formspec metacharacters.
89 -- This is a game engine bug, and in the anticipation that it might be
910 -- fixed some day we don't want to rely on it. So for safety we apply
1011 -- an encoding that avoids all formspec metacharacters.
11 function unified_inventory.mangle_for_formspec(str)
12
13 function ui.mangle_for_formspec(str)
1214 return string.gsub(str, "([^A-Za-z0-9])", function (c) return string.format("_%d_", string.byte(c)) end)
1315 end
14 function unified_inventory.demangle_for_formspec(str)
16 function ui.demangle_for_formspec(str)
1517 return string.gsub(str, "_([0-9]+)_", function (v) return string.char(v) end)
1618 end
1719
18 function unified_inventory.get_per_player_formspec(player_name)
19 local lite = unified_inventory.lite_mode and not minetest.check_player_privs(player_name, {ui_full=true})
20
21 local ui = {}
22 ui.pagecols = unified_inventory.pagecols
23 ui.pagerows = unified_inventory.pagerows
24 ui.page_y = unified_inventory.page_y
25 ui.formspec_y = unified_inventory.formspec_y
26 ui.main_button_x = unified_inventory.main_button_x
27 ui.main_button_y = unified_inventory.main_button_y
28 ui.craft_result_x = unified_inventory.craft_result_x
29 ui.craft_result_y = unified_inventory.craft_result_y
30 ui.form_header_y = unified_inventory.form_header_y
31
32 if lite then
33 ui.pagecols = 4
34 ui.pagerows = 6
35 ui.page_y = 0.25
36 ui.formspec_y = 0.47
37 ui.main_button_x = 8.2
38 ui.main_button_y = 6.5
39 ui.craft_result_x = 2.8
40 ui.craft_result_y = 3.4
41 ui.form_header_y = -0.1
42 end
43
44 ui.items_per_page = ui.pagecols * ui.pagerows
45 return ui, lite
46 end
47
48 function unified_inventory.get_formspec(player, page)
20
21 function ui.get_per_player_formspec(player_name)
22 local draw_lite_mode = ui.lite_mode and not minetest.check_player_privs(player_name, {ui_full=true})
23
24 return table.copy(draw_lite_mode and ui.style_lite or ui.style_full), draw_lite_mode
25 end
26
27 local function formspec_button(ui_peruser, name, image, offset, pos, scale, label)
28 local element = 'image_button'
29 if minetest.registered_items[image] then
30 element = 'item_image_button'
31 end
32 local spc = (1-scale)*ui_peruser.btn_size/2
33 local size = ui_peruser.btn_size*scale
34 return string.format("%s[%f,%f;%f,%f;%s;%s;]", element,
35 (offset.x or offset[1]) + ( ui_peruser.btn_spc * (pos.x or pos[1]) ) + spc,
36 (offset.y or offset[2]) + ( ui_peruser.btn_spc * (pos.y or pos[2]) ) + spc,
37 size, size, image, name) ..
38 string.format("tooltip[%s;%s]", name, F(label or name))
39 end
40
41 function ui.get_formspec(player, page)
4942
5043 if not player then
5144 return ""
5245 end
5346
5447 local player_name = player:get_player_name()
55 local ui_peruser,draw_lite_mode = unified_inventory.get_per_player_formspec(player_name)
56
57 unified_inventory.current_page[player_name] = page
58 local pagedef = unified_inventory.pages[page]
48 local ui_peruser,draw_lite_mode = ui.get_per_player_formspec(player_name)
49
50 ui.current_page[player_name] = page
51 local pagedef = ui.pages[page]
52
53 if not pagedef then
54 return "" -- Invalid page name
55 end
5956
6057 local formspec = {
61 "size[14,10]",
62 "background[-0.19,-0.25;14.4,10.75;ui_form_bg.png]" -- Background
58 "formspec_version[4]",
59 "size["..ui_peruser.formw..","..ui_peruser.formh.."]",
60 pagedef.formspec_prepend and "" or "no_prepend[]",
61 ui.standard_background
6362 }
64 local n = 3
65
66 if draw_lite_mode then
67 formspec[1] = "size[11,7.7]"
68 formspec[2] = "background[-0.19,-0.2;11.4,8.4;ui_form_bg.png]"
69 end
70
71 if unified_inventory.is_creative(player_name)
72 and page == "craft" then
73 formspec[n] = "background[0,"..(ui_peruser.formspec_y + 2)..";1,1;ui_single_slot.png]"
74 n = n+1
75 end
76
77 -- Current page
78 if not unified_inventory.pages[page] then
79 return "" -- Invalid page name
80 end
81
82 local perplayer_formspec = unified_inventory.get_per_player_formspec(player_name)
63
64 local n = 5
65
66 local perplayer_formspec = ui.get_per_player_formspec(player_name)
8367 local fsdata = pagedef.get_formspec(player, perplayer_formspec)
8468
8569 formspec[n] = fsdata.formspec
9276
9377 local filtered_inv_buttons = {}
9478
95 for i, def in pairs(unified_inventory.buttons) do
79 for i, def in pairs(ui.buttons) do
9680 if not (draw_lite_mode and def.hide_lite) then
9781 table.insert(filtered_inv_buttons, def)
9882 end
10791
10892 if def.type == "image" then
10993 if (def.condition == nil or def.condition(player) == true) then
110 formspec[n] = "image_button["
111 formspec[n+1] = ( ui_peruser.main_button_x + 0.65 * (i - 1) - button_col * 0.65 * 4)
112 formspec[n+2] = ","..(ui_peruser.main_button_y + button_row * 0.7)..";0.8,0.8;"
113 formspec[n+3] = F(def.image)..";"
114 formspec[n+4] = F(def.name)..";]"
115 formspec[n+5] = "tooltip["..F(def.name)
116 formspec[n+6] = ";"..(def.tooltip or "").."]"
117 n = n+7
94 formspec[n] = string.format("image_button[%f,%f;%f,%f;%s;%s;]",
95 ui_peruser.main_button_x + ui_peruser.btn_spc * (i - 1) - button_col * ui_peruser.btn_spc * 4,
96 ui_peruser.main_button_y + button_row * ui_peruser.btn_spc,
97 ui_peruser.btn_size,ui_peruser.btn_size,
98 F(def.image),
99 F(def.name))
100 formspec[n+1] = "tooltip["..F(def.name)..";"..(def.tooltip or "").."]"
101 n = n+2
118102 else
119 formspec[n] = "image["
120 formspec[n+1] = ( ui_peruser.main_button_x + 0.65 * (i - 1) - button_col * 0.65 * 4)
121 formspec[n+2] = ","..(ui_peruser.main_button_y + button_row * 0.7)..";0.8,0.8;"
122 formspec[n+3] = F(def.image).."^[colorize:#808080:alpha]"
123 n = n+4
124
103 formspec[n] = string.format("image[%f,%f;%f,%f;%s^[colorize:#808080:alpha]",
104 ui_peruser.main_button_x + ui_peruser.btn_spc * (i - 1) - button_col * ui_peruser.btn_spc * 4,
105 ui_peruser.main_button_y + button_row * ui_peruser.btn_spc,
106 ui_peruser.btn_size,ui_peruser.btn_size,def.image)
107 n = n+1
125108 end
126109 end
127110 end
129112 if fsdata.draw_inventory ~= false then
130113 -- Player inventory
131114 formspec[n] = "listcolors[#00000000;#00000000]"
132 formspec[n+1] = "list[current_player;main;0,"..(ui_peruser.formspec_y + 3.5)..";8,4;]"
115 formspec[n+1] = ui_peruser.standard_inv
133116 n = n+2
134117 end
135118
137120 return table.concat(formspec, "")
138121 end
139122
140 -- Controls to flip items pages
141 local start_x = 9.2
142
143 if not draw_lite_mode then
144 formspec[n] =
145 "image_button[" .. (start_x + 0.6 * 0)
146 .. ",9;.8,.8;ui_skip_backward_icon.png;start_list;]"
147 .. "tooltip[start_list;" .. F(S("First page")) .. "]"
148
149 .. "image_button[" .. (start_x + 0.6 * 1)
150 .. ",9;.8,.8;ui_doubleleft_icon.png;rewind3;]"
151 .. "tooltip[rewind3;" .. F(S("Back three pages")) .. "]"
152 .. "image_button[" .. (start_x + 0.6 * 2)
153 .. ",9;.8,.8;ui_left_icon.png;rewind1;]"
154 .. "tooltip[rewind1;" .. F(S("Back one page")) .. "]"
155
156 .. "image_button[" .. (start_x + 0.6 * 3)
157 .. ",9;.8,.8;ui_right_icon.png;forward1;]"
158 .. "tooltip[forward1;" .. F(S("Forward one page")) .. "]"
159 .. "image_button[" .. (start_x + 0.6 * 4)
160 .. ",9;.8,.8;ui_doubleright_icon.png;forward3;]"
161 .. "tooltip[forward3;" .. F(S("Forward three pages")) .. "]"
162
163 .. "image_button[" .. (start_x + 0.6 * 5)
164 .. ",9;.8,.8;ui_skip_forward_icon.png;end_list;]"
165 .. "tooltip[end_list;" .. F(S("Last page")) .. "]"
166 else
167 formspec[n] =
168 "image_button[" .. (8.2 + 0.65 * 0)
169 .. ",5.8;.8,.8;ui_skip_backward_icon.png;start_list;]"
170 .. "tooltip[start_list;" .. F(S("First page")) .. "]"
171 .. "image_button[" .. (8.2 + 0.65 * 1)
172 .. ",5.8;.8,.8;ui_left_icon.png;rewind1;]"
173 .. "tooltip[rewind1;" .. F(S("Back one page")) .. "]"
174 .. "image_button[" .. (8.2 + 0.65 * 2)
175 .. ",5.8;.8,.8;ui_right_icon.png;forward1;]"
176 .. "tooltip[forward1;" .. F(S("Forward one page")) .. "]"
177 .. "image_button[" .. (8.2 + 0.65 * 3)
178 .. ",5.8;.8,.8;ui_skip_forward_icon.png;end_list;]"
179 .. "tooltip[end_list;" .. F(S("Last page")) .. "]"
180 end
181 n = n+1
123 -- Category filters
124
125 local categories_pos = { ui_peruser.page_x, ui_peruser.page_y-ui_peruser.btn_spc-0.5 }
126 local categories_scroll_pos = { ui_peruser.page_x, ui_peruser.form_header_y-(draw_lite_mode and 0 or 0.2) }
127
128 formspec[n] = string.format("background9[%f,%f;%f,%f;%s;false;3]",
129 ui_peruser.page_x-0.1, categories_scroll_pos[2],
130 (ui_peruser.btn_spc * ui_peruser.pagecols) + 0.13, 1.4+(draw_lite_mode and 0 or 0.2),
131 "ui_smallbg_9_sliced.png")
132 n = n + 1
133
134 formspec[n] = string.format("label[%f,%f;%s]", ui_peruser.page_x, ui_peruser.form_header_y+(draw_lite_mode and 0.3 or 0.2), "Category:")
135 n = n + 1
136
137 local scroll_offset = 0
138 local category_count = #unified_inventory.category_list
139 if category_count > ui_peruser.pagecols then
140 scroll_offset = unified_inventory.current_category_scroll[player_name]
141 end
142
143 for index, category in ipairs(unified_inventory.category_list) do
144 local column = index - scroll_offset
145 if column > 0 and column <= ui_peruser.pagecols then
146 local scale = 0.8
147 if unified_inventory.current_category[player_name] == category.name then
148 scale = 1
149 end
150 formspec[n] = formspec_button(ui_peruser, "category_"..category.name, category.symbol, categories_pos, {column-1, 0}, scale, category.label)
151 n = n + 1
152 end
153 end
154 if category_count > ui_peruser.pagecols and scroll_offset > 0 then
155 -- prev
156 formspec[n] = formspec_button(ui_peruser, "prev_category", "ui_left_icon.png", categories_scroll_pos, {ui_peruser.pagecols - 2, 0}, 0.8, S("Scroll categories left"))
157 n = n + 1
158 end
159 if category_count > ui_peruser.pagecols and category_count - scroll_offset > ui_peruser.pagecols then
160 -- next
161 formspec[n] = formspec_button(ui_peruser, "next_category", "ui_right_icon.png", categories_scroll_pos, {ui_peruser.pagecols - 1, 0}, 0.8, S("Scroll categories right"))
162 n = n + 1
163 end
182164
183165 -- Search box
184166 formspec[n] = "field_close_on_enter[searchbox;false]"
185 n = n+1
186
187 if not draw_lite_mode then
188 formspec[n] = "field[9.5,8.325;3,1;searchbox;;"
189 .. F(unified_inventory.current_searchbox[player_name]) .. "]"
190 formspec[n+1] = "image_button[12.2,8.1;.8,.8;ui_search_icon.png;searchbutton;]"
191 .. "tooltip[searchbutton;" ..F(S("Search")) .. "]"
192 formspec[n+2] = "image_button[12.9,8.1;.8,.8;ui_reset_icon.png;searchresetbutton;]"
193 .. "tooltip[searchbutton;" ..F(S("Search")) .. "]"
194 .. "tooltip[searchresetbutton;" ..F(S("Reset search and display everything")) .. "]"
195 else
196 formspec[n] = "field[8.5,5.225;2.2,1;searchbox;;"
197 .. F(unified_inventory.current_searchbox[player_name]) .. "]"
198 formspec[n+1] = "image_button[10.3,5;.8,.8;ui_search_icon.png;searchbutton;]"
199 .. "tooltip[searchbutton;" ..F(S("Search")) .. "]"
200 formspec[n+2] = "image_button[11,5;.8,.8;ui_reset_icon.png;searchresetbutton;]"
201 .. "tooltip[searchbutton;" ..F(S("Search")) .. "]"
202 .. "tooltip[searchresetbutton;" ..F(S("Reset search and display everything")) .. "]"
203 end
204 n = n+3
167
168 formspec[n+1] = string.format("field[%f,%f;%f,%f;searchbox;;%s]",
169 ui_peruser.page_buttons_x, ui_peruser.page_buttons_y,
170 ui_peruser.searchwidth - 0.1, ui_peruser.btn_size,
171 F(ui.current_searchbox[player_name]))
172 formspec[n+2] = string.format("image_button[%f,%f;%f,%f;ui_search_icon.png;searchbutton;]",
173 ui_peruser.page_buttons_x + ui_peruser.searchwidth, ui_peruser.page_buttons_y,
174 ui_peruser.btn_size,ui_peruser.btn_size)
175 formspec[n+3] = "tooltip[searchbutton;" ..F(S("Search")) .. "]"
176 formspec[n+4] = string.format("image_button[%f,%f;%f,%f;ui_reset_icon.png;searchresetbutton;]",
177 ui_peruser.page_buttons_x + ui_peruser.searchwidth + ui_peruser.btn_spc,
178 ui_peruser.page_buttons_y,
179 ui_peruser.btn_size, ui_peruser.btn_size)
180 formspec[n+5] = "tooltip[searchresetbutton;"..F(S("Reset search and display everything")).."]"
181
182 n = n + 6
183
184 -- Controls to flip items pages
185
186 local btnlist = {
187 { "ui_skip_backward_icon.png", "start_list", S("First page") },
188 { "ui_doubleleft_icon.png", "rewind3", S("Back three pages") },
189 { "ui_left_icon.png", "rewind1", S("Back one page") },
190 { "ui_right_icon.png", "forward1", S("Forward one page") },
191 { "ui_doubleright_icon.png", "forward3", S("Forward three pages") },
192 { "ui_skip_forward_icon.png", "end_list", S("Last page") },
193 }
194
195 if draw_lite_mode then
196 btnlist[5] = nil
197 btnlist[2] = nil
198 end
199
200 local bn = 0
201 for _, b in pairs(btnlist) do
202 formspec[n] = string.format("image_button[%f,%f;%f,%f;%s;%s;]",
203 ui_peruser.page_buttons_x + ui_peruser.btn_spc*bn,
204 ui_peruser.page_buttons_y + ui_peruser.btn_spc,
205 ui_peruser.btn_size, ui_peruser.btn_size,
206 b[1],b[2])
207 formspec[n+1] = "tooltip["..b[2]..";"..F(b[3]).."]"
208 bn = bn + 1
209 n = n + 2
210 end
205211
206212 local no_matches = S("No matching items")
207213 if draw_lite_mode then
209215 end
210216
211217 -- Items list
212 if #unified_inventory.filtered_items_list[player_name] == 0 then
213 formspec[n] = "label[8.2,"..ui_peruser.form_header_y..";" .. F(no_matches) .. "]"
218 if #ui.filtered_items_list[player_name] == 0 then
219 formspec[n] = "label["..ui_peruser.page_x..","..(ui_peruser.page_y+0.15)..";" .. F(no_matches) .. "]"
214220 else
215 local dir = unified_inventory.active_search_direction[player_name]
216 local list_index = unified_inventory.current_index[player_name]
217 local page = math.floor(list_index / (ui_peruser.items_per_page) + 1)
221 local dir = ui.active_search_direction[player_name]
222 local list_index = ui.current_index[player_name]
223 local page2 = math.floor(list_index / (ui_peruser.items_per_page) + 1)
218224 local pagemax = math.floor(
219 (#unified_inventory.filtered_items_list[player_name] - 1)
225 (#ui.filtered_items_list[player_name] - 1)
220226 / (ui_peruser.items_per_page) + 1)
221 local item = {}
222227 for y = 0, ui_peruser.pagerows - 1 do
223228 for x = 0, ui_peruser.pagecols - 1 do
224 local name = unified_inventory.filtered_items_list[player_name][list_index]
225 if minetest.registered_items[name] then
229 local name = ui.filtered_items_list[player_name][list_index]
230 local item = minetest.registered_items[name]
231 if item then
226232 -- Clicked on current item: Flip crafting direction
227 if name == unified_inventory.current_item[player_name] then
228 local cdir = unified_inventory.current_craft_direction[player_name]
233 if name == ui.current_item[player_name] then
234 local cdir = ui.current_craft_direction[player_name]
229235 if cdir == "recipe" then
230236 dir = "usage"
231237 elseif cdir == "usage" then
233239 end
234240 else
235241 -- Default: use active search direction by default
236 dir = unified_inventory.active_search_direction[player_name]
242 dir = ui.active_search_direction[player_name]
237243 end
238 formspec[n] = "item_image_button["
239 ..(8.2 + x * 0.7)..","
240 ..(ui_peruser.formspec_y + ui_peruser.page_y + y * 0.7)..";.81,.81;"
241 ..name..";item_button_"..dir.."_"
242 ..unified_inventory.mangle_for_formspec(name)..";]"
243 n = n+1
244
245 local button_name = "item_button_" .. dir .. "_"
246 .. ui.mangle_for_formspec(name)
247 formspec[n] = ("item_image_button[%f,%f;%f,%f;%s;%s;]"):format(
248 ui_peruser.page_x + x * ui_peruser.btn_spc,
249 ui_peruser.page_y + y * ui_peruser.btn_spc,
250 ui_peruser.btn_size, ui_peruser.btn_size,
251 name, button_name
252 )
253 formspec[n + 1] = ("tooltip[%s;%s \\[%s\\]]"):format(
254 button_name, minetest.formspec_escape(item.description),
255 item.mod_origin or "??"
256 )
257 n = n + 2
244258 list_index = list_index + 1
245259 end
246260 end
247261 end
248 formspec[n] = "label[8.2,"..ui_peruser.form_header_y..";"..F(S("Page")) .. ": "
249 .. S("%s of %s"):format(page,pagemax).."]"
262 formspec[n] = string.format("label[%f,%f;%s: %s]",
263 ui_peruser.page_buttons_x + ui_peruser.btn_spc * (draw_lite_mode and 1 or 2),
264 ui_peruser.page_buttons_y + 0.1 + ui_peruser.btn_spc * 2,
265 F(S("Page")), S("@1 of @2",page2,pagemax))
250266 end
251267 n= n+1
252268
253 if unified_inventory.activefilter[player_name] ~= "" then
254 formspec[n] = "label[8.2,"..(ui_peruser.form_header_y + 0.4)..";" .. F(S("Filter")) .. ":]"
255 formspec[n+1] = "label[9.1,"..(ui_peruser.form_header_y + 0.4)..";"..F(unified_inventory.activefilter[player_name]).."]"
269 if ui.activefilter[player_name] ~= "" then
270 formspec[n] = string.format("label[%f,%f;%s: %s]",
271 ui_peruser.page_x, ui_peruser.page_y - 0.25,
272 F(S("Filter")), F(ui.activefilter[player_name]))
256273 end
257274 return table.concat(formspec, "")
258275 end
259276
260 function unified_inventory.set_inventory_formspec(player, page)
277 function ui.set_inventory_formspec(player, page)
261278 if player then
262 player:set_inventory_formspec(unified_inventory.get_formspec(player, page))
263 end
279 player:set_inventory_formspec(ui.get_formspec(player, page))
280 end
281 end
282
283 local function valid_def(def)
284 return (not def.groups.not_in_creative_inventory
285 or def.groups.not_in_creative_inventory == 0)
286 and def.description
287 and def.description ~= ""
264288 end
265289
266290 --apply filter to the inventory list (create filtered copy of full one)
267 function unified_inventory.apply_filter(player, filter, search_dir)
291 function ui.apply_filter(player, filter, search_dir)
268292 if not player then
269293 return false
270294 end
283307 return true
284308 end
285309 else
310 local lang = minetest.get_player_information(player_name).lang_code
286311 ffilter = function(name, def)
287312 local lname = string.lower(name)
288313 local ldesc = string.lower(def.description)
314 local llocaldesc = minetest.get_translated_string
315 and string.lower(minetest.get_translated_string(lang, def.description))
289316 return string.find(lname, lfilter, 1, true) or string.find(ldesc, lfilter, 1, true)
290 end
291 end
292 local is_creative = unified_inventory.is_creative(player_name)
293 unified_inventory.filtered_items_list[player_name]={}
294 for name, def in pairs(minetest.registered_items) do
295 if (not def.groups.not_in_creative_inventory
296 or def.groups.not_in_creative_inventory == 0)
297 and def.description
298 and def.description ~= ""
299 and ffilter(name, def)
300 and (is_creative or unified_inventory.crafts_for.recipe[def.name]) then
301 table.insert(unified_inventory.filtered_items_list[player_name], name)
302 end
303 end
304 table.sort(unified_inventory.filtered_items_list[player_name])
305 unified_inventory.filtered_items_list_size[player_name] = #unified_inventory.filtered_items_list[player_name]
306 unified_inventory.current_index[player_name] = 1
307 unified_inventory.activefilter[player_name] = filter
308 unified_inventory.active_search_direction[player_name] = search_dir
309 unified_inventory.set_inventory_formspec(player,
310 unified_inventory.current_page[player_name])
311 end
312
313 function unified_inventory.items_in_group(groups)
317 or llocaldesc and string.find(llocaldesc, lfilter, 1, true)
318 end
319 end
320 ui.filtered_items_list[player_name]={}
321 local category = ui.current_category[player_name] or 'all'
322 if category == 'all' then
323 for name, def in pairs(minetest.registered_items) do
324 if valid_def(def)
325 and ffilter(name, def) then
326 table.insert(ui.filtered_items_list[player_name], name)
327 end
328 end
329 elseif category == 'uncategorized' then
330 for name, def in pairs(minetest.registered_items) do
331 if (not ui.find_category(name))
332 and valid_def(def)
333 and ffilter(name, def) then
334 table.insert(ui.filtered_items_list[player_name], name)
335 end
336 end
337 else
338 for name,exists in pairs(ui.registered_category_items[category]) do
339 local def = minetest.registered_items[name]
340 if exists and def
341 and valid_def(def)
342 and ffilter(name, def) then
343 table.insert(ui.filtered_items_list[player_name], name)
344 end
345 end
346 end
347 table.sort(ui.filtered_items_list[player_name])
348 ui.filtered_items_list_size[player_name] = #ui.filtered_items_list[player_name]
349 ui.current_index[player_name] = 1
350 ui.activefilter[player_name] = filter
351 ui.active_search_direction[player_name] = search_dir
352 ui.set_inventory_formspec(player,
353 ui.current_page[player_name])
354 end
355
356 function ui.items_in_group(groups)
314357 local items = {}
315358 for name, item in pairs(minetest.registered_items) do
316359 for _, group in pairs(groups:split(',')) do
322365 return items
323366 end
324367
325 function unified_inventory.sort_inventory(inv)
368 function ui.sort_inventory(inv)
326369 local inlist = inv:get_list("main")
327370 local typecnt = {}
328371 local typekeys = {}
+0
-45
intllib.lua less more
0
1 -- Fallback functions for when `intllib` is not installed.
2 -- Code released under Unlicense <http://unlicense.org>.
3
4 -- Get the latest version of this file at:
5 -- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
6
7 local function format(str, ...)
8 local args = { ... }
9 local function repl(escape, open, num, close)
10 if escape == "" then
11 local replacement = tostring(args[tonumber(num)])
12 if open == "" then
13 replacement = replacement..close
14 end
15 return replacement
16 else
17 return "@"..open..num..close
18 end
19 end
20 return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
21 end
22
23 local gettext, ngettext
24 if minetest.get_modpath("intllib") then
25 if intllib.make_gettext_pair then
26 -- New method using gettext.
27 gettext, ngettext = intllib.make_gettext_pair()
28 else
29 -- Old method using text files.
30 gettext = intllib.Getter()
31 end
32 end
33
34 -- Fill in missing functions.
35
36 gettext = gettext or function(msgid, ...)
37 return format(msgid, ...)
38 end
39
40 ngettext = ngettext or function(msgid, msgid_plural, n, ...)
41 return format(n==1 and msgid or msgid_plural, ...)
42 end
43
44 return gettext, ngettext
00 -- Based on 4itemnames mod by 4aiman
11
2 local item_names = {} -- [player_name] = { hud, dtime, itemname }
2 local item_names = {} -- [player_name] = { hud, dtime, itemname }
33 local dlimit = 3 -- HUD element will be hidden after this many seconds
4 local air_hud_mod = minetest.get_modpath("4air")
5 local hud_mod = minetest.get_modpath("hud")
64 local hudbars_mod = minetest.get_modpath("hudbars")
75
86 local function set_hud(player)
97 local player_name = player:get_player_name()
10 local off = {x=0, y=-70}
11 if air_hud_mod or hud_mod then
12 off.y = off.y - 20
13 elseif hudbars_mod then
14 off.y = off.y + 13
8 local off = {x=0, y=-65}
9 if hudbars_mod then
10 -- Assume no alignment (2 per line)
11 off.y = off.y - math.ceil(hb.hudbars_count / 2) * 25
12 else
13 off.y = off.y - 25
1514 end
15
1616 item_names[player_name] = {
1717 hud = player:hud_add({
1818 hud_elem_type = "text",
1919 position = {x=0.5, y=1},
2020 offset = off,
21 alignment = {x=0, y=0},
21 alignment = {x=0, y=-1},
2222 number = 0xFFFFFF,
2323 text = "",
2424 }),
+0
-366
locale/de.po less more
0 # German translation for the unified_inventory mod.
1 # Copyright (C) 2018 Maciej Kasatkin (RealBadAngel)
2 # This file is distributed under the same license as the unified_inventory package.
3 # Xanthin
4 # CodeXP <codexp@gmx.net>, 2018.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: unified_inventory\n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2018-04-02 13:41+0200\n"
12 "PO-Revision-Date: \n"
13 "Last-Translator: CodeXP <codexp@gmx.net>\n"
14 "Language-Team: \n"
15 "Language: de\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19
20 #: api.lua register.lua
21 msgid "Crafting"
22 msgstr "Fertigung"
23
24 #: api.lua
25 msgid "Mixing"
26 msgstr "Mischen"
27
28 #: api.lua
29 msgid "Cooking"
30 msgstr "Kochen"
31
32 #: api.lua
33 msgid "Digging"
34 msgstr "Graben"
35
36 #: bags.lua
37 msgid "Bags"
38 msgstr "Taschen"
39
40 #: bags.lua
41 msgid "Bag @1"
42 msgstr "Tasche @1"
43
44 #: bags.lua
45 msgid "Small Bag"
46 msgstr "Kleine Tasche"
47
48 #: bags.lua
49 msgid "Medium Bag"
50 msgstr "Mittelgroße Tasche"
51
52 #: bags.lua
53 msgid "Large Bag"
54 msgstr "Große Tasche"
55
56 #: group.lua
57 msgid " and "
58 msgstr " und "
59
60 #: internal.lua
61 msgid "First page"
62 msgstr "Erste Seite"
63
64 #: internal.lua
65 msgid "Back three pages"
66 msgstr "3 Seiten zurückblättern"
67
68 #: internal.lua
69 msgid "Back one page"
70 msgstr "1 Seite zurückblättern"
71
72 #: internal.lua
73 msgid "Forward one page"
74 msgstr "1 Seite vorblättern"
75
76 #: internal.lua
77 msgid "Forward three pages"
78 msgstr "3 Seiten vorblättern"
79
80 #: internal.lua
81 msgid "Last page"
82 msgstr "Letzte Seite"
83
84 #: internal.lua
85 msgid "Search"
86 msgstr "Suchen"
87
88 #: internal.lua
89 msgid "Reset search and display everything"
90 msgstr "Suche zurücksetzen und alles anzeigen"
91
92 #: internal.lua
93 msgid "No matching items"
94 msgstr "Keine passenden Gegenstände"
95
96 #: internal.lua
97 msgid "No matches."
98 msgstr "Keine Treffer"
99
100 #: internal.lua
101 msgid "Page"
102 msgstr "Seite"
103
104 #: internal.lua
105 #, lua-format
106 msgid "%s of %s"
107 msgstr "%s von %s"
108
109 #: internal.lua
110 msgid "Filter"
111 msgstr "Filter"
112
113 #: register.lua
114 msgid "Can use the creative inventory"
115 msgstr "Kann das Kreativinventar nutzen"
116
117 #: register.lua
118 msgid ""
119 "Forces Unified Inventory to be displayed in Full mode if Lite mode is "
120 "configured globally"
121 msgstr ""
122
123 #: register.lua
124 msgid "Crafting Grid"
125 msgstr "Fertigungsraster"
126
127 #: register.lua
128 msgid "Crafting Guide"
129 msgstr "Fertigungsführer"
130
131 #: register.lua
132 msgid "Set home position"
133 msgstr "Heimatposition setzen"
134
135 #: register.lua
136 #, lua-format
137 msgid "Home position set to: %s"
138 msgstr "Heimatposition nach: %s gesetzt"
139
140 #: register.lua
141 msgid "You don't have the \"home\" privilege!"
142 msgstr "Du hast das \"home\"-Privileg nicht!"
143
144 #: register.lua
145 msgid "Go home"
146 msgstr "Nach Hause gehen"
147
148 #: register.lua
149 msgid "Set time to day"
150 msgstr "Zur Tageszeit wechseln"
151
152 #: register.lua
153 msgid "Time of day set to 6am"
154 msgstr "Tageszeit auf 6 Uhr gesetzt"
155
156 #: register.lua
157 msgid "You don't have the settime privilege!"
158 msgstr "Du hast das \"settime\"-Privileg nicht!"
159
160 #: register.lua
161 msgid "Set time to night"
162 msgstr "Zur Nachtzeit wechseln"
163
164 #: register.lua
165 msgid "Time of day set to 9pm"
166 msgstr "Tageszeit auf 21 Uhr gesetzt"
167
168 #: register.lua
169 msgid "Clear inventory"
170 msgstr "Inventar leeren"
171
172 #: register.lua
173 #, fuzzy
174 msgid ""
175 "This button has been disabled outside of creative mode to prevent accidental "
176 "inventory trashing.\n"
177 "Use the trash slot instead."
178 msgstr ""
179 "Diese Funktion ist außerhalb des Kreativmodus deaktiviert, um ein "
180 "versehentliches Löschen des ganzen Inventars zu verhindern.\n"
181 "Nutze stattdessen das Müllfeld."
182
183 #: register.lua
184 msgid "Inventory cleared!"
185 msgstr "Inventar geleert!"
186
187 #: register.lua
188 msgid "Trash:"
189 msgstr "Müll:"
190
191 #: register.lua
192 msgid "Refill:"
193 msgstr "Nachfüllen:"
194
195 #: register.lua
196 #, lua-format
197 msgid "Any item belonging to the %s group"
198 msgstr "Irgendein Gegenstand, der zur Gruppe %s gehört"
199
200 #: register.lua
201 #, lua-format
202 msgid "Any item belonging to the groups %s"
203 msgstr "Irgendein Gegenstand, der zu den Gruppen %s gehört"
204
205 #: register.lua
206 #, lua-format
207 msgid "Recipe %d of %d"
208 msgstr "Rezept %d von %d"
209
210 #: register.lua
211 #, lua-format
212 msgid "Usage %d of %d"
213 msgstr "Verwendung %d von %d"
214
215 #: register.lua
216 msgid "No recipes"
217 msgstr "Keine Rezepte"
218
219 #: register.lua
220 msgid "No usages"
221 msgstr "Keine Verwendungen"
222
223 #: register.lua
224 msgid "Result"
225 msgstr "Ergebnis"
226
227 #: register.lua
228 msgid "Ingredient"
229 msgstr "Zutat"
230
231 #: register.lua
232 msgid "Show next recipe"
233 msgstr "Nächstes Rezept zeigen"
234
235 #: register.lua
236 msgid "Show next usage"
237 msgstr "Nächste Verwendung zeigen"
238
239 #: register.lua
240 msgid "Show previous recipe"
241 msgstr "Vorheriges Rezept zeigen"
242
243 #: register.lua
244 msgid "Show previous usage"
245 msgstr "Vorherige Verwendung zeigen"
246
247 #: register.lua
248 #, lua-format
249 msgid "%s (%s)"
250 msgstr ""
251
252 #: register.lua
253 msgid "Give me:"
254 msgstr "Gib mir:"
255
256 #: register.lua
257 msgid ""
258 "This recipe is too\n"
259 "large to be displayed."
260 msgstr ""
261 "Dieses Rezept ist zu\n"
262 "groß, um angezeigt\n"
263 "zu werden."
264
265 #: register.lua
266 msgid "To craft grid:"
267 msgstr "Ins Fertigungsraster:"
268
269 #: register.lua
270 msgid "All"
271 msgstr "Alles"
272
273 #: waypoints.lua
274 msgid "White"
275 msgstr "Weiß"
276
277 #: waypoints.lua
278 msgid "Yellow"
279 msgstr "Gelb"
280
281 #: waypoints.lua
282 msgid "Red"
283 msgstr "Rot"
284
285 #: waypoints.lua
286 msgid "Green"
287 msgstr "Grün"
288
289 #: waypoints.lua
290 msgid "Blue"
291 msgstr "Blau"
292
293 #: waypoints.lua
294 msgid "Waypoints"
295 msgstr "Wegpunkte"
296
297 #: waypoints.lua
298 #, lua-format
299 msgid "Select Waypoint #%d"
300 msgstr "Wegpunkt Nr. %d auswählen"
301
302 #: waypoints.lua
303 #, lua-format
304 msgid "Waypoint %d"
305 msgstr "Wegpunkt Nr. %d"
306
307 #: waypoints.lua
308 msgid "Set waypoint to current location"
309 msgstr "Setze Wegpunkt zur derzeitigen Position"
310
311 #: waypoints.lua
312 msgid "invisible"
313 msgstr "unsichtbar"
314
315 #: waypoints.lua
316 msgid "visible"
317 msgstr "sichtbar"
318
319 #: waypoints.lua
320 msgid "Make waypoint @1"
321 msgstr "Wegpunkt @1 machen"
322
323 #: waypoints.lua
324 msgid "Disable"
325 msgstr "ausschalten"
326
327 #: waypoints.lua
328 msgid "Enable"
329 msgstr "einschalten"
330
331 #: waypoints.lua
332 msgid "@1 display of waypoint coordinates"
333 msgstr "Anzeige der Wegpunktkoordinaten @1"
334
335 #: waypoints.lua
336 msgid "Change color of waypoint display"
337 msgstr "Farbe der Darstellung der Wegpunkte ändern"
338
339 #: waypoints.lua
340 msgid "Edit waypoint name"
341 msgstr "Name des Wegpunkts ändern"
342
343 #: waypoints.lua
344 msgid "Waypoint active"
345 msgstr "Wegpunkt aktiv"
346
347 #: waypoints.lua
348 msgid "Waypoint inactive"
349 msgstr "Wegpunkt inaktiv"
350
351 #: waypoints.lua
352 msgid "Finish editing"
353 msgstr "Bearbeitung abschließen"
354
355 #: waypoints.lua
356 msgid "World position"
357 msgstr "Weltposition"
358
359 #: waypoints.lua
360 msgid "Name"
361 msgstr "Name"
362
363 #: waypoints.lua
364 msgid "HUD text color"
365 msgstr "HUD-Textfarbe"
+0
-366
locale/es.po less more
0 # Spanish translation for the unified_inventory mod.
1 # Copyright (C) 2018 Maciej Kasatkin (RealBadAngel)
2 # This file is distributed under the same license as the unified_inventory package.
3 # Diego Martínez <kaeza>
4 # CodeXP <codexp@gmx.net>, 2018.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: unified_inventory\n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2018-04-02 16:15+0200\n"
12 "PO-Revision-Date: \n"
13 "Last-Translator: CodeXP <codexp@gmx.net>\n"
14 "Language-Team: \n"
15 "Language: es\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19
20 #: api.lua register.lua
21 msgid "Crafting"
22 msgstr "Elaboración"
23
24 #: api.lua
25 msgid "Mixing"
26 msgstr ""
27
28 #: api.lua
29 #, fuzzy
30 msgid "Cooking"
31 msgstr "hornear"
32
33 #: api.lua
34 msgid "Digging"
35 msgstr ""
36
37 #: bags.lua
38 msgid "Bags"
39 msgstr "Bolsas"
40
41 #: bags.lua
42 msgid "Bag @1"
43 msgstr "Bolsa @1"
44
45 #: bags.lua
46 msgid "Small Bag"
47 msgstr "Bolsa Pequeña"
48
49 #: bags.lua
50 msgid "Medium Bag"
51 msgstr "Bolsa Mediana"
52
53 #: bags.lua
54 msgid "Large Bag"
55 msgstr "Bolsa Grande"
56
57 #: group.lua
58 msgid " and "
59 msgstr ""
60
61 #: internal.lua
62 msgid "First page"
63 msgstr ""
64
65 #: internal.lua
66 msgid "Back three pages"
67 msgstr ""
68
69 #: internal.lua
70 msgid "Back one page"
71 msgstr ""
72
73 #: internal.lua
74 msgid "Forward one page"
75 msgstr ""
76
77 #: internal.lua
78 msgid "Forward three pages"
79 msgstr ""
80
81 #: internal.lua
82 msgid "Last page"
83 msgstr ""
84
85 #: internal.lua
86 msgid "Search"
87 msgstr ""
88
89 #: internal.lua
90 msgid "Reset search and display everything"
91 msgstr ""
92
93 #: internal.lua
94 msgid "No matching items"
95 msgstr ""
96
97 #: internal.lua
98 msgid "No matches."
99 msgstr ""
100
101 #: internal.lua
102 msgid "Page"
103 msgstr "Página"
104
105 #: internal.lua
106 #, lua-format
107 msgid "%s of %s"
108 msgstr "%s de %s"
109
110 #: internal.lua
111 msgid "Filter"
112 msgstr "Filtro"
113
114 #: register.lua
115 msgid "Can use the creative inventory"
116 msgstr "Puede usar el inventario creativo"
117
118 #: register.lua
119 msgid ""
120 "Forces Unified Inventory to be displayed in Full mode if Lite mode is "
121 "configured globally"
122 msgstr ""
123
124 #: register.lua
125 msgid "Crafting Grid"
126 msgstr ""
127
128 #: register.lua
129 msgid "Crafting Guide"
130 msgstr "Guía de Elaboración"
131
132 #: register.lua
133 #, fuzzy
134 msgid "Set home position"
135 msgstr "Posición en el mundo"
136
137 #: register.lua
138 #, lua-format
139 msgid "Home position set to: %s"
140 msgstr "Posición de hogar cambiada a: %s"
141
142 #: register.lua
143 msgid "You don't have the \"home\" privilege!"
144 msgstr "¡No tienes el privilegio \"home\"!"
145
146 #: register.lua
147 msgid "Go home"
148 msgstr ""
149
150 #: register.lua
151 msgid "Set time to day"
152 msgstr ""
153
154 #: register.lua
155 msgid "Time of day set to 6am"
156 msgstr "Hora del día cambiada a 6AM"
157
158 #: register.lua
159 msgid "You don't have the settime privilege!"
160 msgstr "¡No tienes el privilegio \"settime\"!"
161
162 #: register.lua
163 msgid "Set time to night"
164 msgstr ""
165
166 #: register.lua
167 msgid "Time of day set to 9pm"
168 msgstr "Hora del día cambiada a 9PM"
169
170 #: register.lua
171 msgid "Clear inventory"
172 msgstr ""
173
174 #: register.lua
175 #, fuzzy
176 msgid ""
177 "This button has been disabled outside of creative mode to prevent accidental "
178 "inventory trashing.\n"
179 "Use the trash slot instead."
180 msgstr ""
181 "Éste botón ha sido deshabilitado para prevenir la destrucción accidental del "
182 "inventario.\n"
183 "Usa la ranura para basura en su lugar."
184
185 #: register.lua
186 msgid "Inventory cleared!"
187 msgstr "¡Inventario limpio!"
188
189 #: register.lua
190 msgid "Trash:"
191 msgstr "Basura:"
192
193 #: register.lua
194 msgid "Refill:"
195 msgstr "Rellenar:"
196
197 #: register.lua
198 #, lua-format
199 msgid "Any item belonging to the %s group"
200 msgstr ""
201
202 #: register.lua
203 #, lua-format
204 msgid "Any item belonging to the groups %s"
205 msgstr ""
206
207 #: register.lua
208 #, lua-format
209 msgid "Recipe %d of %d"
210 msgstr "Receta %d de %d"
211
212 #: register.lua
213 #, lua-format
214 msgid "Usage %d of %d"
215 msgstr ""
216
217 #: register.lua
218 msgid "No recipes"
219 msgstr ""
220
221 #: register.lua
222 msgid "No usages"
223 msgstr ""
224
225 #: register.lua
226 msgid "Result"
227 msgstr "Resultado"
228
229 #: register.lua
230 msgid "Ingredient"
231 msgstr ""
232
233 #: register.lua
234 msgid "Show next recipe"
235 msgstr ""
236
237 #: register.lua
238 msgid "Show next usage"
239 msgstr ""
240
241 #: register.lua
242 msgid "Show previous recipe"
243 msgstr ""
244
245 #: register.lua
246 msgid "Show previous usage"
247 msgstr ""
248
249 #: register.lua
250 #, lua-format
251 msgid "%s (%s)"
252 msgstr ""
253
254 #: register.lua
255 msgid "Give me:"
256 msgstr ""
257
258 #: register.lua
259 msgid ""
260 "This recipe is too\n"
261 "large to be displayed."
262 msgstr ""
263
264 #: register.lua
265 #, fuzzy
266 msgid "To craft grid:"
267 msgstr "Copiar al cuadro de elaboración"
268
269 #: register.lua
270 msgid "All"
271 msgstr "Todos"
272
273 #: waypoints.lua
274 msgid "White"
275 msgstr "Blanco"
276
277 #: waypoints.lua
278 msgid "Yellow"
279 msgstr "Amarillo"
280
281 #: waypoints.lua
282 msgid "Red"
283 msgstr "Rojo"
284
285 #: waypoints.lua
286 msgid "Green"
287 msgstr "Verde"
288
289 #: waypoints.lua
290 msgid "Blue"
291 msgstr "Azul"
292
293 #: waypoints.lua
294 msgid "Waypoints"
295 msgstr "Puntos de paso"
296
297 #: waypoints.lua
298 #, lua-format
299 msgid "Select Waypoint #%d"
300 msgstr ""
301
302 #: waypoints.lua
303 #, lua-format
304 msgid "Waypoint %d"
305 msgstr "Puntos de paso %d"
306
307 #: waypoints.lua
308 msgid "Set waypoint to current location"
309 msgstr ""
310
311 #: waypoints.lua
312 msgid "invisible"
313 msgstr ""
314
315 #: waypoints.lua
316 msgid "visible"
317 msgstr ""
318
319 #: waypoints.lua
320 msgid "Make waypoint @1"
321 msgstr ""
322
323 #: waypoints.lua
324 msgid "Disable"
325 msgstr ""
326
327 #: waypoints.lua
328 msgid "Enable"
329 msgstr ""
330
331 #: waypoints.lua
332 msgid "@1 display of waypoint coordinates"
333 msgstr ""
334
335 #: waypoints.lua
336 msgid "Change color of waypoint display"
337 msgstr ""
338
339 #: waypoints.lua
340 msgid "Edit waypoint name"
341 msgstr ""
342
343 #: waypoints.lua
344 msgid "Waypoint active"
345 msgstr "Punto de paso activo"
346
347 #: waypoints.lua
348 msgid "Waypoint inactive"
349 msgstr "Punto de paso inactivo"
350
351 #: waypoints.lua
352 msgid "Finish editing"
353 msgstr ""
354
355 #: waypoints.lua
356 msgid "World position"
357 msgstr "Posición en el mundo"
358
359 #: waypoints.lua
360 msgid "Name"
361 msgstr "Nombre"
362
363 #: waypoints.lua
364 msgid "HUD text color"
365 msgstr "Color del HUD"
+0
-364
locale/fr.po less more
0 # French translation for the unified_inventory mod.
1 # Copyright (C) 2018 Maciej Kasatkin (RealBadAngel)
2 # This file is distributed under the same license as the unified_inventory package.
3 # kilbith
4 # CodeXP <codexp@gmx.net>, 2018.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: unified_inventory\n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2018-04-02 16:15+0200\n"
12 "PO-Revision-Date: \n"
13 "Last-Translator: CodeXP <codexp@gmx.net>\n"
14 "Language-Team: \n"
15 "Language: fr\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19
20 #: api.lua register.lua
21 msgid "Crafting"
22 msgstr "Création"
23
24 #: api.lua
25 msgid "Mixing"
26 msgstr ""
27
28 #: api.lua
29 msgid "Cooking"
30 msgstr "Cuisson"
31
32 #: api.lua
33 msgid "Digging"
34 msgstr "Creuser"
35
36 #: bags.lua
37 msgid "Bags"
38 msgstr "Sacs"
39
40 #: bags.lua
41 msgid "Bag @1"
42 msgstr "Sac @1"
43
44 #: bags.lua
45 msgid "Small Bag"
46 msgstr "Petit sac"
47
48 #: bags.lua
49 msgid "Medium Bag"
50 msgstr "Sac moyen"
51
52 #: bags.lua
53 msgid "Large Bag"
54 msgstr "Grand sac"
55
56 #: group.lua
57 msgid " and "
58 msgstr " et "
59
60 #: internal.lua
61 msgid "First page"
62 msgstr "1ère page"
63
64 #: internal.lua
65 msgid "Back three pages"
66 msgstr "3 pages en arrière"
67
68 #: internal.lua
69 msgid "Back one page"
70 msgstr "Page précédente"
71
72 #: internal.lua
73 msgid "Forward one page"
74 msgstr "Page suivante"
75
76 #: internal.lua
77 msgid "Forward three pages"
78 msgstr "3 pages en avant"
79
80 #: internal.lua
81 msgid "Last page"
82 msgstr "Dernière page"
83
84 #: internal.lua
85 msgid "Search"
86 msgstr "Rechercher"
87
88 #: internal.lua
89 msgid "Reset search and display everything"
90 msgstr ""
91
92 #: internal.lua
93 msgid "No matching items"
94 msgstr "Aucun élément correspondant"
95
96 #: internal.lua
97 msgid "No matches."
98 msgstr "Aucun match"
99
100 #: internal.lua
101 msgid "Page"
102 msgstr "Page"
103
104 #: internal.lua
105 #, lua-format
106 msgid "%s of %s"
107 msgstr "%s de %s"
108
109 #: internal.lua
110 msgid "Filter"
111 msgstr "Filtre"
112
113 #: register.lua
114 msgid "Can use the creative inventory"
115 msgstr "Vous pouvez utiliser l'inventaire créatif"
116
117 #: register.lua
118 msgid ""
119 "Forces Unified Inventory to be displayed in Full mode if Lite mode is "
120 "configured globally"
121 msgstr ""
122
123 #: register.lua
124 msgid "Crafting Grid"
125 msgstr "Grille de création"
126
127 #: register.lua
128 msgid "Crafting Guide"
129 msgstr "Guide de création"
130
131 #: register.lua
132 #, fuzzy
133 msgid "Set home position"
134 msgstr "Position dans le monde"
135
136 #: register.lua
137 #, lua-format
138 msgid "Home position set to: %s"
139 msgstr "Position de votre base fixée à: %s"
140
141 #: register.lua
142 msgid "You don't have the \"home\" privilege!"
143 msgstr "Vous n'avez pas le privilège \"home\"!"
144
145 #: register.lua
146 msgid "Go home"
147 msgstr ""
148
149 #: register.lua
150 msgid "Set time to day"
151 msgstr ""
152
153 #: register.lua
154 msgid "Time of day set to 6am"
155 msgstr "Heure fixée à 6h"
156
157 #: register.lua
158 msgid "You don't have the settime privilege!"
159 msgstr "Vous n'avez pas le privilège \"settime\"!"
160
161 #: register.lua
162 msgid "Set time to night"
163 msgstr ""
164
165 #: register.lua
166 msgid "Time of day set to 9pm"
167 msgstr "Heure fixée à 21h"
168
169 #: register.lua
170 msgid "Clear inventory"
171 msgstr ""
172
173 #: register.lua
174 msgid ""
175 "This button has been disabled outside of creative mode to prevent accidental "
176 "inventory trashing.\n"
177 "Use the trash slot instead."
178 msgstr ""
179 "Ce bouton a été désactivé en dehors du mode créatif pour éviter des saccages "
180 "dans l'inventaire.\n"
181 "Utilisez plutôt la case poubelle."
182
183 #: register.lua
184 msgid "Inventory cleared!"
185 msgstr "Inventaire vidé !"
186
187 #: register.lua
188 msgid "Trash:"
189 msgstr "Poubelle :"
190
191 #: register.lua
192 msgid "Refill:"
193 msgstr "Remplir :"
194
195 #: register.lua
196 #, lua-format
197 msgid "Any item belonging to the %s group"
198 msgstr ""
199
200 #: register.lua
201 #, lua-format
202 msgid "Any item belonging to the groups %s"
203 msgstr ""
204
205 #: register.lua
206 #, lua-format
207 msgid "Recipe %d of %d"
208 msgstr "Recette %d de %d"
209
210 #: register.lua
211 #, lua-format
212 msgid "Usage %d of %d"
213 msgstr ""
214
215 #: register.lua
216 msgid "No recipes"
217 msgstr ""
218
219 #: register.lua
220 msgid "No usages"
221 msgstr ""
222
223 #: register.lua
224 msgid "Result"
225 msgstr "Résultat"
226
227 #: register.lua
228 msgid "Ingredient"
229 msgstr ""
230
231 #: register.lua
232 msgid "Show next recipe"
233 msgstr ""
234
235 #: register.lua
236 msgid "Show next usage"
237 msgstr ""
238
239 #: register.lua
240 msgid "Show previous recipe"
241 msgstr ""
242
243 #: register.lua
244 msgid "Show previous usage"
245 msgstr ""
246
247 #: register.lua
248 #, lua-format
249 msgid "%s (%s)"
250 msgstr ""
251
252 #: register.lua
253 msgid "Give me:"
254 msgstr ""
255
256 #: register.lua
257 msgid ""
258 "This recipe is too\n"
259 "large to be displayed."
260 msgstr ""
261
262 #: register.lua
263 msgid "To craft grid:"
264 msgstr "Sur de création:"
265
266 #: register.lua
267 msgid "All"
268 msgstr "Tout"
269
270 #: waypoints.lua
271 msgid "White"
272 msgstr "Blanc"
273
274 #: waypoints.lua
275 msgid "Yellow"
276 msgstr "Jaune"
277
278 #: waypoints.lua
279 msgid "Red"
280 msgstr "Rouge"
281
282 #: waypoints.lua
283 msgid "Green"
284 msgstr "Vert"
285
286 #: waypoints.lua
287 msgid "Blue"
288 msgstr "Bleu"
289
290 #: waypoints.lua
291 msgid "Waypoints"
292 msgstr "Point de passage"
293
294 #: waypoints.lua
295 #, lua-format
296 msgid "Select Waypoint #%d"
297 msgstr "Choisir un point de passage #%d"
298
299 #: waypoints.lua
300 #, lua-format
301 msgid "Waypoint %d"
302 msgstr "Point de passage %d"
303
304 #: waypoints.lua
305 msgid "Set waypoint to current location"
306 msgstr "Marquer un point de passage à la position actuelle"
307
308 #: waypoints.lua
309 msgid "invisible"
310 msgstr ""
311
312 #: waypoints.lua
313 msgid "visible"
314 msgstr ""
315
316 #: waypoints.lua
317 msgid "Make waypoint @1"
318 msgstr "Rendre @1 le point de passage"
319
320 #: waypoints.lua
321 msgid "Disable"
322 msgstr ""
323
324 #: waypoints.lua
325 msgid "Enable"
326 msgstr ""
327
328 #: waypoints.lua
329 #, fuzzy
330 msgid "@1 display of waypoint coordinates"
331 msgstr "@1 montrer les coordonnées des points de passages"
332
333 #: waypoints.lua
334 msgid "Change color of waypoint display"
335 msgstr "Changer la couleur du point de passage"
336
337 #: waypoints.lua
338 msgid "Edit waypoint name"
339 msgstr "Editer le nom du point de passage"
340
341 #: waypoints.lua
342 msgid "Waypoint active"
343 msgstr "Point de passage actif"
344
345 #: waypoints.lua
346 msgid "Waypoint inactive"
347 msgstr "Point de passage inactif"
348
349 #: waypoints.lua
350 msgid "Finish editing"
351 msgstr "Terminer l'édition"
352
353 #: waypoints.lua
354 msgid "World position"
355 msgstr "Position dans le monde"
356
357 #: waypoints.lua
358 msgid "Name"
359 msgstr "Nom"
360
361 #: waypoints.lua
362 msgid "HUD text color"
363 msgstr "Couleur de texte du HUD"
+0
-359
locale/pl.po less more
0 # Polish translation for the unified_inventory mod.
1 # Copyright (C) 2018 Maciej Kasatkin (RealBadAngel)
2 # This file is distributed under the same license as the unified_inventory package.
3 # RealBadAngel
4 # CodeXP <codexp@gmx.net>, 2018.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: unified_inventory\n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2018-04-02 16:30+0200\n"
12 "PO-Revision-Date: \n"
13 "Last-Translator: CodeXP <codexp@gmx.net>\n"
14 "Language-Team: \n"
15 "Language: pl\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19
20 #: api.lua register.lua
21 msgid "Crafting"
22 msgstr ""
23
24 #: api.lua
25 msgid "Mixing"
26 msgstr ""
27
28 #: api.lua
29 msgid "Cooking"
30 msgstr ""
31
32 #: api.lua
33 msgid "Digging"
34 msgstr ""
35
36 #: bags.lua
37 msgid "Bags"
38 msgstr "Plecaki"
39
40 #: bags.lua
41 msgid "Bag @1"
42 msgstr "Plecak @1"
43
44 #: bags.lua
45 msgid "Small Bag"
46 msgstr "Maly plecak"
47
48 #: bags.lua
49 msgid "Medium Bag"
50 msgstr "Sredni plecak"
51
52 #: bags.lua
53 msgid "Large Bag"
54 msgstr "Duzy plecak"
55
56 #: group.lua
57 msgid " and "
58 msgstr " i "
59
60 #: internal.lua
61 msgid "First page"
62 msgstr "Pierwsza strona"
63
64 #: internal.lua
65 msgid "Back three pages"
66 msgstr "3 strony w tyl"
67
68 #: internal.lua
69 msgid "Back one page"
70 msgstr "1 strona w tyl"
71
72 #: internal.lua
73 msgid "Forward one page"
74 msgstr "1 strona do przodu"
75
76 #: internal.lua
77 msgid "Forward three pages"
78 msgstr "3 strony do przodu"
79
80 #: internal.lua
81 msgid "Last page"
82 msgstr "Ostatnia strona"
83
84 #: internal.lua
85 msgid "Search"
86 msgstr "Szukaj"
87
88 #: internal.lua
89 msgid "Reset search and display everything"
90 msgstr ""
91
92 #: internal.lua
93 msgid "No matching items"
94 msgstr "Brak pasujacych przedmiotow"
95
96 #: internal.lua
97 msgid "No matches."
98 msgstr "Brak wyników"
99
100 #: internal.lua
101 msgid "Page"
102 msgstr "Strona"
103
104 #: internal.lua
105 #, lua-format
106 msgid "%s of %s"
107 msgstr "%s z %s"
108
109 #: internal.lua
110 msgid "Filter"
111 msgstr "Filtr"
112
113 #: register.lua
114 msgid "Can use the creative inventory"
115 msgstr ""
116
117 #: register.lua
118 msgid ""
119 "Forces Unified Inventory to be displayed in Full mode if Lite mode is "
120 "configured globally"
121 msgstr ""
122
123 #: register.lua
124 msgid "Crafting Grid"
125 msgstr ""
126
127 #: register.lua
128 msgid "Crafting Guide"
129 msgstr ""
130
131 #: register.lua
132 msgid "Set home position"
133 msgstr "Ustaw pozycję wyjściową"
134
135 #: register.lua
136 #, lua-format
137 msgid "Home position set to: %s"
138 msgstr "Pozycja domowa ustawiona na: %s"
139
140 #: register.lua
141 msgid "You don't have the \"home\" privilege!"
142 msgstr "Nie masz uprawnien do zmiany czasu \"home\"!"
143
144 #: register.lua
145 msgid "Go home"
146 msgstr "Idź do domu"
147
148 #: register.lua
149 msgid "Set time to day"
150 msgstr "Ustaw czas na dzień"
151
152 #: register.lua
153 msgid "Time of day set to 6am"
154 msgstr "Czas ustawiony na 6:00"
155
156 #: register.lua
157 msgid "You don't have the settime privilege!"
158 msgstr "Nie masz uprawnien do zmiany czasu \"settime\"!"
159
160 #: register.lua
161 msgid "Set time to night"
162 msgstr "Ustaw czas na noc"
163
164 #: register.lua
165 msgid "Time of day set to 9pm"
166 msgstr "Czas ustawiony na 21:00"
167
168 #: register.lua
169 msgid "Clear inventory"
170 msgstr "Wyczyść zapasy"
171
172 #: register.lua
173 msgid ""
174 "This button has been disabled outside of creative mode to prevent accidental "
175 "inventory trashing.\n"
176 "Use the trash slot instead."
177 msgstr ""
178
179 #: register.lua
180 msgid "Inventory cleared!"
181 msgstr "Zapasy zostały wyczyszczone!"
182
183 #: register.lua
184 msgid "Trash:"
185 msgstr "Smietnik:"
186
187 #: register.lua
188 msgid "Refill:"
189 msgstr "Uzupelnianie:"
190
191 #: register.lua
192 #, lua-format
193 msgid "Any item belonging to the %s group"
194 msgstr ""
195
196 #: register.lua
197 #, lua-format
198 msgid "Any item belonging to the groups %s"
199 msgstr ""
200
201 #: register.lua
202 #, lua-format
203 msgid "Recipe %d of %d"
204 msgstr "Recepta %d z %d"
205
206 #: register.lua
207 #, lua-format
208 msgid "Usage %d of %d"
209 msgstr "Użycie %d z %d"
210
211 #: register.lua
212 msgid "No recipes"
213 msgstr "Brak recepty"
214
215 #: register.lua
216 msgid "No usages"
217 msgstr "Bez użycia"
218
219 #: register.lua
220 msgid "Result"
221 msgstr "Wynik"
222
223 #: register.lua
224 msgid "Ingredient"
225 msgstr "Składnik"
226
227 #: register.lua
228 msgid "Show next recipe"
229 msgstr ""
230
231 #: register.lua
232 msgid "Show next usage"
233 msgstr ""
234
235 #: register.lua
236 msgid "Show previous recipe"
237 msgstr ""
238
239 #: register.lua
240 msgid "Show previous usage"
241 msgstr ""
242
243 #: register.lua
244 #, lua-format
245 msgid "%s (%s)"
246 msgstr ""
247
248 #: register.lua
249 msgid "Give me:"
250 msgstr "Daj mi:"
251
252 #: register.lua
253 msgid ""
254 "This recipe is too\n"
255 "large to be displayed."
256 msgstr ""
257
258 #: register.lua
259 msgid "To craft grid:"
260 msgstr ""
261
262 #: register.lua
263 msgid "All"
264 msgstr "Wszystko"
265
266 #: waypoints.lua
267 msgid "White"
268 msgstr "Bialy"
269
270 #: waypoints.lua
271 msgid "Yellow"
272 msgstr "Zolty"
273
274 #: waypoints.lua
275 msgid "Red"
276 msgstr "Czerwony"
277
278 #: waypoints.lua
279 msgid "Green"
280 msgstr "Zielony"
281
282 #: waypoints.lua
283 msgid "Blue"
284 msgstr "Niebieski"
285
286 #: waypoints.lua
287 msgid "Waypoints"
288 msgstr "Punkty orientacyjne"
289
290 #: waypoints.lua
291 #, lua-format
292 msgid "Select Waypoint #%d"
293 msgstr "Wybierz punkt #%d"
294
295 #: waypoints.lua
296 #, lua-format
297 msgid "Waypoint %d"
298 msgstr "Punkty orientacyjne %d"
299
300 #: waypoints.lua
301 msgid "Set waypoint to current location"
302 msgstr "Ustaw punkt orientacyjny na biezacej pozycji"
303
304 #: waypoints.lua
305 msgid "invisible"
306 msgstr "niewidzialny"
307
308 #: waypoints.lua
309 msgid "visible"
310 msgstr "widomy"
311
312 #: waypoints.lua
313 msgid "Make waypoint @1"
314 msgstr "Robić punkt @1"
315
316 #: waypoints.lua
317 msgid "Disable"
318 msgstr ""
319
320 #: waypoints.lua
321 msgid "Enable"
322 msgstr ""
323
324 #: waypoints.lua
325 msgid "@1 display of waypoint coordinates"
326 msgstr "@1 koordynatow punktu"
327
328 #: waypoints.lua
329 msgid "Change color of waypoint display"
330 msgstr "Zmien kolor punktu"
331
332 #: waypoints.lua
333 msgid "Edit waypoint name"
334 msgstr "Edytuj nazwe punktu"
335
336 #: waypoints.lua
337 msgid "Waypoint active"
338 msgstr "Punkt wlaczony"
339
340 #: waypoints.lua
341 msgid "Waypoint inactive"
342 msgstr "Punkt wylaczony"
343
344 #: waypoints.lua
345 msgid "Finish editing"
346 msgstr "Zakoncz edycje"
347
348 #: waypoints.lua
349 msgid "World position"
350 msgstr "Pozycja"
351
352 #: waypoints.lua
353 msgid "Name"
354 msgstr "Nazwa"
355
356 #: waypoints.lua
357 msgid "HUD text color"
358 msgstr "Kolor tekstu HUD"
+0
-366
locale/pt.po less more
0 # Portuguese translation for the unified_inventory mod.
1 # Copyright (C) 2018 Maciej Kasatkin (RealBadAngel)
2 # This file is distributed under the same license as the unified_inventory package.
3 # Lunovox <lunovox@openmailbox.org>
4 # CodeXP <codexp@gmx.net>, 2018.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: unified_inventory\n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2018-04-02 16:48+0200\n"
12 "PO-Revision-Date: \n"
13 "Last-Translator: CodeXP <codexp@gmx.net>\n"
14 "Language-Team: \n"
15 "Language: pt\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19
20 #: api.lua register.lua
21 msgid "Crafting"
22 msgstr "Artesanato"
23
24 #: api.lua
25 msgid "Mixing"
26 msgstr "Muistura"
27
28 #: api.lua
29 msgid "Cooking"
30 msgstr "Cozimento"
31
32 #: api.lua
33 msgid "Digging"
34 msgstr "Escavação"
35
36 #: bags.lua
37 msgid "Bags"
38 msgstr "Bolsas"
39
40 #: bags.lua
41 msgid "Bag @1"
42 msgstr "Bolsa @1"
43
44 #: bags.lua
45 msgid "Small Bag"
46 msgstr "Bolsa Pequena"
47
48 #: bags.lua
49 msgid "Medium Bag"
50 msgstr "Bolsa Média"
51
52 #: bags.lua
53 msgid "Large Bag"
54 msgstr "Bolsa Grande"
55
56 #: group.lua
57 msgid " and "
58 msgstr " e "
59
60 #: internal.lua
61 msgid "First page"
62 msgstr "Primeira Página"
63
64 #: internal.lua
65 msgid "Back three pages"
66 msgstr "Voltar 3 Páginas"
67
68 #: internal.lua
69 msgid "Back one page"
70 msgstr "Voltar 1 Página"
71
72 #: internal.lua
73 msgid "Forward one page"
74 msgstr "Avançar 1 Página"
75
76 #: internal.lua
77 msgid "Forward three pages"
78 msgstr "Avançar 3 Páginas"
79
80 #: internal.lua
81 msgid "Last page"
82 msgstr "Ultima Página"
83
84 #: internal.lua
85 msgid "Search"
86 msgstr "Pesquisar"
87
88 #: internal.lua
89 msgid "Reset search and display everything"
90 msgstr "Redefinir pesquisa e exibir tudo"
91
92 #: internal.lua
93 msgid "No matching items"
94 msgstr "Nenhum item correspondente"
95
96 #: internal.lua
97 msgid "No matches."
98 msgstr "Sem correspondências"
99
100 #: internal.lua
101 msgid "Page"
102 msgstr "Página"
103
104 #: internal.lua
105 #, lua-format
106 msgid "%s of %s"
107 msgstr "%s de %s"
108
109 #: internal.lua
110 msgid "Filter"
111 msgstr "Filtro"
112
113 #: register.lua
114 msgid "Can use the creative inventory"
115 msgstr "Pode usar o inventário do criativo"
116
117 #: register.lua
118 msgid ""
119 "Forces Unified Inventory to be displayed in Full mode if Lite mode is "
120 "configured globally"
121 msgstr ""
122 "Força o Unified Inventory a ser exibido no modo Full se o modo Lite estiver "
123 "configurado globalmente"
124
125 #: register.lua
126 msgid "Crafting Grid"
127 msgstr "Grade de Artesanato"
128
129 #: register.lua
130 msgid "Crafting Guide"
131 msgstr "Guia de Artesanato"
132
133 #: register.lua
134 msgid "Set home position"
135 msgstr "Definir posição de casa"
136
137 #: register.lua
138 #, lua-format
139 msgid "Home position set to: %s"
140 msgstr "Posição inicial definida para: %s"
141
142 #: register.lua
143 msgid "You don't have the \"home\" privilege!"
144 msgstr "Você não tem o privilégio de \"home\"!"
145
146 #: register.lua
147 msgid "Go home"
148 msgstr "Transportar para Casa"
149
150 #: register.lua
151 msgid "Set time to day"
152 msgstr "Definir turno para dia"
153
154 #: register.lua
155 msgid "Time of day set to 6am"
156 msgstr "Hora do dia definida para 06h"
157
158 #: register.lua
159 msgid "You don't have the settime privilege!"
160 msgstr "Você não tem o privilégio de \"settime\"!"
161
162 #: register.lua
163 msgid "Set time to night"
164 msgstr "Definir turno para noite"
165
166 #: register.lua
167 msgid "Time of day set to 9pm"
168 msgstr "Hora do dia ajustada para 21h"
169
170 #: register.lua
171 msgid "Clear inventory"
172 msgstr "Limpar Inventário"
173
174 #: register.lua
175 msgid ""
176 "This button has been disabled outside of creative mode to prevent accidental "
177 "inventory trashing.\n"
178 "Use the trash slot instead."
179 msgstr ""
180 "Este botão foi desativado fora do modo de criativo para evitar o descarte "
181 "acidental de inventário. \n"
182 "Use o slot de lixo em vez disso."
183
184 #: register.lua
185 msgid "Inventory cleared!"
186 msgstr "Inventário Apagado!"
187
188 #: register.lua
189 msgid "Trash:"
190 msgstr "Lixo:"
191
192 #: register.lua
193 msgid "Refill:"
194 msgstr "Recarga:"
195
196 #: register.lua
197 #, lua-format
198 msgid "Any item belonging to the %s group"
199 msgstr "Qualquer item pertencente ao grupo '%s'."
200
201 #: register.lua
202 #, lua-format
203 msgid "Any item belonging to the groups %s"
204 msgstr "Qualquer item pertencente aos grupos '%s'."
205
206 #: register.lua
207 #, lua-format
208 msgid "Recipe %d of %d"
209 msgstr "Receita %d de %d"
210
211 #: register.lua
212 #, lua-format
213 msgid "Usage %d of %d"
214 msgstr "Utilização %d de %d"
215
216 #: register.lua
217 msgid "No recipes"
218 msgstr "Sem Receita"
219
220 #: register.lua
221 msgid "No usages"
222 msgstr "Sem Utilização"
223
224 #: register.lua
225 msgid "Result"
226 msgstr "Resultado"
227
228 #: register.lua
229 msgid "Ingredient"
230 msgstr "Ingrediente"
231
232 #: register.lua
233 msgid "Show next recipe"
234 msgstr "Exibir Próxima Receita"
235
236 #: register.lua
237 msgid "Show next usage"
238 msgstr "Mostrar Próxima Utilização"
239
240 #: register.lua
241 msgid "Show previous recipe"
242 msgstr "Exibir Receita Anterior"
243
244 #: register.lua
245 msgid "Show previous usage"
246 msgstr "Exibir Utilização Anterior"
247
248 #: register.lua
249 #, lua-format
250 msgid "%s (%s)"
251 msgstr ""
252
253 #: register.lua
254 msgid "Give me:"
255 msgstr "Gerado:"
256
257 #: register.lua
258 msgid ""
259 "This recipe is too\n"
260 "large to be displayed."
261 msgstr ""
262 "Esta receita é grande \n"
263 "demais para ser apresentada."
264
265 #: register.lua
266 msgid "To craft grid:"
267 msgstr "Para Grade de Artesanato"
268
269 #: register.lua
270 msgid "All"
271 msgstr "MAX"
272
273 #: waypoints.lua
274 msgid "White"
275 msgstr "Branco"
276
277 #: waypoints.lua
278 msgid "Yellow"
279 msgstr "Amarelo"
280
281 #: waypoints.lua
282 msgid "Red"
283 msgstr "Vermelho"
284
285 #: waypoints.lua
286 msgid "Green"
287 msgstr "Verde"
288
289 #: waypoints.lua
290 msgid "Blue"
291 msgstr "Azul"
292
293 #: waypoints.lua
294 msgid "Waypoints"
295 msgstr "Apontador de Direção"
296
297 #: waypoints.lua
298 #, lua-format
299 msgid "Select Waypoint #%d"
300 msgstr "Seleção de Apontador de Direção #%02d"
301
302 #: waypoints.lua
303 #, lua-format
304 msgid "Waypoint %d"
305 msgstr "Apontador de Direção %d"
306
307 #: waypoints.lua
308 msgid "Set waypoint to current location"
309 msgstr "Configurar localização atual do Apontador de Direção"
310
311 #: waypoints.lua
312 msgid "invisible"
313 msgstr "invisível"
314
315 #: waypoints.lua
316 msgid "visible"
317 msgstr "visível"
318
319 #: waypoints.lua
320 msgid "Make waypoint @1"
321 msgstr "Fazer Apontador de Direção @1"
322
323 #: waypoints.lua
324 msgid "Disable"
325 msgstr ""
326
327 #: waypoints.lua
328 msgid "Enable"
329 msgstr ""
330
331 #: waypoints.lua
332 msgid "@1 display of waypoint coordinates"
333 msgstr "@1 exibição de coordenadas de Fazer Apontador de Direção"
334
335 #: waypoints.lua
336 msgid "Change color of waypoint display"
337 msgstr "Mudar cor exibida do Apontador de Direção"
338
339 #: waypoints.lua
340 msgid "Edit waypoint name"
341 msgstr "Editar Nome de Apontador de Direção"
342
343 #: waypoints.lua
344 msgid "Waypoint active"
345 msgstr "Apontador de Direção Ativo"
346
347 #: waypoints.lua
348 msgid "Waypoint inactive"
349 msgstr "Apontador de Direção Inativo"
350
351 #: waypoints.lua
352 msgid "Finish editing"
353 msgstr "Edição Finalizada"
354
355 #: waypoints.lua
356 msgid "World position"
357 msgstr "Posição Mundial"
358
359 #: waypoints.lua
360 msgid "Name"
361 msgstr "Nome"
362
363 #: waypoints.lua
364 msgid "HUD text color"
365 msgstr "Cor de HUD"
+0
-366
locale/ru.po less more
0 # Russian translation for the unified_inventory mod.
1 # Copyright (C) 2018 Maciej Kasatkin (RealBadAngel)
2 # This file is distributed under the same license as the unified_inventory package.
3 # eternal_sorrow
4 # CodeXP <codexp@gmx.net>, 2018.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: unified_inventory\n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2018-04-02 03:34+0200\n"
12 "PO-Revision-Date: \n"
13 "Last-Translator: CodeXP <codexp@gmx.net>\n"
14 "Language-Team: \n"
15 "Language: ru\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19
20 #: api.lua register.lua
21 #, fuzzy
22 msgid "Crafting"
23 msgstr "Крафт"
24
25 #: api.lua
26 msgid "Mixing"
27 msgstr "Мешать"
28
29 #: api.lua
30 msgid "Cooking"
31 msgstr "Варить"
32
33 #: api.lua
34 msgid "Digging"
35 msgstr "Копать"
36
37 #: bags.lua
38 msgid "Bags"
39 msgstr "Сумки"
40
41 #: bags.lua
42 msgid "Bag @1"
43 msgstr "Сумка @1"
44
45 #: bags.lua
46 msgid "Small Bag"
47 msgstr "Малая сумка"
48
49 #: bags.lua
50 msgid "Medium Bag"
51 msgstr "Средняя сумка"
52
53 #: bags.lua
54 msgid "Large Bag"
55 msgstr "Большая сумка"
56
57 #: group.lua
58 msgid " and "
59 msgstr " и "
60
61 #: internal.lua
62 msgid "First page"
63 msgstr "Первая страница"
64
65 #: internal.lua
66 msgid "Back three pages"
67 msgstr "3 страницы назад"
68
69 #: internal.lua
70 msgid "Back one page"
71 msgstr "1 страницу назад"
72
73 #: internal.lua
74 msgid "Forward one page"
75 msgstr "1 страницу вперёд"
76
77 #: internal.lua
78 msgid "Forward three pages"
79 msgstr "3 страницы вперёд"
80
81 #: internal.lua
82 msgid "Last page"
83 msgstr "Последняя страница"
84
85 #: internal.lua
86 msgid "Search"
87 msgstr "Поиск"
88
89 #: internal.lua
90 msgid "Reset search and display everything"
91 msgstr "Сброс поиска, показать всё"
92
93 #: internal.lua
94 msgid "No matching items"
95 msgstr "Нет подходящих элементов"
96
97 #: internal.lua
98 msgid "No matches."
99 msgstr "Ничего не найдено"
100
101 #: internal.lua
102 msgid "Page"
103 msgstr "Страница"
104
105 #: internal.lua
106 #, lua-format
107 msgid "%s of %s"
108 msgstr "%s из %s"
109
110 #: internal.lua
111 msgid "Filter"
112 msgstr "Фильтр"
113
114 #: register.lua
115 msgid "Can use the creative inventory"
116 msgstr "Можно использовать инвентарь творческого режима"
117
118 #: register.lua
119 msgid ""
120 "Forces Unified Inventory to be displayed in Full mode if Lite mode is "
121 "configured globally"
122 msgstr ""
123
124 #: register.lua
125 msgid "Crafting Grid"
126 msgstr "Решетка крафта"
127
128 #: register.lua
129 msgid "Crafting Guide"
130 msgstr "Книга рецептов"
131
132 #: register.lua
133 msgid "Set home position"
134 msgstr "Установить позицию дома"
135
136 #: register.lua
137 #, lua-format
138 msgid "Home position set to: %s"
139 msgstr "Дом теперь расположен по коодинатам: %s"
140
141 #: register.lua
142 msgid "You don't have the \"home\" privilege!"
143 msgstr "У вас нет привилегии \"home\"!"
144
145 #: register.lua
146 msgid "Go home"
147 msgstr "Отправиться домой"
148
149 #: register.lua
150 msgid "Set time to day"
151 msgstr "День"
152
153 #: register.lua
154 msgid "Time of day set to 6am"
155 msgstr "Установлено время 6 утра"
156
157 #: register.lua
158 #, fuzzy
159 msgid "You don't have the settime privilege!"
160 msgstr "Вам не разрешено устанавливать время! (нет привилегии \"settime\")"
161
162 #: register.lua
163 msgid "Set time to night"
164 msgstr "Ночь"
165
166 #: register.lua
167 msgid "Time of day set to 9pm"
168 msgstr "Установлено время 9 вечера"
169
170 #: register.lua
171 msgid "Clear inventory"
172 msgstr "Очистить инвентарь"
173
174 #: register.lua
175 msgid ""
176 "This button has been disabled outside of creative mode to prevent accidental "
177 "inventory trashing.\n"
178 "Use the trash slot instead."
179 msgstr ""
180 "Эта кнопка отключена вне творческого режима, чтобы предотвратить случайное "
181 "уничтожение предметов.\n"
182 "Используйте слот корзины вместо нее."
183
184 #: register.lua
185 msgid "Inventory cleared!"
186 msgstr "Инвентарь очищен!"
187
188 #: register.lua
189 msgid "Trash:"
190 msgstr "Мусор:"
191
192 #: register.lua
193 msgid "Refill:"
194 msgstr "Наполнить:"
195
196 #: register.lua
197 #, lua-format
198 msgid "Any item belonging to the %s group"
199 msgstr "Любой элемент из группы: %s"
200
201 #: register.lua
202 #, lua-format
203 msgid "Any item belonging to the groups %s"
204 msgstr "Любой элемент из группы: %s"
205
206 #: register.lua
207 #, lua-format
208 msgid "Recipe %d of %d"
209 msgstr "Рецепт %s из %s"
210
211 #: register.lua
212 #, lua-format
213 msgid "Usage %d of %d"
214 msgstr "Вариант %d of %d"
215
216 #: register.lua
217 msgid "No recipes"
218 msgstr "Рецептов нет"
219
220 #: register.lua
221 msgid "No usages"
222 msgstr "Не используется"
223
224 #: register.lua
225 msgid "Result"
226 msgstr "Результат"
227
228 #: register.lua
229 msgid "Ingredient"
230 msgstr "Состав"
231
232 #: register.lua
233 msgid "Show next recipe"
234 msgstr "Следующий рецепт"
235
236 #: register.lua
237 msgid "Show next usage"
238 msgstr "Следующее использование"
239
240 #: register.lua
241 msgid "Show previous recipe"
242 msgstr "Прошлый рецепт"
243
244 #: register.lua
245 msgid "Show previous usage"
246 msgstr "Прошлая страница"
247
248 #: register.lua
249 #, lua-format
250 msgid "%s (%s)"
251 msgstr ""
252
253 #: register.lua
254 msgid "Give me:"
255 msgstr "Дай мне:"
256
257 #: register.lua
258 msgid ""
259 "This recipe is too\n"
260 "large to be displayed."
261 msgstr ""
262 "Этот рецепт не\n"
263 "помещается в решетку."
264
265 #: register.lua
266 msgid "To craft grid:"
267 msgstr "На решeтку крафта:"
268
269 #: register.lua
270 msgid "All"
271 msgstr "Все"
272
273 #: waypoints.lua
274 msgid "White"
275 msgstr "Белый"
276
277 #: waypoints.lua
278 msgid "Yellow"
279 msgstr "Желтый"
280
281 #: waypoints.lua
282 msgid "Red"
283 msgstr "Красный"
284
285 #: waypoints.lua
286 msgid "Green"
287 msgstr "Зелёный"
288
289 #: waypoints.lua
290 msgid "Blue"
291 msgstr "Синий"
292
293 #: waypoints.lua
294 msgid "Waypoints"
295 msgstr "Путевые точки"
296
297 #: waypoints.lua
298 #, lua-format
299 msgid "Select Waypoint #%d"
300 msgstr "Выбрать путевую точку №%d"
301
302 #: waypoints.lua
303 #, lua-format
304 msgid "Waypoint %d"
305 msgstr "Путевая точка %d"
306
307 #: waypoints.lua
308 msgid "Set waypoint to current location"
309 msgstr "Установить путевую точку по текущей позиции"
310
311 #: waypoints.lua
312 msgid "invisible"
313 msgstr "невидимой"
314
315 #: waypoints.lua
316 msgid "visible"
317 msgstr "видимой"
318
319 #: waypoints.lua
320 msgid "Make waypoint @1"
321 msgstr "Сделать путевую точку @1"
322
323 #: waypoints.lua
324 msgid "Disable"
325 msgstr "Выключить"
326
327 #: waypoints.lua
328 msgid "Enable"
329 msgstr "Включить"
330
331 #: waypoints.lua
332 msgid "@1 display of waypoint coordinates"
333 msgstr "@1 показ координат путевых точек"
334
335 #: waypoints.lua
336 msgid "Change color of waypoint display"
337 msgstr "Поменять цвет путевой точки"
338
339 #: waypoints.lua
340 msgid "Edit waypoint name"
341 msgstr "Переименовать путевую точку"
342
343 #: waypoints.lua
344 msgid "Waypoint active"
345 msgstr "Путевая точка включена"
346
347 #: waypoints.lua
348 msgid "Waypoint inactive"
349 msgstr "Путевая точка выключена"
350
351 #: waypoints.lua
352 msgid "Finish editing"
353 msgstr "Закончить редакцию"
354
355 #: waypoints.lua
356 msgid "World position"
357 msgstr "Позиция мира"
358
359 #: waypoints.lua
360 msgid "Name"
361 msgstr "Имя"
362
363 #: waypoints.lua
364 msgid "HUD text color"
365 msgstr "Цвет текста HUDа"
+0
-360
locale/tr.po less more
0 # Turkish translation for the unified_inventory mod.
1 # Copyright (C) 2018 Maciej Kasatkin (RealBadAngel)
2 # This file is distributed under the same license as the unified_inventory package.
3 # Mahmutelmas06@hotmail.com
4 # CodeXP <codexp@gmx.net>, 2018.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: unified_inventory\n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2018-04-02 13:41+0200\n"
12 "PO-Revision-Date: \n"
13 "Last-Translator: CodeXP <codexp@gmx.net>\n"
14 "Language-Team: \n"
15 "Language: tr\n"
16 "MIME-Version: 1.0\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
19
20 #: api.lua register.lua
21 msgid "Crafting"
22 msgstr "Üretim"
23
24 #: api.lua
25 msgid "Mixing"
26 msgstr "Karıştırma"
27
28 #: api.lua
29 msgid "Cooking"
30 msgstr "Pişirme"
31
32 #: api.lua
33 msgid "Digging"
34 msgstr "Kazma"
35
36 #: bags.lua
37 msgid "Bags"
38 msgstr "Çantalarım"
39
40 #: bags.lua
41 msgid "Bag @1"
42 msgstr "@1. Çanta"
43
44 #: bags.lua
45 msgid "Small Bag"
46 msgstr "Küçük Çanta"
47
48 #: bags.lua
49 msgid "Medium Bag"
50 msgstr "Çanta"
51
52 #: bags.lua
53 msgid "Large Bag"
54 msgstr "Büyük Çanta"
55
56 #: group.lua
57 msgid " and "
58 msgstr " ve "
59
60 #: internal.lua
61 msgid "First page"
62 msgstr "İlk Sayfa"
63
64 #: internal.lua
65 msgid "Back three pages"
66 msgstr "3 Sayfa Gerile"
67
68 #: internal.lua
69 msgid "Back one page"
70 msgstr "Geri"
71
72 #: internal.lua
73 msgid "Forward one page"
74 msgstr "İleri"
75
76 #: internal.lua
77 msgid "Forward three pages"
78 msgstr "3 Sayfa İlerile"
79
80 #: internal.lua
81 msgid "Last page"
82 msgstr "Son Sayfa"
83
84 #: internal.lua
85 msgid "Search"
86 msgstr "Ara"
87
88 #: internal.lua
89 msgid "Reset search and display everything"
90 msgstr ""
91
92 #: internal.lua
93 msgid "No matching items"
94 msgstr "Eşleşme yok"
95
96 #: internal.lua
97 msgid "No matches."
98 msgstr "Eşleşme yok"
99
100 #: internal.lua
101 msgid "Page"
102 msgstr "Sayfa"
103
104 #: internal.lua
105 #, lua-format
106 msgid "%s of %s"
107 msgstr "%s dan %s"
108
109 #: internal.lua
110 msgid "Filter"
111 msgstr "Süzgeç"
112
113 #: register.lua
114 msgid "Can use the creative inventory"
115 msgstr "Yaratıcı envanteri kullanabilir"
116
117 #: register.lua
118 msgid ""
119 "Forces Unified Inventory to be displayed in Full mode if Lite mode is "
120 "configured globally"
121 msgstr ""
122
123 #: register.lua
124 msgid "Crafting Grid"
125 msgstr "Üretim tablosu"
126
127 #: register.lua
128 msgid "Crafting Guide"
129 msgstr "Kılavuz"
130
131 #: register.lua
132 msgid "Set home position"
133 msgstr "Set ev pozisyon"
134
135 #: register.lua
136 #, lua-format
137 msgid "Home position set to: %s"
138 msgstr "Yeni eviniz: %s"
139
140 #: register.lua
141 msgid "You don't have the \"home\" privilege!"
142 msgstr "\"home\" yetkiniz yok!"
143
144 #: register.lua
145 msgid "Go home"
146 msgstr "Eve git"
147
148 #: register.lua
149 msgid "Set time to day"
150 msgstr "Güne zaman ayarla"
151
152 #: register.lua
153 msgid "Time of day set to 6am"
154 msgstr "Saat 06:00 olarak ayarlandı"
155
156 #: register.lua
157 msgid "You don't have the settime privilege!"
158 msgstr "\"settime\" yetkiniz yok!"
159
160 #: register.lua
161 msgid "Set time to night"
162 msgstr "Geceye zaman ayarla"
163
164 #: register.lua
165 msgid "Time of day set to 9pm"
166 msgstr "Saat 19:00 olarak ayarlandı"
167
168 #: register.lua
169 msgid "Clear inventory"
170 msgstr ""
171
172 #: register.lua
173 msgid ""
174 "This button has been disabled outside of creative mode to prevent accidental "
175 "inventory trashing.\n"
176 "Use the trash slot instead."
177 msgstr "Yaratıcı modu dışında iken bu tuş kullanılamaz."
178
179 #: register.lua
180 msgid "Inventory cleared!"
181 msgstr "Envanter temizlendi!"
182
183 #: register.lua
184 msgid "Trash:"
185 msgstr "Çöp"
186
187 #: register.lua
188 msgid "Refill:"
189 msgstr "Doldur"
190
191 #: register.lua
192 #, lua-format
193 msgid "Any item belonging to the %s group"
194 msgstr ""
195
196 #: register.lua
197 #, lua-format
198 msgid "Any item belonging to the groups %s"
199 msgstr ""
200
201 #: register.lua
202 #, lua-format
203 msgid "Recipe %d of %d"
204 msgstr "%d dan %d tarifi"
205
206 #: register.lua
207 #, lua-format
208 msgid "Usage %d of %d"
209 msgstr "Kullanım %d/%d"
210
211 #: register.lua
212 msgid "No recipes"
213 msgstr "Tarifi yok"
214
215 #: register.lua
216 msgid "No usages"
217 msgstr "Kullanım yok"
218
219 #: register.lua
220 msgid "Result"
221 msgstr "Çıktı"
222
223 #: register.lua
224 msgid "Ingredient"
225 msgstr "Bileşen"
226
227 #: register.lua
228 msgid "Show next recipe"
229 msgstr ""
230
231 #: register.lua
232 msgid "Show next usage"
233 msgstr ""
234
235 #: register.lua
236 msgid "Show previous recipe"
237 msgstr ""
238
239 #: register.lua
240 msgid "Show previous usage"
241 msgstr ""
242
243 #: register.lua
244 #, lua-format
245 msgid "%s (%s)"
246 msgstr ""
247
248 #: register.lua
249 msgid "Give me:"
250 msgstr "Ver bana:"
251
252 #: register.lua
253 msgid ""
254 "This recipe is too\n"
255 "large to be displayed."
256 msgstr ""
257
258 #: register.lua
259 #, fuzzy
260 msgid "To craft grid:"
261 msgstr "Üretim tablosuna kopyala"
262
263 #: register.lua
264 msgid "All"
265 msgstr "Tümü"
266
267 #: waypoints.lua
268 msgid "White"
269 msgstr "Beyaz"
270
271 #: waypoints.lua
272 msgid "Yellow"
273 msgstr "Sarı"
274
275 #: waypoints.lua
276 msgid "Red"
277 msgstr "Kırmızı"
278
279 #: waypoints.lua
280 msgid "Green"
281 msgstr "Yeşil"
282
283 #: waypoints.lua
284 msgid "Blue"
285 msgstr "Mavi"
286
287 #: waypoints.lua
288 msgid "Waypoints"
289 msgstr "Konum Noktaları"
290
291 #: waypoints.lua
292 #, lua-format
293 msgid "Select Waypoint #%d"
294 msgstr "#%d konum noktası seç"
295
296 #: waypoints.lua
297 #, lua-format
298 msgid "Waypoint %d"
299 msgstr "%d Konum Noktaları"
300
301 #: waypoints.lua
302 msgid "Set waypoint to current location"
303 msgstr "Bulunduğun noktayı işaretle"
304
305 #: waypoints.lua
306 msgid "invisible"
307 msgstr "görünmez"
308
309 #: waypoints.lua
310 msgid "visible"
311 msgstr "görünür"
312
313 #: waypoints.lua
314 msgid "Make waypoint @1"
315 msgstr "Yol noktası @1"
316
317 #: waypoints.lua
318 msgid "Disable"
319 msgstr ""
320
321 #: waypoints.lua
322 msgid "Enable"
323 msgstr ""
324
325 #: waypoints.lua
326 msgid "@1 display of waypoint coordinates"
327 msgstr "Yol noktası koordinatlarının görüntülenmesini @1"
328
329 #: waypoints.lua
330 msgid "Change color of waypoint display"
331 msgstr "Konum Gösterge Rengi"
332
333 #: waypoints.lua
334 msgid "Edit waypoint name"
335 msgstr "Konum Noktasını Düzenle"
336
337 #: waypoints.lua
338 msgid "Waypoint active"
339 msgstr "Konum Etkin"
340
341 #: waypoints.lua
342 msgid "Waypoint inactive"
343 msgstr "Konum Devredışı"
344
345 #: waypoints.lua
346 msgid "Finish editing"
347 msgstr "Düzenleme bitti"
348
349 #: waypoints.lua
350 msgid "World position"
351 msgstr "Dünya konumu"
352
353 #: waypoints.lua
354 msgid "Name"
355 msgstr "İsim"
356
357 #: waypoints.lua
358 msgid "HUD text color"
359 msgstr "Metin rengi"
0 # textdomain: unified_inventory
1 Crafting=Fertigung
2 Mixing=Mischen
3 Cooking=Kochen
4 Digging=Graben
5 Bags=Taschen
6 Bag @1=Tasche @1
7 Small Bag=Kleine Tasche
8 Medium Bag=Mittelgroße Tasche
9 Large Bag=Große Tasche
10 and = und
11 First page=Erste Seite
12 Back three pages=3 Seiten zurückblättern
13 Back one page=1 Seite zurückblättern
14 Forward one page=1 Seite vorblättern
15 Forward three pages=3 Seiten vorblättern
16 Last page=Letzte Seite
17 Search=Suchen
18 Reset search and display everything=Suche zurücksetzen und alles anzeigen
19 No matching items=Keine passenden Gegenstände
20 No matches.=Keine Treffer
21 Page=Seite
22 @1 of @2=@1 von @2
23 Filter=Filter
24 Can use the creative inventory=Kann das Kreativinventar nutzen
25 Crafting Grid=Fertigungsraster
26 Crafting Guide=Fertigungsführer
27 Set home position=Heimatposition setzen
28 Home position set to: @1=Heimatposition nach @1 gesetzt
29 You don't have the "home" privilege!=Du hast das „home“-Privileg nicht!
30 Go home=Nach Hause gehen
31 Set time to day=Zur Tageszeit wechseln
32 Time of day set to 6am=Tageszeit auf 6 Uhr gesetzt
33 You don't have the settime privilege!=Du hast das „settime“-Privileg nicht!
34 Set time to night=Zur Nachtzeit wechseln
35 Time of day set to 9pm=Tageszeit auf 21 Uhr gesetzt
36 Clear inventory=Inventar leeren
37 Inventory cleared!=Inventar geleert!
38 Trash:=Müll:
39 Refill:=Nachfüllen:
40 Any item belonging to the @1 group=Irgendein Gegenstand, der zur Gruppe @1 gehört
41 Any item belonging to the groups @1=Irgendein Gegenstand, der zu den Gruppen @1 gehört
42 Recipe @1 of @2=Rezept @1 von @2
43 Usage @1 of @2=Verwendung @1 von @2
44 No recipes=Keine Rezepte
45 No usages=Keine Verwendungen
46 Result=Ergebnis
47 Ingredient=Zutat
48 Show next recipe=Nächstes Rezept zeigen
49 Show next usage=Nächste Verwendung zeigen
50 Show previous recipe=Vorheriges Rezept zeigen
51 Show previous usage=Vorherige Verwendung zeigen
52 Give me:=Gib mir:
53 To craft grid:=Ins Fertigungsraster:
54 All=Alles
55 White=Weiß
56 Yellow=Gelb
57 Red=Rot
58 Green=Grün
59 Blue=Blau
60 Waypoints=Wegpunkte
61 Select Waypoint #@1=Wegpunkt Nr. @1 auswählen
62 Waypoint @1=Wegpunkt Nr. @1
63 Set waypoint to current location=Setze Wegpunkt zur derzeitigen Position
64 invisible=unsichtbar
65 visible=sichtbar
66 Make waypoint @1=Wegpunkt @1 machen
67 Disable=ausschalten
68 Enable=einschalten
69 @1 display of waypoint coordinates=Anzeige der Wegpunktkoordinaten @1
70 Change color of waypoint display=Farbe der Darstellung der Wegpunkte ändern
71 Edit waypoint name=Name des Wegpunkts ändern
72 Waypoint active=Wegpunkt aktiv
73 Waypoint inactive=Wegpunkt inaktiv
74 Finish editing=Bearbeitung abschließen
75 World position=Weltposition
76 Name=Name
77 HUD text color=HUD-Textfarbe
78 Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally=Zwingt Unified Inventory, im Vollmodus angezeigt zu werden, wenn der Minimalmodus global eingestellt ist
0 # textdomain: unified_inventory
1
2 # waypoints.lua
3
4 White=Blanco
5 Yellow=Amarillo
6 Red=Rojo
7 Green=Verde
8 Blue=Azul
9 Waypoints=Puntos
10 Select Waypoint #@1=Seleccionar Punto #@1
11 Waypoint @1=Punto @1
12 Set waypoint to current location=Establecer el punto a la ubicación actual
13 Make waypoint @1=Hacer punto @1
14 invisible=invisible
15 visible=visible
16 @1 display of waypoint coordinates=Visualizar coordenadas del punto @1
17 Disable=Deshabilitado
18 Enable=Habilitado
19 Change color of waypoint display=Cambiar el color del punto
20 Edit waypoint name=Editar nombre del punto
21 Waypoint active=Punto activo
22 Waypoint inactive=Punto inactivo
23 Finish editing=Terminar edición
24 World position=Posición en el mundo
25 Name=Nombre
26 HUD text color=Color del texto de la Interfaz
27
28 # group.lua
29
30 and = y
31
32 # register.lua
33
34 Can use the creative inventory=Puede usar el inventario creativo
35 Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally=Obliga al Inventario Unificado a mostrarse en modo Completo si el modo Simple está configurado globalmente
36 Crafting Grid=Cuadricula de Elaboración
37 Crafting Guide=Guía de Elaboración
38 Set home position=Establecer posición de la casa
39 Home position set to: @1=Posición de la casa cambiada a: @1
40 You don't have the \"home\" privilege!=¡No tienes el privilegio \"home\"!
41 Go home=Ir a casa
42 Set time to day=Cambiar a dia
43 Set time to night=Cambiar a noche
44 Time of day set to 6am=Hora del día cambiada a 6 AM
45 Time of day set to 9pm=Hora del día cambiada a 9 PM
46 You don't have the settime privilege!=¡No tienes el privilegio "settime"!
47 Clear inventory=Limpiar inventario
48 Inventory cleared!=¡Inventario limpio!
49 This button has been disabled outside=Este botón ha sido deshabilitado
50 Crafting=Elaboración
51 Trash:=Basura:
52 Refill:=Rellenar:
53 Any item belonging to the @1 group=Cualquier elemento que pertenezca al grupo @1
54 Any item belonging to the groups @1=Cualquier elemento perteneciente a los grupos @1
55 Recipe @1 of @2=Receta @1 de @2
56 Usage @1 of @2=Uso @1 de @2
57 No recipes=No tiene receta
58 No usages=No tiene uso
59 Result=Resultado
60 Ingredient=Ingrediente
61 Show next recipe=Mostrar la siguiente receta
62 Show next usage=Mostrar el siguiente uso
63 Show previous recipe=Mostrar la receta anterior
64 Show previous usage=Mostrar el uso anterior
65 @1 (@2)=@1 (@2)
66 Give me:=Dame:
67 This recipe is too@nlarge to be displayed.=Esta receta es demasiado@ngrande para ser mostrada.
68 To craft grid:=Construir:
69 All=Todos
70
71 # api.lua
72
73 Mixing=Mezclar
74 Cooking=Hornear
75 Digging=Recoger
76
77 # internal.lua
78
79 First page=Primera página
80 Back three pages=Volver tres páginas
81 Back one page=Volver una página
82 Forward one page=Avanzar una página
83 Forward three pages=Avanzar tres páginas
84 Last page=Ultima Pagina
85 Search=Buscar
86 Reset search and display everything=Limpiar la busqueda y mostrar todo
87 No matching items=No se encontraron elementos
88 No matches.=No hay resultados.
89 Page=Página
90 @1 of @2=@1 de @2
91 Filter=Filtro
92
93 # bags.lua
94
95 Bags=Bolsos
96 Bag @1=Bolso @1
97 Small Bag=Bolso Pequeño
98 Medium Bag=Bolso Mediano
99 Large Bag=Bolso Grande
0 # textdomain: unified_inventory
1 Crafting=Création
2 Cooking=Cuisson
3 Digging=Creuser
4 Bags=Sacs
5 Bag @1=Sac @1
6 Small Bag=Petit sac
7 Medium Bag=Sac moyen
8 Large Bag=Grand sac
9 and = et
10 First page=1ère page
11 Back three pages=3 pages en arrière
12 Back one page=Page précédente
13 Forward one page=Page suivante
14 Forward three pages=3 pages en avant
15 Last page=Dernière page
16 Search=Rechercher
17 No matching items=Aucun élément correspondant
18 No matches.=Aucun match
19 Page=Page
20 @1 of @2=@1 de @2
21 Filter=Filtre
22 Can use the creative inventory=Vous pouvez utiliser l'inventaire créatif
23 Crafting Grid=Grille de création
24 Crafting Guide=Guide de création
25 Set home position=Position dans le monde
26 Home position set to: @1=Position de votre base fixée à: @1
27 You don't have the "home" privilege!=Vous n'avez pas le privilège "home"!
28 Time of day set to 6am=Heure fixée à 6h
29 You don't have the settime privilege!=Vous n'avez pas le privilège "settime"!
30 Time of day set to 9pm=Heure fixée à 21h
31 Inventory cleared!=Inventaire vidé !
32 Trash:=Poubelle :
33 Refill:=Remplir :
34 Recipe @1 of @2=Recette @1 de @2
35 Result=Résultat
36 To craft grid:=Sur de création:
37 All=Tout
38 White=Blanc
39 Yellow=Jaune
40 Red=Rouge
41 Green=Vert
42 Blue=Bleu
43 Waypoints=Point de passage
44 Select Waypoint #@1=Choisir un point de passage #@1
45 Waypoint @1=Point de passage @1
46 Set waypoint to current location=Marquer un point de passage à la position actuelle
47 Make waypoint @1=Rendre @1 le point de passage
48 @1 display of waypoint coordinates=@1 montrer les coordonnées des points de passages
49 Change color of waypoint display=Changer la couleur du point de passage
50 Edit waypoint name=Editer le nom du point de passage
51 Waypoint active=Point de passage actif
52 Waypoint inactive=Point de passage inactif
53 Finish editing=Terminer l'édition
54 World position=Position dans le monde
55 Name=Nom
56 HUD text color=Couleur de texte du HUD
0 # textdomain: unified_inventory
1 Crafting=Assemblaggio
2 Mixing=Unione
3 Cooking=Cottura
4 Digging=Scavo
5 Bags=Borse
6 Bag @1=Borsa @1
7 Small Bag=Borsa piccola
8 Medium Bag=Borsa media
9 Large Bag=Borsa grande
10 and = e
11 First page=Prima pagina
12 Back three pages=Indietro di tre pagine
13 Back one page=Indietro di una pagina
14 Forward one page=Avanti di una pagina
15 Forward three pages=Avanti di tre pagine
16 Last page=Ultima pagina
17 Search=Cerca
18 Reset search and display everything=Azzera la ricerca e mostra tutto
19 No matching items=Nessun oggetto corrispondente
20 No matches.=Nessuna corrispondenza.
21 Page=Pagina
22 @1 of @2=@1 di @2
23 Filter=Filtro
24 Can use the creative inventory=Può usare l'inventario creativo
25 Crafting Grid=Griglia di assemblaggio
26 Crafting Guide=Guida di assemblaggio
27 Set home position=Imposta la residenza
28 Home position set to: @1=Residenza impostata su: @1
29 You don't have the "home" privilege!=Non hai il privilegio "home"!
30 Go home=Torna a casa
31 Set time to day=Imposta l'orario sul giorno
32 Time of day set to 6am=Orario impostato sulle 6am
33 You don't have the settime privilege!=Non hai il privilegio "time"!
34 Set time to night=Imposta l'orario sulla notte
35 Time of day set to 9pm=Orario impostato sulle 9am
36 Clear inventory=Ripulisci l'inventario
37 Inventory cleared!=Inventario ripulito!
38 Trash:=Butta:
39 Refill:=Riempi:
40 Any item belonging to the @1 group=Qualunque oggetto appartenente al gruppo @1
41 Any item belonging to the groups @1=Qualunque oggetto appartenente ai gruppi @1
42 Recipe @1 of @2=Ricetta @1 di @2
43 Usage @1 of @2=Uso @1 di @2
44 No recipes=Nessuna ricetta
45 No usages=Nessun utilizzo
46 Result=Risultato
47 Ingredient=Ingrediente
48 Show next recipe=Mostra la prossima ricetta
49 Show next usage=Mostra il prossimo utilizzo
50 Show previous recipe=Mostra la ricetta precedente
51 Show previous usage=Mostra l'utilizzo precedente
52 Give me:=Dammi:
53 To craft grid:=Alla griglia di assemblaggio:
54 All=Tutto
55 White=Bianco
56 Yellow=Giallo
57 Red=Rosso
58 Green=Verde
59 Blue=Blu
60 Waypoints=Tappe
61 Select Waypoint #@1=Seleziona tappa n°@1
62 Waypoint @1=Tappa @1
63 Set waypoint to current location=Imposta tappa alla posizione attuale
64 invisible=invisibile
65 visible=visibile
66 Make waypoint @1=Crea tappa @1
67 Disable=Disabilita
68 Enable=Abilita
69 @1 display of waypoint coordinates=@1 la visualizzazione delle coordinate della tappa
70 Change color of waypoint display=Modifica il colore della visualizzazione della tappa
71 Edit waypoint name=Modifica il nome della tappa
72 Waypoint active=Tappa attiva
73 Waypoint inactive=Tappa inattiva
74 Finish editing=Termina la modifica
75 World position=Posizione del mondo
76 Name=Nome
77 HUD text color=Colore del testo del visore
78 Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally=Forza la visualizzazione di Unified Inventory in modalità completa se è configurata globalmente la visualizzazione semplice
0 # textdomain: unified_inventory
1 Crafting=Pertukangan
2 Mixing=Pencampuran
3 Cooking=Pemasakan
4 Digging=Penggalian
5 Bags=Beg
6 Bag @1=Beg @1
7 Small Bag=Beg Kecil
8 Medium Bag=Beg Sederhana
9 Large Bag=Beg Besar
10 and = dan
11 First page=Halaman pertama
12 Back three pages=Tiga halaman sebelumnya
13 Back one page=Halaman sebelumnya
14 Forward one page=Halaman seterusnya
15 Forward three pages=Tiga halaman seterusnya
16 Last page=Halaman terakhir
17 Search=Cari
18 Reset search and display everything=Set semula carian dan tunjukkan semua benda
19 No matching items=Tiada item sepadan
20 No matches.=Tiada padanan.
21 Page=Halaman
22 @1 of @2=@1 drpd @2
23 Filter=Tapis
24 Can use the creative inventory=Boleh guna inventori kreatif
25 Crafting Grid=Grid Pertukangan
26 Crafting Guide=Panduan Pertukangan
27 Set home position=Tetapkan kedudukan rumah
28 Home position set to: @1=Kedudukan rumah ditetapkan ke: @1
29 You don't have the "home" privilege!=Anda tidak ada keistimewaan "home"!
30 Go home=Balik rumah
31 Set time to day=Tetapkan masa jadi siang
32 Time of day set to 6am=Masa ditetapkan ke 6 pagi
33 You don't have the settime privilege!=Anda tidak ada keistimewaan settime!
34 Set time to night=Tetapkan masa jadi malam
35 Time of day set to 9pm=Masa ditetapkan ke 9 malam
36 Clear inventory=Kosongkan inventori
37 Inventory cleared!=Inventori dikosongkan!
38 Trash:=Buang:
39 Refill:=Isi balik:
40 Any item belonging to the @1 group=Sebarang item dari kumpulan @1
41 Any item belonging to the groups @1=Sebarang item dari kumpulan @1
42 Recipe @1 of @2=Resipi @1 drpd @2
43 Usage @1 of @2=Kegunaan @1 drpd @2
44 No recipes=Tiada resipi
45 No usages=Tiada kegunaan
46 Result=Hasil
47 Ingredient=Bahan
48 Show next recipe=Tunjuk resipi seterusnya
49 Show next usage=Tunjuk kegunaan seterusnya
50 Show previous recipe=Tunjuk resipi sebelumnya
51 Show previous usage=Tunjuk kegunaan sebelumnya
52 @1 (@2)=@1 (@2)
53 Give me:=Beri saya:
54 To craft grid:=Ke grid pertukangan:
55 White=Putih
56 Yellow=Kuning
57 Red=Merah
58 Green=Hijau
59 Blue=Biru
60 Waypoints=Titik Arah
61 Select Waypoint #@1=Pilih Titik Arah #@1
62 Waypoint @1=Titik Arah @1
63 Set waypoint to current location=Tetapkan titik arah ke lokasi semasa
64 invisible=Sembunyikan
65 visible=Paparkan
66 Make waypoint @1=@1 titik arah
67 Disable=Sembunyikan
68 Enable=Paparkan
69 @1 display of waypoint coordinates=@1 koordinat untuk titik arah
70 Change color of waypoint display=Tukar warna paparan titik arah
71 Edit waypoint name=Edit nama titik arah
72 Waypoint active=Titik arah aktif
73 Waypoint inactive=Titik arah tidak aktif
74 Finish editing=Selesai edit
75 World position=Kedudukan dunia
76 Name=Nama
77 HUD text color=Warna tulisan HUD
0 # textdomain: unified_inventory
1 Bags=Plecaki
2 Bag @1=Plecak @1
3 Small Bag=Maly plecak
4 Medium Bag=Sredni plecak
5 Large Bag=Duzy plecak
6 and = i
7 First page=Pierwsza strona
8 Back three pages=3 strony w tyl
9 Back one page=1 strona w tyl
10 Forward one page=1 strona do przodu
11 Forward three pages=3 strony do przodu
12 Last page=Ostatnia strona
13 Search=Szukaj
14 No matching items=Brak pasujacych przedmiotow
15 No matches.=Brak wyników
16 Page=Strona
17 @1 of @2=@1 z @2
18 Filter=Filtr
19 Set home position=Ustaw pozycję wyjściową
20 Home position set to: @1=Pozycja domowa ustawiona na: @1
21 You don't have the "home" privilege!=Nie masz uprawnien do zmiany czasu "home"!
22 Go home=Idź do domu
23 Set time to day=Ustaw czas na dzień
24 Time of day set to 6am=Czas ustawiony na 6:00
25 You don't have the settime privilege!=Nie masz uprawnien do zmiany czasu "settime"!
26 Set time to night=Ustaw czas na noc
27 Time of day set to 9pm=Czas ustawiony na 21:00
28 Clear inventory=Wyczyść zapasy
29 Inventory cleared!=Zapasy zostały wyczyszczone!
30 Trash:=Smietnik:
31 Refill:=Uzupelnianie:
32 Recipe @1 of @2=Recepta @1 z @2
33 Usage @1 of @2=Użycie @1 z @2
34 No recipes=Brak recepty
35 No usages=Bez użycia
36 Result=Wynik
37 Ingredient=Składnik
38 Give me:=Daj mi:
39 All=Wszystko
40 White=Bialy
41 Yellow=Zolty
42 Red=Czerwony
43 Green=Zielony
44 Blue=Niebieski
45 Waypoints=Punkty orientacyjne
46 Select Waypoint #@1=Wybierz punkt #@1
47 Waypoint @1=Punkty orientacyjne @1
48 Set waypoint to current location=Ustaw punkt orientacyjny na biezacej pozycji
49 invisible=niewidzialny
50 visible=widomy
51 Make waypoint @1=Robić punkt @1
52 @1 display of waypoint coordinates=@1 koordynatow punktu
53 Change color of waypoint display=Zmien kolor punktu
54 Edit waypoint name=Edytuj nazwe punktu
55 Waypoint active=Punkt wlaczony
56 Waypoint inactive=Punkt wylaczony
57 Finish editing=Zakoncz edycje
58 World position=Pozycja
59 Name=Nazwa
60 HUD text color=Kolor tekstu HUD
0 # textdomain: unified_inventory
1 Crafting=Artesanato
2 Mixing=Muistura
3 Cooking=Cozimento
4 Digging=Escavação
5 Bags=Bolsas
6 Bag @1=Bolsa @1
7 Small Bag=Bolsa Pequena
8 Medium Bag=Bolsa Média
9 Large Bag=Bolsa Grande
10 and = e
11 First page=Primeira Página
12 Back three pages=Voltar 3 Páginas
13 Back one page=Voltar 1 Página
14 Forward one page=Avançar 1 Página
15 Forward three pages=Avançar 3 Páginas
16 Last page=Ultima Página
17 Search=Pesquisar
18 Reset search and display everything=Redefinir pesquisa e exibir tudo
19 No matching items=Nenhum item correspondente
20 No matches.=Sem correspondências
21 Page=Página
22 @1 of @2=@1 de @2
23 Filter=Filtro
24 Can use the creative inventory=Pode usar o inventário do criativo
25 Crafting Grid=Grade de Artesanato
26 Crafting Guide=Guia de Artesanato
27 Set home position=Definir posição de casa
28 Home position set to: @1=Posição inicial definida para: @1
29 You don't have the "home" privilege!=Você não tem o privilégio de "home"!
30 Go home=Transportar para Casa
31 Set time to day=Definir turno para dia
32 Time of day set to 6am=Hora do dia definida para 06h
33 You don't have the settime privilege!=Você não tem o privilégio de "settime"!
34 Set time to night=Definir turno para noite
35 Time of day set to 9pm=Hora do dia ajustada para 21h
36 Clear inventory=Limpar Inventário
37 Inventory cleared!=Inventário Apagado!
38 Trash:=Lixo:
39 Refill:=Recarga:
40 Any item belonging to the @1 group=Qualquer item pertencente ao grupo '@1'.
41 Any item belonging to the groups @1=Qualquer item pertencente aos grupos '@1'.
42 Recipe @1 of @2=Receita @1 de @2
43 Usage @1 of @2=Utilização @1 de @2
44 No recipes=Sem Receita
45 No usages=Sem Utilização
46 Result=Resultado
47 Ingredient=Ingrediente
48 Show next recipe=Exibir Próxima Receita
49 Show next usage=Mostrar Próxima Utilização
50 Show previous recipe=Exibir Receita Anterior
51 Show previous usage=Exibir Utilização Anterior
52 Give me:=Gerado:
53 To craft grid:=Para Grade de Artesanato
54 All=MAX
55 White=Branco
56 Yellow=Amarelo
57 Red=Vermelho
58 Green=Verde
59 Blue=Azul
60 Waypoints=Apontador de Direção
61 Select Waypoint #@1=Seleção de Apontador de Direção #@1
62 Waypoint @1=Apontador de Direção @1
63 Set waypoint to current location=Configurar localização atual do Apontador de Direção
64 invisible=invisível
65 visible=visível
66 Make waypoint @1=Fazer Apontador de Direção @1
67 @1 display of waypoint coordinates=@1 exibição de coordenadas de Fazer Apontador de Direção
68 Change color of waypoint display=Mudar cor exibida do Apontador de Direção
69 Edit waypoint name=Editar Nome de Apontador de Direção
70 Waypoint active=Apontador de Direção Ativo
71 Waypoint inactive=Apontador de Direção Inativo
72 Finish editing=Edição Finalizada
73 World position=Posição Mundial
74 Name=Nome
75 HUD text color=Cor de HUD
0 # textdomain: unified_inventory
1 Crafting=Крафт
2 Mixing=Мешать
3 Cooking=Варить
4 Digging=Копать
5 Bags=Сумки
6 Bag @1=Сумка @1
7 Small Bag=Малая сумка
8 Medium Bag=Средняя сумка
9 Large Bag=Большая сумка
10 and = и
11 First page=Первая страница
12 Back three pages=3 страницы назад
13 Back one page=1 страницу назад
14 Forward one page=1 страницу вперёд
15 Forward three pages=3 страницы вперёд
16 Last page=Последняя страница
17 Search=Поиск
18 Reset search and display everything=Сброс поиска, показать всё
19 No matching items=Нет подходящих элементов
20 No matches.=Ничего не найдено
21 Page=Страница
22 @1 of @2=@1 из @2
23 Filter=Фильтр
24 Can use the creative inventory=Можно использовать инвентарь творческого режима
25 Crafting Grid=Решетка крафта
26 Crafting Guide=Книга рецептов
27 Set home position=Установить позицию дома
28 Home position set to: @1=Дом теперь расположен по коодинатам: @1
29 You don't have the "home" privilege!=У вас нет привилегии "home"!
30 Go home=Отправиться домой
31 Set time to day=День
32 Time of day set to 6am=Установлено время 6 утра
33 You don't have the settime privilege!=Вам не разрешено устанавливать время! (нет привилегии "settime")
34 Set time to night=Ночь
35 Time of day set to 9pm=Установлено время 9 вечера
36 Clear inventory=Очистить инвентарь
37 Inventory cleared!=Инвентарь очищен!
38 Trash:=Мусор:
39 Refill:=Наполнить:
40 Any item belonging to the @1 group=Любой элемент из группы: @1
41 Any item belonging to the groups @1=Любой элемент из группы: @1
42 Recipe @1 of @2=Рецепт @1 из @2
43 Usage @1 of @2=Вариант @1 of @2
44 No recipes=Рецептов нет
45 No usages=Не используется
46 Result=Результат
47 Ingredient=Состав
48 Show next recipe=Следующий рецепт
49 Show next usage=Следующее использование
50 Show previous recipe=Прошлый рецепт
51 Show previous usage=Прошлая страница
52 Give me:=Дай мне:
53 To craft grid:=На решeтку крафта:
54 All=Все
55 White=Белый
56 Yellow=Желтый
57 Red=Красный
58 Green=Зелёный
59 Blue=Синий
60 Waypoints=Путевые точки
61 Select Waypoint #@1=Выбрать путевую точку №@1
62 Waypoint @1=Путевая точка @1
63 Set waypoint to current location=Установить путевую точку по текущей позиции
64 invisible=невидимой
65 visible=видимой
66 Make waypoint @1=Сделать путевую точку @1
67 Disable=Выключить
68 Enable=Включить
69 @1 display of waypoint coordinates=@1 показ координат путевых точек
70 Change color of waypoint display=Поменять цвет путевой точки
71 Edit waypoint name=Переименовать путевую точку
72 Waypoint active=Путевая точка включена
73 Waypoint inactive=Путевая точка выключена
74 Finish editing=Закончить редакцию
75 World position=Позиция мира
76 Name=Имя
77 HUD text color=Цвет текста HUDа
0 # textdomain: unified_inventory
1
2 # waypoints.lua
3
4 White=
5 Yellow=
6 Red=
7 Green=
8 Blue=
9 Waypoints=
10 Select Waypoint #@1=
11 Waypoint @1=
12 Set waypoint to current location=
13 Make waypoint @1=
14 invisible=
15 visible=
16 @1 display of waypoint coordinates=
17 Disable=
18 Enable=
19 Change color of waypoint display=
20 Edit waypoint name=
21 Waypoint active=
22 Waypoint inactive=
23 Finish editing=
24 World position=
25 Name=
26 HUD text color=
27
28 # group.lua
29
30 and =
31
32 # register.lua
33
34 Can use the creative inventory=
35 Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally=
36 Crafting Grid=
37 Crafting Guide=
38 Set home position=
39 Home position set to: @1=
40 You don't have the \"home\" privilege!=
41 Go home=
42 Set time to day=
43 Set time to night=
44 Time of day set to 6am=
45 Time of day set to 9pm=
46 You don't have the settime privilege!=
47 Clear inventory=
48 Inventory cleared!=
49 This button has been disabled outside=
50 Crafting=
51 Trash:=
52 Refill:=
53 Any item belonging to the @1 group=
54 Any item belonging to the groups @1=
55 Recipe @1 of @2=
56 Usage @1 of @2=
57 No recipes=
58 No usages=
59 Result=
60 Ingredient=
61 Show next recipe=
62 Show next usage=
63 Show previous recipe=
64 Show previous usage=
65 @1 (@2)=
66 Give me:=
67 This recipe is too@nlarge to be displayed.=
68 To craft grid:=
69 All=
70
71 # api.lua
72
73 Mixing=
74 Cooking=
75 Digging=
76
77 # internal.lua
78
79 First page=
80 Back three pages=
81 Back one page=
82 Forward one page=
83 Forward three pages=
84 Last page=
85 Search=
86 Reset search and display everything=
87 No matching items=
88 No matches.=
89 Page=
90 @1 of @2=
91 Filter=
92
93 # bags.lua
94
95 Bags=
96 Bag @1=
97 Small Bag=
98 Medium Bag=
99 Large Bag=
0 # textdomain: unified_inventory
1 Crafting=Üretim
2 Mixing=Karıştırma
3 Cooking=Pişirme
4 Digging=Kazma
5 Bags=Çantalarım
6 Bag @1=@1. Çanta
7 Small Bag=Küçük Çanta
8 Medium Bag=Çanta
9 Large Bag=Büyük Çanta
10 and = ve
11 First page=İlk Sayfa
12 Back three pages=3 Sayfa Gerile
13 Back one page=Geri
14 Forward one page=İleri
15 Forward three pages=3 Sayfa İlerile
16 Last page=Son Sayfa
17 Search=Ara
18 No matching items=Eşleşme yok
19 No matches.=Eşleşme yok
20 Page=Sayfa
21 @1 of @2=@1 dan @2
22 Filter=Süzgeç
23 Can use the creative inventory=Yaratıcı envanteri kullanabilir
24 Crafting Grid=Üretim tablosu
25 Crafting Guide=Kılavuz
26 Set home position=Set ev pozisyon
27 Home position set to: @1=Yeni eviniz: @1
28 You don't have the "home" privilege!="home" yetkiniz yok!
29 Go home=Eve git
30 Set time to day=Güne zaman ayarla
31 Time of day set to 6am=Saat 06:00 olarak ayarlandı
32 You don't have the settime privilege!="settime" yetkiniz yok!
33 Set time to night=Geceye zaman ayarla
34 Time of day set to 9pm=Saat 19:00 olarak ayarlandı
35 msgid ""=Yaratıcı modu dışında iken bu tuş kullanılamaz.
36 Inventory cleared!=Envanter temizlendi!
37 Trash:=Çöp
38 Refill:=Doldur
39 Recipe @1 of @2=@1 dan @2 tarifi
40 Usage @1 of @2=Kullanım @1/@2
41 No recipes=Tarifi yok
42 No usages=Kullanım yok
43 Result=Çıktı
44 Ingredient=Bileşen
45 Give me:=Ver bana:
46 To craft grid:=Üretim tablosuna kopyala
47 All=Tümü
48 White=Beyaz
49 Yellow=Sarı
50 Red=Kırmızı
51 Green=Yeşil
52 Blue=Mavi
53 Waypoints=Konum Noktaları
54 Select Waypoint #@1=#@1 konum noktası seç
55 Waypoint @1=@1 Konum Noktaları
56 Set waypoint to current location=Bulunduğun noktayı işaretle
57 invisible=görünmez
58 visible=görünür
59 Make waypoint @1=Yol noktası @1
60 @1 display of waypoint coordinates=Yol noktası koordinatlarının görüntülenmesini @1
61 Change color of waypoint display=Konum Gösterge Rengi
62 Edit waypoint name=Konum Noktasını Düzenle
63 Waypoint active=Konum Etkin
64 Waypoint inactive=Konum Devredışı
65 Finish editing=Düzenleme bitti
66 World position=Dünya konumu
67 Name=İsim
68 HUD text color=Metin rengi
0 # textdomain: unified_inventory
1 # traslation by: IFRFSX(BingFengFSX)
2 #Email: IFRFSX@Protonmail.com
3
4 Crafting=合成
5 Mixing=混合
6 Cooking=烹饪
7 Digging=挖出
8 Bags=背包
9 Bag @1=背包@1
10 Small Bag=小背包
11 Medium Bag=中背包
12 Large Bag=大背包
13 and = 和
14 First page=第一页
15 Back three pages=后退三页
16 Back one page=后退一页
17 Forward one page=前进一页
18 Forward three pages=前进三页
19 Last page=最后一页
20 Search=搜索
21 No matching items=没有匹配物品
22 No matches.=没有匹配
23 Page=页面
24 @1 of @2=第@1页,共@2页
25 Filter=过滤器
26 Can use the creative inventory=可以使用创造背包
27 Crafting Grid=合成表
28 Crafting Guide=合成指南
29 Set home position=设置家的位置
30 Home position set to: @1=家的位置设置到: @1
31 You don't have the "home" privilege!=你没有“home”权限!
32 Go home=回家
33 Set time to day=设置时间到白天
34 Time of day set to 6am=时间设置到早晨6点
35 You don't have the settime privilege!=你没有“settime”权限!
36 Set time to night=设置时间到晚上
37 Time of day set to 9pm=时间设置到晚上9点
38
39 Inventory cleared!=清空背包
40 Clear inventory=清空背包
41
42 Trash:=丢弃:
43 Refill:=填满:
44 Recipe @1 of @2=第@1配方,共@2个
45 Usage @1 of @2=第@1用法,共@2个
46 No recipes=没有配方
47 No usages=没有用法
48 Result=结果
49 Ingredient=原料
50 Give me:=给予:
51 To craft grid:=填充物品到合成表
52 All=全部
53 White=白
54 Yellow=黄
55 Red=红
56 Green=绿
57 Blue=蓝
58 Waypoints=航路点
59 Select Waypoint #@1=查询航路点 #@1
60 Waypoint @1=航路点 @1
61 Set waypoint to current location=将航路点设置到当前位置
62 invisible=不可见的
63 visible=可见的
64 Make waypoint @1=设置航路点 @1
65 @1 display of waypoint coordinates=显示航路点@1坐标
66 Change color of waypoint display=改变航路点显示的颜色
67 Edit waypoint name=编辑航路点名称
68 Waypoint active=航路点已激活
69 Waypoint inactive=航路点未激活
70 Finish editing=完成编辑
71 World position=世界位置
72 Name=名称
73 HUD text color=HUD文本颜色
74
75 Reset search and display everything=重置搜索并显示所有物品
76
77 Any item belonging to the @1 group=属于@1组的任何项目
78 Any item belonging to the groups @1=属于组@1的任何项目
0 # textdomain: unified_inventory
1 # traslation by: IFRFSX(BingFengFSX)
2 #Email: IFRFSX@Protonmail.com
3
4 Crafting=合成
5 Mixing=混合
6 Cooking=烹飪
7 Digging=挖出
8 Bags=揹包
9 Bag @1=揹包@1
10 Small Bag=小揹包
11 Medium Bag=中揹包
12 Large Bag=大揹包
13 and = 和
14 First page=第一頁
15 Back three pages=後退三頁
16 Back one page=後退一頁
17 Forward one page=前進一頁
18 Forward three pages=前進三頁
19 Last page=最後一頁
20 Search=搜索
21 No matching items=沒有匹配物品
22 No matches.=沒有匹配
23 Page=頁面
24 @1 of @2=第@1頁,共@2頁
25 Filter=過濾器
26 Can use the creative inventory=可以使用創造揹包
27 Crafting Grid=合成表
28 Crafting Guide=合成指南
29 Set home position=設置家的位置
30 Home position set to: @1=家的位置設置到: @1
31 You don't have the "home" privilege!=你沒有“home”權限!
32 Go home=回家
33 Set time to day=設置時間到白天
34 Time of day set to 6am=時間設置到早晨6點
35 You don't have the settime privilege!=你沒有“settime”權限!
36 Set time to night=設置時間到晚上
37 Time of day set to 9pm=時間設置到晚上9點
38
39 Inventory cleared!=清空揹包
40 Clear inventory=清空揹包
41
42 Trash:=丟棄:
43 Refill:=填滿:
44 Recipe @1 of @2=第@1配方,共@2個
45 Usage @1 of @2=第@1用法,共@2個
46 No recipes=沒有配方
47 No usages=沒有用法
48 Result=結果
49 Ingredient=原料
50 Give me:=給予:
51 To craft grid:=填充物品到合成表
52 All=全部
53 White=白
54 Yellow=黃
55 Red=紅
56 Green=綠
57 Blue=藍
58 Waypoints=航路點
59 Select Waypoint #@1=查詢航路點 #@1
60 Waypoint @1=航路點 @1
61 Set waypoint to current location=將航路點設置到當前位置
62 invisible=不可見的
63 visible=可見的
64 Make waypoint @1=設置航路點 @1
65 @1 display of waypoint coordinates=顯示航路點@1座標
66 Change color of waypoint display=改變航路點顯示的顏色
67 Edit waypoint name=編輯航路點名稱
68 Waypoint active=航路點已激活
69 Waypoint inactive=航路點未激活
70 Finish editing=完成編輯
71 World position=世界位置
72 Name=名稱
73 HUD text color=HUD文本顏色
74
75 Reset search and display everything=重置搜索並顯示所有物品
76
77 Any item belonging to the @1 group=屬於@1組的任何項目
78 Any item belonging to the groups @1=屬於組@1的任何項目
0 -- match_craft.lua
1 -- Find and automatically move inventory items to the crafting grid
2 -- according to the recipe.
3
4 --[[
5 Retrieve items from inventory lists and calculate their total count.
6 Return a table of "item name" - "total count" pairs.
7
8 Arguments:
9 inv: minetest inventory reference
10 lists: names of inventory lists to use
11
12 Example usage:
13 -- Count items in "main" and "craft" lists of player inventory
14 unified_inventory.count_items(player_inv_ref, {"main", "craft"})
15
16 Example output:
17 {
18 ["default:pine_wood"] = 2,
19 ["default:acacia_wood"] = 4,
20 ["default:chest"] = 3,
21 ["default:axe_diamond"] = 2, -- unstackable item are counted too
22 ["wool:white"] = 6
23 }
24 ]]--
25 function unified_inventory.count_items(inv, lists)
26 local counts = {}
27
28 for i = 1, #lists do
29 local name = lists[i]
30 local size = inv:get_size(name)
31 local list = inv:get_list(name)
32
33 for j = 1, size do
34 local stack = list[j]
35
36 if not stack:is_empty() then
37 local item = stack:get_name()
38 local count = stack:get_count()
39
40 counts[item] = (counts[item] or 0) + count
41 end
42 end
43 end
44
45 return counts
46 end
47
48 --[[
49 Retrieve craft recipe items and their positions in the crafting grid.
50 Return a table of "craft item name" - "set of positions" pairs.
51
52 Note that if craft width is not 3 then positions are recalculated as
53 if items were placed on a 3x3 grid. Also note that craft can contain
54 groups of items with "group:" prefix.
55
56 Arguments:
57 craft: minetest craft recipe
58
59 Example output:
60 -- Bed recipe
61 {
62 ["wool:white"] = {[1] = true, [2] = true, [3] = true}
63 ["group:wood"] = {[4] = true, [5] = true, [6] = true}
64 }
65 --]]
66 function unified_inventory.count_craft_positions(craft)
67 local positions = {}
68 local craft_items = craft.items
69 local craft_type = unified_inventory.registered_craft_types[craft.type]
70 or unified_inventory.craft_type_defaults(craft.type, {})
71 local display_width = craft_type.dynamic_display_size
72 and craft_type.dynamic_display_size(craft).width
73 or craft_type.width
74 local craft_width = craft_type.get_shaped_craft_width
75 and craft_type.get_shaped_craft_width(craft)
76 or display_width
77 local i = 0
78
79 for y = 1, 3 do
80 for x = 1, craft_width do
81 i = i + 1
82 local item = craft_items[i]
83
84 if item ~= nil then
85 local pos = 3 * (y - 1) + x
86 local set = positions[item]
87
88 if set ~= nil then
89 set[pos] = true
90 else
91 positions[item] = {[pos] = true}
92 end
93 end
94 end
95 end
96
97 return positions
98 end
99
100 --[[
101 For every craft item find all matching inventory items.
102 - If craft item is a group then find all inventory items that matches
103 this group.
104 - If craft item is not a group (regular item) then find only this item.
105
106 If inventory doesn't contain needed item then found set is empty for
107 this item.
108
109 Return a table of "craft item name" - "set of matching inventory items"
110 pairs.
111
112 Arguments:
113 inv_items: table with items names as keys
114 craft_items: table with items names or groups as keys
115
116 Example output:
117 {
118 ["group:wood"] = {
119 ["default:pine_wood"] = true,
120 ["default:acacia_wood"] = true
121 },
122 ["wool:white"] = {
123 ["wool:white"] = true
124 }
125 }
126 --]]
127 function unified_inventory.find_usable_items(inv_items, craft_items)
128 local get_group = minetest.get_item_group
129 local result = {}
130
131 for craft_item in pairs(craft_items) do
132 local group = craft_item:match("^group:(.+)")
133 local found = {}
134
135 if group ~= nil then
136 for inv_item in pairs(inv_items) do
137 if get_group(inv_item, group) > 0 then
138 found[inv_item] = true
139 end
140 end
141 else
142 if inv_items[craft_item] ~= nil then
143 found[craft_item] = true
144 end
145 end
146
147 result[craft_item] = found
148 end
149
150 return result
151 end
152
153 --[[
154 Match inventory items with craft grid positions.
155 For every position select the matching inventory item with maximum
156 (total_count / (times_matched + 1)) value.
157
158 If for some position matching item cannot be found or match count is 0
159 then return nil.
160
161 Return a table of "matched item name" - "set of craft positions" pairs
162 and overall match count.
163
164 Arguments:
165 inv_counts: table of inventory items counts from "count_items"
166 craft_positions: table of craft positions from "count_craft_positions"
167
168 Example output:
169 match_table = {
170 ["wool:white"] = {[1] = true, [2] = true, [3] = true}
171 ["default:acacia_wood"] = {[4] = true, [6] = true}
172 ["default:pine_wood"] = {[5] = true}
173 }
174 match_count = 2
175 --]]
176 function unified_inventory.match_items(inv_counts, craft_positions)
177 local usable = unified_inventory.find_usable_items(inv_counts, craft_positions)
178 local match_table = {}
179 local match_count
180 local matches = {}
181
182 for craft_item, pos_set in pairs(craft_positions) do
183 local use_set = usable[craft_item]
184
185 for pos in pairs(pos_set) do
186 local pos_item
187 local pos_count
188
189 for use_item in pairs(use_set) do
190 local count = inv_counts[use_item]
191 local times_matched = matches[use_item] or 0
192 local new_pos_count = math.floor(count / (times_matched + 1))
193
194 if pos_count == nil or pos_count < new_pos_count then
195 pos_item = use_item
196 pos_count = new_pos_count
197 end
198 end
199
200 if pos_item == nil or pos_count == 0 then
201 return nil
202 end
203
204 local set = match_table[pos_item]
205
206 if set ~= nil then
207 set[pos] = true
208 else
209 match_table[pos_item] = {[pos] = true}
210 end
211
212 matches[pos_item] = (matches[pos_item] or 0) + 1
213 end
214 end
215
216 for match_item, times_matched in pairs(matches) do
217 local count = inv_counts[match_item]
218 local item_count = math.floor(count / times_matched)
219
220 if match_count == nil or item_count < match_count then
221 match_count = item_count
222 end
223 end
224
225 return match_table, match_count
226 end
227
228 --[[
229 Remove item from inventory lists.
230 Return stack of actually removed items.
231
232 This function replicates the inv:remove_item function but can accept
233 multiple lists.
234
235 Arguments:
236 inv: minetest inventory reference
237 lists: names of inventory lists
238 stack: minetest item stack
239 --]]
240 function unified_inventory.remove_item(inv, lists, stack)
241 local removed = ItemStack(nil)
242 local leftover = ItemStack(stack)
243
244 for i = 1, #lists do
245 if leftover:is_empty() then
246 break
247 end
248
249 local cur_removed = inv:remove_item(lists[i], leftover)
250 removed:add_item(cur_removed)
251 leftover:take_item(cur_removed:get_count())
252 end
253
254 return removed
255 end
256
257 --[[
258 Add item to inventory lists.
259 Return leftover stack.
260
261 This function replicates the inv:add_item function but can accept
262 multiple lists.
263
264 Arguments:
265 inv: minetest inventory reference
266 lists: names of inventory lists
267 stack: minetest item stack
268 --]]
269 function unified_inventory.add_item(inv, lists, stack)
270 local leftover = ItemStack(stack)
271
272 for i = 1, #lists do
273 if leftover:is_empty() then
274 break
275 end
276
277 leftover = inv:add_item(lists[i], leftover)
278 end
279
280 return leftover
281 end
282
283 --[[
284 Move items from source list to destination list if possible.
285 Skip positions specified in exclude set.
286
287 Arguments:
288 inv: minetest inventory reference
289 src_list: name of source list
290 dst_list: name of destination list
291 exclude: set of positions to skip
292 --]]
293 function unified_inventory.swap_items(inv, src_list, dst_list, exclude)
294 local size = inv:get_size(src_list)
295 local empty = ItemStack(nil)
296
297 for i = 1, size do
298 if exclude == nil or exclude[i] == nil then
299 local stack = inv:get_stack(src_list, i)
300
301 if not stack:is_empty() then
302 inv:set_stack(src_list, i, empty)
303 local leftover = inv:add_item(dst_list, stack)
304
305 if not leftover:is_empty() then
306 inv:set_stack(src_list, i, leftover)
307 end
308 end
309 end
310 end
311 end
312
313 --[[
314 Move matched items to the destination list.
315
316 If destination list position is already occupied with some other item
317 then function tries to (in that order):
318 1. Move it to the source list
319 2. Move it to some other unused position in destination list itself
320 3. Drop it to the ground if nothing else is possible.
321
322 Arguments:
323 player: minetest player object
324 src_list: name of source list
325 dst_list: name of destination list
326 match_table: table of matched items
327 amount: amount of items per every position
328 --]]
329 function unified_inventory.move_match(player, src_list, dst_list, match_table, amount)
330 local inv = player:get_inventory()
331 local item_drop = minetest.item_drop
332 local src_dst_list = {src_list, dst_list}
333 local dst_src_list = {dst_list, src_list}
334
335 local needed = {}
336 local moved = {}
337
338 -- Remove stacks needed for craft
339 for item, pos_set in pairs(match_table) do
340 local stack = ItemStack(item)
341 local stack_max = stack:get_stack_max()
342 local bounded_amount = math.min(stack_max, amount)
343 stack:set_count(bounded_amount)
344
345 for pos in pairs(pos_set) do
346 needed[pos] = unified_inventory.remove_item(inv, dst_src_list, stack)
347 end
348 end
349
350 -- Add already removed stacks
351 for pos, stack in pairs(needed) do
352 local occupied = inv:get_stack(dst_list, pos)
353 inv:set_stack(dst_list, pos, stack)
354
355 if not occupied:is_empty() then
356 local leftover = unified_inventory.add_item(inv, src_dst_list, occupied)
357
358 if not leftover:is_empty() then
359 inv:set_stack(dst_list, pos, leftover)
360 local oversize = unified_inventory.add_item(inv, src_dst_list, stack)
361
362 if not oversize:is_empty() then
363 item_drop(oversize, player, player:get_pos())
364 end
365 end
366 end
367
368 moved[pos] = true
369 end
370
371 -- Swap items from unused positions to src (moved positions excluded)
372 unified_inventory.swap_items(inv, dst_list, src_list, moved)
373 end
374
375 --[[
376 Find craft match and move matched items to the destination list.
377
378 If match cannot be found or match count is smaller than the desired
379 amount then do nothing.
380
381 If amount passed is -1 then amount is defined by match count itself.
382 This is used to indicate "craft All" case.
383
384 Arguments:
385 player: minetest player object
386 src_list: name of source list
387 dst_list: name of destination list
388 craft: minetest craft recipe
389 amount: desired amount of output items
390 --]]
391 function unified_inventory.craftguide_match_craft(player, src_list, dst_list, craft, amount)
392 local inv = player:get_inventory()
393 local src_dst_list = {src_list, dst_list}
394
395 local counts = unified_inventory.count_items(inv, src_dst_list)
396 local positions = unified_inventory.count_craft_positions(craft)
397 local match_table, match_count = unified_inventory.match_items(counts, positions)
398
399 if match_table == nil or match_count < amount then
400 return
401 end
402
403 if amount == -1 then
404 amount = match_count
405 end
406
407 unified_inventory.move_match(player, src_list, dst_list, match_table, amount)
408 end
00 name = unified_inventory
1 depends = default
2 optional_depends = creative, sfinv, datastorage, farming
3 description = """
4 Unified Inventory replaces the default survival and creative inventory.
5 It adds a nicer interface and a number of features, such as a crafting guide.
6 """
7 min_minetest_version = 5.4.0
0 local S = unified_inventory.gettext
0 local S = minetest.get_translator("unified_inventory")
1 local NS = function(s) return s end
12 local F = minetest.formspec_escape
3 local ui = unified_inventory
24
35 minetest.register_privilege("creative", {
46 description = S("Can use the creative inventory"),
1012 give_to_singleplayer = false,
1113 })
1214
13
1415 local trash = minetest.create_detached_inventory("trash", {
1516 --allow_put = function(inv, listname, index, stack, player)
16 -- if unified_inventory.is_creative(player:get_player_name()) then
17 -- if ui.is_creative(player:get_player_name()) then
1718 -- return stack:get_count()
1819 -- else
1920 -- return 0
2728 })
2829 trash:set_size("main", 1)
2930
30 unified_inventory.register_button("craft", {
31 ui.register_button("craft", {
3132 type = "image",
3233 image = "ui_craft_icon.png",
3334 tooltip = S("Crafting Grid")
3435 })
3536
36 unified_inventory.register_button("craftguide", {
37 ui.register_button("craftguide", {
3738 type = "image",
3839 image = "ui_craftguide_icon.png",
3940 tooltip = S("Crafting Guide")
4041 })
4142
42 unified_inventory.register_button("home_gui_set", {
43 ui.register_button("home_gui_set", {
4344 type = "image",
4445 image = "ui_sethome_icon.png",
4546 tooltip = S("Set home position"),
4748 action = function(player)
4849 local player_name = player:get_player_name()
4950 if minetest.check_player_privs(player_name, {home=true}) then
50 unified_inventory.set_home(player, player:getpos())
51 local home = unified_inventory.home_pos[player_name]
51 ui.set_home(player, player:get_pos())
52 local home = ui.home_pos[player_name]
5253 if home ~= nil then
5354 minetest.sound_play("dingdong",
5455 {to_player=player_name, gain = 1.0})
5556 minetest.chat_send_player(player_name,
56 S("Home position set to: %s"):format(minetest.pos_to_string(home)))
57 S("Home position set to: @1", minetest.pos_to_string(home)))
5758 end
5859 else
5960 minetest.chat_send_player(player_name,
6061 S("You don't have the \"home\" privilege!"))
61 unified_inventory.set_inventory_formspec(player, unified_inventory.current_page[player_name])
62 ui.set_inventory_formspec(player, ui.current_page[player_name])
6263 end
6364 end,
6465 condition = function(player)
6667 end,
6768 })
6869
69 unified_inventory.register_button("home_gui_go", {
70 ui.register_button("home_gui_go", {
7071 type = "image",
7172 image = "ui_gohome_icon.png",
7273 tooltip = S("Go home"),
7475 action = function(player)
7576 local player_name = player:get_player_name()
7677 if minetest.check_player_privs(player_name, {home=true}) then
77 minetest.sound_play("teleport",
78 {to_player=player:get_player_name(), gain = 1.0})
79 unified_inventory.go_home(player)
78 if ui.go_home(player) then
79 minetest.sound_play("teleport", {to_player = player_name})
80 end
8081 else
8182 minetest.chat_send_player(player_name,
8283 S("You don't have the \"home\" privilege!"))
83 unified_inventory.set_inventory_formspec(player, unified_inventory.current_page[player_name])
84 ui.set_inventory_formspec(player, ui.current_page[player_name])
8485 end
8586 end,
8687 condition = function(player)
8889 end,
8990 })
9091
91 unified_inventory.register_button("misc_set_day", {
92 ui.register_button("misc_set_day", {
9293 type = "image",
9394 image = "ui_sun_icon.png",
9495 tooltip = S("Set time to day"),
104105 else
105106 minetest.chat_send_player(player_name,
106107 S("You don't have the settime privilege!"))
107 unified_inventory.set_inventory_formspec(player, unified_inventory.current_page[player_name])
108 ui.set_inventory_formspec(player, ui.current_page[player_name])
108109 end
109110 end,
110111 condition = function(player)
112113 end,
113114 })
114115
115 unified_inventory.register_button("misc_set_night", {
116 ui.register_button("misc_set_night", {
116117 type = "image",
117118 image = "ui_moon_icon.png",
118119 tooltip = S("Set time to night"),
128129 else
129130 minetest.chat_send_player(player_name,
130131 S("You don't have the settime privilege!"))
131 unified_inventory.set_inventory_formspec(player, unified_inventory.current_page[player_name])
132 ui.set_inventory_formspec(player, ui.current_page[player_name])
132133 end
133134 end,
134135 condition = function(player)
136137 end,
137138 })
138139
139 unified_inventory.register_button("clear_inv", {
140 ui.register_button("clear_inv", {
140141 type = "image",
141142 image = "ui_trash_icon.png",
142143 tooltip = S("Clear inventory"),
143144 action = function(player)
144145 local player_name = player:get_player_name()
145 if not unified_inventory.is_creative(player_name) then
146 if not ui.is_creative(player_name) then
146147 minetest.chat_send_player(player_name,
147148 S("This button has been disabled outside"
148149 .." of creative mode to prevent"
149150 .." accidental inventory trashing."
150151 .."\nUse the trash slot instead."))
151 unified_inventory.set_inventory_formspec(player, unified_inventory.current_page[player_name])
152 ui.set_inventory_formspec(player, ui.current_page[player_name])
152153 return
153154 end
154155 player:get_inventory():set_list("main", {})
157158 {to_player=player_name, gain = 1.0})
158159 end,
159160 condition = function(player)
160 return unified_inventory.is_creative(player:get_player_name())
161 end,
162 })
163
164 unified_inventory.register_page("craft", {
161 return ui.is_creative(player:get_player_name())
162 end,
163 })
164
165 ui.register_page("craft", {
165166 get_formspec = function(player, perplayer_formspec)
166167
167 local formspecy = perplayer_formspec.formspec_y
168 local formheadery = perplayer_formspec.form_header_y
169
170 local player_name = player:get_player_name()
171 local formspec = "background[2,"..formspecy..";6,3;ui_crafting_form.png]"
172 formspec = formspec.."background[0,"..(formspecy + 3.5)..";8,4;ui_main_inventory.png]"
173 formspec = formspec.."label[0,"..formheadery..";" ..F(S("Crafting")).."]"
174 formspec = formspec.."listcolors[#00000000;#00000000]"
175 formspec = formspec.."list[current_player;craftpreview;6,"..formspecy..";1,1;]"
176 formspec = formspec.."list[current_player;craft;2,"..formspecy..";3,3;]"
177 if unified_inventory.trash_enabled or unified_inventory.is_creative(player_name) or minetest.get_player_privs(player_name).give then
178 formspec = formspec.."label[7,"..(formspecy + 1.5)..";" .. F(S("Trash:")) .. "]"
179 formspec = formspec.."background[7,"..(formspecy + 2)..";1,1;ui_single_slot.png]"
180 formspec = formspec.."list[detached:trash;main;7,"..(formspecy + 2)..";1,1;]"
181 end
182 formspec = formspec.."listring[current_name;craft]"
183 formspec = formspec.."listring[current_player;main]"
184 if unified_inventory.is_creative(player_name) then
185 formspec = formspec.."label[0,"..(formspecy + 1.5)..";" .. F(S("Refill:")) .. "]"
186 formspec = formspec.."list[detached:"..F(player_name).."refill;main;0,"..(formspecy +2)..";1,1;]"
187 end
188 return {formspec=formspec}
168 local formheaderx = perplayer_formspec.form_header_x
169 local formheadery = perplayer_formspec.form_header_y
170 local craftx = perplayer_formspec.craft_x
171 local crafty = perplayer_formspec.craft_y
172
173 local player_name = player:get_player_name()
174 local formspec = {
175 perplayer_formspec.standard_inv_bg,
176 perplayer_formspec.craft_grid,
177 "label["..formheaderx..","..formheadery..";" ..F(S("Crafting")).."]",
178 "listcolors[#00000000;#00000000]",
179 "listring[current_name;craft]",
180 "listring[current_player;main]"
181 }
182 local n=#formspec+1
183
184 if ui.trash_enabled or ui.is_creative(player_name) or minetest.get_player_privs(player_name).give then
185 formspec[n] = string.format("label[%f,%f;%s]", craftx + 6.45, crafty + 2.4, F(S("Trash:")))
186 formspec[n+1] = ui.make_trash_slot(craftx + 6.25, crafty + 2.5)
187 n=n + 2
188 end
189
190 if ui.is_creative(player_name) then
191 formspec[n] = ui.single_slot(craftx - 2.5, crafty + 2.5)
192 formspec[n+1] = string.format("label[%f,%f;%s]", craftx - 2.3, crafty + 2.4,F(S("Refill:")))
193 formspec[n+2] = string.format("list[detached:%srefill;main;%f,%f;1,1;]",
194 F(player_name), craftx - 2.5 + ui.list_img_offset, crafty + 2.5 + ui.list_img_offset)
195 end
196 return {formspec=table.concat(formspec)}
189197 end,
190198 })
191199
204212 local selectitem = name
205213 if name:sub(1, 6) == "group:" then
206214 local group_name = name:sub(7)
207 local group_item = unified_inventory.get_group_item(group_name)
215 local group_item = ui.get_group_item(group_name)
208216 show_is_group = not group_item.sole
209217 displayitem = group_item.item or "unknown"
210218 selectitem = group_item.sole and displayitem or name
211219 end
212220 local label = show_is_group and "G" or ""
213 local buttonname = F(buttonname_prefix..unified_inventory.mangle_for_formspec(selectitem))
221 local buttonname = F(buttonname_prefix..ui.mangle_for_formspec(selectitem))
214222 local button = string.format("item_image_button[%f,%f;%f,%f;%s;%s;%s]",
215223 x, y, w, h,
216224 F(displayitem), buttonname, label)
217225 if show_is_group then
218 local groupstring, andcount = unified_inventory.extract_groupnames(name)
226 local groupstring, andcount = ui.extract_groupnames(name)
219227 local grouptip
220228 if andcount == 1 then
221 grouptip = string.format(S("Any item belonging to the %s group"), groupstring)
229 grouptip = S("Any item belonging to the @1 group", groupstring)
222230 elseif andcount > 1 then
223 grouptip = string.format(S("Any item belonging to the groups %s"), groupstring)
231 grouptip = S("Any item belonging to the groups @1", groupstring)
224232 end
225233 grouptip = F(grouptip)
226234 if andcount >= 1 then
231239 end
232240
233241 local recipe_text = {
234 recipe = S("Recipe %d of %d"),
235 usage = S("Usage %d of %d"),
242 recipe = NS("Recipe @1 of @2"),
243 usage = NS("Usage @1 of @2"),
236244 }
237245 local no_recipe_text = {
238246 recipe = S("No recipes"),
255263 usage = "recipe",
256264 }
257265
258 unified_inventory.register_page("craftguide", {
266 ui.register_page("craftguide", {
259267 get_formspec = function(player, perplayer_formspec)
260268
261 local formspecy = perplayer_formspec.formspec_y
262 local formheadery = perplayer_formspec.form_header_y
263 local craftresultx = perplayer_formspec.craft_result_x
264 local craftresulty = perplayer_formspec.craft_result_y
269 local craftguidex = perplayer_formspec.craft_guide_x
270 local craftguidey = perplayer_formspec.craft_guide_y
271 local craftguidearrowx = perplayer_formspec.craft_guide_arrow_x
272 local craftguideresultx = perplayer_formspec.craft_guide_result_x
273 local formheaderx = perplayer_formspec.form_header_x
274 local formheadery = perplayer_formspec.form_header_y
275 local give_x = perplayer_formspec.give_btn_x
265276
266277 local player_name = player:get_player_name()
267278 local player_privs = minetest.get_player_privs(player_name)
268 local formspec = ""
269 formspec = formspec.."background[0,"..(formspecy + 3.5)..";8,4;ui_main_inventory.png]"
270 formspec = formspec.."label[0,"..formheadery..";" .. F(S("Crafting Guide")) .. "]"
271 formspec = formspec.."listcolors[#00000000;#00000000]"
272 local item_name = unified_inventory.current_item[player_name]
273 if not item_name then return {formspec=formspec} end
279
280 local formspec = {
281 perplayer_formspec.standard_inv_bg,
282 "label["..formheaderx..","..formheadery..";" .. F(S("Crafting Guide")) .. "]",
283 "listcolors[#00000000;#00000000]"
284 }
285
286 local item_name = ui.current_item[player_name]
287 if not item_name then
288 return { formspec = table.concat(formspec) }
289 end
290
291 local n = 4
292
274293 local item_name_shown
275 if minetest.registered_items[item_name] and minetest.registered_items[item_name].description then
276 item_name_shown = string.format(S("%s (%s)"), minetest.registered_items[item_name].description, item_name)
294 if minetest.registered_items[item_name]
295 and minetest.registered_items[item_name].description then
296 item_name_shown = S("@1 (@2)",
297 minetest.registered_items[item_name].description, item_name)
277298 else
278299 item_name_shown = item_name
279300 end
280301
281 local dir = unified_inventory.current_craft_direction[player_name]
282 local rdir
283 if dir == "recipe" then rdir = "usage" end
284 if dir == "usage" then rdir = "recipe" end
285 local crafts = unified_inventory.crafts_for[dir][item_name]
286 local alternate = unified_inventory.alternate[player_name]
302 local dir = ui.current_craft_direction[player_name]
303 local rdir = dir == "recipe" and "usage" or "recipe"
304
305 local crafts = ui.crafts_for[dir][item_name]
306 local alternate = ui.alternate[player_name]
287307 local alternates, craft
288 if crafts ~= nil and #crafts > 0 then
308 if crafts and #crafts > 0 then
289309 alternates = #crafts
290310 craft = crafts[alternate]
291311 end
292 local has_creative = player_privs.give or player_privs.creative or
293 minetest.settings:get_bool("creative_mode")
294
295 formspec = formspec.."background[0.5,"..(formspecy + 0.2)..";8,3;ui_craftguide_form.png]"
296 formspec = formspec.."textarea["..craftresultx..","..craftresulty
297 ..";10,1;;"..F(role_text[dir])..": "..item_name_shown..";]"
298 formspec = formspec..stack_image_button(0, formspecy, 1.1, 1.1, "item_button_"
299 .. rdir .. "_", ItemStack(item_name))
312 local has_give = player_privs.give or ui.is_creative(player_name)
313
314 formspec[n] = string.format("image[%f,%f;%f,%f;ui_crafting_arrow.png]",
315 craftguidearrowx, craftguidey, ui.imgscale, ui.imgscale)
316
317 formspec[n+1] = string.format("textarea[%f,%f;10,1;;%s: %s;]",
318 perplayer_formspec.craft_guide_resultstr_x, perplayer_formspec.craft_guide_resultstr_y,
319 F(role_text[dir]), item_name_shown)
320 n = n + 2
321
322 local giveme_form = table.concat({
323 "label[".. (give_x+0.1)..",".. (craftguidey + 2.7) .. ";" .. F(S("Give me:")) .. "]",
324 "button["..(give_x)..",".. (craftguidey + 2.9) .. ";0.75,0.5;craftguide_giveme_1;1]",
325 "button["..(give_x+0.8)..",".. (craftguidey + 2.9) .. ";0.75,0.5;craftguide_giveme_10;10]",
326 "button["..(give_x+1.6)..",".. (craftguidey + 2.9) .. ";0.75,0.5;craftguide_giveme_99;99]"
327 })
300328
301329 if not craft then
302 formspec = formspec.."label[5.5,"..(formspecy + 2.35)..";"
303 ..F(no_recipe_text[dir]).."]"
304 local no_pos = dir == "recipe" and 4.5 or 6.5
305 local item_pos = dir == "recipe" and 6.5 or 4.5
306 formspec = formspec.."image["..no_pos..","..formspecy..";1.1,1.1;ui_no.png]"
307 formspec = formspec..stack_image_button(item_pos, formspecy, 1.1, 1.1, "item_button_"
308 ..other_dir[dir].."_", ItemStack(item_name))
309 if has_creative then
310 formspec = formspec.."label[0,"..(formspecy + 2.10)..";" .. F(S("Give me:")) .. "]"
311 .."button[0, "..(formspecy + 2.7)..";0.6,0.5;craftguide_giveme_1;1]"
312 .."button[0.6,"..(formspecy + 2.7)..";0.7,0.5;craftguide_giveme_10;10]"
313 .."button[1.3,"..(formspecy + 2.7)..";0.8,0.5;craftguide_giveme_99;99]"
330 -- No craft recipes available for this item.
331 formspec[n] = string.format("label[%f,%f;%s]", craftguidex+2.5, craftguidey+1.5, F(no_recipe_text[dir]))
332 local no_pos = dir == "recipe" and (craftguidex+2.5) or craftguideresultx
333 local item_pos = dir == "recipe" and craftguideresultx or (craftguidex+2.5)
334 formspec[n+1] = "image["..no_pos..","..craftguidey..";1.2,1.2;ui_no.png]"
335 formspec[n+2] = stack_image_button(item_pos, craftguidey, 1.2, 1.2,
336 "item_button_" .. other_dir[dir] .. "_", ItemStack(item_name))
337 if has_give then
338 formspec[n+3] = giveme_form
314339 end
315 return {formspec = formspec}
316 end
317
318 local craft_type = unified_inventory.registered_craft_types[craft.type] or
319 unified_inventory.craft_type_defaults(craft.type, {})
340 return { formspec = table.concat(formspec) }
341 else
342 formspec[n] = stack_image_button(craftguideresultx, craftguidey, 1.2, 1.2,
343 "item_button_" .. rdir .. "_", ItemStack(craft.output))
344 n = n + 1
345 end
346
347 local craft_type = ui.registered_craft_types[craft.type] or
348 ui.craft_type_defaults(craft.type, {})
320349 if craft_type.icon then
321 formspec = formspec..string.format(" image[%f,%f;%f,%f;%s]",5.7,(formspecy + 0.05),0.5,0.5,craft_type.icon)
322 end
323 formspec = formspec.."label[5.5,"..(formspecy + 1)..";" .. F(craft_type.description).."]"
324 formspec = formspec..stack_image_button(6.5, formspecy, 1.1, 1.1, "item_button_usage_", ItemStack(craft.output))
325 local display_size = craft_type.dynamic_display_size and craft_type.dynamic_display_size(craft) or { width = craft_type.width, height = craft_type.height }
326 local craft_width = craft_type.get_shaped_craft_width and craft_type.get_shaped_craft_width(craft) or display_size.width
350 formspec[n] = string.format("image[%f,%f;%f,%f;%s]",
351 craftguidearrowx+0.35, craftguidey, 0.5, 0.5, craft_type.icon)
352 n = n + 1
353 end
354 formspec[n] = string.format("label[%f,%f;%s]", craftguidearrowx + 0.15, craftguidey + 1.4, F(craft_type.description))
355 n = n + 1
356
357 local display_size = craft_type.dynamic_display_size
358 and craft_type.dynamic_display_size(craft)
359 or { width = craft_type.width, height = craft_type.height }
360 local craft_width = craft_type.get_shaped_craft_width
361 and craft_type.get_shaped_craft_width(craft)
362 or display_size.width
327363
328364 -- This keeps recipes aligned to the right,
329365 -- so that they're close to the arrow.
330 local xoffset = 5.5
366 local xoffset = craftguidex+3.75
367 local bspc = 1.25
331368 -- Offset factor for crafting grids with side length > 4
332369 local of = (3/math.max(3, math.max(display_size.width, display_size.height)))
333370 local od = 0
334 -- Minimum grid size at which size optimazation measures kick in
371 -- Minimum grid size at which size optimization measures kick in
335372 local mini_craft_size = 6
336373 if display_size.width >= mini_craft_size then
337374 od = math.max(1, display_size.width - 2)
340377 -- Size modifier factor
341378 local sf = math.min(1, of * (1.05 + 0.05*od))
342379 -- Button size
343 local bsize_h = 1.1 * sf
344 local bsize_w = bsize_h
345 if display_size.width >= mini_craft_size then
346 bsize_w = 1.175 * sf
347 end
348 if (bsize_h > 0.35 and display_size.width) then
380 local bsize = 1.2 * sf
381
382 if display_size.width >= mini_craft_size then -- it's not a normal 3x3 grid
383 bsize = 0.8 * sf
384 end
385 if (bsize > 0.35 and display_size.width) then
349386 for y = 1, display_size.height do
350387 for x = 1, display_size.width do
351388 local item
355392 -- Flipped x, used to build formspec buttons from right to left
356393 local fx = display_size.width - (x-1)
357394 -- x offset, y offset
358 local xof = (fx-1) * of + of
359 local yof = (y-1) * of + 1
395 local xof = ((fx-1) * of + of) * bspc
396 local yof = ((y-1) * of + 1) * bspc
360397 if item then
361 formspec = formspec..stack_image_button(
362 xoffset - xof, formspecy - 1 + yof, bsize_w, bsize_h,
398 formspec[n] = stack_image_button(
399 xoffset - xof, craftguidey - 1.25 + yof, bsize, bsize,
363400 "item_button_recipe_",
364401 ItemStack(item))
365402 else
366403 -- Fake buttons just to make grid
367 formspec = formspec.."image_button["
368 ..tostring(xoffset - xof)..","..tostring(formspecy - 1 + yof)
369 ..";"..bsize_w..","..bsize_h..";ui_blank_image.png;;]"
404 formspec[n] = string.format("image_button[%f,%f;%f,%f;ui_blank_image.png;;]",
405 xoffset - xof, craftguidey - 1.25 + yof, bsize, bsize)
370406 end
407 n = n + 1
371408 end
372409 end
373410 else
374411 -- Error
375 formspec = formspec.."label["
376 ..tostring(2)..","..tostring(formspecy)
377 ..";"..F(S("This recipe is too\nlarge to be displayed.")).."]"
412 formspec[n] = string.format("label[2,%f;%s]",
413 craftguidey, F(S("This recipe is too@nlarge to be displayed.")))
414 n = n + 1
378415 end
379416
380417 if craft_type.uses_crafting_grid and display_size.width <= 3 then
381 formspec = formspec.."label[0,"..(formspecy + 0.9)..";" .. F(S("To craft grid:")) .. "]"
382 .."button[0, "..(formspecy + 1.5)..";0.6,0.5;craftguide_craft_1;1]"
383 .."button[0.6,"..(formspecy + 1.5)..";0.7,0.5;craftguide_craft_10;10]"
384 .."button[1.3,"..(formspecy + 1.5)..";0.8,0.5;craftguide_craft_max;" .. F(S("All")) .. "]"
385 end
386 if has_creative then
387 formspec = formspec.."label[0,"..(formspecy + 2.1)..";" .. F(S("Give me:")) .. "]"
388 .."button[0, "..(formspecy + 2.7)..";0.6,0.5;craftguide_giveme_1;1]"
389 .."button[0.6,"..(formspecy + 2.7)..";0.7,0.5;craftguide_giveme_10;10]"
390 .."button[1.3,"..(formspecy + 2.7)..";0.8,0.5;craftguide_giveme_99;99]"
418 formspec[n] = "label["..(give_x+0.1)..",".. (craftguidey + 1.7) .. ";" .. F(S("To craft grid:")) .. "]"
419 formspec[n+1] = "button[".. (give_x)..",".. (craftguidey + 1.9) .. ";0.75,0.5;craftguide_craft_1;1]"
420 formspec[n+2] = "button[".. (give_x+0.8)..",".. (craftguidey + 1.9) .. ";0.75,0.5;craftguide_craft_10;10]"
421 formspec[n+3] = "button[".. (give_x+1.6)..",".. (craftguidey + 1.9) .. ";0.75,0.5;craftguide_craft_max;" .. F(S("All")) .. "]"
422 n = n + 4
423 end
424
425 if has_give then
426 formspec[n] = giveme_form
427 n = n + 1
391428 end
392429
393430 if alternates and alternates > 1 then
394 formspec = formspec.."label[5.5,"..(formspecy + 1.6)..";"
395 ..string.format(F(recipe_text[dir]), alternate, alternates).."]"
396 .."image_button[5.5,"..(formspecy + 2)..";1,1;ui_left_icon.png;alternate_prev;]"
397 .."image_button[6.5,"..(formspecy + 2)..";1,1;ui_right_icon.png;alternate;]"
398 .."tooltip[alternate_prev;"..F(prev_alt_text[dir]).."]"
399 .."tooltip[alternate;"..F(next_alt_text[dir]).."]"
400 end
401 return {formspec = formspec}
431 formspec[n] = string.format("label[%f,%f;%s]",
432 craftguidex+4, craftguidey + 2.3, F(S(recipe_text[dir], alternate, alternates)))
433 formspec[n+1] = string.format("image_button[%f,%f;1.1,1.1;ui_left_icon.png;alternate_prev;]",
434 craftguidearrowx+0.2, craftguidey + 2.6)
435 formspec[n+2] = string.format("image_button[%f,%f;1.1,1.1;ui_right_icon.png;alternate;]",
436 craftguidearrowx+1.35, craftguidey + 2.6)
437 formspec[n+3] = "tooltip[alternate_prev;" .. F(prev_alt_text[dir]) .. "]"
438 formspec[n+4] = "tooltip[alternate;" .. F(next_alt_text[dir]) .. "]"
439 end
440
441 return { formspec = table.concat(formspec) }
402442 end,
403443 })
404444
405445 local function craftguide_giveme(player, formname, fields)
446 local player_name = player:get_player_name()
447 local player_privs = minetest.get_player_privs(player_name)
448 if not player_privs.give and
449 not ui.is_creative(player_name) then
450 minetest.log("action", "[unified_inventory] Denied give action to player " ..
451 player_name)
452 return
453 end
454
406455 local amount
407456 for k, v in pairs(fields) do
408457 amount = k:match("craftguide_giveme_(.*)")
409458 if amount then break end
410459 end
411 if not amount then return end
412
413 amount = tonumber(amount)
460
461 amount = tonumber(amount) or 0
414462 if amount == 0 then return end
415463
416 local player_name = player:get_player_name()
417
418 local output = unified_inventory.current_item[player_name]
464 local output = ui.current_item[player_name]
419465 if (not output) or (output == "") then return end
420466
421467 local player_inv = player:get_inventory()
422468
423469 player_inv:add_item("main", {name = output, count = amount})
424 end
425
426 -- tells if an item can be moved and returns an index if so
427 local function item_fits(player_inv, craft_item, needed_item)
428 local need_group = string.sub(needed_item, 1, 6) == "group:"
429 if need_group then
430 need_group = string.sub(needed_item, 7)
431 end
432 if craft_item
433 and not craft_item:is_empty() then
434 local ciname = craft_item:get_name()
435
436 -- abort if the item there isn't usable
437 if ciname ~= needed_item
438 and not need_group then
439 return
440 end
441
442 -- abort if no item fits onto it
443 if craft_item:get_count() >= craft_item:get_definition().stack_max then
444 return
445 end
446
447 -- use the item there if it's in the right group and a group item is needed
448 if need_group then
449 if minetest.get_item_group(ciname, need_group) == 0 then
450 return
451 end
452 needed_item = ciname
453 need_group = false
454 end
455 end
456
457 if need_group then
458 -- search an item of the specific group
459 for i,item in pairs(player_inv:get_list("main")) do
460 if not item:is_empty()
461 and minetest.get_item_group(item:get_name(), need_group) > 0 then
462 return i
463 end
464 end
465
466 -- no index found
467 return
468 end
469
470 -- search an item with a the name needed_item
471 for i,item in pairs(player_inv:get_list("main")) do
472 if not item:is_empty()
473 and item:get_name() == needed_item then
474 return i
475 end
476 end
477
478 -- no index found
479 end
480
481 -- modifies the player inventory and returns the changed craft_item if possible
482 local function move_item(player_inv, craft_item, needed_item)
483 local stackid = item_fits(player_inv, craft_item, needed_item)
484 if not stackid then
485 return
486 end
487 local wanted_stack = player_inv:get_stack("main", stackid)
488 local taken_item = wanted_stack:take_item()
489 player_inv:set_stack("main", stackid, wanted_stack)
490
491 if not craft_item
492 or craft_item:is_empty() then
493 return taken_item
494 end
495
496 craft_item:add_item(taken_item)
497 return craft_item
498470 end
499471
500472 local function craftguide_craft(player, formname, fields)
504476 if amount then break end
505477 end
506478 if not amount then return end
479
480 amount = tonumber(amount) or -1 -- fallback for "all"
481 if amount == 0 or amount < -1 or amount > 99 then return end
482
507483 local player_name = player:get_player_name()
508484
509 local output = unified_inventory.current_item[player_name]
510 if (not output) or (output == "") then return end
511
512 local player_inv = player:get_inventory()
513
514 local crafts = unified_inventory.crafts_for[unified_inventory.current_craft_direction[player_name]][output]
515 if (not crafts) or (#crafts == 0) then return end
516
517 local alternate = unified_inventory.alternate[player_name]
485 local output = ui.current_item[player_name] or ""
486 if output == "" then return end
487
488 local crafts = ui.crafts_for[
489 ui.current_craft_direction[player_name]][output] or {}
490 if #crafts == 0 then return end
491
492 local alternate = ui.alternate[player_name]
518493
519494 local craft = crafts[alternate]
520495 if craft.width > 3 then return end
521496
522 local needed = craft.items
523
524 local craft_list = player_inv:get_list("craft")
525
526 local width = craft.width
527 if width == 0 then
528 -- Shapeless recipe
529 width = 3
530 end
531
532 amount = tonumber(amount) or 99
533 --[[
534 if amount == "max" then
535 amount = 99 -- Arbitrary; need better way to do this.
536 else
537 amount = tonumber(amount)
538 end--]]
539
540 for iter = 1, amount do
541 local index = 1
542 for y = 1, 3 do
543 for x = 1, width do
544 local needed_item = needed[index]
545 if needed_item then
546 local craft_index = ((y - 1) * 3) + x
547 local craft_item = craft_list[craft_index]
548 local newitem = move_item(player_inv, craft_item, needed_item)
549 if newitem then
550 craft_list[craft_index] = newitem
551 end
552 end
553 index = index + 1
554 end
555 end
556 end
557
558 player_inv:set_list("craft", craft_list)
559
560 unified_inventory.set_inventory_formspec(player, "craft")
497 ui.craftguide_match_craft(player, "main", "craft", craft, amount)
498
499 ui.set_inventory_formspec(player, "craft")
561500 end
562501
563502 minetest.register_on_player_receive_fields(function(player, formname, fields)
503 if formname ~= "" then
504 return
505 end
506
564507 for k, v in pairs(fields) do
565508 if k:match("craftguide_craft_") then
566509 craftguide_craft(player, formname, fields)
88 #If enabled, the trash slot can be used by those without both creative
99 #and the give privilege.
1010 unified_inventory_trash (Enable trash) bool true
11
12
13 unified_inventory_automatic_categorization (Items automatically added to categories) bool true
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
textures/ui_bags_lg_form.png less more
Binary diff not shown
textures/ui_bags_main_form.png less more
Binary diff not shown
textures/ui_bags_med_form.png less more
Binary diff not shown
textures/ui_bags_sm_form.png less more
Binary diff not shown
textures/ui_bags_trash.png less more
Binary diff not shown
Binary diff not shown
textures/ui_craftguide_form.png less more
Binary diff not shown
textures/ui_crafting_form.png less more
Binary diff not shown
textures/ui_form_bg.png less more
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
textures/ui_main_inventory.png less more
Binary diff not shown
textures/ui_misc_form.png less more
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
textures/ui_xyz_off_icon.png less more
Binary diff not shown
textures/ui_xyz_on_icon.png less more
Binary diff not shown
0 local S = unified_inventory.gettext
0 local S = minetest.get_translator("unified_inventory")
11 local F = minetest.formspec_escape
2 local ui = unified_inventory
23
34 local hud_colors = {
45 {"#FFFFFF", 0xFFFFFF, S("White")},
1314 -- Stores temporary player data (persists until player leaves)
1415 local waypoints_temp = {}
1516
16 unified_inventory.register_page("waypoints", {
17 ui.register_page("waypoints", {
1718 get_formspec = function(player)
1819 local player_name = player:get_player_name()
20 local wp_info_x = ui.style_full.form_header_x + 1.25
21 local wp_info_y = ui.style_full.form_header_y + 0.5
22 local wp_bottom_row = ui.style_full.std_inv_y - 1
23 local wp_buttons_rj = ui.style_full.std_inv_x + 10.1 - ui.style_full.btn_spc
24 local wp_edit_w = ui.style_full.btn_spc * 4 - 0.1
1925
2026 -- build a "fake" temp entry if the server took too long
2127 -- during sign-on and returned an empty entry
2228 if not waypoints_temp[player_name] then waypoints_temp[player_name] = {hud = 1} end
2329
2430 local waypoints = datastorage.get(player_name, "waypoints")
25 local formspec = "background[0,4.5;8,4;ui_main_inventory.png]" ..
26 "image[0,0;1,1;ui_waypoints_icon.png]" ..
27 "label[1,0;" .. F(S("Waypoints")) .. "]"
31 local formspec = { ui.style_full.standard_inv_bg,
32 string.format("label[%f,%f;%s]",
33 ui.style_full.form_header_x, ui.style_full.form_header_y,
34 F(S("Waypoints"))),
35 "image["..wp_info_x..","..wp_info_y..";1,1;ui_waypoints_icon.png]"
36 }
37 local n=4
2838
2939 -- Tabs buttons:
30 for i = 1, 5, 1 do
31 formspec = formspec ..
32 "image_button[0.0," .. 0.2 + i * 0.7 .. ";.8,.8;" ..
33 (i == waypoints.selected and "ui_blue_icon_background.png^" or "") ..
34 "ui_" .. i .. "_icon.png;" ..
35 "select_waypoint" .. i .. ";]" ..
36 "tooltip[select_waypoint" .. i .. ";"
37 .. (S("Select Waypoint #%d"):format(i)).."]"
40 for i = 1, 5 do
41 local sw="select_waypoint"..i
42 formspec[n] = string.format("image_button[%f,%f;%f,%f;%sui_%i_icon.png;%s;]",
43 ui.style_full.main_button_x, wp_bottom_row - (5-i) * ui.style_full.btn_spc,
44 ui.style_full.btn_size, ui.style_full.btn_size,
45 (i == waypoints.selected) and "ui_blue_icon_background.png^" or "",
46 i, sw)
47 formspec[n+1] = "tooltip["..sw..";"..S("Select Waypoint #@1", i).."]"
48 n = n + 2
3849 end
3950
4051 local i = waypoints.selected or 1
4152 local waypoint = waypoints[i] or {}
4253 local temp = waypoints_temp[player_name][i] or {}
43 local default_name = string.format(S("Waypoint %d"), i)
54 local default_name = S("Waypoint @1", i)
4455
4556 -- Main buttons:
46 formspec = formspec ..
47 "image_button[4.5,3.7;.8,.8;"..
48 "ui_waypoint_set_icon.png;"..
49 "set_waypoint"..i..";]"..
50 "tooltip[set_waypoint" .. i .. ";"
51 .. F(S("Set waypoint to current location")).."]"
52
53 formspec = formspec ..
54 "image_button[5.2,3.7;.8,.8;"..
55 (waypoint.active and "ui_on_icon.png" or "ui_off_icon.png")..";"..
56 "toggle_waypoint"..i..";]"..
57 "tooltip[toggle_waypoint" .. i .. ";"
58 .. F(S("Make waypoint @1",
59 waypoint.active and S("invisible") or S("visible"))).."]"
60
61 formspec = formspec ..
62 "image_button[5.9,3.7;.8,.8;"..
63 (waypoint.display_pos and "ui_green_icon_background.png" or "ui_red_icon_background.png").."^ui_xyz_icon.png;"..
64 "toggle_display_pos" .. i .. ";]"..
65 "tooltip[toggle_display_pos" .. i .. ";"
66 .. F(S("@1 display of waypoint coordinates",
67 waypoint.display_pos and S("Disable") or S("Enable"))) .."]"
68
69 formspec = formspec ..
70 "image_button[6.6,3.7;.8,.8;"..
71 "ui_circular_arrows_icon.png;"..
72 "toggle_color"..i..";]"..
73 "tooltip[toggle_color" .. i .. ";"
74 .. F(S("Change color of waypoint display")).."]"
75
76 formspec = formspec ..
77 "image_button[7.3,3.7;.8,.8;"..
78 "ui_pencil_icon.png;"..
79 "rename_waypoint"..i..";]"..
80 "tooltip[rename_waypoint" .. i .. ";"
81 .. F(S("Edit waypoint name")).."]"
57 local btnlist = {
58 { "ui_waypoint_set_icon.png", "set_waypoint", S("Set waypoint to current location") },
59 { waypoint.active and "ui_on_icon.png" or "ui_off_icon.png", "toggle_waypoint", S("Make waypoint @1", waypoint.active and "invisible" or "visible") },
60 { waypoint.display_pos and "ui_green_icon_background.png^ui_xyz_icon.png" or "ui_red_icon_background.png^ui_xyz_icon.png^(ui_no.png^[transformR90)", "toggle_display_pos", S("@1 display of waypoint coordinates", waypoint.display_pos and "Disable" or "Enable") },
61 { "ui_circular_arrows_icon.png", "toggle_color", S("Change color of waypoint display") },
62 { "ui_pencil_icon.png", "rename_waypoint", S("Edit waypoint name") }
63 }
64
65 local x = 4
66 for _, b in pairs(btnlist) do
67 formspec[n] = string.format("image_button[%f,%f;%f,%f;%s;%s%i;]",
68 wp_buttons_rj - ui.style_full.btn_spc * x, wp_bottom_row,
69 ui.style_full.btn_size, ui.style_full.btn_size,
70 b[1], b[2], i)
71 formspec[n+1] = "tooltip["..b[2]..i..";"..F(b[3]).."]"
72 x = x - 1
73 n = n + 2
74 end
8275
8376 -- Waypoint's info:
77 formspec[n] = "label["..wp_info_x..","..(wp_info_y+1.1)..";"
8478 if waypoint.active then
85 formspec = formspec .. "label[1,0.8;"..F(S("Waypoint active")).."]"
79 formspec[n+1] = F(S("Waypoint active")).."]"
8680 else
87 formspec = formspec .. "label[1,0.8;"..F(S("Waypoint inactive")).."]"
88 end
81 formspec[n+1] = F(S("Waypoint inactive")).."]"
82 end
83 n = n + 2
8984
9085 if temp.edit then
91 formspec = formspec ..
92 "field[1.3,3.2;6,.8;rename_box" .. i .. ";;"
93 ..(waypoint.name or default_name).."]" ..
94 "image_button[7.3,2.9;.8,.8;"..
95 "ui_ok_icon.png;"..
96 "confirm_rename"..i.. ";]"..
97 "tooltip[confirm_rename" .. i .. ";"
98 .. F(S("Finish editing")).."]"
99 end
100
101 formspec = formspec .. "label[1,1.3;"..F(S("World position"))..": " ..
102 minetest.pos_to_string(waypoint.world_pos or vector.new()) .. "]" ..
103 "label[1,1.8;"..F(S("Name"))..": ".. (waypoint.name or default_name) .. "]" ..
104 "label[1,2.3;"..F(S("HUD text color"))..": " ..
105 hud_colors[waypoint.color or 1][3] .. "]"
106
107 return {formspec=formspec}
86 formspec[n] = string.format("field[%f,%f;%f,%f;rename_box%i;;%s]",
87 wp_buttons_rj - wp_edit_w - 0.1, wp_bottom_row - ui.style_full.btn_spc,
88 wp_edit_w, ui.style_full.btn_size, i, (waypoint.name or default_name))
89 formspec[n+1] = string.format("image_button[%f,%f;%f,%f;ui_ok_icon.png;confirm_rename%i;]",
90 wp_buttons_rj, wp_bottom_row - ui.style_full.btn_spc,
91 ui.style_full.btn_size, ui.style_full.btn_size, i)
92 formspec[n+2] = "tooltip[confirm_rename"..i..";"..F(S("Finish editing")).."]"
93 n = n + 3
94 end
95
96 formspec[n] = string.format("label[%f,%f;%s: %s]",
97 wp_info_x, wp_info_y+1.6, F(S("World position")),
98 minetest.pos_to_string(waypoint.world_pos or vector.new()))
99 formspec[n+1] = string.format("label[%f,%f;%s: %s]",
100 wp_info_x, wp_info_y+2.10, F(S("Name")), (waypoint.name or default_name))
101 formspec[n+2] = string.format("label[%f,%f;%s: %s]",
102 wp_info_x, wp_info_y+2.60, F(S("HUD text color")), hud_colors[waypoint.color or 1][3])
103
104 return {formspec=table.concat(formspec)}
108105 end,
109106 })
110107
111 unified_inventory.register_button("waypoints", {
108 ui.register_button("waypoints", {
112109 type = "image",
113110 image = "ui_waypoints_icon.png",
114111 tooltip = S("Waypoints"),
173170
174171 if fields["set_waypoint"..i] then
175172 hit = true
176 local pos = player:getpos()
173 local pos = player:get_pos()
177174 pos.x = math.floor(pos.x)
178175 pos.y = math.floor(pos.y)
179176 pos.z = math.floor(pos.z)
223220 update_hud(player, waypoints, temp, i)
224221 end
225222 if update_formspec then
226 unified_inventory.set_inventory_formspec(player, "waypoints")
223 ui.set_inventory_formspec(player, "waypoints")
227224 end
228225 if hit then return end
229226 end