forked from minetest-mods/unified_inventory
Draw the trash slot by overlaying the bare trash can icon
over the single slot image instead of baking it in.
This commit is contained in:
parent
8e94d86420
commit
60d7a6d213
6
bags.lua
6
bags.lua
@ -74,9 +74,9 @@ for bag_i = 1, 4 do
|
||||
if ui.trash_enabled
|
||||
or ui.is_creative(player_name)
|
||||
or minetest.get_player_privs(player_name).give then
|
||||
formspec[n] = "image[7.8,0.25;"..ui.imgscale..","..ui.imgscale..";ui_trash_slot.png]"
|
||||
.. "list[detached:trash;main;7.95,0.25;1,1;]"
|
||||
n = n + 1
|
||||
formspec[n] = "image[7.8,0.25;"..ui.trash_slot_img.."]"
|
||||
formspec[n+1] = "list[detached:trash;main;7.95,0.25;1,1;]"
|
||||
n = n + 2
|
||||
end
|
||||
local inv = player:get_inventory()
|
||||
for i = 1, 4 do
|
||||
|
3
init.lua
3
init.lua
@ -102,6 +102,9 @@ for _, style in ipairs({ui.style_full, ui.style_lite}) do
|
||||
ui.imgscale*8, ui.imgscale*4)
|
||||
end
|
||||
|
||||
ui.trash_slot_img = string.format("%f,%f;ui_single_slot.png^(ui_trash_slot_icon.png^[opacity:95)",
|
||||
ui.imgscale, ui.imgscale)
|
||||
|
||||
-- Disable default creative inventory
|
||||
local creative = rawget(_G, "creative") or rawget(_G, "creative_inventory")
|
||||
if creative then
|
||||
|
@ -187,8 +187,7 @@ ui.register_page("craft", {
|
||||
|
||||
if ui.trash_enabled or ui.is_creative(player_name) or minetest.get_player_privs(player_name).give then
|
||||
formspec[n] = string.format("label[%f,%f;%s]", craftx + 6.45, crafty + 2.4, F(S("Trash:")))
|
||||
formspec[n+1] = string.format("image[%f,%f;%f,%f;ui_trash_slot.png]",
|
||||
craftx+6.25, crafty + 2.5, ui.imgscale, ui.imgscale)
|
||||
formspec[n+1] = string.format("image[%f,%f;%s]", craftx+6.25, crafty + 2.5, ui.trash_slot_img)
|
||||
formspec[n+2] = string.format("list[detached:trash;main;%f,%f;1,1;]", craftx + 6.4, crafty + 2.65)
|
||||
n=n+3
|
||||
end
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.0 KiB |
BIN
textures/ui_trash_slot_icon.png
Normal file
BIN
textures/ui_trash_slot_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 782 B |
Loading…
Reference in New Issue
Block a user