forked from Mineclonia/Mineclonia
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:
parent
5d0c9c77cd
commit
412c1ac5d6
|
@ -158,7 +158,7 @@ local make_banner_overlay = function(base_color, layers)
|
||||||
local color = mcl_banners.colors[layerinfo.color][4]
|
local color = mcl_banners.colors[layerinfo.color][4]
|
||||||
|
|
||||||
-- Generate layer texture
|
-- 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
|
lovl = (lovl ~= "" and (lovl .. "^") or "") .. layer
|
||||||
end
|
end
|
||||||
|
@ -167,7 +167,7 @@ local make_banner_overlay = function(base_color, layers)
|
||||||
return text:gsub("%^", "\\%^"):gsub(":", "\\:") -- :gsub("%(", "\\%("):gsub("%)", "\\%)")
|
return text:gsub("%^", "\\%^"):gsub(":", "\\:") -- :gsub("%(", "\\%("):gsub("%)", "\\%)")
|
||||||
end
|
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
|
end
|
||||||
return base
|
return base
|
||||||
end
|
end
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
Loading…
Reference in New Issue