diff --git a/modules/CastBar.lua b/modules/CastBar.lua index 9f0862d..ef5de12 100644 --- a/modules/CastBar.lua +++ b/modules/CastBar.lua @@ -34,6 +34,7 @@ function CastBar.prototype:GetDefaultSettings() settings["usesDogTagStrings"] = false settings["rangeColor"] = true settings["bAllowExpand"] = false + settings["respectLagTolerance"] = true return settings end @@ -118,6 +119,24 @@ function CastBar.prototype:GetOptions() order = 43 } + opts["respectLagTolerance"] = + { + type = 'toggle', + name = L["Respect lag tolerance"], + desc = L["When checked, if a 'Custom Lag Tolerance' is set in the game's Combat options, the lag indicator will always use that tolerance value. Otherwise, it uses the computed latency."], + get = function() + return self.moduleSettings.respectLagTolerance + end, + set = function(info, value) + self.moduleSettings.respectLagTolerance = value + self:CVarUpdate() + end, + disabled = function() + return not self.moduleSettings.enabled or GetCVar("reducedLagTolerance") == "0" + end, + order = 42.1, + } + opts["barVisible"] = { type = 'toggle', name = L["Bar visible"], @@ -338,7 +357,7 @@ function CastBar.prototype:CheckVehicle() end function CastBar.prototype:CVarUpdate(...) - self.useFixedLatency = GetCVar("reducedLagTolerance") == "1" + self.useFixedLatency = self.moduleSettings.respectLagTolerance and GetCVar("reducedLagTolerance") == "1" self.fixedLatency = tonumber(GetCVar("maxSpellStartRecoveryoffset")) / 1000 end diff --git a/modules/GlobalCoolDown.lua b/modules/GlobalCoolDown.lua index 7d9b85b..08bf123 100644 --- a/modules/GlobalCoolDown.lua +++ b/modules/GlobalCoolDown.lua @@ -44,7 +44,7 @@ function GlobalCoolDown.prototype:Enable(core) end function GlobalCoolDown.prototype:CVarUpdate() - self.useFixedLatency = GetCVar("reducedLagTolerance") == "1" + self.useFixedLatency = self.moduleSettings.respectLagTolerance and GetCVar("reducedLagTolerance") == "1" self.fixedLatency = tonumber(GetCVar("maxSpellStartRecoveryoffset")) / 1000.0 end @@ -66,6 +66,7 @@ function GlobalCoolDown.prototype:GetDefaultSettings() settings["barVisible"]["bg"] = false settings["bAllowExpand"] = false settings["lagAlpha"] = 0.7 + settings["respectLagTolerance"] = true return settings end @@ -114,6 +115,24 @@ function GlobalCoolDown.prototype:GetOptions() order = 42 } + opts["respectLagTolerance"] = + { + type = 'toggle', + name = L["Respect lag tolerance"], + desc = L["When checked, if a 'Custom Lag Tolerance' is set in the game's Combat options, the lag indicator will always use that tolerance value. Otherwise, it uses the computed latency."], + get = function() + return self.moduleSettings.respectLagTolerance + end, + set = function(info, value) + self.moduleSettings.respectLagTolerance = value + self:CVarUpdate() + end, + disabled = function() + return not self.moduleSettings.enabled or GetCVar("reducedLagTolerance") == "0" + end, + order = 42.1, + } + return opts end