1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Merge branch 'master' into fix-ss-nullref

This commit is contained in:
Dean Herbert 2020-05-07 22:29:18 +09:00 committed by GitHub
commit c5bd352f63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 83 additions and 8 deletions

View File

@ -32,5 +32,11 @@ namespace osu.Game.Tournament.Models
MinValue = 640,
MaxValue = 1366,
};
public Bindable<int> PlayersPerTeam = new BindableInt(4)
{
MinValue = 3,
MaxValue = 4,
};
}
}

View File

@ -36,7 +36,7 @@ namespace osu.Game.Tournament.Screens.Gameplay
[Resolved]
private TournamentMatchChatDisplay chat { get; set; }
private Box chroma;
private Drawable chroma;
[BackgroundDependencyLoader]
private void load(LadderInfo ladder, MatchIPCInfo ipc, Storage storage)
@ -61,16 +61,30 @@ namespace osu.Game.Tournament.Screens.Gameplay
Y = 110,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Children = new Drawable[]
Children = new[]
{
chroma = new Box
chroma = new Container
{
// chroma key area for stable gameplay
Name = "chroma",
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Height = 512,
Colour = new Color4(0, 255, 0, 255),
Children = new Drawable[]
{
new ChromaArea
{
Name = "Left chroma",
RelativeSizeAxes = Axes.Both,
Width = 0.5f,
},
new ChromaArea
{
Name = "Right chroma",
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Width = 0.5f,
}
}
},
}
},
@ -98,9 +112,15 @@ namespace osu.Game.Tournament.Screens.Gameplay
},
new SettingsSlider<int>
{
LabelText = "Chroma Width",
LabelText = "Chroma width",
Bindable = LadderInfo.ChromaKeyWidth,
KeyboardStep = 1,
},
new SettingsSlider<int>
{
LabelText = "Players per team",
Bindable = LadderInfo.PlayersPerTeam,
KeyboardStep = 1,
}
}
}
@ -201,5 +221,54 @@ namespace osu.Game.Tournament.Screens.Gameplay
lastState = state.NewValue;
}
}
private class ChromaArea : CompositeDrawable
{
[Resolved]
private LadderInfo ladder { get; set; }
[BackgroundDependencyLoader]
private void load()
{
// chroma key area for stable gameplay
Colour = new Color4(0, 255, 0, 255);
ladder.PlayersPerTeam.BindValueChanged(performLayout, true);
}
private void performLayout(ValueChangedEvent<int> playerCount)
{
switch (playerCount.NewValue)
{
case 3:
InternalChildren = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Width = 0.5f,
Height = 0.5f,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
new Box
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Height = 0.5f,
},
};
break;
default:
InternalChild = new Box
{
RelativeSizeAxes = Axes.Both,
};
break;
}
}
}
}
}

View File

@ -139,7 +139,7 @@ namespace osu.Game.Graphics
return false;
dateText.Text = $"{date:d MMMM yyyy} ";
timeText.Text = $"{date:hh:mm:ss \"UTC\"z}";
timeText.Text = $"{date:HH:mm:ss \"UTC\"z}";
return true;
}