items/mcl_banners: fix preview masking

The `layer` string was inherited from the old patch, which I frankly
don't understand. I restructured it to `follow make_banner_texture` more
closely, with the addition of the mcl_banners_front mask, which
prevents the rear portions of the patterns from showing up.

The numbers in the final `[combine` and `[resize` steps are arbitrary,
and were derived by trial-and-error.
This commit is contained in:
E 2021-04-22 22:23:16 -04:00
parent f7dc051adf
commit 48dd5267dd
2 changed files with 2 additions and 2 deletions

View File

@ -158,7 +158,7 @@ local make_banner_overlay = function(base_color, layers)
local color = mcl_banners.colors[layerinfo.color][4]
-- Generate layer texture
local layer = "(([combine:20x40:-2,-2="..pattern.."^[resize:16x24^[colorize:"..color..":"..layer_ratio..")^[mask:"..pattern..")"
local layer = "((("..pattern.."^[mask:mcl_banners_front.png)^[colorize:"..color..":"..layer_ratio..")^[mask:"..pattern..")"
lovl = (lovl ~= "" and (lovl .. "^") or "") .. layer
end
@ -167,7 +167,7 @@ local make_banner_overlay = function(base_color, layers)
return text:gsub("%^", "\\%^"):gsub(":", "\\:") -- :gsub("%(", "\\%("):gsub("%)", "\\%)")
end
return "[combine:32x32:0,0=" .. escape(base) .. ":8,4=" .. escape(lovl)
return "[combine:32x32:0,0=" .. escape(base) .. ":7,3=" .. escape("("..lovl.."^[resize:50x38)")
end
return base
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB