smart_sfinv_tweaks: Add trash button for creative pages

This commit is contained in:
Alexander Weber 2022-01-12 21:17:57 +01:00
parent 97172b6f0f
commit 25c2c5b53a
2 changed files with 17 additions and 1 deletions

View File

@ -16,7 +16,7 @@ sfinv_buttons.register_button('compress', {
sfinv_buttons.register_button('rotate', {
image = "smart_sfinv_tweaks_rotate.png",
tooltip = "Rotate inventory rows",
position = 7,
position = 8,
action = function(player)
maininv.get(player):rotate_rows()
end,
@ -25,6 +25,22 @@ sfinv_buttons.register_button('rotate', {
end
})
sfinv_buttons.register_button('trash', {
image = "smart_sfinv_tweaks_trash_button.png",
tooltip = "Remove all items from inventory",
position = 9,
action = function(player)
maininv.get(player):remove_all()
end,
show = function(player, context, content, show_inv)
if context.page:sub(1,9) == "creative:" then
return show_inv
else
return false
end
end
})
local crafting_enhance = 'image_button[0.5,1.6;0.8,0.8;smart_sfinv_tweaks_sweep_button.png;sfinv_tweaks_sweep;]' ..
'tooltip[sfinv_tweaks_sweep;Sweep crafting area]'

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B