diff --git a/COMPILING.md b/COMPILING.md
new file mode 100644
index 0000000000..bfcbf6bc2c
--- /dev/null
+++ b/COMPILING.md
@@ -0,0 +1,36 @@
+# Linux
+### 1. Requirements:
+Mono >= 5.4.0 (>= 5.8.0 recommended)
+Please check [here](http://www.mono-project.com/download/) for stable or [here](http://www.mono-project.com/download/alpha/) for an alpha release.
+NuGet >= 4.4.0
+msbuild
+git
+
+### 2. Cloning project
+Clone the entire repository with submodules using
+```
+git clone https://github.com/ppy/osu --recursive
+```
+Then restore NuGet packages from the repository
+```
+nuget restore
+```
+### 3. Compiling
+Simply run `msbuild` where `osu.sln` is located, this will create all binaries in `osu/osu.Desktop/bin/Debug`.
+### 4. Optimizing
+If you want additional performance you can change build type to Release with
+```
+msbuild -p:Configuration=Release
+```
+Additionally, mono provides an AOT utility which attempts to precompile binaries. You can utilize that by running
+```
+mono --aot ./osu\!.exe
+```
+### 5. Troubleshooting
+You may run into trouble with NuGet versioning, as the one in packaging system is almost always out of date. Simply run
+```
+nuget
+sudo nuget update -self
+```
+**Warning** NuGet creates few config files when it's run for the first time.
+Do not run NuGet as root on the first run or you might run into very peculiar issues.
diff --git a/NuGet.config b/NuGet.config
deleted file mode 100644
index 95f993e510..0000000000
--- a/NuGet.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/README.md b/README.md
index 856536d22d..47df86f57e 100644
--- a/README.md
+++ b/README.md
@@ -8,8 +8,11 @@ This is still heavily under development and is not intended for end-user use. Th
# Requirements
-- A desktop platform which can compile .NET 4.5 (tested on macOS, linux and windows). We recommend using [Visual Studio Code](https://code.visualstudio.com/) (all platforms) or [Visual Studio Community Edition](https://www.visualstudio.com/) (windows only), both of which are free.
-- Make sure you initialise and keep submodules up-to-date.
+- A desktop platform that can compile .NET 4.6.1. We recommend using [Visual Studio Community Edition](https://www.visualstudio.com/) (Windows), [Visual Studio for Mac](https://www.visualstudio.com/vs/visual-studio-mac/) (macOS) or [MonoDevelop](http://www.monodevelop.com/download/) (Linux), all of which are free. [Visual Studio Code](https://code.visualstudio.com/) may also be used but requires further setup steps which are not covered here.
+
+# Getting Started
+- Clone the repository including submodules (`git clone --recurse-submodules https://github.com/ppy/osu`)
+- Build in your IDE of choice (recommended IDEs automatically restore nuget packages; if you are using an alternative make sure to `nuget restore`)
# Contributing
diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj
index 4a1798feb4..3cc4e7f943 100644
--- a/osu.Desktop/osu.Desktop.csproj
+++ b/osu.Desktop/osu.Desktop.csproj
@@ -136,7 +136,7 @@
True
- $(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll
+ $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll
True
diff --git a/osu.Desktop/packages.config b/osu.Desktop/packages.config
index e7233a42ac..4757b50c4c 100644
--- a/osu.Desktop/packages.config
+++ b/osu.Desktop/packages.config
@@ -6,7 +6,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
-
+
diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs
index b90a06b94e..a617b65676 100644
--- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs
+++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs
@@ -6,6 +6,7 @@ using osu.Framework.Graphics;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Drawables;
using OpenTK;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Catch.Objects.Drawable
{
diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs
index 3826fd1129..3b9eacde9c 100644
--- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs
+++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs
@@ -5,7 +5,6 @@ using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.Judgements;
using osu.Game.Rulesets.Catch.Objects;
-using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj
index 578d8eb34d..16c909e063 100644
--- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj
+++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj
@@ -37,7 +37,7 @@
True
- $(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll
+ $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll
True
diff --git a/osu.Game.Rulesets.Catch/packages.config b/osu.Game.Rulesets.Catch/packages.config
index 2369f7529b..b39a85a382 100644
--- a/osu.Game.Rulesets.Catch/packages.config
+++ b/osu.Game.Rulesets.Catch/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs b/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs
index d7bfa9caa1..ded1bc17af 100644
--- a/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs
+++ b/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Beatmaps;
-using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mania.Judgements
{
diff --git a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs
index a8d1b079eb..e369df6ae1 100644
--- a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs
+++ b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mania.Judgements
{
@@ -24,4 +24,4 @@ namespace osu.Game.Rulesets.Mania.Judgements
}
}
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs
index d326c6fc0a..4787a4977b 100644
--- a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs
+++ b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mania.Judgements
{
@@ -11,4 +11,4 @@ namespace osu.Game.Rulesets.Mania.Judgements
protected override int NumericResultFor(HitResult result) => 20;
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs
index 1f3b352da4..4762a98c40 100644
--- a/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs
+++ b/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Judgements;
-using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mania.Judgements
{
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs
index 7b207ca229..41d817a746 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs
@@ -12,6 +12,7 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Mania.Judgements;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Input.Bindings;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mania.Objects.Drawables
{
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs
index 557fbf6ea8..8ed5d2b924 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs
@@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Mania.Judgements;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Framework.Graphics.Shapes;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mania.Objects.Drawables
{
@@ -113,4 +114,4 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
UpdateJudgement(true);
}
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs
index 537246509b..aabfcafa85 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs
@@ -8,6 +8,7 @@ using osu.Framework.Input.Bindings;
using osu.Game.Rulesets.Mania.Judgements;
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Mania.Objects.Drawables
{
diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs
index 012137f555..140bab2225 100644
--- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs
+++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs
@@ -6,7 +6,6 @@ using osu.Game.Beatmaps;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Mania.Judgements;
using osu.Game.Rulesets.Mania.Objects;
-using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs
index 1932038411..b5890b289f 100644
--- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs
+++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs
@@ -13,7 +13,7 @@ using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Mania.Timing;
using osu.Game.Rulesets.Mania.UI;
-using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Timing;
using osu.Game.Tests.Visual;
diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj
index bdd6656ed9..3393774a9c 100644
--- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj
+++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj
@@ -37,7 +37,7 @@
True
- $(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll
+ $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll
True
diff --git a/osu.Game.Rulesets.Mania/packages.config b/osu.Game.Rulesets.Mania/packages.config
index 2369f7529b..b39a85a382 100644
--- a/osu.Game.Rulesets.Mania/packages.config
+++ b/osu.Game.Rulesets.Mania/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs b/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs
index 28b6a04376..cd9c3888df 100644
--- a/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs
+++ b/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs
@@ -4,7 +4,7 @@
using OpenTK;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Osu.Objects.Drawables;
-using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Judgements
{
@@ -34,4 +34,4 @@ namespace osu.Game.Rulesets.Osu.Judgements
public ComboResult Combo;
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs
index 71349285b3..7b1f80f439 100644
--- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs
+++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs
@@ -11,8 +11,11 @@ using System.Collections.Generic;
using System.Linq;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.Scoring;
-using osu.Game.Rulesets.UI;
using OpenTK;
+using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Osu.Objects.Drawables;
+using osu.Framework.Graphics;
+using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Rulesets.Osu.Mods
{
@@ -23,13 +26,86 @@ namespace osu.Game.Rulesets.Osu.Mods
public class OsuModEasy : ModEasy
{
-
}
- public class OsuModHidden : ModHidden
+ public class OsuModHidden : ModHidden, IApplicableToDrawableHitObjects
{
public override string Description => @"Play with no approach circles and fading notes for a slight score advantage.";
public override double ScoreMultiplier => 1.06;
+
+ private const double fade_in_duration_multiplier = 0.4;
+ private const double fade_out_duration_multiplier = 0.3;
+
+ private float preEmpt => DrawableOsuHitObject.TIME_PREEMPT;
+
+ public void ApplyToDrawableHitObjects(IEnumerable drawables)
+ {
+ foreach (var d in drawables.OfType())
+ {
+ d.ApplyCustomUpdateState += ApplyHiddenState;
+ d.FadeInDuration = preEmpt * fade_in_duration_multiplier;
+ }
+ }
+
+ protected void ApplyHiddenState(DrawableHitObject drawable, ArmedState state)
+ {
+ if (!(drawable is DrawableOsuHitObject d))
+ return;
+
+ var fadeOutStartTime = d.HitObject.StartTime - preEmpt + d.FadeInDuration;
+ var fadeOutDuration = preEmpt * fade_out_duration_multiplier;
+
+ // new duration from completed fade in to end (before fading out)
+ var longFadeDuration = ((d.HitObject as IHasEndTime)?.EndTime ?? d.HitObject.StartTime) - fadeOutStartTime;
+
+ switch (drawable)
+ {
+ case DrawableHitCircle circle:
+ // we don't want to see the approach circle
+ circle.ApproachCircle.Hide();
+
+ // fade out immediately after fade in.
+ using (drawable.BeginAbsoluteSequence(fadeOutStartTime, true))
+ circle.FadeOut(fadeOutDuration);
+ break;
+ case DrawableSlider slider:
+ using (slider.BeginAbsoluteSequence(fadeOutStartTime, true))
+ {
+ slider.Body.FadeOut(longFadeDuration, Easing.Out);
+
+ // delay a bit less to let the sliderball fade out peacefully instead of having a hard cut
+ using (slider.BeginDelayedSequence(longFadeDuration - fadeOutDuration, true))
+ slider.Ball.FadeOut(fadeOutDuration);
+ }
+
+ break;
+ case DrawableSpinner spinner:
+ // hide elements we don't care about.
+ spinner.Disc.Hide();
+ spinner.Ticks.Hide();
+ spinner.Background.Hide();
+
+ using (spinner.BeginAbsoluteSequence(fadeOutStartTime + longFadeDuration, true))
+ {
+ spinner.FadeOut(fadeOutDuration);
+
+ // speed up the end sequence accordingly
+ switch (state)
+ {
+ case ArmedState.Hit:
+ spinner.ScaleTo(spinner.Scale * 1.2f, fadeOutDuration * 2, Easing.Out);
+ break;
+ case ArmedState.Miss:
+ spinner.ScaleTo(spinner.Scale * 0.8f, fadeOutDuration * 2, Easing.In);
+ break;
+ }
+
+ spinner.Expire();
+ }
+
+ break;
+ }
+ }
}
public class OsuModHardRock : ModHardRock, IApplicableToHitObject
@@ -51,11 +127,6 @@ namespace osu.Game.Rulesets.Osu.Mods
slider.ControlPoints = newControlPoints;
slider.Curve?.Calculate(); // Recalculate the slider curve
}
-
- public void ApplyToHitObjects(RulesetContainer rulesetContainer)
- {
-
- }
}
public class OsuModSuddenDeath : ModSuddenDeath
@@ -96,7 +167,6 @@ namespace osu.Game.Rulesets.Osu.Mods
public class OsuModPerfect : ModPerfect
{
-
}
public class OsuModSpunOut : Mod
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
index a973d2b580..6220bbd120 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
@@ -6,8 +6,8 @@ using osu.Framework.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
using OpenTK;
-using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu.Judgements;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
@@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private readonly NumberPiece number;
private readonly GlowPiece glow;
- public DrawableHitCircle(OsuHitObject h) : base(h)
+ public DrawableHitCircle(HitCircle h) : base(h)
{
Origin = Anchor.Centre;
@@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
},
number = new NumberPiece
{
- Text = h is Spinner ? "S" : (HitObject.ComboIndex + 1).ToString(),
+ Text = (HitObject.ComboIndex + 1).ToString(),
},
ring = new RingPiece(),
flash = new FlashPiece(),
@@ -88,25 +88,27 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
base.UpdatePreemptState();
- ApproachCircle.FadeIn(Math.Min(TIME_FADEIN * 2, TIME_PREEMPT));
+ ApproachCircle.FadeIn(Math.Min(FadeInDuration * 2, TIME_PREEMPT));
ApproachCircle.ScaleTo(1.1f, TIME_PREEMPT);
}
protected override void UpdateCurrentState(ArmedState state)
{
- double duration = ((HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime) - HitObject.StartTime;
-
- glow.Delay(duration).FadeOut(400);
+ glow.FadeOut(400);
switch (state)
{
case ArmedState.Idle:
- this.Delay(duration + TIME_PREEMPT).FadeOut(TIME_FADEOUT);
+ this.Delay(TIME_PREEMPT).FadeOut(500);
+
Expire(true);
+
+ // override lifetime end as FadeIn may have been changed externally, causing out expiration to be too early.
+ LifetimeEnd = HitObject.StartTime + HitObject.HitWindowFor(HitResult.Miss);
break;
case ArmedState.Miss:
ApproachCircle.FadeOut(50);
- this.FadeOut(TIME_FADEOUT / 5);
+ this.FadeOut(100);
Expire();
break;
case ArmedState.Hit:
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs
index 3e0c23a1ab..f5f0300ae1 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs
@@ -12,7 +12,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
public const float TIME_PREEMPT = 600;
public const float TIME_FADEIN = 400;
- public const float TIME_FADEOUT = 500;
+
+ ///
+ /// The number of milliseconds used to fade in.
+ ///
+ public virtual double FadeInDuration { get; set; } = TIME_FADEIN;
+
+ public override bool IsPresent => base.IsPresent || State.Value == ArmedState.Idle && Time.Current >= HitObject.StartTime - TIME_PREEMPT;
protected DrawableOsuHitObject(OsuHitObject hitObject)
: base(hitObject)
@@ -37,10 +43,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
}
}
- protected virtual void UpdatePreemptState()
- {
- this.FadeIn(TIME_FADEIN);
- }
+ protected virtual void UpdatePreemptState() => this.FadeIn(FadeInDuration);
protected virtual void UpdateCurrentState(ArmedState state)
{
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs
index 7755a54e88..f16a41519e 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs
@@ -2,10 +2,10 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
-using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Judgements;
using OpenTK;
using osu.Game.Rulesets.Judgements;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
@@ -24,4 +24,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
base.LoadComplete();
}
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs
index a9b63ea642..477ced01c6 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs
@@ -7,6 +7,7 @@ using osu.Game.Rulesets.Objects.Drawables;
using OpenTK;
using osu.Game.Graphics;
using osu.Game.Rulesets.Osu.Judgements;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
@@ -24,19 +25,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
this.repeatPoint = repeatPoint;
this.drawableSlider = drawableSlider;
- AutoSizeAxes = Axes.Both;
+ Size = new Vector2(32 * repeatPoint.Scale);
+
Blending = BlendingMode.Additive;
Origin = Anchor.Centre;
- Scale = new Vector2(0.5f);
Children = new Drawable[]
{
new SpriteIcon
{
- Icon = FontAwesome.fa_eercast,
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- Size = new Vector2(32),
+ RelativeSizeAxes = Axes.Both,
+ Icon = FontAwesome.fa_eercast
}
};
}
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
index 41d5ef1b02..5a8bcae277 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
@@ -10,6 +10,7 @@ using System.Linq;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Osu.Judgements;
using osu.Framework.Graphics.Primitives;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
@@ -17,23 +18,24 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
private readonly Slider slider;
- private readonly DrawableHitCircle initialCircle;
+ public readonly DrawableHitCircle InitialCircle;
private readonly List components = new List();
private readonly Container ticks;
private readonly Container repeatPoints;
- private readonly SliderBody body;
- private readonly SliderBall ball;
+ public readonly SliderBody Body;
+ public readonly SliderBall Ball;
- public DrawableSlider(Slider s) : base(s)
+ public DrawableSlider(Slider s)
+ : base(s)
{
slider = s;
Children = new Drawable[]
{
- body = new SliderBody(s)
+ Body = new SliderBody(s)
{
AccentColour = AccentColour,
Position = s.StackedPosition,
@@ -41,16 +43,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
},
ticks = new Container(),
repeatPoints = new Container(),
- ball = new SliderBall(s)
+ Ball = new SliderBall(s)
{
Scale = new Vector2(s.Scale),
AccentColour = AccentColour,
AlwaysPresent = true,
Alpha = 0
},
- initialCircle = new DrawableHitCircle(new HitCircle
+ InitialCircle = new DrawableHitCircle(new HitCircle
{
- //todo: avoid creating this temporary HitCircle.
StartTime = s.StartTime,
Position = s.StackedPosition,
ComboIndex = s.ComboIndex,
@@ -61,16 +62,16 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
})
};
- components.Add(body);
- components.Add(ball);
+ components.Add(Body);
+ components.Add(Ball);
- AddNested(initialCircle);
+ AddNested(InitialCircle);
var repeatDuration = s.Curve.Distance / s.Velocity;
foreach (var tick in s.NestedHitObjects.OfType())
{
var repeatStartTime = s.StartTime + tick.RepeatIndex * repeatDuration;
- var fadeInTime = repeatStartTime + (tick.StartTime - repeatStartTime) / 2 - (tick.RepeatIndex == 0 ? TIME_FADEIN : TIME_FADEIN / 2);
+ var fadeInTime = repeatStartTime + (tick.StartTime - repeatStartTime) / 2 - (tick.RepeatIndex == 0 ? FadeInDuration : FadeInDuration / 2);
var fadeOutTime = repeatStartTime + repeatDuration;
var drawableTick = new DrawableSliderTick(tick)
@@ -87,7 +88,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
foreach (var repeatPoint in s.NestedHitObjects.OfType())
{
var repeatStartTime = s.StartTime + repeatPoint.RepeatIndex * repeatDuration;
- var fadeInTime = repeatStartTime + (repeatPoint.StartTime - repeatStartTime) / 2 - (repeatPoint.RepeatIndex == 0 ? TIME_FADEIN : TIME_FADEIN / 2);
+ var fadeInTime = repeatStartTime + (repeatPoint.StartTime - repeatStartTime) / 2 - (repeatPoint.RepeatIndex == 0 ? FadeInDuration : FadeInDuration / 2);
var fadeOutTime = repeatStartTime + repeatDuration;
var drawableRepeatPoint = new DrawableRepeatPoint(repeatPoint, this)
@@ -105,11 +106,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private int currentRepeat;
public bool Tracking;
+ public override double FadeInDuration
+ {
+ get { return base.FadeInDuration; }
+ set { InitialCircle.FadeInDuration = base.FadeInDuration = value; }
+ }
+
protected override void Update()
{
base.Update();
- Tracking = ball.Tracking;
+ Tracking = Ball.Tracking;
double progress = MathHelper.Clamp((Time.Current - slider.StartTime) / slider.Duration, 0, 1);
@@ -120,11 +127,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
currentRepeat = repeat;
//todo: we probably want to reconsider this before adding scoring, but it looks and feels nice.
- if (!initialCircle.Judgements.Any(j => j.IsHit))
- initialCircle.Position = slider.Curve.PositionAt(progress);
+ if (!InitialCircle.Judgements.Any(j => j.IsHit))
+ InitialCircle.Position = slider.Curve.PositionAt(progress);
foreach (var c in components) c.UpdateProgress(progress, repeat);
- foreach (var t in ticks.Children) t.Tracking = ball.Tracking;
+ foreach (var t in ticks.Children) t.Tracking = Ball.Tracking;
}
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
@@ -133,13 +140,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
var judgementsCount = ticks.Children.Count + repeatPoints.Children.Count + 1;
var judgementsHit = ticks.Children.Count(t => t.Judgements.Any(j => j.IsHit)) + repeatPoints.Children.Count(t => t.Judgements.Any(j => j.IsHit));
- if (initialCircle.Judgements.Any(j => j.IsHit))
+ if (InitialCircle.Judgements.Any(j => j.IsHit))
judgementsHit++;
var hitFraction = (double)judgementsHit / judgementsCount;
- if (hitFraction == 1 && initialCircle.Judgements.Any(j => j.Result == HitResult.Great))
+ if (hitFraction == 1 && InitialCircle.Judgements.Any(j => j.Result == HitResult.Great))
AddJudgement(new OsuJudgement { Result = HitResult.Great });
- else if (hitFraction >= 0.5 && initialCircle.Judgements.Any(j => j.Result >= HitResult.Good))
+ else if (hitFraction >= 0.5 && InitialCircle.Judgements.Any(j => j.Result >= HitResult.Good))
AddJudgement(new OsuJudgement { Result = HitResult.Good });
else if (hitFraction > 0)
AddJudgement(new OsuJudgement { Result = HitResult.Meh });
@@ -150,21 +157,21 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected override void UpdateCurrentState(ArmedState state)
{
- ball.FadeIn();
+ Ball.FadeIn();
using (BeginDelayedSequence(slider.Duration, true))
{
- body.FadeOut(160);
- ball.FadeOut(160);
+ Body.FadeOut(160);
+ Ball.FadeOut(160);
this.FadeOut(800)
.Expire();
}
}
- public Drawable ProxiedLayer => initialCircle.ApproachCircle;
+ public Drawable ProxiedLayer => InitialCircle.ApproachCircle;
- public override Vector2 SelectionPoint => ToScreenSpace(body.Position);
- public override Quad SelectionQuad => body.PathDrawQuad;
+ public override Vector2 SelectionPoint => ToScreenSpace(Body.Position);
+ public override Quad SelectionQuad => Body.PathDrawQuad;
}
}
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs
index 7199691ae6..bce7ef6141 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs
@@ -8,6 +8,7 @@ using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Osu.Judgements;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
index 054a2067ec..5351ad50c4 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
@@ -13,6 +13,7 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Allocation;
using osu.Game.Rulesets.Osu.Judgements;
using osu.Game.Screens.Ranking;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
@@ -20,13 +21,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
private readonly Spinner spinner;
- private readonly SpinnerDisc disc;
- private readonly SpinnerTicks ticks;
+ public readonly SpinnerDisc Disc;
+ public readonly SpinnerTicks Ticks;
private readonly SpinnerSpmCounter spmCounter;
private readonly Container mainContainer;
- private readonly SpinnerBackground background;
+ public readonly SpinnerBackground Background;
private readonly Container circleContainer;
private readonly CirclePiece circle;
private readonly GlowPiece glow;
@@ -84,20 +85,20 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
RelativeSizeAxes = Axes.Y,
Children = new Drawable[]
{
- background = new SpinnerBackground
+ Background = new SpinnerBackground
{
Alpha = 0.6f,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
- disc = new SpinnerDisc(spinner)
+ Disc = new SpinnerDisc(spinner)
{
Scale = Vector2.Zero,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
circleContainer.CreateProxy(),
- ticks = new SpinnerTicks
+ Ticks = new SpinnerTicks
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@@ -114,22 +115,22 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
};
}
- public float Progress => MathHelper.Clamp(disc.RotationAbsolute / 360 / spinner.SpinsRequired, 0, 1);
+ public float Progress => MathHelper.Clamp(Disc.RotationAbsolute / 360 / spinner.SpinsRequired, 0, 1);
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
{
if (Time.Current < HitObject.StartTime) return;
- if (Progress >= 1 && !disc.Complete)
+ if (Progress >= 1 && !Disc.Complete)
{
- disc.Complete = true;
+ Disc.Complete = true;
const float duration = 200;
- disc.FadeAccent(completeColour, duration);
+ Disc.FadeAccent(completeColour, duration);
- background.FadeAccent(completeColour, duration);
- background.FadeOut(duration);
+ Background.FadeAccent(completeColour, duration);
+ Background.FadeOut(duration);
circle.FadeColour(completeColour, duration);
glow.FadeColour(completeColour, duration);
@@ -153,20 +154,20 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
normalColour = baseColour;
- background.AccentColour = normalColour;
+ Background.AccentColour = normalColour;
completeColour = colours.YellowLight.Opacity(0.75f);
- disc.AccentColour = fillColour;
+ Disc.AccentColour = fillColour;
circle.Colour = colours.BlueDark;
glow.Colour = colours.BlueDark;
}
protected override void Update()
{
- disc.Tracking = OsuActionInputManager.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton);
- if (!spmCounter.IsPresent && disc.Tracking)
- spmCounter.FadeIn(TIME_FADEIN);
+ Disc.Tracking = OsuActionInputManager.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton);
+ if (!spmCounter.IsPresent && Disc.Tracking)
+ spmCounter.FadeIn(FadeInDuration);
base.Update();
}
@@ -175,14 +176,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
base.UpdateAfterChildren();
- circle.Rotation = disc.Rotation;
- ticks.Rotation = disc.Rotation;
- spmCounter.SetRotation(disc.RotationAbsolute);
+ circle.Rotation = Disc.Rotation;
+ Ticks.Rotation = Disc.Rotation;
+ spmCounter.SetRotation(Disc.RotationAbsolute);
float relativeCircleScale = spinner.Scale * circle.DrawHeight / mainContainer.DrawHeight;
- disc.ScaleTo(relativeCircleScale + (1 - relativeCircleScale) * Progress, 200, Easing.OutQuint);
+ Disc.ScaleTo(relativeCircleScale + (1 - relativeCircleScale) * Progress, 200, Easing.OutQuint);
- symbol.RotateTo(disc.Rotation / 2, 500, Easing.OutQuint);
+ symbol.RotateTo(Disc.Rotation / 2, 500, Easing.OutQuint);
}
protected override void UpdatePreemptState()
@@ -192,7 +193,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
circleContainer.ScaleTo(spinner.Scale * 0.3f);
circleContainer.ScaleTo(spinner.Scale, TIME_PREEMPT / 1.4f, Easing.OutQuint);
- disc.RotateTo(-720);
+ Disc.RotateTo(-720);
symbol.RotateTo(-720);
mainContainer
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs
index ca75a61738..9f54ce3fa3 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs
@@ -26,6 +26,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
private const float idle_alpha = 0.2f;
private const float tracking_alpha = 0.4f;
+ public override bool IsPresent => true; // handle input when hidden
+
public SpinnerDisc(Spinner s)
{
spinner = s;
diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs
index 7532387aa2..a3a6527b31 100644
--- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs
+++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs
@@ -7,7 +7,7 @@ using OpenTK;
using osu.Game.Rulesets.Objects.Types;
using OpenTK.Graphics;
using osu.Game.Beatmaps.ControlPoints;
-using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Objects
{
diff --git a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs
index f82c6ce3b2..ba774e887f 100644
--- a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs
+++ b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs
@@ -9,9 +9,9 @@ using osu.Game.Rulesets.Osu.Objects.Drawables;
using System;
using System.Diagnostics;
using osu.Framework.Graphics;
-using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Replays;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Osu.Replays
{
diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs
index 2cf321da50..38c602bc42 100644
--- a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs
+++ b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs
@@ -41,10 +41,10 @@ namespace osu.Game.Rulesets.Osu.Scoring
mods = Score.Mods;
accuracy = Score.Accuracy;
scoreMaxCombo = Score.MaxCombo;
- count300 = Convert.ToInt32(Score.Statistics["300"]);
- count100 = Convert.ToInt32(Score.Statistics["100"]);
- count50 = Convert.ToInt32(Score.Statistics["50"]);
- countMiss = Convert.ToInt32(Score.Statistics["x"]);
+ count300 = Convert.ToInt32(Score.Statistics[HitResult.Great]);
+ count100 = Convert.ToInt32(Score.Statistics[HitResult.Good]);
+ count50 = Convert.ToInt32(Score.Statistics[HitResult.Meh]);
+ countMiss = Convert.ToInt32(Score.Statistics[HitResult.Miss]);
// Don't count scores made with supposedly unranked mods
if (mods.Any(m => !m.Ranked))
diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs
index ad9737af52..7520e1801c 100644
--- a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs
+++ b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs
@@ -6,7 +6,6 @@ using System.Linq;
using osu.Framework.Extensions;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Judgements;
-using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Judgements;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
@@ -33,8 +32,7 @@ namespace osu.Game.Rulesets.Osu.Scoring
foreach (var obj in beatmap.HitObjects)
{
- var slider = obj as Slider;
- if (slider != null)
+ if (obj is Slider slider)
{
// Head
AddJudgement(new OsuJudgement { Result = HitResult.Great });
@@ -64,10 +62,10 @@ namespace osu.Game.Rulesets.Osu.Scoring
{
base.PopulateScore(score);
- score.Statistics[@"300"] = scoreResultCounts.GetOrDefault(HitResult.Great);
- score.Statistics[@"100"] = scoreResultCounts.GetOrDefault(HitResult.Good);
- score.Statistics[@"50"] = scoreResultCounts.GetOrDefault(HitResult.Meh);
- score.Statistics[@"x"] = scoreResultCounts.GetOrDefault(HitResult.Miss);
+ score.Statistics[HitResult.Great] = scoreResultCounts.GetOrDefault(HitResult.Great);
+ score.Statistics[HitResult.Good] = scoreResultCounts.GetOrDefault(HitResult.Good);
+ score.Statistics[HitResult.Meh] = scoreResultCounts.GetOrDefault(HitResult.Meh);
+ score.Statistics[HitResult.Miss] = scoreResultCounts.GetOrDefault(HitResult.Miss);
}
protected override void OnNewJudgement(Judgement judgement)
diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs
index ef0bffa14e..cdce19ad21 100644
--- a/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs
+++ b/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs
@@ -11,60 +11,106 @@ using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Tests.Visual;
using OpenTK;
+using osu.Game.Rulesets.Osu.Mods;
+using OpenTK.Graphics;
+using osu.Game.Rulesets.Osu.Judgements;
+using System.Collections.Generic;
+using System;
namespace osu.Game.Rulesets.Osu.Tests
{
[Ignore("getting CI working")]
public class TestCaseHitCircle : OsuTestCase
{
+ public override IReadOnlyList RequiredTypes => new[]
+ {
+ typeof(HitCircle),
+ typeof(OsuModHidden),
+ typeof(DrawableHitCircle)
+ };
+
private readonly Container content;
protected override Container Content => content;
private bool auto;
+ private bool hidden;
private int depthIndex;
+ private int circleSize;
+ private float circleScale = 1;
public TestCaseHitCircle()
{
base.Content.Add(content = new OsuInputManager(new RulesetInfo { ID = 0 }));
- AddStep("Single", () => addSingle());
- AddStep("Stream", addStream);
+ AddStep("Single", () => testSingle());
+ AddStep("Stream", testStream);
AddToggleStep("Auto", v => auto = v);
+ AddToggleStep("Hidden", v => hidden = v);
+ AddSliderStep("CircleSize", 0, 10, 0, s => circleSize = s);
+ AddSliderStep("CircleScale", 0.5f, 2, 1, s => circleScale = s);
}
- private void addSingle(double timeOffset = 0, Vector2? positionOffset = null)
+ private void testSingle(double timeOffset = 0, Vector2? positionOffset = null)
{
positionOffset = positionOffset ?? Vector2.Zero;
var circle = new HitCircle
{
StartTime = Time.Current + 1000 + timeOffset,
- Position = positionOffset.Value
+ Position = positionOffset.Value,
+ ComboColour = Color4.LightSeaGreen
};
- circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = 0 });
+ circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = circleSize });
- var drawable = new DrawableHitCircle(circle)
+ var drawable = new TestDrawableHitCircle(circle, auto)
{
Anchor = Anchor.Centre,
+ Scale = new Vector2(circleScale),
Depth = depthIndex++
};
if (auto)
drawable.State.Value = ArmedState.Hit;
+ if (hidden)
+ new OsuModHidden().ApplyToDrawableHitObjects(new [] { drawable });
+
Add(drawable);
}
- private void addStream()
+ private void testStream()
{
Vector2 pos = Vector2.Zero;
for (int i = 0; i <= 1000; i += 100)
{
- addSingle(i, pos);
+ testSingle(i, pos);
pos += new Vector2(10);
}
}
+
+ private class TestDrawableHitCircle : DrawableHitCircle
+ {
+ private readonly bool auto;
+
+ public TestDrawableHitCircle(HitCircle h, bool auto) : base(h)
+ {
+ this.auto = auto;
+ }
+
+ protected override void CheckForJudgements(bool userTriggered, double timeOffset)
+ {
+ if (auto && !userTriggered && timeOffset > 0)
+ {
+ // pretend we really hit it
+ AddJudgement(new OsuJudgement
+ {
+ Result = HitObject.ScoreResultForOffset(timeOffset)
+ });
+ }
+ base.CheckForJudgements(userTriggered, timeOffset);
+ }
+ }
}
}
diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs
index 7ce9c35bd5..5b6b357351 100644
--- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs
+++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs
@@ -13,37 +13,52 @@ using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Tests.Visual;
using OpenTK;
+using osu.Game.Rulesets.Osu.Mods;
+using OpenTK.Graphics;
namespace osu.Game.Rulesets.Osu.Tests
{
[Ignore("getting CI working")]
public class TestCaseSlider : OsuTestCase
{
- public override IReadOnlyList RequiredTypes => new[] { typeof(DrawableSlider) };
+ public override IReadOnlyList RequiredTypes => new[]
+ {
+ typeof(Slider),
+ typeof(HitCircle),
+ typeof(OsuModHidden),
+ typeof(DrawableSlider),
+ typeof(DrawableHitCircle),
+ typeof(DrawableSliderTick),
+ typeof(DrawableRepeatPoint)
+ };
private readonly Container content;
protected override Container Content => content;
+ private bool hidden;
+ private int repeats;
+ private int depthIndex;
+ private int circleSize;
+ private float circleScale = 1;
private double speedMultiplier = 2;
private double sliderMultiplier = 2;
- private int depthIndex;
public TestCaseSlider()
{
base.Content.Add(content = new OsuInputManager(new RulesetInfo { ID = 0 }));
- AddStep("Single", () => addSingle());
- AddStep("Repeated (1)", () => addRepeated(1));
- AddStep("Repeated (2)", () => addRepeated(2));
- AddStep("Repeated (3)", () => addRepeated(3));
- AddStep("Repeated (4)", () => addRepeated(4));
- AddStep("Stream", addStream);
-
- AddSliderStep("SpeedMultiplier", 0.01, 10, 2, s => speedMultiplier = s);
- AddSliderStep("SliderMultiplier", 0.01, 10, 2, s => sliderMultiplier = s);
+ AddStep("Single", () => testSingle());
+ AddStep("Stream", testStream);
+ AddStep("Repeated", () => testRepeated(repeats));
+ AddToggleStep("Hidden", v => hidden = v);
+ AddSliderStep("Repeats", 1, 10, 1, s => repeats = s);
+ AddSliderStep("CircleSize", 0, 10, 0, s => circleSize = s);
+ AddSliderStep("CircleScale", 0.5f, 2, 1, s => circleScale = s);
+ AddSliderStep("SpeedMultiplier", 0.1, 10, 2, s => speedMultiplier = s);
+ AddSliderStep("SliderMultiplier", 0.1, 10, 2, s => sliderMultiplier = s);
}
- private void addSingle(double timeOffset = 0, Vector2? positionOffset = null)
+ private void testSingle(double timeOffset = 0, Vector2? positionOffset = null)
{
positionOffset = positionOffset ?? Vector2.Zero;
@@ -51,32 +66,19 @@ namespace osu.Game.Rulesets.Osu.Tests
{
StartTime = Time.Current + 1000 + timeOffset,
Position = new Vector2(-200, 0) + positionOffset.Value,
+ ComboColour = Color4.LightSeaGreen,
ControlPoints = new List
{
new Vector2(-200, 0) + positionOffset.Value,
new Vector2(400, 0) + positionOffset.Value,
},
- Distance = 400,
+ Distance = 400
};
- var cpi = new ControlPointInfo();
- cpi.DifficultyPoints.Add(new DifficultyControlPoint { SpeedMultiplier = speedMultiplier });
-
- var difficulty = new BeatmapDifficulty
- {
- SliderMultiplier = (float)sliderMultiplier,
- CircleSize = 0
- };
-
- slider.ApplyDefaults(cpi, difficulty);
- Add(new DrawableSlider(slider)
- {
- Anchor = Anchor.Centre,
- Depth = depthIndex++
- });
+ addSlider(slider);
}
- private void addRepeated(int repeats)
+ private void testRepeated(int repeats)
{
// The first run through the slider is considered a repeat
repeats++;
@@ -89,6 +91,7 @@ namespace osu.Game.Rulesets.Osu.Tests
{
StartTime = Time.Current + 1000,
Position = new Vector2(-200, 0),
+ ComboColour = Color4.LightSeaGreen,
ControlPoints = new List
{
new Vector2(-200, 0),
@@ -99,32 +102,45 @@ namespace osu.Game.Rulesets.Osu.Tests
RepeatSamples = repeatSamples
};
+ addSlider(slider);
+ }
+
+ private void testStream()
+ {
+ Vector2 pos = Vector2.Zero;
+
+ for (int i = 0; i <= 1000; i += 100)
+ {
+ testSingle(i, pos);
+ pos += new Vector2(10);
+ }
+ }
+
+ private void addSlider(Slider slider)
+ {
var cpi = new ControlPointInfo();
cpi.DifficultyPoints.Add(new DifficultyControlPoint { SpeedMultiplier = speedMultiplier });
var difficulty = new BeatmapDifficulty
{
SliderMultiplier = (float)sliderMultiplier,
- CircleSize = 0
+ CircleSize = circleSize
};
slider.ApplyDefaults(cpi, difficulty);
- Add(new DrawableSlider(slider)
+
+ var drawable = new DrawableSlider(slider)
{
Anchor = Anchor.Centre,
+ Scale = new Vector2(circleScale),
Depth = depthIndex++
- });
- }
+ };
- private void addStream()
- {
- Vector2 pos = Vector2.Zero;
+ if (hidden)
+ new OsuModHidden().ApplyToDrawableHitObjects(new [] { drawable });
- for (int i = 0; i <= 1000; i += 100)
- {
- addSingle(i, pos);
- pos += new Vector2(10);
- }
+ Add(drawable);
}
}
+
}
diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs
index 76cc70effd..c4ee56455a 100644
--- a/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs
+++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs
@@ -1,11 +1,15 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using System;
+using System.Collections.Generic;
using NUnit.Framework;
+using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
+using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Tests.Visual;
@@ -15,30 +19,47 @@ namespace osu.Game.Rulesets.Osu.Tests
[Ignore("getting CI working")]
public class TestCaseSpinner : OsuTestCase
{
+ public override IReadOnlyList RequiredTypes => new[]
+{
+ typeof(Spinner),
+ typeof(OsuModHidden),
+ typeof(DrawableSpinner)
+ };
+
private readonly Container content;
protected override Container Content => content;
+ private bool hidden;
private int depthIndex;
+ private int circleSize;
+ private float circleScale = 1;
public TestCaseSpinner()
{
base.Content.Add(content = new OsuInputManager(new RulesetInfo { ID = 0 }));
- AddStep("Single", addSingle);
+ AddStep("Single", testSingle);
+ AddToggleStep("Hidden", v => hidden = v);
+ AddSliderStep("CircleSize", 0, 10, 0, s => circleSize = s);
+ AddSliderStep("CircleScale", 0.5f, 2, 1, s => circleScale = s);
}
- private void addSingle()
+ private void testSingle()
{
var spinner = new Spinner { StartTime = Time.Current + 1000, EndTime = Time.Current + 4000 };
- spinner.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = 0 });
+ spinner.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = circleSize });
var drawable = new DrawableSpinner(spinner)
{
Anchor = Anchor.Centre,
+ Scale = new Vector2(circleScale),
Depth = depthIndex++
};
+ if (hidden)
+ new OsuModHidden().ApplyToDrawableHitObjects(new [] { drawable });
+
Add(drawable);
}
}
diff --git a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs
index 7c9cbd63fc..f37b87e533 100644
--- a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs
+++ b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs
@@ -35,16 +35,13 @@ namespace osu.Game.Rulesets.Osu.UI
protected override DrawableHitObject GetVisualRepresentation(OsuHitObject h)
{
- var circle = h as HitCircle;
- if (circle != null)
+ if (h is HitCircle circle)
return new DrawableHitCircle(circle);
- var slider = h as Slider;
- if (slider != null)
+ if (h is Slider slider)
return new DrawableSlider(slider);
- var spinner = h as Spinner;
- if (spinner != null)
+ if (h is Spinner spinner)
return new DrawableSpinner(spinner);
return null;
}
diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj
index 245f3eed91..785c3e17fb 100644
--- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj
+++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj
@@ -38,7 +38,7 @@
True
- $(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll
+ $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll
True
diff --git a/osu.Game.Rulesets.Osu/packages.config b/osu.Game.Rulesets.Osu/packages.config
index 2369f7529b..b39a85a382 100644
--- a/osu.Game.Rulesets.Osu/packages.config
+++ b/osu.Game.Rulesets.Osu/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs
index c9daef8c99..ce5be8d148 100644
--- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs
+++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.Judgements
{
@@ -20,4 +20,4 @@ namespace osu.Game.Rulesets.Taiko.Judgements
}
}
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs
index 3cd134f3f7..70cdd1fe0e 100644
--- a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs
+++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Judgements;
-using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.Judgements
{
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs
index 75e988ced6..f5bafefd0b 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs
@@ -13,6 +13,7 @@ using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Judgements;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs
index e662f61bbe..a741e35963 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs
@@ -4,6 +4,7 @@
using System;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko.Judgements;
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs
index fd35f0eaec..0c10c7142e 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs
@@ -5,6 +5,7 @@ using System;
using System.Linq;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko.Judgements;
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs
index cda82afe0e..249bb41d91 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs
@@ -3,7 +3,7 @@
using System;
using System.Linq;
-using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko.Judgements;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs
index 5ca33aaea2..26e6585fb9 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs
@@ -14,6 +14,7 @@ using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Taiko.Judgements;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs
index df9ce5e2eb..3848e36fc9 100644
--- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs
+++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs
@@ -4,7 +4,6 @@
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Judgements;
-using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko.Judgements;
using osu.Game.Rulesets.Taiko.Objects;
diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs
index b1e6e9c4ce..1f13864c2a 100644
--- a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs
+++ b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs
@@ -20,6 +20,7 @@ using osu.Game.Rulesets.Taiko.UI;
using osu.Game.Tests.Beatmaps;
using osu.Game.Tests.Visual;
using OpenTK;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.Tests
{
diff --git a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs
index 41b66c286b..0b67613ec3 100644
--- a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs
+++ b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs
@@ -6,6 +6,7 @@ using osu.Framework.Allocation;
using osu.Game.Graphics;
using osu.Game.Rulesets.Judgements;
using osu.Framework.Graphics;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.UI
{
@@ -49,4 +50,4 @@ namespace osu.Game.Rulesets.Taiko.UI
base.LoadComplete();
}
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj
index 7e44e85e52..1aed86f8f9 100644
--- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj
+++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj
@@ -37,7 +37,7 @@
True
- $(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll
+ $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll
True
diff --git a/osu.Game.Rulesets.Taiko/packages.config b/osu.Game.Rulesets.Taiko/packages.config
index 2369f7529b..b39a85a382 100644
--- a/osu.Game.Rulesets.Taiko/packages.config
+++ b/osu.Game.Rulesets.Taiko/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs
index cef8797f20..ad15833569 100644
--- a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs
+++ b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs
@@ -160,9 +160,9 @@ namespace osu.Game.Tests.Visual
};
foreach(var s in scores)
{
- s.Statistics.Add("300", RNG.Next(2000));
- s.Statistics.Add("100", RNG.Next(2000));
- s.Statistics.Add("50", RNG.Next(2000));
+ s.Statistics.Add(HitResult.Great, RNG.Next(2000));
+ s.Statistics.Add(HitResult.Good, RNG.Next(2000));
+ s.Statistics.Add(HitResult.Meh, RNG.Next(2000));
}
anotherScores = new[]
@@ -272,9 +272,9 @@ namespace osu.Game.Tests.Visual
};
foreach (var s in anotherScores)
{
- s.Statistics.Add("300", RNG.Next(2000));
- s.Statistics.Add("100", RNG.Next(2000));
- s.Statistics.Add("50", RNG.Next(2000));
+ s.Statistics.Add(HitResult.Great, RNG.Next(2000));
+ s.Statistics.Add(HitResult.Good, RNG.Next(2000));
+ s.Statistics.Add(HitResult.Meh, RNG.Next(2000));
}
topScore = new OnlineScore
@@ -299,9 +299,9 @@ namespace osu.Game.Tests.Visual
TotalScore = 987654321,
Accuracy = 0.8487,
};
- topScore.Statistics.Add("300", RNG.Next(2000));
- topScore.Statistics.Add("100", RNG.Next(2000));
- topScore.Statistics.Add("50", RNG.Next(2000));
+ topScore.Statistics.Add(HitResult.Great, RNG.Next(2000));
+ topScore.Statistics.Add(HitResult.Good, RNG.Next(2000));
+ topScore.Statistics.Add(HitResult.Meh, RNG.Next(2000));
}
[BackgroundDependencyLoader]
diff --git a/osu.Game.Tests/Visual/TestCaseResults.cs b/osu.Game.Tests/Visual/TestCaseResults.cs
index d0c5aa4939..28ce9524e0 100644
--- a/osu.Game.Tests/Visual/TestCaseResults.cs
+++ b/osu.Game.Tests/Visual/TestCaseResults.cs
@@ -15,6 +15,15 @@ namespace osu.Game.Tests.Visual
{
private BeatmapManager beatmaps;
+ public override IReadOnlyList RequiredTypes => new[]
+ {
+ typeof(Score),
+ typeof(Results),
+ typeof(ResultsPage),
+ typeof(ResultsPageScore),
+ typeof(ResultsPageRanking)
+ };
+
[BackgroundDependencyLoader]
private void load(BeatmapManager beatmaps)
{
@@ -41,12 +50,12 @@ namespace osu.Game.Tests.Visual
MaxCombo = 123,
Rank = ScoreRank.A,
Date = DateTimeOffset.Now,
- Statistics = new Dictionary
+ Statistics = new Dictionary
{
- { "300", 50 },
- { "100", 20 },
- { "50", 50 },
- { "x", 1 }
+ { HitResult.Great, 50 },
+ { HitResult.Good, 20 },
+ { HitResult.Meh, 50 },
+ { HitResult.Miss, 1 }
},
User = new User
{
diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj
index df66896d9b..8c04874e75 100644
--- a/osu.Game.Tests/osu.Game.Tests.csproj
+++ b/osu.Game.Tests/osu.Game.Tests.csproj
@@ -38,7 +38,7 @@
True
- $(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll
+ $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll
True
diff --git a/osu.Game.Tests/packages.config b/osu.Game.Tests/packages.config
index c2056e09a8..9fbb0537bc 100644
--- a/osu.Game.Tests/packages.config
+++ b/osu.Game.Tests/packages.config
@@ -6,6 +6,6 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
-
+
\ No newline at end of file
diff --git a/osu.Game/Online/API/Requests/GetScoresRequest.cs b/osu.Game/Online/API/Requests/GetScoresRequest.cs
index 065c770738..14605081b6 100644
--- a/osu.Game/Online/API/Requests/GetScoresRequest.cs
+++ b/osu.Game/Online/API/Requests/GetScoresRequest.cs
@@ -122,26 +122,26 @@ namespace osu.Game.Online.API.Requests
{
foreach (var kvp in value)
{
- string key = kvp.Key;
- switch (key)
+ HitResult newKey;
+ switch (kvp.Key)
{
case @"count_300":
- key = @"300";
+ newKey = HitResult.Great;
break;
case @"count_100":
- key = @"100";
+ newKey = HitResult.Good;
break;
case @"count_50":
- key = @"50";
+ newKey = HitResult.Meh;
break;
case @"count_miss":
- key = @"x";
+ newKey = HitResult.Miss;
break;
default:
continue;
}
- Statistics.Add(key, kvp.Value);
+ Statistics.Add(newKey, kvp.Value);
}
}
}
diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs
index 5a3aba7b43..2d5913d8ca 100644
--- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs
+++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs
@@ -12,6 +12,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Online.API.Requests;
using osu.Game.Overlays.Profile.Sections.Ranks;
using osu.Game.Rulesets.Mods;
+using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
using osu.Game.Screens.Select.Leaderboards;
using osu.Game.Users;
@@ -48,7 +49,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
Font = @"Exo2.0-RegularItalic",
Margin = new MarginPadding { Left = side_margin }
},
- new DrawableFlag(score.User.Country?.FlagName)
+ new DrawableFlag(score.User.Country)
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
@@ -104,7 +105,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
- Text = $"{score.Statistics["300"]}/{score.Statistics["100"]}/{score.Statistics["50"]}",
+ Text = $"{score.Statistics[HitResult.Great]}/{score.Statistics[HitResult.Good]}/{score.Statistics[HitResult.Meh]}",
Font = @"Exo2.0-RegularItalic",
Margin = new MarginPadding { Right = side_margin }
},
diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs
index 833ed94c0f..e3b878587d 100644
--- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs
+++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs
@@ -52,13 +52,13 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
score = value;
avatar.User = username.User = score.User;
- flag.FlagName = score.User.Country?.FlagName;
+ flag.Country = score.User.Country;
date.Text = $@"achieved {score.Date:MMM d, yyyy}";
rank.UpdateRank(score.Rank);
totalScore.Value = $@"{score.TotalScore:N0}";
accuracy.Value = $@"{score.Accuracy:P2}";
- statistics.Value = $"{score.Statistics["300"]}/{score.Statistics["100"]}/{score.Statistics["50"]}";
+ statistics.Value = $"{score.Statistics[HitResult.Great]}/{score.Statistics[HitResult.Good]}/{score.Statistics[HitResult.Meh]}";
modsContainer.Clear();
foreach (Mod mod in score.Mods)
diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs
index 77b7c3add2..35c2e9234d 100644
--- a/osu.Game/Overlays/Mods/ModButton.cs
+++ b/osu.Game/Overlays/Mods/ModButton.cs
@@ -204,13 +204,13 @@ namespace osu.Game.Overlays.Mods
{
iconsContainer.AddRange(new[]
{
- backgroundIcon = new ModIcon(Mods[1])
+ backgroundIcon = new PassThroughTooltipModIcon(Mods[1])
{
Origin = Anchor.BottomRight,
Anchor = Anchor.BottomRight,
Position = new Vector2(1.5f),
},
- foregroundIcon = new ModIcon(Mods[0])
+ foregroundIcon = new PassThroughTooltipModIcon(Mods[0])
{
Origin = Anchor.BottomRight,
Anchor = Anchor.BottomRight,
@@ -220,7 +220,7 @@ namespace osu.Game.Overlays.Mods
}
else
{
- iconsContainer.Add(foregroundIcon = new ModIcon(Mod)
+ iconsContainer.Add(foregroundIcon = new PassThroughTooltipModIcon(Mod)
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
@@ -259,5 +259,14 @@ namespace osu.Game.Overlays.Mods
Mod = mod;
}
+
+ private class PassThroughTooltipModIcon : ModIcon
+ {
+ public override string TooltipText => null;
+
+ public PassThroughTooltipModIcon(Mod mod) : base(mod)
+ {
+ }
+ }
}
}
diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs
index 18e77cf186..960bb60287 100644
--- a/osu.Game/Overlays/Profile/ProfileHeader.cs
+++ b/osu.Game/Overlays/Profile/ProfileHeader.cs
@@ -109,7 +109,7 @@ namespace osu.Game.Overlays.Profile
Origin = Anchor.BottomLeft,
Y = -48,
},
- countryFlag = new DrawableFlag(user.Country?.FlagName)
+ countryFlag = new DrawableFlag(user.Country)
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
@@ -333,7 +333,7 @@ namespace osu.Game.Overlays.Profile
{
infoTextLeft.AddText("from ");
infoTextLeft.AddText(user.Country.FullName, boldItalic);
- countryFlag.FlagName = user.Country.FlagName;
+ countryFlag.Country = user.Country;
}
infoTextLeft.NewParagraph();
diff --git a/osu.Game/Overlays/Profile/SupporterIcon.cs b/osu.Game/Overlays/Profile/SupporterIcon.cs
index 570d5a13bb..b5cd94e54b 100644
--- a/osu.Game/Overlays/Profile/SupporterIcon.cs
+++ b/osu.Game/Overlays/Profile/SupporterIcon.cs
@@ -1,20 +1,23 @@
-// Copyright (c) 2007-2017 ppy Pty Ltd .
+// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
namespace osu.Game.Overlays.Profile
{
- public class SupporterIcon : CircularContainer
+ public class SupporterIcon : CircularContainer, IHasTooltip
{
private readonly Box background;
+ public string TooltipText => "osu!supporter";
+
public SupporterIcon()
{
Masking = true;
diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs
index 5ab4b7636b..3d7880f56f 100644
--- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs
+++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs
@@ -9,7 +9,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
-using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Judgements
{
diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs
index d804111a7f..f8c9b9734f 100644
--- a/osu.Game/Rulesets/Judgements/Judgement.cs
+++ b/osu.Game/Rulesets/Judgements/Judgement.cs
@@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Judgements
{
diff --git a/osu.Game/Rulesets/Mods/IApplicableToDrawableHitObject.cs b/osu.Game/Rulesets/Mods/IApplicableToDrawableHitObject.cs
new file mode 100644
index 0000000000..1024d5686d
--- /dev/null
+++ b/osu.Game/Rulesets/Mods/IApplicableToDrawableHitObject.cs
@@ -0,0 +1,20 @@
+// Copyright (c) 2007-2017 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using System.Collections.Generic;
+using osu.Game.Rulesets.Objects.Drawables;
+
+namespace osu.Game.Rulesets.Mods
+{
+ ///
+ /// An interface for s that can be applied to s.
+ ///
+ public interface IApplicableToDrawableHitObjects
+ {
+ ///
+ /// Applies this to a list of s.
+ ///
+ /// The list of s to apply to.
+ void ApplyToDrawableHitObjects(IEnumerable drawables);
+ }
+}
diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs
index c118cd5bee..45a7275c53 100644
--- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs
+++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs
@@ -16,6 +16,7 @@ using osu.Game.Graphics;
using osu.Framework.Configuration;
using OpenTK;
using osu.Framework.Graphics.Primitives;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Objects.Drawables
{
@@ -122,6 +123,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
{
UpdateState(state);
+ // apply any custom state overrides
+ ApplyCustomUpdateState?.Invoke(this, state);
+
if (State == ArmedState.Hit)
PlaySamples();
};
@@ -243,9 +247,15 @@ namespace osu.Game.Rulesets.Objects.Drawables
h.OnJudgement += (d, j) => OnJudgement?.Invoke(d, j);
h.OnJudgementRemoved += (d, j) => OnJudgementRemoved?.Invoke(d, j);
+ h.ApplyCustomUpdateState += (d, s) => ApplyCustomUpdateState?.Invoke(d, s);
nestedHitObjects.Add(h);
}
+ ///
+ /// Bind to apply a custom state which can override the default implementation.
+ ///
+ public event Action ApplyCustomUpdateState;
+
protected abstract void UpdateState(ArmedState state);
}
}
diff --git a/osu.Game/Rulesets/Objects/Drawables/HitResult.cs b/osu.Game/Rulesets/Scoring/HitResult.cs
similarity index 91%
rename from osu.Game/Rulesets/Objects/Drawables/HitResult.cs
rename to osu.Game/Rulesets/Scoring/HitResult.cs
index 961843cbd7..49ab9fd2f0 100644
--- a/osu.Game/Rulesets/Objects/Drawables/HitResult.cs
+++ b/osu.Game/Rulesets/Scoring/HitResult.cs
@@ -3,7 +3,7 @@
using System.ComponentModel;
-namespace osu.Game.Rulesets.Objects.Drawables
+namespace osu.Game.Rulesets.Scoring
{
public enum HitResult
{
diff --git a/osu.Game/Rulesets/Scoring/Score.cs b/osu.Game/Rulesets/Scoring/Score.cs
index 6a06f364c6..025335ba55 100644
--- a/osu.Game/Rulesets/Scoring/Score.cs
+++ b/osu.Game/Rulesets/Scoring/Score.cs
@@ -40,6 +40,6 @@ namespace osu.Game.Rulesets.Scoring
public DateTimeOffset Date;
- public Dictionary Statistics = new Dictionary();
+ public Dictionary Statistics = new Dictionary();
}
}
diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs
index e129a81116..23c4464bb1 100644
--- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs
+++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs
@@ -8,7 +8,6 @@ using osu.Game.Beatmaps;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.UI;
-using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Scoring
{
diff --git a/osu.Game/Rulesets/UI/ModIcon.cs b/osu.Game/Rulesets/UI/ModIcon.cs
index 5ca3d9521b..90f63aeab6 100644
--- a/osu.Game/Rulesets/UI/ModIcon.cs
+++ b/osu.Game/Rulesets/UI/ModIcon.cs
@@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.UI
private readonly ModType type;
- public string TooltipText { get; }
+ public virtual string TooltipText { get; }
public ModIcon(Mod mod)
{
diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs
index fe7c0c05ed..40a37c689b 100644
--- a/osu.Game/Rulesets/UI/RulesetContainer.cs
+++ b/osu.Game/Rulesets/UI/RulesetContainer.cs
@@ -260,6 +260,9 @@ namespace osu.Game.Rulesets.UI
}
Playfield.PostProcess();
+
+ foreach (var mod in Mods.OfType())
+ mod.ApplyToDrawableHitObjects(Playfield.HitObjects.Objects);
}
protected override void Update()
diff --git a/osu.Game/Screens/Multiplayer/ParticipantInfo.cs b/osu.Game/Screens/Multiplayer/ParticipantInfo.cs
index fa48287ce1..2197b7477c 100644
--- a/osu.Game/Screens/Multiplayer/ParticipantInfo.cs
+++ b/osu.Game/Screens/Multiplayer/ParticipantInfo.cs
@@ -27,7 +27,7 @@ namespace osu.Game.Screens.Multiplayer
set
{
host.Text = value.Username;
- flagContainer.Children = new[] { new DrawableFlag(value.Country?.FlagName) { RelativeSizeAxes = Axes.Both } };
+ flagContainer.Children = new[] { new DrawableFlag(value.Country) { RelativeSizeAxes = Axes.Both } };
}
}
diff --git a/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs b/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs
index 06ef87276a..351db533f3 100644
--- a/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs
+++ b/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs
@@ -7,10 +7,10 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Rulesets.Judgements;
-using osu.Game.Rulesets.Objects.Drawables;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Graphics.Shapes;
+using osu.Game.Rulesets.Scoring;
namespace osu.Game.Screens.Play.HUD
{
diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs
index 25a42cae1c..0d29b74dfd 100644
--- a/osu.Game/Screens/Ranking/ResultsPageScore.cs
+++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs
@@ -23,6 +23,7 @@ using osu.Game.Screens.Play;
using osu.Game.Screens.Select.Leaderboards;
using osu.Game.Users;
using osu.Framework.Graphics.Shapes;
+using osu.Framework.Extensions;
namespace osu.Game.Screens.Ranking
{
@@ -163,7 +164,7 @@ namespace osu.Game.Screens.Ranking
}
};
- statisticsContainer.ChildrenEnumerable = Score.Statistics.Select(s => new DrawableScoreStatistic(s));
+ statisticsContainer.ChildrenEnumerable = Score.Statistics.OrderByDescending(p => p.Key).Select(s => new DrawableScoreStatistic(s));
}
protected override void LoadComplete()
@@ -186,9 +187,9 @@ namespace osu.Game.Screens.Ranking
private class DrawableScoreStatistic : Container
{
- private readonly KeyValuePair statistic;
+ private readonly KeyValuePair statistic;
- public DrawableScoreStatistic(KeyValuePair statistic)
+ public DrawableScoreStatistic(KeyValuePair statistic)
{
this.statistic = statistic;
@@ -209,7 +210,7 @@ namespace osu.Game.Screens.Ranking
Origin = Anchor.TopCentre,
},
new OsuSpriteText {
- Text = statistic.Key,
+ Text = statistic.Key.GetDescription(),
Colour = colours.Gray7,
Font = @"Exo2.0-Bold",
Y = 26,
@@ -250,16 +251,16 @@ namespace osu.Game.Screens.Ranking
{
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
- Text = datetime.ToString("HH:mm"),
- Padding = new MarginPadding { Left = 10, Right = 10, Top = 5, Bottom = 5 },
+ Text = datetime.ToShortDateString(),
+ Padding = new MarginPadding { Horizontal = 10, Vertical = 5 },
Colour = Color4.White,
},
new OsuSpriteText
{
Origin = Anchor.CentreRight,
Anchor = Anchor.CentreRight,
- Text = datetime.ToString("yyyy/MM/dd"),
- Padding = new MarginPadding { Left = 10, Right = 10, Top = 5, Bottom = 5 },
+ Text = datetime.ToShortTimeString(),
+ Padding = new MarginPadding { Horizontal = 10, Vertical = 5 },
Colour = Color4.White,
}
};
diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs
index 6c0cc341fd..cea658b06c 100644
--- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs
+++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs
@@ -46,7 +46,7 @@ namespace osu.Game.Screens.Select.Carousel
{
if (songSelect != null)
{
- startRequested = songSelect.Start;
+ startRequested = songSelect.FinaliseSelection;
editRequested = songSelect.Edit;
}
diff --git a/osu.Game/Screens/Select/EditSongSelect.cs b/osu.Game/Screens/Select/EditSongSelect.cs
index f02d25501e..37f2663d91 100644
--- a/osu.Game/Screens/Select/EditSongSelect.cs
+++ b/osu.Game/Screens/Select/EditSongSelect.cs
@@ -7,6 +7,10 @@ namespace osu.Game.Screens.Select
{
protected override bool ShowFooter => false;
- protected override void Start() => Exit();
+ protected override bool OnSelectionFinalised()
+ {
+ Exit();
+ return true;
+ }
}
}
diff --git a/osu.Game/Screens/Select/ImportFromStablePopup.cs b/osu.Game/Screens/Select/ImportFromStablePopup.cs
index 489ab79fa4..03e9462636 100644
--- a/osu.Game/Screens/Select/ImportFromStablePopup.cs
+++ b/osu.Game/Screens/Select/ImportFromStablePopup.cs
@@ -14,7 +14,7 @@ namespace osu.Game.Screens.Select
HeaderText = @"You have no beatmaps!";
BodyText = "An existing copy of osu! was found, though.\nWould you like to import your beatmaps?";
- Icon = FontAwesome.fa_trash_o;
+ Icon = FontAwesome.fa_plane;
Buttons = new PopupDialogButton[]
{
diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs
index 03466439ad..e0c9a3e04e 100644
--- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs
+++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs
@@ -145,7 +145,7 @@ namespace osu.Game.Screens.Select.Leaderboards
Masking = true,
Children = new Drawable[]
{
- new DrawableFlag(Score.User?.Country?.FlagName)
+ new DrawableFlag(Score.User?.Country)
{
Width = 30,
RelativeSizeAxes = Axes.Y,
diff --git a/osu.Game/Screens/Select/MatchSongSelect.cs b/osu.Game/Screens/Select/MatchSongSelect.cs
index 898c195432..9143da326d 100644
--- a/osu.Game/Screens/Select/MatchSongSelect.cs
+++ b/osu.Game/Screens/Select/MatchSongSelect.cs
@@ -5,6 +5,10 @@ namespace osu.Game.Screens.Select
{
public class MatchSongSelect : SongSelect
{
- protected override void Start() => Exit();
+ protected override bool OnSelectionFinalised()
+ {
+ Exit();
+ return true;
+ }
}
}
diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs
index 727cdb9959..87b3485dc1 100644
--- a/osu.Game/Screens/Select/PlaySongSelect.cs
+++ b/osu.Game/Screens/Select/PlaySongSelect.cs
@@ -124,9 +124,9 @@ namespace osu.Game.Screens.Select
return false;
}
- protected override void Start()
+ protected override bool OnSelectionFinalised()
{
- if (player != null) return;
+ if (player != null) return false;
// Ctrl+Enter should start map with autoplay enabled.
if (GetContainingInputManager().CurrentState?.Keyboard.ControlPressed == true)
@@ -147,7 +147,12 @@ namespace osu.Game.Screens.Select
sampleConfirm?.Play();
- LoadComponentAsync(player = new PlayerLoader(new Player()), l => Push(player));
+ LoadComponentAsync(player = new PlayerLoader(new Player()), l =>
+ {
+ if (IsCurrentScreen) Push(player);
+ });
+
+ return true;
}
}
}
diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs
index 9e5a2fa633..b89a8a4e73 100644
--- a/osu.Game/Screens/Select/SongSelect.cs
+++ b/osu.Game/Screens/Select/SongSelect.cs
@@ -227,13 +227,18 @@ namespace osu.Game.Screens.Select
Push(new Editor());
}
- public void Start(BeatmapInfo beatmap)
+ ///
+ /// Call to make a selection and perform the default action for this SongSelect.
+ ///
+ /// An optional beatmap to override the current carousel selection.
+ public void FinaliseSelection(BeatmapInfo beatmap = null)
{
// if we have a pending filter operation, we want to run it now.
// it could change selection (ie. if the ruleset has been changed).
Carousel.FlushPendingFilterOperations();
- Carousel.SelectBeatmap(beatmap);
+ if (beatmap != null)
+ Carousel.SelectBeatmap(beatmap);
if (selectionChangedDebounce?.Completed == false)
{
@@ -242,13 +247,14 @@ namespace osu.Game.Screens.Select
selectionChangedDebounce = null;
}
- Start();
+ OnSelectionFinalised();
}
///
/// Called when a selection is made.
///
- protected abstract void Start();
+ /// If a resultant action occurred that takes the user away from SongSelect.
+ protected abstract bool OnSelectionFinalised();
private ScheduledDelegate selectionChangedDebounce;
@@ -339,7 +345,7 @@ namespace osu.Game.Screens.Select
logo.Action = () =>
{
- Start();
+ FinaliseSelection();
return false;
};
}
@@ -462,7 +468,7 @@ namespace osu.Game.Screens.Select
{
case Key.KeypadEnter:
case Key.Enter:
- Start();
+ FinaliseSelection();
return true;
case Key.Delete:
if (state.Keyboard.ShiftPressed)
diff --git a/osu.Game/Users/Country.cs b/osu.Game/Users/Country.cs
index 0c0d12c1cc..46ddaee637 100644
--- a/osu.Game/Users/Country.cs
+++ b/osu.Game/Users/Country.cs
@@ -6,6 +6,7 @@ using Newtonsoft.Json;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
@@ -26,36 +27,30 @@ namespace osu.Game.Users
public string FlagName;
}
- public class DrawableFlag : Container
+ public class DrawableFlag : Container, IHasTooltip
{
private readonly Sprite sprite;
private TextureStore textures;
- private string flagName;
- public string FlagName
+ private Country country;
+ public Country Country
{
- get { return flagName; }
+ get { return country; }
set
{
- if (value == flagName) return;
- flagName = value;
- sprite.Texture = textures.Get($@"Flags/{flagName}");
+ if (value == country)
+ return;
+
+ country = value;
+ sprite.Texture = getFlagTexture();
}
}
- [BackgroundDependencyLoader]
- private void load(TextureStore ts)
- {
- if (ts == null)
- throw new ArgumentNullException(nameof(ts));
+ public string TooltipText => country?.FullName;
- textures = ts;
- sprite.Texture = textures.Get($@"Flags/{flagName}");
- }
-
- public DrawableFlag(string name = null)
+ public DrawableFlag(Country country = null)
{
- flagName = name ?? @"__";
+ this.country = country;
Children = new Drawable[]
{
@@ -65,5 +60,17 @@ namespace osu.Game.Users
},
};
}
+
+ [BackgroundDependencyLoader]
+ private void load(TextureStore ts)
+ {
+ if (ts == null)
+ throw new ArgumentNullException(nameof(ts));
+
+ textures = ts;
+ sprite.Texture = getFlagTexture();
+ }
+
+ private Texture getFlagTexture() => textures.Get($@"Flags/{country?.FlagName ?? @"__"}");
}
}
diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs
index a2cc8e8d49..e0a4e3184d 100644
--- a/osu.Game/Users/UserPanel.cs
+++ b/osu.Game/Users/UserPanel.cs
@@ -114,7 +114,7 @@ namespace osu.Game.Users
Spacing = new Vector2(5f, 0f),
Children = new Drawable[]
{
- new DrawableFlag(user.Country?.FlagName)
+ new DrawableFlag(user.Country)
{
Width = 30f,
RelativeSizeAxes = Axes.Y,
diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj
index ff7b4fae23..49978693b3 100644
--- a/osu.Game/osu.Game.csproj
+++ b/osu.Game/osu.Game.csproj
@@ -144,7 +144,7 @@
True
- $(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll
+ $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll
True
@@ -311,6 +311,7 @@
+
@@ -612,7 +613,7 @@
-
+
diff --git a/osu.Game/packages.config b/osu.Game/packages.config
index 3ba50388e8..e35f06dd67 100644
--- a/osu.Game/packages.config
+++ b/osu.Game/packages.config
@@ -66,7 +66,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
-
+