1- local SimplePointDisplay = LibStub (" AceAddon-3.0" ):NewAddon (" SimplePointDisplay " , " AceConsole-3.0" , " AceEvent-3.0" , " AceBucket-3.0" )
1+ local cPointDisplay = LibStub (" AceAddon-3.0" ):NewAddon (" cPointDisplay " , " AceConsole-3.0" , " AceEvent-3.0" , " AceBucket-3.0" )
22local LSM = LibStub (" LibSharedMedia-3.0" )
33local db
44
5- SimplePointDisplay .Types = {
5+ cPointDisplay .Types = {
66 [" GENERAL" ] = {
77 name = " General" ,
88 points = {
@@ -22,7 +22,7 @@ SimplePointDisplay.Types = {
2222 },
2323 },
2424}
25- local Types = SimplePointDisplay .Types
25+ local Types = cPointDisplay .Types
2626
2727---- Spell Info table
2828local SpellInfo = {
@@ -244,7 +244,7 @@ local function FadeIt(self, NewOpacity)
244244end
245245
246246-- Determine new opacity values for frames
247- function SimplePointDisplay :FadeFrames ()
247+ function cPointDisplay :FadeFrames ()
248248 for ic ,vc in pairs (Types ) do
249249 for it ,vt in ipairs (Types [ic ].points ) do
250250 local NewOpacity
@@ -274,10 +274,10 @@ function SimplePointDisplay:FadeFrames()
274274 end
275275 end
276276 end
277- SimplePointDisplay :UpdatePointDisplay (" ENABLE" )
277+ cPointDisplay :UpdatePointDisplay (" ENABLE" )
278278end
279279
280- function SimplePointDisplay :UpdateCFStatus ()
280+ function cPointDisplay :UpdateCFStatus ()
281281 local OldStatus = CFStatus
282282
283283 -- Combat Fader based on status
@@ -296,16 +296,16 @@ function SimplePointDisplay:UpdateCFStatus()
296296 CFStatus = " OUTOFCOMBAT"
297297 end
298298 end
299- if CFStatus ~= OldStatus then SimplePointDisplay :FadeFrames () end
299+ if CFStatus ~= OldStatus then cPointDisplay :FadeFrames () end
300300end
301301
302- function SimplePointDisplay :UpdateCombatFader ()
302+ function cPointDisplay :UpdateCombatFader ()
303303 CFStatus = nil
304- SimplePointDisplay :UpdateCFStatus ()
304+ cPointDisplay :UpdateCFStatus ()
305305end
306306
307307-- On combat state change
308- function SimplePointDisplay :CombatFaderCombatState ()
308+ function cPointDisplay :CombatFaderCombatState ()
309309 -- If in combat, then don't worry about health/power events
310310 if UnitAffectingCombat (" player" ) then
311311 CFFrame :UnregisterEvent (" UNIT_HEALTH" )
@@ -319,31 +319,31 @@ function SimplePointDisplay:CombatFaderCombatState()
319319end
320320
321321-- Register events for Combat Fader status
322- function SimplePointDisplay :UpdateCombatFaderEnabled ()
322+ function cPointDisplay :UpdateCombatFaderEnabled ()
323323 CFFrame :RegisterEvent (" PLAYER_ENTERING_WORLD" )
324324 CFFrame :RegisterEvent (" PLAYER_TARGET_CHANGED" )
325325 CFFrame :RegisterEvent (" PLAYER_REGEN_ENABLED" )
326326 CFFrame :RegisterEvent (" PLAYER_REGEN_DISABLED" )
327327
328328 CFFrame :SetScript (" OnEvent" , function (self , event , ...)
329329 if event == " PLAYER_REGEN_ENABLED" or event == " PLAYER_REGEN_DISABLED" then
330- SimplePointDisplay :CombatFaderCombatState ()
331- SimplePointDisplay :UpdateCFStatus ()
330+ cPointDisplay :CombatFaderCombatState ()
331+ cPointDisplay :UpdateCFStatus ()
332332 elseif event == " UNIT_HEALTH" or event == " UNIT_POWER" or event == " UNIT_DISPLAYPOWER" then
333333 local unit = ...
334334 if unit == " player" then
335- SimplePointDisplay :UpdateCFStatus ()
335+ cPointDisplay :UpdateCFStatus ()
336336 end
337337 elseif event == " PLAYER_TARGET_CHANGED" then
338- SimplePointDisplay :UpdateCFStatus ()
338+ cPointDisplay :UpdateCFStatus ()
339339 elseif event == " PLAYER_ENTERING_WORLD" then
340- SimplePointDisplay :CombatFaderCombatState ()
341- SimplePointDisplay :UpdateCombatFader ()
340+ cPointDisplay :CombatFaderCombatState ()
341+ cPointDisplay :UpdateCombatFader ()
342342 end
343343 end )
344344
345- SimplePointDisplay :UpdateCombatFader ()
346- SimplePointDisplay :FadeFrames ()
345+ cPointDisplay :UpdateCombatFader ()
346+ cPointDisplay :FadeFrames ()
347347end
348348
349349-- Update Point Bars
@@ -416,7 +416,7 @@ local function SetPointBarTextures(shown, ic, it, tid, i)
416416 end
417417end
418418
419- function SimplePointDisplay :UpdatePointDisplay (...)
419+ function cPointDisplay :UpdatePointDisplay (...)
420420 local UpdateList
421421 if ... == " ENABLE" then
422422 -- Update everything
@@ -494,7 +494,7 @@ local function GetBuffCount(SpellID, ...)
494494 return count
495495end
496496
497- function SimplePointDisplay :GetPoints (CurClass , CurType )
497+ function cPointDisplay :GetPoints (CurClass , CurType )
498498 local NewPoints
499499 -- General
500500 if CurClass == " GENERAL" then
@@ -519,7 +519,7 @@ function SimplePointDisplay:GetPoints(CurClass, CurType)
519519end
520520
521521-- Update all valid Point Displays
522- function SimplePointDisplay :UpdatePoints (...)
522+ function cPointDisplay :UpdatePoints (...)
523523 if not LoggedIn then return end
524524
525525 local HasChanged = false
@@ -559,7 +559,7 @@ function SimplePointDisplay:UpdatePoints(...)
559559 if ( db [ic ].types [tid ].enabled and not db [ic ].types [tid ].configmode .enabled ) then
560560 -- Retrieve new point count
561561 local OldPoints = Points [tid ]
562- SimplePointDisplay :GetPoints (ic , tid )
562+ cPointDisplay :GetPoints (ic , tid )
563563 if Points [tid ] ~= OldPoints then
564564 -- Points have changed, flag for updating
565565 HasChanged = true
@@ -571,26 +571,26 @@ function SimplePointDisplay:UpdatePoints(...)
571571 end
572572
573573 -- Update Point Displays
574- if HasChanged then SimplePointDisplay :UpdatePointDisplay (Enable ) end
574+ if HasChanged then cPointDisplay :UpdatePointDisplay (Enable ) end
575575end
576576
577577-- Enable a Point Display
578- function SimplePointDisplay :EnablePointDisplay (c , t )
579- SimplePointDisplay :UpdatePoints (" ENABLE" )
578+ function cPointDisplay :EnablePointDisplay (c , t )
579+ cPointDisplay :UpdatePoints (" ENABLE" )
580580end
581581
582582-- Disable a Point Display
583- function SimplePointDisplay :DisablePointDisplay (c , t )
583+ function cPointDisplay :DisablePointDisplay (c , t )
584584 -- Set to 0 points
585585 Points [t ] = 0
586586 PointsChanged [t ] = true
587587
588588 -- Update Point Displays
589- SimplePointDisplay :UpdatePointDisplay (" ENABLE" )
589+ cPointDisplay :UpdatePointDisplay (" ENABLE" )
590590end
591591
592592-- Update frame positions/sizes
593- function SimplePointDisplay :UpdatePosition ()
593+ function cPointDisplay :UpdatePosition ()
594594 for ic ,vc in pairs (Types ) do
595595 for it ,vt in ipairs (Types [ic ].points ) do
596596 local tid = Types [ic ].points [it ].id
@@ -707,7 +707,7 @@ function SimplePointDisplay:UpdatePosition()
707707end
708708
709709-- Update BG Panel textures
710- function SimplePointDisplay :UpdateBGPanelTextures ()
710+ function cPointDisplay :UpdateBGPanelTextures ()
711711 local BorderA
712712 local BGA
713713
@@ -768,7 +768,7 @@ local function VerifyBorder(border)
768768end
769769
770770-- Retrieve Border/Background textures and store in tables
771- function SimplePointDisplay :GetTextures ()
771+ function cPointDisplay :GetTextures ()
772772 for ic ,vc in pairs (Types ) do
773773 for it ,vt in ipairs (Types [ic ].points ) do
774774 local tid = Types [ic ].points [it ].id
@@ -788,7 +788,7 @@ function SimplePointDisplay:GetTextures()
788788 end
789789end
790790
791- function SimplePointDisplay :GetClassColors ()
791+ function cPointDisplay :GetClassColors ()
792792 local CurClassColor
793793 for k ,v in pairs (Types ) do
794794 tinsert (ClassColorBarTable , k )
@@ -823,7 +823,7 @@ local function CreateFrames()
823823 local tid = Types [ic ].points [it ].id
824824
825825 -- BG Panel
826- local FrameName = " SimplePointDisplay_Frames_ " .. tid
826+ local FrameName = " cPointDisplay_Frames_ " .. tid
827827 Frames [ic ][tid ].bgpanel .frame = CreateFrame (" Frame" , FrameName , UIParent )
828828
829829 Frames [ic ][tid ].bgpanel .bg = Frames [ic ][tid ].bgpanel .frame :CreateTexture (nil , " ARTWORK" )
@@ -837,12 +837,12 @@ local function CreateFrames()
837837 Frames [ic ][tid ].bgpanel .frame :Hide ()
838838
839839 -- Anchor Panel
840- local AnchorFrameName = " SimplePointDisplay_Frames_ " .. tid .. " _avAanchor"
840+ local AnchorFrameName = " cPointDisplay_Frames_ " .. tid .. " _avAanchor"
841841 Frames [ic ][tid ].anchor .frame = CreateFrame (" Frame" , AnchorFrameName , UIParent )
842842
843843 -- Point bars
844844 for i = 1 , Types [ic ].points [it ].barcount do
845- local BarFrameName = " SimplePointDisplay_Frames_ " .. tid .. " _bar" .. tostring (i )
845+ local BarFrameName = " cPointDisplay_Frames_ " .. tid .. " _bar" .. tostring (i )
846846 Frames [ic ][tid ].bars [i ].frame = CreateFrame (" Frame" , BarFrameName , UIParent )
847847
848848 Frames [ic ][tid ].bars [i ].bg = Frames [ic ][tid ].bars [i ].frame :CreateTexture (nil , " ARTWORK" )
@@ -918,69 +918,70 @@ local function CreateTables()
918918 end
919919end
920920
921- function SimplePointDisplay :ProfChange ()
921+ function cPointDisplay :ProfChange ()
922922 if not LoggedIn then return end
923923
924924 db = self .db .profile
925- SimplePointDisplay :ConfigRefresh ()
926- SimplePointDisplay :Refresh ()
925+ cPointDisplay :ConfigRefresh ()
926+ cPointDisplay :Refresh ()
927927end
928928
929- -- Refresh SimplePointDisplay
930- function SimplePointDisplay :Refresh ()
929+ -- Refresh cPointDisplay
930+ function cPointDisplay :Refresh ()
931931 if not LoggedIn then return end
932932
933- SimplePointDisplay :UpdateSpec ()
934- SimplePointDisplay :UpdateCombatFaderEnabled ()
935- SimplePointDisplay :GetTextures ()
936- SimplePointDisplay :UpdateBGPanelTextures ()
937- SimplePointDisplay :UpdatePosition ()
938- SimplePointDisplay :UpdatePoints (" ENABLE" )
933+ cPointDisplay :UpdateSpec ()
934+ cPointDisplay :UpdateCombatFaderEnabled ()
935+ cPointDisplay :GetTextures ()
936+ cPointDisplay :UpdateBGPanelTextures ()
937+ cPointDisplay :UpdatePosition ()
938+ cPointDisplay :UpdatePoints (" ENABLE" )
939939end
940940
941941-- Hide default UI frames
942- function SimplePointDisplay :HideUIElements ()
942+ function cPointDisplay :HideUIElements ()
943943 if db [" GENERAL" ].types [" cp" ].enabled and db [" GENERAL" ].types [" cp" ].general .hideui then
944- for i = 1 ,5 do
945- _G [" ComboPoint" .. i ]:Hide ()
946- _G [" ComboPoint" .. i ]:SetScript (" OnShow" , function (self ) self :Hide () end )
944+ local CPF = ComboPointPlayerFrame
945+ if CPF then
946+ CPF :Hide ()
947+ CPF :SetScript (" OnShow" , function (self ) self :Hide () end )
947948 end
948949 end
949950
950951 if db [" PALADIN" ].types [" hp" ].enabled and db [" PALADIN" ].types [" hp" ].general .hideui then
951- local HPF = _G [ " PaladinPowerBar " ]
952+ local HPF = PaladinPowerBarFrame
952953 if HPF then
953954 HPF :Hide ()
954955 HPF :SetScript (" OnShow" , function (self ) self :Hide () end )
955956 end
956957 end
957958
958959 if db [" WARLOCK" ].types [" ss" ].enabled and db [" WARLOCK" ].types [" ss" ].general .hideui then
959- local SSF = _G [ " ShardBarFrame " ]
960+ local SSF = WarlockPowerFrame
960961 if SSF then
961962 SSF :Hide ()
962963 SSF :SetScript (" OnShow" , function (self ) self :Hide () end )
963964 end
964965 end
965966end
966967
967- function SimplePointDisplay :UpdateSpec ()
968+ function cPointDisplay :UpdateSpec ()
968969 PlayerSpec = GetActiveSpecGroup ()
969970end
970971
971- function SimplePointDisplay :PLAYER_ENTERING_WORLD ()
972- SimplePointDisplay :UpdateSpec ()
973- SimplePointDisplay :UpdatePoints (" ENABLE" )
974- SimplePointDisplay :UpdatePosition ()
972+ function cPointDisplay :PLAYER_ENTERING_WORLD ()
973+ cPointDisplay :UpdateSpec ()
974+ cPointDisplay :UpdatePoints (" ENABLE" )
975+ cPointDisplay :UpdatePosition ()
975976end
976977
977978local function ClassColorsUpdate ()
978979 ClassColors = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS [PlayerClass ] or RAID_CLASS_COLORS [PlayerClass ]
979- SimplePointDisplay :GetClassColors ()
980- SimplePointDisplay :UpdatePoints (" ENABLE" )
980+ cPointDisplay :GetClassColors ()
981+ cPointDisplay :UpdatePoints (" ENABLE" )
981982end
982983
983- function SimplePointDisplay :PLAYER_LOGIN ()
984+ function cPointDisplay :PLAYER_LOGIN ()
984985 PlayerClass = select (2 , UnitClass (" player" ))
985986
986987 -- Build Class list to run updates on
@@ -990,17 +991,17 @@ function SimplePointDisplay:PLAYER_LOGIN()
990991 },
991992
992993 -- Register Media
993- LSM :Register (" border" , " Solid" , [[ Interface\Addons\SimplePointDisplay \Media\SolidBorder]] )
994- LSM :Register (" background" , " Round-Small" , [[ Interface\Addons\SimplePointDisplay \Media\Round-Small]] )
995- LSM :Register (" background" , " Round-Smaller" , [[ Interface\Addons\SimplePointDisplay \Media\Round-Smaller]] )
996- LSM :Register (" background" , " Arrow" , [[ Interface\Addons\SimplePointDisplay \Media\Arrow]] )
997- LSM :Register (" background" , " Holy Power 1" , [[ Interface\Addons\SimplePointDisplay \Media\HolyPower1]] )
998- LSM :Register (" background" , " Holy Power 2" , [[ Interface\Addons\SimplePointDisplay \Media\HolyPower2]] )
999- LSM :Register (" background" , " Holy Power 3" , [[ Interface\Addons\SimplePointDisplay \Media\HolyPower3]] )
1000- LSM :Register (" background" , " Soul Shard" , [[ Interface\Addons\SimplePointDisplay \Media\SoulShard]] )
994+ LSM :Register (" border" , " Solid" , [[ Interface\Addons\cPointDisplay \Media\SolidBorder]] )
995+ LSM :Register (" background" , " Round-Small" , [[ Interface\Addons\cPointDisplay \Media\Round-Small]] )
996+ LSM :Register (" background" , " Round-Smaller" , [[ Interface\Addons\cPointDisplay \Media\Round-Smaller]] )
997+ LSM :Register (" background" , " Arrow" , [[ Interface\Addons\cPointDisplay \Media\Arrow]] )
998+ LSM :Register (" background" , " Holy Power 1" , [[ Interface\Addons\cPointDisplay \Media\HolyPower1]] )
999+ LSM :Register (" background" , " Holy Power 2" , [[ Interface\Addons\cPointDisplay \Media\HolyPower2]] )
1000+ LSM :Register (" background" , " Holy Power 3" , [[ Interface\Addons\cPointDisplay \Media\HolyPower3]] )
1001+ LSM :Register (" background" , " Soul Shard" , [[ Interface\Addons\cPointDisplay \Media\SoulShard]] )
10011002
10021003 -- Hide Elements
1003- SimplePointDisplay :HideUIElements ()
1004+ cPointDisplay :HideUIElements ()
10041005
10051006 -- Register Events
10061007 -- Throttled Events
@@ -1031,17 +1032,17 @@ function SimplePointDisplay:PLAYER_LOGIN()
10311032 LoggedIn = true
10321033
10331034 -- Refresh Addon
1034- SimplePointDisplay :Refresh ()
1035+ cPointDisplay :Refresh ()
10351036end
10361037
1037- function SimplePointDisplay :OnInitialize ()
1038- self .db = LibStub (" AceDB-3.0" ):New (" SimplePointDisplayDB " , defaults , " Default" )
1038+ function cPointDisplay :OnInitialize ()
1039+ self .db = LibStub (" AceDB-3.0" ):New (" cPointDisplayDB " , defaults , " Default" )
10391040
10401041 self .db .RegisterCallback (self , " OnProfileChanged" , " ProfChange" )
10411042 self .db .RegisterCallback (self , " OnProfileCopied" , " ProfChange" )
10421043 self .db .RegisterCallback (self , " OnProfileReset" , " ProfChange" )
10431044
1044- SimplePointDisplay :SetUpInitialOptions ()
1045+ cPointDisplay :SetUpInitialOptions ()
10451046
10461047 db = self .db .profile
10471048
0 commit comments