diff --git a/osu-resources b/osu-resources index 2d8a6c1699..e674531595 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 2d8a6c1699ff1acd3915fc28e8906dabf1b145a3 +Subproject commit e67453159540f5008b5efadfbc12dfb3f4bee1f7 diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs index 0bfd191556..0204058b8a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTaikoHitObjects.cs @@ -38,7 +38,7 @@ namespace osu.Desktop.VisualTests.Tests Position = new Vector2(100, 100) }); - Add(new CentreHitCircle(new AccentedCirclePiece() + Add(new CentreHitCircle(new StrongCirclePiece() { KiaiMode = kiai }) @@ -54,7 +54,7 @@ namespace osu.Desktop.VisualTests.Tests Position = new Vector2(100, 300) }); - Add(new RimHitCircle(new AccentedCirclePiece() + Add(new RimHitCircle(new StrongCirclePiece() { KiaiMode = kiai }) @@ -70,7 +70,7 @@ namespace osu.Desktop.VisualTests.Tests Position = new Vector2(100, 500) }); - Add(new SwellCircle(new AccentedCirclePiece() + Add(new SwellCircle(new StrongCirclePiece() { KiaiMode = kiai }) @@ -87,7 +87,7 @@ namespace osu.Desktop.VisualTests.Tests Position = new Vector2(575, 100) }); - Add(new DrumRollCircle(new AccentedCirclePiece() + Add(new DrumRollCircle(new StrongCirclePiece() { KiaiMode = kiai }) @@ -99,8 +99,6 @@ namespace osu.Desktop.VisualTests.Tests private class SwellCircle : BaseCircle { - private const float symbol_size = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.35f; - public SwellCircle(CirclePiece piece) : base(piece) { @@ -108,7 +106,8 @@ namespace osu.Desktop.VisualTests.Tests { Anchor = Anchor.Centre, Origin = Anchor.Centre, - TextSize = symbol_size, + TextSize = SYMBOL_INNER_SIZE, + Icon = FontAwesome.fa_asterisk, Shadow = false }); } @@ -136,8 +135,6 @@ namespace osu.Desktop.VisualTests.Tests private class CentreHitCircle : BaseCircle { - private const float symbol_size = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.35f; - public CentreHitCircle(CirclePiece piece) : base(piece) { @@ -145,7 +142,7 @@ namespace osu.Desktop.VisualTests.Tests { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(symbol_size), + Size = new Vector2(SYMBOL_INNER_SIZE), Masking = true, Children = new[] { @@ -166,8 +163,6 @@ namespace osu.Desktop.VisualTests.Tests private class RimHitCircle : BaseCircle { - private const float symbol_size = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f; - public RimHitCircle(CirclePiece piece) : base(piece) { @@ -175,8 +170,8 @@ namespace osu.Desktop.VisualTests.Tests { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(symbol_size), - BorderThickness = 8, + Size = new Vector2(SYMBOL_SIZE), + BorderThickness = SYMBOL_BORDER, BorderColour = Color4.White, Masking = true, Children = new[] @@ -200,6 +195,10 @@ namespace osu.Desktop.VisualTests.Tests private abstract class BaseCircle : Container { + protected const float SYMBOL_SIZE = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f; + protected const float SYMBOL_BORDER = 8; + protected const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER; + protected readonly CirclePiece Piece; protected BaseCircle(CirclePiece piece) diff --git a/osu.Game.Modes.Osu/OsuAutoReplay.cs b/osu.Game.Modes.Osu/OsuAutoReplay.cs index 61b7466d86..b3fece2b84 100644 --- a/osu.Game.Modes.Osu/OsuAutoReplay.cs +++ b/osu.Game.Modes.Osu/OsuAutoReplay.cs @@ -29,7 +29,7 @@ namespace osu.Game.Modes.Osu createAutoReplay(); } - internal class LegacyReplayFrameComparer : IComparer + private class LegacyReplayFrameComparer : IComparer { public int Compare(LegacyReplayFrame f1, LegacyReplayFrame f2) { diff --git a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs index b2676bf28a..1fc2db53fa 100644 --- a/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -44,7 +44,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps IHasRepeats repeatsData = original as IHasRepeats; IHasEndTime endTimeData = original as IHasEndTime; - bool accented = ((original.Sample?.Type ?? SampleType.None) & SampleType.Finish) > 0; + bool strong = ((original.Sample?.Type ?? SampleType.None) & SampleType.Finish) > 0; if (distanceData != null) { @@ -52,7 +52,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps { StartTime = original.StartTime, Sample = original.Sample, - Accented = accented, + IsStrong = strong, Distance = distanceData.Distance * (repeatsData?.RepeatCount ?? 1) }; @@ -61,11 +61,11 @@ namespace osu.Game.Modes.Taiko.Beatmaps if (endTimeData != null) { // We compute the end time manually to add in the Bash convert factor - return new Bash + return new Swell { StartTime = original.StartTime, Sample = original.Sample, - Accented = accented, + IsStrong = strong, EndTime = original.StartTime + endTimeData.Duration * bash_convert_factor }; @@ -75,7 +75,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps { StartTime = original.StartTime, Sample = original.Sample, - Accented = accented + IsStrong = strong }; } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs new file mode 100644 index 0000000000..3551538fe7 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRoll.cs @@ -0,0 +1,57 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Taiko.Judgements; +using System.Linq; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public class DrawableDrumRoll : DrawableTaikoHitObject + { + private readonly DrumRoll drumRoll; + + public DrawableDrumRoll(DrumRoll drumRoll) + : base(drumRoll) + { + this.drumRoll = drumRoll; + + int tickIndex = 0; + foreach (var tick in drumRoll.Ticks) + { + var newTick = new DrawableDrumRollTick(tick) + { + Depth = tickIndex, + X = (float)((tick.StartTime - HitObject.StartTime) / drumRoll.Duration) + }; + + AddNested(newTick); + + tickIndex++; + } + } + + protected override void UpdateState(ArmedState state) + { + } + + protected override void CheckJudgement(bool userTriggered) + { + if (userTriggered) + return; + + if (Judgement.TimeOffset < 0) + return; + + int countHit = NestedHitObjects.Count(o => o.Judgement.Result == HitResult.Hit); + + if (countHit > drumRoll.RequiredGoodHits) + { + Judgement.Result = HitResult.Hit; + Judgement.TaikoResult = countHit >= drumRoll.RequiredGreatHits ? TaikoHitResult.Great : TaikoHitResult.Good; + } + else + Judgement.Result = HitResult.Miss; + } + } +} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs new file mode 100644 index 0000000000..1e270c6751 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableDrumRollTick.cs @@ -0,0 +1,53 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Input; +using osu.Game.Modes.Taiko.Judgements; +using System; +using osu.Game.Modes.Objects.Drawables; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public class DrawableDrumRollTick : DrawableTaikoHitObject + { + private readonly DrumRollTick tick; + + public DrawableDrumRollTick(DrumRollTick tick) + : base(tick) + { + this.tick = tick; + } + + protected override TaikoJudgement CreateJudgement() => new TaikoDrumRollTickJudgement(); + + protected override void CheckJudgement(bool userTriggered) + { + if (!userTriggered) + { + if (Judgement.TimeOffset > tick.HitWindow) + Judgement.Result = HitResult.Miss; + return; + } + + if (Math.Abs(Judgement.TimeOffset) < tick.HitWindow) + { + Judgement.Result = HitResult.Hit; + Judgement.TaikoResult = TaikoHitResult.Great; + } + } + + protected override void UpdateState(ArmedState state) + { + } + + protected override void UpdateScrollPosition(double time) + { + // Drum roll ticks shouldn't move + } + + protected override bool HandleKeyPress(Key key) + { + return !Judgement.Result.HasValue && UpdateJudgement(true); + } + } +} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs new file mode 100644 index 0000000000..a3ea9e36b9 --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableHit.cs @@ -0,0 +1,67 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Input; +using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Taiko.Judgements; +using System; +using System.Collections.Generic; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public abstract class DrawableHit : DrawableTaikoHitObject + { + /// + /// A list of keys which can result in hits for this HitObject. + /// + protected abstract List HitKeys { get; } + + private readonly Hit hit; + + /// + /// Whether the last key pressed is a valid hit key. + /// + private bool validKeyPressed; + + protected DrawableHit(Hit hit) + : base(hit) + { + this.hit = hit; + } + + protected override void CheckJudgement(bool userTriggered) + { + if (!userTriggered) + { + if (Judgement.TimeOffset > hit.HitWindowGood) + Judgement.Result = HitResult.Miss; + return; + } + + double hitOffset = Math.Abs(Judgement.TimeOffset); + + if (hitOffset > hit.HitWindowMiss) + return; + + if (!validKeyPressed) + Judgement.Result = HitResult.Miss; + else if (hitOffset < hit.HitWindowGood) + { + Judgement.Result = HitResult.Hit; + Judgement.TaikoResult = hitOffset < hit.HitWindowGreat ? TaikoHitResult.Great : TaikoHitResult.Good; + } + else + Judgement.Result = HitResult.Miss; + } + + protected override bool HandleKeyPress(Key key) + { + if (Judgement.Result.HasValue) + return false; + + validKeyPressed = HitKeys.Contains(key); + + return UpdateJudgement(true); + } + } +} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs new file mode 100644 index 0000000000..5e225e1dce --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableStrongHit.cs @@ -0,0 +1,85 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Input; +using System; +using System.Linq; +using osu.Framework.Input; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public abstract class DrawableStrongHit : DrawableHit + { + /// + /// The lenience for the second key press. + /// This does not adjust by map difficulty in ScoreV2 yet. + /// + private const double second_hit_window = 30; + + private double firstHitTime; + private bool firstKeyHeld; + private Key firstHitKey; + + protected DrawableStrongHit(Hit hit) + : base(hit) + { + } + + protected override void CheckJudgement(bool userTriggered) + { + if (!Judgement.Result.HasValue) + { + base.CheckJudgement(userTriggered); + return; + } + + if (!userTriggered) + return; + + // If we get here, we're assured that the key pressed is the correct secondary key + + if (Math.Abs(firstHitTime - Time.Current) < second_hit_window) + Judgement.SecondHit = true; + } + + protected override bool HandleKeyPress(Key key) + { + // Check if we've handled the first key + if (!Judgement.Result.HasValue) + { + // First key hasn't been handled yet, attempt to handle it + bool handled = base.HandleKeyPress(key); + + if (handled) + { + firstHitTime = Time.Current; + firstHitKey = key; + } + + return handled; + } + + // If we've already hit the second key, don't handle this object any further + if (Judgement.SecondHit) + return false; + + // Don't handle represses of the first key + if (firstHitKey == key) + return false; + + // Don't handle invalid hit key presses + if (!HitKeys.Contains(key)) + return false; + + // Assume the intention was to hit the strong hit with both keys only if the first key is still being held down + return firstKeyHeld && UpdateJudgement(true); + } + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + firstKeyHeld = state.Keyboard.Keys.Contains(firstHitKey); + + return base.OnKeyDown(state, args); + } + } +} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs new file mode 100644 index 0000000000..15584ac73f --- /dev/null +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableSwell.cs @@ -0,0 +1,75 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Input; +using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Taiko.Judgements; +using System; + +namespace osu.Game.Modes.Taiko.Objects.Drawable +{ + public class DrawableSwell : DrawableTaikoHitObject + { + /// + /// The amount of times the user has hit this swell. + /// + private int userHits; + + private readonly Swell swell; + + public DrawableSwell(Swell swell) + : base(swell) + { + this.swell = swell; + } + + protected override void CheckJudgement(bool userTriggered) + { + if (userTriggered) + { + if (Time.Current < HitObject.StartTime) + return; + + userHits++; + + if (userHits == swell.RequiredHits) + { + Judgement.Result = HitResult.Hit; + Judgement.TaikoResult = TaikoHitResult.Great; + } + } + else + { + if (Judgement.TimeOffset < 0) + return; + + if (userHits > swell.RequiredHits / 2) + { + Judgement.Result = HitResult.Hit; + Judgement.TaikoResult = TaikoHitResult.Good; + } + else + Judgement.Result = HitResult.Miss; + } + } + + protected override void UpdateState(ArmedState state) + { + } + + protected override void UpdateScrollPosition(double time) + { + base.UpdateScrollPosition(Math.Min(time, HitObject.StartTime)); + } + + protected override bool HandleKeyPress(Key key) + { + if (Judgement.Result.HasValue) + return false; + + UpdateJudgement(true); + + return true; + } + } +} diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs index e165f40442..c14dc6d7b0 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/DrawableTaikoHitObject.cs @@ -1,15 +1,23 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using OpenTK.Input; using osu.Framework.Graphics; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Taiko.Judgements; -using osu.Game.Modes.Taiko.Objects.Drawable.Pieces; +using System.Collections.Generic; +using osu.Framework.Input; namespace osu.Game.Modes.Taiko.Objects.Drawable { public abstract class DrawableTaikoHitObject : DrawableHitObject { + /// + /// A list of keys which this hit object will accept. These are the standard Taiko keys for now. + /// These should be moved to bindings later. + /// + private readonly List validKeys = new List(new[] { Key.D, Key.F, Key.J, Key.K }); + protected DrawableTaikoHitObject(TaikoHitObject hitObject) : base(hitObject) { @@ -17,11 +25,6 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable Origin = Anchor.Centre; RelativePositionAxes = Axes.X; - - Children = new[] - { - CreateCircle() - }; } protected override void LoadComplete() @@ -49,6 +52,20 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable UpdateScrollPosition(Time.Current); } - protected abstract CirclePiece CreateCircle(); + protected virtual bool HandleKeyPress(Key key) => false; + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + // Make sure we don't handle held-down keys + if (args.Repeat) + return false; + + // Check if we've pressed a valid taiko key + if (!validKeys.Contains(args.Key)) + return false; + + // Handle it! + return HandleKeyPress(args.Key); + } } } diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs index 453ab7a05d..ec98feddae 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/CirclePiece.cs @@ -20,6 +20,10 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces /// public class CirclePiece : Container { + public const float SYMBOL_SIZE = TaikoHitObject.CIRCLE_RADIUS * 2f * 0.45f; + public const float SYMBOL_BORDER = 8; + public const float SYMBOL_INNER_SIZE = SYMBOL_SIZE - 2 * SYMBOL_BORDER; + private Color4 accentColour; /// /// The colour of the inner circle and outer glows. diff --git a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/AccentedCirclePiece.cs b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/StrongCirclePiece.cs similarity index 64% rename from osu.Game.Modes.Taiko/Objects/Drawable/Pieces/AccentedCirclePiece.cs rename to osu.Game.Modes.Taiko/Objects/Drawable/Pieces/StrongCirclePiece.cs index c02cbc572a..319ca17cb8 100644 --- a/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/AccentedCirclePiece.cs +++ b/osu.Game.Modes.Taiko/Objects/Drawable/Pieces/StrongCirclePiece.cs @@ -6,20 +6,20 @@ using OpenTK; namespace osu.Game.Modes.Taiko.Objects.Drawable.Pieces { /// - /// A type of circle piece which is drawn at a higher scale as an "accent". + /// A type of circle piece which is drawn at a higher scale to represent a "strong" piece. /// - public class AccentedCirclePiece : CirclePiece + public class StrongCirclePiece : CirclePiece { /// - /// The amount to scale up the base circle to show it as an "accented" piece. + /// The amount to scale up the base circle to show it as a "strong" piece. /// - private const float accent_scale = 1.5f; + private const float strong_scale = 1.5f; - public AccentedCirclePiece() + public StrongCirclePiece() { - SymbolContainer.Scale = new Vector2(accent_scale); + SymbolContainer.Scale = new Vector2(strong_scale); } - public override Vector2 Size => new Vector2(base.Size.X, base.Size.Y * accent_scale); + public override Vector2 Size => new Vector2(base.Size.X, base.Size.Y * strong_scale); } } diff --git a/osu.Game.Modes.Taiko/Objects/DrumRoll.cs b/osu.Game.Modes.Taiko/Objects/DrumRoll.cs index cdb8ef2405..1f9241268b 100644 --- a/osu.Game.Modes.Taiko/Objects/DrumRoll.cs +++ b/osu.Game.Modes.Taiko/Objects/DrumRoll.cs @@ -101,4 +101,4 @@ namespace osu.Game.Modes.Taiko.Objects return ret; } } -} +} \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/Objects/DrumRollTick.cs b/osu.Game.Modes.Taiko/Objects/DrumRollTick.cs index 66a2d16fe1..2ca0d71fc1 100644 --- a/osu.Game.Modes.Taiko/Objects/DrumRollTick.cs +++ b/osu.Game.Modes.Taiko/Objects/DrumRollTick.cs @@ -15,5 +15,10 @@ namespace osu.Game.Modes.Taiko.Objects /// Half of this value is the hit window of the tick. /// public double TickTimeDistance; + + /// + /// The time allowed to hit this tick. + /// + public double HitWindow => TickTimeDistance / 2; } } \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/Objects/Bash.cs b/osu.Game.Modes.Taiko/Objects/Swell.cs similarity index 84% rename from osu.Game.Modes.Taiko/Objects/Bash.cs rename to osu.Game.Modes.Taiko/Objects/Swell.cs index b8b4eea6a9..20b9a6effb 100644 --- a/osu.Game.Modes.Taiko/Objects/Bash.cs +++ b/osu.Game.Modes.Taiko/Objects/Swell.cs @@ -8,14 +8,14 @@ using osu.Game.Modes.Objects.Types; namespace osu.Game.Modes.Taiko.Objects { - public class Bash : TaikoHitObject, IHasEndTime + public class Swell : TaikoHitObject, IHasEndTime { public double EndTime { get; set; } public double Duration => EndTime - StartTime; /// - /// The number of hits required to complete the bash successfully. + /// The number of hits required to complete the swell successfully. /// public int RequiredHits { get; protected set; } diff --git a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs index 0ec1c2b93c..28077db1ba 100644 --- a/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs +++ b/osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs @@ -20,10 +20,10 @@ namespace osu.Game.Modes.Taiko.Objects public double PreEmpt; /// - /// Whether this HitObject is accented. - /// Accented hit objects give more points for hitting the hit object with both keys. + /// Whether this HitObject is a "strong" type. + /// Strong hit objects give more points for hitting the hit object with both keys. /// - public bool Accented; + public bool IsStrong; /// /// Whether this HitObject is in Kiai time. diff --git a/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs index 3007411230..2ab31c5efb 100644 --- a/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Modes.Taiko/Scoring/TaikoScoreProcessor.cs @@ -128,7 +128,7 @@ namespace osu.Game.Modes.Taiko.Scoring hpIncreaseGood = hpMultiplierNormal * hp_hit_good; hpIncreaseMiss = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.Difficulty.DrainRate, hp_miss_min, hp_miss_mid, hp_miss_max); - var accentedHits = beatmap.HitObjects.FindAll(o => o is Hit && o.Accented); + var accentedHits = beatmap.HitObjects.FindAll(o => o is Hit && o.IsStrong); // This is a linear function that awards: // 10 times bonus points for hitting an accented hit object with both keys with 30 accented hit objects in the map @@ -143,7 +143,7 @@ namespace osu.Game.Modes.Taiko.Scoring { Result = HitResult.Hit, TaikoResult = TaikoHitResult.Great, - SecondHit = obj.Accented + SecondHit = obj.IsStrong }); } else if (obj is DrumRoll) @@ -154,7 +154,7 @@ namespace osu.Game.Modes.Taiko.Scoring { Result = HitResult.Hit, TaikoResult = TaikoHitResult.Great, - SecondHit = obj.Accented + SecondHit = obj.IsStrong }); } @@ -162,10 +162,10 @@ namespace osu.Game.Modes.Taiko.Scoring { Result = HitResult.Hit, TaikoResult = TaikoHitResult.Great, - SecondHit = obj.Accented + SecondHit = obj.IsStrong }); } - else if (obj is Bash) + else if (obj is Swell) { AddJudgement(new TaikoJudgement { diff --git a/osu.Game.Modes.Taiko/UI/InputDrum.cs b/osu.Game.Modes.Taiko/UI/InputDrum.cs index 1787670c7a..2e4c2232fa 100644 --- a/osu.Game.Modes.Taiko/UI/InputDrum.cs +++ b/osu.Game.Modes.Taiko/UI/InputDrum.cs @@ -139,7 +139,7 @@ namespace osu.Game.Modes.Taiko.UI { target.FadeTo(Math.Min(target.Alpha + 0.4f, 1), 40, EasingTypes.OutQuint); target.Delay(40); - target.FadeOut(600, EasingTypes.OutQuint); + target.FadeOut(1000, EasingTypes.OutQuint); } return false; diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs index b7fac507d6..9bc75a55f5 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -26,6 +26,7 @@ namespace osu.Game.Modes.Taiko.UI /// /// The play field height scale. + /// This also uniformly scales the notes to match the new playfield height. /// public const float PLAYFIELD_SCALE = 0.65f; @@ -173,6 +174,7 @@ namespace osu.Game.Modes.Taiko.UI public override void Add(DrawableHitObject h) { h.Depth = (float)h.HitObject.StartTime; + h.Scale = new Vector2(PLAYFIELD_SCALE); base.Add(h); } diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 25c3052583..d2aecc8d2e 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -52,15 +52,20 @@ + + + + + - - + + - - + + @@ -97,4 +102,4 @@ --> - \ No newline at end of file + diff --git a/osu.Game/Database/ScoreDatabase.cs b/osu.Game/Database/ScoreDatabase.cs index 665ae8649e..096c0dcc29 100644 --- a/osu.Game/Database/ScoreDatabase.cs +++ b/osu.Game/Database/ScoreDatabase.cs @@ -101,7 +101,7 @@ namespace osu.Game.Database using (var lzma = new LzmaStream(properties, replayInStream, compressedSize, outSize)) using (var reader = new StreamReader(lzma)) - score.Replay = new LegacyReplay(reader); + score.Replay = score.CreateLegacyReplayFrom(reader); } } diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index 3ab6fa7093..39d0cf181c 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -20,9 +20,11 @@ namespace osu.Game.Graphics.Cursor { protected override Drawable CreateCursor() => new Cursor(); + private bool dragging; + protected override bool OnMouseMove(InputState state) { - if (state.Mouse.HasMainButtonPressed) + if (dragging) { Vector2 offset = state.Mouse.Position - state.Mouse.PositionMouseDown ?? state.Mouse.Delta; float degrees = (float)MathHelper.RadiansToDegrees(Math.Atan2(-offset.X, offset.Y)) + 24.3f; @@ -39,6 +41,12 @@ namespace osu.Game.Graphics.Cursor return base.OnMouseMove(state); } + protected override bool OnDragStart(InputState state) + { + dragging = true; + return base.OnDragStart(state); + } + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) { ActiveCursor.Scale = new Vector2(1); @@ -53,6 +61,8 @@ namespace osu.Game.Graphics.Cursor { if (!state.Mouse.HasMainButtonPressed) { + dragging = false; + ((Cursor)ActiveCursor).AdditiveLayer.FadeOut(500, EasingTypes.OutQuint); ActiveCursor.RotateTo(0, 600 * (1 + Math.Abs(ActiveCursor.Rotation / 720)), EasingTypes.OutElasticHalf); ActiveCursor.ScaleTo(1, 500, EasingTypes.OutElastic); diff --git a/osu.Game/Modes/LegacyReplay.cs b/osu.Game/Modes/LegacyReplay.cs index 4b77550cbc..d57d4a15d2 100644 --- a/osu.Game/Modes/LegacyReplay.cs +++ b/osu.Game/Modes/LegacyReplay.cs @@ -46,13 +46,13 @@ namespace osu.Game.Modes } } - public override ReplayInputHandler GetInputHandler() => new LegacyReplayInputHandler(Frames); + public override ReplayInputHandler CreateInputHandler() => new LegacyReplayInputHandler(Frames); /// /// The ReplayHandler will take a replay and handle the propagation of updates to the input stack. /// It handles logic of any frames which *must* be executed. /// - public class LegacyReplayInputHandler : ReplayInputHandler + protected class LegacyReplayInputHandler : ReplayInputHandler { private readonly List replayContent; @@ -163,7 +163,7 @@ namespace osu.Game.Modes return currentTime = time; } - private class ReplayMouseState : MouseState + protected class ReplayMouseState : MouseState { public ReplayMouseState(Vector2 position, IEnumerable list) { @@ -172,7 +172,7 @@ namespace osu.Game.Modes } } - private class ReplayKeyboardState : KeyboardState + protected class ReplayKeyboardState : KeyboardState { public ReplayKeyboardState(List keys) { @@ -182,7 +182,7 @@ namespace osu.Game.Modes } [Flags] - public enum LegacyButtonState + protected enum LegacyButtonState { None = 0, Left1 = 1, @@ -192,7 +192,7 @@ namespace osu.Game.Modes Smoke = 16 } - public class LegacyReplayFrame + protected class LegacyReplayFrame { public Vector2 Position => new Vector2(MouseX, MouseY); diff --git a/osu.Game/Modes/Mods/Mod.cs b/osu.Game/Modes/Mods/Mod.cs index 8416ae6211..c53c6faa21 100644 --- a/osu.Game/Modes/Mods/Mod.cs +++ b/osu.Game/Modes/Mods/Mod.cs @@ -157,7 +157,7 @@ namespace osu.Game.Modes.Mods public void Apply(HitRenderer hitRenderer) { - hitRenderer.InputManager.ReplayInputHandler = CreateReplayScore(hitRenderer.Beatmap)?.Replay?.GetInputHandler(); + hitRenderer.InputManager.ReplayInputHandler = CreateReplayScore(hitRenderer.Beatmap)?.Replay?.CreateInputHandler(); } } diff --git a/osu.Game/Modes/Replay.cs b/osu.Game/Modes/Replay.cs index 0a41a12335..6d93afdeb9 100644 --- a/osu.Game/Modes/Replay.cs +++ b/osu.Game/Modes/Replay.cs @@ -7,6 +7,6 @@ namespace osu.Game.Modes { public abstract class Replay { - public virtual ReplayInputHandler GetInputHandler() => null; + public virtual ReplayInputHandler CreateInputHandler() => null; } } \ No newline at end of file diff --git a/osu.Game/Modes/Scoring/Score.cs b/osu.Game/Modes/Scoring/Score.cs index fa74fba279..75c243278d 100644 --- a/osu.Game/Modes/Scoring/Score.cs +++ b/osu.Game/Modes/Scoring/Score.cs @@ -6,6 +6,7 @@ using Newtonsoft.Json; using osu.Game.Database; using osu.Game.Modes.Mods; using osu.Game.Users; +using System.IO; namespace osu.Game.Modes.Scoring { @@ -43,6 +44,13 @@ namespace osu.Game.Modes.Scoring [JsonProperty(@"date")] public DateTime Date; + /// + /// Creates a legacy replay which is read from a stream. + /// + /// The stream reader. + /// The replay. + public virtual Replay CreateLegacyReplayFrom(StreamReader reader) => new LegacyReplay(reader); + // [JsonProperty(@"count50")] 0, //[JsonProperty(@"count100")] 0, //[JsonProperty(@"count300")] 100, diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 8ac809e591..e6abdab729 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -126,7 +126,7 @@ namespace osu.Game Beatmap.Value = BeatmapDatabase.GetWorkingBeatmap(s.Beatmap); - menu.Push(new PlayerLoader(new Player { ReplayInputHandler = s.Replay.GetInputHandler() })); + menu.Push(new PlayerLoader(new Player { ReplayInputHandler = s.Replay.CreateInputHandler() })); } protected override void LoadComplete() diff --git a/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs b/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs index 6b59af0bb4..fd8a24f213 100644 --- a/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs +++ b/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs @@ -13,14 +13,14 @@ namespace osu.Game.Screens.Select.Leaderboards { public class DrawableRank : Container { - private readonly Sprite sprite; + private readonly Sprite rankSprite; public ScoreRank Rank { get; private set; } [BackgroundDependencyLoader] private void load(TextureStore textures) { - sprite.Texture = textures.Get($@"Badges/ScoreRanks/{Rank.GetDescription()}"); + rankSprite.Texture = textures.Get($@"Grades/{Rank.GetDescription()}"); } public DrawableRank(ScoreRank rank) @@ -29,10 +29,7 @@ namespace osu.Game.Screens.Select.Leaderboards Children = new Drawable[] { - sprite = new Sprite - { - RelativeSizeAxes = Axes.Both, - }, + rankSprite = new Sprite { FillMode = FillMode.Fill }, }; } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 2198167c7d..b57a21bed4 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -160,7 +160,7 @@ - + @@ -322,7 +322,7 @@ - + @@ -398,4 +398,4 @@ --> - \ No newline at end of file +