1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 18:32:56 +08:00

Modified ManiaComboCounter behavior

This to match more with the current behavior in osu!mania.
This commit is contained in:
Adonais Romero González 2016-10-16 17:45:37 -05:00
parent 2c06764b79
commit a671765a4f
2 changed files with 41 additions and 7 deletions

View File

@ -32,6 +32,8 @@ namespace osu.Desktop.Tests
int numerator = 0, denominator = 0;
bool maniaHold = false;
ScoreCounter score = new ScoreCounter(7)
{
Origin = Anchor.TopRight,
@ -72,7 +74,7 @@ namespace osu.Desktop.Tests
};
Add(taikoCombo);
ComboCounter maniaCombo = new ManiaComboCounter
ManiaComboCounter maniaCombo = new ManiaComboCounter
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
@ -147,6 +149,15 @@ namespace osu.Desktop.Tests
accuracyCombo.SetFraction(numerator, denominator);
});
AddButton(@"mania hold", delegate
{
if (!maniaHold)
maniaCombo.HoldStart();
else
maniaCombo.HoldEnd();
maniaHold = !maniaHold;
});
AddButton(@"Alter stars", delegate
{
stars.Count = RNG.NextSingle() * (stars.MaxStars + 1);

View File

@ -4,6 +4,7 @@
using OpenTK.Graphics;
using osu.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transformations;
using osu.Game.GameModes.Play.Taiko;
using System;
using System.Collections.Generic;
@ -18,9 +19,14 @@ namespace osu.Game.GameModes.Play.Mania
/// </summary>
public class ManiaComboCounter : TaikoComboCounter
{
protected ushort KeysHeld = 0;
protected Color4 OriginalColour;
protected Color4 TintColour => Color4.OrangeRed;
protected Color4 TintColour => Color4.Orange;
protected EasingTypes TintEasing => EasingTypes.None;
protected int TintDuration => 500;
protected Color4 PopOutColor => Color4.Red;
protected override float PopOutInitialAlpha => 1.0f;
protected override ulong PopOutDuration => 300;
@ -32,7 +38,7 @@ namespace osu.Game.GameModes.Play.Mania
PopOutSpriteText.Anchor = Anchor.BottomCentre;
PopOutSpriteText.Origin = Anchor.Centre;
PopOutSpriteText.FadeColour(PopOutColor, 0);
OriginalColour = Colour;
OriginalColour = DisplayedCountSpriteText.Colour;
}
protected override void OnCountRolling(ulong currentValue, ulong newValue)
@ -51,11 +57,28 @@ namespace osu.Game.GameModes.Play.Mania
base.OnCountRolling(currentValue, newValue);
}
protected override void transformAnimate(ulong newValue)
/// <summary>
/// Tints text while holding a key.
/// </summary>
/// <remarks>
/// Does not alter combo. This has to be done depending of the scoring system.
/// (i.e. v1 = each period of time; v2 = when starting and ending a key hold)
/// </remarks>
public void HoldStart()
{
base.transformAnimate(newValue);
DisplayedCountSpriteText.FadeColour(TintColour, 0);
DisplayedCountSpriteText.FadeColour(OriginalColour, AnimationDuration, AnimationEasing);
if (KeysHeld == 0)
DisplayedCountSpriteText.FadeColour(TintColour, TintDuration, TintEasing);
KeysHeld++;
}
/// <summary>
/// Ends tinting.
/// </summary>
public void HoldEnd()
{
KeysHeld--;
if (KeysHeld == 0)
DisplayedCountSpriteText.FadeColour(OriginalColour, TintDuration, TintEasing);
}
}
}