Move hardware cursor control to hidden DisableHardwareCursors setting.

This commit is contained in:
Paul Chote
2020-01-19 00:18:53 +00:00
committed by Matthias Mailänder
parent 370f7a44fa
commit f730b55255
5 changed files with 9 additions and 27 deletions

View File

@@ -40,8 +40,7 @@ namespace OpenRA.Graphics
public CursorManager(CursorProvider cursorProvider)
{
// Cursor settings are applied on game start
hardwareCursorsDisabled = !Game.Settings.Graphics.HardwareCursors;
hardwareCursorsDisabled = Game.Settings.Graphics.DisableHardwareCursors;
graphicSettings = Game.Settings.Graphics;
sheetBuilder = new SheetBuilder(SheetType.BGRA);

View File

@@ -154,8 +154,6 @@ namespace OpenRA
[Desc("Screen resolution in windowed mode.")]
public int2 WindowedSize = new int2(1024, 768);
public bool HardwareCursors = true;
public bool CursorDouble = false;
public WorldViewport ViewportDistance = WorldViewport.Medium;
@@ -174,6 +172,9 @@ namespace OpenRA
[Desc("Disable the OpenGL debug message callback feature.")]
public bool DisableGLDebugMessageCallback = false;
[Desc("Disable operating-system provided cursor rendering.")]
public bool DisableHardwareCursors = false;
[Desc("Use OpenGL ES if both ES and regular OpenGL are available.")]
public bool PreferGLES = false;

View File

@@ -26,7 +26,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
static readonly WindowMode OriginalGraphicsMode;
static readonly int2 OriginalGraphicsWindowedSize;
static readonly int2 OriginalGraphicsFullscreenSize;
static readonly bool OriginalGraphicsHardwareCursors;
static readonly bool OriginalServerDiscoverNatDevices;
readonly Dictionary<PanelType, Action> leavePanelActions = new Dictionary<PanelType, Action>();
@@ -53,7 +52,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
OriginalGraphicsMode = original.Graphics.Mode;
OriginalGraphicsWindowedSize = original.Graphics.WindowedSize;
OriginalGraphicsFullscreenSize = original.Graphics.FullscreenSize;
OriginalGraphicsHardwareCursors = original.Graphics.HardwareCursors;
OriginalServerDiscoverNatDevices = original.Server.DiscoverNatDevices;
}
@@ -84,8 +82,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
current.Graphics.Mode != OriginalGraphicsMode ||
current.Graphics.WindowedSize != OriginalGraphicsWindowedSize ||
current.Graphics.FullscreenSize != OriginalGraphicsFullscreenSize ||
current.Server.DiscoverNatDevices != OriginalServerDiscoverNatDevices ||
current.Graphics.HardwareCursors != OriginalGraphicsHardwareCursors)
current.Server.DiscoverNatDevices != OriginalServerDiscoverNatDevices)
{
Action restart = () =>
{
@@ -211,7 +208,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var ds = Game.Settings.Graphics;
var gs = Game.Settings.Game;
BindCheckboxPref(panel, "HARDWARECURSORS_CHECKBOX", ds, "HardwareCursors");
BindCheckboxPref(panel, "CURSORDOUBLE_CHECKBOX", ds, "CursorDouble");
BindCheckboxPref(panel, "VSYNC_CHECKBOX", ds, "VSync");
BindCheckboxPref(panel, "FRAME_LIMIT_CHECKBOX", ds, "CapFramerate");

View File

@@ -124,20 +124,13 @@ Container@SETTINGS_PANEL:
Height: 25
MaxLength: 5
Type: Integer
Checkbox@HARDWARECURSORS_CHECKBOX:
X: 80
Y: 75
Width: 200
Height: 20
Font: Regular
Text: Use Hardware Cursors
Label@VIDEO_DESC:
Y: 97
Y: 67
Width: PARENT_RIGHT
Height: 25
Font: Tiny
Align: Center
Text: Mode, resolution, and cursor changes will be applied after the game is restarted
Text: Mode and resolution changes will be applied after the game is restarted
Checkbox@VSYNC_CHECKBOX:
X: 80
Y: 125

View File

@@ -138,20 +138,13 @@ Background@SETTINGS_PANEL:
Height: 25
MaxLength: 5
Type: Integer
Checkbox@HARDWARECURSORS_CHECKBOX:
X: 80
Y: 75
Width: 200
Height: 20
Font: Regular
Text: Use Hardware Cursors
Label@VIDEO_DESC:
Y: 97
Y: 67
Width: PARENT_RIGHT
Height: 25
Font: Tiny
Align: Center
Text: Mode, resolution, and cursor changes will be applied after the game is restarted
Text: Mode and resolutiom changes will be applied after the game is restarted
Checkbox@VSYNC_CHECKBOX:
X: 80
Y: 125