Thread Tools Display Modes
Prev Previous Post   Next Post Next
08-17-16, 07:03 AM   #1
mich125
A Fallenroot Satyr
Join Date: Jan 2010
Posts: 27
Exclamation Help with textures on frames update

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:
  1. local main = function()
  2. for _, StatusBarTextures in pairs ({
  3.     PlayerFrameHealthBar,
  4.     PlayerFrameManaBar,
  5. TargetFrameHealthBar,
  6. TargetFrameManaBar,
  7. TargetFrameToTHealthBar,
  8. TargetFrameToTManaBar,
  9.     FocusFrameHealthBar,
  10.     FocusFrameManaBar,
  11.     FocusFrameToTHealthBar,
  12.     FocusFrameToTManaBar,
  13. PartyMemberFrame1HealthBar,
  14. PartyMemberFrame2HealthBar,
  15. PartyMemberFrame3HealthBar,
  16. PartyMemberFrame4HealthBar,
  17.     PartyMemberFrame1ManaBar,
  18.     PartyMemberFrame2ManaBar,
  19.     PartyMemberFrame3ManaBar,
  20.     PartyMemberFrame4ManaBar,
  21. CastingBarFrame,
  22. TargetFrameSpellBar,
  23. FocusFrameSpellBar,
  24.         })  do StatusBarTextures:SetStatusBarTexture("Interface\\AddOns\\EVUI\\FrameBackground") end
  25. for _, BarTextures in pairs ({
  26. TargetFrameNameBackground,
  27. FocusFrameNameBackground,
  28.         })  do BarTextures:SetTexture("Interface\\AddOns\\EVUI\\FrameBackground") end
  29. end
  30.  
  31. local ef = CreateFrame("frame")
  32. ef:RegisterEvent("PLAYER_ENTERING_WORLD")
  33. ef:SetScript("OnEvent", function(self)
  34.  main()
  35.  main = nil
  36.  self:UnregisterEvent("PLAYER_ENTERING_WORLD")
  37.  self:SetScript("OnEvent", nil)
  38. end)

Last edited by mich125 : 08-17-16 at 07:25 AM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Help with textures on frames update


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off