Import upstream version 20180810+git20210824.1.3fffa41
Debian Janitor
2 years ago
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) | |
2 | 5 | |
3 | 6 | 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. | |
5 | 7 | |
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 and refill slot for creative | |
18 | * Waypoints to keep track of important locations | |
19 | * Lite mode: reduces the item browser width | |
20 | * `minetest.conf` setting `unified_inventory_lite = true` | |
21 | * Mod API for modders: see [mod_api.txt](doc/mod_api.txt) | |
22 | * Setting-determinated features: see [settingtypes.txt](settingtypes.txt) | |
23 | ||
24 | ||
25 | ## Requirements | |
26 | ||
27 | * Minetest 5.4.0+ | |
28 | * Mod `default` for category filters (contained in Minetest Game) | |
29 | * Mod `farming` for craftable bags (contained in Minetest Game) | |
30 | * For waypoint migration: `datastorage` | |
31 | ||
32 | ||
33 | # Licenses | |
8 | 34 | |
9 | 35 | Copyright (C) 2012-2014 Maciej Kasatkin (RealBadAngel) |
10 | 36 | |
11 | Unified inventory code is licensed under the GNU LGPLv2+. | |
37 | Copyright (C) 2012-? Various minetest-mods contributors | |
12 | 38 | |
13 | Licenses for textures: | |
39 | ||
40 | ## Code | |
41 | ||
42 | GNU LGPLv2+, see [license notice](LICENSE.txt) | |
43 | ||
44 | ||
45 | ## Textures | |
14 | 46 | |
15 | 47 | VanessaE: (CC-BY-4.0) |
48 | ||
16 | 49 | * `ui_group.png` |
17 | 50 | |
18 | 51 | Tango Project: (Public Domain, CC-BY-4.0) |
52 | ||
19 | 53 | * [`ui_reset_icon.png`](https://commons.wikimedia.org/wiki/File:Edit-clear.svg) |
20 | 54 | * [`ui_doubleleft_icon.png`](http://commons.wikimedia.org/wiki/File:Media-seek-backward.svg) |
21 | 55 | * [`ui_doubleright_icon.png`](http://commons.wikimedia.org/wiki/File:Media-seek-forward.svg) |
24 | 58 | * [`ui_skip_forward_icon.png`](http://commons.wikimedia.org/wiki/File:Media-skip-forward.svg) |
25 | 59 | |
26 | 60 | From http://www.clker.com (Public Domain, CC-BY-4.0): |
61 | ||
27 | 62 | * [`bags_small.png`](http://www.clker.com/clipart-moneybag-empty.html) |
28 | 63 | * [`bags_medium.png`](http://www.clker.com/clipart-backpack-1.html) |
29 | 64 | * [`bags_large.png` / `ui_bags_icon.png`](http://www.clker.com/clipart-backpack-green-brown.html) |
36 | 71 | * [`ui_waypoint_set_icon.png`](http://www.clker.com/clipart-larger-flag.html) |
37 | 72 | |
38 | 73 | Everaldo Coelho (YellowIcon) (LGPL v2.1+): |
74 | ||
39 | 75 | * [`ui_craftguide_icon.png` / `ui_craft_icon.png`](http://commons.wikimedia.org/wiki/File:Advancedsettings.png) |
40 | 76 | |
41 | 77 | Gregory H. Revera: (CC-BY-SA 3.0) |
78 | ||
42 | 79 | * [`ui_moon_icon.png`](http://commons.wikimedia.org/wiki/File:FullMoon2010.jpg) |
43 | 80 | |
44 | 81 | Thomas Bresson: (CC-BY 3.0) |
82 | ||
45 | 83 | * [`ui_sun_icon.png`](http://commons.wikimedia.org/wiki/File:2012-10-13_15-29-35-sun.jpg) |
46 | 84 | |
47 | 85 | Fibonacci: (Public domain, CC-BY 4.0) |
86 | ||
48 | 87 | * [`ui_xyz_off_icon.png`](http://commons.wikimedia.org/wiki/File:No_sign.svg) |
49 | 88 | |
50 | 89 | Gregory Maxwell: (Public domain, CC-BY 4.0) |
90 | ||
51 | 91 | * [`ui_ok_icon.png`](http://commons.wikimedia.org/wiki/File:Yes_check.svg) |
52 | 92 | |
53 | 93 | Adrien Facélina: (LGPL v2.1+) |
94 | ||
54 | 95 | * [`inventory_plus_worldedit_gui.png`](http://commons.wikimedia.org/wiki/File:Erioll_world_2.svg) |
55 | 96 | |
56 | 97 | Other files from Wikimedia Commons: |
98 | ||
57 | 99 | * [`ui_gohome_icon.png` / `ui_home_icon.png` / `ui_sethome_icon.png`](http://commons.wikimedia.org/wiki/File:Home_256x256.png) (GPL v2+) |
58 | 100 | |
59 | 101 | RealBadAngel: (CC-BY-4.0) |
60 | * Everything else.⏎ | |
102 | ||
103 | * Everything else. |
0 | local S = unified_inventory.gettext | |
0 | local S = minetest.get_translator("unified_inventory") | |
1 | 1 | local F = minetest.formspec_escape |
2 | local ui = unified_inventory | |
2 | 3 | |
3 | 4 | -- Create detached creative inventory after loading all mods |
4 | 5 | minetest.after(0.01, function() |
7 | 8 | if not rev_aliases[target] then rev_aliases[target] = {} end |
8 | 9 | table.insert(rev_aliases[target], source) |
9 | 10 | end |
10 | unified_inventory.items_list = {} | |
11 | ui.items_list = {} | |
11 | 12 | for name, def in pairs(minetest.registered_items) do |
12 | 13 | if (not def.groups.not_in_creative_inventory or |
13 | 14 | def.groups.not_in_creative_inventory == 0) and |
14 | 15 | def.description and def.description ~= "" then |
15 | table.insert(unified_inventory.items_list, name) | |
16 | table.insert(ui.items_list, name) | |
16 | 17 | local all_names = rev_aliases[name] or {} |
17 | 18 | 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) | |
20 | 21 | if recipes then |
21 | 22 | for _, recipe in ipairs(recipes) do |
22 | 23 | |
25 | 26 | for _,chk in pairs(recipe.items) do |
26 | 27 | local groupchk = string.find(chk, "group:") |
27 | 28 | 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) | |
29 | 30 | or minetest.get_item_group(chk, "not_in_craft_guide") ~= 0 then |
30 | 31 | unknowns = true |
31 | 32 | end |
32 | 33 | end |
33 | 34 | |
34 | 35 | if not unknowns then |
35 | unified_inventory.register_craft(recipe) | |
36 | ui.register_craft(recipe) | |
36 | 37 | end |
37 | 38 | end |
38 | 39 | end |
39 | 40 | end |
40 | 41 | end |
41 | 42 | 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 | |
46 | 47 | local def = minetest.registered_items[name] |
47 | 48 | -- Simple drops |
48 | 49 | if type(def.drop) == "string" then |
49 | 50 | local dstack = ItemStack(def.drop) |
50 | 51 | if not dstack:is_empty() and dstack:get_name() ~= name then |
51 | unified_inventory.register_craft({ | |
52 | ui.register_craft({ | |
52 | 53 | type = "digging", |
53 | 54 | items = {name}, |
54 | 55 | output = def.drop, |
114 | 115 | end |
115 | 116 | end |
116 | 117 | for itemstring, count in pairs(drop_guaranteed) do |
117 | unified_inventory.register_craft({ | |
118 | ui.register_craft({ | |
118 | 119 | type = "digging", |
119 | 120 | items = {name}, |
120 | 121 | output = itemstring .. " " .. count, |
122 | 123 | }) |
123 | 124 | end |
124 | 125 | for itemstring, count in pairs(drop_maybe) do |
125 | unified_inventory.register_craft({ | |
126 | ui.register_craft({ | |
126 | 127 | type = "digging_chance", |
127 | 128 | items = {name}, |
128 | 129 | output = itemstring .. " " .. count, |
131 | 132 | end |
132 | 133 | end |
133 | 134 | end |
134 | for _, recipes in pairs(unified_inventory.crafts_for.recipe) do | |
135 | for _, recipes in pairs(ui.crafts_for.recipe) do | |
135 | 136 | for _, recipe in ipairs(recipes) do |
136 | 137 | local ingredient_items = {} |
137 | 138 | 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 | |
140 | 141 | if matches_spec(name) then |
141 | 142 | ingredient_items[name] = true |
142 | 143 | end |
143 | 144 | end |
144 | 145 | end |
145 | 146 | 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] = {} | |
148 | 149 | end |
149 | table.insert(unified_inventory.crafts_for.usage[name], recipe) | |
150 | table.insert(ui.crafts_for.usage[name], recipe) | |
150 | 151 | end |
151 | 152 | end |
152 | 153 | end |
155 | 156 | |
156 | 157 | -- load_home |
157 | 158 | local function load_home() |
158 | local input = io.open(unified_inventory.home_filename, "r") | |
159 | local input = io.open(ui.home_filename, "r") | |
159 | 160 | if not input then |
160 | unified_inventory.home_pos = {} | |
161 | ui.home_pos = {} | |
161 | 162 | return |
162 | 163 | end |
163 | 164 | while true do |
166 | 167 | local y = input:read("*n") |
167 | 168 | local z = input:read("*n") |
168 | 169 | 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} | |
170 | 171 | end |
171 | 172 | io.close(input) |
172 | 173 | end |
173 | 174 | load_home() |
174 | 175 | |
175 | function unified_inventory.set_home(player, pos) | |
176 | function ui.set_home(player, pos) | |
176 | 177 | 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 | ||
178 | 180 | -- 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 | |
181 | 188 | output:write(v.x.." "..v.y.." "..v.z.." "..k.."\n") |
182 | 189 | end |
183 | 190 | io.close(output) |
184 | 191 | end |
185 | 192 | |
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()] | |
188 | 195 | if pos then |
189 | player:setpos(pos) | |
190 | end | |
196 | player:set_pos(pos) | |
197 | return true | |
198 | end | |
199 | return false | |
191 | 200 | end |
192 | 201 | |
193 | 202 | -- register_craft |
194 | function unified_inventory.register_craft(options) | |
203 | function ui.register_craft(options) | |
195 | 204 | if not options.output then |
196 | 205 | return |
197 | 206 | end |
202 | 211 | if options.type == "normal" and options.width == 0 then |
203 | 212 | options = { type = "shapeless", items = options.items, output = options.output, width = 0 } |
204 | 213 | 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) | |
209 | 218 | end |
210 | 219 | |
211 | 220 | |
216 | 225 | } |
217 | 226 | |
218 | 227 | |
219 | function unified_inventory.craft_type_defaults(name, options) | |
228 | function ui.craft_type_defaults(name, options) | |
220 | 229 | if not options.description then |
221 | 230 | options.description = name |
222 | 231 | end |
225 | 234 | end |
226 | 235 | |
227 | 236 | |
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", { | |
235 | 244 | description = F(S("Crafting")), |
236 | 245 | icon = "ui_craftgrid_icon.png", |
237 | 246 | width = 3, |
247 | 256 | }) |
248 | 257 | |
249 | 258 | |
250 | unified_inventory.register_craft_type("shapeless", { | |
259 | ui.register_craft_type("shapeless", { | |
251 | 260 | description = F(S("Mixing")), |
252 | 261 | icon = "ui_craftgrid_icon.png", |
253 | 262 | width = 3, |
262 | 271 | }) |
263 | 272 | |
264 | 273 | |
265 | unified_inventory.register_craft_type("cooking", { | |
274 | ui.register_craft_type("cooking", { | |
266 | 275 | description = F(S("Cooking")), |
267 | 276 | icon = "default_furnace_front.png", |
268 | 277 | width = 1, |
270 | 279 | }) |
271 | 280 | |
272 | 281 | |
273 | unified_inventory.register_craft_type("digging", { | |
282 | ui.register_craft_type("digging", { | |
274 | 283 | description = F(S("Digging")), |
275 | 284 | icon = "default_tool_steelpick.png", |
276 | 285 | width = 1, |
277 | 286 | height = 1, |
278 | 287 | }) |
279 | 288 | |
280 | unified_inventory.register_craft_type("digging_chance", { | |
289 | ui.register_craft_type("digging_chance", { | |
281 | 290 | description = "Digging (by chance)", |
282 | 291 | icon = "default_tool_steelpick.png^[transformFY.png", |
283 | 292 | width = 1, |
284 | 293 | height = 1, |
285 | 294 | }) |
286 | 295 | |
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) | |
293 | 302 | if not def.action then |
294 | 303 | def.action = function(player) |
295 | unified_inventory.set_inventory_formspec(player, name) | |
304 | ui.set_inventory_formspec(player, name) | |
296 | 305 | end |
297 | 306 | end |
298 | 307 | 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) | |
304 | 312 | return minetest.check_player_privs(playername, {creative=true}) |
305 | 313 | or minetest.settings:get_bool("creative_mode") |
306 | 314 | end |
307 | 315 | |
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") | |
6 | 8 | local F = minetest.formspec_escape |
7 | ||
8 | unified_inventory.register_page("bags", { | |
9 | local ui = unified_inventory | |
10 | ||
11 | ui.register_page("bags", { | |
9 | 12 | get_formspec = function(player) |
10 | 13 | 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 | }) } | |
23 | 31 | end, |
24 | 32 | }) |
25 | 33 | |
26 | unified_inventory.register_button("bags", { | |
34 | ui.register_button("bags", { | |
27 | 35 | type = "image", |
28 | 36 | image = "ui_bags_icon.png", |
29 | 37 | tooltip = S("Bags"), |
37 | 45 | }):get_stack("bag" .. i, 1) |
38 | 46 | end |
39 | 47 | |
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, { | |
43 | 50 | get_formspec = function(player) |
44 | local stack = get_player_bag_stack(player, bi) | |
51 | local stack = get_player_bag_stack(player, bag_i) | |
45 | 52 | 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]") | |
52 | 53 | 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 | ||
60 | 68 | 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 | |
64 | 74 | end |
65 | 75 | local inv = player:get_inventory() |
66 | 76 | for i = 1, 4 do |
67 | 77 | local def = get_player_bag_stack(player, i):get_definition() |
68 | local button | |
69 | 78 | if def.groups.bagslots then |
70 | local list_name = "bag"..i.."contents" | |
79 | local list_name = "bag" .. i .. "contents" | |
71 | 80 | local size = inv:get_size(list_name) |
72 | 81 | local used = 0 |
73 | 82 | for si = 1, size do |
77 | 86 | end |
78 | 87 | end |
79 | 88 | 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 | |
84 | 93 | end |
85 | formspec = formspec..button | |
86 | end | |
87 | return {formspec=formspec} | |
94 | end | |
95 | return { formspec = table.concat(formspec) } | |
88 | 96 | end, |
89 | 97 | }) |
90 | 98 | end |
94 | 102 | return |
95 | 103 | end |
96 | 104 | for i = 1, 4 do |
97 | if fields["bag"..i] then | |
105 | if fields["bag" .. i] then | |
98 | 106 | local stack = get_player_bag_stack(player, i) |
99 | 107 | if not stack:get_definition().groups.bagslots then |
100 | 108 | return |
101 | 109 | end |
102 | unified_inventory.set_inventory_formspec(player, "bag"..i) | |
110 | ui.set_inventory_formspec(player, "bag" .. i) | |
103 | 111 | return |
104 | 112 | end |
105 | 113 | end |
109 | 117 | local is_empty = true |
110 | 118 | local bags = {} |
111 | 119 | for i = 1, 4 do |
112 | local bag = "bag"..i | |
120 | local bag = "bag" .. i | |
113 | 121 | if not bags_inv:is_empty(bag) then |
114 | 122 | -- Stack limit is 1, otherwise use stack:to_string() |
115 | 123 | bags[i] = bags_inv:get_stack(bag, 1):get_name() |
116 | 124 | is_empty = false |
117 | 125 | end |
118 | 126 | end |
127 | local meta = player:get_meta() | |
119 | 128 | if is_empty then |
120 | player:set_attribute("unified_inventory:bags", nil) | |
129 | meta:set_string("unified_inventory:bags", nil) | |
121 | 130 | else |
122 | player:set_attribute("unified_inventory:bags", | |
131 | meta:set_string("unified_inventory:bags", | |
123 | 132 | minetest.serialize(bags)) |
124 | 133 | end |
125 | 134 | end |
126 | 135 | |
127 | 136 | local function load_bags_metadata(player, bags_inv) |
128 | 137 | 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") | |
130 | 140 | local bags = bags_meta and minetest.deserialize(bags_meta) or {} |
131 | 141 | local dirty_meta = false |
132 | 142 | if not bags_meta then |
133 | 143 | -- Backwards compatiblity |
134 | 144 | for i = 1, 4 do |
135 | local bag = "bag"..i | |
145 | local bag = "bag" .. i | |
136 | 146 | if not player_inv:is_empty(bag) then |
137 | 147 | -- Stack limit is 1, otherwise use stack:to_string() |
138 | 148 | bags[i] = player_inv:get_stack(bag, 1):get_name() |
142 | 152 | end |
143 | 153 | -- Fill detached slots |
144 | 154 | for i = 1, 4 do |
145 | local bag = "bag"..i | |
155 | local bag = "bag" .. i | |
146 | 156 | bags_inv:set_size(bag, 1) |
147 | 157 | bags_inv:set_stack(bag, 1, bags[i] or "") |
148 | 158 | end |
154 | 164 | |
155 | 165 | -- Clean up deprecated garbage after saving |
156 | 166 | for i = 1, 4 do |
157 | local bag = "bag"..i | |
167 | local bag = "bag" .. i | |
158 | 168 | player_inv:set_size(bag, 0) |
159 | 169 | end |
160 | 170 | end |
161 | 171 | |
162 | 172 | minetest.register_on_joinplayer(function(player) |
163 | local player_inv = player:get_inventory() | |
164 | 173 | 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",{ | |
166 | 175 | on_put = function(inv, listname, index, stack, player) |
167 | player:get_inventory():set_size(listname.."contents", | |
176 | player:get_inventory():set_size(listname .. "contents", | |
168 | 177 | stack:get_definition().groups.bagslots) |
169 | 178 | save_bags_metadata(player, inv) |
170 | 179 | end, |
174 | 183 | return 0 |
175 | 184 | end |
176 | 185 | 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") | |
178 | 187 | |
179 | 188 | if new_slots >= old_slots then |
180 | 189 | return 1 |
181 | 190 | end |
182 | 191 | |
183 | 192 | -- 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") | |
185 | 194 | local new_list = {} |
186 | 195 | local slots_used = 0 |
187 | 196 | local use_new_list = false |
195 | 204 | end |
196 | 205 | if new_slots >= slots_used then |
197 | 206 | if use_new_list then |
198 | player_inv:set_list(listname.."contents", new_list) | |
207 | player_inv:set_list(listname .. "contents", new_list) | |
199 | 208 | end |
200 | 209 | return 1 |
201 | 210 | end |
203 | 212 | return 0 |
204 | 213 | end, |
205 | 214 | 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 | |
207 | 216 | return stack:get_count() |
208 | 217 | end |
209 | 218 | return 0 |
210 | 219 | end, |
211 | 220 | 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) | |
213 | 222 | save_bags_metadata(player, inv) |
214 | 223 | end, |
215 | 224 | allow_move = function() |
244 | 253 | minetest.register_craft({ |
245 | 254 | output = "unified_inventory:bag_small", |
246 | 255 | recipe = { |
247 | {"", "farming:cotton", ""}, | |
256 | {"", "farming:string", ""}, | |
248 | 257 | {"group:wool", "group:wool", "group:wool"}, |
249 | 258 | {"group:wool", "group:wool", "group:wool"}, |
250 | 259 | }, |
254 | 263 | output = "unified_inventory:bag_medium", |
255 | 264 | recipe = { |
256 | 265 | {"", "", ""}, |
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"}, | |
259 | 268 | }, |
260 | 269 | }) |
261 | 270 | |
263 | 272 | output = "unified_inventory:bag_large", |
264 | 273 | recipe = { |
265 | 274 | {"", "", ""}, |
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"}, | |
268 | 277 | }, |
269 | 278 | }) |
270 | 279 | end |
18 | 18 | unified_inventory.active_search_direction[player_name] = "nochange" |
19 | 19 | unified_inventory.apply_filter(player, "", "nochange") |
20 | 20 | unified_inventory.current_searchbox[player_name] = "" |
21 | unified_inventory.current_category[player_name] = "all" | |
22 | unified_inventory.current_category_scroll[player_name] = 0 | |
21 | 23 | unified_inventory.alternate[player_name] = 1 |
22 | 24 | unified_inventory.current_item[player_name] = nil |
23 | 25 | unified_inventory.current_craft_direction[player_name] = "recipe" |
27 | 29 | -- Refill slot |
28 | 30 | local refill = minetest.create_detached_inventory(player_name.."refill", { |
29 | 31 | allow_put = function(inv, listname, index, stack, player) |
30 | local player_name = player:get_player_name() | |
31 | 32 | if unified_inventory.is_creative(player_name) then |
32 | 33 | return stack:get_count() |
33 | 34 | else |
35 | 36 | end |
36 | 37 | end, |
37 | 38 | on_put = function(inv, listname, index, stack, player) |
38 | local player_name = player:get_player_name() | |
39 | 39 | local handle_refill = (minetest.registered_items[stack:get_name()] or {}).on_refill or default_refill |
40 | 40 | stack = handle_refill(stack) |
41 | 41 | inv:set_stack(listname, index, stack) |
46 | 46 | refill:set_size("main", 1) |
47 | 47 | end) |
48 | 48 | |
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 | ||
49 | 58 | minetest.register_on_player_receive_fields(function(player, formname, fields) |
50 | 59 | local player_name = player:get_player_name() |
51 | 60 | |
59 | 68 | if fields.searchbox |
60 | 69 | and fields.searchbox ~= unified_inventory.current_searchbox[player_name] then |
61 | 70 | 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 | |
63 | 106 | end |
64 | 107 | |
65 | 108 | for i, def in pairs(unified_inventory.buttons) do |
111 | 154 | unified_inventory.current_page[player_name]) |
112 | 155 | end |
113 | 156 | |
157 | -- Check clicked item image button | |
114 | 158 | local clicked_item |
115 | 159 | 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 | |
118 | 162 | clicked_item = unified_inventory.demangle_for_formspec(mangled_item) |
119 | 163 | 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) | |
125 | 167 | return |
126 | 168 | end |
127 | if new_dir == "recipe" | |
128 | or new_dir == "usage" then | |
169 | if new_dir == "recipe" or new_dir == "usage" then | |
129 | 170 | unified_inventory.current_craft_direction[player_name] = new_dir |
130 | 171 | end |
131 | 172 | break |
144 | 185 | unified_inventory.alternate[player_name] = 1 |
145 | 186 | unified_inventory.set_inventory_formspec(player, "craftguide") |
146 | 187 | elseif player_creative then |
188 | -- Creative page: Add entire stack to inventory | |
147 | 189 | local inv = player:get_inventory() |
148 | 190 | local stack = ItemStack(clicked_item) |
149 | 191 | stack:set_count(stack:get_stack_max()) |
161 | 203 | minetest.sound_play("paperflip2", |
162 | 204 | {to_player=player_name, gain = 1.0}) |
163 | 205 | 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") | |
170 | 207 | end |
171 | 208 | |
172 | 209 | -- 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 = "unknown_item.png", | |
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 | config = config or {} | |
84 | if config.symbol then | |
85 | unified_inventory.set_category_symbol(category_name, config.symbol) | |
86 | end | |
87 | if config.label then | |
88 | unified_inventory.set_category_label(category_name, config.label) | |
89 | end | |
90 | if config.index then | |
91 | unified_inventory.set_category_index(category_name, config.index) | |
92 | end | |
93 | if config.items then | |
94 | unified_inventory.add_category_items(category_name, config.items) | |
95 | end | |
96 | update_category_list() | |
97 | end | |
98 | function unified_inventory.set_category_symbol(category_name, symbol) | |
99 | ensure_category_exists(category_name) | |
100 | unified_inventory.registered_categories[category_name].symbol = symbol | |
101 | update_category_list() | |
102 | end | |
103 | function unified_inventory.set_category_label(category_name, label) | |
104 | ensure_category_exists(category_name) | |
105 | unified_inventory.registered_categories[category_name].label = label | |
106 | update_category_list() | |
107 | end | |
108 | function unified_inventory.set_category_index(category_name, index) | |
109 | ensure_category_exists(category_name) | |
110 | unified_inventory.registered_categories[category_name].index = index | |
111 | update_category_list() | |
112 | end | |
113 | function unified_inventory.add_category_item(category_name, item) | |
114 | ensure_category_exists(category_name) | |
115 | unified_inventory.registered_category_items[category_name][item] = true | |
116 | end | |
117 | function unified_inventory.add_category_items(category_name, items) | |
118 | for _,item in ipairs(items) do | |
119 | unified_inventory.add_category_item(category_name, item) | |
120 | end | |
121 | end | |
122 | ||
123 | function unified_inventory.remove_category_item(category_name, item) | |
124 | unified_inventory.registered_category_items[category_name][item] = nil | |
125 | end | |
126 | function unified_inventory.remove_category(category_name) | |
127 | unified_inventory.registered_categories[category_name] = nil | |
128 | unified_inventory.registered_category_items[category_name] = nil | |
129 | update_category_list() | |
130 | end | |
131 | ||
132 | function unified_inventory.find_category(item) | |
133 | -- Returns the first category the item exists in | |
134 | -- Best for checking if an item has any category at all | |
135 | for category, items in pairs(unified_inventory.registered_category_items) do | |
136 | if items[item] then return category end | |
137 | end | |
138 | end | |
139 | function unified_inventory.find_categories(item) | |
140 | -- Returns all the categories the item exists in | |
141 | -- Best for listing all categories | |
142 | local categories = {} | |
143 | for category, items in pairs(unified_inventory.registered_category_items) do | |
144 | if items[item] then | |
145 | table.insert(categories, category) | |
146 | end | |
147 | end | |
148 | return categories | |
149 | 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 | 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") | |
1 | 1 | |
2 | 2 | function unified_inventory.canonical_item_spec_matcher(spec) |
3 | 3 | 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 | |
6 | 5 | 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 | |
12 | 16 | end |
13 | return true | |
14 | 17 | end |
15 | else | |
16 | return function (itemname) return itemname == specname end | |
18 | return true | |
17 | 19 | end |
18 | 20 | end |
19 | 21 | |
24 | 26 | |
25 | 27 | function unified_inventory.extract_groupnames(groupname) |
26 | 28 | 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 | |
42 | 30 | return nil, 0 |
43 | 31 | end |
32 | local group_names = specname:sub(7):split(",") | |
33 | return table.concat(group_names, S(" and ")), #group_names | |
44 | 34 | end |
45 | 35 | |
46 | 36 | unified_inventory.registered_group_items = { |
0 | -- Unified Inventory for Minetest >= 0.4.16 | |
0 | -- Unified Inventory | |
1 | 1 | |
2 | 2 | local modpath = minetest.get_modpath(minetest.get_current_modname()) |
3 | 3 | local worldpath = minetest.get_worldpath() |
4 | ||
5 | -- Intllib | |
6 | local S, NS = dofile(modpath .. "/intllib.lua") | |
7 | 4 | |
8 | 5 | -- Data tables definitions |
9 | 6 | unified_inventory = { |
12 | 9 | alternate = {}, |
13 | 10 | current_page = {}, |
14 | 11 | current_searchbox = {}, |
12 | current_category = {}, | |
13 | current_category_scroll = {}, | |
15 | 14 | current_index = {}, |
16 | 15 | current_item = {}, |
17 | 16 | current_craft_direction = {}, |
32 | 31 | -- Default inventory page |
33 | 32 | default = "craft", |
34 | 33 | |
35 | -- intllib | |
36 | gettext = S, | |
37 | ||
38 | 34 | -- "Lite" mode |
39 | 35 | lite_mode = minetest.settings:get_bool("unified_inventory_lite"), |
40 | 36 | |
37 | -- Items automatically added to categories based on item definitions | |
38 | automatic_categorization = (minetest.settings:get_bool("unified_inventory_automatic_categorization") ~= false), | |
39 | ||
41 | 40 | -- Trash enabled |
42 | 41 | 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]", | |
43 | 45 | |
46 | version = 3 | |
47 | } | |
48 | ||
49 | local ui = unified_inventory | |
50 | ||
51 | -- These tables establish position and layout for the two UI styles. | |
52 | -- UI doesn't use formspec_[xy] anymore, but other mods may need them. | |
53 | ||
54 | ui.style_full = { | |
55 | formspec_x = 1, | |
56 | formspec_y = 1, | |
57 | formw = 17.75, | |
58 | formh = 12.25, | |
44 | 59 | 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 | |
60 | pagerows = 9, | |
61 | page_x = 10.75, | |
62 | page_y = 2.30, | |
63 | craft_x = 2.8, | |
64 | craft_y = 1.15, | |
65 | craftresult_x = 7.8, | |
66 | craft_arrow_x = 6.55, | |
67 | craft_guide_x = 3.3, | |
68 | craft_guide_y = 1.15, | |
69 | craft_guide_arrow_x = 7.05, | |
70 | craft_guide_result_x = 8.3, | |
71 | craft_guide_resultstr_x = 0.3, | |
72 | craft_guide_resultstr_y = 0.6, | |
73 | give_btn_x = 0.25, | |
74 | main_button_x = 0.4, | |
75 | main_button_y = 11.0, | |
76 | page_buttons_x = 11.60, | |
77 | page_buttons_y = 10.15, | |
78 | searchwidth = 3.4, | |
79 | form_header_x = 0.4, | |
80 | form_header_y = 0.4, | |
81 | btn_spc = 0.85, | |
82 | btn_size = 0.75, | |
83 | std_inv_x = 0.3, | |
84 | std_inv_y = 5.75, | |
53 | 85 | } |
86 | ||
87 | ui.style_lite = { | |
88 | formspec_x = 0.6, | |
89 | formspec_y = 0.6, | |
90 | formw = 14, | |
91 | formh = 9.75, | |
92 | pagecols = 4, | |
93 | pagerows = 5, | |
94 | page_x = 10.5, | |
95 | page_y = 2.15, | |
96 | craft_x = 2.6, | |
97 | craft_y = 0.75, | |
98 | craftresult_x = 5.75, | |
99 | craft_arrow_x = 6.35, | |
100 | craft_guide_x = 3.1, | |
101 | craft_guide_y = 0.75, | |
102 | craft_guide_arrow_x = 7.05, | |
103 | craft_guide_result_x = 8.3, | |
104 | craft_guide_resultstr_x = 0.15, | |
105 | craft_guide_resultstr_y = 0.35, | |
106 | give_btn_x = 0.15, | |
107 | main_button_x = 10.5, | |
108 | main_button_y = 8.15, | |
109 | page_buttons_x = 10.5, | |
110 | page_buttons_y = 6.15, | |
111 | searchwidth = 1.6, | |
112 | form_header_x = 0.2, | |
113 | form_header_y = 0.2, | |
114 | btn_spc = 0.8, | |
115 | btn_size = 0.7, | |
116 | std_inv_x = 0.1, | |
117 | std_inv_y = 4.6, | |
118 | } | |
119 | ||
120 | dofile(modpath.."/api.lua") | |
121 | ||
122 | for _, style in ipairs({ui.style_full, ui.style_lite}) do | |
123 | style.items_per_page = style.pagecols * style.pagerows | |
124 | style.standard_inv = string.format("list[current_player;main;%f,%f;8,4;]", | |
125 | style.std_inv_x + ui.list_img_offset, style.std_inv_y + ui.list_img_offset) | |
126 | ||
127 | style.standard_inv_bg = ui.make_inv_img_grid(style.std_inv_x, style.std_inv_y, 8, 1, true).. | |
128 | ui.make_inv_img_grid(style.std_inv_x, style.std_inv_y + ui.imgscale, 8, 3) | |
129 | ||
130 | style.craft_grid = table.concat({ | |
131 | ui.make_inv_img_grid(style.craft_x, style.craft_y, 3, 3), | |
132 | ui.single_slot(style.craft_x + ui.imgscale*4, style.craft_y), -- the craft result slot | |
133 | string.format("image[%f,%f;%f,%f;ui_crafting_arrow.png]", | |
134 | style.craft_arrow_x, style.craft_y, ui.imgscale, ui.imgscale), | |
135 | string.format("list[current_player;craft;%f,%f;3,3;]", | |
136 | style.craft_x + ui.list_img_offset, style.craft_y + ui.list_img_offset), | |
137 | string.format("list[current_player;craftpreview;%f,%f;1,1;]", | |
138 | style.craftresult_x + ui.list_img_offset, style.craft_y + ui.list_img_offset) | |
139 | }) | |
140 | end | |
54 | 141 | |
55 | 142 | -- Disable default creative inventory |
56 | 143 | local creative = rawget(_G, "creative") or rawget(_G, "creative_inventory") |
67 | 154 | end |
68 | 155 | |
69 | 156 | dofile(modpath.."/group.lua") |
70 | dofile(modpath.."/api.lua") | |
157 | dofile(modpath.."/category.lua") | |
158 | dofile(modpath.."/default-categories.lua") | |
71 | 159 | dofile(modpath.."/internal.lua") |
72 | 160 | dofile(modpath.."/callbacks.lua") |
161 | dofile(modpath.."/match_craft.lua") | |
73 | 162 | dofile(modpath.."/register.lua") |
74 | 163 | |
75 | 164 | if minetest.settings:get_bool("unified_inventory_bags") ~= false then |
77 | 166 | end |
78 | 167 | |
79 | 168 | dofile(modpath.."/item_names.lua") |
80 | ||
81 | if minetest.get_modpath("datastorage") then | |
82 | dofile(modpath.."/waypoints.lua") | |
83 | end | |
169 | dofile(modpath.."/waypoints.lua") |
0 | local S = unified_inventory.gettext | |
0 | local S = minetest.get_translator("unified_inventory") | |
1 | 1 | local F = minetest.formspec_escape |
2 | local ui = unified_inventory | |
2 | 3 | |
3 | 4 | -- This pair of encoding functions is used where variable text must go in |
4 | 5 | -- button names, where the text might contain formspec metacharacters. |
8 | 9 | -- This is a game engine bug, and in the anticipation that it might be |
9 | 10 | -- fixed some day we don't want to rely on it. So for safety we apply |
10 | 11 | -- an encoding that avoids all formspec metacharacters. |
11 | function unified_inventory.mangle_for_formspec(str) | |
12 | ||
13 | function ui.mangle_for_formspec(str) | |
12 | 14 | return string.gsub(str, "([^A-Za-z0-9])", function (c) return string.format("_%d_", string.byte(c)) end) |
13 | 15 | end |
14 | function unified_inventory.demangle_for_formspec(str) | |
16 | function ui.demangle_for_formspec(str) | |
15 | 17 | return string.gsub(str, "_([0-9]+)_", function (v) return string.char(v) end) |
16 | 18 | end |
17 | 19 | |
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 | local style = table.copy(draw_lite_mode and ui.style_lite or ui.style_full) | |
25 | style.is_lite_mode = draw_lite_mode | |
26 | return style | |
27 | end | |
28 | ||
29 | local function formspec_button(ui_peruser, name, image, offset, pos, scale, label) | |
30 | local element = 'image_button' | |
31 | if minetest.registered_items[image] then | |
32 | element = 'item_image_button' | |
33 | elseif image:find(":", 1, true) then | |
34 | image = "unknown_item.png" | |
35 | end | |
36 | local spc = (1-scale)*ui_peruser.btn_size/2 | |
37 | local size = ui_peruser.btn_size*scale | |
38 | return string.format("%s[%f,%f;%f,%f;%s;%s;]", element, | |
39 | (offset.x or offset[1]) + ( ui_peruser.btn_spc * (pos.x or pos[1]) ) + spc, | |
40 | (offset.y or offset[2]) + ( ui_peruser.btn_spc * (pos.y or pos[2]) ) + spc, | |
41 | size, size, image, name) .. | |
42 | string.format("tooltip[%s;%s]", name, F(label or name)) | |
43 | end | |
44 | ||
45 | local function formspec_add_filters(player, formspec, style) | |
46 | local button_row = 0 | |
47 | local button_col = 0 | |
48 | local n = #formspec + 1 | |
49 | ||
50 | -- Main buttons | |
51 | ||
52 | local filtered_inv_buttons = {} | |
53 | ||
54 | for i, def in pairs(ui.buttons) do | |
55 | if not (style.is_lite_mode and def.hide_lite) then | |
56 | table.insert(filtered_inv_buttons, def) | |
57 | end | |
58 | end | |
59 | ||
60 | for i, def in pairs(filtered_inv_buttons) do | |
61 | if style.is_lite_mode and i > 4 then | |
62 | button_row = 1 | |
63 | button_col = 1 | |
64 | end | |
65 | ||
66 | if def.type == "image" then | |
67 | local pos_x = style.main_button_x + style.btn_spc * (i - 1) - button_col * style.btn_spc * 4 | |
68 | local pos_y = style.main_button_y + button_row * style.btn_spc | |
69 | if (def.condition == nil or def.condition(player) == true) then | |
70 | formspec[n] = string.format("image_button[%f,%f;%f,%f;%s;%s;]", | |
71 | pos_x, pos_y, style.btn_size, style.btn_size, | |
72 | F(def.image), | |
73 | F(def.name)) | |
74 | formspec[n+1] = "tooltip["..F(def.name)..";"..(def.tooltip or "").."]" | |
75 | n = n+2 | |
76 | else | |
77 | formspec[n] = string.format("image[%f,%f;%f,%f;%s^[colorize:#808080:alpha]", | |
78 | pos_x, pos_y, style.btn_size, style.btn_size, | |
79 | def.image) | |
80 | n = n+1 | |
81 | end | |
82 | end | |
83 | end | |
84 | end | |
85 | ||
86 | local function formspec_add_categories(player, formspec, ui_peruser) | |
87 | local player_name = player:get_player_name() | |
88 | local n = #formspec + 1 | |
89 | ||
90 | local categories_pos = { | |
91 | ui_peruser.page_x, | |
92 | ui_peruser.page_y-ui_peruser.btn_spc-0.5 | |
93 | } | |
94 | local categories_scroll_pos = { | |
95 | ui_peruser.page_x, | |
96 | ui_peruser.form_header_y - (ui_peruser.is_lite_mode and 0 or 0.2) | |
97 | } | |
98 | ||
99 | formspec[n] = string.format("background9[%f,%f;%f,%f;%s;false;3]", | |
100 | ui_peruser.page_x-0.1, categories_scroll_pos[2], | |
101 | (ui_peruser.btn_spc * ui_peruser.pagecols) + 0.13, 1.4 + (ui_peruser.is_lite_mode and 0 or 0.2), | |
102 | "ui_smallbg_9_sliced.png") | |
103 | n = n + 1 | |
104 | ||
105 | formspec[n] = string.format("label[%f,%f;%s]", | |
106 | ui_peruser.page_x, | |
107 | ui_peruser.form_header_y + (ui_peruser.is_lite_mode and 0.3 or 0.2), F(S("Category:"))) | |
108 | n = n + 1 | |
109 | ||
110 | local scroll_offset = 0 | |
111 | local category_count = #ui.category_list | |
112 | if category_count > ui_peruser.pagecols then | |
113 | scroll_offset = ui.current_category_scroll[player_name] | |
114 | end | |
115 | ||
116 | for index, category in ipairs(ui.category_list) do | |
117 | local column = index - scroll_offset | |
118 | if column > 0 and column <= ui_peruser.pagecols then | |
119 | local scale = 0.8 | |
120 | if ui.current_category[player_name] == category.name then | |
121 | scale = 1 | |
122 | end | |
123 | formspec[n] = formspec_button(ui_peruser, "category_"..category.name, category.symbol, categories_pos, {column-1, 0}, scale, category.label) | |
124 | n = n + 1 | |
125 | end | |
126 | end | |
127 | if category_count > ui_peruser.pagecols and scroll_offset > 0 then | |
128 | -- prev | |
129 | 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")) | |
130 | n = n + 1 | |
131 | end | |
132 | if category_count > ui_peruser.pagecols and category_count - scroll_offset > ui_peruser.pagecols then | |
133 | -- next | |
134 | 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")) | |
135 | end | |
136 | end | |
137 | ||
138 | local function formspec_add_search_box(player, formspec, ui_peruser) | |
139 | local player_name = player:get_player_name() | |
140 | local n = #formspec + 1 | |
141 | ||
142 | formspec[n] = "field_close_on_enter[searchbox;false]" | |
143 | ||
144 | formspec[n+1] = string.format("field[%f,%f;%f,%f;searchbox;;%s]", | |
145 | ui_peruser.page_buttons_x, ui_peruser.page_buttons_y, | |
146 | ui_peruser.searchwidth - 0.1, ui_peruser.btn_size, | |
147 | F(ui.current_searchbox[player_name])) | |
148 | formspec[n+2] = string.format("image_button[%f,%f;%f,%f;ui_search_icon.png;searchbutton;]", | |
149 | ui_peruser.page_buttons_x + ui_peruser.searchwidth, ui_peruser.page_buttons_y, | |
150 | ui_peruser.btn_size,ui_peruser.btn_size) | |
151 | formspec[n+3] = "tooltip[searchbutton;" ..F(S("Search")) .. "]" | |
152 | formspec[n+4] = string.format("image_button[%f,%f;%f,%f;ui_reset_icon.png;searchresetbutton;]", | |
153 | ui_peruser.page_buttons_x + ui_peruser.searchwidth + ui_peruser.btn_spc, | |
154 | ui_peruser.page_buttons_y, | |
155 | ui_peruser.btn_size, ui_peruser.btn_size) | |
156 | formspec[n+5] = "tooltip[searchresetbutton;"..F(S("Reset search and display everything")).."]" | |
157 | ||
158 | if ui.activefilter[player_name] ~= "" then | |
159 | formspec[n+6] = string.format("label[%f,%f;%s: %s]", | |
160 | ui_peruser.page_x, ui_peruser.page_y - 0.25, | |
161 | F(S("Filter")), F(ui.activefilter[player_name])) | |
162 | end | |
163 | end | |
164 | ||
165 | local function formspec_add_item_browser(player, formspec, ui_peruser) | |
166 | local player_name = player:get_player_name() | |
167 | local n = #formspec + 1 | |
168 | ||
169 | -- Controls to flip items pages | |
170 | ||
171 | local btnlist = { | |
172 | { "ui_skip_backward_icon.png", "start_list", S("First page") }, | |
173 | { "ui_doubleleft_icon.png", "rewind3", S("Back three pages") }, | |
174 | { "ui_left_icon.png", "rewind1", S("Back one page") }, | |
175 | { "ui_right_icon.png", "forward1", S("Forward one page") }, | |
176 | { "ui_doubleright_icon.png", "forward3", S("Forward three pages") }, | |
177 | { "ui_skip_forward_icon.png", "end_list", S("Last page") }, | |
178 | } | |
179 | ||
180 | if ui_peruser.is_lite_mode then | |
181 | btnlist[2] = nil | |
182 | btnlist[5] = nil | |
183 | end | |
184 | ||
185 | local bn = 0 | |
186 | for _, b in pairs(btnlist) do | |
187 | formspec[n] = string.format("image_button[%f,%f;%f,%f;%s;%s;]", | |
188 | ui_peruser.page_buttons_x + ui_peruser.btn_spc*bn, | |
189 | ui_peruser.page_buttons_y + ui_peruser.btn_spc, | |
190 | ui_peruser.btn_size, ui_peruser.btn_size, | |
191 | b[1],b[2]) | |
192 | formspec[n+1] = "tooltip["..b[2]..";"..F(b[3]).."]" | |
193 | bn = bn + 1 | |
194 | n = n + 2 | |
195 | end | |
196 | ||
197 | -- Items list | |
198 | if #ui.filtered_items_list[player_name] == 0 then | |
199 | local no_matches = S("No matching items") | |
200 | if ui_peruser.is_lite_mode then | |
201 | no_matches = S("No matches.") | |
202 | end | |
203 | ||
204 | formspec[n] = "label["..ui_peruser.page_x..","..(ui_peruser.page_y+0.15)..";" .. F(no_matches) .. "]" | |
205 | return | |
206 | end | |
207 | ||
208 | local dir = ui.active_search_direction[player_name] | |
209 | local list_index = ui.current_index[player_name] | |
210 | local page2 = math.floor(list_index / (ui_peruser.items_per_page) + 1) | |
211 | local pagemax = math.floor( | |
212 | (#ui.filtered_items_list[player_name] - 1) | |
213 | / (ui_peruser.items_per_page) + 1) | |
214 | for y = 0, ui_peruser.pagerows - 1 do | |
215 | for x = 0, ui_peruser.pagecols - 1 do | |
216 | local name = ui.filtered_items_list[player_name][list_index] | |
217 | local item = minetest.registered_items[name] | |
218 | if item then | |
219 | -- Clicked on current item: Flip crafting direction | |
220 | if name == ui.current_item[player_name] then | |
221 | local cdir = ui.current_craft_direction[player_name] | |
222 | if cdir == "recipe" then | |
223 | dir = "usage" | |
224 | elseif cdir == "usage" then | |
225 | dir = "recipe" | |
226 | end | |
227 | else | |
228 | -- Default: use active search direction by default | |
229 | dir = ui.active_search_direction[player_name] | |
230 | end | |
231 | ||
232 | local button_name = "item_button_" .. dir .. "_" | |
233 | .. ui.mangle_for_formspec(name) | |
234 | formspec[n] = ("item_image_button[%f,%f;%f,%f;%s;%s;]"):format( | |
235 | ui_peruser.page_x + x * ui_peruser.btn_spc, | |
236 | ui_peruser.page_y + y * ui_peruser.btn_spc, | |
237 | ui_peruser.btn_size, ui_peruser.btn_size, | |
238 | name, button_name | |
239 | ) | |
240 | formspec[n + 1] = ("tooltip[%s;%s \\[%s\\]]"):format( | |
241 | button_name, minetest.formspec_escape(item.description), | |
242 | item.mod_origin or "??" | |
243 | ) | |
244 | n = n + 2 | |
245 | list_index = list_index + 1 | |
246 | end | |
247 | end | |
248 | end | |
249 | formspec[n] = string.format("label[%f,%f;%s: %s]", | |
250 | ui_peruser.page_buttons_x + ui_peruser.btn_spc * (ui_peruser.is_lite_mode and 1 or 2), | |
251 | ui_peruser.page_buttons_y + 0.1 + ui_peruser.btn_spc * 2, | |
252 | F(S("Page")), S("@1 of @2",page2,pagemax)) | |
253 | end | |
254 | ||
255 | function ui.get_formspec(player, page) | |
49 | 256 | |
50 | 257 | if not player then |
51 | 258 | return "" |
52 | 259 | end |
53 | 260 | |
54 | 261 | 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] | |
59 | ||
60 | local formspec = { | |
61 | "size[14,10]", | |
62 | "background[-0.19,-0.25;14.4,10.75;ui_form_bg.png]" -- Background | |
262 | local ui_peruser = ui.get_per_player_formspec(player_name) | |
263 | ||
264 | ui.current_page[player_name] = page | |
265 | local pagedef = ui.pages[page] | |
266 | ||
267 | if not pagedef then | |
268 | return "" -- Invalid page name | |
269 | end | |
270 | ||
271 | local fs = { | |
272 | "formspec_version[4]", | |
273 | "size["..ui_peruser.formw..","..ui_peruser.formh.."]", | |
274 | pagedef.formspec_prepend and "" or "no_prepend[]", | |
275 | ui.standard_background | |
63 | 276 | } |
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) | |
277 | ||
278 | local perplayer_formspec = ui.get_per_player_formspec(player_name) | |
83 | 279 | local fsdata = pagedef.get_formspec(player, perplayer_formspec) |
84 | 280 | |
85 | formspec[n] = fsdata.formspec | |
86 | n = n+1 | |
87 | ||
88 | local button_row = 0 | |
89 | local button_col = 0 | |
90 | ||
91 | -- Main buttons | |
92 | ||
93 | local filtered_inv_buttons = {} | |
94 | ||
95 | for i, def in pairs(unified_inventory.buttons) do | |
96 | if not (draw_lite_mode and def.hide_lite) then | |
97 | table.insert(filtered_inv_buttons, def) | |
98 | end | |
99 | end | |
100 | ||
101 | for i, def in pairs(filtered_inv_buttons) do | |
102 | ||
103 | if draw_lite_mode and i > 4 then | |
104 | button_row = 1 | |
105 | button_col = 1 | |
106 | end | |
107 | ||
108 | if def.type == "image" then | |
109 | 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 | |
118 | 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 | ||
125 | end | |
126 | end | |
127 | end | |
281 | fs[#fs + 1] = fsdata.formspec | |
282 | ||
283 | formspec_add_filters(player, fs, ui_peruser) | |
128 | 284 | |
129 | 285 | if fsdata.draw_inventory ~= false then |
130 | 286 | -- Player inventory |
131 | formspec[n] = "listcolors[#00000000;#00000000]" | |
132 | formspec[n+1] = "list[current_player;main;0,"..(ui_peruser.formspec_y + 3.5)..";8,4;]" | |
133 | n = n+2 | |
287 | fs[#fs + 1] = "listcolors[#00000000;#00000000]" | |
288 | fs[#fs + 1] = ui_peruser.standard_inv | |
134 | 289 | end |
135 | 290 | |
136 | 291 | if fsdata.draw_item_list == false then |
137 | return table.concat(formspec, "") | |
138 | end | |
139 | ||
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 | |
182 | ||
183 | -- Search box | |
184 | 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 | |
205 | ||
206 | local no_matches = S("No matching items") | |
207 | if draw_lite_mode then | |
208 | no_matches = S("No matches.") | |
209 | end | |
210 | ||
211 | -- 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) .. "]" | |
214 | 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) | |
218 | local pagemax = math.floor( | |
219 | (#unified_inventory.filtered_items_list[player_name] - 1) | |
220 | / (ui_peruser.items_per_page) + 1) | |
221 | local item = {} | |
222 | for y = 0, ui_peruser.pagerows - 1 do | |
223 | 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 | |
226 | -- 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] | |
229 | if cdir == "recipe" then | |
230 | dir = "usage" | |
231 | elseif cdir == "usage" then | |
232 | dir = "recipe" | |
233 | end | |
234 | else | |
235 | -- Default: use active search direction by default | |
236 | dir = unified_inventory.active_search_direction[player_name] | |
237 | 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 | list_index = list_index + 1 | |
245 | end | |
246 | end | |
247 | end | |
248 | formspec[n] = "label[8.2,"..ui_peruser.form_header_y..";"..F(S("Page")) .. ": " | |
249 | .. S("%s of %s"):format(page,pagemax).."]" | |
250 | end | |
251 | n= n+1 | |
252 | ||
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]).."]" | |
256 | end | |
257 | return table.concat(formspec, "") | |
258 | end | |
259 | ||
260 | function unified_inventory.set_inventory_formspec(player, page) | |
292 | return table.concat(fs, "") | |
293 | end | |
294 | ||
295 | formspec_add_categories(player, fs, ui_peruser) | |
296 | formspec_add_search_box(player, fs, ui_peruser) | |
297 | formspec_add_item_browser(player, fs, ui_peruser) | |
298 | ||
299 | return table.concat(fs) | |
300 | end | |
301 | ||
302 | function ui.set_inventory_formspec(player, page) | |
261 | 303 | if player then |
262 | player:set_inventory_formspec(unified_inventory.get_formspec(player, page)) | |
263 | end | |
304 | player:set_inventory_formspec(ui.get_formspec(player, page)) | |
305 | end | |
306 | end | |
307 | ||
308 | local function valid_def(def) | |
309 | return (not def.groups.not_in_creative_inventory | |
310 | or def.groups.not_in_creative_inventory == 0) | |
311 | and def.description | |
312 | and def.description ~= "" | |
264 | 313 | end |
265 | 314 | |
266 | 315 | --apply filter to the inventory list (create filtered copy of full one) |
267 | function unified_inventory.apply_filter(player, filter, search_dir) | |
316 | function ui.apply_filter(player, filter, search_dir) | |
268 | 317 | if not player then |
269 | 318 | return false |
270 | 319 | end |
283 | 332 | return true |
284 | 333 | end |
285 | 334 | else |
335 | local lang = minetest.get_player_information(player_name).lang_code | |
286 | 336 | ffilter = function(name, def) |
287 | 337 | local lname = string.lower(name) |
288 | 338 | local ldesc = string.lower(def.description) |
339 | local llocaldesc = minetest.get_translated_string | |
340 | and string.lower(minetest.get_translated_string(lang, def.description)) | |
289 | 341 | 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) | |
314 | local items = {} | |
315 | for name, item in pairs(minetest.registered_items) do | |
316 | for _, group in pairs(groups:split(',')) do | |
317 | if item.groups[group] then | |
318 | table.insert(items, name) | |
319 | end | |
320 | end | |
321 | end | |
322 | return items | |
323 | end | |
324 | ||
325 | function unified_inventory.sort_inventory(inv) | |
326 | local inlist = inv:get_list("main") | |
327 | local typecnt = {} | |
328 | local typekeys = {} | |
329 | for _, st in ipairs(inlist) do | |
330 | if not st:is_empty() then | |
331 | local n = st:get_name() | |
332 | local w = st:get_wear() | |
333 | local m = st:get_metadata() | |
334 | local k = string.format("%s %05d %s", n, w, m) | |
335 | if not typecnt[k] then | |
336 | typecnt[k] = { | |
337 | name = n, | |
338 | wear = w, | |
339 | metadata = m, | |
340 | stack_max = st:get_stack_max(), | |
341 | count = 0, | |
342 | } | |
343 | table.insert(typekeys, k) | |
344 | end | |
345 | typecnt[k].count = typecnt[k].count + st:get_count() | |
346 | end | |
347 | end | |
348 | table.sort(typekeys) | |
349 | local outlist = {} | |
350 | for _, k in ipairs(typekeys) do | |
351 | local tc = typecnt[k] | |
352 | while tc.count > 0 do | |
353 | local c = math.min(tc.count, tc.stack_max) | |
354 | table.insert(outlist, ItemStack({ | |
355 | name = tc.name, | |
356 | wear = tc.wear, | |
357 | metadata = tc.metadata, | |
358 | count = c, | |
359 | })) | |
360 | tc.count = tc.count - c | |
361 | end | |
362 | end | |
363 | if #outlist > #inlist then return end | |
364 | while #outlist < #inlist do | |
365 | table.insert(outlist, ItemStack(nil)) | |
366 | end | |
367 | inv:set_list("main", outlist) | |
368 | end | |
342 | or llocaldesc and string.find(llocaldesc, lfilter, 1, true) | |
343 | end | |
344 | end | |
345 | ui.filtered_items_list[player_name]={} | |
346 | local category = ui.current_category[player_name] or 'all' | |
347 | if category == 'all' then | |
348 | for name, def in pairs(minetest.registered_items) do | |
349 | if valid_def(def) | |
350 | and ffilter(name, def) then | |
351 | table.insert(ui.filtered_items_list[player_name], name) | |
352 | end | |
353 | end | |
354 | elseif category == 'uncategorized' then | |
355 | for name, def in pairs(minetest.registered_items) do | |
356 | if (not ui.find_category(name)) | |
357 | and valid_def(def) | |
358 | and ffilter(name, def) then | |
359 | table.insert(ui.filtered_items_list[player_name], name) | |
360 | end | |
361 | end | |
362 | else | |
363 | for name,exists in pairs(ui.registered_category_items[category]) do | |
364 | local def = minetest.registered_items[name] | |
365 | if exists and def | |
366 | and valid_def(def) | |
367 | and ffilter(name, def) then | |
368 | table.insert(ui.filtered_items_list[player_name], name) | |
369 | end | |
370 | end | |
371 | end | |
372 | table.sort(ui.filtered_items_list[player_name]) | |
373 | ui.filtered_items_list_size[player_name] = #ui.filtered_items_list[player_name] | |
374 | ui.current_index[player_name] = 1 | |
375 | ui.activefilter[player_name] = filter | |
376 | ui.active_search_direction[player_name] = search_dir | |
377 | ui.set_inventory_formspec(player, | |
378 | ui.current_page[player_name]) | |
379 | end |
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 |
0 | 0 | -- Based on 4itemnames mod by 4aiman |
1 | 1 | |
2 | local item_names = {} -- [player_name] = { hud, dtime, itemname } | |
2 | local item_names = {} -- [player_name] = { hud, dtime, itemname } | |
3 | 3 | 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") | |
6 | 4 | local hudbars_mod = minetest.get_modpath("hudbars") |
7 | 5 | |
8 | 6 | local function set_hud(player) |
9 | 7 | 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 | |
15 | 14 | end |
15 | ||
16 | 16 | item_names[player_name] = { |
17 | 17 | hud = player:hud_add({ |
18 | 18 | hud_elem_type = "text", |
19 | 19 | position = {x=0.5, y=1}, |
20 | 20 | offset = off, |
21 | alignment = {x=0, y=0}, | |
21 | alignment = {x=0, y=-1}, | |
22 | 22 | number = 0xFFFFFF, |
23 | 23 | text = "", |
24 | 24 | }), |
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 | # 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 | # 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 | # 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 | # 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 | # 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 | # textdomain: unified_inventory | |
1 | Mixing= | |
2 | Cooking= | |
3 | Digging= | |
4 | Bags= | |
5 | Bag @1= | |
6 | Small Bag= | |
7 | Medium Bag= | |
8 | Large Bag= | |
9 | All Items= | |
10 | Misc. Items= | |
11 | Plant Life= | |
12 | Building Materials= | |
13 | Tools= | |
14 | Minerals and Metals= | |
15 | Environment and Worldgen= | |
16 | Lighting= | |
17 | and = | |
18 | Scroll categories left= | |
19 | Scroll categories right= | |
20 | Search= | |
21 | Reset search and display everything= | |
22 | First page= | |
23 | Back three pages= | |
24 | Back one page= | |
25 | Forward one page= | |
26 | Forward three pages= | |
27 | Last page= | |
28 | No matching items= | |
29 | No matches.= | |
30 | Page= | |
31 | @1 of @2= | |
32 | Filter= | |
33 | Can use the creative inventory= | |
34 | Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally= | |
35 | Crafting Grid= | |
36 | Crafting Guide= | |
37 | Set home position= | |
38 | Home position set to: @1= | |
39 | You don't have the "home" privilege!= | |
40 | Go home= | |
41 | Set time to day= | |
42 | Time of day set to 6am= | |
43 | You don't have the settime privilege!= | |
44 | Set time to night= | |
45 | Time of day set to 9pm= | |
46 | Clear inventory= | |
47 | This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.= | |
48 | Inventory cleared!= | |
49 | Trash:= | |
50 | Refill:= | |
51 | Any item belonging to the @1 group= | |
52 | Any item belonging to the groups @1= | |
53 | Recipe @1 of @2= | |
54 | Usage @1 of @2= | |
55 | No recipes= | |
56 | No usages= | |
57 | Result= | |
58 | Ingredient= | |
59 | Show next recipe= | |
60 | Show next usage= | |
61 | Show previous recipe= | |
62 | Show previous usage= | |
63 | @1 (@2)= | |
64 | Give me:= | |
65 | This recipe is too@@large to be displayed.= | |
66 | To craft grid:= | |
67 | All= | |
68 | Crafting= | |
69 | White= | |
70 | Yellow= | |
71 | Red= | |
72 | Green= | |
73 | Blue= | |
74 | Waypoints= | |
75 | Select Waypoint #@1= | |
76 | Waypoint @1= | |
77 | Set waypoint to current location= | |
78 | Hide waypoint= | |
79 | Show waypoint= | |
80 | Hide coordinates= | |
81 | Show coordinates= | |
82 | Change color of waypoint display= | |
83 | Edit waypoint name= | |
84 | Waypoint active= | |
85 | Waypoint inactive= | |
86 | Finish editing= | |
87 | World position= | |
88 | Name= | |
89 | HUD text color= |
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 | Mixing=Mischen | |
2 | Cooking=Kochen | |
3 | Digging=Graben | |
4 | Bags=Taschen | |
5 | Bag @1=Tasche @1 | |
6 | Small Bag=Kleine Tasche | |
7 | Medium Bag=Mittelgroße Tasche | |
8 | Large Bag=Große Tasche | |
9 | All Items= | |
10 | Misc. Items= | |
11 | Plant Life= | |
12 | Building Materials= | |
13 | Tools= | |
14 | Minerals and Metals= | |
15 | Environment and Worldgen= | |
16 | Lighting= | |
17 | and = und | |
18 | Scroll categories left= | |
19 | Scroll categories right= | |
20 | Search=Suchen | |
21 | Reset search and display everything=Suche zurücksetzen und alles anzeigen | |
22 | First page=Erste Seite | |
23 | Back three pages=3 Seiten zurückblättern | |
24 | Back one page=1 Seite zurückblättern | |
25 | Forward one page=1 Seite vorblättern | |
26 | Forward three pages=3 Seiten vorblättern | |
27 | Last page=Letzte Seite | |
28 | No matching items=Keine passenden Gegenstände | |
29 | No matches.=Keine Treffer | |
30 | Page=Seite | |
31 | @1 of @2=@1 von @2 | |
32 | Filter=Filter | |
33 | Can use the creative inventory=Kann das Kreativinventar nutzen | |
34 | 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 | |
35 | Crafting Grid=Fertigungsraster | |
36 | Crafting Guide=Fertigungsführer | |
37 | Set home position=Heimatposition setzen | |
38 | Home position set to: @1=Heimatposition nach @1 gesetzt | |
39 | You don't have the "home" privilege!=Du hast das „home“-Privileg nicht! | |
40 | Go home=Nach Hause gehen | |
41 | Set time to day=Zur Tageszeit wechseln | |
42 | Time of day set to 6am=Tageszeit auf 6 Uhr gesetzt | |
43 | You don't have the settime privilege!=Du hast das „settime“-Privileg nicht! | |
44 | Set time to night=Zur Nachtzeit wechseln | |
45 | Time of day set to 9pm=Tageszeit auf 21 Uhr gesetzt | |
46 | Clear inventory=Inventar leeren | |
47 | This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.= | |
48 | Inventory cleared!=Inventar geleert! | |
49 | Trash:=Müll: | |
50 | Refill:=Nachfüllen: | |
51 | Any item belonging to the @1 group=Irgendein Gegenstand, der zur Gruppe @1 gehört | |
52 | Any item belonging to the groups @1=Irgendein Gegenstand, der zu den Gruppen @1 gehört | |
53 | Recipe @1 of @2=Rezept @1 von @2 | |
54 | Usage @1 of @2=Verwendung @1 von @2 | |
55 | No recipes=Keine Rezepte | |
56 | No usages=Keine Verwendungen | |
57 | Result=Ergebnis | |
58 | Ingredient=Zutat | |
59 | Show next recipe=Nächstes Rezept zeigen | |
60 | Show next usage=Nächste Verwendung zeigen | |
61 | Show previous recipe=Vorheriges Rezept zeigen | |
62 | Show previous usage=Vorherige Verwendung zeigen | |
63 | @1 (@2)= | |
64 | Give me:=Gib mir: | |
65 | This recipe is too@@large to be displayed.= | |
66 | To craft grid:=Ins Fertigungsraster: | |
67 | All=Alles | |
68 | Crafting=Fertigung | |
69 | White=Weiß | |
70 | Yellow=Gelb | |
71 | Red=Rot | |
72 | Green=Grün | |
73 | Blue=Blau | |
74 | Waypoints=Wegpunkte | |
75 | Select Waypoint #@1=Wegpunkt Nr. @1 auswählen | |
76 | Waypoint @1=Wegpunkt Nr. @1 | |
77 | Set waypoint to current location=Setze Wegpunkt zur derzeitigen Position | |
78 | Hide waypoint= | |
79 | Show waypoint= | |
80 | Hide coordinates= | |
81 | Show coordinates= | |
82 | Change color of waypoint display=Farbe der Darstellung der Wegpunkte ändern | |
83 | Edit waypoint name=Name des Wegpunkts ändern | |
84 | Waypoint active=Wegpunkt aktiv | |
85 | Waypoint inactive=Wegpunkt inaktiv | |
86 | Finish editing=Bearbeitung abschließen | |
87 | World position=Weltposition | |
88 | Name=Name | |
89 | HUD text color=HUD-Textfarbe | |
90 | ||
91 | ||
92 | ##### not used anymore ##### | |
93 | ||
94 | invisible=unsichtbar | |
95 | visible=sichtbar | |
96 | Make waypoint @1=Wegpunkt @1 machen | |
97 | Disable=ausschalten | |
98 | Enable=einschalten | |
99 | @1 display of waypoint coordinates=Anzeige der Wegpunktkoordinaten @1 |
0 | # textdomain: unified_inventory | |
1 | # api.lua | |
2 | Mixing=Mezclar | |
3 | Cooking=Hornear | |
4 | Digging=Recoger | |
5 | # bags.lua | |
6 | Bags=Bolsos | |
7 | Bag @1=Bolso @1 | |
8 | Small Bag=Bolso Pequeño | |
9 | Medium Bag=Bolso Mediano | |
10 | Large Bag=Bolso Grande | |
11 | All Items= | |
12 | Misc. Items= | |
13 | Plant Life= | |
14 | Building Materials= | |
15 | Tools= | |
16 | Minerals and Metals= | |
17 | Environment and Worldgen= | |
18 | Lighting= | |
19 | # group.lua | |
20 | and = y | |
21 | Scroll categories left= | |
22 | Scroll categories right= | |
23 | Search=Buscar | |
24 | Reset search and display everything=Limpiar la busqueda y mostrar todo | |
25 | # internal.lua | |
26 | First page=Primera página | |
27 | Back three pages=Volver tres páginas | |
28 | Back one page=Volver una página | |
29 | Forward one page=Avanzar una página | |
30 | Forward three pages=Avanzar tres páginas | |
31 | Last page=Ultima Pagina | |
32 | No matching items=No se encontraron elementos | |
33 | No matches.=No hay resultados. | |
34 | Page=Página | |
35 | @1 of @2=@1 de @2 | |
36 | Filter=Filtro | |
37 | # register.lua | |
38 | Can use the creative inventory=Puede usar el inventario creativo | |
39 | 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 | |
40 | Crafting Grid=Cuadricula de Elaboración | |
41 | Crafting Guide=Guía de Elaboración | |
42 | Set home position=Establecer posición de la casa | |
43 | Home position set to: @1=Posición de la casa cambiada a: @1 | |
44 | You don't have the "home" privilege!= | |
45 | Go home=Ir a casa | |
46 | Set time to day=Cambiar a dia | |
47 | Time of day set to 6am=Hora del día cambiada a 6 AM | |
48 | You don't have the settime privilege!=¡No tienes el privilegio "settime"! | |
49 | Set time to night=Cambiar a noche | |
50 | Time of day set to 9pm=Hora del día cambiada a 9 PM | |
51 | Clear inventory=Limpiar inventario | |
52 | This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.= | |
53 | Inventory cleared!=¡Inventario limpio! | |
54 | Trash:=Basura: | |
55 | Refill:=Rellenar: | |
56 | Any item belonging to the @1 group=Cualquier elemento que pertenezca al grupo @1 | |
57 | Any item belonging to the groups @1=Cualquier elemento perteneciente a los grupos @1 | |
58 | Recipe @1 of @2=Receta @1 de @2 | |
59 | Usage @1 of @2=Uso @1 de @2 | |
60 | No recipes=No tiene receta | |
61 | No usages=No tiene uso | |
62 | Result=Resultado | |
63 | Ingredient=Ingrediente | |
64 | Show next recipe=Mostrar la siguiente receta | |
65 | Show next usage=Mostrar el siguiente uso | |
66 | Show previous recipe=Mostrar la receta anterior | |
67 | Show previous usage=Mostrar el uso anterior | |
68 | @1 (@2)=@1 (@2) | |
69 | Give me:=Dame: | |
70 | This recipe is too@@large to be displayed.= | |
71 | To craft grid:=Construir: | |
72 | All=Todos | |
73 | Crafting=Elaboración | |
74 | White=Blanco | |
75 | Yellow=Amarillo | |
76 | Red=Rojo | |
77 | Green=Verde | |
78 | Blue=Azul | |
79 | Waypoints=Puntos | |
80 | Select Waypoint #@1=Seleccionar Punto #@1 | |
81 | Waypoint @1=Punto @1 | |
82 | Set waypoint to current location=Establecer el punto a la ubicación actual | |
83 | Hide waypoint= | |
84 | Show waypoint= | |
85 | Hide coordinates= | |
86 | Show coordinates= | |
87 | Change color of waypoint display=Cambiar el color del punto | |
88 | Edit waypoint name=Editar nombre del punto | |
89 | Waypoint active=Punto activo | |
90 | Waypoint inactive=Punto inactivo | |
91 | Finish editing=Terminar edición | |
92 | World position=Posición en el mundo | |
93 | Name=Nombre | |
94 | HUD text color=Color del texto de la Interfaz | |
95 | ||
96 | ||
97 | ##### not used anymore ##### | |
98 | ||
99 | Make waypoint @1=Hacer punto @1 | |
100 | invisible=invisible | |
101 | visible=visible | |
102 | @1 display of waypoint coordinates=Visualizar coordenadas del punto @1 | |
103 | Disable=Deshabilitado | |
104 | Enable=Habilitado | |
105 | You don't have the \"home\" privilege!=¡No tienes el privilegio \"home\"! | |
106 | This button has been disabled outside=Este botón ha sido deshabilitado | |
107 | This recipe is too@nlarge to be displayed.=Esta receta es demasiado@ngrande para ser mostrada. |
0 | # textdomain: unified_inventory | |
1 | Mixing= | |
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 | All Items= | |
10 | Misc. Items= | |
11 | Plant Life= | |
12 | Building Materials= | |
13 | Tools= | |
14 | Minerals and Metals= | |
15 | Environment and Worldgen= | |
16 | Lighting= | |
17 | and = et | |
18 | Scroll categories left= | |
19 | Scroll categories right= | |
20 | Search=Rechercher | |
21 | Reset search and display everything= | |
22 | First page=1ère page | |
23 | Back three pages=3 pages en arrière | |
24 | Back one page=Page précédente | |
25 | Forward one page=Page suivante | |
26 | Forward three pages=3 pages en avant | |
27 | Last page=Dernière page | |
28 | No matching items=Aucun élément correspondant | |
29 | No matches.=Aucun match | |
30 | Page=Page | |
31 | @1 of @2=@1 de @2 | |
32 | Filter=Filtre | |
33 | Can use the creative inventory=Vous pouvez utiliser l'inventaire créatif | |
34 | Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally= | |
35 | Crafting Grid=Grille de création | |
36 | Crafting Guide=Guide de création | |
37 | Set home position=Position dans le monde | |
38 | Home position set to: @1=Position de votre base fixée à: @1 | |
39 | You don't have the "home" privilege!=Vous n'avez pas le privilège "home"! | |
40 | Go home= | |
41 | Set time to day= | |
42 | Time of day set to 6am=Heure fixée à 6h | |
43 | You don't have the settime privilege!=Vous n'avez pas le privilège "settime"! | |
44 | Set time to night= | |
45 | Time of day set to 9pm=Heure fixée à 21h | |
46 | Clear inventory= | |
47 | This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.= | |
48 | Inventory cleared!=Inventaire vidé ! | |
49 | Trash:=Poubelle : | |
50 | Refill:=Remplir : | |
51 | Any item belonging to the @1 group= | |
52 | Any item belonging to the groups @1= | |
53 | Recipe @1 of @2=Recette @1 de @2 | |
54 | Usage @1 of @2= | |
55 | No recipes= | |
56 | No usages= | |
57 | Result=Résultat | |
58 | Ingredient= | |
59 | Show next recipe= | |
60 | Show next usage= | |
61 | Show previous recipe= | |
62 | Show previous usage= | |
63 | @1 (@2)= | |
64 | Give me:= | |
65 | This recipe is too@@large to be displayed.= | |
66 | To craft grid:=Sur de création: | |
67 | All=Tout | |
68 | Crafting=Création | |
69 | White=Blanc | |
70 | Yellow=Jaune | |
71 | Red=Rouge | |
72 | Green=Vert | |
73 | Blue=Bleu | |
74 | Waypoints=Point de passage | |
75 | Select Waypoint #@1=Choisir un point de passage #@1 | |
76 | Waypoint @1=Point de passage @1 | |
77 | Set waypoint to current location=Marquer un point de passage à la position actuelle | |
78 | Hide waypoint= | |
79 | Show waypoint= | |
80 | Hide coordinates= | |
81 | Show coordinates= | |
82 | Change color of waypoint display=Changer la couleur du point de passage | |
83 | Edit waypoint name=Editer le nom du point de passage | |
84 | Waypoint active=Point de passage actif | |
85 | Waypoint inactive=Point de passage inactif | |
86 | Finish editing=Terminer l'édition | |
87 | World position=Position dans le monde | |
88 | Name=Nom | |
89 | HUD text color=Couleur de texte du HUD | |
90 | ||
91 | ||
92 | ##### not used anymore ##### | |
93 | ||
94 | Make waypoint @1=Rendre @1 le point de passage | |
95 | @1 display of waypoint coordinates=@1 montrer les coordonnées des points de passages |
0 | # textdomain: unified_inventory | |
1 | Mixing=Unione | |
2 | Cooking=Cottura | |
3 | Digging=Scavo | |
4 | Bags=Borse | |
5 | Bag @1=Borsa @1 | |
6 | Small Bag=Borsa piccola | |
7 | Medium Bag=Borsa media | |
8 | Large Bag=Borsa grande | |
9 | All Items= | |
10 | Misc. Items= | |
11 | Plant Life= | |
12 | Building Materials= | |
13 | Tools= | |
14 | Minerals and Metals= | |
15 | Environment and Worldgen= | |
16 | Lighting= | |
17 | and = e | |
18 | Scroll categories left= | |
19 | Scroll categories right= | |
20 | Search=Cerca | |
21 | Reset search and display everything=Azzera la ricerca e mostra tutto | |
22 | First page=Prima pagina | |
23 | Back three pages=Indietro di tre pagine | |
24 | Back one page=Indietro di una pagina | |
25 | Forward one page=Avanti di una pagina | |
26 | Forward three pages=Avanti di tre pagine | |
27 | Last page=Ultima pagina | |
28 | No matching items=Nessun oggetto corrispondente | |
29 | No matches.=Nessuna corrispondenza. | |
30 | Page=Pagina | |
31 | @1 of @2=@1 di @2 | |
32 | Filter=Filtro | |
33 | Can use the creative inventory=Può usare l'inventario creativo | |
34 | 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 | |
35 | Crafting Grid=Griglia di assemblaggio | |
36 | Crafting Guide=Guida di assemblaggio | |
37 | Set home position=Imposta la residenza | |
38 | Home position set to: @1=Residenza impostata su: @1 | |
39 | You don't have the "home" privilege!=Non hai il privilegio "home"! | |
40 | Go home=Torna a casa | |
41 | Set time to day=Imposta l'orario sul giorno | |
42 | Time of day set to 6am=Orario impostato sulle 6am | |
43 | You don't have the settime privilege!=Non hai il privilegio "time"! | |
44 | Set time to night=Imposta l'orario sulla notte | |
45 | Time of day set to 9pm=Orario impostato sulle 9am | |
46 | Clear inventory=Ripulisci l'inventario | |
47 | This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.= | |
48 | Inventory cleared!=Inventario ripulito! | |
49 | Trash:=Butta: | |
50 | Refill:=Riempi: | |
51 | Any item belonging to the @1 group=Qualunque oggetto appartenente al gruppo @1 | |
52 | Any item belonging to the groups @1=Qualunque oggetto appartenente ai gruppi @1 | |
53 | Recipe @1 of @2=Ricetta @1 di @2 | |
54 | Usage @1 of @2=Uso @1 di @2 | |
55 | No recipes=Nessuna ricetta | |
56 | No usages=Nessun utilizzo | |
57 | Result=Risultato | |
58 | Ingredient=Ingrediente | |
59 | Show next recipe=Mostra la prossima ricetta | |
60 | Show next usage=Mostra il prossimo utilizzo | |
61 | Show previous recipe=Mostra la ricetta precedente | |
62 | Show previous usage=Mostra l'utilizzo precedente | |
63 | @1 (@2)= | |
64 | Give me:=Dammi: | |
65 | This recipe is too@@large to be displayed.= | |
66 | To craft grid:=Alla griglia di assemblaggio: | |
67 | All=Tutto | |
68 | Crafting=Assemblaggio | |
69 | White=Bianco | |
70 | Yellow=Giallo | |
71 | Red=Rosso | |
72 | Green=Verde | |
73 | Blue=Blu | |
74 | Waypoints=Tappe | |
75 | Select Waypoint #@1=Seleziona tappa n°@1 | |
76 | Waypoint @1=Tappa @1 | |
77 | Set waypoint to current location=Imposta tappa alla posizione attuale | |
78 | Hide waypoint= | |
79 | Show waypoint= | |
80 | Hide coordinates= | |
81 | Show coordinates= | |
82 | Change color of waypoint display=Modifica il colore della visualizzazione della tappa | |
83 | Edit waypoint name=Modifica il nome della tappa | |
84 | Waypoint active=Tappa attiva | |
85 | Waypoint inactive=Tappa inattiva | |
86 | Finish editing=Termina la modifica | |
87 | World position=Posizione del mondo | |
88 | Name=Nome | |
89 | HUD text color=Colore del testo del visore | |
90 | ||
91 | ||
92 | ##### not used anymore ##### | |
93 | ||
94 | invisible=invisibile | |
95 | visible=visibile | |
96 | Make waypoint @1=Crea tappa @1 | |
97 | Disable=Disabilita | |
98 | Enable=Abilita | |
99 | @1 display of waypoint coordinates=@1 la visualizzazione delle coordinate della tappa |
0 | # textdomain: unified_inventory | |
1 | Mixing=Pencampuran | |
2 | Cooking=Pemasakan | |
3 | Digging=Penggalian | |
4 | Bags=Beg | |
5 | Bag @1=Beg @1 | |
6 | Small Bag=Beg Kecil | |
7 | Medium Bag=Beg Sederhana | |
8 | Large Bag=Beg Besar | |
9 | All Items= | |
10 | Misc. Items= | |
11 | Plant Life= | |
12 | Building Materials= | |
13 | Tools= | |
14 | Minerals and Metals= | |
15 | Environment and Worldgen= | |
16 | Lighting= | |
17 | and = dan | |
18 | Scroll categories left= | |
19 | Scroll categories right= | |
20 | Search=Cari | |
21 | Reset search and display everything=Set semula carian dan tunjukkan semua benda | |
22 | First page=Halaman pertama | |
23 | Back three pages=Tiga halaman sebelumnya | |
24 | Back one page=Halaman sebelumnya | |
25 | Forward one page=Halaman seterusnya | |
26 | Forward three pages=Tiga halaman seterusnya | |
27 | Last page=Halaman terakhir | |
28 | No matching items=Tiada item sepadan | |
29 | No matches.=Tiada padanan. | |
30 | Page=Halaman | |
31 | @1 of @2=@1 drpd @2 | |
32 | Filter=Tapis | |
33 | Can use the creative inventory=Boleh guna inventori kreatif | |
34 | Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally= | |
35 | Crafting Grid=Grid Pertukangan | |
36 | Crafting Guide=Panduan Pertukangan | |
37 | Set home position=Tetapkan kedudukan rumah | |
38 | Home position set to: @1=Kedudukan rumah ditetapkan ke: @1 | |
39 | You don't have the "home" privilege!=Anda tidak ada keistimewaan "home"! | |
40 | Go home=Balik rumah | |
41 | Set time to day=Tetapkan masa jadi siang | |
42 | Time of day set to 6am=Masa ditetapkan ke 6 pagi | |
43 | You don't have the settime privilege!=Anda tidak ada keistimewaan settime! | |
44 | Set time to night=Tetapkan masa jadi malam | |
45 | Time of day set to 9pm=Masa ditetapkan ke 9 malam | |
46 | Clear inventory=Kosongkan inventori | |
47 | This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.= | |
48 | Inventory cleared!=Inventori dikosongkan! | |
49 | Trash:=Buang: | |
50 | Refill:=Isi balik: | |
51 | Any item belonging to the @1 group=Sebarang item dari kumpulan @1 | |
52 | Any item belonging to the groups @1=Sebarang item dari kumpulan @1 | |
53 | Recipe @1 of @2=Resipi @1 drpd @2 | |
54 | Usage @1 of @2=Kegunaan @1 drpd @2 | |
55 | No recipes=Tiada resipi | |
56 | No usages=Tiada kegunaan | |
57 | Result=Hasil | |
58 | Ingredient=Bahan | |
59 | Show next recipe=Tunjuk resipi seterusnya | |
60 | Show next usage=Tunjuk kegunaan seterusnya | |
61 | Show previous recipe=Tunjuk resipi sebelumnya | |
62 | Show previous usage=Tunjuk kegunaan sebelumnya | |
63 | @1 (@2)=@1 (@2) | |
64 | Give me:=Beri saya: | |
65 | This recipe is too@@large to be displayed.= | |
66 | To craft grid:=Ke grid pertukangan: | |
67 | All= | |
68 | Crafting=Pertukangan | |
69 | White=Putih | |
70 | Yellow=Kuning | |
71 | Red=Merah | |
72 | Green=Hijau | |
73 | Blue=Biru | |
74 | Waypoints=Titik Arah | |
75 | Select Waypoint #@1=Pilih Titik Arah #@1 | |
76 | Waypoint @1=Titik Arah @1 | |
77 | Set waypoint to current location=Tetapkan titik arah ke lokasi semasa | |
78 | Hide waypoint= | |
79 | Show waypoint= | |
80 | Hide coordinates= | |
81 | Show coordinates= | |
82 | Change color of waypoint display=Tukar warna paparan titik arah | |
83 | Edit waypoint name=Edit nama titik arah | |
84 | Waypoint active=Titik arah aktif | |
85 | Waypoint inactive=Titik arah tidak aktif | |
86 | Finish editing=Selesai edit | |
87 | World position=Kedudukan dunia | |
88 | Name=Nama | |
89 | HUD text color=Warna tulisan HUD | |
90 | ||
91 | ||
92 | ##### not used anymore ##### | |
93 | ||
94 | invisible=Sembunyikan | |
95 | visible=Paparkan | |
96 | Make waypoint @1=@1 titik arah | |
97 | Disable=Sembunyikan | |
98 | Enable=Paparkan | |
99 | @1 display of waypoint coordinates=@1 koordinat untuk titik arah |
0 | # textdomain: unified_inventory | |
1 | Mixing= | |
2 | Cooking= | |
3 | Digging= | |
4 | Bags=Plecaki | |
5 | Bag @1=Plecak @1 | |
6 | Small Bag=Maly plecak | |
7 | Medium Bag=Sredni plecak | |
8 | Large Bag=Duzy plecak | |
9 | All Items= | |
10 | Misc. Items= | |
11 | Plant Life= | |
12 | Building Materials= | |
13 | Tools= | |
14 | Minerals and Metals= | |
15 | Environment and Worldgen= | |
16 | Lighting= | |
17 | and = i | |
18 | Scroll categories left= | |
19 | Scroll categories right= | |
20 | Search=Szukaj | |
21 | Reset search and display everything= | |
22 | First page=Pierwsza strona | |
23 | Back three pages=3 strony w tyl | |
24 | Back one page=1 strona w tyl | |
25 | Forward one page=1 strona do przodu | |
26 | Forward three pages=3 strony do przodu | |
27 | Last page=Ostatnia strona | |
28 | No matching items=Brak pasujacych przedmiotow | |
29 | No matches.=Brak wyników | |
30 | Page=Strona | |
31 | @1 of @2=@1 z @2 | |
32 | Filter=Filtr | |
33 | Can use the creative inventory= | |
34 | Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally= | |
35 | Crafting Grid= | |
36 | Crafting Guide= | |
37 | Set home position=Ustaw pozycję wyjściową | |
38 | Home position set to: @1=Pozycja domowa ustawiona na: @1 | |
39 | You don't have the "home" privilege!=Nie masz uprawnien do zmiany czasu "home"! | |
40 | Go home=Idź do domu | |
41 | Set time to day=Ustaw czas na dzień | |
42 | Time of day set to 6am=Czas ustawiony na 6:00 | |
43 | You don't have the settime privilege!=Nie masz uprawnien do zmiany czasu "settime"! | |
44 | Set time to night=Ustaw czas na noc | |
45 | Time of day set to 9pm=Czas ustawiony na 21:00 | |
46 | Clear inventory=Wyczyść zapasy | |
47 | This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.= | |
48 | Inventory cleared!=Zapasy zostały wyczyszczone! | |
49 | Trash:=Smietnik: | |
50 | Refill:=Uzupelnianie: | |
51 | Any item belonging to the @1 group= | |
52 | Any item belonging to the groups @1= | |
53 | Recipe @1 of @2=Recepta @1 z @2 | |
54 | Usage @1 of @2=Użycie @1 z @2 | |
55 | No recipes=Brak recepty | |
56 | No usages=Bez użycia | |
57 | Result=Wynik | |
58 | Ingredient=Składnik | |
59 | Show next recipe= | |
60 | Show next usage= | |
61 | Show previous recipe= | |
62 | Show previous usage= | |
63 | @1 (@2)= | |
64 | Give me:=Daj mi: | |
65 | This recipe is too@@large to be displayed.= | |
66 | To craft grid:= | |
67 | All=Wszystko | |
68 | Crafting= | |
69 | White=Bialy | |
70 | Yellow=Zolty | |
71 | Red=Czerwony | |
72 | Green=Zielony | |
73 | Blue=Niebieski | |
74 | Waypoints=Punkty orientacyjne | |
75 | Select Waypoint #@1=Wybierz punkt #@1 | |
76 | Waypoint @1=Punkty orientacyjne @1 | |
77 | Set waypoint to current location=Ustaw punkt orientacyjny na biezacej pozycji | |
78 | Hide waypoint= | |
79 | Show waypoint= | |
80 | Hide coordinates= | |
81 | Show coordinates= | |
82 | Change color of waypoint display=Zmien kolor punktu | |
83 | Edit waypoint name=Edytuj nazwe punktu | |
84 | Waypoint active=Punkt wlaczony | |
85 | Waypoint inactive=Punkt wylaczony | |
86 | Finish editing=Zakoncz edycje | |
87 | World position=Pozycja | |
88 | Name=Nazwa | |
89 | HUD text color=Kolor tekstu HUD | |
90 | ||
91 | ||
92 | ##### not used anymore ##### | |
93 | ||
94 | invisible=niewidzialny | |
95 | visible=widomy | |
96 | Make waypoint @1=Robić punkt @1 | |
97 | @1 display of waypoint coordinates=@1 koordynatow punktu |
0 | # textdomain: unified_inventory | |
1 | Mixing=Muistura | |
2 | Cooking=Cozimento | |
3 | Digging=Escavação | |
4 | Bags=Bolsas | |
5 | Bag @1=Bolsa @1 | |
6 | Small Bag=Bolsa Pequena | |
7 | Medium Bag=Bolsa Média | |
8 | Large Bag=Bolsa Grande | |
9 | All Items= | |
10 | Misc. Items= | |
11 | Plant Life= | |
12 | Building Materials= | |
13 | Tools= | |
14 | Minerals and Metals= | |
15 | Environment and Worldgen= | |
16 | Lighting= | |
17 | and = e | |
18 | Scroll categories left= | |
19 | Scroll categories right= | |
20 | Search=Pesquisar | |
21 | Reset search and display everything=Redefinir pesquisa e exibir tudo | |
22 | First page=Primeira Página | |
23 | Back three pages=Voltar 3 Páginas | |
24 | Back one page=Voltar 1 Página | |
25 | Forward one page=Avançar 1 Página | |
26 | Forward three pages=Avançar 3 Páginas | |
27 | Last page=Ultima Página | |
28 | No matching items=Nenhum item correspondente | |
29 | No matches.=Sem correspondências | |
30 | Page=Página | |
31 | @1 of @2=@1 de @2 | |
32 | Filter=Filtro | |
33 | Can use the creative inventory=Pode usar o inventário do criativo | |
34 | Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally= | |
35 | Crafting Grid=Grade de Artesanato | |
36 | Crafting Guide=Guia de Artesanato | |
37 | Set home position=Definir posição de casa | |
38 | Home position set to: @1=Posição inicial definida para: @1 | |
39 | You don't have the "home" privilege!=Você não tem o privilégio de "home"! | |
40 | Go home=Transportar para Casa | |
41 | Set time to day=Definir turno para dia | |
42 | Time of day set to 6am=Hora do dia definida para 06h | |
43 | You don't have the settime privilege!=Você não tem o privilégio de "settime"! | |
44 | Set time to night=Definir turno para noite | |
45 | Time of day set to 9pm=Hora do dia ajustada para 21h | |
46 | Clear inventory=Limpar Inventário | |
47 | This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.= | |
48 | Inventory cleared!=Inventário Apagado! | |
49 | Trash:=Lixo: | |
50 | Refill:=Recarga: | |
51 | Any item belonging to the @1 group=Qualquer item pertencente ao grupo '@1'. | |
52 | Any item belonging to the groups @1=Qualquer item pertencente aos grupos '@1'. | |
53 | Recipe @1 of @2=Receita @1 de @2 | |
54 | Usage @1 of @2=Utilização @1 de @2 | |
55 | No recipes=Sem Receita | |
56 | No usages=Sem Utilização | |
57 | Result=Resultado | |
58 | Ingredient=Ingrediente | |
59 | Show next recipe=Exibir Próxima Receita | |
60 | Show next usage=Mostrar Próxima Utilização | |
61 | Show previous recipe=Exibir Receita Anterior | |
62 | Show previous usage=Exibir Utilização Anterior | |
63 | @1 (@2)= | |
64 | Give me:=Gerado: | |
65 | This recipe is too@@large to be displayed.= | |
66 | To craft grid:=Para Grade de Artesanato | |
67 | All=MAX | |
68 | Crafting=Artesanato | |
69 | White=Branco | |
70 | Yellow=Amarelo | |
71 | Red=Vermelho | |
72 | Green=Verde | |
73 | Blue=Azul | |
74 | Waypoints=Apontador de Direção | |
75 | Select Waypoint #@1=Seleção de Apontador de Direção #@1 | |
76 | Waypoint @1=Apontador de Direção @1 | |
77 | Set waypoint to current location=Configurar localização atual do Apontador de Direção | |
78 | Hide waypoint= | |
79 | Show waypoint= | |
80 | Hide coordinates= | |
81 | Show coordinates= | |
82 | Change color of waypoint display=Mudar cor exibida do Apontador de Direção | |
83 | Edit waypoint name=Editar Nome de Apontador de Direção | |
84 | Waypoint active=Apontador de Direção Ativo | |
85 | Waypoint inactive=Apontador de Direção Inativo | |
86 | Finish editing=Edição Finalizada | |
87 | World position=Posição Mundial | |
88 | Name=Nome | |
89 | HUD text color=Cor de HUD | |
90 | ||
91 | ||
92 | ##### not used anymore ##### | |
93 | ||
94 | invisible=invisível | |
95 | visible=visível | |
96 | Make waypoint @1=Fazer Apontador de Direção @1 | |
97 | @1 display of waypoint coordinates=@1 exibição de coordenadas de Fazer Apontador de Direção |
0 | # textdomain: unified_inventory | |
1 | Mixing=Мешать | |
2 | Cooking=Варить | |
3 | Digging=Копать | |
4 | Bags=Сумки | |
5 | Bag @1=Сумка @1 | |
6 | Small Bag=Малая сумка | |
7 | Medium Bag=Средняя сумка | |
8 | Large Bag=Большая сумка | |
9 | All Items= | |
10 | Misc. Items= | |
11 | Plant Life= | |
12 | Building Materials= | |
13 | Tools= | |
14 | Minerals and Metals= | |
15 | Environment and Worldgen= | |
16 | Lighting= | |
17 | and = и | |
18 | Scroll categories left= | |
19 | Scroll categories right= | |
20 | Search=Поиск | |
21 | Reset search and display everything=Сброс поиска, показать всё | |
22 | First page=Первая страница | |
23 | Back three pages=3 страницы назад | |
24 | Back one page=1 страницу назад | |
25 | Forward one page=1 страницу вперёд | |
26 | Forward three pages=3 страницы вперёд | |
27 | Last page=Последняя страница | |
28 | No matching items=Нет подходящих элементов | |
29 | No matches.=Ничего не найдено | |
30 | Page=Страница | |
31 | @1 of @2=@1 из @2 | |
32 | Filter=Фильтр | |
33 | Can use the creative inventory=Можно использовать инвентарь творческого режима | |
34 | Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally= | |
35 | Crafting Grid=Решетка крафта | |
36 | Crafting Guide=Книга рецептов | |
37 | Set home position=Установить позицию дома | |
38 | Home position set to: @1=Дом теперь расположен по коодинатам: @1 | |
39 | You don't have the "home" privilege!=У вас нет привилегии "home"! | |
40 | Go home=Отправиться домой | |
41 | Set time to day=День | |
42 | Time of day set to 6am=Установлено время 6 утра | |
43 | You don't have the settime privilege!=Вам не разрешено устанавливать время! (нет привилегии "settime") | |
44 | Set time to night=Ночь | |
45 | Time of day set to 9pm=Установлено время 9 вечера | |
46 | Clear inventory=Очистить инвентарь | |
47 | This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.= | |
48 | Inventory cleared!=Инвентарь очищен! | |
49 | Trash:=Мусор: | |
50 | Refill:=Наполнить: | |
51 | Any item belonging to the @1 group=Любой элемент из группы: @1 | |
52 | Any item belonging to the groups @1=Любой элемент из группы: @1 | |
53 | Recipe @1 of @2=Рецепт @1 из @2 | |
54 | Usage @1 of @2=Вариант @1 of @2 | |
55 | No recipes=Рецептов нет | |
56 | No usages=Не используется | |
57 | Result=Результат | |
58 | Ingredient=Состав | |
59 | Show next recipe=Следующий рецепт | |
60 | Show next usage=Следующее использование | |
61 | Show previous recipe=Прошлый рецепт | |
62 | Show previous usage=Прошлая страница | |
63 | @1 (@2)= | |
64 | Give me:=Дай мне: | |
65 | This recipe is too@@large to be displayed.= | |
66 | To craft grid:=На решeтку крафта: | |
67 | All=Все | |
68 | Crafting=Крафт | |
69 | White=Белый | |
70 | Yellow=Желтый | |
71 | Red=Красный | |
72 | Green=Зелёный | |
73 | Blue=Синий | |
74 | Waypoints=Путевые точки | |
75 | Select Waypoint #@1=Выбрать путевую точку №@1 | |
76 | Waypoint @1=Путевая точка @1 | |
77 | Set waypoint to current location=Установить путевую точку по текущей позиции | |
78 | Hide waypoint= | |
79 | Show waypoint= | |
80 | Hide coordinates= | |
81 | Show coordinates= | |
82 | Change color of waypoint display=Поменять цвет путевой точки | |
83 | Edit waypoint name=Переименовать путевую точку | |
84 | Waypoint active=Путевая точка включена | |
85 | Waypoint inactive=Путевая точка выключена | |
86 | Finish editing=Закончить редакцию | |
87 | World position=Позиция мира | |
88 | Name=Имя | |
89 | HUD text color=Цвет текста HUDа | |
90 | ||
91 | ||
92 | ##### not used anymore ##### | |
93 | ||
94 | invisible=невидимой | |
95 | visible=видимой | |
96 | Make waypoint @1=Сделать путевую точку @1 | |
97 | Disable=Выключить | |
98 | Enable=Включить | |
99 | @1 display of waypoint coordinates=@1 показ координат путевых точек |
0 | # textdomain: unified_inventory | |
1 | Mixing=Karıştırma | |
2 | Cooking=Pişirme | |
3 | Digging=Kazma | |
4 | Bags=Çantalarım | |
5 | Bag @1=@1. Çanta | |
6 | Small Bag=Küçük Çanta | |
7 | Medium Bag=Çanta | |
8 | Large Bag=Büyük Çanta | |
9 | All Items= | |
10 | Misc. Items= | |
11 | Plant Life= | |
12 | Building Materials= | |
13 | Tools= | |
14 | Minerals and Metals= | |
15 | Environment and Worldgen= | |
16 | Lighting= | |
17 | and = ve | |
18 | Scroll categories left= | |
19 | Scroll categories right= | |
20 | Search=Ara | |
21 | Reset search and display everything= | |
22 | First page=İlk Sayfa | |
23 | Back three pages=3 Sayfa Gerile | |
24 | Back one page=Geri | |
25 | Forward one page=İleri | |
26 | Forward three pages=3 Sayfa İlerile | |
27 | Last page=Son Sayfa | |
28 | No matching items=Eşleşme yok | |
29 | No matches.=Eşleşme yok | |
30 | Page=Sayfa | |
31 | @1 of @2=@1 dan @2 | |
32 | Filter=Süzgeç | |
33 | Can use the creative inventory=Yaratıcı envanteri kullanabilir | |
34 | Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally= | |
35 | Crafting Grid=Üretim tablosu | |
36 | Crafting Guide=Kılavuz | |
37 | Set home position=Set ev pozisyon | |
38 | Home position set to: @1=Yeni eviniz: @1 | |
39 | You don't have the "home" privilege!="home" yetkiniz yok! | |
40 | Go home=Eve git | |
41 | Set time to day=Güne zaman ayarla | |
42 | Time of day set to 6am=Saat 06:00 olarak ayarlandı | |
43 | You don't have the settime privilege!="settime" yetkiniz yok! | |
44 | Set time to night=Geceye zaman ayarla | |
45 | Time of day set to 9pm=Saat 19:00 olarak ayarlandı | |
46 | Clear inventory= | |
47 | This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.= | |
48 | Inventory cleared!=Envanter temizlendi! | |
49 | Trash:=Çöp | |
50 | Refill:=Doldur | |
51 | Any item belonging to the @1 group= | |
52 | Any item belonging to the groups @1= | |
53 | Recipe @1 of @2=@1 dan @2 tarifi | |
54 | Usage @1 of @2=Kullanım @1/@2 | |
55 | No recipes=Tarifi yok | |
56 | No usages=Kullanım yok | |
57 | Result=Çıktı | |
58 | Ingredient=Bileşen | |
59 | Show next recipe= | |
60 | Show next usage= | |
61 | Show previous recipe= | |
62 | Show previous usage= | |
63 | @1 (@2)= | |
64 | Give me:=Ver bana: | |
65 | This recipe is too@@large to be displayed.= | |
66 | To craft grid:=Üretim tablosuna kopyala | |
67 | All=Tümü | |
68 | Crafting=Üretim | |
69 | White=Beyaz | |
70 | Yellow=Sarı | |
71 | Red=Kırmızı | |
72 | Green=Yeşil | |
73 | Blue=Mavi | |
74 | Waypoints=Konum Noktaları | |
75 | Select Waypoint #@1=#@1 konum noktası seç | |
76 | Waypoint @1=@1 Konum Noktaları | |
77 | Set waypoint to current location=Bulunduğun noktayı işaretle | |
78 | Hide waypoint= | |
79 | Show waypoint= | |
80 | Hide coordinates= | |
81 | Show coordinates= | |
82 | Change color of waypoint display=Konum Gösterge Rengi | |
83 | Edit waypoint name=Konum Noktasını Düzenle | |
84 | Waypoint active=Konum Etkin | |
85 | Waypoint inactive=Konum Devredışı | |
86 | Finish editing=Düzenleme bitti | |
87 | World position=Dünya konumu | |
88 | Name=İsim | |
89 | HUD text color=Metin rengi | |
90 | ||
91 | ||
92 | ##### not used anymore ##### | |
93 | ||
94 | msgid ""=Yaratıcı modu dışında iken bu tuş kullanılamaz. | |
95 | invisible=görünmez | |
96 | visible=görünür | |
97 | Make waypoint @1=Yol noktası @1 | |
98 | @1 display of waypoint coordinates=Yol noktası koordinatlarının görüntülenmesini @1 |
0 | # textdomain: unified_inventory | |
1 | Mixing=混合 | |
2 | Cooking=烹饪 | |
3 | Digging=挖出 | |
4 | Bags=背包 | |
5 | Bag @1=背包@1 | |
6 | Small Bag=小背包 | |
7 | Medium Bag=中背包 | |
8 | Large Bag=大背包 | |
9 | All Items= | |
10 | Misc. Items= | |
11 | Plant Life= | |
12 | Building Materials= | |
13 | Tools= | |
14 | Minerals and Metals= | |
15 | Environment and Worldgen= | |
16 | Lighting= | |
17 | and = 和 | |
18 | Scroll categories left= | |
19 | Scroll categories right= | |
20 | Search=搜索 | |
21 | Reset search and display everything=重置搜索并显示所有物品 | |
22 | First page=第一页 | |
23 | Back three pages=后退三页 | |
24 | Back one page=后退一页 | |
25 | Forward one page=前进一页 | |
26 | Forward three pages=前进三页 | |
27 | Last page=最后一页 | |
28 | No matching items=没有匹配物品 | |
29 | No matches.=没有匹配 | |
30 | Page=页面 | |
31 | @1 of @2=第@1页,共@2页 | |
32 | Filter=过滤器 | |
33 | Can use the creative inventory=可以使用创造背包 | |
34 | Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally= | |
35 | Crafting Grid=合成表 | |
36 | Crafting Guide=合成指南 | |
37 | Set home position=设置家的位置 | |
38 | Home position set to: @1=家的位置设置到: @1 | |
39 | You don't have the "home" privilege!=你没有“home”权限! | |
40 | Go home=回家 | |
41 | Set time to day=设置时间到白天 | |
42 | Time of day set to 6am=时间设置到早晨6点 | |
43 | You don't have the settime privilege!=你没有“settime”权限! | |
44 | Set time to night=设置时间到晚上 | |
45 | Time of day set to 9pm=时间设置到晚上9点 | |
46 | Clear inventory=清空背包 | |
47 | This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.= | |
48 | Inventory cleared!=清空背包 | |
49 | Trash:=丢弃: | |
50 | Refill:=填满: | |
51 | Any item belonging to the @1 group=属于@1组的任何项目 | |
52 | Any item belonging to the groups @1=属于组@1的任何项目 | |
53 | Recipe @1 of @2=第@1配方,共@2个 | |
54 | Usage @1 of @2=第@1用法,共@2个 | |
55 | No recipes=没有配方 | |
56 | No usages=没有用法 | |
57 | Result=结果 | |
58 | Ingredient=原料 | |
59 | Show next recipe= | |
60 | Show next usage= | |
61 | Show previous recipe= | |
62 | Show previous usage= | |
63 | @1 (@2)= | |
64 | Give me:=给予: | |
65 | This recipe is too@@large to be displayed.= | |
66 | To craft grid:=填充物品到合成表 | |
67 | All=全部 | |
68 | Crafting=合成 | |
69 | White=白 | |
70 | Yellow=黄 | |
71 | Red=红 | |
72 | Green=绿 | |
73 | Blue=蓝 | |
74 | Waypoints=航路点 | |
75 | Select Waypoint #@1=查询航路点 #@1 | |
76 | Waypoint @1=航路点 @1 | |
77 | Set waypoint to current location=将航路点设置到当前位置 | |
78 | Hide waypoint= | |
79 | Show waypoint= | |
80 | Hide coordinates= | |
81 | Show coordinates= | |
82 | Change color of waypoint display=改变航路点显示的颜色 | |
83 | Edit waypoint name=编辑航路点名称 | |
84 | Waypoint active=航路点已激活 | |
85 | Waypoint inactive=航路点未激活 | |
86 | Finish editing=完成编辑 | |
87 | World position=世界位置 | |
88 | Name=名称 | |
89 | HUD text color=HUD文本颜色 | |
90 | ||
91 | ||
92 | ##### not used anymore ##### | |
93 | ||
94 | invisible=不可见的 | |
95 | visible=可见的 | |
96 | Make waypoint @1=设置航路点 @1 | |
97 | @1 display of waypoint coordinates=显示航路点@1坐标 |
0 | # textdomain: unified_inventory | |
1 | Mixing=混合 | |
2 | Cooking=烹飪 | |
3 | Digging=挖出 | |
4 | Bags=揹包 | |
5 | Bag @1=揹包@1 | |
6 | Small Bag=小揹包 | |
7 | Medium Bag=中揹包 | |
8 | Large Bag=大揹包 | |
9 | All Items= | |
10 | Misc. Items= | |
11 | Plant Life= | |
12 | Building Materials= | |
13 | Tools= | |
14 | Minerals and Metals= | |
15 | Environment and Worldgen= | |
16 | Lighting= | |
17 | and = 和 | |
18 | Scroll categories left= | |
19 | Scroll categories right= | |
20 | Search=搜索 | |
21 | Reset search and display everything=重置搜索並顯示所有物品 | |
22 | First page=第一頁 | |
23 | Back three pages=後退三頁 | |
24 | Back one page=後退一頁 | |
25 | Forward one page=前進一頁 | |
26 | Forward three pages=前進三頁 | |
27 | Last page=最後一頁 | |
28 | No matching items=沒有匹配物品 | |
29 | No matches.=沒有匹配 | |
30 | Page=頁面 | |
31 | @1 of @2=第@1頁,共@2頁 | |
32 | Filter=過濾器 | |
33 | Can use the creative inventory=可以使用創造揹包 | |
34 | Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally= | |
35 | Crafting Grid=合成表 | |
36 | Crafting Guide=合成指南 | |
37 | Set home position=設置家的位置 | |
38 | Home position set to: @1=家的位置設置到: @1 | |
39 | You don't have the "home" privilege!=你沒有“home”權限! | |
40 | Go home=回家 | |
41 | Set time to day=設置時間到白天 | |
42 | Time of day set to 6am=時間設置到早晨6點 | |
43 | You don't have the settime privilege!=你沒有“settime”權限! | |
44 | Set time to night=設置時間到晚上 | |
45 | Time of day set to 9pm=時間設置到晚上9點 | |
46 | Clear inventory=清空揹包 | |
47 | This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.= | |
48 | Inventory cleared!=清空揹包 | |
49 | Trash:=丟棄: | |
50 | Refill:=填滿: | |
51 | Any item belonging to the @1 group=屬於@1組的任何項目 | |
52 | Any item belonging to the groups @1=屬於組@1的任何項目 | |
53 | Recipe @1 of @2=第@1配方,共@2個 | |
54 | Usage @1 of @2=第@1用法,共@2個 | |
55 | No recipes=沒有配方 | |
56 | No usages=沒有用法 | |
57 | Result=結果 | |
58 | Ingredient=原料 | |
59 | Show next recipe= | |
60 | Show next usage= | |
61 | Show previous recipe= | |
62 | Show previous usage= | |
63 | @1 (@2)= | |
64 | Give me:=給予: | |
65 | This recipe is too@@large to be displayed.= | |
66 | To craft grid:=填充物品到合成表 | |
67 | All=全部 | |
68 | Crafting=合成 | |
69 | White=白 | |
70 | Yellow=黃 | |
71 | Red=紅 | |
72 | Green=綠 | |
73 | Blue=藍 | |
74 | Waypoints=航路點 | |
75 | Select Waypoint #@1=查詢航路點 #@1 | |
76 | Waypoint @1=航路點 @1 | |
77 | Set waypoint to current location=將航路點設置到當前位置 | |
78 | Hide waypoint= | |
79 | Show waypoint= | |
80 | Hide coordinates= | |
81 | Show coordinates= | |
82 | Change color of waypoint display=改變航路點顯示的顏色 | |
83 | Edit waypoint name=編輯航路點名稱 | |
84 | Waypoint active=航路點已激活 | |
85 | Waypoint inactive=航路點未激活 | |
86 | Finish editing=完成編輯 | |
87 | World position=世界位置 | |
88 | Name=名稱 | |
89 | HUD text color=HUD文本顏色 | |
90 | ||
91 | ||
92 | ##### not used anymore ##### | |
93 | ||
94 | invisible=不可見的 | |
95 | visible=可見的 | |
96 | Make waypoint @1=設置航路點 @1 | |
97 | @1 display of waypoint coordinates=顯示航路點@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 |
0 | 0 | name = unified_inventory |
1 | ||
2 | optional_depends = default, 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 | |
1 | 2 | local F = minetest.formspec_escape |
3 | local ui = unified_inventory | |
2 | 4 | |
3 | 5 | minetest.register_privilege("creative", { |
4 | 6 | description = S("Can use the creative inventory"), |
10 | 12 | give_to_singleplayer = false, |
11 | 13 | }) |
12 | 14 | |
13 | ||
14 | 15 | local trash = minetest.create_detached_inventory("trash", { |
15 | 16 | --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 | |
17 | 18 | -- return stack:get_count() |
18 | 19 | -- else |
19 | 20 | -- return 0 |
27 | 28 | }) |
28 | 29 | trash:set_size("main", 1) |
29 | 30 | |
30 | unified_inventory.register_button("craft", { | |
31 | ui.register_button("craft", { | |
31 | 32 | type = "image", |
32 | 33 | image = "ui_craft_icon.png", |
33 | 34 | tooltip = S("Crafting Grid") |
34 | 35 | }) |
35 | 36 | |
36 | unified_inventory.register_button("craftguide", { | |
37 | ui.register_button("craftguide", { | |
37 | 38 | type = "image", |
38 | 39 | image = "ui_craftguide_icon.png", |
39 | 40 | tooltip = S("Crafting Guide") |
40 | 41 | }) |
41 | 42 | |
42 | unified_inventory.register_button("home_gui_set", { | |
43 | ui.register_button("home_gui_set", { | |
43 | 44 | type = "image", |
44 | 45 | image = "ui_sethome_icon.png", |
45 | 46 | tooltip = S("Set home position"), |
47 | 48 | action = function(player) |
48 | 49 | local player_name = player:get_player_name() |
49 | 50 | 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] | |
52 | 53 | if home ~= nil then |
53 | 54 | minetest.sound_play("dingdong", |
54 | 55 | {to_player=player_name, gain = 1.0}) |
55 | 56 | 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))) | |
57 | 58 | end |
58 | 59 | else |
59 | 60 | minetest.chat_send_player(player_name, |
60 | 61 | 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]) | |
62 | 63 | end |
63 | 64 | end, |
64 | 65 | condition = function(player) |
66 | 67 | end, |
67 | 68 | }) |
68 | 69 | |
69 | unified_inventory.register_button("home_gui_go", { | |
70 | ui.register_button("home_gui_go", { | |
70 | 71 | type = "image", |
71 | 72 | image = "ui_gohome_icon.png", |
72 | 73 | tooltip = S("Go home"), |
74 | 75 | action = function(player) |
75 | 76 | local player_name = player:get_player_name() |
76 | 77 | 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 | |
80 | 81 | else |
81 | 82 | minetest.chat_send_player(player_name, |
82 | 83 | 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]) | |
84 | 85 | end |
85 | 86 | end, |
86 | 87 | condition = function(player) |
88 | 89 | end, |
89 | 90 | }) |
90 | 91 | |
91 | unified_inventory.register_button("misc_set_day", { | |
92 | ui.register_button("misc_set_day", { | |
92 | 93 | type = "image", |
93 | 94 | image = "ui_sun_icon.png", |
94 | 95 | tooltip = S("Set time to day"), |
104 | 105 | else |
105 | 106 | minetest.chat_send_player(player_name, |
106 | 107 | 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]) | |
108 | 109 | end |
109 | 110 | end, |
110 | 111 | condition = function(player) |
112 | 113 | end, |
113 | 114 | }) |
114 | 115 | |
115 | unified_inventory.register_button("misc_set_night", { | |
116 | ui.register_button("misc_set_night", { | |
116 | 117 | type = "image", |
117 | 118 | image = "ui_moon_icon.png", |
118 | 119 | tooltip = S("Set time to night"), |
128 | 129 | else |
129 | 130 | minetest.chat_send_player(player_name, |
130 | 131 | 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]) | |
132 | 133 | end |
133 | 134 | end, |
134 | 135 | condition = function(player) |
136 | 137 | end, |
137 | 138 | }) |
138 | 139 | |
139 | unified_inventory.register_button("clear_inv", { | |
140 | ui.register_button("clear_inv", { | |
140 | 141 | type = "image", |
141 | 142 | image = "ui_trash_icon.png", |
142 | 143 | tooltip = S("Clear inventory"), |
143 | 144 | action = function(player) |
144 | 145 | 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 | |
146 | 147 | minetest.chat_send_player(player_name, |
147 | 148 | S("This button has been disabled outside" |
148 | 149 | .." of creative mode to prevent" |
149 | 150 | .." accidental inventory trashing." |
150 | 151 | .."\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]) | |
152 | 153 | return |
153 | 154 | end |
154 | 155 | player:get_inventory():set_list("main", {}) |
157 | 158 | {to_player=player_name, gain = 1.0}) |
158 | 159 | end, |
159 | 160 | 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", { | |
165 | 166 | get_formspec = function(player, perplayer_formspec) |
166 | 167 | |
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)} | |
189 | 197 | end, |
190 | 198 | }) |
191 | 199 | |
204 | 212 | local selectitem = name |
205 | 213 | if name:sub(1, 6) == "group:" then |
206 | 214 | 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) | |
208 | 216 | show_is_group = not group_item.sole |
209 | 217 | displayitem = group_item.item or "unknown" |
210 | 218 | selectitem = group_item.sole and displayitem or name |
211 | 219 | end |
212 | 220 | 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)) | |
214 | 222 | local button = string.format("item_image_button[%f,%f;%f,%f;%s;%s;%s]", |
215 | 223 | x, y, w, h, |
216 | 224 | F(displayitem), buttonname, label) |
217 | 225 | if show_is_group then |
218 | local groupstring, andcount = unified_inventory.extract_groupnames(name) | |
226 | local groupstring, andcount = ui.extract_groupnames(name) | |
219 | 227 | local grouptip |
220 | 228 | 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) | |
222 | 230 | 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) | |
224 | 232 | end |
225 | 233 | grouptip = F(grouptip) |
226 | 234 | if andcount >= 1 then |
231 | 239 | end |
232 | 240 | |
233 | 241 | 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"), | |
236 | 244 | } |
237 | 245 | local no_recipe_text = { |
238 | 246 | recipe = S("No recipes"), |
255 | 263 | usage = "recipe", |
256 | 264 | } |
257 | 265 | |
258 | unified_inventory.register_page("craftguide", { | |
266 | ui.register_page("craftguide", { | |
259 | 267 | get_formspec = function(player, perplayer_formspec) |
260 | 268 | |
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 | |
265 | 276 | |
266 | 277 | local player_name = player:get_player_name() |
267 | 278 | 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 | ||
274 | 293 | 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) | |
277 | 298 | else |
278 | 299 | item_name_shown = item_name |
279 | 300 | end |
280 | 301 | |
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] | |
287 | 307 | local alternates, craft |
288 | if crafts ~= nil and #crafts > 0 then | |
308 | if crafts and #crafts > 0 then | |
289 | 309 | alternates = #crafts |
290 | 310 | craft = crafts[alternate] |
291 | 311 | 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 | }) | |
300 | 328 | |
301 | 329 | 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 | |
314 | 339 | 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, {}) | |
320 | 349 | 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 | |
327 | 363 | |
328 | 364 | -- This keeps recipes aligned to the right, |
329 | 365 | -- so that they're close to the arrow. |
330 | local xoffset = 5.5 | |
366 | local xoffset = craftguidex+3.75 | |
367 | local bspc = 1.25 | |
331 | 368 | -- Offset factor for crafting grids with side length > 4 |
332 | 369 | local of = (3/math.max(3, math.max(display_size.width, display_size.height))) |
333 | 370 | 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 | |
335 | 372 | local mini_craft_size = 6 |
336 | 373 | if display_size.width >= mini_craft_size then |
337 | 374 | od = math.max(1, display_size.width - 2) |
340 | 377 | -- Size modifier factor |
341 | 378 | local sf = math.min(1, of * (1.05 + 0.05*od)) |
342 | 379 | -- 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 | |
349 | 386 | for y = 1, display_size.height do |
350 | 387 | for x = 1, display_size.width do |
351 | 388 | local item |
355 | 392 | -- Flipped x, used to build formspec buttons from right to left |
356 | 393 | local fx = display_size.width - (x-1) |
357 | 394 | -- 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 | |
360 | 397 | 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, | |
363 | 400 | "item_button_recipe_", |
364 | 401 | ItemStack(item)) |
365 | 402 | else |
366 | 403 | -- 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) | |
370 | 406 | end |
407 | n = n + 1 | |
371 | 408 | end |
372 | 409 | end |
373 | 410 | else |
374 | 411 | -- 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 | |
378 | 415 | end |
379 | 416 | |
380 | 417 | 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 | |
391 | 428 | end |
392 | 429 | |
393 | 430 | 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) } | |
402 | 442 | end, |
403 | 443 | }) |
404 | 444 | |
405 | 445 | 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 | ||
406 | 455 | local amount |
407 | 456 | for k, v in pairs(fields) do |
408 | 457 | amount = k:match("craftguide_giveme_(.*)") |
409 | 458 | if amount then break end |
410 | 459 | end |
411 | if not amount then return end | |
412 | ||
413 | amount = tonumber(amount) | |
460 | ||
461 | amount = tonumber(amount) or 0 | |
414 | 462 | if amount == 0 then return end |
415 | 463 | |
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] | |
419 | 465 | if (not output) or (output == "") then return end |
420 | 466 | |
421 | 467 | local player_inv = player:get_inventory() |
422 | 468 | |
423 | 469 | 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 | |
498 | 470 | end |
499 | 471 | |
500 | 472 | local function craftguide_craft(player, formname, fields) |
504 | 476 | if amount then break end |
505 | 477 | end |
506 | 478 | 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 | ||
507 | 483 | local player_name = player:get_player_name() |
508 | 484 | |
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] | |
518 | 493 | |
519 | 494 | local craft = crafts[alternate] |
520 | 495 | if craft.width > 3 then return end |
521 | 496 | |
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") | |
561 | 500 | end |
562 | 501 | |
563 | 502 | minetest.register_on_player_receive_fields(function(player, formname, fields) |
503 | if formname ~= "" then | |
504 | return | |
505 | end | |
506 | ||
564 | 507 | for k, v in pairs(fields) do |
565 | 508 | if k:match("craftguide_craft_") then |
566 | 509 | craftguide_craft(player, formname, fields) |
8 | 8 | #If enabled, the trash slot can be used by those without both creative |
9 | 9 | #and the give privilege. |
10 | 10 | 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
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
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
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
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
0 | local S = unified_inventory.gettext | |
0 | local S = minetest.get_translator("unified_inventory") | |
1 | 1 | local F = minetest.formspec_escape |
2 | local ui = unified_inventory | |
3 | local COUNT = 5 | |
2 | 4 | |
3 | 5 | local hud_colors = { |
4 | 6 | {"#FFFFFF", 0xFFFFFF, S("White")}, |
8 | 10 | {"#2c4df1", 0x2c4df1, S("Blue")}, |
9 | 11 | } |
10 | 12 | |
11 | local hud_colors_max = #hud_colors | |
12 | ||
13 | -- Stores temporary player data (persists until player leaves) | |
13 | -- Storage compatibility code | |
14 | ||
15 | --[[ | |
16 | Stores temporary player data (persists until player leaves) | |
17 | [player_name] = { | |
18 | [<waypoint index>] = { | |
19 | edit = <edit current waypoint?>, | |
20 | hud = <hud ID>, | |
21 | }, | |
22 | [<waypoint index>] = { ... }, | |
23 | ... | |
24 | } | |
25 | ]] | |
14 | 26 | local waypoints_temp = {} |
15 | 27 | |
16 | unified_inventory.register_page("waypoints", { | |
28 | --[[ | |
29 | Datastorage format (per-player): | |
30 | { | |
31 | selected = <waypoint index>, | |
32 | [<waypoint index>] = { | |
33 | name = <name or nil> | |
34 | world_pos = <coordinates vector>, | |
35 | color = <"hud_colors" index>, | |
36 | active = <hud show waypoint?>, | |
37 | display_pos = <hud display coorinates?>, | |
38 | }, | |
39 | [<waypoint index>] = { ... }, | |
40 | ... | |
41 | } | |
42 | Player metadata format: | |
43 | { | |
44 | selected = <selected number>, | |
45 | -- Cannot mix integer/string keys in JSON | |
46 | data = { | |
47 | [<waypoint index>] = { same as above }, | |
48 | ... | |
49 | } | |
50 | } | |
51 | ]] | |
52 | ||
53 | local function set_waypoint_data(player, waypoints) | |
54 | local meta = player:get_meta() | |
55 | if not next(waypoints.data or {}) then | |
56 | -- Empty data. Do not save anything, or delete | |
57 | meta:set_string("ui_waypoints", "") | |
58 | else | |
59 | meta:set_string("ui_waypoints", minetest.write_json(waypoints)) | |
60 | end | |
61 | end | |
62 | ||
63 | local function migrate_datastorage(player, waypoints) | |
64 | -- Copy values from old table | |
65 | local new_data = { | |
66 | selected = waypoints.selected, | |
67 | data = {} | |
68 | } | |
69 | for i = 1, COUNT do | |
70 | new_data.data[i] = waypoints[i] | |
71 | end | |
72 | ||
73 | set_waypoint_data(player, new_data) | |
74 | ||
75 | -- Delete values, but keep one entry so that it's saved by datastorage | |
76 | for k, _ in pairs(waypoints) do | |
77 | waypoints[k] = nil | |
78 | end | |
79 | waypoints[1] = 1 | |
80 | end | |
81 | ||
82 | local have_datastorage = minetest.get_modpath("datastorage") ~= nil | |
83 | local function get_waypoint_data(player) | |
84 | local player_name = player:get_player_name() | |
85 | ||
86 | -- Migration step | |
87 | if have_datastorage then | |
88 | local waypoints = datastorage.get(player_name, "waypoints") | |
89 | if waypoints.selected then | |
90 | migrate_datastorage(player, waypoints) | |
91 | minetest.log("action", "[unified_inventory] " .. | |
92 | "Migrated waypoints of player: " .. player_name) | |
93 | end | |
94 | end | |
95 | ||
96 | -- Get directly from metadata | |
97 | local waypoints = player:get_meta():get("ui_waypoints") | |
98 | waypoints = waypoints and minetest.parse_json(waypoints) or {} | |
99 | waypoints.data = waypoints.data or {} | |
100 | ||
101 | return waypoints | |
102 | end | |
103 | ||
104 | ui.register_page("waypoints", { | |
17 | 105 | get_formspec = function(player) |
18 | 106 | local player_name = player:get_player_name() |
19 | ||
20 | -- build a "fake" temp entry if the server took too long | |
21 | -- during sign-on and returned an empty entry | |
22 | if not waypoints_temp[player_name] then waypoints_temp[player_name] = {hud = 1} end | |
23 | ||
24 | 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")) .. "]" | |
107 | local wp_info_x = ui.style_full.form_header_x + 1.25 | |
108 | local wp_info_y = ui.style_full.form_header_y + 0.5 | |
109 | local wp_bottom_row = ui.style_full.std_inv_y - 1 | |
110 | local wp_buttons_rj = ui.style_full.std_inv_x + 10.1 - ui.style_full.btn_spc | |
111 | local wp_edit_w = ui.style_full.btn_spc * 4 - 0.1 | |
112 | ||
113 | local waypoints = get_waypoint_data(player) | |
114 | local sel = waypoints.selected or 1 | |
115 | ||
116 | local formspec = { | |
117 | ui.style_full.standard_inv_bg, | |
118 | string.format("label[%f,%f;%s]", | |
119 | ui.style_full.form_header_x, ui.style_full.form_header_y, F(S("Waypoints"))), | |
120 | "image["..wp_info_x..","..wp_info_y..";1,1;ui_waypoints_icon.png]" | |
121 | } | |
122 | local n=4 | |
28 | 123 | |
29 | 124 | -- 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)).."]" | |
38 | end | |
39 | ||
40 | local i = waypoints.selected or 1 | |
41 | local waypoint = waypoints[i] or {} | |
42 | local temp = waypoints_temp[player_name][i] or {} | |
43 | local default_name = string.format(S("Waypoint %d"), i) | |
125 | for i = 1, COUNT do | |
126 | local sw="select_waypoint"..i | |
127 | formspec[n] = string.format("image_button[%f,%f;%f,%f;%sui_%i_icon.png;%s;]", | |
128 | ui.style_full.main_button_x, wp_bottom_row - (5-i) * ui.style_full.btn_spc, | |
129 | ui.style_full.btn_size, ui.style_full.btn_size, | |
130 | (i == sel) and "ui_blue_icon_background.png^" or "", | |
131 | i, sw) | |
132 | formspec[n+1] = "tooltip["..sw..";"..S("Select Waypoint #@1", i).."]" | |
133 | n = n + 2 | |
134 | end | |
135 | ||
136 | local waypoint = waypoints.data[sel] or {} | |
137 | local temp = waypoints_temp[player_name][sel] or {} | |
138 | local default_name = S("Waypoint @1", sel) | |
44 | 139 | |
45 | 140 | -- 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")).."]" | |
141 | local btnlist = { | |
142 | set_waypoint = { | |
143 | "ui_waypoint_set_icon.png", | |
144 | S("Set waypoint to current location") | |
145 | }, | |
146 | toggle_waypoint = { | |
147 | waypoint.active and "ui_on_icon.png" or "ui_off_icon.png", | |
148 | waypoint.active and S("Hide waypoint") or S("Show waypoint") | |
149 | }, | |
150 | toggle_display_pos = { | |
151 | 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)", | |
152 | waypoint.display_pos and S("Hide coordinates") or S("Show coordinates") | |
153 | }, | |
154 | toggle_color = { | |
155 | "ui_circular_arrows_icon.png", | |
156 | S("Change color of waypoint display") | |
157 | }, | |
158 | rename_waypoint = { | |
159 | "ui_pencil_icon.png", | |
160 | S("Edit waypoint name") | |
161 | } | |
162 | } | |
163 | ||
164 | local x = 4 | |
165 | for name, def in pairs(btnlist) do | |
166 | formspec[n] = string.format("image_button[%f,%f;%f,%f;%s;%s%i;]", | |
167 | wp_buttons_rj - ui.style_full.btn_spc * x, wp_bottom_row, | |
168 | ui.style_full.btn_size, ui.style_full.btn_size, | |
169 | def[1], name, sel) | |
170 | formspec[n+1] = "tooltip["..name..sel..";"..F(def[2]).."]" | |
171 | x = x - 1 | |
172 | n = n + 2 | |
173 | end | |
82 | 174 | |
83 | 175 | -- Waypoint's info: |
84 | if waypoint.active then | |
85 | formspec = formspec .. "label[1,0.8;"..F(S("Waypoint active")).."]" | |
86 | else | |
87 | formspec = formspec .. "label[1,0.8;"..F(S("Waypoint inactive")).."]" | |
88 | end | |
176 | formspec[n] = ("label[%f,%f;%s]"):format( | |
177 | wp_info_x, wp_info_y + 1.1, | |
178 | F(waypoint.active and S("Waypoint active") or S("Waypoint inactive")) | |
179 | ) | |
180 | n = n + 1 | |
89 | 181 | |
90 | 182 | 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} | |
183 | formspec[n] = string.format("field[%f,%f;%f,%f;rename_box%i;;%s]", | |
184 | wp_buttons_rj - wp_edit_w - 0.1, wp_bottom_row - ui.style_full.btn_spc, | |
185 | wp_edit_w, ui.style_full.btn_size, sel, (waypoint.name or default_name)) | |
186 | formspec[n+1] = string.format("image_button[%f,%f;%f,%f;ui_ok_icon.png;confirm_rename%i;]", | |
187 | wp_buttons_rj, wp_bottom_row - ui.style_full.btn_spc, | |
188 | ui.style_full.btn_size, ui.style_full.btn_size, sel) | |
189 | formspec[n+2] = "tooltip[confirm_rename"..sel..";"..F(S("Finish editing")).."]" | |
190 | n = n + 3 | |
191 | end | |
192 | ||
193 | formspec[n] = string.format("label[%f,%f;%s: %s]", | |
194 | wp_info_x, wp_info_y+1.6, F(S("World position")), | |
195 | minetest.pos_to_string(waypoint.world_pos or vector.new())) | |
196 | formspec[n+1] = string.format("label[%f,%f;%s: %s]", | |
197 | wp_info_x, wp_info_y+2.10, F(S("Name")), (waypoint.name or default_name)) | |
198 | formspec[n+2] = string.format("label[%f,%f;%s: %s]", | |
199 | wp_info_x, wp_info_y+2.60, F(S("HUD text color")), hud_colors[waypoint.color or 1][3]) | |
200 | ||
201 | return {formspec=table.concat(formspec)} | |
108 | 202 | end, |
109 | 203 | }) |
110 | 204 | |
111 | unified_inventory.register_button("waypoints", { | |
205 | ui.register_button("waypoints", { | |
112 | 206 | type = "image", |
113 | 207 | image = "ui_waypoints_icon.png", |
114 | 208 | tooltip = S("Waypoints"), |
116 | 210 | }) |
117 | 211 | |
118 | 212 | local function update_hud(player, waypoints, temp, i) |
119 | local waypoint = waypoints[i] | |
213 | local waypoint = waypoints.data[i] | |
120 | 214 | if not waypoint then return end |
215 | ||
121 | 216 | temp[i] = temp[i] or {} |
122 | 217 | temp = temp[i] |
218 | ||
123 | 219 | local pos = waypoint.world_pos or vector.new() |
124 | 220 | local name |
125 | 221 | if waypoint.display_pos then |
128 | 224 | name = name..", "..waypoint.name |
129 | 225 | end |
130 | 226 | else |
131 | name = waypoint.name or "Waypoint "..i | |
132 | end | |
227 | name = waypoint.name or S("Waypoint @1", i) | |
228 | end | |
229 | ||
230 | -- Perform HUD updates | |
133 | 231 | if temp.hud then |
134 | 232 | player:hud_remove(temp.hud) |
233 | temp.hud = nil | |
135 | 234 | end |
136 | 235 | if waypoint.active then |
137 | 236 | temp.hud = player:hud_add({ |
141 | 240 | text = "m", |
142 | 241 | world_pos = pos |
143 | 242 | }) |
144 | else | |
145 | temp.hud = nil | |
146 | 243 | end |
147 | 244 | end |
148 | 245 | |
154 | 251 | local need_update_hud = false |
155 | 252 | local hit = false |
156 | 253 | |
157 | local waypoints = datastorage.get(player_name, "waypoints") | |
254 | local waypoints = get_waypoint_data(player) | |
158 | 255 | local temp = waypoints_temp[player_name] |
159 | for i = 1, 5, 1 do | |
256 | for i = 1, COUNT do | |
257 | local waypoint = waypoints.data[i] or {} | |
258 | ||
160 | 259 | if fields["select_waypoint"..i] then |
161 | 260 | hit = true |
162 | 261 | waypoints.selected = i |
165 | 264 | |
166 | 265 | if fields["toggle_waypoint"..i] then |
167 | 266 | hit = true |
168 | waypoints[i] = waypoints[i] or {} | |
169 | waypoints[i].active = not (waypoints[i].active) | |
267 | waypoint.active = not (waypoint.active) | |
170 | 268 | need_update_hud = true |
171 | 269 | update_formspec = true |
172 | 270 | end |
173 | 271 | |
174 | 272 | if fields["set_waypoint"..i] then |
175 | 273 | hit = true |
176 | local pos = player:getpos() | |
177 | pos.x = math.floor(pos.x) | |
178 | pos.y = math.floor(pos.y) | |
179 | pos.z = math.floor(pos.z) | |
180 | waypoints[i] = waypoints[i] or {} | |
181 | waypoints[i].world_pos = pos | |
274 | local pos = vector.round(player:get_pos()) | |
275 | waypoint.world_pos = pos | |
182 | 276 | need_update_hud = true |
183 | 277 | update_formspec = true |
184 | 278 | end |
192 | 286 | |
193 | 287 | if fields["toggle_display_pos"..i] then |
194 | 288 | hit = true |
195 | waypoints[i] = waypoints[i] or {} | |
196 | waypoints[i].display_pos = not waypoints[i].display_pos | |
289 | waypoint.display_pos = not waypoint.display_pos | |
197 | 290 | need_update_hud = true |
198 | 291 | update_formspec = true |
199 | 292 | end |
200 | 293 | |
201 | 294 | if fields["toggle_color"..i] then |
202 | 295 | hit = true |
203 | waypoints[i] = waypoints[i] or {} | |
204 | local color = waypoints[i].color or 1 | |
296 | local color = waypoint.color or 0 | |
205 | 297 | color = color + 1 |
206 | if color > hud_colors_max then | |
298 | if color > #hud_colors then | |
207 | 299 | color = 1 |
208 | 300 | end |
209 | waypoints[i].color = color | |
301 | waypoint.color = color | |
210 | 302 | need_update_hud = true |
211 | 303 | update_formspec = true |
212 | 304 | end |
213 | 305 | |
214 | 306 | if fields["confirm_rename"..i] then |
215 | 307 | hit = true |
216 | waypoints[i] = waypoints[i] or {} | |
308 | temp[i] = temp[i] or {} | |
217 | 309 | temp[i].edit = false |
218 | waypoints[i].name = fields["rename_box"..i] | |
219 | need_update_hud = true | |
220 | update_formspec = true | |
221 | end | |
310 | waypoint.name = fields["rename_box"..i] | |
311 | need_update_hud = true | |
312 | update_formspec = true | |
313 | end | |
314 | ||
315 | if hit then | |
316 | -- Save first | |
317 | waypoints.data[i] = waypoint | |
318 | set_waypoint_data(player, waypoints) | |
319 | end | |
320 | -- Update after | |
222 | 321 | if need_update_hud then |
223 | 322 | update_hud(player, waypoints, temp, i) |
224 | 323 | end |
225 | 324 | if update_formspec then |
226 | unified_inventory.set_inventory_formspec(player, "waypoints") | |
227 | end | |
325 | ui.set_inventory_formspec(player, "waypoints") | |
326 | end | |
327 | ||
228 | 328 | if hit then return end |
229 | 329 | end |
230 | 330 | end) |
232 | 332 | |
233 | 333 | minetest.register_on_joinplayer(function(player) |
234 | 334 | local player_name = player:get_player_name() |
235 | local waypoints = datastorage.get(player_name, "waypoints") | |
236 | local temp = {} | |
237 | waypoints_temp[player_name] = temp | |
238 | for i = 1, 5 do | |
239 | update_hud(player, waypoints, temp, i) | |
335 | local waypoints = get_waypoint_data(player) | |
336 | ||
337 | waypoints_temp[player_name] = {} | |
338 | for i = 1, COUNT do | |
339 | update_hud(player, waypoints, waypoints_temp[player_name], i) | |
240 | 340 | end |
241 | 341 | end) |
242 | 342 |