24 Commits

Author SHA1 Message Date
aa04d4539f Merge remote-tracking branch 'github/master' 2023-06-07 22:58:05 +02:00
a977ec47fd Merge remote-tracking branch 'upstream/master' 2022-08-26 15:24:41 +02:00
8c56e27c94 Merge remote-tracking branch 'github/master' 2022-05-27 18:54:23 +02:00
6da71e1819 Merge remote-tracking branch 'upstream/master' 2022-03-05 11:37:32 +01:00
9649c0ed0e Merge remote-tracking branch 'github/master' 2022-01-22 20:08:35 +01:00
4633a276a2 Merge remote-tracking branch 'upstream/master' 2021-12-17 18:16:48 +01:00
1ac54a017d Merge remote-tracking branch 'github/master' 2021-11-26 21:45:26 +01:00
4c4fb3ba88 Merge remote-tracking branch 'github/master' 2021-11-01 10:43:50 +01:00
9d66a21271 Merge remote-tracking branch 'upstream/master' 2021-08-31 20:12:45 +02:00
15a84bdbf4 Merge remote-tracking branch 'upstream/master' 2021-07-24 13:14:48 +02:00
838c67ae86 Merge remote-tracking branch 'upstream/master' 2021-07-17 20:48:14 +02:00
132a362f85 Merge remote-tracking branch 'upstream/master' 2021-06-20 17:33:07 +02:00
03b077cd1b Merge remote-tracking branch 'upstream/master' 2021-04-08 13:39:49 +02:00
829b38c6fc Merge remote-tracking branch 'upstream/master' 2021-04-04 21:05:40 +02:00
70fdb8556b Merge remote-tracking branch 'upstream/master' 2021-03-12 12:01:23 +01:00
497c632b24 Merge remote-tracking branch 'upstream/master' 2020-12-18 12:20:14 +01:00
46eeb36784 Merge remote-tracking branch 'upstream/master' 2020-07-18 11:28:21 +02:00
9a31609cfd Merge remote-tracking branch 'upstream/master' into nalc-1.2-dev 2020-06-14 22:55:56 +02:00
8e6a3740ae Merge branch 'master' of yunohost.local:minetest-mods/unified_inventory into nalc-1.2-dev 2019-12-22 15:57:28 +01:00
1fd87f5c51 Suppression des icônes set_home et home_go 2019-05-01 17:28:36 +02:00
e5dc9ed53a Merge branch 'master' into nalc-1.1 2019-05-01 17:15:35 +02:00
4bf5f22696 Merge branch 'master' into nalc 2019-01-19 19:43:32 +01:00
4f666f93d0 Ajoute message de chargement du mod dans le journal "action" 2019-01-19 19:43:04 +01:00
264833ed41 Place les boutons d'inventaires sur 2 lignes 2018-11-20 22:04:24 +01:00
8 changed files with 97 additions and 189 deletions

View File

@ -12,9 +12,8 @@ local function is_recipe_craftable(recipe)
end
else
-- Possibly an item
local itemname_cleaned = ItemStack(itemname):get_name()
if not minetest.registered_items[itemname_cleaned]
or minetest.get_item_group(itemname_cleaned, "not_in_craft_guide") ~= 0 then
if not minetest.registered_items[itemname]
or minetest.get_item_group(itemname, "not_in_craft_guide") ~= 0 then
return false
end
end
@ -51,7 +50,6 @@ minetest.after(0.01, function()
end
end
end
table.sort(ui.items_list)
ui.items_list_size = #ui.items_list
print("Unified Inventory. Inventory size: "..ui.items_list_size)

View File

@ -221,11 +221,6 @@ minetest.register_on_joinplayer(function(player)
on_take = function(inv, listname, index, stack, player)
player:get_inventory():set_size(listname .. "contents", 0)
save_bags_metadata(player, inv)
if listname == ui.current_page[player:get_player_name()] then
-- Bag is currently open: avoid follow-up issues by navigating back
-- Trick: the list name is the same as the registered page name
ui.set_inventory_formspec(player, "bags")
end
end,
allow_move = function()
return 0

View File

@ -53,9 +53,8 @@ unified_inventory = {
standard_background = "bgcolor[#0000]background9[0,0;1,1;ui_formbg_9_sliced.png;true;16]",
hide_disabled_buttons = minetest.settings:get_bool("unified_inventory_hide_disabled_buttons", false),
hide_uncraftable_items = minetest.settings:get_bool("unified_inventory_hide_uncraftable_items", false),
version = 5
version = 4
}
local ui = unified_inventory
@ -192,10 +191,9 @@ dofile(modpath.."/register.lua")
if minetest.settings:get_bool("unified_inventory_bags") ~= false then
dofile(modpath.."/bags.lua")
end
if minetest.settings:get_bool("unified_inventory_item_names") ~= false then
dofile(modpath.."/item_names.lua")
end
if minetest.settings:get_bool("unified_inventory_waypoints") ~= false then
dofile(modpath.."/waypoints.lua")
end
dofile(modpath.."/item_names.lua")
dofile(modpath.."/waypoints.lua")
dofile(modpath.."/legacy.lua") -- mod compatibility
minetest.log("action", "[unified_inventory] loaded.")

View File

@ -270,8 +270,8 @@ local function formspec_add_item_browser(player, formspec, ui_peruser)
button_name, minetest.formspec_escape(tooltip)
)
n = n + 2
list_index = list_index + 1
end
list_index = list_index + 1
end
end
formspec[n] = "style[page_number;content_offset=0]"
@ -349,25 +349,12 @@ function ui.apply_filter(player, filter, search_dir)
end
local player_name = player:get_player_name()
-- Whether to show uncraftable items
local fprefilter = function(_)
return true
end
if ui.hide_uncraftable_items and not ui.is_creative(player_name) then
fprefilter = function(name)
return ui.get_recipe_list(name)
end
end
local registered_items = minetest.registered_items
local lfilter = string.lower(filter)
local ffilter
if lfilter:sub(1, 6) == "group:" then
-- Group filter: all groups of the item must match
local groups = lfilter:sub(7):split(",")
ffilter = function(name)
local def = registered_items[name]
ffilter = function(name, def)
for _, group in ipairs(groups) do
if not def.groups[group]
or def.groups[group] <= 0 then
@ -381,8 +368,7 @@ function ui.apply_filter(player, filter, search_dir)
local player_info = minetest.get_player_information(player_name)
local lang = player_info and player_info.lang_code or ""
ffilter = function(name)
local def = registered_items[name]
ffilter = function(name, def)
local lname = string.lower(name)
local ldesc = string.lower(def.description)
local llocaldesc = minetest.get_translated_string
@ -392,29 +378,32 @@ function ui.apply_filter(player, filter, search_dir)
end
end
local is_itemdef_listable = ui.is_itemdef_listable
local filtered_items = {}
local category = ui.current_category[player_name] or 'all'
if category == 'all' then
for _, name in ipairs(ui.items_list) do
if fprefilter(name) and ffilter(name) then
for name, def in pairs(minetest.registered_items) do
if is_itemdef_listable(def)
and ffilter(name, def) then
table.insert(filtered_items, name)
end
end
elseif category == 'uncategorized' then
for _, name in ipairs(ui.items_list) do
if not ui.find_category(name)
and fprefilter(name)
and ffilter(name) then
for name, def in pairs(minetest.registered_items) do
if is_itemdef_listable(def)
and not ui.find_category(name)
and ffilter(name, def) then
table.insert(filtered_items, name)
end
end
else
-- Any other category is selected
for name, exists in pairs(ui.registered_category_items[category]) do
if exists
and fprefilter(name)
and ffilter(name) then
local def = minetest.registered_items[name]
if exists and def
and is_itemdef_listable(def)
and ffilter(name, def) then
table.insert(filtered_items, name)
end
end

View File

@ -3,8 +3,6 @@
local item_names = {} -- [player_name] = { hud, dtime, itemname }
local dlimit = 3 -- HUD element will be hidden after this many seconds
local hudbars_mod = minetest.get_modpath("hudbars")
local only_names = minetest.settings:get_bool("unified_inventory_only_names", true)
local max_length = tonumber(minetest.settings:get("unified_inventory_max_item_name_length")) or 80
local function set_hud(player)
local player_name = player:get_player_name()
@ -62,7 +60,6 @@ minetest.register_globalstep(function(dtime)
data.itemname = itemname
data.index = index
data.dtime = 0
local lang_code = minetest.get_player_information(player:get_player_name()).lang_code
local desc = stack.get_meta
and stack:get_meta():get_string("description")
@ -72,14 +69,6 @@ minetest.register_globalstep(function(dtime)
local def = minetest.registered_items[itemname]
desc = def and def.description or ""
end
if only_names and desc and string.find(desc, "\n") then
desc = string.match(desc, "([^\n]*)")
end
desc = minetest.get_translated_string(lang_code, desc)
desc = minetest.strip_colors(desc)
if string.len(desc) > max_length and max_length > 0 then
desc = string.sub(desc, 1, max_length) .. " [...]"
end
player:hud_change(data.hud, 'text', desc)
end
end

View File

@ -1,91 +1,98 @@
# textdomain: unified_inventory
Category:=Kategorie:
Mixing=Miksowanie
Cooking=Gotowanie
Digging=Kopanie
Mixing=
Cooking=
Digging=
Bags=Plecaki
Bag @1=Plecak @1
Small Bag=Mały plecak
Medium Bag=Średni plecak
Large Bag=Duży plecak
All Items=Wszystkie przedmioty
Misc. Items=Różne przedmioty
Plant Life=Życie roślin
Building Materials=Materiały budowlane
Tools=Narzędzia
Minerals and Metals=Minerały i metale
Environment and Worldgen=Otoczenie i generowanie świata
Lighting=Oświetlenie
Small Bag=Maly plecak
Medium Bag=Sredni plecak
Large Bag=Duzy plecak
All Items=
Misc. Items=
Plant Life=
Building Materials=
Tools=
Minerals and Metals=
Environment and Worldgen=
Lighting=
and = i
Scroll categories left=Przewiń kategorię w lewo
Scroll categories right=Przewiń kategorię w prawo
Scroll categories left=
Scroll categories right=
Search=Szukaj
Reset search and display everything=Zresetuj wyszukiwanie i pokaż wszystko
Reset search and display everything=
First page=Pierwsza strona
Back three pages=Trzy strony do tyłu
Back one page=Stronę do tyłu
Forward one page=Stronę do przodu
Forward three pages=Trzy strony do przodu
Back three pages=3 strony w tyl
Back one page=1 strona w tyl
Forward one page=1 strona do przodu
Forward three pages=3 strony do przodu
Last page=Ostatnia strona
No matching items=Brak pasujących przedmiotów
No matching items=Brak pasujacych przedmiotow
No matches.=Brak wyników
Page=Strona
@1 of @2=@1 z @2
Filter=Filtr
Can use the creative inventory=Może używać kreatywnego ekwipunku
Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally=Wymusza wyświetlanie Unified Inventory w trybie Full jeżeli tryb Lite jest skonfigurowany globalnie
Crafting Grid=Siatka craftingu
Crafting Guide=Przewodnik craftingu
Set home position=Ustaw pozycję domu
Home position set to: @1=Pozycja domu ustawiona na: @1
You don't have the "home" privilege!=Brak uprawnień "home"!
Can use the creative inventory=
Forces Unified Inventory to be displayed in Full mode if Lite mode is configured globally=
Crafting Grid=
Crafting Guide=
Set home position=Ustaw pozycję wyjściową
Home position set to: @1=Pozycja domowa ustawiona na: @1
You don't have the "home" privilege!=Nie masz uprawnien do zmiany czasu "home"!
Go home=Idź do domu
Set time to day=Ustaw czas na dzień
Time of day set to 6am=Czas ustawiony na 6:00
You don't have the settime privilege!=Brak uprawnień "settime"!
You don't have the settime privilege!=Nie masz uprawnien do zmiany czasu "settime"!
Set time to night=Ustaw czas na noc
Time of day set to 9pm=Czas ustawiony na 21:00
Clear inventory=Wyczyść ekwipunek
This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.=Aby zapobiec przypadkowemu skasowaniu ekwipunku, ten przycisk został wyłączony poza trybem kreatywnym.@nUżyj zamiast tego ikony śmietnika.
Inventory cleared!=Ekwipunek został wyczyszczony!
Trash:=Śmietnik:
Refill:=Uzupełnianie:
Any item belonging to the @1 group=Każdy przedmiot należący do @1 grupy
Any item belonging to the groups @1=Każdy przedmiot należacy do grup @1
Clear inventory=Wyczyść zapasy
This button has been disabled outside of creative mode to prevent accidental inventory trashing.@nUse the trash slot instead.=
Inventory cleared!=Zapasy zostały wyczyszczone!
Trash:=Smietnik:
Refill:=Uzupelnianie:
Any item belonging to the @1 group=
Any item belonging to the groups @1=
Recipe @1 of @2=Recepta @1 z @2
Usage @1 of @2=Użycie @1 z @2
No recipes=Brak recepty
No usages=Bez użycia
Result=Wynik
Ingredient=Składnik
Show next recipe=Pokaż nastepną recepturę
Show next usage=Pokaż następne użycie
Show previous recipe=Pokaż poprzednią recepturę
Show previous usage=Pokaż poprzednie użycie
@1 (@2)=@1 (@2)
Show next recipe=
Show next usage=
Show previous recipe=
Show previous usage=
@1 (@2)=
Give me:=Daj mi:
This recipe is too@@large to be displayed.=Receptura jest zbyt@@duża aby ją wyświetlić.
To craft grid:=Do siatki craftingu.
This recipe is too@@large to be displayed.=
To craft grid:=
All=Wszystko
Crafting=Crafting
White=Biały
Yellow=Zółty
Crafting=
White=Bialy
Yellow=Zolty
Red=Czerwony
Green=Zielony
Blue=Niebieski
Waypoints=Punkty orientacyjne
Select Waypoint #@1=Wybierz punkt #@1
Waypoint @1=Punkty orientacyjne @1
Set waypoint to current location=Ustaw punkt orientacyjny na bieżacej pozycji
Hide waypoint=Ukryj punkt orientacyjny
Show waypoint=Pokaż punkt orientacyjny
Hide coordinates=Ukryj koordynaty
Show coordinates=Pokaż koordynaty
Change color of waypoint display=Zmień kolor punktu
Edit waypoint name=Edytuj nazwę punktu
Waypoint active=Punkt włączony
Waypoint inactive=Punkt wyłączony
Finish editing=Zakończ edycję
Set waypoint to current location=Ustaw punkt orientacyjny na biezacej pozycji
Hide waypoint=
Show waypoint=
Hide coordinates=
Show coordinates=
Change color of waypoint display=Zmien kolor punktu
Edit waypoint name=Edytuj nazwe punktu
Waypoint active=Punkt wlaczony
Waypoint inactive=Punkt wylaczony
Finish editing=Zakoncz edycje
World position=Pozycja
Name=Nazwa
HUD text color=Kolor tekstu HUD
HUD text color=Kolor tekstu HUD
##### not used anymore #####
invisible=niewidzialny
visible=widomy
Make waypoint @1=Robić punkt @1
@1 display of waypoint coordinates=@1 koordynatow punktu

View File

@ -41,55 +41,6 @@ ui.register_button("craftguide", {
tooltip = S("Crafting Guide")
})
ui.register_button("home_gui_set", {
type = "image",
image = "ui_sethome_icon.png",
tooltip = S("Set home position"),
hide_lite=true,
action = function(player)
local player_name = player:get_player_name()
if minetest.check_player_privs(player_name, {home=true}) then
ui.set_home(player, player:get_pos())
local home = ui.home_pos[player_name]
if home ~= nil then
minetest.sound_play("dingdong",
{to_player=player_name, gain = 1.0})
minetest.chat_send_player(player_name,
S("Home position set to: @1", minetest.pos_to_string(home)))
end
else
minetest.chat_send_player(player_name,
S("You don't have the \"home\" privilege!"))
ui.set_inventory_formspec(player, ui.current_page[player_name])
end
end,
condition = function(player)
return minetest.check_player_privs(player:get_player_name(), {home=true})
end,
})
ui.register_button("home_gui_go", {
type = "image",
image = "ui_gohome_icon.png",
tooltip = S("Go home"),
hide_lite=true,
action = function(player)
local player_name = player:get_player_name()
if minetest.check_player_privs(player_name, {home=true}) then
if ui.go_home(player) then
minetest.sound_play("teleport", {to_player = player_name})
end
else
minetest.chat_send_player(player_name,
S("You don't have the \"home\" privilege!"))
ui.set_inventory_formspec(player, ui.current_page[player_name])
end
end,
condition = function(player)
return minetest.check_player_privs(player:get_player_name(), {home=true})
end,
})
ui.register_button("misc_set_day", {
type = "image",
image = "ui_sun_icon.png",

View File

@ -1,36 +1,17 @@
# Reduced formspec layout, optimized for smaller displays.
# Note: This may also disable some features to free up visual space.
#Enabling lite mode enables a smaller and simpler version of the Unified
#Inventory, optimized for small displays.
unified_inventory_lite (Lite mode) bool false
# Provides craftable bag items to extend the inventory space.
#If enabled, bags will be made available which can be used to extend
#inventory storage size.
unified_inventory_bags (Enable bags) bool true
# Shows the trash slot to everyone.
# When disabled, only players with the privilege "creative" or "give" will
# have this slot shown in their inventory.
#If enabled, the trash slot can be used by those without both creative
#and the give privilege.
unified_inventory_trash (Enable trash) bool true
# Provides waypoints on a per-player basis to remember positions on the map.
unified_inventory_waypoints (Enable waypoints) bool true
# If enabled, disabled buttons will be hidden instead of grayed out.
#If enabled, disabled buttons will be hidden instead of grayed out.
unified_inventory_hide_disabled_buttons (Hide disabled buttons) bool false
# Hides items with no known craft recipe from the category "all" (default).
# This setting has no effect on players in creative mode.
unified_inventory_hide_uncraftable_items (Hide uncraftable items) bool false
# Automatically categorizes registered items based on their
# groups. This is based on a fuzzy match, thus is not 100% accurate.
unified_inventory_automatic_categorization (Categories: add items automatically) bool true
# Shows the selected wielded item description in the HUD for a few seconds.
unified_inventory_item_names (Enable HUD item names) bool true
# Trims the shown wielded item description to the first line.
unified_inventory_only_names (HUD item name: first line only) bool true
# Hard character limit of the wielded item description.
# Crops the shown description to the specified length.
# 0 disables this functionality.
unified_inventory_max_item_name_length (HUD item names: character limit) int 80
unified_inventory_automatic_categorization (Items automatically added to categories) bool true