-
Notifications
You must be signed in to change notification settings - Fork 93
feat(gui): implement user based font scaling #1457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
828eaa2
to
b632b27
Compare
Tweaked some naming but theres likely going to be the odd bit of name tweaking still. |
b632b27
to
654b37e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to merge this change before the other, so we can experiment with this.
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp
Outdated
Show resolved
Hide resolved
i will tweak and rebase this on main so it can be merged independent of other font scaling tweaks. |
654b37e
to
5b6391f
Compare
Rebased, removed the other font scaling stuff and tweaked based on feedback. This now will not scale the font if the value is set to zero, which i have set as the default. |
This is not what I meant :)
|
5b6391f
to
d1843fa
Compare
Tweaked and pushed. |
One more thought: If a user sets the scale to 1, then we would expect a linear scale. But instead it would "secretly" scale by 0.7 * 1. I wonder if we should do something about that. |
Should we override whatever Situation here ends up a bit like what the scroll Anchor PR is doing. |
Maybe start m_resolutionFontSizeAdjustment as -1 and if it less than 0 then we use Language.ini settings, otherwise user setting. Not sure. |
d1843fa
to
37ee9c5
Compare
So tweaked this now so by default, for this PR, the user based setting does not adjust the default from languages.ini |
GeneralsMD/Code/GameEngine/Source/GameClient/GlobalLanguage.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameClient/GlobalLanguage.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameClient/GlobalLanguage.cpp
Outdated
Show resolved
Hide resolved
37ee9c5
to
1105ede
Compare
Tweaked based on some of the feedback. |
1105ede
to
2c6ada7
Compare
Tweaked now so the GlobalLanguage reads from the options.ini and loads the value locally. The options menu then reads from the options ini and sets the value in GlobalLanguage |
will replicate to generals later if we think this is good to go now. |
2c6ada7
to
8845a00
Compare
Tweaked and replicated to generals |
8845a00
to
72e16f6
Compare
Tweaked and pushed. |
//------------------------------------------------------------------------------------------------- | ||
// Set User Font Scaling Percentage | ||
val = pref->getResolutionFontAdjustment() * 100.0f; // TheSuperHackers @todo replace with options input when applicable | ||
if (val >= 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is -1 default, then this is not saved to Options.ini? Is this intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tweaked it now so -100 is a considered value since it's a special case for disabling the user font scaling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it even need the check at all? The OptionPreferences function already clamps it to valid values, so we could just go ahead and use its returned value without checking it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checks there more for later when we have UI elements to set the value instead of it being taken from prefs directly as it currently is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I dont yet quite understand how the user will be setting a minus one.
72e16f6
to
0188f49
Compare
This PR adds user based font scaling adjustment to the game.
The value can be set within the options.ini by setting
ResolutionFontAdjustment = 10
etc, where the value is a percentage increase, the default being 0% of the original scale.This value acts on the normal ini based resolution scaling to give some user flexibility.
TODO: