tooltips added

This commit is contained in:
Joachim Stolberg 2019-01-13 12:21:42 +01:00
parent 849a2eacd1
commit ace17bca05

@ -47,10 +47,10 @@ local function formspec(self, pos, meta)
"list[context;input;1,3.6;8,1;]".. "list[context;input;1,3.6;8,1;]"..
"image_button[9,3.6;1,1;techpack_warehouse_input_inv.png;input;;true;false;]".. "image_button[9,3.6;1,1;techpack_warehouse_input_inv.png;input;;true;false;]"..
"tooltip[shift;Pass-through storage for unconfigured items]".. "tooltip[shift;Pass-through storage for unconfigured items (turn on/off)]"..
"tooltip[filter;Filter: To configure the 8 storages]".. "tooltip[filter;Filter: To configure the 8 storages]"..
"tooltip[storage;Storage: All items will be store here]".. "tooltip[storage;Storage: All items will be stored here]"..
"tooltip[input;Input: Put items will be moved to the storage]".. "tooltip[input;Input: Put items will be moved to the storage, if configured]"..
"list[current_player;main;1,5.3;8,4;]".. "list[current_player;main;1,5.3;8,4;]"..
"listring[context;shift]".. "listring[context;shift]"..
@ -217,23 +217,21 @@ function techpack_warehouse.allow_metadata_inventory_take(pos, listname, index,
if minetest.is_protected(pos, player:get_player_name()) then if minetest.is_protected(pos, player:get_player_name()) then
return 0 return 0
end end
if listname == "main" then
local number = M(pos):get_string("tubelib_number")
Cache[number] = nil
local inv = M(pos):get_inventory() local inv = M(pos):get_inventory()
local list = inv:get_list("main") local main_stack = inv:get_stack("main", index)
local num = list[index]:get_count() local number = M(pos):get_string("tubelib_number")
if listname == "main" then
Cache[number] = nil
local num = main_stack:get_count()
if num > 99 then if num > 99 then
return 99 return 99
else else
return num return num
end end
elseif listname == "filter" then elseif listname == "filter" and main_stack:is_empty() then
local number = M(pos):get_string("tubelib_number")
Cache[number] = nil Cache[number] = nil
return 1 return 1
elseif listname == "shift" then elseif listname == "shift" then
local number = M(pos):get_string("tubelib_number")
Cache[number] = nil Cache[number] = nil
return stack:get_count() return stack:get_count()
end end