firstrun: add ui scale slider to profiles

This commit is contained in:
shagu
2025-07-20 23:25:22 +02:00
parent 1d619bd6fd
commit 72899ee191
+36 -4
View File
@@ -134,7 +134,7 @@ pfUI:RegisterModule("firstrun", "vanilla:tbc", function ()
f.Modern = CreateFrame("Button", nil, f, "UIPanelButtonTemplate")
f.Modern:SetWidth(120)
f.Modern:SetHeight(20)
f.Modern:SetPoint("BOTTOM", -65, 80)
f.Modern:SetPoint("BOTTOM", -65, 100)
f.Modern:SetTextColor(1,1,1)
f.Modern:SetText("Modern")
f.Modern:SetScript("OnClick", function()
@@ -147,7 +147,7 @@ pfUI:RegisterModule("firstrun", "vanilla:tbc", function ()
f.Nostalgia = CreateFrame("Button", nil, f, "UIPanelButtonTemplate")
f.Nostalgia:SetWidth(120)
f.Nostalgia:SetHeight(20)
f.Nostalgia:SetPoint("BOTTOM", 65, 80)
f.Nostalgia:SetPoint("BOTTOM", 65, 100)
f.Nostalgia:SetTextColor(1,1,1)
f.Nostalgia:SetText("Nostalgia")
f.Nostalgia:SetScript("OnClick", function()
@@ -160,7 +160,7 @@ pfUI:RegisterModule("firstrun", "vanilla:tbc", function ()
f.Legacy = CreateFrame("Button", nil, f, "UIPanelButtonTemplate")
f.Legacy:SetWidth(120)
f.Legacy:SetHeight(20)
f.Legacy:SetPoint("BOTTOM", 65, 55)
f.Legacy:SetPoint("BOTTOM", 65, 75)
f.Legacy:SetTextColor(1,1,1)
f.Legacy:SetText("Legacy")
f.Legacy:SetScript("OnClick", function()
@@ -173,7 +173,7 @@ pfUI:RegisterModule("firstrun", "vanilla:tbc", function ()
f.Slim = CreateFrame("Button", nil, f, "UIPanelButtonTemplate")
f.Slim:SetWidth(120)
f.Slim:SetHeight(20)
f.Slim:SetPoint("BOTTOM", -65, 55)
f.Slim:SetPoint("BOTTOM", -65, 75)
f.Slim:SetTextColor(1,1,1)
f.Slim:SetText("Slim")
f.Slim:SetScript("OnClick", function()
@@ -183,6 +183,38 @@ pfUI:RegisterModule("firstrun", "vanilla:tbc", function ()
end)
SkinButton(f.Slim)
f.Slider = CreateFrame("Slider", "pfFirstRunWizardScaleSlider", f, "OptionsSliderTemplate")
f.Slider.text = f.Slider:CreateFontString("Status", "LOW", "GameFontWhite")
f.Slider.text:SetPoint("TOP", f.Slider, "BOTTOM", 0, 2)
f.Slider.text:SetText(T["Scale"])
f.Slider:SetWidth(240)
f.Slider:SetHeight(20)
f.Slider:SetPoint("BOTTOM", 0, 50)
f.Slider:SetOrientation('HORIZONTAL')
f.Slider:SetMinMaxValues(0.5, 2.0)
f.Slider:SetValue(UIParent:GetScale())
f.Slider:SetScript("OnMouseUp", function()
local scale = round(this:GetValue(),2)
SetCVar("uiScale", scale)
SetCVar("useUiScale", 1)
UIParent:SetScale(scale)
this:SetValue(scale)
end)
f.Slider:SetScript("OnValueChanged", function()
local scale = round(this:GetValue(),2)
this:SetValue(scale)
end)
f.Slider:SetScript("OnUpdate", function()
local scale = round(this:GetValue(),2)
this.text:SetText(T["Scale"] .. ": " .. scale * 100 .. "%")
end)
SkinSlider(f.Slider)
return f
end)