Skip to content

Commit

Permalink
Merge pull request #7 from ChronosSF/8.0-update
Browse files Browse the repository at this point in the history
adding 8.0 fixes
  • Loading branch information
ChronosSF authored Jul 23, 2018
2 parents e9daf5e + ce7e3d2 commit c6be924
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 33 deletions.
49 changes: 20 additions & 29 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ cPointDisplay.Types = {
[1] = {name = "Arcane Charges", id = "ac", barcount = 4}
}
},
["HUNTER"] = {
name = "Hunter",
points = {
[1] = {name = "Mongoose Bite Charges", id = "mb", barcount = 3}
}
},
["MONK"] = {
name = "Monk",
points = {
Expand Down Expand Up @@ -239,16 +233,16 @@ local CFStatus = nil
-- Power 'Full' check
local power_check = {
MANA = function()
return UnitMana("player") < UnitManaMax("player")
return UnitPower("player", 0) < UnitPowerMax("player", 0)
end,
RAGE = function()
return UnitMana("player") > 0
return UnitPower("player", 1) > 0
end,
ENERGY = function()
return UnitMana("player") < UnitManaMax("player")
return UnitPower("player", 3) < UnitPowerMax("player", 3)
end,
RUNICPOWER = function()
return UnitMana("player") > 0
return UnitPower("player", 6) > 0
end,
}

Expand Down Expand Up @@ -328,11 +322,11 @@ function cPointDisplay:CombatFaderCombatState()
-- If in combat, then don't worry about health/power events
if UnitAffectingCombat("player") then
CFFrame:UnregisterEvent("UNIT_HEALTH")
CFFrame:UnregisterEvent("UNIT_POWER")
CFFrame:UnregisterEvent("UNIT_POWER_UPDATE")
CFFrame:UnregisterEvent("UNIT_DISPLAYPOWER")
else
CFFrame:RegisterEvent("UNIT_HEALTH")
CFFrame:RegisterEvent("UNIT_POWER")
CFFrame:RegisterEvent("UNIT_POWER_UPDATE")
CFFrame:RegisterEvent("UNIT_DISPLAYPOWER")
end
end
Expand All @@ -348,7 +342,7 @@ function cPointDisplay:UpdateCombatFaderEnabled()
if event == "PLAYER_REGEN_ENABLED" or event == "PLAYER_REGEN_DISABLED" then
cPointDisplay:CombatFaderCombatState()
cPointDisplay:UpdateCFStatus()
elseif event == "UNIT_HEALTH" or event == "UNIT_POWER" or event == "UNIT_DISPLAYPOWER" then
elseif event == "UNIT_HEALTH" or event == "UNIT_POWER_UPDATE" or event == "UNIT_DISPLAYPOWER" then
local unit = ...
if unit == "player" then
cPointDisplay:UpdateCFStatus()
Expand Down Expand Up @@ -526,40 +520,34 @@ function cPointDisplay:GetPoints(CurClass, CurType)
NewPoints = GetComboPoints("vehicle", "vehicle")
end
else
NewPoints = UnitPower("player", SPELL_POWER_COMBO_POINTS)
NewPoints = UnitPower("player", 4)
end
end
-- Paladin
elseif CurClass == "PALADIN" and PlayerSpec == 3 then -- hp is only for retribution
-- Holy Power
if CurType == "hp" then
NewPoints = UnitPower("player", SPELL_POWER_HOLY_POWER)
NewPoints = UnitPower("player", Enum.PowerType.HolyPower)
end
-- Monk
elseif CurClass == "MONK" and PlayerSpec == 3 then -- chi is only for windwalkers
-- Chi
local maxchi = UnitPowerMax("player", SPELL_POWER_CHI)
local maxchi = UnitPowerMax("player", Enum.PowerType.Chi)
if (CurType == "c5" and maxchi == 5) or
(CurType == "c6" and maxchi == 6) then
NewPoints = UnitPower("player", SPELL_POWER_CHI)
NewPoints = UnitPower("player", Enum.PowerType.Chi)
end
-- Warlock
elseif CurClass == "WARLOCK" then
-- Soul Shards
if CurType == "ss" then
NewPoints = UnitPower("player", SPELL_POWER_SOUL_SHARDS)
NewPoints = UnitPower("player", Enum.PowerType.SoulShards)
end
-- Mage
elseif CurClass == "MAGE" and PlayerSpec == SPEC_MAGE_ARCANE then
-- Arcane Charges
if CurType == "ac" then
NewPoints = UnitPower("player", SPELL_POWER_ARCANE_CHARGES)
end
-- Hunter
elseif CurClass == "HUNTER" and PlayerSpec == 3 then
-- Mongoose Bite Charges
if CurType == "mb" then
NewPoints = GetSpellCharges(190928)
NewPoints = UnitPower("player", Enum.PowerType.ArcaneCharges)
end
end
Points[CurType] = NewPoints
Expand Down Expand Up @@ -1074,18 +1062,18 @@ function cPointDisplay:PLAYER_LOGIN()
"UNIT_AURA",
}
if (PlayerClass == "PALADIN") then
tinsert(EventList, "UNIT_POWER")
tinsert(EventList, "UNIT_POWER_UPDATE")
end
if (PlayerClass == "MONK") then
tinsert(EventList, "UNIT_POWER")
tinsert(EventList, "UNIT_POWER_UPDATE")
tinsert(EventList, "PLAYER_TALENT_UPDATE")
end
if (PlayerClass == "WARLOCK") then
tinsert(EventList, "UNIT_POWER")
tinsert(EventList, "UNIT_POWER_UPDATE")
tinsert(EventList, "UNIT_DISPLAYPOWER")
end
if (PlayerClass == "MAGE") then
tinsert(EventList, "UNIT_POWER")
tinsert(EventList, "UNIT_POWER_UPDATE")
end
local UpdateSpeed = (1 / db.updatespeed)
self:RegisterBucketEvent(EventList, UpdateSpeed, "UpdatePoints")
Expand All @@ -1094,6 +1082,9 @@ function cPointDisplay:PLAYER_LOGIN()
if (PlayerClass == "HUNTER") then
self:RegisterEvent("SPELL_UPDATE_CHARGES", "UpdatePoints")
end
if (PlayerClass == "ROGUE" or PlayerClass == "DRUID") then
self:RegisterEvent("UNIT_POWER_UPDATE", "UpdatePoints")
end

-- Class Colors
if CUSTOM_CLASS_COLORS then
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Then open the renamed file and change the string `nibPointDisplayDB` to `cPointD
- Holy Power
- Soul Shards
- Arcane Charges
- Mongoose Bite Charges
- Chi *new*
- Chi
- ~~Mongoose Bite Charges~~ (removed for 8.0)

### Requests

Expand Down
4 changes: 2 additions & 2 deletions cPointDisplay.toc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Interface: 70300
## Interface: 80000
## Title: |cFFFF9933c|rPointDisplay
## Author: Nibelheim, ChronosSF
## Notes: Customizable graphical point display (Combo Points, Holy Power, Soul Shards, etc.). Fan update of nibPointDisplay by Nibelheim.
## Version: 7.3.0
## Version: 8.0.0
## SavedVariables: cPointDisplayDB
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets

Expand Down

0 comments on commit c6be924

Please sign in to comment.