Since I do not believe you can set seperate UI scales per character I’m trying to find a command to do it via script/macro. I have googled and searched and the only results I can find direct the questioner to how to change UI scale via slider (which affects all characters/the client as a whole). Anyone able to direct me or simply know if this is possible?
If the value you are scaling the UI to is at least 0.64, you can use the following command to set the UI scale cVar. This will persist until you use the command again with a different value. (Where X is your scaling value, and is 0.64 or greater.)
/run SetCVar("uiScale", X)
For smaller values, the cVar doesn’t work. You can use this command instead:
/run UIParent:SetScale(X)
(Where X is the scale number you want.) This command does not persist between sessions, so it will revert to whatever your default is any time you log in or reload your UI. If you don’t mind hitting your macro each time you log in/reload, it will get the job done. As a note, this works fine for values above 0.64, it’s just most people prefer using the cVar at those scales because it persists. In your case, the less persistent option may be what you want.
If you want the game to use different UI scales for different characters, create the two files named in bold in a folder named UIScalePerCharacter under \Interface\AddOns
UIScalePerCharacter.toc
## Interface: 20504
## Title: UIScalePerCharacter
## Notes: Remembers UIScale per character after each character's first login
## SavedVariablesPerCharacter: UIScalePerCharacter
UIScalePerCharacter.lua
UIScalePerCharacter.lua
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_LOGIN")
f:SetScript("OnEvent",function(self,event)
if event=="PLAYER_LOGIN" then
SetCVar("UseUIScale",1) -- while addon enabled, Use UI Scale enabled on login
if UIScalePerCharacter then
SetCVar("UIScale",UIScalePerCharacter)
else
UIScalePerCharacter = GetCVar("UIScale")
end
self:RegisterEvent("UI_SCALE_CHANGED")
elseif event=="UI_SCALE_CHANGED" then
C_Timer.After(0,function() UIScalePerCharacter = GetCVar("UIScale") end)
end
end)
Notes:
- The ## Interface number is for BCC. For retail it’s currently 90200 and for classic it’s 11402.
- On the first login of a character after enabling this addon, it will adopt the last UIScale as its initial scale. So if you change the scale to 0.8 and log on another character that hasn’t logged in with this addon, it will be 0.8.
- After a character’s first login, that character will remember its scale to whatever you last set it to.
- If you use ElvUI or something that handles UI Scale, all bets are off. I likely wouldn’t try this solution.