Hi
I have a simple script to change texture on frames, but HP and Mana bars texture gets changed to default when hp/mana value changes.
I assume that I need some sort of "onupdate" script to keep new textures on? Anyone can help me plz?
When i load ui, new textures load fine:
When hp changes, red hp texture is default
When hp/mana changes, mana texture changes to default:
Lua Code:
local main = function()
for _, StatusBarTextures in pairs ({
PlayerFrameHealthBar,
PlayerFrameManaBar,
TargetFrameHealthBar,
TargetFrameManaBar,
TargetFrameToTHealthBar,
TargetFrameToTManaBar,
FocusFrameHealthBar,
FocusFrameManaBar,
FocusFrameToTHealthBar,
FocusFrameToTManaBar,
PartyMemberFrame1HealthBar,
PartyMemberFrame2HealthBar,
PartyMemberFrame3HealthBar,
PartyMemberFrame4HealthBar,
PartyMemberFrame1ManaBar,
PartyMemberFrame2ManaBar,
PartyMemberFrame3ManaBar,
PartyMemberFrame4ManaBar,
CastingBarFrame,
TargetFrameSpellBar,
FocusFrameSpellBar,
}) do StatusBarTextures:SetStatusBarTexture("Interface\\AddOns\\EVUI\\FrameBackground") end
for _, BarTextures in pairs ({
TargetFrameNameBackground,
FocusFrameNameBackground,
}) do BarTextures:SetTexture("Interface\\AddOns\\EVUI\\FrameBackground") end
end
local ef = CreateFrame("frame")
ef:RegisterEvent("PLAYER_ENTERING_WORLD")
ef:SetScript("OnEvent", function(self)
main()
main = nil
self:UnregisterEvent("PLAYER_ENTERING_WORLD")
self:SetScript("OnEvent", nil)
end)