Browse Source

Use bag icons directly from UI

master
Wuzzy 3 years ago
parent
commit
1750111664
4 changed files with 3 additions and 3 deletions
  1. +3
    -3
      init.lua
  2. BIN
      textures/inventory_icon_bags_large.png
  3. BIN
      textures/inventory_icon_bags_medium.png
  4. BIN
      textures/inventory_icon_bags_small.png

+ 3
- 3
init.lua View File

@@ -16,7 +16,7 @@ function inventory_icon.get_inventory_state(inv, listname)
end

function inventory_icon.replace_icon(name)
return "inventory_icon_"..name
return name.."^[resize:32x32"
end

minetest.register_on_joinplayer(function(player)
@@ -55,7 +55,7 @@ minetest.register_on_joinplayer(function(player)
if bag:is_empty() then
scale = { x = 0, y = 0 }
text = ""
icon = "inventory_icon_bags_small.png"
icon = "bags_small.png^[resize:32x32"
else
scale = { x = 1, y = 1 }
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
scale = { x = 0, y = 0 }
text = ""
icon = "inventory_icon_bags_small.png"
icon = "bags_small.png^[resize:32x32"
else
scale = { x = 1, y = 1 }
local occupied, size = inventory_icon.get_inventory_state(player:get_inventory(), "bag"..i.."contents")

BIN
textures/inventory_icon_bags_large.png View File

Before After
Width: 32  |  Height: 32  |  Size: 670B

BIN
textures/inventory_icon_bags_medium.png View File

Before After
Width: 32  |  Height: 32  |  Size: 922B

BIN
textures/inventory_icon_bags_small.png View File

Before After
Width: 32  |  Height: 32  |  Size: 699B

Loading…
Cancel
Save