From d4701247a5d164b6f6c0285c70ccaa2a643b5a51 Mon Sep 17 00:00:00 2001 From: memus Date: Wed, 3 Apr 2019 23:29:56 +0200 Subject: [PATCH] Fixed lua error --- RaidNotifier.lua | 4 ++-- RaidNotifier.txt | 2 +- TrialAetherianArchive.lua | 1 - TrialAsylumSanctorium.lua | 3 +-- TrialCloudrest.lua | 20 +++++++++++++++++--- TrialDragonStarArena.lua | 3 +-- TrialHallsOfFabrication.lua | 21 +++++++++++++++++---- TrialHelRaCitadel.lua | 3 +-- TrialMaelstormArena.lua | 3 +-- TrialMawOfLorkhaj.lua | 8 ++++---- TrialSanctumOphidia.lua | 3 +-- 11 files changed, 46 insertions(+), 25 deletions(-) diff --git a/RaidNotifier.lua b/RaidNotifier.lua index b0d42c8..c255590 100644 --- a/RaidNotifier.lua +++ b/RaidNotifier.lua @@ -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 diff --git a/RaidNotifier.txt b/RaidNotifier.txt index 6caacc4..62f4640 100644 --- a/RaidNotifier.txt +++ b/RaidNotifier.txt @@ -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 diff --git a/TrialAetherianArchive.lua b/TrialAetherianArchive.lua index 35057d9..f7a1387 100644 --- a/TrialAetherianArchive.lua +++ b/TrialAetherianArchive.lua @@ -1,5 +1,4 @@ RaidNotifier = RaidNotifier or {} -RaidNotifier.Util = {} RaidNotifier.AA = {} local RaidNotifier = RaidNotifier diff --git a/TrialAsylumSanctorium.lua b/TrialAsylumSanctorium.lua index a94e976..0db3033 100644 --- a/TrialAsylumSanctorium.lua +++ b/TrialAsylumSanctorium.lua @@ -1,5 +1,4 @@ RaidNotifier = RaidNotifier or {} -RaidNotifier.Util = {} RaidNotifier.AS = {} local RaidNotifier = RaidNotifier @@ -226,4 +225,4 @@ function RaidNotifier.AS.OnCombatEvent(_, result, isError, aName, aGraphic, aAct -- --end end -end \ No newline at end of file +end diff --git a/TrialCloudrest.lua b/TrialCloudrest.lua index 7c5436a..a5e4d1a 100644 --- a/TrialCloudrest.lua +++ b/TrialCloudrest.lua @@ -1,5 +1,4 @@ RaidNotifier = RaidNotifier or {} -RaidNotifier.Util = {} RaidNotifier.CR = {} local RaidNotifier = RaidNotifier @@ -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 diff --git a/TrialDragonStarArena.lua b/TrialDragonStarArena.lua index 7637a23..8ebcf63 100644 --- a/TrialDragonStarArena.lua +++ b/TrialDragonStarArena.lua @@ -1,5 +1,4 @@ RaidNotifier = RaidNotifier or {} -RaidNotifier.Util = {} RaidNotifier.DSA = {} local RaidNotifier = RaidNotifier @@ -82,4 +81,4 @@ function RaidNotifier.DSA.OnCombatEvent(_, result, isError, aName, aGraphic, aAc end end end -end \ No newline at end of file +end diff --git a/TrialHallsOfFabrication.lua b/TrialHallsOfFabrication.lua index 6190192..8d70f5d 100644 --- a/TrialHallsOfFabrication.lua +++ b/TrialHallsOfFabrication.lua @@ -1,5 +1,4 @@ RaidNotifier = RaidNotifier or {} -RaidNotifier.Util = {} RaidNotifier.HOF = {} local RaidNotifier = RaidNotifier @@ -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 @@ -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 diff --git a/TrialHelRaCitadel.lua b/TrialHelRaCitadel.lua index e82e305..d351ab9 100644 --- a/TrialHelRaCitadel.lua +++ b/TrialHelRaCitadel.lua @@ -1,5 +1,4 @@ RaidNotifier = RaidNotifier or {} -RaidNotifier.Util = {} RaidNotifier.HRC = {} local RaidNotifier = RaidNotifier @@ -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 \ No newline at end of file +end diff --git a/TrialMaelstormArena.lua b/TrialMaelstormArena.lua index 666b119..75e11d3 100644 --- a/TrialMaelstormArena.lua +++ b/TrialMaelstormArena.lua @@ -1,5 +1,4 @@ RaidNotifier = RaidNotifier or {} -RaidNotifier.Util = {} RaidNotifier.MA = {} local RaidNotifier = RaidNotifier @@ -32,4 +31,4 @@ function RaidNotifier.MA.OnCombatEvent(_, result, isError, aName, aGraphic, aAct end end end -end \ No newline at end of file +end diff --git a/TrialMawOfLorkhaj.lua b/TrialMawOfLorkhaj.lua index 5cf1b26..1e7ca40 100644 --- a/TrialMawOfLorkhaj.lua +++ b/TrialMawOfLorkhaj.lua @@ -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 @@ -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 @@ -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) diff --git a/TrialSanctumOphidia.lua b/TrialSanctumOphidia.lua index 24938af..8257a21 100644 --- a/TrialSanctumOphidia.lua +++ b/TrialSanctumOphidia.lua @@ -1,5 +1,4 @@ RaidNotifier = RaidNotifier or {} -RaidNotifier.Util = {} RaidNotifier.SO = {} local RaidNotifier = RaidNotifier @@ -132,4 +131,4 @@ function RaidNotifier.SO.OnCombatEvent(_, result, isError, aName, aGraphic, aAct end end end -end \ No newline at end of file +end