simply quickput

master
Pascal Abresch 2021-08-28 14:26:15 +02:00
parent 97c9fbaf11
commit af137398c2
3 changed files with 5 additions and 44 deletions

View File

@ -1,11 +1,3 @@
--[[local formspec = --template for sparkinventory
"size[11.4,4]"..
"list[current_player;main;0,0;8,3;8]" ..
"list[current_player;main;0,3.2;8,1;]"..
"list[current_player;craft;8.5,0;3,3]" ..
"list[current_player;craftpreview;8.5,3.2;1,1]" ..
"listcolors[#fc059db0;#fc059dd0]"
]]--
minetest.register_on_joinplayer(
function(player)
minetest.after(0.01,function()
@ -14,35 +6,10 @@ minetest.register_on_joinplayer(
end)
end)
local spark_quick_put_machines = minetest.settings:get_bool("spark_quick_put_machines")
local spark_quick_put_storage = minetest.settings:get_bool("spark_quick_put_storage")
local spark_quick_put_default = minetest.settings:get_bool("spark_quick_put_default")
local spark_quick_put_overide = minetest.settings:get("spark_quick_put_overide")
local whitelist
if spark_quick_put_overide then
--overide here
whitelist = { "product" }
else
if spark_quick_put_machines then
whitelist = { "fuel", "product", "source" }
end
local spark_quick_put_enable = minetest.settings:get_bool("spark_quick_put_enabled")
if spark_quick_put_storage then
if whitelist then
table.insert(whitelist, "main")
else
whitelist = { "main" }
end
end
if spark_quick_put_default then
if whitelist then
table.insert(whitelist, "src")
table.insert(whitelist, "dst")
end
end
end
local whitelist = { "fuel", "product", "source", }
local function quick_refuel(position, node, puncher, pointed)
local nodemeta = minetest.get_meta(position)
@ -63,7 +30,7 @@ local function quick_refuel(position, node, puncher, pointed)
end
if whitelist then
if spark_quick_put_enable then
minetest.register_on_punchnode(quick_refuel)
end

View File

@ -1,5 +1,2 @@
spark_log (Enable console log) bool true
spark_quick_put_machines (Left click items into machines) bool false
spark_quick_put_storage (Left click items into storage) bool false
spark_quick_put_default (Left click items into default mod blocks) bool false
spark_quick_put_overide ([ADVANCED] Space seperated list of inventories to overide the whitelist) string
spark_quick_put_enabled (Left click items into inventories) bool true

View File

@ -3,8 +3,5 @@ spark_gui_foreground (GUI foreground color <RGBA>) string fc059dd0
spark_gui_highlight (GUI highlight color <RGBA>) string fc059db0
spark_gui_full (GUI Full background <BOOL>) bool false
spark_log (Enable console log) bool true
spark_quick_put_machines (Left click items into machines) bool false
spark_quick_put_storage (Left click items into storage) bool false
spark_quick_put_default (Left click items into default mod blocks) bool false
spark_quick_put_overide ([ADVANCED] Space seperated list of inventories to overide the whitelist) string
spark_quick_put_enabled (Left click items into inventories) bool true
spark_debug_enable ([WARNING: ARBITRARY LUA CODE [very bad!]] enable sparkdebug) bool false