mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:23:00 +08:00
Merge branch 'master' into selectionlayer-rewrite
This commit is contained in:
commit
6c125683d4
62
osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs
Normal file
62
osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -108,6 +108,7 @@ namespace osu.Game.Rulesets.Catch.Replays
|
|||||||
case BananaShower.Banana _:
|
case BananaShower.Banana _:
|
||||||
case TinyDroplet _:
|
case TinyDroplet _:
|
||||||
case Droplet _:
|
case Droplet _:
|
||||||
|
case Fruit _:
|
||||||
moveToNext(nestedObj);
|
moveToNext(nestedObj);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -8,5 +8,6 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
public class OsuEditPlayfield : OsuPlayfield
|
public class OsuEditPlayfield : OsuPlayfield
|
||||||
{
|
{
|
||||||
protected override bool ProxyApproachCircles => false;
|
protected override bool ProxyApproachCircles => false;
|
||||||
|
protected override bool DisplayJudgements => false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
// Todo: This should not be a thing, but is currently required for the editor
|
// Todo: This should not be a thing, but is currently required for the editor
|
||||||
// https://github.com/ppy/osu-framework/issues/1283
|
// https://github.com/ppy/osu-framework/issues/1283
|
||||||
protected virtual bool ProxyApproachCircles => true;
|
protected virtual bool ProxyApproachCircles => true;
|
||||||
|
protected virtual bool DisplayJudgements => true;
|
||||||
|
|
||||||
public static readonly Vector2 BASE_SIZE = new Vector2(512, 384);
|
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)
|
private void onJudgement(DrawableHitObject judgedObject, Judgement judgement)
|
||||||
{
|
{
|
||||||
if (!judgedObject.DisplayJudgement)
|
if (!judgedObject.DisplayJudgement || !DisplayJudgements)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DrawableOsuJudgement explosion = new DrawableOsuJudgement(judgement, judgedObject)
|
DrawableOsuJudgement explosion = new DrawableOsuJudgement(judgement, judgedObject)
|
||||||
|
@ -23,6 +23,8 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
{
|
{
|
||||||
private const float judgement_size = 80;
|
private const float judgement_size = 80;
|
||||||
|
|
||||||
|
private OsuColour colours;
|
||||||
|
|
||||||
protected readonly Judgement Judgement;
|
protected readonly Judgement Judgement;
|
||||||
|
|
||||||
public readonly DrawableHitObject JudgedObject;
|
public readonly DrawableHitObject JudgedObject;
|
||||||
@ -45,11 +47,13 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
|
this.colours = colours;
|
||||||
|
|
||||||
Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText
|
Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = Judgement.Result.GetDescription().ToUpper(),
|
Text = Judgement.Result.GetDescription().ToUpper(),
|
||||||
Font = @"Venera",
|
Font = @"Venera",
|
||||||
Colour = Judgement.Result == HitResult.Miss ? colours.Red : Color4.White,
|
Colour = judgementColour(Judgement.Result),
|
||||||
Scale = new Vector2(0.85f, 1),
|
Scale = new Vector2(0.85f, 1),
|
||||||
TextSize = 12
|
TextSize = 12
|
||||||
}, restrictSize: false);
|
}, restrictSize: false);
|
||||||
@ -84,5 +88,24 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
|
|
||||||
Expire(true);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user