Merge branch 'master' into dependency-updates

This commit is contained in:
Dan Balasescu 2017-04-12 19:56:18 +09:00 committed by GitHub
commit ce269eaebb
3 changed files with 27 additions and 10 deletions

View File

@ -27,6 +27,7 @@ namespace osu.Desktop.VisualTests.Tests
private readonly Random rng = new Random(1337);
private TaikoPlayfield playfield;
private Container playfieldContainer;
public override void Reset()
{
@ -48,14 +49,17 @@ namespace osu.Desktop.VisualTests.Tests
AddStep("Height test 3", () => changePlayfieldSize(3));
AddStep("Height test 4", () => changePlayfieldSize(4));
AddStep("Height test 5", () => changePlayfieldSize(5));
AddStep("Reset height", () => changePlayfieldSize(6));
var rateAdjustClock = new StopwatchClock(true) { Rate = 1 };
Add(new Container
Add(playfieldContainer = new Container
{
Clock = new FramedClock(rateAdjustClock),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X,
Y = 200,
Height = TaikoPlayfield.DEFAULT_PLAYFIELD_HEIGHT,
Clock = new FramedClock(rateAdjustClock),
Children = new[]
{
playfield = new TaikoPlayfield()
@ -65,6 +69,7 @@ namespace osu.Desktop.VisualTests.Tests
private void changePlayfieldSize(int step)
{
// Add new hits
switch (step)
{
case 1:
@ -81,11 +86,20 @@ namespace osu.Desktop.VisualTests.Tests
break;
case 5:
addSwell(1000);
playfield.Delay(scroll_time - 100);
playfieldContainer.Delay(scroll_time - 100);
break;
}
playfield.ResizeTo(new Vector2(1, rng.Next(25, 400)), 500);
// Tween playfield height
switch (step)
{
default:
playfieldContainer.ResizeTo(new Vector2(1, rng.Next(25, 400)), 500);
break;
case 6:
playfieldContainer.ResizeTo(new Vector2(1, TaikoPlayfield.DEFAULT_PLAYFIELD_HEIGHT), 500);
break;
}
}
private void addHitJudgement()

View File

@ -33,6 +33,11 @@ namespace osu.Game.Modes.UI
/// </summary>
public event Action OnAllJudged;
/// <summary>
/// Whether to apply adjustments to the child <see cref="Playfield{TObject,TJudgement}"/> based on our own size.
/// </summary>
public bool AspectAdjust = true;
/// <summary>
/// The input manager for this HitRenderer.
/// </summary>
@ -168,11 +173,6 @@ namespace osu.Game.Modes.UI
{
public event Action<TJudgement> OnJudgement;
/// <summary>
/// Whether to apply adjustments to the child <see cref="Playfield{TObject,TJudgement}"/> based on our own size.
/// </summary>
public bool AspectAdjust = true;
public sealed override bool ProvidingUserCursor => !HasReplayLoaded && Playfield.ProvidingUserCursor;
protected override Container<Drawable> Content => content;

View File

@ -39,6 +39,9 @@ namespace osu.Game.Modes.UI
{
AlwaysReceiveInput = true;
// Default height since we force relative size axes
Size = Vector2.One;
AddInternal(ScaledContent = new ScaledContainer
{
CustomWidth = customWidth,