Skip to content

Commit faeef7f

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/master' into arcane-power
# Conflicts: # cPointDisplay.toc
2 parents 33e67c5 + d2dacc8 commit faeef7f

69 files changed

Lines changed: 3698 additions & 1010 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Config.lua

Lines changed: 121 additions & 121 deletions
Large diffs are not rendered by default.

Core.lua

Lines changed: 74 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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")
22
local LSM = LibStub("LibSharedMedia-3.0")
33
local db
44

5-
SimplePointDisplay.Types = {
5+
cPointDisplay.Types = {
66
["GENERAL"] = {
77
name = "General",
88
points = {
@@ -28,7 +28,7 @@ SimplePointDisplay.Types = {
2828
}
2929
}
3030
}
31-
local Types = SimplePointDisplay.Types
31+
local Types = cPointDisplay.Types
3232

3333
---- Spell Info table
3434
local SpellInfo = {
@@ -250,7 +250,7 @@ local function FadeIt(self, NewOpacity)
250250
end
251251

252252
-- Determine new opacity values for frames
253-
function SimplePointDisplay:FadeFrames()
253+
function cPointDisplay:FadeFrames()
254254
for ic,vc in pairs(Types) do
255255
for it,vt in ipairs(Types[ic].points) do
256256
local NewOpacity
@@ -280,10 +280,10 @@ function SimplePointDisplay:FadeFrames()
280280
end
281281
end
282282
end
283-
SimplePointDisplay:UpdatePointDisplay("ENABLE")
283+
cPointDisplay:UpdatePointDisplay("ENABLE")
284284
end
285285

286-
function SimplePointDisplay:UpdateCFStatus()
286+
function cPointDisplay:UpdateCFStatus()
287287
local OldStatus = CFStatus
288288

289289
-- Combat Fader based on status
@@ -302,16 +302,16 @@ function SimplePointDisplay:UpdateCFStatus()
302302
CFStatus = "OUTOFCOMBAT"
303303
end
304304
end
305-
if CFStatus ~= OldStatus then SimplePointDisplay:FadeFrames() end
305+
if CFStatus ~= OldStatus then cPointDisplay:FadeFrames() end
306306
end
307307

308-
function SimplePointDisplay:UpdateCombatFader()
308+
function cPointDisplay:UpdateCombatFader()
309309
CFStatus = nil
310-
SimplePointDisplay:UpdateCFStatus()
310+
cPointDisplay:UpdateCFStatus()
311311
end
312312

313313
-- On combat state change
314-
function SimplePointDisplay:CombatFaderCombatState()
314+
function cPointDisplay:CombatFaderCombatState()
315315
-- If in combat, then don't worry about health/power events
316316
if UnitAffectingCombat("player") then
317317
CFFrame:UnregisterEvent("UNIT_HEALTH")
@@ -325,31 +325,31 @@ function SimplePointDisplay:CombatFaderCombatState()
325325
end
326326

327327
-- Register events for Combat Fader status
328-
function SimplePointDisplay:UpdateCombatFaderEnabled()
328+
function cPointDisplay:UpdateCombatFaderEnabled()
329329
CFFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
330330
CFFrame:RegisterEvent("PLAYER_TARGET_CHANGED")
331331
CFFrame:RegisterEvent("PLAYER_REGEN_ENABLED")
332332
CFFrame:RegisterEvent("PLAYER_REGEN_DISABLED")
333333

334334
CFFrame:SetScript("OnEvent", function(self, event, ...)
335335
if event == "PLAYER_REGEN_ENABLED" or event == "PLAYER_REGEN_DISABLED" then
336-
SimplePointDisplay:CombatFaderCombatState()
337-
SimplePointDisplay:UpdateCFStatus()
336+
cPointDisplay:CombatFaderCombatState()
337+
cPointDisplay:UpdateCFStatus()
338338
elseif event == "UNIT_HEALTH" or event == "UNIT_POWER" or event == "UNIT_DISPLAYPOWER" then
339339
local unit = ...
340340
if unit == "player" then
341-
SimplePointDisplay:UpdateCFStatus()
341+
cPointDisplay:UpdateCFStatus()
342342
end
343343
elseif event == "PLAYER_TARGET_CHANGED" then
344-
SimplePointDisplay:UpdateCFStatus()
344+
cPointDisplay:UpdateCFStatus()
345345
elseif event == "PLAYER_ENTERING_WORLD" then
346-
SimplePointDisplay:CombatFaderCombatState()
347-
SimplePointDisplay:UpdateCombatFader()
346+
cPointDisplay:CombatFaderCombatState()
347+
cPointDisplay:UpdateCombatFader()
348348
end
349349
end)
350350

351-
SimplePointDisplay:UpdateCombatFader()
352-
SimplePointDisplay:FadeFrames()
351+
cPointDisplay:UpdateCombatFader()
352+
cPointDisplay:FadeFrames()
353353
end
354354

355355
-- Update Point Bars
@@ -422,7 +422,7 @@ local function SetPointBarTextures(shown, ic, it, tid, i)
422422
end
423423
end
424424

425-
function SimplePointDisplay:UpdatePointDisplay(...)
425+
function cPointDisplay:UpdatePointDisplay(...)
426426
local UpdateList
427427
if ... == "ENABLE" then
428428
-- Update everything
@@ -500,7 +500,7 @@ local function GetBuffCount(SpellID, ...)
500500
return count
501501
end
502502

503-
function SimplePointDisplay:GetPoints(CurClass, CurType)
503+
function cPointDisplay:GetPoints(CurClass, CurType)
504504
local NewPoints
505505
-- General
506506
if CurClass == "GENERAL" then
@@ -531,7 +531,7 @@ function SimplePointDisplay:GetPoints(CurClass, CurType)
531531
end
532532

533533
-- Update all valid Point Displays
534-
function SimplePointDisplay:UpdatePoints(...)
534+
function cPointDisplay:UpdatePoints(...)
535535
if not LoggedIn then return end
536536

537537
local HasChanged = false
@@ -571,7 +571,7 @@ function SimplePointDisplay:UpdatePoints(...)
571571
if ( db[ic].types[tid].enabled and not db[ic].types[tid].configmode.enabled ) then
572572
-- Retrieve new point count
573573
local OldPoints = Points[tid]
574-
SimplePointDisplay:GetPoints(ic, tid)
574+
cPointDisplay:GetPoints(ic, tid)
575575
if Points[tid] ~= OldPoints then
576576
-- Points have changed, flag for updating
577577
HasChanged = true
@@ -583,26 +583,26 @@ function SimplePointDisplay:UpdatePoints(...)
583583
end
584584

585585
-- Update Point Displays
586-
if HasChanged then SimplePointDisplay:UpdatePointDisplay(Enable) end
586+
if HasChanged then cPointDisplay:UpdatePointDisplay(Enable) end
587587
end
588588

589589
-- Enable a Point Display
590-
function SimplePointDisplay:EnablePointDisplay(c, t)
591-
SimplePointDisplay:UpdatePoints("ENABLE")
590+
function cPointDisplay:EnablePointDisplay(c, t)
591+
cPointDisplay:UpdatePoints("ENABLE")
592592
end
593593

594594
-- Disable a Point Display
595-
function SimplePointDisplay:DisablePointDisplay(c, t)
595+
function cPointDisplay:DisablePointDisplay(c, t)
596596
-- Set to 0 points
597597
Points[t] = 0
598598
PointsChanged[t] = true
599599

600600
-- Update Point Displays
601-
SimplePointDisplay:UpdatePointDisplay("ENABLE")
601+
cPointDisplay:UpdatePointDisplay("ENABLE")
602602
end
603603

604604
-- Update frame positions/sizes
605-
function SimplePointDisplay:UpdatePosition()
605+
function cPointDisplay:UpdatePosition()
606606
for ic,vc in pairs(Types) do
607607
for it,vt in ipairs(Types[ic].points) do
608608
local tid = Types[ic].points[it].id
@@ -719,7 +719,7 @@ function SimplePointDisplay:UpdatePosition()
719719
end
720720

721721
-- Update BG Panel textures
722-
function SimplePointDisplay:UpdateBGPanelTextures()
722+
function cPointDisplay:UpdateBGPanelTextures()
723723
local BorderA
724724
local BGA
725725

@@ -780,7 +780,7 @@ local function VerifyBorder(border)
780780
end
781781

782782
-- Retrieve Border/Background textures and store in tables
783-
function SimplePointDisplay:GetTextures()
783+
function cPointDisplay:GetTextures()
784784
for ic,vc in pairs(Types) do
785785
for it,vt in ipairs(Types[ic].points) do
786786
local tid = Types[ic].points[it].id
@@ -800,7 +800,7 @@ function SimplePointDisplay:GetTextures()
800800
end
801801
end
802802

803-
function SimplePointDisplay:GetClassColors()
803+
function cPointDisplay:GetClassColors()
804804
local CurClassColor
805805
for k,v in pairs(Types) do
806806
tinsert(ClassColorBarTable, k)
@@ -835,7 +835,7 @@ local function CreateFrames()
835835
local tid = Types[ic].points[it].id
836836

837837
-- BG Panel
838-
local FrameName = "SimplePointDisplay_Frames_"..tid
838+
local FrameName = "cPointDisplay_Frames_"..tid
839839
Frames[ic][tid].bgpanel.frame = CreateFrame("Frame", FrameName, UIParent)
840840

841841
Frames[ic][tid].bgpanel.bg = Frames[ic][tid].bgpanel.frame:CreateTexture(nil, "ARTWORK")
@@ -849,12 +849,12 @@ local function CreateFrames()
849849
Frames[ic][tid].bgpanel.frame:Hide()
850850

851851
-- Anchor Panel
852-
local AnchorFrameName = "SimplePointDisplay_Frames_"..tid.."_avAanchor"
852+
local AnchorFrameName = "cPointDisplay_Frames_"..tid.."_avAanchor"
853853
Frames[ic][tid].anchor.frame = CreateFrame("Frame", AnchorFrameName, UIParent)
854854

855855
-- Point bars
856856
for i = 1, Types[ic].points[it].barcount do
857-
local BarFrameName = "SimplePointDisplay_Frames_"..tid.."_bar"..tostring(i)
857+
local BarFrameName = "cPointDisplay_Frames_"..tid.."_bar"..tostring(i)
858858
Frames[ic][tid].bars[i].frame = CreateFrame("Frame", BarFrameName, UIParent)
859859

860860
Frames[ic][tid].bars[i].bg = Frames[ic][tid].bars[i].frame:CreateTexture(nil, "ARTWORK")
@@ -930,45 +930,46 @@ local function CreateTables()
930930
end
931931
end
932932

933-
function SimplePointDisplay:ProfChange()
933+
function cPointDisplay:ProfChange()
934934
if not LoggedIn then return end
935935

936936
db = self.db.profile
937-
SimplePointDisplay:ConfigRefresh()
938-
SimplePointDisplay:Refresh()
937+
cPointDisplay:ConfigRefresh()
938+
cPointDisplay:Refresh()
939939
end
940940

941-
-- Refresh SimplePointDisplay
942-
function SimplePointDisplay:Refresh()
941+
-- Refresh cPointDisplay
942+
function cPointDisplay:Refresh()
943943
if not LoggedIn then return end
944944

945-
SimplePointDisplay:UpdateSpec()
946-
SimplePointDisplay:UpdateCombatFaderEnabled()
947-
SimplePointDisplay:GetTextures()
948-
SimplePointDisplay:UpdateBGPanelTextures()
949-
SimplePointDisplay:UpdatePosition()
950-
SimplePointDisplay:UpdatePoints("ENABLE")
945+
cPointDisplay:UpdateSpec()
946+
cPointDisplay:UpdateCombatFaderEnabled()
947+
cPointDisplay:GetTextures()
948+
cPointDisplay:UpdateBGPanelTextures()
949+
cPointDisplay:UpdatePosition()
950+
cPointDisplay:UpdatePoints("ENABLE")
951951
end
952952

953953
-- Hide default UI frames
954-
function SimplePointDisplay:HideUIElements()
954+
function cPointDisplay:HideUIElements()
955955
if db["GENERAL"].types["cp"].enabled and db["GENERAL"].types["cp"].general.hideui then
956-
for i = 1,5 do
957-
_G["ComboPoint"..i]:Hide()
958-
_G["ComboPoint"..i]:SetScript("OnShow", function(self) self:Hide() end)
956+
local CPF = ComboPointPlayerFrame
957+
if CPF then
958+
CPF:Hide()
959+
CPF:SetScript("OnShow", function(self) self:Hide() end)
959960
end
960961
end
961962

962963
if db["PALADIN"].types["hp"].enabled and db["PALADIN"].types["hp"].general.hideui then
963-
local HPF = _G["PaladinPowerBar"]
964+
local HPF = PaladinPowerBarFrame
964965
if HPF then
965966
HPF:Hide()
966967
HPF:SetScript("OnShow", function(self) self:Hide() end)
967968
end
968969
end
969970

970971
if db["WARLOCK"].types["ss"].enabled and db["WARLOCK"].types["ss"].general.hideui then
971-
local SSF = _G["ShardBarFrame"]
972+
local SSF = WarlockPowerFrame
972973
if SSF then
973974
SSF:Hide()
974975
SSF:SetScript("OnShow", function(self) self:Hide() end)
@@ -984,23 +985,23 @@ function SimplePointDisplay:HideUIElements()
984985
end
985986
end
986987

987-
function SimplePointDisplay:UpdateSpec()
988+
function cPointDisplay:UpdateSpec()
988989
PlayerSpec = GetActiveSpecGroup()
989990
end
990991

991-
function SimplePointDisplay:PLAYER_ENTERING_WORLD()
992-
SimplePointDisplay:UpdateSpec()
993-
SimplePointDisplay:UpdatePoints("ENABLE")
994-
SimplePointDisplay:UpdatePosition()
992+
function cPointDisplay:PLAYER_ENTERING_WORLD()
993+
cPointDisplay:UpdateSpec()
994+
cPointDisplay:UpdatePoints("ENABLE")
995+
cPointDisplay:UpdatePosition()
995996
end
996997

997998
local function ClassColorsUpdate()
998999
ClassColors = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[PlayerClass] or RAID_CLASS_COLORS[PlayerClass]
999-
SimplePointDisplay:GetClassColors()
1000-
SimplePointDisplay:UpdatePoints("ENABLE")
1000+
cPointDisplay:GetClassColors()
1001+
cPointDisplay:UpdatePoints("ENABLE")
10011002
end
10021003

1003-
function SimplePointDisplay:PLAYER_LOGIN()
1004+
function cPointDisplay:PLAYER_LOGIN()
10041005
PlayerClass = select(2, UnitClass("player"))
10051006

10061007
-- Build Class list to run updates on
@@ -1010,17 +1011,17 @@ function SimplePointDisplay:PLAYER_LOGIN()
10101011
},
10111012

10121013
-- Register Media
1013-
LSM:Register("border", "Solid", [[Interface\Addons\SimplePointDisplay\Media\SolidBorder]])
1014-
LSM:Register("background", "Round-Small", [[Interface\Addons\SimplePointDisplay\Media\Round-Small]])
1015-
LSM:Register("background", "Round-Smaller", [[Interface\Addons\SimplePointDisplay\Media\Round-Smaller]])
1016-
LSM:Register("background", "Arrow", [[Interface\Addons\SimplePointDisplay\Media\Arrow]])
1017-
LSM:Register("background", "Holy Power 1", [[Interface\Addons\SimplePointDisplay\Media\HolyPower1]])
1018-
LSM:Register("background", "Holy Power 2", [[Interface\Addons\SimplePointDisplay\Media\HolyPower2]])
1019-
LSM:Register("background", "Holy Power 3", [[Interface\Addons\SimplePointDisplay\Media\HolyPower3]])
1020-
LSM:Register("background", "Soul Shard", [[Interface\Addons\SimplePointDisplay\Media\SoulShard]])
1014+
LSM:Register("border", "Solid", [[Interface\Addons\cPointDisplay\Media\SolidBorder]])
1015+
LSM:Register("background", "Round-Small", [[Interface\Addons\cPointDisplay\Media\Round-Small]])
1016+
LSM:Register("background", "Round-Smaller", [[Interface\Addons\cPointDisplay\Media\Round-Smaller]])
1017+
LSM:Register("background", "Arrow", [[Interface\Addons\cPointDisplay\Media\Arrow]])
1018+
LSM:Register("background", "Holy Power 1", [[Interface\Addons\cPointDisplay\Media\HolyPower1]])
1019+
LSM:Register("background", "Holy Power 2", [[Interface\Addons\cPointDisplay\Media\HolyPower2]])
1020+
LSM:Register("background", "Holy Power 3", [[Interface\Addons\cPointDisplay\Media\HolyPower3]])
1021+
LSM:Register("background", "Soul Shard", [[Interface\Addons\cPointDisplay\Media\SoulShard]])
10211022

10221023
-- Hide Elements
1023-
SimplePointDisplay:HideUIElements()
1024+
cPointDisplay:HideUIElements()
10241025

10251026
-- Register Events
10261027
-- Throttled Events
@@ -1054,17 +1055,17 @@ function SimplePointDisplay:PLAYER_LOGIN()
10541055
LoggedIn = true
10551056

10561057
-- Refresh Addon
1057-
SimplePointDisplay:Refresh()
1058+
cPointDisplay:Refresh()
10581059
end
10591060

1060-
function SimplePointDisplay:OnInitialize()
1061-
self.db = LibStub("AceDB-3.0"):New("SimplePointDisplayDB", defaults, "Default")
1061+
function cPointDisplay:OnInitialize()
1062+
self.db = LibStub("AceDB-3.0"):New("cPointDisplayDB", defaults, "Default")
10621063

10631064
self.db.RegisterCallback(self, "OnProfileChanged", "ProfChange")
10641065
self.db.RegisterCallback(self, "OnProfileCopied", "ProfChange")
10651066
self.db.RegisterCallback(self, "OnProfileReset", "ProfChange")
10661067

1067-
SimplePointDisplay:SetUpInitialOptions()
1068+
cPointDisplay:SetUpInitialOptions()
10681069

10691070
db = self.db.profile
10701071

0 commit comments

Comments
 (0)