Skip to content

Commit c6be924

Browse files
authored
Merge pull request #7 from ChronosSF/8.0-update
adding 8.0 fixes
2 parents e9daf5e + ce7e3d2 commit c6be924

File tree

3 files changed

+24
-33
lines changed

3 files changed

+24
-33
lines changed

Core.lua

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ cPointDisplay.Types = {
2727
[1] = {name = "Arcane Charges", id = "ac", barcount = 4}
2828
}
2929
},
30-
["HUNTER"] = {
31-
name = "Hunter",
32-
points = {
33-
[1] = {name = "Mongoose Bite Charges", id = "mb", barcount = 3}
34-
}
35-
},
3630
["MONK"] = {
3731
name = "Monk",
3832
points = {
@@ -239,16 +233,16 @@ local CFStatus = nil
239233
-- Power 'Full' check
240234
local power_check = {
241235
MANA = function()
242-
return UnitMana("player") < UnitManaMax("player")
236+
return UnitPower("player", 0) < UnitPowerMax("player", 0)
243237
end,
244238
RAGE = function()
245-
return UnitMana("player") > 0
239+
return UnitPower("player", 1) > 0
246240
end,
247241
ENERGY = function()
248-
return UnitMana("player") < UnitManaMax("player")
242+
return UnitPower("player", 3) < UnitPowerMax("player", 3)
249243
end,
250244
RUNICPOWER = function()
251-
return UnitMana("player") > 0
245+
return UnitPower("player", 6) > 0
252246
end,
253247
}
254248

@@ -328,11 +322,11 @@ function cPointDisplay:CombatFaderCombatState()
328322
-- If in combat, then don't worry about health/power events
329323
if UnitAffectingCombat("player") then
330324
CFFrame:UnregisterEvent("UNIT_HEALTH")
331-
CFFrame:UnregisterEvent("UNIT_POWER")
325+
CFFrame:UnregisterEvent("UNIT_POWER_UPDATE")
332326
CFFrame:UnregisterEvent("UNIT_DISPLAYPOWER")
333327
else
334328
CFFrame:RegisterEvent("UNIT_HEALTH")
335-
CFFrame:RegisterEvent("UNIT_POWER")
329+
CFFrame:RegisterEvent("UNIT_POWER_UPDATE")
336330
CFFrame:RegisterEvent("UNIT_DISPLAYPOWER")
337331
end
338332
end
@@ -348,7 +342,7 @@ function cPointDisplay:UpdateCombatFaderEnabled()
348342
if event == "PLAYER_REGEN_ENABLED" or event == "PLAYER_REGEN_DISABLED" then
349343
cPointDisplay:CombatFaderCombatState()
350344
cPointDisplay:UpdateCFStatus()
351-
elseif event == "UNIT_HEALTH" or event == "UNIT_POWER" or event == "UNIT_DISPLAYPOWER" then
345+
elseif event == "UNIT_HEALTH" or event == "UNIT_POWER_UPDATE" or event == "UNIT_DISPLAYPOWER" then
352346
local unit = ...
353347
if unit == "player" then
354348
cPointDisplay:UpdateCFStatus()
@@ -526,40 +520,34 @@ function cPointDisplay:GetPoints(CurClass, CurType)
526520
NewPoints = GetComboPoints("vehicle", "vehicle")
527521
end
528522
else
529-
NewPoints = UnitPower("player", SPELL_POWER_COMBO_POINTS)
523+
NewPoints = UnitPower("player", 4)
530524
end
531525
end
532526
-- Paladin
533527
elseif CurClass == "PALADIN" and PlayerSpec == 3 then -- hp is only for retribution
534528
-- Holy Power
535529
if CurType == "hp" then
536-
NewPoints = UnitPower("player", SPELL_POWER_HOLY_POWER)
530+
NewPoints = UnitPower("player", Enum.PowerType.HolyPower)
537531
end
538532
-- Monk
539533
elseif CurClass == "MONK" and PlayerSpec == 3 then -- chi is only for windwalkers
540534
-- Chi
541-
local maxchi = UnitPowerMax("player", SPELL_POWER_CHI)
535+
local maxchi = UnitPowerMax("player", Enum.PowerType.Chi)
542536
if (CurType == "c5" and maxchi == 5) or
543537
(CurType == "c6" and maxchi == 6) then
544-
NewPoints = UnitPower("player", SPELL_POWER_CHI)
538+
NewPoints = UnitPower("player", Enum.PowerType.Chi)
545539
end
546540
-- Warlock
547541
elseif CurClass == "WARLOCK" then
548542
-- Soul Shards
549543
if CurType == "ss" then
550-
NewPoints = UnitPower("player", SPELL_POWER_SOUL_SHARDS)
544+
NewPoints = UnitPower("player", Enum.PowerType.SoulShards)
551545
end
552546
-- Mage
553547
elseif CurClass == "MAGE" and PlayerSpec == SPEC_MAGE_ARCANE then
554548
-- Arcane Charges
555549
if CurType == "ac" then
556-
NewPoints = UnitPower("player", SPELL_POWER_ARCANE_CHARGES)
557-
end
558-
-- Hunter
559-
elseif CurClass == "HUNTER" and PlayerSpec == 3 then
560-
-- Mongoose Bite Charges
561-
if CurType == "mb" then
562-
NewPoints = GetSpellCharges(190928)
550+
NewPoints = UnitPower("player", Enum.PowerType.ArcaneCharges)
563551
end
564552
end
565553
Points[CurType] = NewPoints
@@ -1074,18 +1062,18 @@ function cPointDisplay:PLAYER_LOGIN()
10741062
"UNIT_AURA",
10751063
}
10761064
if (PlayerClass == "PALADIN") then
1077-
tinsert(EventList, "UNIT_POWER")
1065+
tinsert(EventList, "UNIT_POWER_UPDATE")
10781066
end
10791067
if (PlayerClass == "MONK") then
1080-
tinsert(EventList, "UNIT_POWER")
1068+
tinsert(EventList, "UNIT_POWER_UPDATE")
10811069
tinsert(EventList, "PLAYER_TALENT_UPDATE")
10821070
end
10831071
if (PlayerClass == "WARLOCK") then
1084-
tinsert(EventList, "UNIT_POWER")
1072+
tinsert(EventList, "UNIT_POWER_UPDATE")
10851073
tinsert(EventList, "UNIT_DISPLAYPOWER")
10861074
end
10871075
if (PlayerClass == "MAGE") then
1088-
tinsert(EventList, "UNIT_POWER")
1076+
tinsert(EventList, "UNIT_POWER_UPDATE")
10891077
end
10901078
local UpdateSpeed = (1 / db.updatespeed)
10911079
self:RegisterBucketEvent(EventList, UpdateSpeed, "UpdatePoints")
@@ -1094,6 +1082,9 @@ function cPointDisplay:PLAYER_LOGIN()
10941082
if (PlayerClass == "HUNTER") then
10951083
self:RegisterEvent("SPELL_UPDATE_CHARGES", "UpdatePoints")
10961084
end
1085+
if (PlayerClass == "ROGUE" or PlayerClass == "DRUID") then
1086+
self:RegisterEvent("UNIT_POWER_UPDATE", "UpdatePoints")
1087+
end
10971088

10981089
-- Class Colors
10991090
if CUSTOM_CLASS_COLORS then

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Then open the renamed file and change the string `nibPointDisplayDB` to `cPointD
1313
- Holy Power
1414
- Soul Shards
1515
- Arcane Charges
16-
- Mongoose Bite Charges
17-
- Chi *new*
16+
- Chi
17+
- ~~Mongoose Bite Charges~~ (removed for 8.0)
1818

1919
### Requests
2020

cPointDisplay.toc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## Interface: 70300
1+
## Interface: 80000
22
## Title: |cFFFF9933c|rPointDisplay
33
## Author: Nibelheim, ChronosSF
44
## Notes: Customizable graphical point display (Combo Points, Holy Power, Soul Shards, etc.). Fan update of nibPointDisplay by Nibelheim.
5-
## Version: 7.3.0
5+
## Version: 8.0.0
66
## SavedVariables: cPointDisplayDB
77
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets
88

0 commit comments

Comments
 (0)