Merge remote-tracking branch 'github/master'

This commit is contained in:
bri cassa 2023-11-25 15:40:23 +01:00
commit cb6e602497
6 changed files with 107 additions and 79 deletions

View File

@ -12,8 +12,9 @@ local function is_recipe_craftable(recipe)
end end
else else
-- Possibly an item -- Possibly an item
if not minetest.registered_items[itemname] local itemname_cleaned = ItemStack(itemname):get_name()
or minetest.get_item_group(itemname, "not_in_craft_guide") ~= 0 then if not minetest.registered_items[itemname_cleaned]
or minetest.get_item_group(itemname_cleaned, "not_in_craft_guide") ~= 0 then
return false return false
end end
end end

View File

@ -221,6 +221,11 @@ minetest.register_on_joinplayer(function(player)
on_take = function(inv, listname, index, stack, player) on_take = function(inv, listname, index, stack, player)
player:get_inventory():set_size(listname .. "contents", 0) player:get_inventory():set_size(listname .. "contents", 0)
save_bags_metadata(player, inv) 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, end,
allow_move = function() allow_move = function()
return 0 return 0

View File

@ -191,9 +191,12 @@ dofile(modpath.."/register.lua")
if minetest.settings:get_bool("unified_inventory_bags") ~= false then if minetest.settings:get_bool("unified_inventory_bags") ~= false then
dofile(modpath.."/bags.lua") dofile(modpath.."/bags.lua")
end end
if minetest.settings:get_bool("unified_inventory_item_names") ~= false then
dofile(modpath.."/item_names.lua") dofile(modpath.."/item_names.lua")
dofile(modpath.."/waypoints.lua") end
if minetest.settings:get_bool("unified_inventory_waypoints") ~= false then
dofile(modpath.."/waypoints.lua")
end
dofile(modpath.."/legacy.lua") -- mod compatibility dofile(modpath.."/legacy.lua") -- mod compatibility
minetest.log("action", "[unified_inventory] loaded.") minetest.log("action", "[unified_inventory] loaded.")

View File

@ -3,6 +3,8 @@
local item_names = {} -- [player_name] = { hud, dtime, itemname } local item_names = {} -- [player_name] = { hud, dtime, itemname }
local dlimit = 3 -- HUD element will be hidden after this many seconds local dlimit = 3 -- HUD element will be hidden after this many seconds
local hudbars_mod = minetest.get_modpath("hudbars") 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 function set_hud(player)
local player_name = player:get_player_name() local player_name = player:get_player_name()
@ -60,6 +62,7 @@ minetest.register_globalstep(function(dtime)
data.itemname = itemname data.itemname = itemname
data.index = index data.index = index
data.dtime = 0 data.dtime = 0
local lang_code = minetest.get_player_information(player:get_player_name()).lang_code
local desc = stack.get_meta local desc = stack.get_meta
and stack:get_meta():get_string("description") and stack:get_meta():get_string("description")
@ -69,6 +72,14 @@ minetest.register_globalstep(function(dtime)
local def = minetest.registered_items[itemname] local def = minetest.registered_items[itemname]
desc = def and def.description or "" desc = def and def.description or ""
end 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) player:hud_change(data.hud, 'text', desc)
end end
end end

View File

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

@ -1,17 +1,32 @@
#Enabling lite mode enables a smaller and simpler version of the Unified # Reduced formspec layout, optimized for smaller displays.
#Inventory, optimized for small displays. # Note: This may also disable some features to free up visual space.
unified_inventory_lite (Lite mode) bool false unified_inventory_lite (Lite mode) bool false
#If enabled, bags will be made available which can be used to extend # Provides craftable bag items to extend the inventory space.
#inventory storage size.
unified_inventory_bags (Enable bags) bool true unified_inventory_bags (Enable bags) bool true
#If enabled, the trash slot can be used by those without both creative # Shows the trash slot to everyone.
#and the give privilege. # When disabled, only players with the privilege "creative" or "give" will
# have this slot shown in their inventory.
unified_inventory_trash (Enable trash) bool true unified_inventory_trash (Enable trash) bool true
#If enabled, disabled buttons will be hidden instead of grayed out. # 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.
unified_inventory_hide_disabled_buttons (Hide disabled buttons) bool false unified_inventory_hide_disabled_buttons (Hide disabled buttons) 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
unified_inventory_automatic_categorization (Items automatically added to categories) 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