Add UI Scale dropdown to the settings menu.

This commit is contained in:
Paul Chote
2020-01-30 22:31:00 +00:00
committed by teinarss
parent 6388a6bff4
commit 9a0916afbb
8 changed files with 150 additions and 3 deletions

View File

@@ -112,6 +112,15 @@ namespace OpenRA.Mods.Common.LoadScreens
public virtual bool BeforeLoad()
{
// Reset the UI scaling if the user has configured a UI scale that pushes us below the minimum allowed effective resolution
var minResolution = ModData.Manifest.Get<WorldViewportSizes>().MinEffectiveResolution;
var resolution = Game.Renderer.Resolution;
if ((resolution.Width < minResolution.Width || resolution.Height < minResolution.Height) && Game.Settings.Graphics.UIScale > 1.0f)
{
Game.Settings.Graphics.UIScale = 1.0f;
Game.Renderer.SetUIScale(1.0f);
}
// If a ModContent section is defined then we need to make sure that the
// required content is installed or switch to the defined content installer.
if (!ModData.Manifest.Contains<ModContent>())