Skip to content

Commit

Permalink
Display auto-adjustment of UI scale.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tojaso committed Sep 25, 2020
1 parent 8f6b3a9 commit 4dadd4f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Localizations/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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. ' ..
Expand Down
6 changes: 5 additions & 1 deletion Nest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions Raven_Options/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit 4dadd4f

Please sign in to comment.