mirror of
https://repo.or.cz/minetest_inventory_icon.git
synced 2024-12-04 21:03:47 +01:00
Use bag icons directly from UI
This commit is contained in:
parent
4a8da309e5
commit
1750111664
6
init.lua
6
init.lua
@ -16,7 +16,7 @@ function inventory_icon.get_inventory_state(inv, listname)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function inventory_icon.replace_icon(name)
|
function inventory_icon.replace_icon(name)
|
||||||
return "inventory_icon_"..name
|
return name.."^[resize:32x32"
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
@ -55,7 +55,7 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
if bag:is_empty() then
|
if bag:is_empty() then
|
||||||
scale = { x = 0, y = 0 }
|
scale = { x = 0, y = 0 }
|
||||||
text = ""
|
text = ""
|
||||||
icon = "inventory_icon_bags_small.png"
|
icon = "bags_small.png^[resize:32x32"
|
||||||
else
|
else
|
||||||
scale = { x = 1, y = 1 }
|
scale = { x = 1, y = 1 }
|
||||||
local occupied, size = inventory_icon.get_inventory_state(player:get_inventory(), "bag"..i.."contents")
|
local occupied, size = inventory_icon.get_inventory_state(player:get_inventory(), "bag"..i.."contents")
|
||||||
@ -115,7 +115,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
if bag:is_empty() then
|
if bag:is_empty() then
|
||||||
scale = { x = 0, y = 0 }
|
scale = { x = 0, y = 0 }
|
||||||
text = ""
|
text = ""
|
||||||
icon = "inventory_icon_bags_small.png"
|
icon = "bags_small.png^[resize:32x32"
|
||||||
else
|
else
|
||||||
scale = { x = 1, y = 1 }
|
scale = { x = 1, y = 1 }
|
||||||
local occupied, size = inventory_icon.get_inventory_state(player:get_inventory(), "bag"..i.."contents")
|
local occupied, size = inventory_icon.get_inventory_state(player:get_inventory(), "bag"..i.."contents")
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 670 B |
Binary file not shown.
Before Width: | Height: | Size: 922 B |
Binary file not shown.
Before Width: | Height: | Size: 699 B |
Loading…
Reference in New Issue
Block a user