Skip to content

Commit

Permalink
Recent Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tdymel committed Jul 23, 2017
1 parent e94d3e4 commit 9124f17
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 22 deletions.
32 changes: 19 additions & 13 deletions Auras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function MPOWA:OnUpdate(elapsed)
for cat, val in self.NeedUpdate do
if val then
path = self.SAVE[cat]
if not path then return end
if path["enemytarget"] and not UN("target") and not UnitIsFriend("player", "target") then return end
if not self.active[cat] and self:TernaryReturn(cat, "alive", self:Reverse(UnitIsDeadOrGhost("player"))) and self:TernaryReturn(cat, "mounted", self.mounted) and self:TernaryReturn(cat, "incombat", UnitAffectingCombat("player")) and self:TernaryReturn(cat, "inparty", self.party) and self:TernaryReturn(cat, "inraid", UnitInRaid("player")) and self:TernaryReturn(cat, "inbattleground", self.bg) and self:TernaryReturn(cat, "inraidinstance", self.instance) then
self.frames[cat][4]:Hide()
Expand Down Expand Up @@ -104,6 +105,7 @@ function MPOWA:OnUpdate(elapsed)
for cat, val in self.active do
if val then
path = self.SAVE[cat]
if not path then return end
text, count = "", 0
if (path["unit"] or "player") == "player" then
count = GetPlayerBuffApplications(val)
Expand Down Expand Up @@ -297,18 +299,19 @@ function MPOWA:Iterate(unit)

for cat, val in pairs(self.SAVE) do
if (val["buffname"] == "unitpower") then
local tarid = 44
if unit then
if (unit == "target") then
tarid = 45
elseif (string.find(unit,"raid")) then
--local a,b = string.find(unit,"raid")
tarid = tonumber(string.sub(unit, 5))+45
elseif (string.find(unit,"party")) then
--local a,b = string.find(unit,"party")
tarid = tonumber(string.sub(unit, 6))+45
local unit = arg1
if (unit == "target") then
self:Push("unitpower", unit, 45, false)
elseif (string.find(unit,"raid")) then
local st = string.sub(unit, 5)
if st and tonumber(st) then
self:Push("unitpower", unit, (tonumber(st) or 0)+45, false)
end
elseif (string.find(unit,"party")) then
local st = string.sub(unit, 6)
if st and tonumber(st) then
self:Push("unitpower", unit, (tonumber(st) or 0)+45, false)
end
self:Push("unitpower", unit, tarid, false)
end
end
end
Expand Down Expand Up @@ -383,10 +386,13 @@ function MPOWA:Push(aura, unit, i, isdebuff)
end
tex = strlower(strsub(tex, strfind(tex, "Icons")+6))
end
BuffExist[val] = true -- May cause issues elsewhere :/
if path["isdebuff"]==isdebuff and ((path["secondspecifier"] and (strlower(path["secondspecifiertext"])==tex)) or not path["secondspecifier"]) then
if self:TernaryReturn(val, "alive", self:Reverse(UnitIsDeadOrGhost("player"))) and self:TernaryReturn(val, "mounted", self.mounted) and self:TernaryReturn(val, "incombat", UnitAffectingCombat("player")) and self:TernaryReturn(val, "inparty", self.party) and self:TernaryReturn(val, "inraid", UnitInRaid("player")) and self:TernaryReturn(val, "inbattleground", self.bg) and self:TernaryReturn(val, "inraidinstance", self.instance) and not path["cooldown"]
if self:TernaryReturn(val, "alive", self:Reverse(UnitIsDeadOrGhost("player"))) and self:TernaryReturn(val, "mounted", self.mounted)
and self:TernaryReturn(val, "incombat", UnitAffectingCombat("player")) and self:TernaryReturn(val, "inparty", self.party)
and self:TernaryReturn(val, "inraid", UnitInRaid("player")) and self:TernaryReturn(val, "inbattleground", self.bg)
and self:TernaryReturn(val, "inraidinstance", self.instance) and not path["cooldown"]
and (self:IsStacks(GetComboPoints("player", "target"), val, "cpstacks") or (path["buffname"] == "unitpower" and path["inverse"])) then
BuffExist[val] = true
if path["enemytarget"] and unit == "target" then
self.active[val] = i
elseif path["friendlytarget"] and unit == "target" then
Expand Down
2 changes: 1 addition & 1 deletion GUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ function MPOWA:ScrollFrame_Update()
local line -- 1 through 5 of our window to scroll
local lineplusoffset -- an index into our data calculated from the scroll offset
local FRAME = MPowa_ProfileFrame_ScrollFrame
FauxScrollFrame_Update(FRAME,self:GetTableLength(MPOWA_PROFILE),7,40)
FauxScrollFrame_Update(FRAME,MPOWA:GetTableLength(MPOWA_PROFILE),7,40)
for line=1,7 do
lineplusoffset = line + FauxScrollFrame_GetOffset(FRAME)
if MPOWA_PROFILE[lineplusoffset] ~= nil then
Expand Down
18 changes: 10 additions & 8 deletions Init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CreateFrame("Frame", "MPOWA", UIParent)
MPOWA.Build = 55
MPOWA.Build = 56
MPOWA.Cloaded = false
MPOWA.loaded = false
MPOWA.selected = 1
Expand Down Expand Up @@ -164,19 +164,21 @@ function MPOWA:OnEvent(event, arg1)
self.Windfury = false
end
elseif event == "UNIT_MANA" or event == "UNIT_RAGE" or event == "UNIT_ENERGY" then
local tarid = 44
if arg1 then
local unit = arg1
if (unit == "target") then
tarid = 45
self:Push("unitpower", unit, 45, false)
elseif (string.find(unit,"raid")) then
--local a,b = string.find(unit,"raid")
tarid = tonumber(string.sub(unit, 5))+45
local st = string.sub(unit, 5)
if st and tonumber(st) then
self:Push("unitpower", unit, (tonumber(st) or 0)+45, false)
end
elseif (string.find(unit,"party")) then
--local a,b = string.find(unit,"party")
tarid = tonumber(string.sub(unit, 6))+45
local st = string.sub(unit, 6)
if st and tonumber(st) then
self:Push("unitpower", unit, (tonumber(st) or 0)+45, false)
end
end
self:Push("unitpower", unit, tarid, false)
end
elseif event == "PLAYER_LOGOUT" then
MPOWA_SAVE = table.copy(self.SAVE, true)
Expand Down

0 comments on commit 9124f17

Please # to comment.