Remove Game.HasInputFocus

This commit is contained in:
abcdefg30
2020-04-07 14:57:29 +02:00
committed by atlimit8
parent 5b34af0f12
commit 3ba86f329f
6 changed files with 17 additions and 6 deletions

View File

@@ -81,11 +81,11 @@ namespace OpenRA.Platforms.Default
switch (e.window.windowEvent)
{
case SDL.SDL_WindowEventID.SDL_WINDOWEVENT_FOCUS_LOST:
Game.HasInputFocus = false;
device.HasInputFocus = false;
break;
case SDL.SDL_WindowEventID.SDL_WINDOWEVENT_FOCUS_GAINED:
Game.HasInputFocus = true;
device.HasInputFocus = true;
break;
// Triggered when moving between displays with different DPI settings

View File

@@ -105,6 +105,8 @@ namespace OpenRA.Platforms.Default
}
}
public bool HasInputFocus { get; internal set; }
public event Action<float, float, float, float> OnWindowScaleChanged = (oldNative, oldEffective, newNative, newEffective) => { };
[DllImport("user32.dll")]
@@ -221,11 +223,11 @@ namespace OpenRA.Platforms.Default
switch (e.window.windowEvent)
{
case SDL.SDL_WindowEventID.SDL_WINDOWEVENT_FOCUS_LOST:
Game.HasInputFocus = false;
HasInputFocus = false;
break;
case SDL.SDL_WindowEventID.SDL_WINDOWEVENT_FOCUS_GAINED:
Game.HasInputFocus = true;
HasInputFocus = true;
break;
}
}