1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-16 01:33:22 +08:00

Merge branch 'master' into fix-mod-overlay-dim

This commit is contained in:
Dan Balasescu 2019-03-02 16:04:44 +09:00 committed by GitHub
commit f13901cc19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 16 deletions

View File

@ -23,9 +23,6 @@ namespace osu.Game.Tests.Visual
[System.ComponentModel.Description("in BeatmapOverlay")] [System.ComponentModel.Description("in BeatmapOverlay")]
public class TestCaseBeatmapScoresContainer : OsuTestCase public class TestCaseBeatmapScoresContainer : OsuTestCase
{ {
private readonly IEnumerable<APIScoreInfo> scores;
private readonly IEnumerable<APIScoreInfo> anotherScores;
private readonly APIScoreInfo topScoreInfo;
private readonly Box background; private readonly Box background;
public TestCaseBeatmapScoresContainer() public TestCaseBeatmapScoresContainer()
@ -47,15 +44,7 @@ namespace osu.Game.Tests.Visual
} }
}; };
AddStep("scores pack 1", () => scoresContainer.Scores = scores); IEnumerable<APIScoreInfo> scores = new[]
AddStep("scores pack 2", () => scoresContainer.Scores = anotherScores);
AddStep("only top score", () => scoresContainer.Scores = new[] { topScoreInfo });
AddStep("remove scores", () => scoresContainer.Scores = null);
AddStep("resize to big", () => container.ResizeWidthTo(1, 300));
AddStep("resize to normal", () => container.ResizeWidthTo(0.8f, 300));
AddStep("online scores", () => scoresContainer.Beatmap = new BeatmapInfo { OnlineBeatmapID = 75, Ruleset = new OsuRuleset().RulesetInfo });
scores = new[]
{ {
new APIScoreInfo new APIScoreInfo
{ {
@ -168,7 +157,7 @@ namespace osu.Game.Tests.Visual
s.Statistics.Add(HitResult.Meh, RNG.Next(2000)); s.Statistics.Add(HitResult.Meh, RNG.Next(2000));
} }
anotherScores = new[] IEnumerable<APIScoreInfo> anotherScores = new[]
{ {
new APIScoreInfo new APIScoreInfo
{ {
@ -280,7 +269,7 @@ namespace osu.Game.Tests.Visual
s.Statistics.Add(HitResult.Meh, RNG.Next(2000)); s.Statistics.Add(HitResult.Meh, RNG.Next(2000));
} }
topScoreInfo = new APIScoreInfo var topScoreInfo = new APIScoreInfo
{ {
User = new User User = new User
{ {
@ -305,6 +294,14 @@ namespace osu.Game.Tests.Visual
topScoreInfo.Statistics.Add(HitResult.Great, RNG.Next(2000)); topScoreInfo.Statistics.Add(HitResult.Great, RNG.Next(2000));
topScoreInfo.Statistics.Add(HitResult.Good, RNG.Next(2000)); topScoreInfo.Statistics.Add(HitResult.Good, RNG.Next(2000));
topScoreInfo.Statistics.Add(HitResult.Meh, RNG.Next(2000)); topScoreInfo.Statistics.Add(HitResult.Meh, RNG.Next(2000));
AddStep("scores pack 1", () => scoresContainer.Scores = scores);
AddStep("scores pack 2", () => scoresContainer.Scores = anotherScores);
AddStep("only top score", () => scoresContainer.Scores = new[] { topScoreInfo });
AddStep("remove scores", () => scoresContainer.Scores = null);
AddStep("resize to big", () => container.ResizeWidthTo(1, 300));
AddStep("resize to normal", () => container.ResizeWidthTo(0.8f, 300));
AddStep("online scores", () => scoresContainer.Beatmap = new BeatmapInfo { OnlineBeatmapID = 75, Ruleset = new OsuRuleset().RulesetInfo });
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]

View File

@ -91,7 +91,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
Height = 0.5f, Height = 0.5f,
Icon = FontAwesome.fa_search_plus, Icon = FontAwesome.fa_search_plus,
Action = () => timeline.Zoom++ Action = () => changeZoom(1)
}, },
new TimelineButton new TimelineButton
{ {
@ -100,7 +100,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
Height = 0.5f, Height = 0.5f,
Icon = FontAwesome.fa_search_minus, Icon = FontAwesome.fa_search_minus,
Action = () => timeline.Zoom-- Action = () => changeZoom(-1)
}, },
} }
} }
@ -124,5 +124,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
timeline.WaveformVisible.BindTo(waveformCheckbox.Current); timeline.WaveformVisible.BindTo(waveformCheckbox.Current);
} }
private void changeZoom(float change) => timeline.Zoom += change;
} }
} }