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

@@ -57,6 +57,7 @@ namespace OpenRA
IHardwareCursor CreateHardwareCursor(string name, Size size, byte[] data, int2 hotspot, bool pixelDouble);
void SetHardwareCursor(IHardwareCursor cursor);
void SetRelativeMouseMode(bool mode);
void SetScaleModifier(float scale);
}
public interface IGraphicsContext : IDisposable

View File

@@ -91,6 +91,11 @@ namespace OpenRA
return new Size(size.X, size.Y);
}
public void SetUIScale(float scale)
{
Window.SetScaleModifier(scale);
}
public void InitializeFonts(ModData modData)
{
if (Fonts != null)

View File

@@ -10,6 +10,7 @@
#endregion
using System.Collections.Generic;
using OpenRA.Primitives;
namespace OpenRA
{
@@ -23,6 +24,8 @@ namespace OpenRA
public readonly int MaxZoomWindowHeight = 240;
public readonly bool AllowNativeZoom = true;
public readonly Size MinEffectiveResolution = new Size(1024, 720);
public int2 GetSizeRange(WorldViewport distance)
{
return distance == WorldViewport.Close ? CloseWindowHeights