The icons look OK when viewed on the armor equipment grid, but are completely off when hovering over the armor, which also shows the equipment grid.
This is the code I have used to layer the icon:
Code: Select all
if string.find(new_p.type, "-equipment") and new_p.sprite then
if not new_p.sprite.layers then
new_p.sprite.layers = { table.deepcopy(new_p.sprite) }
end
local layer = new_p.sprite.layers[1]
table.insert(
new_p.sprite.layers,
{
filename = quality.icon, height = 32, width = 32, scale = 0.5,
shift = { -(layer.size or layer.width) / 2, (layer.size or layer.height) / 2 }
}
)
end