Skip to content

Commit

Permalink
Final tweaks to UI Scale options
Browse files Browse the repository at this point in the history
  • Loading branch information
Tojaso committed Sep 27, 2020
1 parent 83f051e commit c714e2c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
13 changes: 8 additions & 5 deletions Localizations/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -489,17 +489,20 @@ L["If checked, icon border color is applied to the normal texture."] = true
L["Color Border Texture"] = true
L["If checked, icon border color is applied to the border texture."] = true
L["UI Scale Options"] = true
L["UI Scale warning"] = "The UI Scale is a setting on the System menu's Advanced tab that adjusts the size of user interface elements. " ..
"It must be set to correctly to display pixel perfect elements like thin borders around bars and icons. " ..
L["UI Scale warning"] = "UI Scale is a setting on the System menu's Advanced tab that adjusts the size of user interface elements. " ..
"It must be set correctly to display pixel perfect elements like thin borders around bars and icons. " ..
"This affects the entire UI and is commonly adjusted by addons like ElvUI. " ..
"Raven provides these options to adjust UI Scale in case it is not already set correctly."
"Raven provides options to adjust UI Scale in case it is not already set correctly."
L["Adjust UI Scale"] = true
L["UIScale description"] = "If checked, Raven will adjust the UI Scale to optimize for pixel perfect alignment (requires /reload)."
L["UIScale description"] = "If checked then, during initialization, Raven will adjust the UI Scale to optimize for pixel perfect alignment (requires /reload)."
L["Report UI Scale"] = true
L["UIScale message"] = "If checked, Raven will report display resolution and UI Scale in the chat window during initialization. " ..
"Please verify that display resolution was detected correctly and change system settings if necessary " ..
"(e.g., sometimes switching between windowed and full screen modes and adjusting display resolution can resolve issues)."
L["Display Scale"] = true
L["Override"] = true
L["UIScale override"] = "If checked then, during initialization, Raven will set the UI Scale to a specified value between 0.1 and 1 (requires /reload)."
L["UI Scale"] = true
L["Enter value between 0.1 and 1 to set during initialization."] = true
L["Sound Channel"] = true
L["Master"] = MASTER
L["If checked, sound is played in Master channel."] = true
Expand Down
2 changes: 2 additions & 0 deletions Nest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2575,6 +2575,8 @@ function MOD.Nest_Initialize()
if Raven.db.global.AdjustUIScale then -- option to adjust UI scale for optimized pixel perfect alignment
local oscale = GetCVar("uiScale")
local pscale = 768 / pixelHeight
local x = MOD.db.global.SetUIScale
if MOD.db.global.OverrideUIScale and x and (x >= 0.1) and (x <= 1) then pscale = x end
SetCVar("uiScale", pscale)
if not Raven.db.global.SilentUIScale then
print("Raven: detected display resolution " .. tostring(pixelWidth) .. "x" .. tostring(pixelHeight) ..
Expand Down
2 changes: 2 additions & 0 deletions Profile.lua
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,8 @@ MOD.DefaultProfile = {
PixelPerfect = false, -- enable pixel perfect size and position
AdustUIScale = false, -- enable adjustment of the UI scale during initialization
SilentUIScale = false, -- enable reporting the UI scale during initialization
OverrideUIScale = false, -- enable setting the UI scale during initialization to specified value
SetUIScale = 0, -- value to set the UI scale during initialization (0 is adjusted to current value)
PixelIconBorder = false, -- enable a single pixel color border for icons
RectIcons = false, -- enable rectangular icons
ZoomIcons = false, -- enable zoomed rectangular icons
Expand Down
16 changes: 15 additions & 1 deletion Raven_Options/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3292,12 +3292,26 @@ MOD.OptionsTable = {
set = function(info, value) MOD.db.global.AdjustUIScale = value end,
},
ReportUIScale = {
type = "toggle", order = 10, name = L["Report UI Scale"],
type = "toggle", order = 20, name = L["Report UI Scale"],
disabled = function(info) return not MOD.db.global.AdjustUIScale end,
desc = L["UIScale message"],
get = function(info) return not MOD.db.global.SilentUIScale end,
set = function(info, value) MOD.db.global.SilentUIScale = not value end,
},
OverrideUIScale = {
type = "toggle", order = 30, name = L["Override"],
disabled = function(info) return not MOD.db.global.AdjustUIScale end,
desc = L["UIScale override"],
get = function(info) return MOD.db.global.OverrideUIScale end,
set = function(info, value) MOD.db.global.OverrideUIScale = value end,
},
EnterUIScale = {
type = "input", order = 40, name = L["UI Scale"],
disabled = function(info) return not MOD.db.global.AdjustUIScale or not MOD.db.global.OverrideUIScale end,
desc = L["Enter value between 0.1 and 1 to set during initialization."],
get = function(info) local x = MOD.db.global.SetUIScale; if not x or (x == 0) then x = GetCVar("uiScale") end; if x then return tostring(x) end; return "" end,
set = function(info, value) local x = tonumber(value); if not x or (x < 0.1) or (x > 1) then x = 0 end; MOD.db.global.SetUIScale = x end,
},
},
},
SoundGroup = {
Expand Down

0 comments on commit c714e2c

Please sign in to comment.