87f502a259
When the craft guide is showing a craft, the output slot is now a button, which causes the craft guide to show ways in which that output can be used. This mirrors the way input slots are buttons that show recipes for the selected ingredient. Usages of an item can be iterated through in the same way as recipes for the item. This incidentally offers some ability to retrace one's steps through a crafting chain, without storing actual history.
50 lines
1.5 KiB
Lua
50 lines
1.5 KiB
Lua
-- Unified Inventory for Minetest 0.4.8+
|
|
|
|
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
|
local worldpath = minetest.get_worldpath()
|
|
|
|
-- Data tables definitions
|
|
unified_inventory = {}
|
|
unified_inventory.activefilter = {}
|
|
unified_inventory.active_search_direction = {}
|
|
unified_inventory.alternate = {}
|
|
unified_inventory.current_page = {}
|
|
unified_inventory.current_searchbox = {}
|
|
unified_inventory.current_index = {}
|
|
unified_inventory.current_item = {}
|
|
unified_inventory.current_craft_direction = {}
|
|
unified_inventory.registered_craft_types = {}
|
|
unified_inventory.crafts_for = { usage = {}, recipe = {} }
|
|
unified_inventory.players = {}
|
|
unified_inventory.items_list_size = 0
|
|
unified_inventory.items_list = {}
|
|
unified_inventory.filtered_items_list_size = {}
|
|
unified_inventory.filtered_items_list = {}
|
|
unified_inventory.pages = {}
|
|
unified_inventory.buttons = {}
|
|
|
|
-- Homepos stuff
|
|
unified_inventory.home_pos = {}
|
|
unified_inventory.home_filename =
|
|
worldpath.."/unified_inventory_home.home"
|
|
|
|
-- Default inventory page
|
|
unified_inventory.default = "craft"
|
|
|
|
-- Disable default creative inventory
|
|
if creative_inventory then
|
|
function creative_inventory.set_creative_formspec(player, start_i, pagenum)
|
|
return
|
|
end
|
|
end
|
|
|
|
dofile(modpath.."/datastorage.lua")
|
|
dofile(modpath.."/group.lua")
|
|
dofile(modpath.."/api.lua")
|
|
dofile(modpath.."/internal.lua")
|
|
dofile(modpath.."/callbacks.lua")
|
|
dofile(modpath.."/register.lua")
|
|
dofile(modpath.."/bags.lua")
|
|
dofile(modpath.."/item_names.lua")
|
|
dofile(modpath.."/waypoints.lua")
|