Fix replay button shake container

- Add license headers
- Slightly reduce bottom margin of button in score screen
This commit is contained in:
naoey
2019-06-29 12:26:37 +05:30
parent f9316bc038
commit 424711d24b
3 changed files with 73 additions and 48 deletions

View File

@ -1,5 +1,9 @@
using NUnit.Framework;
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Online;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Rulesets.Osu;
using osu.Game.Scoring;
@ -19,11 +23,19 @@ namespace osu.Game.Tests.Visual.Gameplay
typeof(ReplayDownloadButton)
};
private ReplayDownloadButton downloadButton;
private TestReplayDownloadButton downloadButton;
public TestSceneReplayDownloadButton()
{
Add(new ReplayDownloadButton(getScoreInfo())
createButton();
AddStep(@"downloading state", () => downloadButton.SetDownloadState(DownloadState.Downloading));
AddStep(@"locally available state", () => downloadButton.SetDownloadState(DownloadState.LocallyAvailable));
AddStep(@"not downloaded state", () => downloadButton.SetDownloadState(DownloadState.NotDownloaded));
}
private void createButton()
{
AddStep(@"create button", () => Child = downloadButton = new TestReplayDownloadButton(getScoreInfo())
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@ -45,5 +57,14 @@ namespace osu.Game.Tests.Visual.Gameplay
}
};
}
private class TestReplayDownloadButton : ReplayDownloadButton
{
public void SetDownloadState(DownloadState state) => State.Value = state;
public TestReplayDownloadButton(ScoreInfo score) : base(score)
{
}
}
}
}