1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 05:25:36 +08:00

Add ability to adjust (and save) chroma-key area width

This commit is contained in:
Dean Herbert 2020-03-23 11:47:24 +09:00
parent 4fbf94f963
commit 27ae2d29aa
3 changed files with 20 additions and 4 deletions

View File

@ -24,7 +24,13 @@ namespace osu.Game.Tournament.Models
// only used for serialisation
public List<TournamentProgression> Progressions = new List<TournamentProgression>();
[JsonIgnore]
[JsonIgnore] // updated manually in TournamentGameBase
public Bindable<TournamentMatch> CurrentMatch = new Bindable<TournamentMatch>();
public Bindable<int> ChromaKeyWidth = new BindableInt(1024)
{
MinValue = 640,
MaxValue = 1366,
};
}
}

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Platform;
using osu.Framework.Threading;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.Settings;
using osu.Game.Tournament.Components;
using osu.Game.Tournament.IPC;
using osu.Game.Tournament.Models;
@ -35,6 +36,8 @@ namespace osu.Game.Tournament.Screens.Gameplay
[Resolved]
private TournamentMatchChatDisplay chat { get; set; }
private Box chroma;
[BackgroundDependencyLoader]
private void load(LadderInfo ladder, MatchIPCInfo ipc, Storage storage)
{
@ -60,11 +63,10 @@ namespace osu.Game.Tournament.Screens.Gameplay
Origin = Anchor.TopCentre,
Children = new Drawable[]
{
new Box
chroma = new Box
{
// chroma key area for stable gameplay
Name = "chroma",
RelativeSizeAxes = Axes.X,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Height = 512,
@ -93,6 +95,12 @@ namespace osu.Game.Tournament.Screens.Gameplay
RelativeSizeAxes = Axes.X,
Text = "Toggle chat",
Action = () => { State.Value = State.Value == TourneyState.Idle ? TourneyState.Playing : TourneyState.Idle; }
},
new SettingsSlider<int>
{
LabelText = "Chroma Width",
Bindable = LadderInfo.ChromaKeyWidth,
KeyboardStep = 1,
}
}
}
@ -101,6 +109,8 @@ namespace osu.Game.Tournament.Screens.Gameplay
State.BindTo(ipc.State);
State.BindValueChanged(stateChanged, true);
ladder.ChromaKeyWidth.BindValueChanged(width => chroma.Width = width.NewValue, true);
currentMatch.BindValueChanged(m =>
{
warmup.Value = m.NewValue.Team1Score.Value + m.NewValue.Team2Score.Value == 0;

View File

@ -116,7 +116,7 @@ namespace osu.Game.Tournament.Screens
{
windowSize.Value = new Size((int)(1920 / TournamentSceneManager.STREAM_AREA_WIDTH * TournamentSceneManager.REQUIRED_WIDTH), 1080);
}
}
},
};
}