1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:35:35 +08:00

Disable relative mode for TournamentGame

This commit is contained in:
Shivam 2021-03-23 23:22:17 +01:00
parent bb6e50eb27
commit d17c431faf

View File

@ -2,18 +2,21 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Drawing; using System.Drawing;
using osu.Framework.Extensions.Color4Extensions; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Colour; using osu.Framework.Input.Handlers.Mouse;
using osu.Game.Graphics.Cursor; using osu.Framework.Platform;
using osu.Game.Tournament.Models;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Tournament.Models;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
@ -36,7 +39,7 @@ namespace osu.Game.Tournament
private LoadingSpinner loadingSpinner; private LoadingSpinner loadingSpinner;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(FrameworkConfigManager frameworkConfig) private void load(FrameworkConfigManager frameworkConfig, GameHost host)
{ {
windowSize = frameworkConfig.GetBindable<Size>(FrameworkSetting.WindowedSize); windowSize = frameworkConfig.GetBindable<Size>(FrameworkSetting.WindowedSize);
windowMode = frameworkConfig.GetBindable<WindowMode>(FrameworkSetting.WindowMode); windowMode = frameworkConfig.GetBindable<WindowMode>(FrameworkSetting.WindowMode);
@ -48,6 +51,9 @@ namespace osu.Game.Tournament
Margin = new MarginPadding(40), Margin = new MarginPadding(40),
}); });
var m = (MouseHandler)host.AvailableInputHandlers.Single(t => t is MouseHandler);
m.UseRelativeMode.Value = false;
loadingSpinner.Show(); loadingSpinner.Show();
BracketLoadTask.ContinueWith(_ => LoadComponentsAsync(new[] BracketLoadTask.ContinueWith(_ => LoadComponentsAsync(new[]