1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 06:12:56 +08:00

Merge branch 'master' into selectionlayer-rewrite

This commit is contained in:
Dean Herbert 2018-04-04 20:47:36 +09:00 committed by GitHub
commit 6c125683d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 90 additions and 2 deletions

View File

@ -0,0 +1,62 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Screens.Play;
using osu.Game.Tests.Visual;
using OpenTK;
namespace osu.Game.Rulesets.Catch.Tests
{
public class TestCaseAutoJuiceStream : TestCasePlayer
{
public TestCaseAutoJuiceStream()
: base(new CatchRuleset())
{
}
protected override Beatmap CreateBeatmap(Ruleset ruleset)
{
var beatmap = new Beatmap
{
BeatmapInfo = new BeatmapInfo
{
BaseDifficulty = new BeatmapDifficulty { CircleSize = 6, SliderMultiplier = 3 },
Ruleset = ruleset.RulesetInfo
}
};
for (int i = 0; i < 100; i++)
{
float width = (i % 10 + 1) / 20f;
beatmap.HitObjects.Add(new JuiceStream
{
X = 0.5f - width / 2,
ControlPoints = new List<Vector2>
{
Vector2.Zero,
new Vector2(width * CatchPlayfield.BASE_WIDTH, 0)
},
CurveType = CurveType.Linear,
Distance = width * CatchPlayfield.BASE_WIDTH,
StartTime = i * 2000,
NewCombo = i % 8 == 0
});
}
return beatmap;
}
protected override Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset)
{
beatmap.Mods.Value = beatmap.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() });
return base.CreatePlayer(beatmap, ruleset);
}
}
}

View File

@ -108,6 +108,7 @@ namespace osu.Game.Rulesets.Catch.Replays
case BananaShower.Banana _:
case TinyDroplet _:
case Droplet _:
case Fruit _:
moveToNext(nestedObj);
break;
}

View File

@ -8,5 +8,6 @@ namespace osu.Game.Rulesets.Osu.Edit
public class OsuEditPlayfield : OsuPlayfield
{
protected override bool ProxyApproachCircles => false;
protected override bool DisplayJudgements => false;
}
}

View File

@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Osu.UI
// Todo: This should not be a thing, but is currently required for the editor
// https://github.com/ppy/osu-framework/issues/1283
protected virtual bool ProxyApproachCircles => true;
protected virtual bool DisplayJudgements => true;
public static readonly Vector2 BASE_SIZE = new Vector2(512, 384);
@ -73,7 +74,7 @@ namespace osu.Game.Rulesets.Osu.UI
private void onJudgement(DrawableHitObject judgedObject, Judgement judgement)
{
if (!judgedObject.DisplayJudgement)
if (!judgedObject.DisplayJudgement || !DisplayJudgements)
return;
DrawableOsuJudgement explosion = new DrawableOsuJudgement(judgement, judgedObject)

View File

@ -23,6 +23,8 @@ namespace osu.Game.Rulesets.Judgements
{
private const float judgement_size = 80;
private OsuColour colours;
protected readonly Judgement Judgement;
public readonly DrawableHitObject JudgedObject;
@ -45,11 +47,13 @@ namespace osu.Game.Rulesets.Judgements
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
this.colours = colours;
Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText
{
Text = Judgement.Result.GetDescription().ToUpper(),
Font = @"Venera",
Colour = Judgement.Result == HitResult.Miss ? colours.Red : Color4.White,
Colour = judgementColour(Judgement.Result),
Scale = new Vector2(0.85f, 1),
TextSize = 12
}, restrictSize: false);
@ -84,5 +88,24 @@ namespace osu.Game.Rulesets.Judgements
Expire(true);
}
private Color4 judgementColour(HitResult judgement)
{
switch (judgement)
{
case HitResult.Perfect:
case HitResult.Great:
return colours.Blue;
case HitResult.Ok:
case HitResult.Good:
return colours.Green;
case HitResult.Meh:
return colours.Yellow;
case HitResult.Miss:
return colours.Red;
}
return Color4.White;
}
}
}