Add inline comment and improve linq robustness

This commit is contained in:
Dean Herbert 2021-03-24 14:09:15 +09:00
parent d17c431faf
commit 5ad8dc316f
1 changed files with 6 additions and 2 deletions

View File

@ -51,8 +51,12 @@ private void load(FrameworkConfigManager frameworkConfig, GameHost host)
Margin = new MarginPadding(40),
});
var m = (MouseHandler)host.AvailableInputHandlers.Single(t => t is MouseHandler);
m.UseRelativeMode.Value = false;
// in order to have the OS mouse cursor visible, relative mode needs to be disabled.
// can potentially be removed when https://github.com/ppy/osu-framework/issues/4309 is resolved.
var mouseHandler = host.AvailableInputHandlers.OfType<MouseHandler>().FirstOrDefault();
if (mouseHandler != null)
mouseHandler.UseRelativeMode.Value = false;
loadingSpinner.Show();