mirror of
https://github.com/ppy/osu
synced 2025-03-06 03:19:47 +00:00
Merge pull request #8403 from peppy/chroma-key-width
Add ability to adjust (and save) chroma-key area width
This commit is contained in:
commit
b5488bdecf
@ -24,7 +24,13 @@ namespace osu.Game.Tournament.Models
|
|||||||
// only used for serialisation
|
// only used for serialisation
|
||||||
public List<TournamentProgression> Progressions = new List<TournamentProgression>();
|
public List<TournamentProgression> Progressions = new List<TournamentProgression>();
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore] // updated manually in TournamentGameBase
|
||||||
public Bindable<TournamentMatch> CurrentMatch = new Bindable<TournamentMatch>();
|
public Bindable<TournamentMatch> CurrentMatch = new Bindable<TournamentMatch>();
|
||||||
|
|
||||||
|
public Bindable<int> ChromaKeyWidth = new BindableInt(1024)
|
||||||
|
{
|
||||||
|
MinValue = 640,
|
||||||
|
MaxValue = 1366,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Overlays.Settings;
|
||||||
using osu.Game.Tournament.Components;
|
using osu.Game.Tournament.Components;
|
||||||
using osu.Game.Tournament.IPC;
|
using osu.Game.Tournament.IPC;
|
||||||
using osu.Game.Tournament.Models;
|
using osu.Game.Tournament.Models;
|
||||||
@ -35,6 +36,8 @@ namespace osu.Game.Tournament.Screens.Gameplay
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private TournamentMatchChatDisplay chat { get; set; }
|
private TournamentMatchChatDisplay chat { get; set; }
|
||||||
|
|
||||||
|
private Box chroma;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(LadderInfo ladder, MatchIPCInfo ipc, Storage storage)
|
private void load(LadderInfo ladder, MatchIPCInfo ipc, Storage storage)
|
||||||
{
|
{
|
||||||
@ -60,11 +63,10 @@ namespace osu.Game.Tournament.Screens.Gameplay
|
|||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
chroma = new Box
|
||||||
{
|
{
|
||||||
// chroma key area for stable gameplay
|
// chroma key area for stable gameplay
|
||||||
Name = "chroma",
|
Name = "chroma",
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Height = 512,
|
Height = 512,
|
||||||
@ -93,6 +95,12 @@ namespace osu.Game.Tournament.Screens.Gameplay
|
|||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Text = "Toggle chat",
|
Text = "Toggle chat",
|
||||||
Action = () => { State.Value = State.Value == TourneyState.Idle ? TourneyState.Playing : TourneyState.Idle; }
|
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.BindTo(ipc.State);
|
||||||
State.BindValueChanged(stateChanged, true);
|
State.BindValueChanged(stateChanged, true);
|
||||||
|
|
||||||
|
ladder.ChromaKeyWidth.BindValueChanged(width => chroma.Width = width.NewValue, true);
|
||||||
|
|
||||||
currentMatch.BindValueChanged(m =>
|
currentMatch.BindValueChanged(m =>
|
||||||
{
|
{
|
||||||
warmup.Value = m.NewValue.Team1Score.Value + m.NewValue.Team2Score.Value == 0;
|
warmup.Value = m.NewValue.Team1Score.Value + m.NewValue.Team2Score.Value == 0;
|
||||||
|
@ -116,7 +116,7 @@ namespace osu.Game.Tournament.Screens
|
|||||||
{
|
{
|
||||||
windowSize.Value = new Size((int)(1920 / TournamentSceneManager.STREAM_AREA_WIDTH * TournamentSceneManager.REQUIRED_WIDTH), 1080);
|
windowSize.Value = new Size((int)(1920 / TournamentSceneManager.STREAM_AREA_WIDTH * TournamentSceneManager.REQUIRED_WIDTH), 1080);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user