Skip to content

Commit

Permalink
Fixed lua error
Browse files Browse the repository at this point in the history
  • Loading branch information
memus committed Apr 3, 2019
1 parent 6781cfd commit d470124
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 25 deletions.
4 changes: 2 additions & 2 deletions RaidNotifier.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
RaidNotifier = RaidNotifier or {}
RaidNotifier.Util = {}
RaidNotifier.Util = RaidNotifier.Util or {}

local RaidNotifier = RaidNotifier

RaidNotifier.Name = "RaidNotifier"
RaidNotifier.DisplayName = "Raid Notifier"
RaidNotifier.Version = "2.9.1"
RaidNotifier.Version = "2.9.4"
RaidNotifier.Author = "|c009ad6Kyoma, Memus, Woeler, silentgecko|r"
RaidNotifier.SV_Name = "RNVars"
RaidNotifier.SV_Version = 4
Expand Down
2 changes: 1 addition & 1 deletion RaidNotifier.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Title: |cEFEBBERaidNotifier|r
## Description: Displays on-screen notifications on different events during trials.
## Author: |c009ad6Kyoma, Memus, Woeler, silentgecko|r
## Version: 2.9.1
## Version: 2.9.4
## APIVersion: 100026
## SavedVariables: RNVars RN_DEBUG_LOG
## OptionalDependsOn: LibAddonMenu-2.0 LibMapPing LibGPS2 LibGroupSocket
Expand Down
1 change: 0 additions & 1 deletion TrialAetherianArchive.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
RaidNotifier = RaidNotifier or {}
RaidNotifier.Util = {}
RaidNotifier.AA = {}

local RaidNotifier = RaidNotifier
Expand Down
3 changes: 1 addition & 2 deletions TrialAsylumSanctorium.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
RaidNotifier = RaidNotifier or {}
RaidNotifier.Util = {}
RaidNotifier.AS = {}

local RaidNotifier = RaidNotifier
Expand Down Expand Up @@ -226,4 +225,4 @@ function RaidNotifier.AS.OnCombatEvent(_, result, isError, aName, aGraphic, aAct
--
--end
end
end
end
20 changes: 17 additions & 3 deletions TrialCloudrest.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
RaidNotifier = RaidNotifier or {}
RaidNotifier.Util = {}
RaidNotifier.CR = {}

local RaidNotifier = RaidNotifier
Expand All @@ -18,14 +17,29 @@ function RaidNotifier.CR.Initialize()
data.portalCounter = 0
end

function RaidNotifier.CR.OnCombatStateChanged(inCombat)
if (not inCombat) then
function RaidNotifier.CR.OnBossesChanged()
local bossCount, bossAlive, bossFull = RaidNotifier:GetNumBosses(true)

-- reset if:
-- 1) there are no bosses
-- 2) all bosses are dead
-- 3) all bosses are at full health
if bossCount == 0 or bossAlive == 0 or bossFull == bossCount then
data = {}
data.spearCounter = 0
data.portalCounter = 0
end
end

--function RaidNotifier.CR.OnCombatStateChanged(inCombat)
-- if (not inCombat) then
-- data = {}
-- data.hoarfrost = {}
-- data.spearCounter = 0
-- data.portalCounter = 0
-- end
--end

function RaidNotifier.CR.OnCombatEvent(_, result, isError, aName, aGraphic, aActionSlotType, sName, sType, tName, tType, hitValue, pType, dType, log, sUnitId, tUnitId, abilityId)
local raidId = RaidNotifier.raidId
local self = RaidNotifier
Expand Down
3 changes: 1 addition & 2 deletions TrialDragonStarArena.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
RaidNotifier = RaidNotifier or {}
RaidNotifier.Util = {}
RaidNotifier.DSA = {}

local RaidNotifier = RaidNotifier
Expand Down Expand Up @@ -82,4 +81,4 @@ function RaidNotifier.DSA.OnCombatEvent(_, result, isError, aName, aGraphic, aAc
end
end
end
end
end
21 changes: 17 additions & 4 deletions TrialHallsOfFabrication.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
RaidNotifier = RaidNotifier or {}
RaidNotifier.Util = {}
RaidNotifier.HOF = {}

local RaidNotifier = RaidNotifier
Expand All @@ -17,13 +16,27 @@ function RaidNotifier.HOF.Initialize()
data.Minions = {}
end

function RaidNotifier.HOF.OnCombatStateChanged(inCombat)
if (not inCombat) then
function RaidNotifier.HOF.OnBossesChanged()
local bossCount, bossAlive, bossFull = RaidNotifier:GetNumBosses(true)
-- reset if:
-- 1) there are no bosses
-- 2) all bosses are dead
-- 3) all bosses are at full health
if bossCount == 0 or bossAlive == 0 or bossFull == bossCount then
data = {}
data.Minions = {}
end
end

function RaidNotifier.HOF.OnCombatStateChanged(inCombat)
if (not inCombat) then
dbg("Bosses changed, stop any active countdown")
RaidNotifier:StopCountdown()
-- data = {}
-- data.Minions = {}
end
end

function RaidNotifier.HOF.OnEffectChanged(eventCode, changeType, eSlot, eName, uTag, beginTime, endTime, stackCount, iconName, buffType, eType, aType, statusEffectType, uName, uId, abilityId, uType)
local raidId = RaidNotifier.raidId
local self = RaidNotifier
Expand Down Expand Up @@ -128,7 +141,7 @@ function RaidNotifier.HOF.OnCombatEvent(_, result, isError, aName, aGraphic, aAc
elseif (abilityId == buffsDebuffs.committee_overheat or abilityId == buffsDebuffs.committee_overload) then
if self:IsDevMode() then
if (settings.committee_overpower_auras_dynamic == true) then
if (Util.SafeInt(data.committee_countdown_index) > 0) then --only run while countdown is still happening
if (RaidNotifier.Util.SafeInt(data.committee_countdown_index) > 0) then --only run while countdown is still happening
local key = (abilityId == buffsDebuffs.committee_overload) and "committee_overload_target" or "committee_overheat_target"
local lastTarget = data[key]
data[key] = tUnitId
Expand Down
3 changes: 1 addition & 2 deletions TrialHelRaCitadel.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
RaidNotifier = RaidNotifier or {}
RaidNotifier.Util = {}
RaidNotifier.HRC = {}

local RaidNotifier = RaidNotifier
Expand Down Expand Up @@ -64,4 +63,4 @@ function RaidNotifier.HRC.OnCombatEvent(_, result, isError, aName, aGraphic, aAc
dbg("GAINED >> Warrior Stone Form on %s, hitValue: %d", tName, hitValue)
end
end
end
end
3 changes: 1 addition & 2 deletions TrialMaelstormArena.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
RaidNotifier = RaidNotifier or {}
RaidNotifier.Util = {}
RaidNotifier.MA = {}

local RaidNotifier = RaidNotifier
Expand Down Expand Up @@ -32,4 +31,4 @@ function RaidNotifier.MA.OnCombatEvent(_, result, isError, aName, aGraphic, aAct
end
end
end
end
end
8 changes: 4 additions & 4 deletions TrialMawOfLorkhaj.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
RaidNotifier = RaidNotifier or {}
RaidNotifier.Util = RaidNotifier.Util or {}
RaidNotifier.MOL = {}

local RaidNotifier = RaidNotifier
local Util = RaidNotifier.Util

local function p() end
local function dbg() end
Expand All @@ -25,7 +23,7 @@ local function FindGlyph(glyphId, glyphs, knownGlyphs, allowNew)
local pX, pY = GetMapPlayerPosition("group"..p)
if (knownGlyphs[index] == nil) then --only check unknown glyphs
-- we dont care about scale/factor or how much it is in actual meters
local distance = Util.GetRawDistance(pX,pY, data.x,data.y) * 1000
local distance = RaidNotifier.Util.GetRawDistance(pX,pY, data.x,data.y) * 1000
if (distance < lowestDistance) then
lowestDistance=distance
lowestIndex=index
Expand Down Expand Up @@ -76,7 +74,9 @@ function RaidNotifier.MOL.OnCombatEvent(_, result, isError, aName, aGraphic, aAc
local buffsDebuffs, settings = self.BuffsDebuffs[raidId], self.Vars.mawLorkhaj
if (tName == nil or tName == "") then
tName = self.UnitIdToString(tUnitId)
end
end

dbg(Util)

--Zhaj'hassa the Forgotten
-- Glyphs & Curse (UI elements only, notification code is further down below)
Expand Down
3 changes: 1 addition & 2 deletions TrialSanctumOphidia.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
RaidNotifier = RaidNotifier or {}
RaidNotifier.Util = {}
RaidNotifier.SO = {}

local RaidNotifier = RaidNotifier
Expand Down Expand Up @@ -132,4 +131,4 @@ function RaidNotifier.SO.OnCombatEvent(_, result, isError, aName, aGraphic, aAct
end
end
end
end
end

0 comments on commit d470124

Please sign in to comment.