diff --git a/basicOptions.lua b/basicOptions.lua index bc7e7ad..ed380f9 100644 --- a/basicOptions.lua +++ b/basicOptions.lua @@ -274,7 +274,7 @@ local function newSlider(parent, cvar, minRange, maxRange, stepSize, getValue, s slider.maxText:SetText(maxRange) slider.text:SetText(label) - local valueBox = CreateFrame('editbox', nil, slider) + local valueBox = CreateFrame('editbox', nil, slider, BackdropTemplateMixin and "BackdropTemplate" or nil) valueBox:SetPoint('TOP', slider, 'BOTTOM', 0, 0) valueBox:SetSize(60, 14) valueBox:SetFontObject(GameFontHighlightSmall) @@ -292,7 +292,7 @@ local function newSlider(parent, cvar, minRange, maxRange, stepSize, getValue, s local factor = 1 / stepSize value = floor(value * factor + 0.5) / factor value = max(minRange, min(maxRange, value)) - slider:SetValue(value, true) + slider:SetValue(value) self:SetText(value) self:ClearFocus() end) @@ -844,8 +844,11 @@ SubText_NP:SetPoint('TOPLEFT', Title_NP, 'BOTTOMLEFT', 0, -8) SubText_NP:SetPoint('RIGHT', -32, 0) SubText_NP:SetText('These options allow you to modify Nameplate Options.') +local nameplateDistance = newSlider(AIO_NP, 'nameplateMaxDistance', 10, IsClassic() and 20 or 100) +nameplateDistance:SetPoint('TOPLEFT', SubText_NP, 'BOTTOMLEFT', 0, -20) + local nameplateAtBase = newCheckbox(AIO_NP, 'nameplateOtherAtBase') -nameplateAtBase:SetPoint("TOPLEFT", SubText_NP, "BOTTOMLEFT", 0, -20) +nameplateAtBase:SetPoint("TOPLEFT", nameplateDistance, "BOTTOMLEFT", 0, -16) nameplateAtBase:SetScript('OnClick', function(self) local checked = self:GetChecked() PlaySound(checked and SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON or SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF)