6 Commits

Author SHA1 Message Date
8c56e27c94 Merge remote-tracking branch 'github/master' 2022-05-27 18:54:23 +02:00
14da1a3dd0 Fix reverse item lookup ("usage") broken by 5ac2558
> return { specname }

This returned a number-indexed table whereas the code expects a name-indexed table
2022-04-22 22:01:15 +02:00
fa079c31b6 Obligatory screenshot update 2022-04-11 20:11:31 +02:00
c1fef26c87 Fix error caused by slow starts and mod dependencies 2022-04-11 19:42:06 +02:00
477acd2f89 Change background to rounded corners (#200)
This change is supposed to match the rounded inventory slot design.
2022-04-03 22:30:21 +02:00
19efce45ed Revert "Remove mod name from tooltips"
This reverts commit 64b0248c77.

The mod name may differ from the item name, in which cases it is
helpful to have this information contained in the tooltip.
No information is shown in case the mod name is missing.
2022-03-20 13:45:59 +01:00
7 changed files with 21 additions and 8 deletions

View File

@ -151,7 +151,7 @@ minetest.after(0.01, function()
-- Step 2: Find all matching items for the given spec (groups)
local function get_matching_spec_items(specname)
if specname:sub(1,6) ~= "group:" then
return { specname }
return { [specname] = true }
end
local accepted = {}
@ -177,6 +177,7 @@ minetest.after(0.01, function()
end
for _, recipes in pairs(ui.crafts_for.recipe) do
-- List of crafts that return this item string (variable "_")
for _, recipe in ipairs(recipes) do
local ingredient_items = {}
for _, spec in pairs(recipe.items) do

View File

@ -19,14 +19,12 @@ minetest.register_on_joinplayer(function(player)
unified_inventory.items_list
unified_inventory.activefilter[player_name] = ""
unified_inventory.active_search_direction[player_name] = "nochange"
unified_inventory.apply_filter(player, "", "nochange")
unified_inventory.current_searchbox[player_name] = ""
unified_inventory.current_category[player_name] = "all"
unified_inventory.current_category_scroll[player_name] = 0
unified_inventory.alternate[player_name] = 1
unified_inventory.current_item[player_name] = nil
unified_inventory.current_craft_direction[player_name] = "recipe"
unified_inventory.set_inventory_formspec(player, unified_inventory.default)
-- Refill slot
local refill = minetest.create_detached_inventory(player_name.."refill", {
@ -48,6 +46,14 @@ minetest.register_on_joinplayer(function(player)
refill:set_size("main", 1)
end)
minetest.register_on_mods_loaded(function()
minetest.register_on_joinplayer(function(player)
-- After everything is initialized, set up the formspec
ui.apply_filter(player, "", "nochange")
ui.set_inventory_formspec(player, unified_inventory.default)
end)
end)
local function apply_new_filter(player, search_text, new_dir)
local player_name = player:get_player_name()

View File

@ -50,7 +50,7 @@ unified_inventory = {
trash_enabled = (minetest.settings:get_bool("unified_inventory_trash") ~= false),
imgscale = 1.25,
list_img_offset = 0.13,
standard_background = "background9[0,0;1,1;ui_formbg_9_sliced.png;true;16]",
standard_background = "bgcolor[#0000]background9[0,0;1,1;ui_formbg_9_sliced.png;true;16]",
version = 4
}

View File

@ -115,9 +115,9 @@ local function formspec_add_categories(player, formspec, ui_peruser)
ui_peruser.form_header_y - (ui_peruser.is_lite_mode and 0 or 0.2)
}
formspec[n] = string.format("background9[%f,%f;%f,%f;%s;false;3]",
ui_peruser.page_x-0.1, categories_scroll_pos[2],
(ui_peruser.btn_spc * ui_peruser.pagecols) + 0.13, 1.4 + (ui_peruser.is_lite_mode and 0 or 0.2),
formspec[n] = string.format("background9[%f,%f;%f,%f;%s;false;16]",
ui_peruser.page_x-0.15, categories_scroll_pos[2],
(ui_peruser.btn_spc * ui_peruser.pagecols) + 0.2, 1.4 + (ui_peruser.is_lite_mode and 0 or 0.2),
"ui_smallbg_9_sliced.png")
n = n + 1
@ -256,8 +256,14 @@ local function formspec_add_item_browser(player, formspec, ui_peruser)
ui_peruser.btn_size, ui_peruser.btn_size,
name, button_name
)
local tooltip = item.description
if item.mod_origin then
-- "mod_origin" may not be specified for items that were
-- registered in a callback (during or before ServerEnv init)
tooltip = tooltip .. " [" .. item.mod_origin .. "]"
end
formspec[n + 1] = ("tooltip[%s;%s]"):format(
button_name, minetest.formspec_escape(item.description)
button_name, minetest.formspec_escape(tooltip)
)
n = n + 2
list_index = list_index + 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B

After

Width:  |  Height:  |  Size: 551 B