Skip to content

Commit

Permalink
Fixed #1868 - Lua errors and broken sliders in WoW 9.0.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Mar 10, 2021
1 parent be71393 commit 4acb65e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Bug Fixes
* Fixed an error with the `[Name]` DogTag breaking when LibDogTag-Unit gets upgraded after TMW loads.
* Fixed incorrect labels on Text Display editboxes after changing an icon's text layout.
* Fixed #1868 - Lua errors and broken sliders in WoW 9.0.5.

## v9.0.4
* New Condition: Torghast Anima Power Count
Expand Down
4 changes: 2 additions & 2 deletions Components/Core/Conditions/Categories/Resources.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ConditionCategory:RegisterCondition(1.1, "HEALTH_ABS", {
text = HEALTH .. " - " .. L["CONDITIONPANEL_ABSOLUTE"],
formatter = TMW.C.Formatter.COMMANUMBER,
min = 0,
range = 1000000,
range = 100000,
icon = "Interface\\Icons\\inv_alchemy_elixir_05",
tcoords = CNDT.COMMON.standardtcoords,
funcstr = [[UnitHealth(c.Unit) c.Operator c.Level]],
Expand All @@ -79,7 +79,7 @@ ConditionCategory:RegisterCondition(1.2, "HEALTH_MAX", {
text = HEALTH .. " - " .. L["CONDITIONPANEL_MAX"],
formatter = TMW.C.Formatter.COMMANUMBER,
min = 0,
range = 1000000,
range = 100000,
icon = "Interface\\Icons\\inv_alchemy_elixir_05",
tcoords = CNDT.COMMON.standardtcoords,
funcstr = [[UnitHealthMax(c.Unit) c.Operator c.Level]],
Expand Down
6 changes: 2 additions & 4 deletions Components/Core/Conditions/Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1021,17 +1021,15 @@ TMW:RegisterCallback("TMW_CNDT_GROUP_DRAWGROUP", function(event, CndtGroup, cond
-- Don't try and format text while changing parameters because we might get some errors trying
-- to format unexpected values
CndtGroup.Slider:SetTextFormatter(nil)

CndtGroup.Slider:SetValueStep(step)
CndtGroup.Slider:SetMinMaxValues(min, max)

if range then
CndtGroup.Slider:SetMode(CndtGroup.Slider.MODE_ADJUSTING)
CndtGroup.Slider:SetRange(range)
else
CndtGroup.Slider:SetMode(CndtGroup.Slider.MODE_STATIC)
end

CndtGroup.Slider:SetValueStep(step)
CndtGroup.Slider:SetMinMaxValues(min, max)

CndtGroup.Slider:SetWidth(522)
CndtGroup:AddRow(CndtGroup.Slider, -7)
Expand Down
6 changes: 3 additions & 3 deletions Components/IconModules/IconModule_Texts/Config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -738,11 +738,11 @@

self:SetTexts(TMW.L["UIPANEL_FONT_SHADOW"], TMW.L["UIPANEL_FONT_SHADOW_DESC"])
self:SetSetting("Shadow")
self:SetMode(self.MODE_ADJUSTING)
self:SetMinMaxValues(0, math.huge)
self:SetRange(3)
self:SetValueStep(0.1)
self:SetWheelStep(0.5)
self:SetMode(self.MODE_ADJUSTING)

self:SetTextFormatter(TMW.C.Formatter.PIXELS, TMW.C.Formatter.F_0)
</OnLoad>
Expand Down Expand Up @@ -817,10 +817,10 @@

self:SetTexts(TMW.L["UIPANEL_FONT_WIDTH"], TMW.L["UIPANEL_FONT_WIDTH_DESC"])
self:SetSetting("Width")
self:SetMode(self.MODE_ADJUSTING)
self:SetMinMaxValues(0, math.huge)
self:SetRange(100)
self:SetValueStep(1)
self:SetMode(self.MODE_ADJUSTING)

local formatter = TMW.C.Formatter:New(function(value)
if value == 0 then
Expand All @@ -846,10 +846,10 @@

self:SetTexts(TMW.L["UIPANEL_FONT_HEIGHT"], TMW.L["UIPANEL_FONT_HEIGHT_DESC"])
self:SetSetting("Height")
self:SetMode(self.MODE_ADJUSTING)
self:SetMinMaxValues(0, math.huge)
self:SetRange(100)
self:SetValueStep(1)
self:SetMode(self.MODE_ADJUSTING)

local formatter = TMW.C.Formatter:New(function(value)
if value == 0 then
Expand Down
2 changes: 1 addition & 1 deletion Components/IconViews/Bar/Config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
self:SetTexts(TMW.L["UIPANEL_BAR_PADDING"], TMW.L["UIPANEL_BAR_PADDING_DESC"])
self:SetSetting("Padding")

self:SetMode(self.MODE_ADJUSTING)
self:SetMinMaxValues(0, math.huge)
self:SetRange(10)
self:SetMode(self.MODE_ADJUSTING)
self:SetValueStep(0.1)
self:SetWheelStep(0.5)

Expand Down
1 change: 1 addition & 0 deletions Options/CHANGELOG.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ TMW.CHANGELOG = [==[
### Bug Fixes
* Fixed an error with the `[Name]` DogTag breaking when LibDogTag-Unit gets upgraded after TMW loads.
* Fixed incorrect labels on Text Display editboxes after changing an icon's text layout.
* Fixed #1868 - Lua errors and broken sliders in WoW 9.0.5.
## v9.0.4
* New Condition: Torghast Anima Power Count
Expand Down
4 changes: 2 additions & 2 deletions Options/TellMeWhen_Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2396,7 +2396,7 @@ TMW:NewClass("Config_Slider", "Slider", "Config_Frame")
self.max = max

if self.mode == self.MODE_STATIC then
self:SetMinMaxValues_base(min, max)
self:SetMinMaxValues_base(math.max(min, -10e10), math.min(max, 10e10))
elseif not self.EditBoxShowing then
self:UpdateRange()
end
Expand Down Expand Up @@ -2705,7 +2705,7 @@ TMW:NewClass("Config_Slider", "Slider", "Config_Frame")

self:SetMinMaxValues_base(newmin, newmax)
else
self:SetMinMaxValues_base(self.min, self.max)
self:SetMinMaxValues_base(math.max(self.min, -10e10), math.min(self.max, 10e10))
end
end,

Expand Down

0 comments on commit 4acb65e

Please sign in to comment.