mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 16:03:01 +08:00
Add judgement text displays to osu!mania
This commit is contained in:
parent
54aff432fe
commit
df0a31bf2a
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Extensions;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
|
||||||
@ -33,9 +34,9 @@ namespace osu.Game.Rulesets.Mania.Judgements
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int MaxResultValueForAccuracy => NumericResultForAccuracy(MAX_HIT_RESULT);
|
public int MaxResultValueForAccuracy => NumericResultForAccuracy(MAX_HIT_RESULT);
|
||||||
|
|
||||||
public override string ResultString => string.Empty;
|
public override string ResultString => ManiaResult.GetDescription();
|
||||||
|
|
||||||
public override string MaxResultString => string.Empty;
|
public override string MaxResultString => MAX_HIT_RESULT.GetDescription();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The hit result.
|
/// The hit result.
|
||||||
|
38
osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs
Normal file
38
osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Rulesets.Judgements;
|
||||||
|
using osu.Game.Rulesets.Mania.Judgements;
|
||||||
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Mania.UI
|
||||||
|
{
|
||||||
|
internal class DrawableManiaJudgement : DrawableJudgement<ManiaJudgement>
|
||||||
|
{
|
||||||
|
public DrawableManiaJudgement(ManiaJudgement judgement)
|
||||||
|
: base(judgement)
|
||||||
|
{
|
||||||
|
JudgementText.TextSize = 25;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
this.FadeInFromZero(50, Easing.OutQuint);
|
||||||
|
|
||||||
|
switch (Judgement.Result)
|
||||||
|
{
|
||||||
|
case HitResult.Hit:
|
||||||
|
this.ScaleTo(0.8f);
|
||||||
|
this.ScaleTo(1, 250, Easing.OutElastic);
|
||||||
|
|
||||||
|
this.Delay(50).FadeOut(200).ScaleTo(0.75f, 250);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Expire();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -53,6 +53,8 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
private List<Color4> normalColumnColours = new List<Color4>();
|
private List<Color4> normalColumnColours = new List<Color4>();
|
||||||
private Color4 specialColumnColour;
|
private Color4 specialColumnColour;
|
||||||
|
|
||||||
|
private readonly Container<DrawableManiaJudgement> judgements;
|
||||||
|
|
||||||
private readonly int columnCount;
|
private readonly int columnCount;
|
||||||
|
|
||||||
public ManiaPlayfield(int columnCount)
|
public ManiaPlayfield(int columnCount)
|
||||||
@ -120,6 +122,14 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
Padding = new MarginPadding { Top = HIT_TARGET_POSITION }
|
Padding = new MarginPadding { Top = HIT_TARGET_POSITION }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
judgements = new Container<DrawableManiaJudgement>
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Y = HIT_TARGET_POSITION + 150,
|
||||||
|
BypassAutoSizeAxes = Axes.Both
|
||||||
|
},
|
||||||
topLevelContainer = new Container { RelativeSizeAxes = Axes.Both }
|
topLevelContainer = new Container { RelativeSizeAxes = Axes.Both }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,6 +157,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
private void invertedChanged(bool newValue)
|
private void invertedChanged(bool newValue)
|
||||||
{
|
{
|
||||||
Scale = new Vector2(1, newValue ? -1 : 1);
|
Scale = new Vector2(1, newValue ? -1 : 1);
|
||||||
|
judgements.Scale = Scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -181,7 +192,17 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnJudgement(DrawableHitObject<ManiaHitObject, ManiaJudgement> judgedObject) => columns[judgedObject.HitObject.Column].OnJudgement(judgedObject);
|
public override void OnJudgement(DrawableHitObject<ManiaHitObject, ManiaJudgement> judgedObject)
|
||||||
|
{
|
||||||
|
columns[judgedObject.HitObject.Column].OnJudgement(judgedObject);
|
||||||
|
|
||||||
|
judgements.Clear();
|
||||||
|
judgements.Add(new DrawableManiaJudgement(judgedObject.Judgement)
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the column index is a special column for this playfield.
|
/// Whether the column index is a special column for this playfield.
|
||||||
|
@ -83,6 +83,7 @@
|
|||||||
<Compile Include="Timing\GravityScrollingContainer.cs" />
|
<Compile Include="Timing\GravityScrollingContainer.cs" />
|
||||||
<Compile Include="Timing\ScrollingAlgorithm.cs" />
|
<Compile Include="Timing\ScrollingAlgorithm.cs" />
|
||||||
<Compile Include="UI\Column.cs" />
|
<Compile Include="UI\Column.cs" />
|
||||||
|
<Compile Include="UI\DrawableManiaJudgement.cs" />
|
||||||
<Compile Include="UI\HitExplosion.cs" />
|
<Compile Include="UI\HitExplosion.cs" />
|
||||||
<Compile Include="UI\ManiaRulesetContainer.cs" />
|
<Compile Include="UI\ManiaRulesetContainer.cs" />
|
||||||
<Compile Include="UI\ManiaPlayfield.cs" />
|
<Compile Include="UI\ManiaPlayfield.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user