View Single Post
06-16-20, 08:04 AM   #9
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
I had a look at that addon that you found that did what you wanted but had errors on Classic ?

I just made the following changes to the lua file and it works in Classic now. You should be able to use any text editor to replace the code in the lua file for that LighterManaBar addon with the following and it will work, although I couldn't get it to work on login. Had to do a reload of the UI to make it work every time. Servers have gone down now so ran out of time to make further attempts.

Lua Code:
  1. -- Runs on login and whenever player shapeshifts.
  2. function setManaBarColour(self,event,...)
  3.     PlayerFrameManaBar:SetStatusBarColor(0.2, 0.8, 1)
  4.     -- The following won't work in Classic but should in Retail
  5.     -- ( change text in brackets as expansions are added)
  6.     -- [url]https://github.com/Gethe/wow-ui-source/blob/classic/FrameXML/Constants.lua[/url]
  7.     if MAX_PLAYER_LEVEL_TABLE[LE_EXPANSION_BATTLE_FOR_AZEROTH] then
  8.         PlayerFrameAlternateManaBar:SetStatusBarColor(0.2, 0.8, 1)
  9.     end
  10. end
  11.  
  12. --Runs once at startup
  13. function StartLighterManaBar()
  14.   LighterManaBarFrame:SetScript("OnEvent", setManaBarColour)
  15.   LighterManaBarFrame:RegisterEvent("UNIT_POWER_UPDATE")
  16.   LighterManaBarFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
  17. end
__________________
  Reply With Quote