Skip to content

Commit

Permalink
Fixed update issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonaza committed Aug 23, 2018
1 parent 887f9ad commit 966c5df
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
11 changes: 4 additions & 7 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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();
Expand Down Expand Up @@ -643,6 +639,7 @@ function ExperiencerModuleBarsMixin:Refresh(instant)
end

if(instant or isLoss) then
self.hasBuffer = false;
self:TriggerBufferedUpdate(true);
else
self.hasBuffer = true;
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions modules/artifact.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ function module:IsDisabled()
return not C_AzeriteItem.HasActiveAzeriteItem()
end

function module:AllowedToBufferUpdate()
return true;
end

function module:Update(elapsed)

end
Expand Down
4 changes: 4 additions & 0 deletions modules/conquest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions modules/experience.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 4 additions & 0 deletions modules/honor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion modules/reputation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit 966c5df

Please sign in to comment.