Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bag Lag Experiment #971

Merged
merged 3 commits into from
May 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions core/Experiments.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ along with AdiBags. If not, see <http://www.gnu.org/licenses/>.


local addonName, addon = ...

---@class Experiments
local Experiments = addon:NewModule('Experiments')
local Opts = LibStub('AceDBOptions-3.0')

---@cast addon +AdiBags
---@cast Experiments +Experiments

---@diagnostic disable-next-line: duplicate-set-field
function Experiments:OnInitialize()
-- addon.db.global.experiments or {}
self:CreateAllExperiments()
end

Expand Down Expand Up @@ -98,6 +96,3 @@ end
---@field Description string The description of the experiment.
---@field Percent integer The percentage of players that should be in the experiment.
---@field Enabled boolean Whether or not the experiment is enabled.

---@class Experiments
---@field experiments table<string, Experiment>
20 changes: 12 additions & 8 deletions widgets/ItemButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ local SplitContainerItem = C_Container and _G.C_Container.SplitContainerItem or
local ITEM_QUALITY_COMMON
local ITEM_QUALITY_POOR
local REAGENTBAG_CONTAINER = ( Enum.BagIndex and Enum.BagIndex.REAGENTBAG_CONTAINER ) or 5
local experiments = addon:GetModule('Experiments')

---@cast addon +AdiBags

if addon.isRetail then
ITEM_QUALITY_COMMON = _G.Enum.ItemQuality.Common
Expand Down Expand Up @@ -298,16 +301,17 @@ end
--------------------------------------------------------------------------------

function buttonProto:CanUpdate()
--[[
if self.dirty then
return true
end
return false
--]]
if not self:IsVisible() then
if experiments:Enabled("Bag Lag Fix") then
if self.dirty then
return true
end
return false
else
if not self:IsVisible() then
return false
end
return true
end
return true
end

function buttonProto:FullUpdate()
Expand Down