diff --git a/osu.Game.Tournament/TournamentGame.cs b/osu.Game.Tournament/TournamentGame.cs index beef1e197d..4d7dd97e96 100644 --- a/osu.Game.Tournament/TournamentGame.cs +++ b/osu.Game.Tournament/TournamentGame.cs @@ -35,14 +35,19 @@ namespace osu.Game.Tournament public static readonly Color4 TEXT_COLOUR = Color4Extensions.FromHex("#fff"); private Drawable heightWarning; - private Bindable windowSize; + private Bindable windowMode; + private readonly BindableSize windowSize = new BindableSize(); + private LoadingSpinner loadingSpinner; [BackgroundDependencyLoader] private void load(FrameworkConfigManager frameworkConfig, GameHost host) { - windowSize = frameworkConfig.GetBindable(FrameworkSetting.WindowedSize); + frameworkConfig.BindWith(FrameworkSetting.WindowedSize, windowSize); + + windowSize.MinValue = new Size(TournamentSceneManager.REQUIRED_WIDTH, TournamentSceneManager.STREAM_AREA_HEIGHT); + windowMode = frameworkConfig.GetBindable(FrameworkSetting.WindowMode); Add(loadingSpinner = new LoadingSpinner(true, true) diff --git a/osu.Game.Tournament/TournamentSceneManager.cs b/osu.Game.Tournament/TournamentSceneManager.cs index 945593ba32..123b0f4d44 100644 --- a/osu.Game.Tournament/TournamentSceneManager.cs +++ b/osu.Game.Tournament/TournamentSceneManager.cs @@ -38,11 +38,14 @@ namespace osu.Game.Tournament private Container screens; private TourneyVideo video; - public const float CONTROL_AREA_WIDTH = 200; + public const int CONTROL_AREA_WIDTH = 200; - public const float STREAM_AREA_WIDTH = 1366; + public const int STREAM_AREA_WIDTH = 1366; + public const int STREAM_AREA_HEIGHT = (int)(STREAM_AREA_WIDTH / ASPECT_RATIO); - public const double REQUIRED_WIDTH = CONTROL_AREA_WIDTH * 2 + STREAM_AREA_WIDTH; + public const float ASPECT_RATIO = 16 / 9f; + + public const int REQUIRED_WIDTH = CONTROL_AREA_WIDTH * 2 + STREAM_AREA_WIDTH; [Cached] private TournamentMatchChatDisplay chat = new TournamentMatchChatDisplay(); @@ -65,7 +68,7 @@ namespace osu.Game.Tournament RelativeSizeAxes = Axes.Y, X = CONTROL_AREA_WIDTH, FillMode = FillMode.Fit, - FillAspectRatio = 16 / 9f, + FillAspectRatio = ASPECT_RATIO, Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, Width = STREAM_AREA_WIDTH,