Closed BenjaminHamon closed 2 years ago
Related (but old) issue: #29
I've started investigating this, I'll update with news
As per your suggestion I have decided to remove the UI scale setting, and leave the scaling up to the the setting provided by Blizzard.
I want to start a discussion around setting the UI scale ratio for HydraUI, as I'm having a hard time getting my head around how it is supposed to work. Sorry if the long text is overkill.
WoW UI scaling behavior
The WoW UI is first scaled by the UIScale variable. This setting is accessible through the main menu: System > Advanced > UI Scaling. Its accurate value can be determined with the command
/run print(GetCVar("UIScale"))
, and set with/run SetCVar("UIScale", <value>)
.Wowpedia has a page dedicated to it, which notably explains how to get a pixel perfect display, by setting the scaling value to 768 / ScreenHeight.
Beyond this global setting, each UI element has a local scale value, so as to scale itself relatively to its parent. This is set with the function SetScale.
HydraUI current scaling implementation
HydraUI exposes a UI scaling setting for its own elements. This value is applied on top of the global scaling, as implemented in Tools.lua#L323:
Assuming a screen height of 1440, the suggested scaling is 0.5333 (768 / 1440) and can be set in the game settings. With the HydraUI scaling on top of that, this leads the following results:
suggestedScale / suggestedScale
. Thus, the HydraUI elements are rendered with a scale of 1, and look normal relatively to the rest of the UI.Suggested implementation and changes
In my opinion, the logic should be that the HydraUI scale is unchanged when setting the scaling value to 1, larger for a larger value (1.1 means the UI is scaled to 110%), smaller for a smaller value (0.9 means the UI is scaled to 90%). Thus, I suggest to remove the local SetScale implementation and rely directly on the WoW API SetScale. Furthermore, the UI scaling suggested value should always be 1.
As a helper, and since HydraUI is a complete UI replacement, the HydraUI menu could allow the user to set the global UI scaling, determining the suggested scale as it currently does.