Typos and stuff
This commit is contained in:
parent
f287b668b7
commit
d2ed87776a
|
@ -81,27 +81,29 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
if clicked_category
|
||||
and clicked_category ~= unified_inventory.current_category[player_name] then
|
||||
unified_inventory.current_category[player_name] = clicked_category
|
||||
|
||||
unified_inventory.apply_filter(player, unified_inventory.current_searchbox[player_name], "nochange")
|
||||
unified_inventory.set_inventory_formspec(player,
|
||||
unified_inventory.current_page[player_name])
|
||||
end
|
||||
|
||||
if fields.next_category then
|
||||
local scroll = unified_inventory.current_category_scroll[player_name] + 1
|
||||
unified_inventory.current_category_scroll[player_name] = math.min(#unified_inventory.category_list-ui_peruser.pagecols, scroll)
|
||||
unified_inventory.set_inventory_formspec(player,
|
||||
unified_inventory.current_page[player_name])
|
||||
local scroll = math.min(#unified_inventory.category_list-ui_peruser.pagecols, unified_inventory.current_category_scroll[player_name] + 1)
|
||||
if scroll ~= unified_inventory.current_category_scroll[player_name] then
|
||||
unified_inventory.current_category_scroll[player_name] = scroll
|
||||
unified_inventory.set_inventory_formspec(player,
|
||||
unified_inventory.current_page[player_name])
|
||||
end
|
||||
end
|
||||
if fields.prev_category then
|
||||
local scroll = unified_inventory.current_category_scroll[player_name] - 1
|
||||
unified_inventory.current_category_scroll[player_name] = math.max(0, scroll)
|
||||
unified_inventory.set_inventory_formspec(player,
|
||||
unified_inventory.current_page[player_name])
|
||||
local scroll = math.max(0, unified_inventory.current_category_scroll[player_name] - 1)
|
||||
if scroll ~= unified_inventory.current_category_scroll[player_name] then
|
||||
unified_inventory.current_category_scroll[player_name] = scroll
|
||||
unified_inventory.set_inventory_formspec(player,
|
||||
unified_inventory.current_page[player_name])
|
||||
end
|
||||
end
|
||||
|
||||
for i, def in pairs(unified_inventory.buttons) do
|
||||
|
|
|
@ -12,7 +12,7 @@ function update_category_list()
|
|||
index = -2,
|
||||
})
|
||||
table.insert(category_list, {
|
||||
name = "uncategorised",
|
||||
name = "uncategorized",
|
||||
label = "Misc.",
|
||||
symbol = "ui_no.png",
|
||||
index = -1,
|
||||
|
@ -23,9 +23,8 @@ function update_category_list()
|
|||
name = category,
|
||||
label = def.label or category,
|
||||
symbol = def.symbol,
|
||||
index =
|
||||
def.index or -- sortby defined order
|
||||
((b1-64)*0.01)+((b2-64)*0.0001) -- or do a rhudimentary alphabetical sort
|
||||
index = def.index or -- sortby defined order
|
||||
((b1-64)*0.01)+((b2-64)*0.0001) -- or do a rudimentary alphabetical sort
|
||||
})
|
||||
end
|
||||
table.sort(category_list, function (a,b)
|
||||
|
|
|
@ -618,14 +618,15 @@ unified_inventory.add_category_items('lighting', {
|
|||
"unified_inventory:bag_small",
|
||||
]]
|
||||
|
||||
-- LIST UNCATEGORISED AFTER LOAD
|
||||
-- minetest.after(5, function ( )
|
||||
-- local l = {}
|
||||
-- for name,_ in pairs(minetest.registered_items) do
|
||||
-- if not unified_inventory.find_category(name) then
|
||||
-- table.insert(l, name)
|
||||
-- end
|
||||
-- end
|
||||
-- table.sort(l)
|
||||
-- minetest.log(table.concat(l, '",'.."\n"..'"'))
|
||||
-- end)
|
||||
--[[ LIST UNCATEGORIZED AFTER LOAD
|
||||
minetest.after(5, function ( )
|
||||
local l = {}
|
||||
for name,_ in pairs(minetest.registered_items) do
|
||||
if not unified_inventory.find_category(name) then
|
||||
table.insert(l, name)
|
||||
end
|
||||
end
|
||||
table.sort(l)
|
||||
minetest.log(table.concat(l, '",'.."\n"..'"'))
|
||||
end)
|
||||
]]
|
|
@ -312,7 +312,7 @@ function ui.apply_filter(player, filter, search_dir)
|
|||
table.insert(ui.filtered_items_list[player_name], name)
|
||||
end
|
||||
end
|
||||
elseif category == 'uncategorised' then
|
||||
elseif category == 'uncategorized' then
|
||||
for name, def in pairs(minetest.registered_items) do
|
||||
if (not ui.find_category(name))
|
||||
and (not def.groups.not_in_creative_inventory
|
||||
|
|
Loading…
Reference in New Issue