mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-15 22:30:13 -05:00
Added option to ignore custom lag tolerance for lag indicators
This allows the user to override the fact that they've set a custom lag tolerance in the game's options and instead have the mod display the computed latency. (ticket #201)
This commit is contained in:
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user