Skip to content

Commit

Permalink
Major bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Jan 30, 2019
1 parent 43d236e commit cc1542b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
28 changes: 25 additions & 3 deletions REKeys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ local UnitClass = _G.UnitClass
local UnitFactionGroup = _G.UnitFactionGroup
local UnitExists = _G.UnitExists
local IsPlayerAtEffectiveMaxLevel = _G.IsPlayerAtEffectiveMaxLevel
local IsQuestBounty = _G.IsQuestBounty
local IsInGroup = _G.IsInGroup
local IsInGuild = _G.IsInGuild
local IsInRaid = _G.IsInRaid
Expand All @@ -47,11 +48,12 @@ local SecondsToTime = _G.SecondsToTime
local ElvUI = _G.ElvUI
local RaiderIO = _G.RaiderIO

RE.DataVersion = 6
RE.DataVersion = 7
RE.ThrottleTimer = 0
RE.BestRun = 0
RE.Outdated = false
RE.Fill = true
RE.MPlusDataReceived = false
RE.ThrottleTable = {}
RE.PartyState = {}
RE.DBNameSort = {}
Expand Down Expand Up @@ -139,7 +141,7 @@ function RE:OnLoad(self)
self:RegisterEvent("PLAYER_ENTERING_WORLD")
end

function RE:OnEvent(self, event, name)
function RE:OnEvent(self, event, name, ...)
if event == "ADDON_LOADED" and name == "REKeys" then
if not _G.REKeysDB then _G.REKeysDB = {} end
if not _G.REKeysSettings then _G.REKeysSettings = RE.DefaultSettings end
Expand Down Expand Up @@ -177,7 +179,7 @@ function RE:OnEvent(self, event, name)
icon = "Interface\\Icons\\INV_Relics_Hourglass",
})
function RE.LDB:OnEnter()
if RE.LDB.text == "|cFF74D06CRE|rKeys" then return end
if RE.LDB.text == "|cFF74D06CRE|rKeys" or not RE.MPlusDataReceived then return end
if RE.Outdated then
RE.Tooltip = QTIP:Acquire("REKeysTooltip", 1, "CENTER")
if ElvUI then
Expand Down Expand Up @@ -242,6 +244,7 @@ function RE:OnEvent(self, event, name)
RE.MyFullName = RE.MyName.."-"..RE.MyRealm
RE.MyFaction = UnitFactionGroup("player")
RE.MyClass = select(2, UnitClass("player"))
self:RegisterEvent("MYTHIC_PLUS_CURRENT_AFFIX_UPDATE")
RequestMapInfo()
RequestCurrentAffixes()
RequestRewards()
Expand All @@ -260,6 +263,14 @@ function RE:OnEvent(self, event, name)
Timer.After(5, function() RE:FindKey(true) end)
elseif event == "MODIFIER_STATE_CHANGED" and strfind(name, "SHIFT") and QTIP:IsAcquired("REKeysTooltip") and not RE.Outdated then
RE.FillTooltip()
elseif event == "QUEST_ACCEPTED" then
local questID = ...
if IsQuestBounty(questID) then
RE.MPlusDataReceived = false
RE:FindKey()
end
elseif event == "MYTHIC_PLUS_CURRENT_AFFIX_UPDATE" then
RE.MPlusDataReceived = true
end
end

Expand Down Expand Up @@ -301,6 +312,12 @@ end
function RE:FindKey(dungeonCompleted)
local keystone = GetOwnedKeystoneChallengeMapID()

if not RE.MPlusDataReceived then
RequestCurrentAffixes()
Timer.After(3, RE.FindKey)
return
end

if dungeonCompleted then
RE.BestRun = GetWeeklyChestRewardLevel()
if RE.Settings.MyKeys[RE.MyFullName] then
Expand Down Expand Up @@ -337,6 +354,7 @@ function RE:FindKey(dungeonCompleted)
RE.BestRun = GetWeeklyChestRewardLevel()
local keystoneLevel = GetOwnedKeystoneLevel()
if not RE.Settings.MyKeys[RE.MyFullName] then
RE.BestRun = 0
RE.Settings.MyKeys[RE.MyFullName] = {}
elseif RE.Settings.MyKeys[RE.MyFullName].DungeonID == keystone and RE.Settings.MyKeys[RE.MyFullName].DungeonLevel == keystoneLevel and RE.LDB.text ~= "|cFF74D06CRE|rKeys" then
return
Expand Down Expand Up @@ -633,8 +651,12 @@ function RE:GetRaiderIOScore(name)
end

function RE:KeySearchDelay()
if not RE.MPlusDataReceived then
RequestCurrentAffixes()
end
RE:FindKey()
_G.REKeysFrame:RegisterEvent("CHALLENGE_MODE_COMPLETED")
_G.REKeysFrame:RegisterEvent("QUEST_ACCEPTED")
BUCKET:RegisterBucketEvent("BAG_UPDATE", 2, RE.FindKey)
if RaiderIO then
_G.REKeysFrame:RegisterEvent("MODIFIER_STATE_CHANGED")
Expand Down
2 changes: 1 addition & 1 deletion REKeys.toc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Interface: 80100
## Title: |cFF74D06CRE|rKeys
## Notes: Collect information about keystones owned by your friends.
## Version: 1.5.3
## Version: 1.5.4
## Author: AcidWeb
## SavedVariables: REKeysDB, REKeysSettings
## X-Website: https://www.curseforge.com/wow/addons/rekeys-keystone-manager
Expand Down

0 comments on commit cc1542b

Please sign in to comment.