From 966c5df8549e388d10e5f66aad33556bc37d03b1 Mon Sep 17 00:00:00 2001 From: Sonaza Date: Thu, 23 Aug 2018 23:40:00 +0300 Subject: [PATCH] Fixed update issues --- CHANGELOG.md | 3 +++ core.lua | 11 ++++------- modules/artifact.lua | 4 ++++ modules/conquest.lua | 4 ++++ modules/experience.lua | 4 ++++ modules/honor.lua | 4 ++++ modules/reputation.lua | 6 +++++- 7 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 476fc76..c82479a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 3.0.2 +* Fixed update issues with reputation bar while auto watch is enabled. + ## 3.0.1 * Now auto watch automatically tracks reputation with largest gain when multiple reputations are earned at same time. diff --git a/core.lua b/core.lua index c8586ee..94b24fe 100644 --- a/core.lua +++ b/core.lua @@ -517,8 +517,8 @@ function ExperiencerModuleBarsMixin:TriggerBufferedUpdate(instant) self:SetAnimationSpeed(1.0); - if(valueHasChanged and not self.hasModuleChanged) then - if(self.previousData and not isLoss) then + if(valueHasChanged and not self.hasModuleChanged and not instant and not isLoss) then + if(self.previousData) then local current = data.current; local previous = self.previousData.current; @@ -538,10 +538,6 @@ function ExperiencerModuleBarsMixin:TriggerBufferedUpdate(instant) self.main:ProcessChangesInstantly(); end - if(instant or isLoss) then - self.main:ProcessChangesInstantly(); - end - if(not instant and valueHasChanged and not self.hasModuleChanged) then if(not isLoss) then self.change.fadegain_in:Stop(); @@ -643,6 +639,7 @@ function ExperiencerModuleBarsMixin:Refresh(instant) end if(instant or isLoss) then + self.hasBuffer = false; self:TriggerBufferedUpdate(true); else self.hasBuffer = true; @@ -1404,7 +1401,7 @@ function ExperiencerModuleBarsMixin:OnUpdate(elapsed) if(self.hasBuffer) then self.bufferTimeout = self.bufferTimeout - elapsed; - if(self.bufferTimeout <= 0.0) then + if(self.bufferTimeout <= 0.0 and not self.module:AllowedToBufferUpdate()) then self:TriggerBufferedUpdate(); self.hasBuffer = false; end diff --git a/modules/artifact.lua b/modules/artifact.lua index efdd47b..e2e33b1 100644 --- a/modules/artifact.lua +++ b/modules/artifact.lua @@ -28,6 +28,10 @@ function module:IsDisabled() return not C_AzeriteItem.HasActiveAzeriteItem() end +function module:AllowedToBufferUpdate() + return true; +end + function module:Update(elapsed) end diff --git a/modules/conquest.lua b/modules/conquest.lua index 766fc7e..34423d3 100644 --- a/modules/conquest.lua +++ b/modules/conquest.lua @@ -31,6 +31,10 @@ function module:IsDisabled() return UnitLevel("player") < CONQUEST_UNLOCK_LEVEL; end +function module:AllowedToBufferUpdate() + return true; +end + function module:Update(elapsed) end diff --git a/modules/experience.lua b/modules/experience.lua index 8f8b578..8c1986e 100644 --- a/modules/experience.lua +++ b/modules/experience.lua @@ -101,6 +101,10 @@ function module:IsDisabled() return module:IsPlayerMaxLevel() or IsXPUserDisabled(); end +function module:AllowedToBufferUpdate() + return true; +end + function module:Update(elapsed) local lastPaused = module.session.Paused; module.session.Paused = UnitIsAFK("player"); diff --git a/modules/honor.lua b/modules/honor.lua index 0eb4765..029c4fe 100644 --- a/modules/honor.lua +++ b/modules/honor.lua @@ -32,6 +32,10 @@ function module:IsDisabled() return UnitLevel("player") < HONOR_UNLOCK_LEVEL; end +function module:AllowedToBufferUpdate() + return true; +end + function module:Update(elapsed) end diff --git a/modules/reputation.lua b/modules/reputation.lua index 30556e2..f4a2a85 100644 --- a/modules/reputation.lua +++ b/modules/reputation.lua @@ -667,7 +667,7 @@ function module:CHAT_MSG_COMBAT_FACTION_CHANGE(event, message, ...) local name = GetWatchedFactionInfo(); if(not self.db.global.AutoWatch.IgnoreGuild or not isGuild) then module.AutoWatchUpdate = true; - module.AutoWatchRecentTimeout = 0.25; + module.AutoWatchRecentTimeout = 0.1; if(not module.AutoWatchRecent[reputation]) then module.AutoWatchRecent[reputation] = 0; @@ -677,6 +677,10 @@ function module:CHAT_MSG_COMBAT_FACTION_CHANGE(event, message, ...) end end +function module:AllowedToBufferUpdate() + return not module.AutoWatchUpdate; +end + function module:Update(elapsed) if (module.AutoWatchUpdate) then if (module.AutoWatchRecentTimeout > 0.0) then