mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-03 17:36:56 +00:00
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:
+17
-2
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user