1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 07:43:00 +08:00

Set a fixed minimum window size for the tournament client

This commit is contained in:
Dean Herbert 2023-07-24 18:42:16 +09:00
parent f837c0a43c
commit b7f706ad2b
2 changed files with 14 additions and 6 deletions

View File

@ -35,14 +35,19 @@ namespace osu.Game.Tournament
public static readonly Color4 TEXT_COLOUR = Color4Extensions.FromHex("#fff");
private Drawable heightWarning;
private Bindable<Size> windowSize;
private Bindable<WindowMode> windowMode;
private readonly BindableSize windowSize = new BindableSize();
private LoadingSpinner loadingSpinner;
[BackgroundDependencyLoader]
private void load(FrameworkConfigManager frameworkConfig, GameHost host)
{
windowSize = frameworkConfig.GetBindable<Size>(FrameworkSetting.WindowedSize);
frameworkConfig.BindWith(FrameworkSetting.WindowedSize, windowSize);
windowSize.MinValue = new Size(TournamentSceneManager.REQUIRED_WIDTH, TournamentSceneManager.STREAM_AREA_HEIGHT);
windowMode = frameworkConfig.GetBindable<WindowMode>(FrameworkSetting.WindowMode);
Add(loadingSpinner = new LoadingSpinner(true, true)

View File

@ -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,