From 4dadd4f1c16d8275d5c502b527d601ab5b8a49c9 Mon Sep 17 00:00:00 2001 From: Tom Merrow Date: Thu, 24 Sep 2020 17:42:50 -0700 Subject: [PATCH] Display auto-adjustment of UI scale. --- Localizations/enUS.lua | 4 +++- Nest.lua | 6 +++++- Raven_Options/Options.lua | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Localizations/enUS.lua b/Localizations/enUS.lua index e61c335..0acb261 100644 --- a/Localizations/enUS.lua +++ b/Localizations/enUS.lua @@ -241,7 +241,9 @@ L["If checked, Raven will not play sound effects."] = true L["Minimap Icon"] = true L["If checked, Raven will add an icon to the minimap."] = true L["Adjust UI Scale"] = true -L["If checked, Raven will adjust the UI Scale to optimize for pixel perfect alignment."] = true +L["UIScale description"] = "If checked, Raven will adjust the UI Scale to optimize for pixel perfect alignment. " .. + "Note that this will affect the entire UI, not just Raven. " .. + "Please verify display resolution detected correctly and change system settings if necessary." L["Standard Bar Groups"] = true L["Anchor description"] = "Raven lets you display bars and icons for buffs, debuffs and cooldowns. " .. 'You can use the many options under the "Bar Groups" tab to set up a personalized user interface. ' .. diff --git a/Nest.lua b/Nest.lua index 4e49afa..8e19c2f 100644 --- a/Nest.lua +++ b/Nest.lua @@ -2572,7 +2572,11 @@ function MOD.Nest_Initialize() pixelScale = 1 -- and safe value for pixel perfect calculations end - if Raven.db.global.AdjustUIScale then SetCVar("uiScale", 768 / pixelHeight) end -- option to set UI scale for optimized pixel perfect alignment + if Raven.db.global.AdjustUIScale then -- option to adjust UI scale for optimized pixel perfect alignment + local pscale = 768 / pixelHeight + SetCVar("uiScale", pscale) + print("Raven: detected display resolution " .. tostring(pixelWidth) .. "x" .. tostring(pixelHeight) .. ", adjusted UI scale to " .. tostring(pscale)) + end -- MOD.Debug("Raven result resolution", resolution, pixelScale, pixelWidth, pixelHeight, GetCVar("uiScale"), GetScreenWidth(), GetScreenHeight()) pixelPerfect = (not Raven.db.global.TukuiSkin and Raven.db.global.PixelPerfect) or (Raven.db.global.TukuiSkin and Raven.db.global.TukuiScale) diff --git a/Raven_Options/Options.lua b/Raven_Options/Options.lua index 3f3cc1b..2ab3a04 100644 --- a/Raven_Options/Options.lua +++ b/Raven_Options/Options.lua @@ -1812,10 +1812,10 @@ MOD.OptionsTable = { if value then MOD.ldbi:Show("Raven") else MOD.ldbi:Hide("Raven") end end, }, - spacer0 = { type = "description", name = "", order = 12 }, + spacer0 = { type = "description", name = "", order = 40 }, EnableUIScale = { - type = "toggle", order = 30, name = L["Adjust UI Scale"], - desc = L["If checked, Raven will adjust the UI Scale to optimize for pixel perfect alignment."], + type = "toggle", order = 45, name = L["Adjust UI Scale"], + desc = L["UIScale description"], get = function(info) return MOD.db.global.AdjustUIScale end, set = function(info, value) MOD.db.global.AdjustUIScale = value end, },