mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-11-14 06:10:19 +01:00
Remove default hard dependency for use in devtest
This commit is contained in:
parent
afd38e0c73
commit
aeb9841e3a
|
@ -25,6 +25,10 @@ Unified Inventory replaces the default survival and creative inventory.
|
|||
## Requirements
|
||||
|
||||
* Minetest 5.4.0+
|
||||
* Mod `default` for category filters (contained in Minetest Game)
|
||||
* Mod `farming` for craftable bags (contained in Minetest Game)
|
||||
* Mod `datastorage` for waypoints (deprecated)
|
||||
|
||||
|
||||
# Licenses
|
||||
|
||||
|
|
11
category.lua
11
category.lua
|
@ -70,7 +70,7 @@ end
|
|||
local function ensure_category_exists(category_name)
|
||||
if not unified_inventory.registered_categories[category_name] then
|
||||
unified_inventory.registered_categories[category_name] = {
|
||||
symbol = "default:stick",
|
||||
symbol = "unknown_item.png",
|
||||
label = category_name
|
||||
}
|
||||
end
|
||||
|
@ -81,16 +81,17 @@ end
|
|||
|
||||
function unified_inventory.register_category(category_name, config)
|
||||
ensure_category_exists(category_name)
|
||||
if config and config.symbol then
|
||||
config = config or {}
|
||||
if config.symbol then
|
||||
unified_inventory.set_category_symbol(category_name, config.symbol)
|
||||
end
|
||||
if config and config.label then
|
||||
if config.label then
|
||||
unified_inventory.set_category_label(category_name, config.label)
|
||||
end
|
||||
if config and config.index then
|
||||
if config.index then
|
||||
unified_inventory.set_category_index(category_name, config.index)
|
||||
end
|
||||
if config and config.items then
|
||||
if config.items then
|
||||
unified_inventory.add_category_items(category_name, config.items)
|
||||
end
|
||||
update_category_list()
|
||||
|
|
2
init.lua
2
init.lua
|
@ -1,4 +1,4 @@
|
|||
-- Unified Inventory for Minetest >= 0.4.16
|
||||
-- Unified Inventory
|
||||
|
||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
local worldpath = minetest.get_worldpath()
|
||||
|
|
|
@ -29,6 +29,8 @@ local function formspec_button(ui_peruser, name, image, offset, pos, scale, labe
|
|||
local element = 'image_button'
|
||||
if minetest.registered_items[image] then
|
||||
element = 'item_image_button'
|
||||
elseif image:find(":", 1, true) then
|
||||
image = "unknown_item.png"
|
||||
end
|
||||
local spc = (1-scale)*ui_peruser.btn_size/2
|
||||
local size = ui_peruser.btn_size*scale
|
||||
|
|
4
mod.conf
4
mod.conf
|
@ -1,6 +1,6 @@
|
|||
name = unified_inventory
|
||||
depends = default
|
||||
optional_depends = creative, sfinv, datastorage, farming
|
||||
|
||||
optional_depends = default, creative, sfinv, datastorage, farming
|
||||
description = """
|
||||
Unified Inventory replaces the default survival and creative inventory.
|
||||
It adds a nicer interface and a number of features, such as a crafting guide.
|
||||
|
|
Loading…
Reference in New Issue
Block a user