Skip to content

Commit

Permalink
config: Fix some of the sliders erroring.
Browse files Browse the repository at this point in the history
  • Loading branch information
funkydude committed Jul 27, 2018
1 parent 46770f3 commit e8b3403
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions BasicConfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ BCM.modules[#BCM.modules+1] = function()
fontSizeSlider:SetValueStep(1)
fontSizeSlider:SetWidth(110)
fontSizeSlider:SetScript("OnValueChanged", function(_, v)
v = floor(v)
BCM_FontSizeText:SetFormattedText(FONT_SIZE.." "..FONT_SIZE_TEMPLATE, v)
bcmDB.fontsize = v
for i=1, BCM.chatFrames do
Expand Down Expand Up @@ -582,6 +583,7 @@ BCM.modules[#BCM.modules+1] = function()
chatFrameSlider:SetValue(1)
chatFrameSlider:SetValueStep(1)
chatFrameSlider:SetScript("OnValueChanged", function(_, v)
v = floor(v)
local cF = ("ChatFrame%d"):format(v)
BCM_History_GetText:SetFormattedText("%s: %s", cF, _G[cF].name)
BCM_History_Set:SetValue(bcmDB.lines and bcmDB.lines[cF] or _G[cF]:GetMaxLines())
Expand All @@ -598,6 +600,7 @@ BCM.modules[#BCM.modules+1] = function()
linesSetSlider:SetValueStep(10)
linesSetSlider:SetWidth(200)
linesSetSlider:SetScript("OnValueChanged", function(_, v)
v = floor(v)
BCM_History_SetText:SetFormattedText("%s: %d", HISTORY, v)
local cF = ("ChatFrame%d"):format(BCM_History_Get:GetValue())
if v == _G[cF]:GetMaxLines() then return end -- No value changed, don't save anything
Expand All @@ -622,6 +625,7 @@ BCM.modules[#BCM.modules+1] = function()
chatFrameSlider:SetValue(1)
chatFrameSlider:SetValueStep(1)
chatFrameSlider:SetScript("OnValueChanged", function(_, v)
v = floor(v)
local cF = ("ChatFrame%d"):format(v)
BCM_Justify_GetText:SetFormattedText("%s: %s", cF, _G[cF].name)
BCM_Justify_Set:SetValue(bcmDB.justify and ((bcmDB.justify[cF] == "RIGHT" and 3) or (bcmDB.justify[cF] == "CENTER" and 2)) or 1)
Expand All @@ -637,6 +641,7 @@ BCM.modules[#BCM.modules+1] = function()
justifyPosition:SetValue(bcmDB.justify and ((bcmDB.justify.ChatFrame1 == "RIGHT" and 3) or (bcmDB.justify.ChatFrame1 == "CENTER" and 2)) or 1)
justifyPosition:SetValueStep(1)
justifyPosition:SetScript("OnValueChanged", function(_, v)
v = floor(v)
if not bcmDB.justify then bcmDB.justify = {} end
local cF = ("ChatFrame%d"):format(BCM_Justify_Get:GetValue())
local justify = v == 1 and "LEFT" or v == 2 and "CENTER" or v == 3 and "RIGHT"
Expand Down

0 comments on commit e8b3403

Please sign in to comment.