Castbars: stripe the fill of uninterruptible casts with a tiled texture

The shield draws img/stripes on OVERLAY, anchored to the fill with
horizontal and vertical tiling so the stripes keep their size as the bar
fills. Castbar text moves from the invalid DIALOG layer (read as ARTWORK)
to OVERLAY so it draws above the stripes.
This commit is contained in:
Brues
2026-11-03 01:07:03 -06:00
parent eb68642d21
commit 1c1be19711
4 changed files with 21 additions and 6 deletions
+17 -2
View File
@@ -1183,8 +1183,11 @@ end
-- [ Set Castbar Shield ]
-- Colors a castbar for a cast that none of the player's own interrupts or
-- silences can stop. The bar and the icon's border both take the shield color,
-- so the state still reads on a bar configured without an icon. Not shielded
-- restores the normal cast/channel color and the configured border.
-- so the state still reads on a bar configured without an icon. The fill also
-- gets diagonal stripes, tiled at the image's own size so they keep their
-- spacing as the fill grows or shrinks. They sit on OVERLAY, under the bar's
-- text on the same layer. Not shielded restores the normal cast/channel color
-- and the configured border.
-- 'bar' [frame] the castbar statusbar
-- 'icon' [frame] the icon frame, or nil for a bar without one
-- 'shielded' [bool] whether the cast is uninterruptible
@@ -1196,6 +1199,18 @@ function pfUI.api.SetCastbarShield(bar, icon, shielded, isChannel)
bar:SetStatusBarColor(pfUI.api.GetStringColor(C.appearance.castbar[isChannel and "channelcolor" or "castbarcolor"]))
end
if shielded and not bar.shieldstripes then
bar.shieldstripes = bar:CreateTexture(nil, "OVERLAY")
bar.shieldstripes:SetTexture(pfUI.media["img:stripes"])
bar.shieldstripes:SetHorizTile(true)
bar.shieldstripes:SetVertTile(true)
bar.shieldstripes:SetVertexColor(1, 1, 1, .3)
bar.shieldstripes:SetAllPoints(bar:GetStatusBarTexture())
end
if bar.shieldstripes then
bar.shieldstripes:SetShown(shielded)
end
local iconborder = icon and icon.backdrop
if not iconborder then return end
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

+2 -2
View File
@@ -231,7 +231,7 @@ pfUI:RegisterModule("castbar", function ()
CreateBackdropShadow(cb.bar)
-- text left
cb.bar.left = cb.bar:CreateFontString("Status", "DIALOG", "GameFontNormal")
cb.bar.left = cb.bar:CreateFontString("Status", "OVERLAY", "GameFontNormal")
cb.bar.left:ClearAllPoints()
cb.bar.left:SetPoint("TOPLEFT", cb.bar, "TOPLEFT", 3 + C.castbar[unitstr].txtleftoffx, C.castbar[unitstr].txtleftoffy)
cb.bar.left:SetPoint("BOTTOMRIGHT", cb.bar, "BOTTOMRIGHT", -3 + C.castbar[unitstr].txtleftoffx, C.castbar[unitstr].txtleftoffy)
@@ -242,7 +242,7 @@ pfUI:RegisterModule("castbar", function ()
cb.bar.left:SetJustifyH(C.castbar[unitstr].namealign or "LEFT")
-- text right
cb.bar.right = cb.bar:CreateFontString("Status", "DIALOG", "GameFontNormal")
cb.bar.right = cb.bar:CreateFontString("Status", "OVERLAY", "GameFontNormal")
cb.bar.right:ClearAllPoints()
cb.bar.right:SetPoint("TOPLEFT", cb.bar, "TOPLEFT", 3 + C.castbar[unitstr].txtrightoffx, C.castbar[unitstr].txtrightoffy)
cb.bar.right:SetPoint("BOTTOMRIGHT", cb.bar, "BOTTOMRIGHT", -3 + C.castbar[unitstr].txtrightoffx, C.castbar[unitstr].txtrightoffy)
+2 -2
View File
@@ -1237,7 +1237,7 @@ pfUI:RegisterModule("nameplates", function ()
end
end)
castbar.text = castbar:CreateFontString("Status", "DIALOG", "GameFontNormal")
castbar.text = castbar:CreateFontString("Status", "OVERLAY", "GameFontNormal")
castbar.text:SetPoint("RIGHT", castbar, "LEFT", -4, 0)
castbar.text:SetNonSpaceWrap(false)
castbar.text:SetTextColor(1,1,1,.5)
@@ -1247,7 +1247,7 @@ pfUI:RegisterModule("nameplates", function ()
castbar.timer:SetFormatter(castFormatter)
castbar.onExpire = function() ExpireCast(nameplate) end
castbar.spell = castbar:CreateFontString("Status", "DIALOG", "GameFontNormal")
castbar.spell = castbar:CreateFontString("Status", "OVERLAY", "GameFontNormal")
castbar.spell:SetPoint("CENTER", castbar, "CENTER")
castbar.spell:SetNonSpaceWrap(false)
castbar.spell:SetTextColor(1,1,1,1)