diff --git a/osu-resources b/osu-resources
index 651e598b01..694cb03f19 160000
--- a/osu-resources
+++ b/osu-resources
@@ -1 +1 @@
-Subproject commit 651e598b016b43e31ab1c1b29d5b30c92361b8d9
+Subproject commit 694cb03f19c93106ed0f2593f3e506e835fb652a
diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs
index 79ac24a1da..93fd3935c6 100644
--- a/osu.Desktop/OsuGameDesktop.cs
+++ b/osu.Desktop/OsuGameDesktop.cs
@@ -10,7 +10,7 @@ using osu.Desktop.Overlays;
using osu.Framework.Graphics.Containers;
using osu.Framework.Platform;
using osu.Game;
-using OpenTK.Input;
+using osuTK.Input;
using Microsoft.Win32;
using osu.Desktop.Updater;
using osu.Framework;
diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs
index 96857d6b4f..f31bba1e1e 100644
--- a/osu.Desktop/Overlays/VersionManager.cs
+++ b/osu.Desktop/Overlays/VersionManager.cs
@@ -15,8 +15,8 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using osu.Game.Overlays.Notifications;
using osu.Game.Utils;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Desktop.Overlays
{
diff --git a/osu.Desktop/Updater/SquirrelUpdateManager.cs b/osu.Desktop/Updater/SquirrelUpdateManager.cs
index 1f8bff74f4..19383d617f 100644
--- a/osu.Desktop/Updater/SquirrelUpdateManager.cs
+++ b/osu.Desktop/Updater/SquirrelUpdateManager.cs
@@ -2,6 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
+using System.IO;
+using System.Reflection;
using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@@ -12,9 +14,10 @@ using osu.Game;
using osu.Game.Graphics;
using osu.Game.Overlays;
using osu.Game.Overlays.Notifications;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using Squirrel;
+using LogLevel = Splat.LogLevel;
namespace osu.Desktop.Updater
{
@@ -35,7 +38,10 @@ namespace osu.Desktop.Updater
notificationOverlay = notification;
if (game.IsDeployedBuild)
+ {
+ Splat.Locator.CurrentMutable.Register(() => new SquirrelLogger(), typeof(Splat.ILogger));
Schedule(() => Task.Run(() => checkForUpdateAsync()));
+ }
}
private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null)
@@ -159,5 +165,31 @@ namespace osu.Desktop.Updater
});
}
}
+
+ private class SquirrelLogger : Splat.ILogger, IDisposable
+ {
+ private readonly string path;
+ private readonly object locker = new object();
+ public LogLevel Level { get; set; } = LogLevel.Info;
+
+ public SquirrelLogger()
+ {
+ var file = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "SquirrelSetupUpdater.log");
+ if (File.Exists(file)) File.Delete(file);
+ path = file;
+ }
+
+ public void Write(string message, LogLevel logLevel)
+ {
+ if (logLevel < Level)
+ return;
+
+ lock (locker) File.AppendAllText(path, message + "\r\n");
+ }
+
+ public void Dispose()
+ {
+ }
+ }
}
}
diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj
index e1e59804e5..09bfdc67d4 100644
--- a/osu.Desktop/osu.Desktop.csproj
+++ b/osu.Desktop/osu.Desktop.csproj
@@ -27,7 +27,7 @@
-
+
diff --git a/osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs
index bea64302c3..fc3809fae4 100644
--- a/osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs
+++ b/osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs
@@ -9,7 +9,7 @@ using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Screens.Play;
using osu.Game.Tests.Visual;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Catch.Tests
{
diff --git a/osu.Game.Rulesets.Catch.Tests/TestCaseFruitObjects.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseFruitObjects.cs
index 5c41e4136c..7b6773ad58 100644
--- a/osu.Game.Rulesets.Catch.Tests/TestCaseFruitObjects.cs
+++ b/osu.Game.Rulesets.Catch.Tests/TestCaseFruitObjects.cs
@@ -10,7 +10,7 @@ using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.Objects.Drawable;
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
using osu.Game.Tests.Visual;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Catch.Tests
{
diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs
index c7ea29f8c0..22c1180c09 100644
--- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs
+++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs
@@ -8,7 +8,7 @@ using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Rulesets.Objects.Types;
-using OpenTK;
+using osuTK;
using osu.Game.Rulesets.Catch.MathUtils;
namespace osu.Game.Rulesets.Catch.Beatmaps
diff --git a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyHitObject.cs b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyHitObject.cs
index 720c1d8653..bd7796ed91 100644
--- a/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyHitObject.cs
+++ b/osu.Game.Rulesets.Catch/Difficulty/CatchDifficultyHitObject.cs
@@ -4,7 +4,7 @@
using System;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Catch.Difficulty
{
diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs b/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs
index 21e09f991c..9cfba0236a 100644
--- a/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs
+++ b/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs
@@ -1,12 +1,66 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using osu.Framework.Graphics;
+using osu.Game.Rulesets.Catch.Objects;
+using osu.Game.Rulesets.Catch.UI;
using osu.Game.Rulesets.Mods;
+using osu.Game.Rulesets.UI;
+using osuTK;
namespace osu.Game.Rulesets.Catch.Mods
{
- public class CatchModFlashlight : ModFlashlight
+ public class CatchModFlashlight : ModFlashlight
{
public override double ScoreMultiplier => 1.12;
+
+ private const float default_flashlight_size = 350;
+
+ public override Flashlight CreateFlashlight() => new CatchFlashlight(playfield);
+
+ private CatchPlayfield playfield;
+
+ public override void ApplyToRulesetContainer(RulesetContainer rulesetContainer)
+ {
+ playfield = (CatchPlayfield)rulesetContainer.Playfield;
+ base.ApplyToRulesetContainer(rulesetContainer);
+ }
+
+ private class CatchFlashlight : Flashlight
+ {
+ private readonly CatchPlayfield playfield;
+
+ public CatchFlashlight(CatchPlayfield playfield)
+ {
+ this.playfield = playfield;
+ FlashlightSize = new Vector2(0, getSizeFor(0));
+ }
+
+ protected override void Update()
+ {
+ base.Update();
+
+ var catcherArea = playfield.CatcherArea;
+
+ FlashlightPosition = catcherArea.ToSpaceOfOtherDrawable(catcherArea.MovableCatcher.DrawPosition, this);
+ }
+
+ private float getSizeFor(int combo)
+ {
+ if (combo > 200)
+ return default_flashlight_size * 0.8f;
+ else if (combo > 100)
+ return default_flashlight_size * 0.9f;
+ else
+ return default_flashlight_size;
+ }
+
+ protected override void OnComboChange(int newCombo)
+ {
+ this.TransformTo(nameof(FlashlightSize), new Vector2(0, getSizeFor(newCombo)), FLASHLIGHT_FADE_DURATION);
+ }
+
+ protected override string FragmentShader => "CircularFlashlight";
+ }
}
}
diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs
index 9e840301fd..2db252ebc6 100644
--- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs
+++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs
@@ -2,8 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Objects.Types;
diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs
index 5c8a7c4a7c..a896d13132 100644
--- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs
+++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs
@@ -4,8 +4,8 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Catch.Objects.Drawable
{
diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs
index 4603148114..4bd50f29f6 100644
--- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs
+++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs
@@ -9,8 +9,8 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.MathUtils;
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Catch.Objects.Drawable
{
@@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
private void load()
{
// todo: this should come from the skin.
- AccentColour = colourForRrepesentation(HitObject.VisualRepresentation);
+ AccentColour = colourForRepresentation(HitObject.VisualRepresentation);
InternalChildren = new[]
{
@@ -275,7 +275,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
border.Alpha = (float)MathHelper.Clamp((HitObject.StartTime - Time.Current) / 500, 0, 1);
}
- private Color4 colourForRrepesentation(FruitVisualRepresentation representation)
+ private Color4 colourForRepresentation(FruitVisualRepresentation representation)
{
switch (representation)
{
diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableTinyDroplet.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableTinyDroplet.cs
index e0f02454c4..2f167121aa 100644
--- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableTinyDroplet.cs
+++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableTinyDroplet.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Catch.Objects.Drawable
{
diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs
index 250dc8c7f1..f21c14f076 100644
--- a/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs
+++ b/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs
@@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Catch.Objects.Drawable.Pieces
{
diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs
index 4d1d9d7e5d..0697a72325 100644
--- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs
+++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs
@@ -10,7 +10,7 @@ using osu.Game.Rulesets.Catch.Objects.Drawable;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.UI.Scrolling;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Catch.UI
{
@@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.UI
{
public const float BASE_WIDTH = 512;
- private readonly CatcherArea catcherArea;
+ internal readonly CatcherArea CatcherArea;
public CatchPlayfield(BeatmapDifficulty difficulty, Func> getVisualRepresentation)
{
@@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Catch.UI
{
RelativeSizeAxes = Axes.Both,
},
- catcherArea = new CatcherArea(difficulty)
+ CatcherArea = new CatcherArea(difficulty)
{
GetVisualRepresentation = getVisualRepresentation,
ExplodingFruitTarget = explodingFruitContainer,
@@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Catch.UI
};
}
- public bool CheckIfWeCanCatch(CatchHitObject obj) => catcherArea.AttemptCatch(obj);
+ public bool CheckIfWeCanCatch(CatchHitObject obj) => CatcherArea.AttemptCatch(obj);
public override void Add(DrawableHitObject h)
{
@@ -63,6 +63,6 @@ namespace osu.Game.Rulesets.Catch.UI
}
private void onNewResult(DrawableHitObject judgedObject, JudgementResult result)
- => catcherArea.OnResult((DrawableCatchHitObject)judgedObject, result);
+ => CatcherArea.OnResult((DrawableCatchHitObject)judgedObject, result);
}
}
diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs
index 06453ac32d..3637fe0c36 100644
--- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs
+++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs
@@ -18,8 +18,8 @@ using osu.Game.Rulesets.Catch.Replays;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.UI;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Catch.UI
{
@@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Catch.UI
{
public const float CATCHER_SIZE = 100;
- protected readonly Catcher MovableCatcher;
+ protected internal readonly Catcher MovableCatcher;
public Func> GetVisualRepresentation;
diff --git a/osu.Game.Rulesets.Catch/UI/PlayfieldAdjustmentContainer.cs b/osu.Game.Rulesets.Catch/UI/PlayfieldAdjustmentContainer.cs
index ad0073ff12..fa1a7ee868 100644
--- a/osu.Game.Rulesets.Catch/UI/PlayfieldAdjustmentContainer.cs
+++ b/osu.Game.Rulesets.Catch/UI/PlayfieldAdjustmentContainer.cs
@@ -3,7 +3,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Catch.UI
{
diff --git a/osu.Game.Rulesets.Mania.Tests/ManiaPlacementBlueprintTestCase.cs b/osu.Game.Rulesets.Mania.Tests/ManiaPlacementBlueprintTestCase.cs
index 0c87978f15..b5c08d6837 100644
--- a/osu.Game.Rulesets.Mania.Tests/ManiaPlacementBlueprintTestCase.cs
+++ b/osu.Game.Rulesets.Mania.Tests/ManiaPlacementBlueprintTestCase.cs
@@ -11,8 +11,8 @@ using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Tests.Visual;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Tests
{
diff --git a/osu.Game.Rulesets.Mania.Tests/ManiaSelectionBlueprintTestCase.cs b/osu.Game.Rulesets.Mania.Tests/ManiaSelectionBlueprintTestCase.cs
new file mode 100644
index 0000000000..8c5299e1a2
--- /dev/null
+++ b/osu.Game.Rulesets.Mania.Tests/ManiaSelectionBlueprintTestCase.cs
@@ -0,0 +1,15 @@
+// Copyright (c) 2007-2018 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using osu.Framework.Allocation;
+using osu.Framework.Timing;
+using osu.Game.Tests.Visual;
+
+namespace osu.Game.Rulesets.Mania.Tests
+{
+ public abstract class ManiaSelectionBlueprintTestCase : SelectionBlueprintTestCase
+ {
+ [Cached(Type = typeof(IAdjustableClock))]
+ private readonly IAdjustableClock clock = new StopwatchClock();
+ }
+}
diff --git a/osu.Game.Rulesets.Mania.Tests/TestCaseColumn.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseColumn.cs
index 63724f8edf..eecc578861 100644
--- a/osu.Game.Rulesets.Mania.Tests/TestCaseColumn.cs
+++ b/osu.Game.Rulesets.Mania.Tests/TestCaseColumn.cs
@@ -15,8 +15,8 @@ using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.Mania.UI.Components;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Tests.Visual;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Tests
{
diff --git a/osu.Game.Rulesets.Mania.Tests/TestCaseHoldNoteSelectionBlueprint.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseHoldNoteSelectionBlueprint.cs
index 993f7520e8..756031a463 100644
--- a/osu.Game.Rulesets.Mania.Tests/TestCaseHoldNoteSelectionBlueprint.cs
+++ b/osu.Game.Rulesets.Mania.Tests/TestCaseHoldNoteSelectionBlueprint.cs
@@ -15,7 +15,7 @@ using osu.Game.Tests.Visual;
namespace osu.Game.Rulesets.Mania.Tests
{
- public class TestCaseHoldNoteSelectionBlueprint : SelectionBlueprintTestCase
+ public class TestCaseHoldNoteSelectionBlueprint : ManiaSelectionBlueprintTestCase
{
private readonly DrawableHoldNote drawableObject;
diff --git a/osu.Game.Rulesets.Mania.Tests/TestCaseNoteSelectionBlueprint.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseNoteSelectionBlueprint.cs
index fd26b93e5c..4023f97eb3 100644
--- a/osu.Game.Rulesets.Mania.Tests/TestCaseNoteSelectionBlueprint.cs
+++ b/osu.Game.Rulesets.Mania.Tests/TestCaseNoteSelectionBlueprint.cs
@@ -11,11 +11,11 @@ using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Tests.Visual;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Mania.Tests
{
- public class TestCaseNoteSelectionBlueprint : SelectionBlueprintTestCase
+ public class TestCaseNoteSelectionBlueprint : ManiaSelectionBlueprintTestCase
{
private readonly DrawableNote drawableObject;
diff --git a/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs
index a8b2b20fda..6344aee6bd 100644
--- a/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs
+++ b/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs
@@ -20,8 +20,8 @@ using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Tests.Visual;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Tests
{
diff --git a/osu.Game.Rulesets.Mania.Tests/TestCaseStage.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseStage.cs
index 02d5b13100..7acc37cb67 100644
--- a/osu.Game.Rulesets.Mania.Tests/TestCaseStage.cs
+++ b/osu.Game.Rulesets.Mania.Tests/TestCaseStage.cs
@@ -15,7 +15,7 @@ using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Tests.Visual;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Mania.Tests
{
diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs
index d86ebc9a09..2770a6ff5b 100644
--- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs
+++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs
@@ -12,7 +12,7 @@ using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Mania.Beatmaps.Patterns;
using osu.Game.Rulesets.Mania.MathUtils;
using osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy;
-using OpenTK;
+using osuTK;
using osu.Game.Audio;
namespace osu.Game.Rulesets.Mania.Beatmaps
diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs
index da1dd62cf5..8463e209e4 100644
--- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs
+++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs
@@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using OpenTK;
+using osuTK;
using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternGenerator.cs
index 7bd39adb45..f412e127c5 100644
--- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternGenerator.cs
+++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternGenerator.cs
@@ -7,7 +7,7 @@ using JetBrains.Annotations;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mania.MathUtils;
using osu.Game.Rulesets.Objects;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
{
diff --git a/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNotePlacementBlueprint.cs b/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNotePlacementBlueprint.cs
index 7d28a0cc1a..481c141b9f 100644
--- a/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNotePlacementBlueprint.cs
+++ b/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNotePlacementBlueprint.cs
@@ -7,7 +7,7 @@ using osu.Framework.Input.Events;
using osu.Game.Rulesets.Mania.Edit.Blueprints.Components;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.UI;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{
diff --git a/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNoteSelectionBlueprint.cs b/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNoteSelectionBlueprint.cs
index 35ce38dadb..4b78dd68cb 100644
--- a/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNoteSelectionBlueprint.cs
+++ b/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNoteSelectionBlueprint.cs
@@ -9,8 +9,8 @@ using osu.Game.Graphics;
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
using osu.Game.Rulesets.UI.Scrolling;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{
@@ -49,7 +49,6 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
base.Update();
Size = HitObject.DrawSize + new Vector2(0, HitObject.Tail.DrawHeight);
- Position = Parent.ToLocalSpace(HitObject.ScreenSpaceDrawQuad.TopLeft);
// This is a side-effect of not matching the hitobject's anchors/origins, which is kinda hard to do
// When scrolling upwards our origin is already at the top of the head note (which is the intended location),
diff --git a/osu.Game.Rulesets.Mania/Edit/Blueprints/ManiaPlacementBlueprint.cs b/osu.Game.Rulesets.Mania/Edit/Blueprints/ManiaPlacementBlueprint.cs
index 7d9bbc064b..c36c32bb84 100644
--- a/osu.Game.Rulesets.Mania/Edit/Blueprints/ManiaPlacementBlueprint.cs
+++ b/osu.Game.Rulesets.Mania/Edit/Blueprints/ManiaPlacementBlueprint.cs
@@ -9,7 +9,7 @@ using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.UI.Scrolling;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{
@@ -44,17 +44,13 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{
Column column = ColumnAt(e.ScreenSpaceMousePosition);
- if (column == null)
- SnappedMousePosition = e.MousePosition;
- else
- {
- SnappedWidth = column.DrawWidth;
+ if (column == null) return false;
- // Snap to the column
- var parentPos = Parent.ToLocalSpace(column.ToScreenSpace(new Vector2(column.DrawWidth / 2, 0)));
- SnappedMousePosition = new Vector2(parentPos.X, e.MousePosition.Y);
- }
+ SnappedWidth = column.DrawWidth;
+ // Snap to the column
+ var parentPos = Parent.ToLocalSpace(column.ToScreenSpace(new Vector2(column.DrawWidth / 2, 0)));
+ SnappedMousePosition = new Vector2(parentPos.X, e.MousePosition.Y);
return true;
}
diff --git a/osu.Game.Rulesets.Mania/Edit/Blueprints/ManiaSelectionBlueprint.cs b/osu.Game.Rulesets.Mania/Edit/Blueprints/ManiaSelectionBlueprint.cs
index 53f9dd8752..97817d5414 100644
--- a/osu.Game.Rulesets.Mania/Edit/Blueprints/ManiaSelectionBlueprint.cs
+++ b/osu.Game.Rulesets.Mania/Edit/Blueprints/ManiaSelectionBlueprint.cs
@@ -1,23 +1,79 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Input.Events;
+using osu.Framework.Timing;
using osu.Game.Rulesets.Edit;
+using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Objects.Drawables;
+using osu.Game.Rulesets.UI.Scrolling;
+using osuTK;
namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{
public class ManiaSelectionBlueprint : SelectionBlueprint
{
+ protected new DrawableManiaHitObject HitObject => (DrawableManiaHitObject)base.HitObject;
+
+ protected IClock EditorClock { get; private set; }
+
+ [Resolved]
+ private IScrollingInfo scrollingInfo { get; set; }
+
public ManiaSelectionBlueprint(DrawableHitObject hitObject)
: base(hitObject)
{
RelativeSizeAxes = Axes.None;
}
+ [BackgroundDependencyLoader]
+ private void load(IAdjustableClock clock)
+ {
+ EditorClock = clock;
+ }
+
+ protected override void Update()
+ {
+ base.Update();
+
+ Position = Parent.ToLocalSpace(HitObject.ToScreenSpace(Vector2.Zero));
+ }
+
public override void AdjustPosition(DragEvent dragEvent)
{
+ var objectParent = HitObject.Parent;
+
+ // Using the hitobject position is required since AdjustPosition can be invoked multiple times per frame
+ // without the position having been updated by the parenting ScrollingHitObjectContainer
+ HitObject.Y += dragEvent.Delta.Y;
+
+ float targetPosition;
+
+ // If we're scrolling downwards, a position of 0 is actually further away from the hit target
+ // so we need to flip the vertical coordinate in the hitobject container's space
+ if (scrollingInfo.Direction.Value == ScrollingDirection.Down)
+ targetPosition = -HitObject.Position.Y;
+ else
+ targetPosition = HitObject.Position.Y;
+
+ HitObject.HitObject.StartTime = scrollingInfo.Algorithm.TimeAt(targetPosition,
+ EditorClock.CurrentTime,
+ scrollingInfo.TimeRange.Value,
+ objectParent.DrawHeight);
+ }
+
+ public override void Show()
+ {
+ HitObject.AlwaysAlive = true;
+ base.Show();
+ }
+
+ public override void Hide()
+ {
+ HitObject.AlwaysAlive = false;
+ base.Hide();
}
}
}
diff --git a/osu.Game.Rulesets.Mania/Edit/Blueprints/NoteSelectionBlueprint.cs b/osu.Game.Rulesets.Mania/Edit/Blueprints/NoteSelectionBlueprint.cs
index 7df7924c51..440a539412 100644
--- a/osu.Game.Rulesets.Mania/Edit/Blueprints/NoteSelectionBlueprint.cs
+++ b/osu.Game.Rulesets.Mania/Edit/Blueprints/NoteSelectionBlueprint.cs
@@ -20,7 +20,6 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
base.Update();
Size = HitObject.DrawSize;
- Position = Parent.ToLocalSpace(HitObject.ScreenSpaceDrawQuad.TopLeft);
}
}
}
diff --git a/osu.Game.Rulesets.Mania/Edit/IManiaHitObjectComposer.cs b/osu.Game.Rulesets.Mania/Edit/IManiaHitObjectComposer.cs
index 6347370d72..977c7dd525 100644
--- a/osu.Game.Rulesets.Mania/Edit/IManiaHitObjectComposer.cs
+++ b/osu.Game.Rulesets.Mania/Edit/IManiaHitObjectComposer.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Mania.UI;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Mania.Edit
{
diff --git a/osu.Game.Rulesets.Mania/Edit/ManiaEditRulesetContainer.cs b/osu.Game.Rulesets.Mania/Edit/ManiaEditRulesetContainer.cs
index 2404297cc3..f605ad0a22 100644
--- a/osu.Game.Rulesets.Mania/Edit/ManiaEditRulesetContainer.cs
+++ b/osu.Game.Rulesets.Mania/Edit/ManiaEditRulesetContainer.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
-using OpenTK;
+using osuTK;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.UI;
diff --git a/osu.Game.Rulesets.Mania/Edit/ManiaHitObjectComposer.cs b/osu.Game.Rulesets.Mania/Edit/ManiaHitObjectComposer.cs
index ca952e914d..b74e1b81b5 100644
--- a/osu.Game.Rulesets.Mania/Edit/ManiaHitObjectComposer.cs
+++ b/osu.Game.Rulesets.Mania/Edit/ManiaHitObjectComposer.cs
@@ -12,33 +12,40 @@ using osu.Framework.Allocation;
using osu.Game.Rulesets.Mania.Edit.Blueprints;
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.UI;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Mania.Edit
{
[Cached(Type = typeof(IManiaHitObjectComposer))]
public class ManiaHitObjectComposer : HitObjectComposer, IManiaHitObjectComposer
{
+ protected new ManiaEditRulesetContainer RulesetContainer { get; private set; }
+
public ManiaHitObjectComposer(Ruleset ruleset)
: base(ruleset)
{
}
+ ///
+ /// Retrieves the column that intersects a screen-space position.
+ ///
+ /// The screen-space position.
+ /// The column which intersects with .
+ public Column ColumnAt(Vector2 screenSpacePosition) => RulesetContainer.GetColumnByPosition(screenSpacePosition);
+
private DependencyContainer dependencies;
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
=> dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
- public Column ColumnAt(Vector2 screenSpacePosition) => ((ManiaPlayfield)RulesetContainer.Playfield).GetColumnByPosition(screenSpacePosition);
-
protected override RulesetContainer CreateRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
{
- var rulesetContainer = new ManiaEditRulesetContainer(ruleset, beatmap);
+ RulesetContainer = new ManiaEditRulesetContainer(ruleset, beatmap);
// This is the earliest we can cache the scrolling info to ourselves, before masks are added to the hierarchy and inject it
- dependencies.CacheAs(rulesetContainer.ScrollingInfo);
+ dependencies.CacheAs(RulesetContainer.ScrollingInfo);
- return rulesetContainer;
+ return RulesetContainer;
}
protected override IReadOnlyList CompositionTools => new HitObjectCompositionTool[]
diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModFadeIn.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModFadeIn.cs
index 08815ede09..73942cbb53 100644
--- a/osu.Game.Rulesets.Mania/Mods/ManiaModFadeIn.cs
+++ b/osu.Game.Rulesets.Mania/Mods/ManiaModFadeIn.cs
@@ -3,6 +3,7 @@
using System;
using osu.Game.Graphics;
+using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mods;
namespace osu.Game.Rulesets.Mania.Mods
@@ -16,6 +17,6 @@ namespace osu.Game.Rulesets.Mania.Mods
public override string Description => @"Keys appear out of nowhere!";
public override double ScoreMultiplier => 1;
public override bool Ranked => true;
- public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) };
+ public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) };
}
}
diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs
index d7a1bc4fbe..cd84483eb9 100644
--- a/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs
+++ b/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs
@@ -2,13 +2,60 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
+using osu.Framework.Caching;
+using osu.Framework.Graphics;
+using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mods;
+using osuTK;
namespace osu.Game.Rulesets.Mania.Mods
{
- public class ManiaModFlashlight : ModFlashlight
+ public class ManiaModFlashlight : ModFlashlight
{
public override double ScoreMultiplier => 1;
public override Type[] IncompatibleMods => new[] { typeof(ModHidden) };
+
+ private const float default_flashlight_size = 180;
+
+ public override Flashlight CreateFlashlight() => new ManiaFlashlight();
+
+ private class ManiaFlashlight : Flashlight
+ {
+ private readonly Cached flashlightProperties = new Cached();
+
+ public ManiaFlashlight()
+ {
+ FlashlightSize = new Vector2(0, default_flashlight_size);
+ }
+
+ public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true)
+ {
+ if ((invalidation & Invalidation.DrawSize) > 0)
+ {
+ flashlightProperties.Invalidate();
+ }
+
+ return base.Invalidate(invalidation, source, shallPropagate);
+ }
+
+ protected override void Update()
+ {
+ base.Update();
+
+ if (!flashlightProperties.IsValid)
+ {
+ FlashlightSize = new Vector2(DrawWidth, FlashlightSize.Y);
+
+ FlashlightPosition = DrawPosition + DrawSize / 2;
+ flashlightProperties.Validate();
+ }
+ }
+
+ protected override void OnComboChange(int newCombo)
+ {
+ }
+
+ protected override string FragmentShader => "RectangularFlashlight";
+ }
}
}
diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModHidden.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModHidden.cs
index 2ef68a35fa..9bc2502a8f 100644
--- a/osu.Game.Rulesets.Mania/Mods/ManiaModHidden.cs
+++ b/osu.Game.Rulesets.Mania/Mods/ManiaModHidden.cs
@@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
+using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mods;
namespace osu.Game.Rulesets.Mania.Mods
@@ -10,6 +11,6 @@ namespace osu.Game.Rulesets.Mania.Mods
{
public override string Description => @"Keys fade out before you hit them!";
public override double ScoreMultiplier => 1;
- public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) };
+ public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) };
}
}
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs
index d0fc6aa3d6..cf718ebdb0 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs
@@ -1,11 +1,11 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Objects.Drawables;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Objects.Drawables
{
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs
index 6a0457efc6..5fcc71a039 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs
@@ -5,7 +5,7 @@ using System.Linq;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Bindings;
using osu.Game.Rulesets.Scoring;
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs
index 01d5bc6fd4..3e014ec35c 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs
@@ -2,8 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs
index 8c96c6dfe7..70ff7b4124 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs
@@ -12,6 +12,11 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
{
public abstract class DrawableManiaHitObject : DrawableHitObject
{
+ ///
+ /// Whether this should always remain alive.
+ ///
+ internal bool AlwaysAlive;
+
///
/// The which causes this to be hit.
///
@@ -34,6 +39,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
Direction.BindValueChanged(OnDirectionChanged, true);
}
+ protected override bool ShouldBeAlive => AlwaysAlive || base.ShouldBeAlive;
+
protected virtual void OnDirectionChanged(ScrollingDirection direction)
{
Anchor = Origin = direction == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre;
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs
index 7567f40b2f..423712b026 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Extensions.Color4Extensions;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Bindings;
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs
index 46779b8c14..6aafe3ff81 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs
@@ -3,7 +3,7 @@
using System;
using osu.Framework.Caching;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/GlowPiece.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/GlowPiece.cs
index 68c9ce07d4..3a524bfc90 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/GlowPiece.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/GlowPiece.cs
@@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
{
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/LaneGlowPiece.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/LaneGlowPiece.cs
index 445abc28e2..8325cb8ac0 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/LaneGlowPiece.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/LaneGlowPiece.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/NotePiece.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/NotePiece.cs
index b7c90e5144..26d5a7f188 100644
--- a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/NotePiece.cs
+++ b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/NotePiece.cs
@@ -3,7 +3,7 @@
using osu.Framework.Allocation;
using osu.Framework.Configuration;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs
index 4c1929f182..58e2066f72 100644
--- a/osu.Game.Rulesets.Mania/UI/Column.cs
+++ b/osu.Game.Rulesets.Mania/UI/Column.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Linq;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
@@ -13,7 +13,7 @@ using osu.Framework.Input.Bindings;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Mania.UI.Components;
using osu.Game.Rulesets.UI.Scrolling;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Mania.UI
{
@@ -145,6 +145,13 @@ namespace osu.Game.Rulesets.Mania.UI
HitObjectContainer.Add(hitObject);
}
+ public override void Remove(DrawableHitObject h)
+ {
+ h.OnNewResult -= OnNewResult;
+
+ HitObjectContainer.Remove(h);
+ }
+
internal void OnNewResult(DrawableHitObject judgedObject, JudgementResult result)
{
if (!result.IsHit || !judgedObject.DisplayResult || !DisplayJudgements)
@@ -176,6 +183,6 @@ namespace osu.Game.Rulesets.Mania.UI
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos)
// This probably shouldn't exist as is, but the columns in the stage are separated by a 1px border
- => DrawRectangle.Inflate(new Vector2(1, 0)).Contains(ToLocalSpace(screenSpacePos));
+ => DrawRectangle.Inflate(new Vector2(ManiaStage.COLUMN_SPACING / 2, 0)).Contains(ToLocalSpace(screenSpacePos));
}
}
diff --git a/osu.Game.Rulesets.Mania/UI/Components/ColumnBackground.cs b/osu.Game.Rulesets.Mania/UI/Components/ColumnBackground.cs
index 19cc8fffef..6aef158205 100644
--- a/osu.Game.Rulesets.Mania/UI/Components/ColumnBackground.cs
+++ b/osu.Game.Rulesets.Mania/UI/Components/ColumnBackground.cs
@@ -11,7 +11,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Bindings;
using osu.Game.Graphics;
using osu.Game.Rulesets.UI.Scrolling;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.UI.Components
{
diff --git a/osu.Game.Rulesets.Mania/UI/Components/ColumnHitObjectArea.cs b/osu.Game.Rulesets.Mania/UI/Components/ColumnHitObjectArea.cs
index 5a4adfd72e..f158d5be07 100644
--- a/osu.Game.Rulesets.Mania/UI/Components/ColumnHitObjectArea.cs
+++ b/osu.Game.Rulesets.Mania/UI/Components/ColumnHitObjectArea.cs
@@ -10,7 +10,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.UI.Scrolling;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.UI.Components
{
diff --git a/osu.Game.Rulesets.Mania/UI/Components/ColumnKeyArea.cs b/osu.Game.Rulesets.Mania/UI/Components/ColumnKeyArea.cs
index e30a033831..228e81fef3 100644
--- a/osu.Game.Rulesets.Mania/UI/Components/ColumnKeyArea.cs
+++ b/osu.Game.Rulesets.Mania/UI/Components/ColumnKeyArea.cs
@@ -11,8 +11,8 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Bindings;
using osu.Game.Graphics;
using osu.Game.Rulesets.UI.Scrolling;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.UI.Components
{
diff --git a/osu.Game.Rulesets.Mania/UI/HitExplosion.cs b/osu.Game.Rulesets.Mania/UI/HitExplosion.cs
index c74745868a..817b60d14a 100644
--- a/osu.Game.Rulesets.Mania/UI/HitExplosion.cs
+++ b/osu.Game.Rulesets.Mania/UI/HitExplosion.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@@ -9,7 +9,7 @@ using osu.Framework.MathUtils;
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
using osu.Game.Rulesets.Objects.Drawables;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Mania.UI
{
diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs
index 410c6aa908..32d8ef343f 100644
--- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs
+++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs
@@ -5,11 +5,12 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using System;
using System.Collections.Generic;
+using System.Linq;
using osu.Game.Rulesets.Mania.Beatmaps;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.UI.Scrolling;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Mania.UI
{
@@ -17,6 +18,8 @@ namespace osu.Game.Rulesets.Mania.UI
{
private readonly List stages = new List();
+ public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => stages.Any(s => s.ReceivePositionalInputAt(screenSpacePos));
+
public ManiaPlayfield(List stageDefinitions)
{
if (stageDefinitions == null)
@@ -52,6 +55,8 @@ namespace osu.Game.Rulesets.Mania.UI
public override void Add(DrawableHitObject h) => getStageByColumn(((ManiaHitObject)h.HitObject).Column).Add(h);
+ public override void Remove(DrawableHitObject h) => getStageByColumn(((ManiaHitObject)h.HitObject).Column).Remove(h);
+
public void Add(BarLine barline) => stages.ForEach(s => s.Add(barline));
///
diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs
index 321dd4e1cb..5263d4dcb9 100644
--- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs
+++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs
@@ -25,6 +25,7 @@ using osu.Game.Rulesets.Replays;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.UI.Scrolling;
+using osuTK;
namespace osu.Game.Rulesets.Mania.UI
{
@@ -80,6 +81,13 @@ namespace osu.Game.Rulesets.Mania.UI
Config.BindWith(ManiaSetting.ScrollTime, TimeRange);
}
+ ///
+ /// Retrieves the column that intersects a screen-space position.
+ ///
+ /// The screen-space position.
+ /// The column which intersects with .
+ public Column GetColumnByPosition(Vector2 screenSpacePosition) => Playfield.GetColumnByPosition(screenSpacePosition);
+
protected override Playfield CreatePlayfield() => new ManiaPlayfield(Beatmap.Stages)
{
Anchor = Anchor.Centre,
diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs
index d1ce8b8679..ab835cbbb3 100644
--- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs
+++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs
@@ -15,8 +15,8 @@ using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.UI.Scrolling;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.UI
{
@@ -25,6 +25,8 @@ namespace osu.Game.Rulesets.Mania.UI
///
public class ManiaStage : ScrollingPlayfield
{
+ public const float COLUMN_SPACING = 1;
+
public const float HIT_TARGET_POSITION = 50;
public IReadOnlyList Columns => columnFlow.Children;
@@ -40,6 +42,8 @@ namespace osu.Game.Rulesets.Mania.UI
private List normalColumnColours = new List();
private Color4 specialColumnColour;
+ public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Columns.Any(c => c.ReceivePositionalInputAt(screenSpacePos));
+
private readonly int firstColumnIndex;
public ManiaStage(int firstColumnIndex, StageDefinition definition, ref ManiaAction normalColumnStartAction, ref ManiaAction specialColumnStartAction)
@@ -84,8 +88,8 @@ namespace osu.Game.Rulesets.Mania.UI
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Direction = FillDirection.Horizontal,
- Padding = new MarginPadding { Left = 1, Right = 1 },
- Spacing = new Vector2(1, 0)
+ Padding = new MarginPadding { Left = COLUMN_SPACING, Right = COLUMN_SPACING },
+ Spacing = new Vector2(COLUMN_SPACING, 0)
},
}
},
@@ -157,6 +161,15 @@ namespace osu.Game.Rulesets.Mania.UI
h.OnNewResult += OnNewResult;
}
+ public override void Remove(DrawableHitObject h)
+ {
+ var maniaObject = (ManiaHitObject)h.HitObject;
+ int columnIndex = maniaObject.Column - firstColumnIndex;
+ Columns.ElementAt(columnIndex).Remove(h);
+
+ h.OnNewResult -= OnNewResult;
+ }
+
public void Add(BarLine barline) => base.Add(new DrawableBarLine(barline));
internal void OnNewResult(DrawableHitObject judgedObject, JudgementResult result)
diff --git a/osu.Game.Rulesets.Osu.Tests/TestCaseHitCircle.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseHitCircle.cs
index 6b67188791..1c1a027411 100644
--- a/osu.Game.Rulesets.Osu.Tests/TestCaseHitCircle.cs
+++ b/osu.Game.Rulesets.Osu.Tests/TestCaseHitCircle.cs
@@ -8,7 +8,7 @@ using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Tests.Visual;
-using OpenTK;
+using osuTK;
using System.Collections.Generic;
using System;
using osu.Game.Rulesets.Mods;
diff --git a/osu.Game.Rulesets.Osu.Tests/TestCaseHitCircleSelectionBlueprint.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseHitCircleSelectionBlueprint.cs
index 9662e0018f..fed62188ab 100644
--- a/osu.Game.Rulesets.Osu.Tests/TestCaseHitCircleSelectionBlueprint.cs
+++ b/osu.Game.Rulesets.Osu.Tests/TestCaseHitCircleSelectionBlueprint.cs
@@ -8,7 +8,7 @@ using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Tests.Visual;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Tests
{
diff --git a/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs
index 5b638782fb..1895913917 100644
--- a/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs
+++ b/osu.Game.Rulesets.Osu.Tests/TestCaseSlider.cs
@@ -11,8 +11,8 @@ using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Tests.Visual;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Game.Rulesets.Mods;
using System.Linq;
using NUnit.Framework;
diff --git a/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs
index cacbcb2cd6..cd07369ccf 100644
--- a/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs
+++ b/osu.Game.Rulesets.Osu.Tests/TestCaseSliderSelectionBlueprint.cs
@@ -13,7 +13,7 @@ using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Tests.Visual;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Tests
{
diff --git a/osu.Game.Rulesets.Osu.Tests/TestCaseSpinnerSelectionBlueprint.cs b/osu.Game.Rulesets.Osu.Tests/TestCaseSpinnerSelectionBlueprint.cs
index a0cfd4487e..d7ba5d8105 100644
--- a/osu.Game.Rulesets.Osu.Tests/TestCaseSpinnerSelectionBlueprint.cs
+++ b/osu.Game.Rulesets.Osu.Tests/TestCaseSpinnerSelectionBlueprint.cs
@@ -13,7 +13,7 @@ using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Tests.Visual;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Tests
{
diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs
index 4fc4f3edc3..510c32fd9f 100644
--- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs
+++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Objects;
diff --git a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
index 39e3c009da..d8e3b340c9 100644
--- a/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
+++ b/osu.Game.Rulesets.Osu/Difficulty/Preprocessing/OsuDifficultyHitObject.cs
@@ -4,7 +4,7 @@
using System;
using System.Linq;
using osu.Game.Rulesets.Osu.Objects;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Difficulty.Preprocessing
{
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/HitCircles/Components/HitCirclePiece.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/HitCircles/Components/HitCirclePiece.cs
index 9c33435285..de219ed5a5 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/HitCircles/Components/HitCirclePiece.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/HitCircles/Components/HitCirclePiece.cs
@@ -3,19 +3,19 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
-using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components
{
- public class HitCirclePiece : CompositeDrawable
+ public class HitCirclePiece : HitObjectPiece
{
private readonly HitCircle hitCircle;
public HitCirclePiece(HitCircle hitCircle)
+ : base(hitCircle)
{
this.hitCircle = hitCircle;
Origin = Anchor.Centre;
@@ -25,10 +25,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components
CornerRadius = Size.X / 2;
InternalChild = new RingPiece();
-
- hitCircle.PositionChanged += _ => UpdatePosition();
- hitCircle.StackHeightChanged += _ => UpdatePosition();
- hitCircle.ScaleChanged += _ => Scale = new Vector2(hitCircle.Scale);
}
[BackgroundDependencyLoader]
@@ -36,7 +32,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components
{
Colour = colours.Yellow;
- UpdatePosition();
+ PositionBindable.BindValueChanged(_ => UpdatePosition(), true);
+ StackHeightBindable.BindValueChanged(_ => UpdatePosition());
+ ScaleBindable.BindValueChanged(v => Scale = new Vector2(v), true);
}
protected virtual void UpdatePosition() => Position = hitCircle.StackedPosition;
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/HitObjectPiece.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/HitObjectPiece.cs
new file mode 100644
index 0000000000..882a9a3d81
--- /dev/null
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/HitObjectPiece.cs
@@ -0,0 +1,36 @@
+// Copyright (c) 2007-2018 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using osu.Framework.Allocation;
+using osu.Framework.Configuration;
+using osu.Framework.Graphics.Containers;
+using osu.Game.Rulesets.Osu.Objects;
+using osuTK;
+
+namespace osu.Game.Rulesets.Osu.Edit.Blueprints
+{
+ ///
+ /// A piece of a blueprint which responds to changes in the state of a .
+ ///
+ public abstract class HitObjectPiece : CompositeDrawable
+ {
+ protected readonly IBindable PositionBindable = new Bindable();
+ protected readonly IBindable StackHeightBindable = new Bindable();
+ protected readonly IBindable ScaleBindable = new Bindable();
+
+ private readonly OsuHitObject hitObject;
+
+ protected HitObjectPiece(OsuHitObject hitObject)
+ {
+ this.hitObject = hitObject;
+ }
+
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ PositionBindable.BindTo(hitObject.PositionBindable);
+ StackHeightBindable.BindTo(hitObject.StackHeightBindable);
+ ScaleBindable.BindTo(hitObject.ScaleBindable);
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/SliderPiece.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/SliderPiece.cs
new file mode 100644
index 0000000000..ef7254d9c9
--- /dev/null
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/SliderPiece.cs
@@ -0,0 +1,32 @@
+// Copyright (c) 2007-2018 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using osu.Framework.Allocation;
+using osu.Framework.Configuration;
+using osu.Game.Rulesets.Objects;
+using osu.Game.Rulesets.Osu.Objects;
+
+namespace osu.Game.Rulesets.Osu.Edit.Blueprints
+{
+ ///
+ /// A piece of a blueprint which responds to changes in the state of a .
+ ///
+ public abstract class SliderPiece : HitObjectPiece
+ {
+ protected readonly IBindable PathBindable = new Bindable();
+
+ private readonly Slider slider;
+
+ protected SliderPiece(Slider slider)
+ : base(slider)
+ {
+ this.slider = slider;
+ }
+
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ PathBindable.BindTo(slider.PathBindable);
+ }
+ }
+}
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointPiece.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointPiece.cs
index 7100d9443e..18efe21404 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointPiece.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointPiece.cs
@@ -10,7 +10,7 @@ using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Objects;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs
index ab9d81574a..0089c2dddd 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointVisualiser.cs
@@ -1,26 +1,31 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Osu.Objects;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
- public class PathControlPointVisualiser : CompositeDrawable
+ public class PathControlPointVisualiser : SliderPiece
{
private readonly Slider slider;
private readonly Container pieces;
public PathControlPointVisualiser(Slider slider)
+ : base(slider)
{
this.slider = slider;
InternalChild = pieces = new Container { RelativeSizeAxes = Axes.Both };
+ }
- slider.PathChanged += _ => updatePathControlPoints();
- updatePathControlPoints();
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ PathBindable.BindValueChanged(_ => updatePathControlPoints(), true);
}
private void updatePathControlPoints()
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderBodyPiece.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderBodyPiece.cs
index 06bc265258..5ea85676b5 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderBodyPiece.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderBodyPiece.cs
@@ -3,21 +3,21 @@
using System.Collections.Generic;
using osu.Framework.Allocation;
-using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
- public class SliderBodyPiece : CompositeDrawable
+ public class SliderBodyPiece : SliderPiece
{
private readonly Slider slider;
private readonly ManualSliderBody body;
public SliderBodyPiece(Slider slider)
+ : base(slider)
{
this.slider = slider;
@@ -26,9 +26,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
AccentColour = Color4.Transparent,
PathWidth = slider.Scale * 64
};
-
- slider.PositionChanged += _ => updatePosition();
- slider.ScaleChanged += _ => body.PathWidth = slider.Scale * 64;
}
[BackgroundDependencyLoader]
@@ -36,7 +33,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
body.BorderColour = colours.Yellow;
- updatePosition();
+ PositionBindable.BindValueChanged(_ => updatePosition(), true);
+ ScaleBindable.BindValueChanged(v => body.PathWidth = v * 64, true);
}
private void updatePosition() => Position = slider.StackedPosition;
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderCirclePiece.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderCirclePiece.cs
index 1ee765f5e0..205ac6bea3 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderCirclePiece.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/SliderCirclePiece.cs
@@ -1,6 +1,9 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using osu.Framework.Allocation;
+using osu.Framework.Configuration;
+using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components;
using osu.Game.Rulesets.Osu.Objects;
@@ -8,6 +11,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
public class SliderCirclePiece : HitCirclePiece
{
+ private readonly IBindable pathBindable = new Bindable();
+
private readonly Slider slider;
private readonly SliderPosition position;
@@ -16,8 +21,13 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
this.slider = slider;
this.position = position;
+ }
- slider.PathChanged += _ => UpdatePosition();
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ pathBindable.BindTo(slider.PathBindable);
+ pathBindable.BindValueChanged(_ => UpdatePosition(), true);
}
protected override void UpdatePosition()
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs
index d59cd35f19..ba3501cb2b 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderPlacementBlueprint.cs
@@ -12,8 +12,8 @@ using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components;
-using OpenTK;
-using OpenTK.Input;
+using osuTK;
+using osuTK.Input;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
{
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderSelectionBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderSelectionBlueprint.cs
index 4810d76bf8..2206a36738 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderSelectionBlueprint.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderSelectionBlueprint.cs
@@ -5,7 +5,7 @@ using osu.Framework.Graphics;
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
{
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/Components/SpinnerPiece.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/Components/SpinnerPiece.cs
index bd63a3e607..af648cfa1b 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/Components/SpinnerPiece.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/Components/SpinnerPiece.cs
@@ -8,16 +8,18 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components
{
- public class SpinnerPiece : CompositeDrawable
+ public class SpinnerPiece : HitObjectPiece
{
private readonly Spinner spinner;
private readonly CircularContainer circle;
+ private readonly RingPiece ring;
public SpinnerPiece(Spinner spinner)
+ : base(spinner)
{
this.spinner = spinner;
@@ -27,7 +29,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components
FillMode = FillMode.Fit;
Size = new Vector2(1.3f);
- RingPiece ring;
InternalChildren = new Drawable[]
{
circle = new CircularContainer
@@ -45,18 +46,16 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components
};
ring.Scale = new Vector2(spinner.Scale);
-
- spinner.PositionChanged += _ => updatePosition();
- spinner.StackHeightChanged += _ => updatePosition();
- spinner.ScaleChanged += _ => ring.Scale = new Vector2(spinner.Scale);
-
- updatePosition();
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.Yellow;
+
+ PositionBindable.BindValueChanged(_ => updatePosition(), true);
+ StackHeightBindable.BindValueChanged(_ => updatePosition());
+ ScaleBindable.BindValueChanged(v => ring.Scale = new Vector2(v), true);
}
private void updatePosition() => Position = spinner.Position;
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/SpinnerPlacementBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/SpinnerPlacementBlueprint.cs
index c97adde427..804a4fcba0 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/SpinnerPlacementBlueprint.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/SpinnerPlacementBlueprint.cs
@@ -37,6 +37,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners
isPlacingEnd = true;
piece.FadeTo(1f, 150, Easing.OutQuint);
+
+ BeginPlacement();
}
return true;
diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/SpinnerSelectionBlueprint.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/SpinnerSelectionBlueprint.cs
index 9e9cc87c5e..4b98866613 100644
--- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/SpinnerSelectionBlueprint.cs
+++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/SpinnerSelectionBlueprint.cs
@@ -5,7 +5,7 @@ using osu.Framework.Input.Events;
using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners
{
diff --git a/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs b/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs
index 8571de39f4..05bc7dada0 100644
--- a/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs
+++ b/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs
@@ -5,7 +5,7 @@ using osu.Framework.Graphics.Cursor;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Edit
{
diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs
index a337439593..84a35b04fe 100644
--- a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs
+++ b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs
@@ -1,12 +1,52 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using osu.Framework.Graphics;
+using osu.Framework.Input;
+using osu.Framework.Input.Events;
using osu.Game.Rulesets.Mods;
+using osu.Game.Rulesets.Osu.Objects;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Mods
{
- public class OsuModFlashlight : ModFlashlight
+ public class OsuModFlashlight : ModFlashlight
{
public override double ScoreMultiplier => 1.12;
+
+ private const float default_flashlight_size = 180;
+
+ public override Flashlight CreateFlashlight() => new OsuFlashlight();
+
+ private class OsuFlashlight : Flashlight, IRequireHighFrequencyMousePosition
+ {
+ public OsuFlashlight()
+ {
+ FlashlightSize = new Vector2(0, getSizeFor(0));
+ }
+
+ protected override bool OnMouseMove(MouseMoveEvent e)
+ {
+ FlashlightPosition = e.MousePosition;
+ return base.OnMouseMove(e);
+ }
+
+ private float getSizeFor(int combo)
+ {
+ if (combo > 200)
+ return default_flashlight_size * 0.8f;
+ else if (combo > 100)
+ return default_flashlight_size * 0.9f;
+ else
+ return default_flashlight_size;
+ }
+
+ protected override void OnComboChange(int newCombo)
+ {
+ this.TransformTo(nameof(FlashlightSize), new Vector2(0, getSizeFor(newCombo)), FLASHLIGHT_FADE_DURATION);
+ }
+
+ protected override string FragmentShader => "CircularFlashlight";
+ }
}
}
diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs b/osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs
index 223e4df844..32d2d40671 100644
--- a/osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs
+++ b/osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs
@@ -7,7 +7,7 @@ using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.UI;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Mods
{
diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModTransform.cs b/osu.Game.Rulesets.Osu/Mods/OsuModTransform.cs
index 440b314e5f..dcd1896601 100644
--- a/osu.Game.Rulesets.Osu/Mods/OsuModTransform.cs
+++ b/osu.Game.Rulesets.Osu/Mods/OsuModTransform.cs
@@ -8,7 +8,7 @@ using osu.Game.Graphics;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Mods
{
diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModWiggle.cs b/osu.Game.Rulesets.Osu/Mods/OsuModWiggle.cs
index e0a93453ce..93f1070231 100644
--- a/osu.Game.Rulesets.Osu/Mods/OsuModWiggle.cs
+++ b/osu.Game.Rulesets.Osu/Mods/OsuModWiggle.cs
@@ -9,7 +9,7 @@ using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu.Objects;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Mods
{
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs
index 908b9cb3c6..bd329266aa 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs
index 61a6e6404a..61219d9bb9 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs
@@ -3,7 +3,7 @@
using System;
using System.Collections.Generic;
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Objects.Types;
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
index e663989eeb..9b562745fa 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
@@ -2,12 +2,14 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
+using osu.Framework.Allocation;
+using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
-using OpenTK;
+using osuTK;
using osu.Game.Rulesets.Scoring;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
@@ -21,6 +23,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private readonly NumberPiece number;
private readonly GlowPiece glow;
+ private readonly IBindable positionBindable = new Bindable();
+ private readonly IBindable stackHeightBindable = new Bindable();
+ private readonly IBindable scaleBindable = new Bindable();
+
public DrawableHitCircle(HitCircle h)
: base(h)
{
@@ -59,10 +65,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
//may not be so correct
Size = circle.DrawSize;
+ }
- HitObject.PositionChanged += _ => Position = HitObject.StackedPosition;
- HitObject.StackHeightChanged += _ => Position = HitObject.StackedPosition;
- HitObject.ScaleChanged += s => Scale = new Vector2(s);
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
+ stackHeightBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
+ scaleBindable.BindValueChanged(v => Scale = new Vector2(v));
+
+ positionBindable.BindTo(HitObject.PositionBindable);
+ stackHeightBindable.BindTo(HitObject.StackHeightBindable);
+ scaleBindable.BindTo(HitObject.ScaleBindable);
}
public override Color4 AccentColour
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs
index 10cd246172..2ac46a14f2 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs
@@ -9,15 +9,13 @@ using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Osu.Judgements;
using osu.Game.Rulesets.Scoring;
using osu.Game.Skinning;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Game.Graphics.Containers;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
public class DrawableOsuHitObject : DrawableHitObject
{
- public override bool IsPresent => base.IsPresent || State.Value == ArmedState.Idle && Clock?.CurrentTime >= HitObject.StartTime - HitObject.TimePreempt;
-
private readonly ShakeContainer shakeContainer;
protected DrawableOsuHitObject(OsuHitObject hitObject)
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs
index 04ec3f13c7..17f6ddd211 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
-using OpenTK;
+using osuTK;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs
index dfe7937e81..8c9252a2da 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.MathUtils;
using osu.Game.Rulesets.Objects.Drawables;
-using OpenTK;
+using osuTK;
using osu.Game.Graphics;
using osu.Game.Rulesets.Scoring;
using osu.Game.Skinning;
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
index a90182cecb..eed9a53ad7 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
@@ -1,17 +1,19 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
+using osu.Framework.Configuration;
using osu.Framework.Graphics.Containers;
using osu.Game.Configuration;
+using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
@@ -26,6 +28,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public readonly SnakingSliderBody Body;
public readonly SliderBall Ball;
+ private readonly IBindable positionBindable = new Bindable();
+ private readonly IBindable scaleBindable = new Bindable();
+ private readonly IBindable pathBindable = new Bindable();
+
public DrawableSlider(Slider s)
: base(s)
{
@@ -83,15 +89,26 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
components.Add(drawableRepeatPoint);
AddNested(drawableRepeatPoint);
}
+ }
- HitObject.PositionChanged += _ => Position = HitObject.StackedPosition;
- HitObject.ScaleChanged += _ =>
+ [BackgroundDependencyLoader]
+ private void load(OsuConfigManager config)
+ {
+ config.BindWith(OsuSetting.SnakingInSliders, Body.SnakingIn);
+ config.BindWith(OsuSetting.SnakingOutSliders, Body.SnakingOut);
+
+ positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
+ scaleBindable.BindValueChanged(v =>
{
Body.PathWidth = HitObject.Scale * 64;
Ball.Scale = new Vector2(HitObject.Scale);
- };
+ });
- slider.PathChanged += _ => Body.Refresh();
+ positionBindable.BindTo(HitObject.PositionBindable);
+ scaleBindable.BindTo(HitObject.ScaleBindable);
+ pathBindable.BindTo(slider.PathBindable);
+
+ pathBindable.BindValueChanged(_ => Body.Refresh());
}
public override Color4 AccentColour
@@ -108,13 +125,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
}
}
- [BackgroundDependencyLoader]
- private void load(OsuConfigManager config)
- {
- config.BindWith(OsuSetting.SnakingInSliders, Body.SnakingIn);
- config.BindWith(OsuSetting.SnakingOutSliders, Body.SnakingOut);
- }
-
public bool Tracking;
protected override void Update()
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderHead.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderHead.cs
index b933364887..f4962f6113 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderHead.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderHead.cs
@@ -2,24 +2,35 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
+using osu.Framework.Allocation;
+using osu.Framework.Configuration;
+using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
public class DrawableSliderHead : DrawableHitCircle
{
+ private readonly IBindable positionBindable = new Bindable();
+ private readonly IBindable pathBindable = new Bindable();
+
private readonly Slider slider;
public DrawableSliderHead(Slider slider, HitCircle h)
: base(h)
{
this.slider = slider;
+ }
- h.PositionChanged += _ => updatePosition();
- slider.PathChanged += _ => updatePosition();
+ [BackgroundDependencyLoader]
+ private void load()
+ {
+ positionBindable.BindTo(HitObject.PositionBindable);
+ pathBindable.BindTo(slider.PathBindable);
- updatePosition();
+ positionBindable.BindValueChanged(_ => updatePosition());
+ pathBindable.BindValueChanged(_ => updatePosition(), true);
}
protected override void Update()
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs
index 6946a55d8e..4ff05d8995 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs
@@ -1,8 +1,11 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using osu.Framework.Configuration;
using osu.Framework.Graphics;
+using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
@@ -17,6 +20,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public bool Tracking { get; set; }
+ private readonly IBindable positionBindable = new Bindable();
+ private readonly IBindable pathBindable = new Bindable();
+
public DrawableSliderTail(Slider slider, SliderTailCircle hitCircle)
: base(hitCircle)
{
@@ -29,10 +35,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
AlwaysPresent = true;
- hitCircle.PositionChanged += _ => updatePosition();
- slider.PathChanged += _ => updatePosition();
+ positionBindable.BindTo(hitCircle.PositionBindable);
+ pathBindable.BindTo(slider.PathBindable);
- updatePosition();
+ positionBindable.BindValueChanged(_ => updatePosition());
+ pathBindable.BindValueChanged(_ => updatePosition(), true);
}
protected override void CheckForResult(bool userTriggered, double timeOffset)
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs
index 964c75131a..531e6a37af 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs
@@ -3,8 +3,8 @@
using osu.Framework.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Scoring;
using osu.Game.Skinning;
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
index f3846bd52f..8e809306a4 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs
@@ -6,11 +6,12 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Game.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Allocation;
+using osu.Framework.Configuration;
using osu.Game.Screens.Ranking;
using osu.Game.Rulesets.Scoring;
@@ -36,6 +37,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private readonly Color4 baseColour = OsuColour.FromHex(@"002c3c");
private readonly Color4 fillColour = OsuColour.FromHex(@"005b7c");
+ private readonly IBindable positionBindable = new Bindable();
+
private Color4 normalColour;
private Color4 completeColour;
@@ -112,8 +115,23 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Alpha = 0
}
};
+ }
- s.PositionChanged += _ => Position = s.Position;
+ [BackgroundDependencyLoader]
+ private void load(OsuColour colours)
+ {
+ normalColour = baseColour;
+
+ Background.AccentColour = normalColour;
+
+ completeColour = colours.YellowLight.Opacity(0.75f);
+
+ Disc.AccentColour = fillColour;
+ circle.Colour = colours.BlueDark;
+ glow.Colour = colours.BlueDark;
+
+ positionBindable.BindValueChanged(v => Position = v);
+ positionBindable.BindTo(HitObject.PositionBindable);
}
public float Progress => MathHelper.Clamp(Disc.RotationAbsolute / 360 / Spinner.SpinsRequired, 0, 1);
@@ -153,20 +171,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
});
}
- [BackgroundDependencyLoader]
- private void load(OsuColour colours)
- {
- normalColour = baseColour;
-
- Background.AccentColour = normalColour;
-
- completeColour = colours.YellowLight.Opacity(0.75f);
-
- 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) ?? false;
@@ -213,6 +217,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
switch (state)
{
+ case ArmedState.Idle:
+ Expire(true);
+ break;
case ArmedState.Hit:
sequence.ScaleTo(Scale * 1.2f, 320, Easing.Out);
break;
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs
index a05e51a460..23903e1b5e 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs
index 6bb6991cc0..1a9acf708a 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs
@@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Bindings;
using osu.Game.Skinning;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ExplodePiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ExplodePiece.cs
index ed1b042939..2a2c845143 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ExplodePiece.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ExplodePiece.cs
@@ -4,7 +4,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Skinning;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/FlashPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/FlashPiece.cs
index 0a1339a6ca..8880c96e3c 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/FlashPiece.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/FlashPiece.cs
@@ -3,7 +3,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics.Shapes;
using osu.Game.Skinning;
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ManualSliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ManualSliderBody.cs
index 9d239c15f2..6f4ccd60a9 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ManualSliderBody.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ManualSliderBody.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs
index acb3ee92ff..87ca2f05e1 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs
@@ -5,7 +5,7 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Skinning;
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/RingPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/RingPiece.cs
index f3e0a0ef43..75b34959bd 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/RingPiece.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/RingPiece.cs
@@ -3,8 +3,8 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Skinning;
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs
index 3081ae49fc..5144ce4e7a 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs
@@ -7,9 +7,9 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Objects.Types;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Game.Skinning;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs
index ca2daa3adb..4604a00fdd 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs
@@ -6,9 +6,9 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Lines;
using osu.Framework.Graphics.Primitives;
-using OpenTK;
-using OpenTK.Graphics;
-using OpenTK.Graphics.ES30;
+using osuTK;
+using osuTK.Graphics;
+using osuTK.Graphics.ES30;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SnakingSliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SnakingSliderBody.cs
index 0e6f3ad16c..49c66c4063 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SnakingSliderBody.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SnakingSliderBody.cs
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Game.Rulesets.Objects.Types;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs
index 584fd93a70..e2d67f16a9 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs
index 4dd1c5f218..59400a71ea 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs
@@ -6,8 +6,8 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerTicks.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerTicks.cs
index 61387d796e..cc9bb1975d 100644
--- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerTicks.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerTicks.cs
@@ -5,8 +5,8 @@ using System;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs
index 61d199a7dc..462df43b65 100644
--- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs
+++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs
@@ -1,10 +1,10 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using System;
+using osu.Framework.Configuration;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects;
-using OpenTK;
+using osuTK;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Beatmaps.ControlPoints;
@@ -14,26 +14,15 @@ namespace osu.Game.Rulesets.Osu.Objects
{
public const double OBJECT_RADIUS = 64;
- public event Action PositionChanged;
- public event Action StackHeightChanged;
- public event Action ScaleChanged;
-
public double TimePreempt = 600;
public double TimeFadeIn = 400;
- private Vector2 position;
+ public readonly Bindable PositionBindable = new Bindable();
public virtual Vector2 Position
{
- get => position;
- set
- {
- if (position == value)
- return;
- position = value;
-
- PositionChanged?.Invoke(value);
- }
+ get => PositionBindable;
+ set => PositionBindable.Value = value;
}
public float X => Position.X;
@@ -45,38 +34,24 @@ namespace osu.Game.Rulesets.Osu.Objects
public Vector2 StackedEndPosition => EndPosition + StackOffset;
- private int stackHeight;
+ public readonly Bindable StackHeightBindable = new Bindable();
public int StackHeight
{
- get => stackHeight;
- set
- {
- if (stackHeight == value)
- return;
- stackHeight = value;
-
- StackHeightChanged?.Invoke(value);
- }
+ get => StackHeightBindable;
+ set => StackHeightBindable.Value = value;
}
public Vector2 StackOffset => new Vector2(StackHeight * Scale * -6.4f);
public double Radius => OBJECT_RADIUS * Scale;
- private float scale = 1;
+ public readonly Bindable ScaleBindable = new Bindable(1);
public float Scale
{
- get => scale;
- set
- {
- if (scale == value)
- return;
- scale = value;
-
- ScaleChanged?.Invoke(value);
- }
+ get => ScaleBindable;
+ set => ScaleBindable.Value = value;
}
public virtual bool NewCombo { get; set; }
diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs
index cf57f24b83..d508ec2636 100644
--- a/osu.Game.Rulesets.Osu/Objects/Slider.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs
@@ -2,11 +2,12 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using OpenTK;
+using osuTK;
using osu.Game.Rulesets.Objects.Types;
using System.Collections.Generic;
using osu.Game.Rulesets.Objects;
using System.Linq;
+using osu.Framework.Configuration;
using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
@@ -22,8 +23,6 @@ namespace osu.Game.Rulesets.Osu.Objects
///
private const float base_scoring_distance = 100;
- public event Action PathChanged;
-
public double EndTime => StartTime + this.SpanCount() * Path.Distance / Velocity;
public double Duration => EndTime - StartTime;
@@ -52,20 +51,12 @@ namespace osu.Game.Rulesets.Osu.Objects
}
}
- private SliderPath path;
+ public readonly Bindable PathBindable = new Bindable();
public SliderPath Path
{
- get => path;
- set
- {
- path = value;
-
- PathChanged?.Invoke(value);
-
- if (TailCircle != null)
- TailCircle.Position = EndPosition;
- }
+ get => PathBindable.Value;
+ set => PathBindable.Value = value;
}
public double Distance => Path.Distance;
@@ -164,7 +155,7 @@ namespace osu.Game.Rulesets.Osu.Objects
ComboIndex = ComboIndex,
};
- TailCircle = new SliderTailCircle
+ TailCircle = new SliderTailCircle(this)
{
StartTime = EndTime,
Position = EndPosition,
diff --git a/osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs b/osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs
index b567bd8423..74a7a8d446 100644
--- a/osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs
+++ b/osu.Game.Rulesets.Osu/Objects/SliderTailCircle.cs
@@ -1,13 +1,23 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using osu.Framework.Configuration;
using osu.Game.Rulesets.Judgements;
+using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Judgements;
namespace osu.Game.Rulesets.Osu.Objects
{
public class SliderTailCircle : SliderCircle
{
+ private readonly IBindable pathBindable = new Bindable();
+
+ public SliderTailCircle(Slider slider)
+ {
+ pathBindable.BindTo(slider.PathBindable);
+ pathBindable.BindValueChanged(_ => Position = slider.EndPosition);
+ }
+
public override Judgement CreateJudgement() => new OsuSliderTailJudgement();
}
}
diff --git a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs
index 7322f65066..a0d040c40b 100644
--- a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs
+++ b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.MathUtils;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu.Objects;
diff --git a/osu.Game.Rulesets.Osu/Replays/OsuAutoGeneratorBase.cs b/osu.Game.Rulesets.Osu/Replays/OsuAutoGeneratorBase.cs
index bb0bd891b3..2530644413 100644
--- a/osu.Game.Rulesets.Osu/Replays/OsuAutoGeneratorBase.cs
+++ b/osu.Game.Rulesets.Osu/Replays/OsuAutoGeneratorBase.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu.Objects;
using System;
diff --git a/osu.Game.Rulesets.Osu/Replays/OsuReplayFrame.cs b/osu.Game.Rulesets.Osu/Replays/OsuReplayFrame.cs
index 4412b6efab..82dfa7f0ad 100644
--- a/osu.Game.Rulesets.Osu/Replays/OsuReplayFrame.cs
+++ b/osu.Game.Rulesets.Osu/Replays/OsuReplayFrame.cs
@@ -6,7 +6,7 @@ using osu.Game.Beatmaps;
using osu.Game.Rulesets.Replays;
using osu.Game.Rulesets.Replays.Legacy;
using osu.Game.Rulesets.Replays.Types;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Replays
{
diff --git a/osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs b/osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs
index 5c07860b19..230709a4aa 100644
--- a/osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs
+++ b/osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs
@@ -6,7 +6,7 @@ using System.Linq;
using osu.Framework.Input.StateChanges;
using osu.Framework.MathUtils;
using osu.Game.Rulesets.Replays;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.Replays
{
diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs
index 4b5513ff9c..b25b3e5cb8 100644
--- a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs
+++ b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs
@@ -14,9 +14,9 @@ using osu.Framework.Graphics.Textures;
using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Framework.Timing;
-using OpenTK;
-using OpenTK.Graphics;
-using OpenTK.Graphics.ES30;
+using osuTK;
+using osuTK.Graphics;
+using osuTK.Graphics.ES30;
namespace osu.Game.Rulesets.Osu.UI.Cursor
{
diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs
index 4a45d4fb31..4aa30777e9 100644
--- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs
+++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs
@@ -12,8 +12,8 @@ using osu.Framework.Input.Bindings;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Skinning;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.UI.Cursor
{
diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs
index 398680cb8d..3399fdb9a0 100644
--- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs
+++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables;
@@ -84,5 +84,7 @@ namespace osu.Game.Rulesets.Osu.UI
judgementLayer.Add(explosion);
}
+
+ public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => HitObjectContainer.ReceivePositionalInputAt(screenSpacePos);
}
}
diff --git a/osu.Game.Rulesets.Osu/UI/PlayfieldAdjustmentContainer.cs b/osu.Game.Rulesets.Osu/UI/PlayfieldAdjustmentContainer.cs
index 00d5692fda..df5bd84e75 100644
--- a/osu.Game.Rulesets.Osu/UI/PlayfieldAdjustmentContainer.cs
+++ b/osu.Game.Rulesets.Osu/UI/PlayfieldAdjustmentContainer.cs
@@ -3,7 +3,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Osu.UI
{
diff --git a/osu.Game.Rulesets.Taiko.Tests/TestCaseInputDrum.cs b/osu.Game.Rulesets.Taiko.Tests/TestCaseInputDrum.cs
index 322e9b6bd4..b88aea0bbd 100644
--- a/osu.Game.Rulesets.Taiko.Tests/TestCaseInputDrum.cs
+++ b/osu.Game.Rulesets.Taiko.Tests/TestCaseInputDrum.cs
@@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Audio;
diff --git a/osu.Game.Rulesets.Taiko.Tests/TestCaseTaikoPlayfield.cs b/osu.Game.Rulesets.Taiko.Tests/TestCaseTaikoPlayfield.cs
index fc103e4c72..dad7f34e71 100644
--- a/osu.Game.Rulesets.Taiko.Tests/TestCaseTaikoPlayfield.cs
+++ b/osu.Game.Rulesets.Taiko.Tests/TestCaseTaikoPlayfield.cs
@@ -19,7 +19,7 @@ using osu.Game.Rulesets.Taiko.Objects.Drawables;
using osu.Game.Rulesets.Taiko.UI;
using osu.Game.Tests.Beatmaps;
using osu.Game.Tests.Visual;
-using OpenTK;
+using osuTK;
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.Tests
diff --git a/osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceCalculator.cs b/osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceCalculator.cs
index f530b6725c..734d5d0ad7 100644
--- a/osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceCalculator.cs
+++ b/osu.Game.Rulesets.Taiko/Difficulty/TaikoPerformanceCalculator.cs
@@ -8,6 +8,7 @@ using osu.Game.Beatmaps;
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Scoring;
+using osu.Game.Rulesets.Taiko.Objects;
namespace osu.Game.Rulesets.Taiko.Difficulty
{
@@ -82,7 +83,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty
if (mods.Any(m => m is ModHidden))
strainValue *= 1.025;
- if (mods.Any(m => m is ModFlashlight))
+ if (mods.Any(m => m is ModFlashlight))
// Apply length bonus again if flashlight is on simply because it becomes a lot harder on longer maps.
strainValue *= 1.05 * lengthBonus;
diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs
index 49f7786f59..79dad84696 100644
--- a/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs
+++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs
@@ -1,12 +1,80 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using osu.Framework.Caching;
+using osu.Framework.Graphics;
using osu.Game.Rulesets.Mods;
+using osu.Game.Rulesets.Taiko.Objects;
+using osu.Game.Rulesets.Taiko.UI;
+using osu.Game.Rulesets.UI;
+using osuTK;
namespace osu.Game.Rulesets.Taiko.Mods
{
- public class TaikoModFlashlight : ModFlashlight
+ public class TaikoModFlashlight : ModFlashlight
{
public override double ScoreMultiplier => 1.12;
+
+ private const float default_flashlight_size = 250;
+
+ public override Flashlight CreateFlashlight() => new TaikoFlashlight(playfield);
+
+ private TaikoPlayfield playfield;
+
+ public override void ApplyToRulesetContainer(RulesetContainer rulesetContainer)
+ {
+ playfield = (TaikoPlayfield)rulesetContainer.Playfield;
+ base.ApplyToRulesetContainer(rulesetContainer);
+ }
+
+ private class TaikoFlashlight : Flashlight
+ {
+ private readonly Cached flashlightProperties = new Cached();
+ private readonly TaikoPlayfield taikoPlayfield;
+
+ public TaikoFlashlight(TaikoPlayfield taikoPlayfield)
+ {
+ this.taikoPlayfield = taikoPlayfield;
+ FlashlightSize = new Vector2(0, getSizeFor(0));
+ }
+
+ private float getSizeFor(int combo)
+ {
+ if (combo > 200)
+ return default_flashlight_size * 0.8f;
+ else if (combo > 100)
+ return default_flashlight_size * 0.9f;
+ else
+ return default_flashlight_size;
+ }
+
+ protected override void OnComboChange(int newCombo)
+ {
+ this.TransformTo(nameof(FlashlightSize), new Vector2(0, getSizeFor(newCombo)), FLASHLIGHT_FADE_DURATION);
+ }
+
+ protected override string FragmentShader => "CircularFlashlight";
+
+ public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true)
+ {
+ if ((invalidation & Invalidation.DrawSize) > 0)
+ {
+ flashlightProperties.Invalidate();
+ }
+
+ return base.Invalidate(invalidation, source, shallPropagate);
+ }
+
+ protected override void Update()
+ {
+ base.Update();
+
+ if (!flashlightProperties.IsValid)
+ {
+ FlashlightPosition = taikoPlayfield.HitTarget.ToSpaceOfOtherDrawable(taikoPlayfield.HitTarget.OriginPosition, this);
+ flashlightProperties.Validate();
+ }
+ }
+ }
}
}
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs
index db5f418e18..d6f8522b77 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs
@@ -3,7 +3,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
-using OpenTK;
+using osuTK;
using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLineMajor.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLineMajor.cs
index 300edd2e76..3a1b4e33d2 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLineMajor.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLineMajor.cs
@@ -3,7 +3,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics.Shapes;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs
index 5142f125ac..632dff4525 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs
@@ -6,8 +6,8 @@ using osu.Framework.Allocation;
using osu.Framework.MathUtils;
using osu.Game.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs
index 5059734663..1412bd3cea 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs
@@ -11,8 +11,8 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Scoring;
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs
index 51e39dc648..cee9b40730 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs
@@ -5,7 +5,7 @@ using osu.Framework.Graphics;
using osu.Framework.Input.Bindings;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces;
-using OpenTK;
+using osuTK;
using System.Linq;
using osu.Game.Audio;
using System.Collections.Generic;
@@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
RelativeSizeAxes = Axes.Both,
Child = Content = new Container { RelativeSizeAxes = Axes.Both }
},
- proxiedContent = new Container { RelativeSizeAxes = Axes.Both }
+ proxiedContent = new ProxiedContentContainer { RelativeSizeAxes = Axes.Both }
};
}
@@ -75,6 +75,12 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
public abstract bool OnPressed(TaikoAction action);
public virtual bool OnReleased(TaikoAction action) => false;
+
+ private class ProxiedContentContainer : Container
+ {
+ public override double LifetimeStart => Parent?.LifetimeStart ?? base.LifetimeStart;
+ public override double LifetimeEnd => Parent?.LifetimeEnd ?? base.LifetimeEnd;
+ }
}
public abstract class DrawableTaikoHitObject : DrawableTaikoHitObject
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs
index 27e2b3c762..b4cb3a35f6 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs
@@ -3,7 +3,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics.Shapes;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs
index 7a4931dc71..fdb73235de 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs
@@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Backgrounds;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Game.Beatmaps.ControlPoints;
using osu.Framework.Audio.Track;
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs
index d3487fb65c..613d8debb5 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs
@@ -3,8 +3,8 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs
index d70ac64a27..8455f4af58 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs
index e630847aec..6795338a83 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Graphics;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Game.Graphics.Containers;
using osu.Framework.Graphics;
diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TickPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TickPiece.cs
index 976836a5ed..7327b9c565 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TickPiece.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TickPiece.cs
@@ -3,8 +3,8 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
diff --git a/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs
index 4dd0ba4d3d..84e40427f2 100644
--- a/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs
+++ b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game.Rulesets.Taiko/UI/HitTarget.cs b/osu.Game.Rulesets.Taiko/UI/HitTarget.cs
index 9d824ca5b7..ab5bc841a6 100644
--- a/osu.Game.Rulesets.Taiko/UI/HitTarget.cs
+++ b/osu.Game.Rulesets.Taiko/UI/HitTarget.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
diff --git a/osu.Game.Rulesets.Taiko/UI/InputDrum.cs b/osu.Game.Rulesets.Taiko/UI/InputDrum.cs
index 524535bfde..6d84b69638 100644
--- a/osu.Game.Rulesets.Taiko/UI/InputDrum.cs
+++ b/osu.Game.Rulesets.Taiko/UI/InputDrum.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using OpenTK;
+using osuTK;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs b/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs
index 287d59972a..ad9b967ac6 100644
--- a/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs
+++ b/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game.Rulesets.Taiko/UI/PlayfieldAdjustmentContainer.cs b/osu.Game.Rulesets.Taiko/UI/PlayfieldAdjustmentContainer.cs
index 661a4e135c..73751e845e 100644
--- a/osu.Game.Rulesets.Taiko/UI/PlayfieldAdjustmentContainer.cs
+++ b/osu.Game.Rulesets.Taiko/UI/PlayfieldAdjustmentContainer.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics.Containers;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Taiko.UI
{
diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs
index 561afb0180..333b1ba83a 100644
--- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs
+++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs
@@ -16,8 +16,8 @@ using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Rulesets.Taiko.Objects.Drawables;
using osu.Game.Rulesets.Taiko.Judgements;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Taiko.UI
{
@@ -41,6 +41,7 @@ namespace osu.Game.Rulesets.Taiko.UI
private readonly Container hitExplosionContainer;
private readonly Container kiaiExplosionContainer;
private readonly JudgementContainer judgementContainer;
+ internal readonly HitTarget HitTarget;
private readonly Container topLevelHitContainer;
@@ -102,7 +103,7 @@ namespace osu.Game.Rulesets.Taiko.UI
FillMode = FillMode.Fit,
Blending = BlendingMode.Additive,
},
- new HitTarget
+ HitTarget = new HitTarget
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.Centre,
diff --git a/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs
index 464cfbf5e9..6d64b25906 100644
--- a/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs
+++ b/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs
@@ -3,8 +3,8 @@
using System.IO;
using NUnit.Framework;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Game.Tests.Resources;
using System.Linq;
using osu.Game.Audio;
diff --git a/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs
index 82adc88c6b..40857198f1 100644
--- a/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs
+++ b/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs
@@ -4,7 +4,7 @@
using System.IO;
using System.Linq;
using NUnit.Framework;
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Game.Beatmaps.Formats;
using osu.Game.Storyboards;
diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs
index 64bd563897..f7e1653cdd 100644
--- a/osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs
+++ b/osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs
@@ -12,7 +12,7 @@ using osu.Game.IO.Serialization;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Tests.Resources;
-using OpenTK;
+using osuTK;
namespace osu.Game.Tests.Beatmaps.Formats
{
diff --git a/osu.Game.Tests/Visual/TestCaseBeatDivisorControl.cs b/osu.Game.Tests/Visual/TestCaseBeatDivisorControl.cs
index 6c607acd11..c11bb5d17b 100644
--- a/osu.Game.Tests/Visual/TestCaseBeatDivisorControl.cs
+++ b/osu.Game.Tests/Visual/TestCaseBeatDivisorControl.cs
@@ -7,7 +7,7 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Screens.Edit;
using osu.Game.Screens.Edit.Compose.Components;
-using OpenTK;
+using osuTK;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs
index 596b7839e0..ff383b6723 100644
--- a/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs
+++ b/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs
@@ -13,7 +13,7 @@ using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Lists;
namespace osu.Game.Tests.Visual
diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs
index 41d85673f8..4d19667926 100644
--- a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs
+++ b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs
@@ -4,7 +4,7 @@
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Screens.Select;
-using OpenTK;
+using osuTK;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs
index 175db7d246..35cdfda92c 100644
--- a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs
+++ b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs
@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using NUnit.Framework;
-using OpenTK;
+using osuTK;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs b/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs
index ffa433ef11..a56b82d887 100644
--- a/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs
+++ b/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs
@@ -4,8 +4,8 @@
using System.ComponentModel;
using osu.Game.Graphics;
using osu.Game.Screens.Select.Options;
-using OpenTK.Graphics;
-using OpenTK.Input;
+using osuTK.Graphics;
+using osuTK.Input;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseButtonSystem.cs b/osu.Game.Tests/Visual/TestCaseButtonSystem.cs
index 7f8133d638..0506783310 100644
--- a/osu.Game.Tests/Visual/TestCaseButtonSystem.cs
+++ b/osu.Game.Tests/Visual/TestCaseButtonSystem.cs
@@ -9,7 +9,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Shapes;
using osu.Game.Screens.Menu;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseChannelTabControl.cs b/osu.Game.Tests/Visual/TestCaseChannelTabControl.cs
index e6a04bf5c6..447337bef0 100644
--- a/osu.Game.Tests/Visual/TestCaseChannelTabControl.cs
+++ b/osu.Game.Tests/Visual/TestCaseChannelTabControl.cs
@@ -16,7 +16,7 @@ using osu.Game.Online.API.Requests;
using osu.Game.Online.Chat;
using osu.Game.Overlays.Chat.Tabs;
using osu.Game.Users;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs
index 51def9be7d..61c2f47e7d 100644
--- a/osu.Game.Tests/Visual/TestCaseChatLink.cs
+++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@@ -16,6 +16,7 @@ using NUnit.Framework;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
+using osu.Framework.Configuration;
namespace osu.Game.Tests.Visual
{
@@ -23,6 +24,7 @@ namespace osu.Game.Tests.Visual
public class TestCaseChatLink : OsuTestCase
{
private readonly TestChatLineContainer textContainer;
+ private readonly DialogOverlay dialogOverlay;
private Color4 linkColour;
public override IReadOnlyList RequiredTypes => new[]
@@ -37,6 +39,7 @@ namespace osu.Game.Tests.Visual
public TestCaseChatLink()
{
+ Add(dialogOverlay = new DialogOverlay { Depth = float.MinValue });
Add(textContainer = new TestChatLineContainer
{
Padding = new MarginPadding { Left = 20, Right = 20 },
@@ -52,11 +55,13 @@ namespace osu.Game.Tests.Visual
linkColour = colours.Blue;
var chatManager = new ChannelManager();
- chatManager.AvailableChannels.Add(new Channel { Name = "#english"});
- chatManager.AvailableChannels.Add(new Channel { Name = "#japanese" });
+ BindableCollection availableChannels = (BindableCollection)chatManager.AvailableChannels;
+ availableChannels.Add(new Channel { Name = "#english"});
+ availableChannels.Add(new Channel { Name = "#japanese" });
Dependencies.Cache(chatManager);
Dependencies.Cache(new ChatOverlay());
+ Dependencies.Cache(dialogOverlay);
testLinksGeneral();
testEcho();
diff --git a/osu.Game.Tests/Visual/TestCaseContextMenu.cs b/osu.Game.Tests/Visual/TestCaseContextMenu.cs
index 80505b219b..a0d0eaf015 100644
--- a/osu.Game.Tests/Visual/TestCaseContextMenu.cs
+++ b/osu.Game.Tests/Visual/TestCaseContextMenu.cs
@@ -8,8 +8,8 @@ using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Game.Graphics.Cursor;
namespace osu.Game.Tests.Visual
diff --git a/osu.Game.Tests/Visual/TestCaseCursors.cs b/osu.Game.Tests/Visual/TestCaseCursors.cs
index 1f409f043e..293ca392ab 100644
--- a/osu.Game.Tests/Visual/TestCaseCursors.cs
+++ b/osu.Game.Tests/Visual/TestCaseCursors.cs
@@ -11,8 +11,8 @@ using osu.Framework.Input.Events;
using osu.Framework.MathUtils;
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.Sprites;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseDisclaimer.cs b/osu.Game.Tests/Visual/TestCaseDisclaimer.cs
index a8253a991a..b6b9a7adb4 100644
--- a/osu.Game.Tests/Visual/TestCaseDisclaimer.cs
+++ b/osu.Game.Tests/Visual/TestCaseDisclaimer.cs
@@ -5,7 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Screens.Menu;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseEditorComposeTimeline.cs b/osu.Game.Tests/Visual/TestCaseEditorComposeTimeline.cs
index d2c1127f4c..f548dfe666 100644
--- a/osu.Game.Tests/Visual/TestCaseEditorComposeTimeline.cs
+++ b/osu.Game.Tests/Visual/TestCaseEditorComposeTimeline.cs
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@@ -14,7 +14,7 @@ using osu.Framework.Graphics.UserInterface;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Screens.Edit.Compose.Components.Timeline;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseEditorSeekSnapping.cs b/osu.Game.Tests/Visual/TestCaseEditorSeekSnapping.cs
index dace6e20ef..8bbbe6b918 100644
--- a/osu.Game.Tests/Visual/TestCaseEditorSeekSnapping.cs
+++ b/osu.Game.Tests/Visual/TestCaseEditorSeekSnapping.cs
@@ -11,8 +11,8 @@ using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Tests.Beatmaps;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseEditorSummaryTimeline.cs b/osu.Game.Tests/Visual/TestCaseEditorSummaryTimeline.cs
index cafd1b6f1a..ff28a0aad2 100644
--- a/osu.Game.Tests/Visual/TestCaseEditorSummaryTimeline.cs
+++ b/osu.Game.Tests/Visual/TestCaseEditorSummaryTimeline.cs
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
-using OpenTK;
+using osuTK;
using osu.Game.Screens.Edit.Components.Timelines.Summary;
using osu.Game.Rulesets.Osu;
using osu.Game.Tests.Beatmaps;
diff --git a/osu.Game.Tests/Visual/TestCaseExternalLinkButton.cs b/osu.Game.Tests/Visual/TestCaseExternalLinkButton.cs
index 7d8535f428..07bc59b29c 100644
--- a/osu.Game.Tests/Visual/TestCaseExternalLinkButton.cs
+++ b/osu.Game.Tests/Visual/TestCaseExternalLinkButton.cs
@@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;
using osu.Game.Graphics.UserInterface;
-using OpenTK;
+using osuTK;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs b/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs
index 417b0f94d7..ee97ff7af7 100644
--- a/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs
+++ b/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs
@@ -5,12 +5,12 @@ using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
-using OpenTK.Input;
+using osuTK.Input;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
using osu.Framework.Logging;
using osu.Game.Screens.Play;
-using OpenTK;
+using osuTK;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseGraph.cs b/osu.Game.Tests/Visual/TestCaseGraph.cs
index 40b05d51e6..0b0a80648b 100644
--- a/osu.Game.Tests/Visual/TestCaseGraph.cs
+++ b/osu.Game.Tests/Visual/TestCaseGraph.cs
@@ -5,7 +5,7 @@ using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
-using OpenTK;
+using osuTK;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseHitObjectComposer.cs b/osu.Game.Tests/Visual/TestCaseHitObjectComposer.cs
index d894d2738e..4109b72989 100644
--- a/osu.Game.Tests/Visual/TestCaseHitObjectComposer.cs
+++ b/osu.Game.Tests/Visual/TestCaseHitObjectComposer.cs
@@ -7,7 +7,7 @@ using JetBrains.Annotations;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Timing;
-using OpenTK;
+using osuTK;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
diff --git a/osu.Game.Tests/Visual/TestCaseQuitButton.cs b/osu.Game.Tests/Visual/TestCaseHoldForMenuButton.cs
similarity index 75%
rename from osu.Game.Tests/Visual/TestCaseQuitButton.cs
rename to osu.Game.Tests/Visual/TestCaseHoldForMenuButton.cs
index a427b7a20a..944921bc2e 100644
--- a/osu.Game.Tests/Visual/TestCaseQuitButton.cs
+++ b/osu.Game.Tests/Visual/TestCaseHoldForMenuButton.cs
@@ -7,31 +7,31 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Screens.Play.HUD;
-using OpenTK;
-using OpenTK.Input;
+using osuTK;
+using osuTK.Input;
namespace osu.Game.Tests.Visual
{
[Description("'Hold to Quit' UI element")]
- public class TestCaseQuitButton : ManualInputManagerTestCase
+ public class TestCaseHoldForMenuButton : ManualInputManagerTestCase
{
private bool exitAction;
[BackgroundDependencyLoader]
private void load()
{
- QuitButton quitButton;
+ HoldForMenuButton holdForMenuButton;
- Add(quitButton = new QuitButton
+ Add(holdForMenuButton = new HoldForMenuButton
{
Origin = Anchor.BottomRight,
Anchor = Anchor.BottomRight,
Action = () => exitAction = true
});
- var text = quitButton.Children.OfType().First();
+ var text = holdForMenuButton.Children.OfType().First();
- AddStep("Trigger text fade in", () => InputManager.MoveMouseTo(quitButton));
+ AddStep("Trigger text fade in", () => InputManager.MoveMouseTo(holdForMenuButton));
AddUntilStep(() => text.IsPresent && !exitAction, "Text visible");
AddStep("Trigger text fade out", () => InputManager.MoveMouseTo(Vector2.One));
AddUntilStep(() => !text.IsPresent && !exitAction, "Text is not visible");
@@ -39,7 +39,7 @@ namespace osu.Game.Tests.Visual
AddStep("Trigger exit action", () =>
{
exitAction = false;
- InputManager.MoveMouseTo(quitButton);
+ InputManager.MoveMouseTo(holdForMenuButton);
InputManager.PressButton(MouseButton.Left);
});
@@ -47,7 +47,7 @@ namespace osu.Game.Tests.Visual
AddAssert("action not triggered", () => !exitAction);
AddStep("Trigger exit action", () => InputManager.PressButton(MouseButton.Left));
- AddUntilStep(() => exitAction, $"{nameof(quitButton.Action)} was triggered");
+ AddUntilStep(() => exitAction, $"{nameof(holdForMenuButton.Action)} was triggered");
}
}
}
diff --git a/osu.Game.Tests/Visual/TestCaseIconButton.cs b/osu.Game.Tests/Visual/TestCaseIconButton.cs
index 14cba71ec8..d1f0727af5 100644
--- a/osu.Game.Tests/Visual/TestCaseIconButton.cs
+++ b/osu.Game.Tests/Visual/TestCaseIconButton.cs
@@ -2,8 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using NUnit.Framework;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
diff --git a/osu.Game.Tests/Visual/TestCaseIdleTracker.cs b/osu.Game.Tests/Visual/TestCaseIdleTracker.cs
new file mode 100644
index 0000000000..33e2df9ff0
--- /dev/null
+++ b/osu.Game.Tests/Visual/TestCaseIdleTracker.cs
@@ -0,0 +1,135 @@
+// Copyright (c) 2007-2018 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using NUnit.Framework;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.Containers;
+using osu.Framework.Graphics.Shapes;
+using osu.Game.Input;
+using osuTK;
+using osuTK.Graphics;
+
+namespace osu.Game.Tests.Visual
+{
+ [TestFixture]
+ public class TestCaseIdleTracker : ManualInputManagerTestCase
+ {
+ private readonly IdleTrackingBox box1;
+ private readonly IdleTrackingBox box2;
+ private readonly IdleTrackingBox box3;
+ private readonly IdleTrackingBox box4;
+
+ public TestCaseIdleTracker()
+ {
+ Children = new Drawable[]
+ {
+ box1 = new IdleTrackingBox(1000)
+ {
+ RelativeSizeAxes = Axes.Both,
+ Colour = Color4.Red,
+ Anchor = Anchor.TopLeft,
+ Origin = Anchor.TopLeft,
+ },
+ box2 = new IdleTrackingBox(2000)
+ {
+ RelativeSizeAxes = Axes.Both,
+ Colour = Color4.Green,
+ Anchor = Anchor.TopRight,
+ Origin = Anchor.TopRight,
+ },
+ box3 = new IdleTrackingBox(3000)
+ {
+ RelativeSizeAxes = Axes.Both,
+ Colour = Color4.Blue,
+ Anchor = Anchor.BottomLeft,
+ Origin = Anchor.BottomLeft,
+ },
+ box4 = new IdleTrackingBox(4000)
+ {
+ RelativeSizeAxes = Axes.Both,
+ Colour = Color4.Orange,
+ Anchor = Anchor.BottomRight,
+ Origin = Anchor.BottomRight,
+ },
+ };
+ }
+
+ [Test]
+ public void TestNudge()
+ {
+ AddStep("move mouse to top left", () => InputManager.MoveMouseTo(box1.ScreenSpaceDrawQuad.Centre));
+
+ AddUntilStep(() => box1.IsIdle && box2.IsIdle && box3.IsIdle && box4.IsIdle, "Wait for all idle");
+
+ AddStep("nudge mouse", () => InputManager.MoveMouseTo(box1.ScreenSpaceDrawQuad.Centre + new Vector2(1)));
+
+ AddAssert("check not idle", () => !box1.IsIdle);
+ AddAssert("check idle", () => box2.IsIdle);
+ AddAssert("check idle", () => box3.IsIdle);
+ AddAssert("check idle", () => box4.IsIdle);
+ }
+
+ [Test]
+ public void TestMovement()
+ {
+ AddStep("move mouse", () => InputManager.MoveMouseTo(box2.ScreenSpaceDrawQuad.Centre));
+
+ AddAssert("check not idle", () => box1.IsIdle);
+ AddAssert("check not idle", () => !box2.IsIdle);
+ AddAssert("check idle", () => box3.IsIdle);
+ AddAssert("check idle", () => box4.IsIdle);
+
+ AddStep("move mouse", () => InputManager.MoveMouseTo(box3.ScreenSpaceDrawQuad.Centre));
+ AddStep("move mouse", () => InputManager.MoveMouseTo(box4.ScreenSpaceDrawQuad.Centre));
+
+ AddAssert("check not idle", () => box1.IsIdle);
+ AddAssert("check not idle", () => !box2.IsIdle);
+ AddAssert("check idle", () => !box3.IsIdle);
+ AddAssert("check idle", () => !box4.IsIdle);
+
+ AddUntilStep(() => box1.IsIdle && box2.IsIdle && box3.IsIdle && box4.IsIdle, "Wait for all idle");
+ }
+
+ [Test]
+ public void TestTimings()
+ {
+ AddStep("move mouse", () => InputManager.MoveMouseTo(ScreenSpaceDrawQuad.Centre));
+
+ AddAssert("check not idle", () => !box1.IsIdle && !box2.IsIdle && !box3.IsIdle && !box4.IsIdle);
+ AddUntilStep(() => box1.IsIdle, "Wait for idle");
+ AddAssert("check not idle", () => !box2.IsIdle && !box3.IsIdle && !box4.IsIdle);
+ AddUntilStep(() => box2.IsIdle, "Wait for idle");
+ AddAssert("check not idle", () => !box3.IsIdle && !box4.IsIdle);
+ AddUntilStep(() => box3.IsIdle, "Wait for idle");
+
+ AddUntilStep(() => box1.IsIdle && box2.IsIdle && box3.IsIdle && box4.IsIdle, "Wait for all idle");
+ }
+
+ private class IdleTrackingBox : CompositeDrawable
+ {
+ private readonly IdleTracker idleTracker;
+
+ public bool IsIdle => idleTracker.IsIdle.Value;
+
+ public IdleTrackingBox(double timeToIdle)
+ {
+ Box box;
+
+ Alpha = 0.6f;
+ Scale = new Vector2(0.6f);
+
+ InternalChildren = new Drawable[]
+ {
+ idleTracker = new IdleTracker(timeToIdle),
+ box = new Box
+ {
+ Colour = Color4.White,
+ RelativeSizeAxes = Axes.Both,
+ },
+ };
+
+ idleTracker.IsIdle.BindValueChanged(idle => box.Colour = idle ? Color4.White : Color4.Black, true);
+ }
+ }
+ }
+}
diff --git a/osu.Game.Tests/Visual/TestCaseIntroSequence.cs b/osu.Game.Tests/Visual/TestCaseIntroSequence.cs
index 4982686505..9ce8a4ddd6 100644
--- a/osu.Game.Tests/Visual/TestCaseIntroSequence.cs
+++ b/osu.Game.Tests/Visual/TestCaseIntroSequence.cs
@@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
diff --git a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs
index 178b47ed33..465b943651 100644
--- a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs
+++ b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs
@@ -9,7 +9,7 @@ using osu.Framework.Graphics;
using osu.Framework.MathUtils;
using osu.Framework.Timing;
using osu.Game.Screens.Play;
-using OpenTK.Input;
+using osuTK.Input;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseLeaderboard.cs b/osu.Game.Tests/Visual/TestCaseLeaderboard.cs
index e8ac19e7fc..d4a2fcc62c 100644
--- a/osu.Game.Tests/Visual/TestCaseLeaderboard.cs
+++ b/osu.Game.Tests/Visual/TestCaseLeaderboard.cs
@@ -9,7 +9,7 @@ using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Select.Leaderboards;
using osu.Game.Users;
using osu.Framework.Allocation;
-using OpenTK;
+using osuTK;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets;
diff --git a/osu.Game.Tests/Visual/TestCaseLoaderAnimation.cs b/osu.Game.Tests/Visual/TestCaseLoaderAnimation.cs
index 600784f8db..da2427ff6f 100644
--- a/osu.Game.Tests/Visual/TestCaseLoaderAnimation.cs
+++ b/osu.Game.Tests/Visual/TestCaseLoaderAnimation.cs
@@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Screens;
using osu.Game.Screens.Menu;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseLoadingAnimation.cs b/osu.Game.Tests/Visual/TestCaseLoadingAnimation.cs
index ebbc673d36..e52564c40d 100644
--- a/osu.Game.Tests/Visual/TestCaseLoadingAnimation.cs
+++ b/osu.Game.Tests/Visual/TestCaseLoadingAnimation.cs
@@ -5,7 +5,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Testing;
using osu.Game.Graphics.UserInterface;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseLounge.cs b/osu.Game.Tests/Visual/TestCaseLounge.cs
index 174873b011..e0e6332ef0 100644
--- a/osu.Game.Tests/Visual/TestCaseLounge.cs
+++ b/osu.Game.Tests/Visual/TestCaseLounge.cs
@@ -13,7 +13,7 @@ using osu.Game.Screens.Backgrounds;
using osu.Game.Screens.Multi.Components;
using osu.Game.Screens.Multi.Screens.Lounge;
using osu.Game.Users;
-using OpenTK.Input;
+using osuTK.Input;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseMods.cs b/osu.Game.Tests/Visual/TestCaseMods.cs
index ab53dbd968..029f7da5a9 100644
--- a/osu.Game.Tests/Visual/TestCaseMods.cs
+++ b/osu.Game.Tests/Visual/TestCaseMods.cs
@@ -7,7 +7,7 @@ using osu.Framework.Graphics;
using osu.Game.Overlays.Mods;
using osu.Game.Rulesets;
using osu.Game.Screens.Play.HUD;
-using OpenTK;
+using osuTK;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Osu.Mods;
using System.Linq;
@@ -19,7 +19,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Overlays.Mods.Sections;
using osu.Game.Rulesets.Mania.Mods;
using osu.Game.Rulesets.UI;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseOsuGame.cs b/osu.Game.Tests/Visual/TestCaseOsuGame.cs
index 7a4e4c1210..924a2b5e15 100644
--- a/osu.Game.Tests/Visual/TestCaseOsuGame.cs
+++ b/osu.Game.Tests/Visual/TestCaseOsuGame.cs
@@ -8,7 +8,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Screens;
using osu.Game.Screens.Menu;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCasePlaybackControl.cs b/osu.Game.Tests/Visual/TestCasePlaybackControl.cs
index 36fb1bcedd..4352b2bc3a 100644
--- a/osu.Game.Tests/Visual/TestCasePlaybackControl.cs
+++ b/osu.Game.Tests/Visual/TestCasePlaybackControl.cs
@@ -8,7 +8,7 @@ using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Screens.Edit.Components;
using osu.Game.Tests.Beatmaps;
-using OpenTK;
+using osuTK;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseRankGraph.cs b/osu.Game.Tests/Visual/TestCaseRankGraph.cs
index f5558620ad..f8eea7d63c 100644
--- a/osu.Game.Tests/Visual/TestCaseRankGraph.cs
+++ b/osu.Game.Tests/Visual/TestCaseRankGraph.cs
@@ -3,7 +3,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using System.Collections.Generic;
diff --git a/osu.Game.Tests/Visual/TestCaseRoomSettings.cs b/osu.Game.Tests/Visual/TestCaseRoomSettings.cs
new file mode 100644
index 0000000000..40742ce709
--- /dev/null
+++ b/osu.Game.Tests/Visual/TestCaseRoomSettings.cs
@@ -0,0 +1,119 @@
+// Copyright (c) 2007-2018 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using NUnit.Framework;
+using osu.Framework.Graphics;
+using osu.Framework.Testing.Input;
+using osu.Game.Online.Multiplayer;
+using osu.Game.Screens.Multi.Screens.Match.Settings;
+using osuTK.Input;
+
+namespace osu.Game.Tests.Visual
+{
+ [TestFixture]
+ public class TestCaseRoomSettings : ManualInputManagerTestCase
+ {
+ private readonly Room room;
+ private readonly TestRoomSettingsOverlay overlay;
+
+ public TestCaseRoomSettings()
+ {
+ room = new Room
+ {
+ Name = { Value = "One Testing Room" },
+ Availability = { Value = RoomAvailability.Public },
+ Type = { Value = new GameTypeTeamVersus() },
+ MaxParticipants = { Value = 10 },
+ };
+
+ Add(overlay = new TestRoomSettingsOverlay(room)
+ {
+ RelativeSizeAxes = Axes.Both,
+ Height = 0.75f,
+ });
+
+ AddStep(@"show", overlay.Show);
+ assertAll();
+ AddStep(@"set name", () => overlay.CurrentName = @"Two Testing Room");
+ AddStep(@"set max", () => overlay.CurrentMaxParticipants = null);
+ AddStep(@"set availability", () => overlay.CurrentAvailability = RoomAvailability.InviteOnly);
+ AddStep(@"set type", () => overlay.CurrentType = new GameTypeTagTeam());
+ apply();
+ assertAll();
+ AddStep(@"show", overlay.Show);
+ AddStep(@"set room name", () => room.Name.Value = @"Room Changed Name!");
+ AddStep(@"set room availability", () => room.Availability.Value = RoomAvailability.Public);
+ AddStep(@"set room type", () => room.Type.Value = new GameTypeTag());
+ AddStep(@"set room max", () => room.MaxParticipants.Value = 100);
+ assertAll();
+ AddStep(@"set name", () => overlay.CurrentName = @"Unsaved Testing Room");
+ AddStep(@"set max", () => overlay.CurrentMaxParticipants = 20);
+ AddStep(@"set availability", () => overlay.CurrentAvailability = RoomAvailability.FriendsOnly);
+ AddStep(@"set type", () => overlay.CurrentType = new GameTypeVersus());
+ AddStep(@"hide", overlay.Hide);
+ AddWaitStep(5);
+ AddStep(@"show", overlay.Show);
+ assertAll();
+ AddStep(@"hide", overlay.Hide);
+ }
+
+ private void apply()
+ {
+ AddStep(@"apply", () =>
+ {
+ overlay.ClickApplyButton(InputManager);
+ });
+ }
+
+ private void assertAll()
+ {
+ AddAssert(@"name == room name", () => overlay.CurrentName == room.Name.Value);
+ AddAssert(@"max == room max", () => overlay.CurrentMaxParticipants == room.MaxParticipants.Value);
+ AddAssert(@"availability == room availability", () => overlay.CurrentAvailability == room.Availability.Value);
+ AddAssert(@"type == room type", () => Equals(overlay.CurrentType, room.Type.Value));
+ }
+
+ private class TestRoomSettingsOverlay : RoomSettingsOverlay
+ {
+ public string CurrentName
+ {
+ get => NameField.Text;
+ set => NameField.Text = value;
+ }
+
+ public int? CurrentMaxParticipants
+ {
+ get
+ {
+ if (int.TryParse(MaxParticipantsField.Text, out int max))
+ return max;
+
+ return null;
+ }
+ set => MaxParticipantsField.Text = value?.ToString();
+ }
+
+ public RoomAvailability CurrentAvailability
+ {
+ get => AvailabilityPicker.Current.Value;
+ set => AvailabilityPicker.Current.Value = value;
+ }
+
+ public GameType CurrentType
+ {
+ get => TypePicker.Current.Value;
+ set => TypePicker.Current.Value = value;
+ }
+
+ public TestRoomSettingsOverlay(Room room) : base(room)
+ {
+ }
+
+ public void ClickApplyButton(ManualInputManager inputManager)
+ {
+ inputManager.MoveMouseTo(ApplyButton);
+ inputManager.Click(MouseButton.Left);
+ }
+ }
+ }
+}
diff --git a/osu.Game.Tests/Visual/TestCaseScoreCounter.cs b/osu.Game.Tests/Visual/TestCaseScoreCounter.cs
index 4dff7547d9..c32ca104ed 100644
--- a/osu.Game.Tests/Visual/TestCaseScoreCounter.cs
+++ b/osu.Game.Tests/Visual/TestCaseScoreCounter.cs
@@ -7,7 +7,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.MathUtils;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Play.HUD;
-using OpenTK;
+using osuTK;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseScreenBreadcrumbControl.cs b/osu.Game.Tests/Visual/TestCaseScreenBreadcrumbControl.cs
index b70117a3ad..82da609e49 100644
--- a/osu.Game.Tests/Visual/TestCaseScreenBreadcrumbControl.cs
+++ b/osu.Game.Tests/Visual/TestCaseScreenBreadcrumbControl.cs
@@ -11,7 +11,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens;
-using OpenTK;
+using osuTK;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs
index a486abb9e8..3ac85cd846 100644
--- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs
+++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs
@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Extensions.IEnumerableExtensions;
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
diff --git a/osu.Game.Tests/Visual/TestCaseStoryboard.cs b/osu.Game.Tests/Visual/TestCaseStoryboard.cs
index b63881ffa7..42c0134afa 100644
--- a/osu.Game.Tests/Visual/TestCaseStoryboard.cs
+++ b/osu.Game.Tests/Visual/TestCaseStoryboard.cs
@@ -10,7 +10,7 @@ using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Overlays;
using osu.Game.Storyboards.Drawables;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseTabControl.cs b/osu.Game.Tests/Visual/TestCaseTabControl.cs
index 63708c5662..00b69fd415 100644
--- a/osu.Game.Tests/Visual/TestCaseTabControl.cs
+++ b/osu.Game.Tests/Visual/TestCaseTabControl.cs
@@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Select.Filter;
-using OpenTK;
+using osuTK;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs
index 75b149af29..50ebd3a6e5 100644
--- a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs
+++ b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs
@@ -7,7 +7,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Game.Graphics;
-using OpenTK;
+using osuTK;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseUserPanel.cs b/osu.Game.Tests/Visual/TestCaseUserPanel.cs
index 8e2e708cc7..a53af247f3 100644
--- a/osu.Game.Tests/Visual/TestCaseUserPanel.cs
+++ b/osu.Game.Tests/Visual/TestCaseUserPanel.cs
@@ -5,7 +5,7 @@ using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Users;
-using OpenTK;
+using osuTK;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseVolumePieces.cs b/osu.Game.Tests/Visual/TestCaseVolumePieces.cs
index 3c5b91ccd2..5d7b7088e7 100644
--- a/osu.Game.Tests/Visual/TestCaseVolumePieces.cs
+++ b/osu.Game.Tests/Visual/TestCaseVolumePieces.cs
@@ -5,8 +5,8 @@ using System;
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Game.Overlays.Volume;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseWaveContainer.cs b/osu.Game.Tests/Visual/TestCaseWaveContainer.cs
index 2163d7c3aa..69f1e33579 100644
--- a/osu.Game.Tests/Visual/TestCaseWaveContainer.cs
+++ b/osu.Game.Tests/Visual/TestCaseWaveContainer.cs
@@ -9,8 +9,8 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game.Tests/Visual/TestCaseWaveform.cs b/osu.Game.Tests/Visual/TestCaseWaveform.cs
index 46d46863ad..f97091e58d 100644
--- a/osu.Game.Tests/Visual/TestCaseWaveform.cs
+++ b/osu.Game.Tests/Visual/TestCaseWaveform.cs
@@ -2,8 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using NUnit.Framework;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Audio;
diff --git a/osu.Game.Tests/Visual/TestCaseZoomableScrollContainer.cs b/osu.Game.Tests/Visual/TestCaseZoomableScrollContainer.cs
index 3bf809ebde..7dca99685e 100644
--- a/osu.Game.Tests/Visual/TestCaseZoomableScrollContainer.cs
+++ b/osu.Game.Tests/Visual/TestCaseZoomableScrollContainer.cs
@@ -11,8 +11,8 @@ using osu.Framework.MathUtils;
using osu.Game.Graphics;
using osu.Game.Graphics.Cursor;
using osu.Game.Screens.Edit.Compose.Components.Timeline;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Tests.Visual
{
diff --git a/osu.Game/Beatmaps/ControlPoints/DifficultyControlPoint.cs b/osu.Game/Beatmaps/ControlPoints/DifficultyControlPoint.cs
index 526bddf51a..dc981cd934 100644
--- a/osu.Game/Beatmaps/ControlPoints/DifficultyControlPoint.cs
+++ b/osu.Game/Beatmaps/ControlPoints/DifficultyControlPoint.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
namespace osu.Game.Beatmaps.ControlPoints
{
diff --git a/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs b/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs
index 81eddaa43a..ecd7ff252c 100644
--- a/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs
+++ b/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Game.Beatmaps.Timing;
namespace osu.Game.Beatmaps.ControlPoints
diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetDownloader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetDownloader.cs
index 5b5dbec9c8..160d081b8a 100644
--- a/osu.Game/Beatmaps/Drawables/BeatmapSetDownloader.cs
+++ b/osu.Game/Beatmaps/Drawables/BeatmapSetDownloader.cs
@@ -78,17 +78,17 @@ namespace osu.Game.Beatmaps.Drawables
}
}
- private void setAdded(BeatmapSetInfo s)
+ private void setAdded(BeatmapSetInfo s) => Schedule(() =>
{
if (s.OnlineBeatmapSetID == set.OnlineBeatmapSetID)
DownloadState.Value = DownloadStatus.Downloaded;
- }
+ });
- private void setRemoved(BeatmapSetInfo s)
+ private void setRemoved(BeatmapSetInfo s) => Schedule(() =>
{
if (s.OnlineBeatmapSetID == set.OnlineBeatmapSetID)
DownloadState.Value = DownloadStatus.NotDownloaded;
- }
+ });
private void downloadBegan(DownloadBeatmapSetRequest d)
{
diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs
index da281b4db3..a7dff1aefc 100644
--- a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs
+++ b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs
@@ -5,7 +5,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Sprites;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Beatmaps.Drawables
{
diff --git a/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs b/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs
index 7d00c35862..0d421ff690 100644
--- a/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs
+++ b/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs
@@ -5,7 +5,7 @@ using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Beatmaps.Drawables
{
diff --git a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs
index 24604711d4..14162c35c0 100644
--- a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs
+++ b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs
@@ -9,8 +9,8 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Beatmaps.Drawables
{
diff --git a/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs b/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs
index 1976db907c..9a1617b550 100644
--- a/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs
+++ b/osu.Game/Beatmaps/Drawables/UpdateableBeatmapSetCover.cs
@@ -4,7 +4,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Beatmaps.Drawables
{
diff --git a/osu.Game/Beatmaps/Formats/IHasComboColours.cs b/osu.Game/Beatmaps/Formats/IHasComboColours.cs
index d3377c2717..d47377dc8d 100644
--- a/osu.Game/Beatmaps/Formats/IHasComboColours.cs
+++ b/osu.Game/Beatmaps/Formats/IHasComboColours.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Beatmaps.Formats
{
diff --git a/osu.Game/Beatmaps/Formats/IHasCustomColours.cs b/osu.Game/Beatmaps/Formats/IHasCustomColours.cs
index 32390ac484..a319d0e48e 100644
--- a/osu.Game/Beatmaps/Formats/IHasCustomColours.cs
+++ b/osu.Game/Beatmaps/Formats/IHasCustomColours.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Beatmaps.Formats
{
diff --git a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs
index 2ef7c5de30..217f16b263 100644
--- a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs
+++ b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs
@@ -7,7 +7,7 @@ using System.IO;
using osu.Framework.Logging;
using osu.Game.Audio;
using osu.Game.Beatmaps.ControlPoints;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Beatmaps.Formats
{
diff --git a/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs
index 375c0b29c0..d30c78cb17 100644
--- a/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs
+++ b/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs
@@ -5,8 +5,8 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.IO.File;
using osu.Game.Storyboards;
diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs
index 9ac2cabe9f..8975ab8a0e 100644
--- a/osu.Game/Configuration/OsuConfigManager.cs
+++ b/osu.Game/Configuration/OsuConfigManager.cs
@@ -42,6 +42,8 @@ namespace osu.Game.Configuration
if (!val) Set(OsuSetting.SavePassword, false);
};
+ Set(OsuSetting.ExternalLinkWarning, true);
+
// Audio
Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01);
@@ -148,6 +150,7 @@ namespace osu.Game.Configuration
BeatmapSkins,
BeatmapHitsounds,
IncreaseFirstObjectVisibility,
- ScoreDisplayMode
+ ScoreDisplayMode,
+ ExternalLinkWarning
}
}
diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs
index 4a86d0e4f6..eb8dc7243e 100644
--- a/osu.Game/Graphics/Backgrounds/Triangles.cs
+++ b/osu.Game/Graphics/Backgrounds/Triangles.cs
@@ -3,12 +3,12 @@
using osu.Framework.Graphics;
using osu.Framework.MathUtils;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using System;
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Textures;
-using OpenTK.Graphics.ES30;
+using osuTK.Graphics.ES30;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Allocation;
diff --git a/osu.Game/Graphics/Containers/ConstrainedIconContainer.cs b/osu.Game/Graphics/Containers/ConstrainedIconContainer.cs
index 7289bfe52c..aae05ca767 100644
--- a/osu.Game/Graphics/Containers/ConstrainedIconContainer.cs
+++ b/osu.Game/Graphics/Containers/ConstrainedIconContainer.cs
@@ -4,7 +4,7 @@
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
+using osuTK;
namespace osu.Game.Graphics.Containers
{
diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs
index 5c8fddc342..54a2ea47f9 100644
--- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs
+++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs
@@ -8,7 +8,6 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites;
using System.Collections.Generic;
using osu.Framework.Logging;
-using osu.Framework.Platform;
using osu.Game.Overlays;
using osu.Game.Overlays.Notifications;
@@ -24,14 +23,12 @@ namespace osu.Game.Graphics.Containers
private OsuGame game;
private ChannelManager channelManager;
private Action showNotImplementedError;
- private GameHost host;
[BackgroundDependencyLoader(true)]
- private void load(OsuGame game, NotificationOverlay notifications, GameHost host, ChannelManager channelManager)
+ private void load(OsuGame game, NotificationOverlay notifications, ChannelManager channelManager)
{
// will be null in tests
this.game = game;
- this.host = host;
this.channelManager = channelManager;
showNotImplementedError = () => notifications?.Post(new SimpleNotification
@@ -98,7 +95,7 @@ namespace osu.Game.Graphics.Containers
showNotImplementedError?.Invoke();
break;
case LinkAction.External:
- host.OpenUrlExternally(url);
+ game?.OpenUrlExternally(url);
break;
case LinkAction.OpenUserProfile:
if (long.TryParse(linkArgument, out long userId))
diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs
index 2aa3fede2c..a24b6594e0 100644
--- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs
+++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs
@@ -5,7 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics.Containers;
-using OpenTK;
+using osuTK;
using osu.Framework.Configuration;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
diff --git a/osu.Game/Graphics/Containers/OsuHoverContainer.cs b/osu.Game/Graphics/Containers/OsuHoverContainer.cs
index 577d889be3..af804735a8 100644
--- a/osu.Game/Graphics/Containers/OsuHoverContainer.cs
+++ b/osu.Game/Graphics/Containers/OsuHoverContainer.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Graphics/Containers/OsuScrollContainer.cs b/osu.Game/Graphics/Containers/OsuScrollContainer.cs
index 4f18eb9e7b..8aeade9265 100644
--- a/osu.Game/Graphics/Containers/OsuScrollContainer.cs
+++ b/osu.Game/Graphics/Containers/OsuScrollContainer.cs
@@ -3,7 +3,7 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Events;
-using OpenTK.Input;
+using osuTK.Input;
namespace osu.Game.Graphics.Containers
{
diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs
index a6b79a20dc..97e12ec0f9 100644
--- a/osu.Game/Graphics/Containers/ParallaxContainer.cs
+++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs
@@ -4,7 +4,7 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics;
using osu.Framework.Input;
-using OpenTK;
+using osuTK;
using osu.Framework.Allocation;
using osu.Game.Configuration;
using osu.Framework.Configuration;
diff --git a/osu.Game/Graphics/Containers/WaveContainer.cs b/osu.Game/Graphics/Containers/WaveContainer.cs
index 82432c6ee7..96a2304ed1 100644
--- a/osu.Game/Graphics/Containers/WaveContainer.cs
+++ b/osu.Game/Graphics/Containers/WaveContainer.cs
@@ -6,7 +6,7 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Graphics.Containers
{
diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs
index ba858bf52d..87d97806cd 100644
--- a/osu.Game/Graphics/Cursor/MenuCursor.cs
+++ b/osu.Game/Graphics/Cursor/MenuCursor.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
@@ -13,7 +13,7 @@ using System;
using JetBrains.Annotations;
using osu.Framework.Graphics.Textures;
using osu.Framework.Input.Events;
-using OpenTK.Input;
+using osuTK.Input;
namespace osu.Game.Graphics.Cursor
{
diff --git a/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs
index 44156f6e83..e7a9aab622 100644
--- a/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs
+++ b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Graphics/IHasAccentColour.cs b/osu.Game/Graphics/IHasAccentColour.cs
index 64c240aa84..0718e84a34 100644
--- a/osu.Game/Graphics/IHasAccentColour.cs
+++ b/osu.Game/Graphics/IHasAccentColour.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
diff --git a/osu.Game/Graphics/OsuColour.cs b/osu.Game/Graphics/OsuColour.cs
index 7236248f18..fc627fa501 100644
--- a/osu.Game/Graphics/OsuColour.cs
+++ b/osu.Game/Graphics/OsuColour.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Graphics
{
diff --git a/osu.Game/Graphics/SpriteIcon.cs b/osu.Game/Graphics/SpriteIcon.cs
index 1b1df45c77..2d63d0a52c 100644
--- a/osu.Game/Graphics/SpriteIcon.cs
+++ b/osu.Game/Graphics/SpriteIcon.cs
@@ -7,8 +7,8 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics;
using osu.Framework.IO.Stores;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Caching;
namespace osu.Game.Graphics
diff --git a/osu.Game/Graphics/UserInterface/Bar.cs b/osu.Game/Graphics/UserInterface/Bar.cs
index 16c63a12f4..89bd6f6118 100644
--- a/osu.Game/Graphics/UserInterface/Bar.cs
+++ b/osu.Game/Graphics/UserInterface/Bar.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
diff --git a/osu.Game/Graphics/UserInterface/BarGraph.cs b/osu.Game/Graphics/UserInterface/BarGraph.cs
index 0ba49929e9..f461a0f296 100644
--- a/osu.Game/Graphics/UserInterface/BarGraph.cs
+++ b/osu.Game/Graphics/UserInterface/BarGraph.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using System.Collections.Generic;
diff --git a/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs b/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs
index ebb7b686e4..d4ef335c3e 100644
--- a/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs
+++ b/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using OpenTK;
+using osuTK;
using osu.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game/Graphics/UserInterface/DialogButton.cs b/osu.Game/Graphics/UserInterface/DialogButton.cs
index b2220267ff..24bac05384 100644
--- a/osu.Game/Graphics/UserInterface/DialogButton.cs
+++ b/osu.Game/Graphics/UserInterface/DialogButton.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Shapes;
diff --git a/osu.Game/Graphics/UserInterface/ExternalLinkButton.cs b/osu.Game/Graphics/UserInterface/ExternalLinkButton.cs
index d82448e8a2..8f8ba1ede8 100644
--- a/osu.Game/Graphics/UserInterface/ExternalLinkButton.cs
+++ b/osu.Game/Graphics/UserInterface/ExternalLinkButton.cs
@@ -7,8 +7,8 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Input.Events;
using osu.Framework.Platform;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Graphics.UserInterface
{
diff --git a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs
index 122ac7b627..0564d364ed 100644
--- a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs
+++ b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs
@@ -1,11 +1,11 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK.Graphics;
+using osuTK.Graphics;
using System;
using osu.Framework.Input.Events;
using osu.Game.Input.Bindings;
-using OpenTK.Input;
+using osuTK.Input;
namespace osu.Game.Graphics.UserInterface
{
diff --git a/osu.Game/Graphics/UserInterface/IconButton.cs b/osu.Game/Graphics/UserInterface/IconButton.cs
index f10f03873d..c59326a256 100644
--- a/osu.Game/Graphics/UserInterface/IconButton.cs
+++ b/osu.Game/Graphics/UserInterface/IconButton.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Input.Events;
diff --git a/osu.Game/Graphics/UserInterface/LineGraph.cs b/osu.Game/Graphics/UserInterface/LineGraph.cs
index ff2c4cf7cd..c84c500201 100644
--- a/osu.Game/Graphics/UserInterface/LineGraph.cs
+++ b/osu.Game/Graphics/UserInterface/LineGraph.cs
@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Caching;
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Lines;
diff --git a/osu.Game/Graphics/UserInterface/LoadingAnimation.cs b/osu.Game/Graphics/UserInterface/LoadingAnimation.cs
index 8d45b03a43..e503436d47 100644
--- a/osu.Game/Graphics/UserInterface/LoadingAnimation.cs
+++ b/osu.Game/Graphics/UserInterface/LoadingAnimation.cs
@@ -3,8 +3,8 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Graphics.UserInterface
{
diff --git a/osu.Game/Graphics/UserInterface/Nub.cs b/osu.Game/Graphics/UserInterface/Nub.cs
index 84b7fd9dae..974708af97 100644
--- a/osu.Game/Graphics/UserInterface/Nub.cs
+++ b/osu.Game/Graphics/UserInterface/Nub.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
diff --git a/osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs b/osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs
index 4516d7ce76..89760a9873 100644
--- a/osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs
+++ b/osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs
@@ -8,7 +8,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Game.Graphics.Containers;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Graphics.UserInterface
{
diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs
index ab880cd473..0ff4542678 100644
--- a/osu.Game/Graphics/UserInterface/OsuButton.cs
+++ b/osu.Game/Graphics/UserInterface/OsuButton.cs
@@ -9,7 +9,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Game.Graphics.Sprites;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Graphics.UserInterface
{
diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs
index e267a7f848..194e81dae1 100644
--- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs
+++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs
@@ -10,7 +10,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Game.Graphics.Sprites;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Graphics.UserInterface
{
diff --git a/osu.Game/Graphics/UserInterface/OsuContextMenu.cs b/osu.Game/Graphics/UserInterface/OsuContextMenu.cs
index 9b697f291f..2dd6d4fe78 100644
--- a/osu.Game/Graphics/UserInterface/OsuContextMenu.cs
+++ b/osu.Game/Graphics/UserInterface/OsuContextMenu.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs
index 30803d1545..3f15616d6c 100644
--- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs
+++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Linq;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
@@ -10,7 +10,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Sprites;
-using OpenTK;
+using osuTK;
namespace osu.Game.Graphics.UserInterface
{
diff --git a/osu.Game/Graphics/UserInterface/OsuEnumDropdown.cs b/osu.Game/Graphics/UserInterface/OsuEnumDropdown.cs
index 502f468ec9..5c6a2a0569 100644
--- a/osu.Game/Graphics/UserInterface/OsuEnumDropdown.cs
+++ b/osu.Game/Graphics/UserInterface/OsuEnumDropdown.cs
@@ -2,9 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using System.ComponentModel;
-using System.Reflection;
-using System.Collections.Generic;
namespace osu.Game.Graphics.UserInterface
{
@@ -15,18 +12,7 @@ namespace osu.Game.Graphics.UserInterface
if (!typeof(T).IsEnum)
throw new InvalidOperationException("OsuEnumDropdown only supports enums as the generic type argument");
- List> items = new List>();
- foreach (var val in (T[])Enum.GetValues(typeof(T)))
- {
- var field = typeof(T).GetField(Enum.GetName(typeof(T), val));
- items.Add(
- new KeyValuePair(
- field.GetCustomAttribute()?.Description ?? Enum.GetName(typeof(T), val),
- val
- )
- );
- }
- Items = items;
+ Items = (T[])Enum.GetValues(typeof(T));
}
}
}
diff --git a/osu.Game/Graphics/UserInterface/OsuMenu.cs b/osu.Game/Graphics/UserInterface/OsuMenu.cs
index fe3e866a70..570ed368d8 100644
--- a/osu.Game/Graphics/UserInterface/OsuMenu.cs
+++ b/osu.Game/Graphics/UserInterface/OsuMenu.cs
@@ -4,7 +4,7 @@
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@@ -12,7 +12,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Game.Graphics.Sprites;
-using OpenTK;
+using osuTK;
namespace osu.Game.Graphics.UserInterface
{
diff --git a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs
index f4ec67db23..c8a1bf9178 100644
--- a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs
+++ b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs
@@ -1,9 +1,9 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
-using OpenTK.Input;
+using osuTK;
+using osuTK.Graphics;
+using osuTK.Input;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs
index eecc10469e..a59abcbcee 100644
--- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs
+++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs
@@ -3,8 +3,8 @@
using System;
using System.Globalization;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs
index e7d6a87349..488e16b6fb 100644
--- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs
+++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs
@@ -3,8 +3,8 @@
using System;
using System.Linq;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Extensions;
diff --git a/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs
index 1355ffdb8e..cb951898da 100644
--- a/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs
+++ b/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs
index 37464faa73..523b60fdd2 100644
--- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs
+++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs
@@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Sprites;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
diff --git a/osu.Game/Graphics/UserInterface/PageTabControl.cs b/osu.Game/Graphics/UserInterface/PageTabControl.cs
index fb7b4c5676..50e4743028 100644
--- a/osu.Game/Graphics/UserInterface/PageTabControl.cs
+++ b/osu.Game/Graphics/UserInterface/PageTabControl.cs
@@ -2,8 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Graphics/UserInterface/PercentageCounter.cs b/osu.Game/Graphics/UserInterface/PercentageCounter.cs
index ef3fc156e7..b1514cb8c8 100644
--- a/osu.Game/Graphics/UserInterface/PercentageCounter.cs
+++ b/osu.Game/Graphics/UserInterface/PercentageCounter.cs
@@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
+using osu.Framework.Allocation;
namespace osu.Game.Graphics.UserInterface
{
@@ -25,6 +26,9 @@ namespace osu.Game.Graphics.UserInterface
Current.Value = DisplayedCount = 1.0f;
}
+ [BackgroundDependencyLoader]
+ private void load(OsuColour colours) => AccentColour = colours.BlueLighter;
+
protected override string FormatCount(double count)
{
return $@"{count:P2}";
diff --git a/osu.Game/Graphics/UserInterface/ProgressBar.cs b/osu.Game/Graphics/UserInterface/ProgressBar.cs
index beb1d0055e..ee64c7c25c 100644
--- a/osu.Game/Graphics/UserInterface/ProgressBar.cs
+++ b/osu.Game/Graphics/UserInterface/ProgressBar.cs
@@ -5,7 +5,7 @@ using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Graphics.UserInterface
{
diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs
index c2162b8a42..5a9dd4e05e 100644
--- a/osu.Game/Graphics/UserInterface/RollingCounter.cs
+++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs
@@ -8,7 +8,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
using System;
using System.Collections.Generic;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Graphics.UserInterface
{
diff --git a/osu.Game/Graphics/UserInterface/ScoreCounter.cs b/osu.Game/Graphics/UserInterface/ScoreCounter.cs
index df26f81629..8bf30c32c6 100644
--- a/osu.Game/Graphics/UserInterface/ScoreCounter.cs
+++ b/osu.Game/Graphics/UserInterface/ScoreCounter.cs
@@ -1,6 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using osu.Framework.Allocation;
using osu.Framework.Graphics;
namespace osu.Game.Graphics.UserInterface
@@ -31,6 +32,9 @@ namespace osu.Game.Graphics.UserInterface
LeadingZeroes = leading;
}
+ [BackgroundDependencyLoader]
+ private void load(OsuColour colours) => AccentColour = colours.BlueLighter;
+
protected override double GetProportionalDuration(double currentValue, double newValue)
{
return currentValue > newValue ? currentValue - newValue : newValue - currentValue;
diff --git a/osu.Game/Graphics/UserInterface/SearchTextBox.cs b/osu.Game/Graphics/UserInterface/SearchTextBox.cs
index 08e93fad18..40db6677f5 100644
--- a/osu.Game/Graphics/UserInterface/SearchTextBox.cs
+++ b/osu.Game/Graphics/UserInterface/SearchTextBox.cs
@@ -3,8 +3,8 @@
using osu.Framework.Graphics;
using osu.Framework.Input.Events;
-using OpenTK;
-using OpenTK.Input;
+using osuTK;
+using osuTK.Input;
namespace osu.Game.Graphics.UserInterface
{
diff --git a/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs b/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs
index cf55240e71..ddc48c9be7 100644
--- a/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs
+++ b/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs
@@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
+using osu.Framework.Allocation;
namespace osu.Game.Graphics.UserInterface
{
@@ -17,6 +18,9 @@ namespace osu.Game.Graphics.UserInterface
Current.Value = DisplayedCount = 0;
}
+ [BackgroundDependencyLoader]
+ private void load(OsuColour colours) => AccentColour = colours.BlueLighter;
+
protected override string FormatCount(int count)
{
return $@"{count}x";
diff --git a/osu.Game/Graphics/UserInterface/StarCounter.cs b/osu.Game/Graphics/UserInterface/StarCounter.cs
index 621b5dcf11..009a2a2e1b 100644
--- a/osu.Game/Graphics/UserInterface/StarCounter.cs
+++ b/osu.Game/Graphics/UserInterface/StarCounter.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.MathUtils;
diff --git a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs
index 2000eb47e4..16f727b783 100644
--- a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs
+++ b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs
@@ -4,8 +4,8 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Framework.Extensions.Color4Extensions;
using osu.Game.Graphics.Containers;
diff --git a/osu.Game/IO/Serialization/Converters/Vector2Converter.cs b/osu.Game/IO/Serialization/Converters/Vector2Converter.cs
index ba2158df28..4b057c0f2f 100644
--- a/osu.Game/IO/Serialization/Converters/Vector2Converter.cs
+++ b/osu.Game/IO/Serialization/Converters/Vector2Converter.cs
@@ -4,7 +4,7 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
-using OpenTK;
+using osuTK;
namespace osu.Game.IO.Serialization.Converters
{
diff --git a/osu.Game/Input/Handlers/ReplayInputHandler.cs b/osu.Game/Input/Handlers/ReplayInputHandler.cs
index 0a62c6ca72..c8c5657e41 100644
--- a/osu.Game/Input/Handlers/ReplayInputHandler.cs
+++ b/osu.Game/Input/Handlers/ReplayInputHandler.cs
@@ -10,7 +10,7 @@ using osu.Framework.Input.StateChanges.Events;
using osu.Framework.Input.States;
using osu.Framework.Platform;
using osu.Game.Rulesets.UI;
-using OpenTK;
+using osuTK;
namespace osu.Game.Input.Handlers
{
diff --git a/osu.Game/Input/IdleTracker.cs b/osu.Game/Input/IdleTracker.cs
new file mode 100644
index 0000000000..d96fa8bd34
--- /dev/null
+++ b/osu.Game/Input/IdleTracker.cs
@@ -0,0 +1,71 @@
+// Copyright (c) 2007-2018 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using osu.Framework.Configuration;
+using osu.Framework.Graphics;
+using osu.Framework.Input;
+using osu.Framework.Input.Bindings;
+using osu.Framework.Input.Events;
+
+namespace osu.Game.Input
+{
+ ///
+ /// Track whether the end-user is in an idle state, based on their last interaction with the game.
+ ///
+ public class IdleTracker : Component, IKeyBindingHandler, IHandleGlobalInput
+ {
+ private readonly double timeToIdle;
+
+ private double lastInteractionTime;
+
+ protected double TimeSpentIdle => Clock.CurrentTime - lastInteractionTime;
+
+ ///
+ /// Whether the user is currently in an idle state.
+ ///
+ public IBindable IsIdle => isIdle;
+
+ private readonly BindableBool isIdle = new BindableBool();
+
+ ///
+ /// Intstantiate a new .
+ ///
+ /// The length in milliseconds until an idle state should be assumed.
+ public IdleTracker(double timeToIdle)
+ {
+ this.timeToIdle = timeToIdle;
+ RelativeSizeAxes = Axes.Both;
+ }
+
+ protected override void Update()
+ {
+ base.Update();
+ isIdle.Value = TimeSpentIdle > timeToIdle;
+ }
+
+ public bool OnPressed(PlatformAction action) => updateLastInteractionTime();
+
+ public bool OnReleased(PlatformAction action) => updateLastInteractionTime();
+
+ protected override bool Handle(UIEvent e)
+ {
+ switch (e)
+ {
+ case KeyDownEvent _:
+ case KeyUpEvent _:
+ case MouseDownEvent _:
+ case MouseUpEvent _:
+ case MouseMoveEvent _:
+ return updateLastInteractionTime();
+ default:
+ return base.Handle(e);
+ }
+ }
+
+ private bool updateLastInteractionTime()
+ {
+ lastInteractionTime = Clock.CurrentTime;
+ return false;
+ }
+ }
+}
diff --git a/osu.Game/Online/API/OAuth.cs b/osu.Game/Online/API/OAuth.cs
index 7892df9aab..f60567a706 100644
--- a/osu.Game/Online/API/OAuth.cs
+++ b/osu.Game/Online/API/OAuth.cs
@@ -178,6 +178,7 @@ namespace osu.Game.Online.API
AddParameter("grant_type", GrantType);
AddParameter("client_id", ClientId);
AddParameter("client_secret", ClientSecret);
+ AddParameter("scope", "*");
base.PrePerform();
}
diff --git a/osu.Game/Online/Chat/ChannelManager.cs b/osu.Game/Online/Chat/ChannelManager.cs
index 9014fce18d..29f971078b 100644
--- a/osu.Game/Online/Chat/ChannelManager.cs
+++ b/osu.Game/Online/Chat/ChannelManager.cs
@@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
@@ -31,6 +30,9 @@ namespace osu.Game.Online.Chat
@"#lobby"
};
+ private readonly BindableCollection availableChannels = new BindableCollection();
+ private readonly BindableCollection joinedChannels = new BindableCollection();
+
///
/// The currently opened channel
///
@@ -39,12 +41,12 @@ namespace osu.Game.Online.Chat
///
/// The Channels the player has joined
///
- public ObservableCollection JoinedChannels { get; } = new ObservableCollection(); //todo: should be publicly readonly
+ public IBindableCollection JoinedChannels => joinedChannels;
///
/// The channels available for the player to join
///
- public ObservableCollection AvailableChannels { get; } = new ObservableCollection(); //todo: should be publicly readonly
+ public IBindableCollection AvailableChannels => availableChannels;
private IAPIProvider api;
private ScheduledDelegate fetchMessagesScheduleder;
@@ -77,7 +79,7 @@ namespace osu.Game.Online.Chat
throw new ArgumentNullException(nameof(user));
CurrentChannel.Value = JoinedChannels.FirstOrDefault(c => c.Type == ChannelType.PM && c.Users.Count == 1 && c.Users.Any(u => u.Id == user.Id))
- ?? new Channel { Name = user.Username, Users = { user } };
+ ?? new Channel { Name = user.Username, Users = { user }, Type = ChannelType.PM };
}
private void currentChannelChanged(Channel channel) => JoinChannel(channel);
@@ -223,13 +225,11 @@ namespace osu.Game.Online.Chat
{
foreach (var channel in channels)
{
- // add as available if not already
- if (AvailableChannels.All(c => c.Id != channel.Id))
- AvailableChannels.Add(channel);
+ var ch = getChannel(channel, addToAvailable: true);
// join any channels classified as "defaults"
if (joinDefaults && defaultChannels.Any(c => c.Equals(channel.Name, StringComparison.OrdinalIgnoreCase)))
- JoinChannel(channel);
+ JoinChannel(ch);
}
};
req.Failure += error =>
@@ -262,37 +262,73 @@ namespace osu.Game.Online.Chat
api.Queue(fetchInitialMsgReq);
}
- public void JoinChannel(Channel channel)
+ ///
+ /// Find an existing channel instance for the provided channel. Lookup is performed basd on ID.
+ /// The provided channel may be used if an existing instance is not found.
+ ///
+ /// A candidate channel to be used for lookup or permanently on lookup failure.
+ /// Whether the channel should be added to if not already.
+ /// Whether the channel should be added to if not already.
+ /// The found channel.
+ private Channel getChannel(Channel lookup, bool addToAvailable = false, bool addToJoined = false)
{
- if (channel == null) return;
+ Channel found = null;
- // ReSharper disable once AccessToModifiedClosure
- var existing = JoinedChannels.FirstOrDefault(c => c.Id == channel.Id);
+ bool lookupCondition(Channel ch) => lookup.Id > 0 ? ch.Id == lookup.Id : lookup.Name == ch.Name;
- if (existing != null)
+ var available = AvailableChannels.FirstOrDefault(lookupCondition);
+ if (available != null)
+ found = available;
+
+ var joined = JoinedChannels.FirstOrDefault(lookupCondition);
+ if (found == null && joined != null)
+ found = joined;
+
+ if (found == null)
{
- // if we already have this channel loaded, we don't want to make a second one.
- channel = existing;
- }
- else
- {
- var foundSelf = channel.Users.FirstOrDefault(u => u.Id == api.LocalUser.Value.Id);
+ found = lookup;
+
+ // if we're using a channel object from the server, we want to remove ourselves from the users list.
+ // this is because we check the first user in the channel to display a name/icon on tabs for now.
+ var foundSelf = found.Users.FirstOrDefault(u => u.Id == api.LocalUser.Value.Id);
if (foundSelf != null)
- channel.Users.Remove(foundSelf);
+ found.Users.Remove(foundSelf);
+ }
- JoinedChannels.Add(channel);
+ if (joined == null && addToJoined) joinedChannels.Add(found);
+ if (available == null && addToAvailable) availableChannels.Add(found);
- if (channel.Type == ChannelType.Public && !channel.Joined)
+ return found;
+ }
+
+ ///
+ /// Joins a channel if it has not already been joined.
+ ///
+ /// The channel to join.
+ /// Whether the channel has already been joined server-side. Will skip a join request.
+ /// The joined channel. Note that this may not match the parameter channel as it is a backed object.
+ public Channel JoinChannel(Channel channel, bool alreadyJoined = false)
+ {
+ if (channel == null) return null;
+
+ channel = getChannel(channel, addToJoined: true);
+
+ // ensure we are joined to the channel
+ if (!channel.Joined.Value)
+ {
+ if (alreadyJoined)
+ channel.Joined.Value = true;
+ else
{
- var req = new JoinChannelRequest(channel, api.LocalUser);
- req.Success += () =>
+ switch (channel.Type)
{
- channel.Joined.Value = true;
- JoinChannel(channel);
- };
- req.Failure += ex => LeaveChannel(channel);
- api.Queue(req);
- return;
+ case ChannelType.Public:
+ var req = new JoinChannelRequest(channel, api.LocalUser);
+ req.Success += () => JoinChannel(channel, true);
+ req.Failure += ex => LeaveChannel(channel);
+ api.Queue(req);
+ return channel;
+ }
}
}
@@ -304,15 +340,18 @@ namespace osu.Game.Online.Chat
// let's fetch a small number of messages to bring us up-to-date with the backlog.
fetchInitalMessages(channel);
}
+
+ return channel;
}
public void LeaveChannel(Channel channel)
{
if (channel == null) return;
- if (channel == CurrentChannel.Value) CurrentChannel.Value = null;
+ if (channel == CurrentChannel.Value)
+ CurrentChannel.Value = null;
- JoinedChannels.Remove(channel);
+ joinedChannels.Remove(channel);
if (channel.Joined.Value)
{
@@ -353,20 +392,8 @@ namespace osu.Game.Online.Chat
{
foreach (var channel in updates.Presence)
{
- if (!channel.Joined.Value)
- {
- // we received this from the server so should mark the channel already joined.
- channel.Joined.Value = true;
-
- JoinChannel(channel);
- }
- }
-
- if (!channelsInitialised)
- {
- channelsInitialised = true;
- // we want this to run after the first presence so we can see if the user is in any channels already.
- initializeChannels();
+ // we received this from the server so should mark the channel already joined.
+ JoinChannel(channel, true);
}
//todo: handle left channels
@@ -379,6 +406,13 @@ namespace osu.Game.Online.Chat
lastMessageId = updates.Messages.LastOrDefault()?.Id ?? lastMessageId;
}
+ if (!channelsInitialised)
+ {
+ channelsInitialised = true;
+ // we want this to run after the first presence so we can see if the user is in any channels already.
+ initializeChannels();
+ }
+
fetchUpdates();
};
diff --git a/osu.Game/Online/Chat/ChannelType.cs b/osu.Game/Online/Chat/ChannelType.cs
index 4ac0a99fc6..c8b9463ded 100644
--- a/osu.Game/Online/Chat/ChannelType.cs
+++ b/osu.Game/Online/Chat/ChannelType.cs
@@ -5,7 +5,12 @@ namespace osu.Game.Online.Chat
{
public enum ChannelType
{
+ Public,
+ Private,
+ Multiplayer,
+ Spectator,
+ Temporary,
PM,
- Public
+ Group,
}
}
diff --git a/osu.Game/Online/Chat/DrawableLinkCompiler.cs b/osu.Game/Online/Chat/DrawableLinkCompiler.cs
index 0148d1d2c3..de017baf35 100644
--- a/osu.Game/Online/Chat/DrawableLinkCompiler.cs
+++ b/osu.Game/Online/Chat/DrawableLinkCompiler.cs
@@ -10,7 +10,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
-using OpenTK;
+using osuTK;
namespace osu.Game.Online.Chat
{
diff --git a/osu.Game/Online/Chat/ExternalLinkOpener.cs b/osu.Game/Online/Chat/ExternalLinkOpener.cs
new file mode 100644
index 0000000000..d8b8adbbad
--- /dev/null
+++ b/osu.Game/Online/Chat/ExternalLinkOpener.cs
@@ -0,0 +1,36 @@
+// Copyright (c) 2007-2018 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using osu.Framework.Allocation;
+using osu.Framework.Configuration;
+using osu.Framework.Graphics;
+using osu.Framework.Platform;
+using osu.Game.Configuration;
+using osu.Game.Overlays;
+using osu.Game.Overlays.Chat;
+
+namespace osu.Game.Online.Chat
+{
+ public class ExternalLinkOpener : Component
+ {
+ private GameHost host;
+ private DialogOverlay dialogOverlay;
+ private Bindable externalLinkWarning;
+
+ [BackgroundDependencyLoader(true)]
+ private void load(GameHost host, DialogOverlay dialogOverlay, OsuConfigManager config)
+ {
+ this.host = host;
+ this.dialogOverlay = dialogOverlay;
+ externalLinkWarning = config.GetBindable(OsuSetting.ExternalLinkWarning);
+ }
+
+ public void OpenUrlExternally(string url)
+ {
+ if (externalLinkWarning)
+ dialogOverlay.Push(new ExternalLinkDialog(url, () => host.OpenUrlExternally(url)));
+ else
+ host.OpenUrlExternally(url);
+ }
+ }
+}
diff --git a/osu.Game/Online/Multiplayer/GameType.cs b/osu.Game/Online/Multiplayer/GameType.cs
index 571d3df681..8d39e8f59d 100644
--- a/osu.Game/Online/Multiplayer/GameType.cs
+++ b/osu.Game/Online/Multiplayer/GameType.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@@ -14,6 +14,9 @@ namespace osu.Game.Online.Multiplayer
{
public abstract string Name { get; }
public abstract Drawable GetIcon(OsuColour colours, float size);
+
+ public override int GetHashCode() => GetType().GetHashCode();
+ public override bool Equals(object obj) => GetType() == obj?.GetType();
}
public class GameTypeTag : GameType
diff --git a/osu.Game/Online/Multiplayer/RoomStatus.cs b/osu.Game/Online/Multiplayer/RoomStatus.cs
index 6b82e5f059..7c6e71a360 100644
--- a/osu.Game/Online/Multiplayer/RoomStatus.cs
+++ b/osu.Game/Online/Multiplayer/RoomStatus.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Game.Graphics;
namespace osu.Game.Online.Multiplayer
diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs
index 76a9102c5e..d91f96db53 100644
--- a/osu.Game/OsuGame.cs
+++ b/osu.Game/OsuGame.cs
@@ -14,7 +14,7 @@ using osu.Framework.Allocation;
using osu.Game.Overlays.Toolbar;
using osu.Game.Screens;
using osu.Game.Screens.Menu;
-using OpenTK;
+using osuTK;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@@ -26,6 +26,7 @@ using osu.Framework.Platform;
using osu.Framework.Threading;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
+using osu.Game.Input;
using osu.Game.Rulesets.Scoring;
using osu.Game.Overlays.Notifications;
using osu.Game.Rulesets;
@@ -34,7 +35,7 @@ using osu.Game.Input.Bindings;
using osu.Game.Online.Chat;
using osu.Game.Rulesets.Mods;
using osu.Game.Skinning;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Game.Overlays.Volume;
using osu.Game.Screens.Select;
using osu.Game.Utils;
@@ -50,7 +51,9 @@ namespace osu.Game
{
public Toolbar Toolbar;
- private ChatOverlay chat;
+ private ChatOverlay chatOverlay;
+
+ private ChannelManager channelManager;
private MusicController musicController;
@@ -86,6 +89,8 @@ namespace osu.Game
public float ToolbarOffset => Toolbar.Position.Y + Toolbar.DrawHeight;
+ private IdleTracker idleTracker;
+
public readonly Bindable OverlayActivationMode = new Bindable();
private OsuScreen screenStack;
@@ -179,6 +184,9 @@ namespace osu.Game
LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolumeAdjust);
}
+ private ExternalLinkOpener externalLinkOpener;
+ public void OpenUrlExternally(string url) => externalLinkOpener.OpenUrlExternally(url);
+
private ScheduledDelegate scoreLoad;
///
@@ -311,6 +319,7 @@ namespace osu.Game
},
mainContent = new Container { RelativeSizeAxes = Axes.Both },
overlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue },
+ idleTracker = new IdleTracker(6000)
});
loadComponentSingleFile(screenStack = new Loader(), d =>
@@ -338,12 +347,8 @@ namespace osu.Game
//overlay elements
loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, mainContent.Add);
loadComponentSingleFile(social = new SocialOverlay { Depth = -1 }, mainContent.Add);
- loadComponentSingleFile(new ChannelManager(), channelManager =>
- {
- dependencies.Cache(channelManager);
- AddInternal(channelManager);
- });
- loadComponentSingleFile(chat = new ChatOverlay { Depth = -1 }, mainContent.Add);
+ loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal);
+ loadComponentSingleFile(chatOverlay = new ChatOverlay { Depth = -1 }, mainContent.Add);
loadComponentSingleFile(settings = new MainSettings
{
GetToolbarHeight = () => ToolbarOffset,
@@ -372,17 +377,21 @@ namespace osu.Game
Depth = -6,
}, overlayContent.Add);
+ dependencies.Cache(idleTracker);
dependencies.Cache(settings);
dependencies.Cache(onscreenDisplay);
dependencies.Cache(social);
dependencies.Cache(direct);
- dependencies.Cache(chat);
+ dependencies.Cache(chatOverlay);
+ dependencies.Cache(channelManager);
dependencies.Cache(userProfile);
dependencies.Cache(musicController);
dependencies.Cache(beatmapSetOverlay);
dependencies.Cache(notifications);
dependencies.Cache(dialogOverlay);
+ Add(externalLinkOpener = new ExternalLinkOpener());
+
var singleDisplaySideOverlays = new OverlayContainer[] { settings, notifications };
overlays.AddRange(singleDisplaySideOverlays);
@@ -409,7 +418,7 @@ namespace osu.Game
}
// ensure only one of these overlays are open at once.
- var singleDisplayOverlays = new OverlayContainer[] { chat, social, direct };
+ var singleDisplayOverlays = new OverlayContainer[] { chatOverlay, social, direct };
overlays.AddRange(singleDisplayOverlays);
foreach (var overlay in singleDisplayOverlays)
@@ -534,7 +543,7 @@ namespace osu.Game
switch (action)
{
case GlobalAction.ToggleChat:
- chat.ToggleVisibility();
+ chatOverlay.ToggleVisibility();
return true;
case GlobalAction.ToggleSocial:
social.ToggleVisibility();
diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs
index 73c970ce5d..c267c323a6 100644
--- a/osu.Game/OsuGameBase.cs
+++ b/osu.Game/OsuGameBase.cs
@@ -30,7 +30,7 @@ using osu.Game.IO;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Scoring;
using osu.Game.Skinning;
-using OpenTK.Input;
+using osuTK.Input;
using DebugUtils = osu.Game.Utils.DebugUtils;
namespace osu.Game
diff --git a/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs b/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs
index 398518ef2b..c2f03a4b66 100644
--- a/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs
+++ b/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs
@@ -7,8 +7,8 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.Game.Graphics.Sprites;
using osu.Game.Users;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Game.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
diff --git a/osu.Game/Overlays/BeatmapSet/BasicStats.cs b/osu.Game/Overlays/BeatmapSet/BasicStats.cs
index a7b6b16dcc..26402b6e37 100644
--- a/osu.Game/Overlays/BeatmapSet/BasicStats.cs
+++ b/osu.Game/Overlays/BeatmapSet/BasicStats.cs
@@ -9,7 +9,7 @@ using osu.Framework.Graphics.Cursor;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.BeatmapSet
{
diff --git a/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs b/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs
index bd9d65ccd8..64a8a1062c 100644
--- a/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs
+++ b/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs
@@ -16,8 +16,8 @@ using osu.Game.Beatmaps.Drawables;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.BeatmapSet
{
diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs
index f3e49f68b1..8406dada44 100644
--- a/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs
+++ b/osu.Game/Overlays/BeatmapSet/Buttons/DownloadButton.cs
@@ -12,8 +12,8 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.API;
using osu.Game.Users;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.BeatmapSet.Buttons
{
diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/FavouriteButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/FavouriteButton.cs
index 3821c96369..929f89482c 100644
--- a/osu.Game/Overlays/BeatmapSet/Buttons/FavouriteButton.cs
+++ b/osu.Game/Overlays/BeatmapSet/Buttons/FavouriteButton.cs
@@ -8,7 +8,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.BeatmapSet.Buttons
{
diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs
index 1988b7d222..b971403443 100644
--- a/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs
+++ b/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs
@@ -13,8 +13,8 @@ using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Overlays.Direct;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.BeatmapSet.Buttons
{
diff --git a/osu.Game/Overlays/BeatmapSet/Details.cs b/osu.Game/Overlays/BeatmapSet/Details.cs
index ccd0fa04ab..709d163eaa 100644
--- a/osu.Game/Overlays/BeatmapSet/Details.cs
+++ b/osu.Game/Overlays/BeatmapSet/Details.cs
@@ -9,8 +9,8 @@ using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps;
using osu.Game.Overlays.BeatmapSet.Buttons;
using osu.Game.Screens.Select.Details;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.BeatmapSet
{
diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs
index 6f01fae92d..d353522d8d 100644
--- a/osu.Game/Overlays/BeatmapSet/Header.cs
+++ b/osu.Game/Overlays/BeatmapSet/Header.cs
@@ -13,8 +13,8 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.BeatmapSet.Buttons;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.BeatmapSet
{
diff --git a/osu.Game/Overlays/BeatmapSet/Info.cs b/osu.Game/Overlays/BeatmapSet/Info.cs
index 53216ad666..e985da0eb7 100644
--- a/osu.Game/Overlays/BeatmapSet/Info.cs
+++ b/osu.Game/Overlays/BeatmapSet/Info.cs
@@ -10,8 +10,8 @@ using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.BeatmapSet
{
diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs
index 309d75f60a..b172954c43 100644
--- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs
+++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs
index d954b48b86..aa785385ba 100644
--- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs
+++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs
index 60811d8b12..38107c047d 100644
--- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs
+++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs
index 23c8ec3aab..6294851415 100644
--- a/osu.Game/Overlays/BeatmapSetOverlay.cs
+++ b/osu.Game/Overlays/BeatmapSetOverlay.cs
@@ -16,8 +16,8 @@ using osu.Game.Online.API.Requests;
using osu.Game.Overlays.BeatmapSet;
using osu.Game.Overlays.BeatmapSet.Scores;
using osu.Game.Rulesets;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays
{
@@ -139,7 +139,7 @@ namespace osu.Game.Overlays
var req = new GetBeatmapSetRequest(beatmapId, BeatmapSetLookupType.BeatmapId);
req.Success += res =>
{
- ShowBeatmapSet(res.ToBeatmapSet(rulesets));
+ BeatmapSet = res.ToBeatmapSet(rulesets);
header.Picker.Beatmap.Value = header.BeatmapSet.Beatmaps.First(b => b.OnlineBeatmapID == beatmapId);
};
api.Queue(req);
@@ -150,7 +150,7 @@ namespace osu.Game.Overlays
{
BeatmapSet = null;
var req = new GetBeatmapSetRequest(beatmapSetId);
- req.Success += res => ShowBeatmapSet(res.ToBeatmapSet(rulesets));
+ req.Success += res => BeatmapSet = res.ToBeatmapSet(rulesets);
api.Queue(req);
Show();
}
diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs
index 770f528e17..c11de48430 100644
--- a/osu.Game/Overlays/Chat/ChatLine.cs
+++ b/osu.Game/Overlays/Chat/ChatLine.cs
@@ -3,8 +3,8 @@
using System;
using System.Linq;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Overlays/Chat/ChatTabControl.cs b/osu.Game/Overlays/Chat/ChatTabControl.cs
index ec4fd85901..1f8c5d38b9 100644
--- a/osu.Game/Overlays/Chat/ChatTabControl.cs
+++ b/osu.Game/Overlays/Chat/ChatTabControl.cs
@@ -12,9 +12,9 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Chat;
-using OpenTK;
-using OpenTK.Input;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Input;
+using osuTK.Graphics;
using osu.Framework.Configuration;
using System;
using osu.Framework.Input.Events;
diff --git a/osu.Game/Overlays/Chat/DrawableChannel.cs b/osu.Game/Overlays/Chat/DrawableChannel.cs
index fedfd788ce..ce5d961282 100644
--- a/osu.Game/Overlays/Chat/DrawableChannel.cs
+++ b/osu.Game/Overlays/Chat/DrawableChannel.cs
@@ -5,7 +5,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Containers;
diff --git a/osu.Game/Overlays/Chat/ExternalLinkDialog.cs b/osu.Game/Overlays/Chat/ExternalLinkDialog.cs
new file mode 100644
index 0000000000..b3f7b282a9
--- /dev/null
+++ b/osu.Game/Overlays/Chat/ExternalLinkDialog.cs
@@ -0,0 +1,33 @@
+// Copyright (c) 2007-2018 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using System;
+using osu.Game.Graphics;
+using osu.Game.Overlays.Dialog;
+
+namespace osu.Game.Overlays.Chat
+{
+ public class ExternalLinkDialog : PopupDialog
+ {
+ public ExternalLinkDialog(string url, Action openExternalLinkAction)
+ {
+ HeaderText = "Just checking...";
+ BodyText = $"You are about to leave osu! and open the following link in a web browser:\n\n{url}";
+
+ Icon = FontAwesome.fa_warning;
+
+ Buttons = new PopupDialogButton[]
+ {
+ new PopupDialogOkButton
+ {
+ Text = @"Yes. Go for it.",
+ Action = openExternalLinkAction
+ },
+ new PopupDialogCancelButton
+ {
+ Text = @"No! Abort mission!"
+ },
+ };
+ }
+ }
+}
diff --git a/osu.Game/Overlays/Chat/Selection/ChannelListItem.cs b/osu.Game/Overlays/Chat/Selection/ChannelListItem.cs
index cb6caf1506..5a96465520 100644
--- a/osu.Game/Overlays/Chat/Selection/ChannelListItem.cs
+++ b/osu.Game/Overlays/Chat/Selection/ChannelListItem.cs
@@ -3,8 +3,8 @@
using System;
using System.Collections.Generic;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
diff --git a/osu.Game/Overlays/Chat/Selection/ChannelSection.cs b/osu.Game/Overlays/Chat/Selection/ChannelSection.cs
index ac790b424e..94ee9d4bf6 100644
--- a/osu.Game/Overlays/Chat/Selection/ChannelSection.cs
+++ b/osu.Game/Overlays/Chat/Selection/ChannelSection.cs
@@ -3,7 +3,7 @@
using System.Collections.Generic;
using System.Linq;
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
diff --git a/osu.Game/Overlays/Chat/Selection/ChannelSelectionOverlay.cs b/osu.Game/Overlays/Chat/Selection/ChannelSelectionOverlay.cs
index 9766c0f2c5..3afac211f1 100644
--- a/osu.Game/Overlays/Chat/Selection/ChannelSelectionOverlay.cs
+++ b/osu.Game/Overlays/Chat/Selection/ChannelSelectionOverlay.cs
@@ -3,8 +3,8 @@
using System;
using System.Collections.Generic;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Overlays/Chat/Tabs/ChannelTabControl.cs b/osu.Game/Overlays/Chat/Tabs/ChannelTabControl.cs
index 08d4e40a64..79cb0a4d14 100644
--- a/osu.Game/Overlays/Chat/Tabs/ChannelTabControl.cs
+++ b/osu.Game/Overlays/Chat/Tabs/ChannelTabControl.cs
@@ -6,7 +6,7 @@ using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Chat;
-using OpenTK;
+using osuTK;
using osu.Framework.Configuration;
using System;
using System.Linq;
@@ -56,12 +56,10 @@ namespace osu.Game.Overlays.Chat.Tabs
{
switch (value.Type)
{
- case ChannelType.Public:
+ default:
return new ChannelTabItem(value) { OnRequestClose = tabCloseRequested };
case ChannelType.PM:
return new PrivateChannelTabItem(value) { OnRequestClose = tabCloseRequested };
- default:
- throw new InvalidOperationException("Only TargetType User and Channel are supported.");
}
}
diff --git a/osu.Game/Overlays/Chat/Tabs/ChannelTabItem.cs b/osu.Game/Overlays/Chat/Tabs/ChannelTabItem.cs
index e6de55f9b2..e98eac0aa2 100644
--- a/osu.Game/Overlays/Chat/Tabs/ChannelTabItem.cs
+++ b/osu.Game/Overlays/Chat/Tabs/ChannelTabItem.cs
@@ -13,8 +13,8 @@ using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.Chat;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Chat.Tabs
{
diff --git a/osu.Game/Overlays/Chat/Tabs/PrivateChannelTabItem.cs b/osu.Game/Overlays/Chat/Tabs/PrivateChannelTabItem.cs
index c7ca1cb073..e04d7891f8 100644
--- a/osu.Game/Overlays/Chat/Tabs/PrivateChannelTabItem.cs
+++ b/osu.Game/Overlays/Chat/Tabs/PrivateChannelTabItem.cs
@@ -11,7 +11,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.Chat;
using osu.Game.Users;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Chat.Tabs
{
diff --git a/osu.Game/Overlays/Chat/Tabs/TabCloseButton.cs b/osu.Game/Overlays/Chat/Tabs/TabCloseButton.cs
index 0adaa40889..d7d9b3f95c 100644
--- a/osu.Game/Overlays/Chat/Tabs/TabCloseButton.cs
+++ b/osu.Game/Overlays/Chat/Tabs/TabCloseButton.cs
@@ -5,8 +5,8 @@ using osu.Framework.Graphics;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Chat.Tabs
{
diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs
index e45373c36f..bdb28d1246 100644
--- a/osu.Game/Overlays/ChatOverlay.cs
+++ b/osu.Game/Overlays/ChatOverlay.cs
@@ -2,9 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
-using System.Collections.Specialized;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
@@ -181,35 +180,12 @@ namespace osu.Game.Overlays
channelSelection.OnRequestLeave = channel => channelManager.LeaveChannel(channel);
}
- private void joinedChannelsChanged(object sender, NotifyCollectionChangedEventArgs args)
- {
- switch (args.Action)
- {
- case NotifyCollectionChangedAction.Add:
- foreach (Channel newChannel in args.NewItems)
- {
- channelTabControl.AddChannel(newChannel);
- }
-
- break;
- case NotifyCollectionChangedAction.Remove:
- foreach (Channel removedChannel in args.OldItems)
- {
- channelTabControl.RemoveChannel(removedChannel);
- loadedChannels.Remove(loadedChannels.Find(c => c.Channel == removedChannel));
- }
-
- break;
- }
- }
-
private void currentChannelChanged(Channel channel)
{
if (channel == null)
{
textbox.Current.Disabled = true;
currentChannelContainer.Clear(false);
- channelTabControl.Current.Value = null;
return;
}
@@ -323,19 +299,35 @@ namespace osu.Game.Overlays
this.channelManager = channelManager;
channelManager.CurrentChannel.ValueChanged += currentChannelChanged;
- channelManager.JoinedChannels.CollectionChanged += joinedChannelsChanged;
- channelManager.AvailableChannels.CollectionChanged += availableChannelsChanged;
+ channelManager.JoinedChannels.ItemsAdded += onChannelAddedToJoinedChannels;
+ channelManager.JoinedChannels.ItemsRemoved += onChannelRemovedFromJoinedChannels;
+ channelManager.AvailableChannels.ItemsAdded += availableChannelsChanged;
+ channelManager.AvailableChannels.ItemsRemoved += availableChannelsChanged;
//for the case that channelmanager was faster at fetching the channels than our attachment to CollectionChanged.
channelSelection.UpdateAvailableChannels(channelManager.AvailableChannels);
- joinedChannelsChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, channelManager.JoinedChannels));
+ foreach (Channel channel in channelManager.JoinedChannels)
+ channelTabControl.AddChannel(channel);
}
- private void availableChannelsChanged(object sender, NotifyCollectionChangedEventArgs e)
+ private void onChannelAddedToJoinedChannels(IEnumerable channels)
{
- channelSelection.UpdateAvailableChannels(channelManager.AvailableChannels);
+ foreach (Channel channel in channels)
+ channelTabControl.AddChannel(channel);
}
+ private void onChannelRemovedFromJoinedChannels(IEnumerable channels)
+ {
+ foreach (Channel channel in channels)
+ {
+ channelTabControl.RemoveChannel(channel);
+ loadedChannels.Remove(loadedChannels.Find(c => c.Channel == channel));
+ }
+ }
+
+ private void availableChannelsChanged(IEnumerable channels)
+ => channelSelection.UpdateAvailableChannels(channelManager.AvailableChannels);
+
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
@@ -343,8 +335,10 @@ namespace osu.Game.Overlays
if (channelManager != null)
{
channelManager.CurrentChannel.ValueChanged -= currentChannelChanged;
- channelManager.JoinedChannels.CollectionChanged -= joinedChannelsChanged;
- channelManager.AvailableChannels.CollectionChanged -= availableChannelsChanged;
+ channelManager.JoinedChannels.ItemsAdded -= onChannelAddedToJoinedChannels;
+ channelManager.JoinedChannels.ItemsRemoved -= onChannelRemovedFromJoinedChannels;
+ channelManager.AvailableChannels.ItemsAdded -= availableChannelsChanged;
+ channelManager.AvailableChannels.ItemsRemoved -= availableChannelsChanged;
}
}
diff --git a/osu.Game/Overlays/Dialog/PopupDialog.cs b/osu.Game/Overlays/Dialog/PopupDialog.cs
index f421d2202c..ca921b7882 100644
--- a/osu.Game/Overlays/Dialog/PopupDialog.cs
+++ b/osu.Game/Overlays/Dialog/PopupDialog.cs
@@ -7,16 +7,14 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
-using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Containers;
-using osu.Game.Graphics.Sprites;
using osu.Game.Input.Bindings;
-using OpenTK;
-using OpenTK.Graphics;
-using OpenTK.Input;
+using osuTK;
+using osuTK.Graphics;
+using osuTK.Input;
namespace osu.Game.Overlays.Dialog
{
@@ -35,7 +33,7 @@ namespace osu.Game.Overlays.Dialog
private readonly Container ring;
private readonly FillFlowContainer buttonsContainer;
private readonly SpriteIcon icon;
- private readonly SpriteText header;
+ private readonly TextFlowContainer header;
private readonly TextFlowContainer body;
private bool actionInvoked;
@@ -46,10 +44,19 @@ namespace osu.Game.Overlays.Dialog
set => icon.Icon = value;
}
+ private string text;
+
public string HeaderText
{
- get => header.Text;
- set => header.Text = value;
+ get => text;
+ set
+ {
+ if (text == value)
+ return;
+ text = value;
+
+ header.Text = value;
+ }
}
public string BodyText
@@ -164,18 +171,20 @@ namespace osu.Game.Overlays.Dialog
},
},
},
- header = new OsuSpriteText
+ header = new OsuTextFlowContainer(t => t.TextSize = 25)
{
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
- TextSize = 25,
- Shadow = true,
+ RelativeSizeAxes = Axes.X,
+ AutoSizeAxes = Axes.Y,
+ Padding = new MarginPadding(15),
+ TextAnchor = Anchor.TopCentre,
},
body = new OsuTextFlowContainer(t => t.TextSize = 18)
{
- Padding = new MarginPadding(15),
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
+ Padding = new MarginPadding(15),
TextAnchor = Anchor.TopCentre,
},
},
diff --git a/osu.Game/Overlays/Direct/DirectGridPanel.cs b/osu.Game/Overlays/Direct/DirectGridPanel.cs
index 1c462e3a73..006e3a034b 100644
--- a/osu.Game/Overlays/Direct/DirectGridPanel.cs
+++ b/osu.Game/Overlays/Direct/DirectGridPanel.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Overlays/Direct/DirectListPanel.cs b/osu.Game/Overlays/Direct/DirectListPanel.cs
index 6cb5ebad4e..a922ceb484 100644
--- a/osu.Game/Overlays/Direct/DirectListPanel.cs
+++ b/osu.Game/Overlays/Direct/DirectListPanel.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs
index 5c7c34a0ed..44f7b6d49c 100644
--- a/osu.Game/Overlays/Direct/DirectPanel.cs
+++ b/osu.Game/Overlays/Direct/DirectPanel.cs
@@ -18,8 +18,8 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API.Requests;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Direct
{
@@ -174,11 +174,11 @@ namespace osu.Game.Overlays.Direct
};
}
- private void setAdded(BeatmapSetInfo s)
+ private void setAdded(BeatmapSetInfo s) => Schedule(() =>
{
if (s.OnlineBeatmapSetID == SetInfo.OnlineBeatmapSetID)
progressBar.FadeOut(500);
- }
+ });
protected override void LoadComplete()
{
diff --git a/osu.Game/Overlays/Direct/DownloadButton.cs b/osu.Game/Overlays/Direct/DownloadButton.cs
index 99a5881487..e326f5e592 100644
--- a/osu.Game/Overlays/Direct/DownloadButton.cs
+++ b/osu.Game/Overlays/Direct/DownloadButton.cs
@@ -8,7 +8,7 @@ using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Drawables;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Direct
{
diff --git a/osu.Game/Overlays/Direct/FilterControl.cs b/osu.Game/Overlays/Direct/FilterControl.cs
index c4825f72fe..3f2c3a4fbf 100644
--- a/osu.Game/Overlays/Direct/FilterControl.cs
+++ b/osu.Game/Overlays/Direct/FilterControl.cs
@@ -10,8 +10,8 @@ using osu.Game.Graphics.Containers;
using osu.Game.Online.API.Requests;
using osu.Game.Overlays.SearchableList;
using osu.Game.Rulesets;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Direct
{
diff --git a/osu.Game/Overlays/Direct/Header.cs b/osu.Game/Overlays/Direct/Header.cs
index 01180f1fde..2ca7b558ba 100644
--- a/osu.Game/Overlays/Direct/Header.cs
+++ b/osu.Game/Overlays/Direct/Header.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
diff --git a/osu.Game/Overlays/Direct/IconPill.cs b/osu.Game/Overlays/Direct/IconPill.cs
index 61a0c63814..9ac544ea78 100644
--- a/osu.Game/Overlays/Direct/IconPill.cs
+++ b/osu.Game/Overlays/Direct/IconPill.cs
@@ -5,8 +5,8 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Direct
{
diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs
index ac7a26fca3..d9b36e2367 100644
--- a/osu.Game/Overlays/Direct/PlayButton.cs
+++ b/osu.Game/Overlays/Direct/PlayButton.cs
@@ -10,8 +10,8 @@ using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Direct
{
diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs
index 641f57d25f..765c86e6ad 100644
--- a/osu.Game/Overlays/DirectOverlay.cs
+++ b/osu.Game/Overlays/DirectOverlay.cs
@@ -18,8 +18,8 @@ using osu.Game.Online.API.Requests;
using osu.Game.Overlays.Direct;
using osu.Game.Overlays.SearchableList;
using osu.Game.Rulesets;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays
{
diff --git a/osu.Game/Overlays/HoldToConfirmOverlay.cs b/osu.Game/Overlays/HoldToConfirmOverlay.cs
index 7e2f6f5891..b2c1ad20be 100644
--- a/osu.Game/Overlays/HoldToConfirmOverlay.cs
+++ b/osu.Game/Overlays/HoldToConfirmOverlay.cs
@@ -5,7 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Containers;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Overlays
{
diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs
index 63ddc25fde..fe2903d393 100644
--- a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs
+++ b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs
@@ -15,8 +15,8 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Input;
-using OpenTK.Graphics;
-using OpenTK.Input;
+using osuTK.Graphics;
+using osuTK.Input;
namespace osu.Game.Overlays.KeyBinding
{
diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs b/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs
index 895dda872a..9e57b9eefa 100644
--- a/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs
+++ b/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs
@@ -10,7 +10,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Input;
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets;
-using OpenTK;
+using osuTK;
using osu.Game.Graphics;
namespace osu.Game.Overlays.KeyBinding
diff --git a/osu.Game/Overlays/LoginOverlay.cs b/osu.Game/Overlays/LoginOverlay.cs
index 731c5ee973..e094f8ef48 100644
--- a/osu.Game/Overlays/LoginOverlay.cs
+++ b/osu.Game/Overlays/LoginOverlay.cs
@@ -6,7 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Overlays.Settings.Sections.General;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Cursor;
diff --git a/osu.Game/Overlays/MainSettings.cs b/osu.Game/Overlays/MainSettings.cs
index 736843ee4d..cd9cf8d50e 100644
--- a/osu.Game/Overlays/MainSettings.cs
+++ b/osu.Game/Overlays/MainSettings.cs
@@ -14,8 +14,8 @@ using osu.Game.Input.Bindings;
using osu.Game.Overlays.Settings;
using osu.Game.Overlays.Settings.Sections;
using osu.Game.Screens.Ranking;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays
{
diff --git a/osu.Game/Overlays/MedalOverlay.cs b/osu.Game/Overlays/MedalOverlay.cs
index dcd325490a..85875d2052 100644
--- a/osu.Game/Overlays/MedalOverlay.cs
+++ b/osu.Game/Overlays/MedalOverlay.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@@ -16,7 +16,7 @@ using osu.Framework.Allocation;
using osu.Framework.Audio.Sample;
using osu.Framework.Audio;
using osu.Framework.Graphics.Textures;
-using OpenTK.Input;
+using osuTK.Input;
using osu.Framework.Graphics.Shapes;
using System;
using osu.Framework.Input.Events;
diff --git a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs
index 629b6d6fa4..87d5724d24 100644
--- a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs
+++ b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs
@@ -3,7 +3,7 @@
using System;
using osu.Framework;
-using OpenTK;
+using osuTK;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs
index ecb65f6df2..239688e284 100644
--- a/osu.Game/Overlays/Mods/ModButton.cs
+++ b/osu.Game/Overlays/Mods/ModButton.cs
@@ -1,9 +1,9 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
-using OpenTK.Input;
+using osuTK;
+using osuTK.Graphics;
+using osuTK.Input;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
diff --git a/osu.Game/Overlays/Mods/ModButtonEmpty.cs b/osu.Game/Overlays/Mods/ModButtonEmpty.cs
index 9129856c8f..dfe14e066e 100644
--- a/osu.Game/Overlays/Mods/ModButtonEmpty.cs
+++ b/osu.Game/Overlays/Mods/ModButtonEmpty.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.Mods
diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs
index c0d2d889c6..8ac98ddff6 100644
--- a/osu.Game/Overlays/Mods/ModSection.cs
+++ b/osu.Game/Overlays/Mods/ModSection.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Input;
+using osuTK;
+using osuTK.Input;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs
index 55d5d797e7..742a3830b4 100644
--- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs
+++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions;
diff --git a/osu.Game/Overlays/Mods/Sections/AutomationSection.cs b/osu.Game/Overlays/Mods/Sections/AutomationSection.cs
index 2b509d539e..c14ed270f7 100644
--- a/osu.Game/Overlays/Mods/Sections/AutomationSection.cs
+++ b/osu.Game/Overlays/Mods/Sections/AutomationSection.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Mods;
-using OpenTK.Input;
+using osuTK.Input;
namespace osu.Game.Overlays.Mods.Sections
{
diff --git a/osu.Game/Overlays/Mods/Sections/ConversionSection.cs b/osu.Game/Overlays/Mods/Sections/ConversionSection.cs
index 568f0ecfce..90ff879265 100644
--- a/osu.Game/Overlays/Mods/Sections/ConversionSection.cs
+++ b/osu.Game/Overlays/Mods/Sections/ConversionSection.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Mods;
-using OpenTK.Input;
+using osuTK.Input;
namespace osu.Game.Overlays.Mods.Sections
{
diff --git a/osu.Game/Overlays/Mods/Sections/DifficultyIncreaseSection.cs b/osu.Game/Overlays/Mods/Sections/DifficultyIncreaseSection.cs
index 5aced7ed5d..f1b7edf98b 100644
--- a/osu.Game/Overlays/Mods/Sections/DifficultyIncreaseSection.cs
+++ b/osu.Game/Overlays/Mods/Sections/DifficultyIncreaseSection.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Mods;
-using OpenTK.Input;
+using osuTK.Input;
namespace osu.Game.Overlays.Mods.Sections
{
diff --git a/osu.Game/Overlays/Mods/Sections/DifficultyReductionSection.cs b/osu.Game/Overlays/Mods/Sections/DifficultyReductionSection.cs
index 29fae2c70a..8ab9251431 100644
--- a/osu.Game/Overlays/Mods/Sections/DifficultyReductionSection.cs
+++ b/osu.Game/Overlays/Mods/Sections/DifficultyReductionSection.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Mods;
-using OpenTK.Input;
+using osuTK.Input;
namespace osu.Game.Overlays.Mods.Sections
{
diff --git a/osu.Game/Overlays/Mods/Sections/FunSection.cs b/osu.Game/Overlays/Mods/Sections/FunSection.cs
index ef975d9d75..29329f9c1d 100644
--- a/osu.Game/Overlays/Mods/Sections/FunSection.cs
+++ b/osu.Game/Overlays/Mods/Sections/FunSection.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Mods;
-using OpenTK.Input;
+using osuTK.Input;
namespace osu.Game.Overlays.Mods.Sections
{
diff --git a/osu.Game/Overlays/Music/CollectionsDropdown.cs b/osu.Game/Overlays/Music/CollectionsDropdown.cs
index e06688e8f0..7b2f81b60c 100644
--- a/osu.Game/Overlays/Music/CollectionsDropdown.cs
+++ b/osu.Game/Overlays/Music/CollectionsDropdown.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Overlays/Music/FilterControl.cs b/osu.Game/Overlays/Music/FilterControl.cs
index 2d492dcf1e..598b99b9a6 100644
--- a/osu.Game/Overlays/Music/FilterControl.cs
+++ b/osu.Game/Overlays/Music/FilterControl.cs
@@ -1,14 +1,13 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using System;
namespace osu.Game.Overlays.Music
@@ -37,7 +36,7 @@ namespace osu.Game.Overlays.Music
new CollectionsDropdown
{
RelativeSizeAxes = Axes.X,
- Items = new[] { new KeyValuePair(@"All", PlaylistCollection.All) },
+ Items = new[] { PlaylistCollection.All },
}
},
},
diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs
index c0a59df767..5d89e53081 100644
--- a/osu.Game/Overlays/Music/PlaylistItem.cs
+++ b/osu.Game/Overlays/Music/PlaylistItem.cs
@@ -3,7 +3,7 @@
using System;
using System.Collections.Generic;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@@ -13,7 +13,7 @@ using osu.Framework.Localisation;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Music
{
diff --git a/osu.Game/Overlays/Music/PlaylistList.cs b/osu.Game/Overlays/Music/PlaylistList.cs
index 17c8d2f154..ef7f946859 100644
--- a/osu.Game/Overlays/Music/PlaylistList.cs
+++ b/osu.Game/Overlays/Music/PlaylistList.cs
@@ -11,7 +11,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Events;
using osu.Game.Beatmaps;
using osu.Game.Graphics.Containers;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Music
{
@@ -83,20 +83,20 @@ namespace osu.Game.Overlays.Music
beatmapBacking.ValueChanged += _ => updateSelectedSet();
}
- private void addBeatmapSet(BeatmapSetInfo obj)
+ private void addBeatmapSet(BeatmapSetInfo obj) => Schedule(() =>
{
var newItem = new PlaylistItem(obj) { OnSelect = set => Selected?.Invoke(set) };
items.Add(newItem);
items.SetLayoutPosition(newItem, items.Count - 1);
- }
+ });
- private void removeBeatmapSet(BeatmapSetInfo obj)
+ private void removeBeatmapSet(BeatmapSetInfo obj) => Schedule(() =>
{
var itemToRemove = items.FirstOrDefault(i => i.BeatmapSetInfo.ID == obj.ID);
if (itemToRemove != null)
items.Remove(itemToRemove);
- }
+ });
private void updateSelectedSet()
{
diff --git a/osu.Game/Overlays/Music/PlaylistOverlay.cs b/osu.Game/Overlays/Music/PlaylistOverlay.cs
index b74e7e1178..6c45c63145 100644
--- a/osu.Game/Overlays/Music/PlaylistOverlay.cs
+++ b/osu.Game/Overlays/Music/PlaylistOverlay.cs
@@ -11,8 +11,8 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Music
{
diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs
index f282b757cd..58e03bd0cd 100644
--- a/osu.Game/Overlays/MusicController.cs
+++ b/osu.Game/Overlays/MusicController.cs
@@ -22,8 +22,8 @@ using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.Music;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays
{
@@ -214,8 +214,8 @@ namespace osu.Game.Overlays
beatmapSets.Insert(index, beatmapSetInfo);
}
- private void handleBeatmapAdded(BeatmapSetInfo obj) => beatmapSets.Add(obj);
- private void handleBeatmapRemoved(BeatmapSetInfo obj) => beatmapSets.RemoveAll(s => s.ID == obj.ID);
+ private void handleBeatmapAdded(BeatmapSetInfo obj) => Schedule(() => beatmapSets.Add(obj));
+ private void handleBeatmapRemoved(BeatmapSetInfo obj) => Schedule(() => beatmapSets.RemoveAll(s => s.ID == obj.ID));
protected override void LoadComplete()
{
@@ -406,6 +406,10 @@ namespace osu.Game.Overlays
{
base.PopOut();
+ // This is here mostly as a performance fix.
+ // If the playlist is not hidden it will update children even when the music controller is hidden (due to AlwaysPresent).
+ playlist.State = Visibility.Hidden;
+
this.FadeOut(transition_length, Easing.OutQuint);
dragContainer.ScaleTo(0.9f, transition_length, Easing.OutQuint);
}
diff --git a/osu.Game/Overlays/NotificationOverlay.cs b/osu.Game/Overlays/NotificationOverlay.cs
index 78f8f57343..b9c5151e26 100644
--- a/osu.Game/Overlays/NotificationOverlay.cs
+++ b/osu.Game/Overlays/NotificationOverlay.cs
@@ -6,7 +6,7 @@ using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Overlays.Notifications;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Containers;
using System;
diff --git a/osu.Game/Overlays/Notifications/Notification.cs b/osu.Game/Overlays/Notifications/Notification.cs
index aa2b248bc4..ad20e6cd01 100644
--- a/osu.Game/Overlays/Notifications/Notification.cs
+++ b/osu.Game/Overlays/Notifications/Notification.cs
@@ -8,8 +8,8 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Game.Graphics.Containers;
diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs
index f41e3e876f..6958835f03 100644
--- a/osu.Game/Overlays/Notifications/NotificationSection.cs
+++ b/osu.Game/Overlays/Notifications/NotificationSection.cs
@@ -10,7 +10,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
-using OpenTK;
+using osuTK;
using osu.Game.Graphics.Containers;
namespace osu.Game.Overlays.Notifications
diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs
index 254258d098..56342ea4c4 100644
--- a/osu.Game/Overlays/Notifications/ProgressNotification.cs
+++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs
@@ -8,8 +8,8 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Notifications
{
diff --git a/osu.Game/Overlays/Notifications/SimpleNotification.cs b/osu.Game/Overlays/Notifications/SimpleNotification.cs
index 25a832941e..d0f49a74c0 100644
--- a/osu.Game/Overlays/Notifications/SimpleNotification.cs
+++ b/osu.Game/Overlays/Notifications/SimpleNotification.cs
@@ -8,7 +8,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Notifications
{
diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs
index 97c6554908..9cf42c3a29 100644
--- a/osu.Game/Overlays/OnScreenDisplay.cs
+++ b/osu.Game/Overlays/OnScreenDisplay.cs
@@ -11,8 +11,8 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Threading;
diff --git a/osu.Game/Overlays/Profile/Header/BadgeContainer.cs b/osu.Game/Overlays/Profile/Header/BadgeContainer.cs
index 6a87db4211..06fef22309 100644
--- a/osu.Game/Overlays/Profile/Header/BadgeContainer.cs
+++ b/osu.Game/Overlays/Profile/Header/BadgeContainer.cs
@@ -13,7 +13,7 @@ using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Users;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Profile.Header
{
diff --git a/osu.Game/Overlays/Profile/Header/RankGraph.cs b/osu.Game/Overlays/Profile/Header/RankGraph.cs
index bfb01ce1c8..f74c8b5069 100644
--- a/osu.Game/Overlays/Profile/Header/RankGraph.cs
+++ b/osu.Game/Overlays/Profile/Header/RankGraph.cs
@@ -15,7 +15,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Users;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Profile.Header
{
diff --git a/osu.Game/Overlays/Profile/Header/SupporterIcon.cs b/osu.Game/Overlays/Profile/Header/SupporterIcon.cs
index 37ad63464c..1325ea4e9a 100644
--- a/osu.Game/Overlays/Profile/Header/SupporterIcon.cs
+++ b/osu.Game/Overlays/Profile/Header/SupporterIcon.cs
@@ -8,7 +8,7 @@ using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Profile.Header
{
diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs
index 4839348e0e..a8075ec295 100644
--- a/osu.Game/Overlays/Profile/ProfileHeader.cs
+++ b/osu.Game/Overlays/Profile/ProfileHeader.cs
@@ -2,8 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Overlays/Profile/ProfileSection.cs b/osu.Game/Overlays/Profile/ProfileSection.cs
index c408f69cd7..1aa43feb8c 100644
--- a/osu.Game/Overlays/Profile/ProfileSection.cs
+++ b/osu.Game/Overlays/Profile/ProfileSection.cs
@@ -1,14 +1,14 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Users;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Configuration;
namespace osu.Game.Overlays.Profile
diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs
index 621f752b9c..195269d427 100644
--- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs
+++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs
@@ -7,7 +7,7 @@ using osu.Framework.Graphics;
using osu.Game.Online.API.Requests;
using osu.Game.Overlays.Direct;
using osu.Game.Users;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Profile.Sections.Beatmaps
{
diff --git a/osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs b/osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs
index 165299e8c0..3aefce39dc 100644
--- a/osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs
+++ b/osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs
@@ -8,8 +8,8 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Profile.Sections
{
diff --git a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs
index 0a2b2fe121..bc0f22f4d0 100644
--- a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs
+++ b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs
@@ -8,7 +8,7 @@ using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Drawables;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Profile.Sections.Historical
{
diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs
index 788041205b..5207aa6528 100644
--- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs
+++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs b/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs
index db93fcbc1b..40da95c30b 100644
--- a/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs
+++ b/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs
index 67e86265ed..a20054351d 100644
--- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs
+++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics;
diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/ScoreModsContainer.cs b/osu.Game/Overlays/Profile/Sections/Ranks/ScoreModsContainer.cs
index 90f476fa73..f67d333a0f 100644
--- a/osu.Game/Overlays/Profile/Sections/Ranks/ScoreModsContainer.cs
+++ b/osu.Game/Overlays/Profile/Sections/Ranks/ScoreModsContainer.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.UI;
using System.Collections.Generic;
diff --git a/osu.Game/Overlays/SearchableList/DisplayStyleControl.cs b/osu.Game/Overlays/SearchableList/DisplayStyleControl.cs
index 26a87230de..35888bee73 100644
--- a/osu.Game/Overlays/SearchableList/DisplayStyleControl.cs
+++ b/osu.Game/Overlays/SearchableList/DisplayStyleControl.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game/Overlays/SearchableList/HeaderTabControl.cs b/osu.Game/Overlays/SearchableList/HeaderTabControl.cs
index 62685eb323..07f1714e2c 100644
--- a/osu.Game/Overlays/SearchableList/HeaderTabControl.cs
+++ b/osu.Game/Overlays/SearchableList/HeaderTabControl.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;
diff --git a/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs b/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs
index 82a60a09e1..bd03ff9734 100644
--- a/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs
+++ b/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Overlays/SearchableList/SearchableListHeader.cs b/osu.Game/Overlays/SearchableList/SearchableListHeader.cs
index 9c4fe1c398..312197c7ae 100644
--- a/osu.Game/Overlays/SearchableList/SearchableListHeader.cs
+++ b/osu.Game/Overlays/SearchableList/SearchableListHeader.cs
@@ -2,8 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs b/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs
index df249b0b88..2c97cbeb40 100644
--- a/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs
+++ b/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
diff --git a/osu.Game/Overlays/SearchableList/SlimEnumDropdown.cs b/osu.Game/Overlays/SearchableList/SlimEnumDropdown.cs
index 33ddb8f53f..4c7f3e1c31 100644
--- a/osu.Game/Overlays/SearchableList/SlimEnumDropdown.cs
+++ b/osu.Game/Overlays/SearchableList/SlimEnumDropdown.cs
@@ -1,12 +1,12 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.SearchableList
{
diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs
index d637eb96f6..ad79024f62 100644
--- a/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs
+++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs
@@ -6,6 +6,7 @@ using osu.Framework.Audio;
using osu.Framework.Graphics;
using System.Collections.Generic;
using System.Linq;
+using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Settings.Sections.Audio
{
@@ -35,12 +36,12 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
private void updateItems()
{
- var deviceItems = new List> { new KeyValuePair("Default", string.Empty) };
- deviceItems.AddRange(audio.AudioDeviceNames.Select(d => new KeyValuePair(d, d)));
+ var deviceItems = new List { string.Empty };
+ deviceItems.AddRange(audio.AudioDeviceNames);
var preferredDeviceName = audio.AudioDevice.Value;
- if (deviceItems.All(kv => kv.Value != preferredDeviceName))
- deviceItems.Add(new KeyValuePair(preferredDeviceName, preferredDeviceName));
+ if (deviceItems.All(kv => kv != preferredDeviceName))
+ deviceItems.Add(preferredDeviceName);
// The option dropdown for audio device selection lists all audio
// device names. Dropdowns, however, may not have multiple identical
@@ -59,7 +60,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
Children = new Drawable[]
{
- dropdown = new SettingsDropdown()
+ dropdown = new AudioDeviceSettingsDropdown()
};
updateItems();
@@ -69,5 +70,16 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
audio.OnNewDevice += onDeviceChanged;
audio.OnLostDevice += onDeviceChanged;
}
+
+ private class AudioDeviceSettingsDropdown : SettingsDropdown
+ {
+ protected override OsuDropdown CreateDropdown() => new AudioDeviceDropdownControl { Items = Items };
+
+ private class AudioDeviceDropdownControl : DropdownControl
+ {
+ protected override string GenerateItemText(string item)
+ => string.IsNullOrEmpty(item) ? "Default" : base.GenerateItemText(item);
+ }
+ }
}
}
diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs
index 11a3d36779..6623fbc73b 100644
--- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs
+++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs
@@ -10,11 +10,11 @@ using osu.Game.Configuration;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API;
-using OpenTK;
+using osuTK;
using osu.Game.Users;
using System.ComponentModel;
using osu.Game.Graphics;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Input.Events;
using RectangleF = osu.Framework.Graphics.Primitives.RectangleF;
diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs
index 254de6c6f7..685244e06b 100644
--- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs
+++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs
@@ -6,9 +6,9 @@ using System.Drawing;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
-using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
+using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Settings.Sections.Graphics
{
@@ -85,7 +85,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
if (resolutions.Count > 1)
{
- resolutionSettingsContainer.Child = resolutionDropdown = new SettingsDropdown
+ resolutionSettingsContainer.Child = resolutionDropdown = new ResolutionSettingsDropdown
{
LabelText = "Resolution",
ShowsDefaultIndicator = false,
@@ -115,18 +115,36 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
}, true);
}
- private IReadOnlyList> getResolutions()
+ private IReadOnlyList getResolutions()
{
- var resolutions = new KeyValuePair("Default", new Size(9999, 9999)).Yield();
+ var resolutions = new List { new Size(9999, 9999) };
if (game.Window != null)
- resolutions = resolutions.Concat(game.Window.AvailableResolutions
- .Where(r => r.Width >= 800 && r.Height >= 600)
- .OrderByDescending(r => r.Width)
- .ThenByDescending(r => r.Height)
- .Select(res => new KeyValuePair($"{res.Width}x{res.Height}", new Size(res.Width, res.Height)))
- .Distinct());
- return resolutions.ToList();
+ {
+ resolutions.AddRange(game.Window.AvailableResolutions
+ .Where(r => r.Width >= 800 && r.Height >= 600)
+ .OrderByDescending(r => r.Width)
+ .ThenByDescending(r => r.Height)
+ .Select(res => new Size(res.Width, res.Height))
+ .Distinct());
+ }
+
+ return resolutions;
+ }
+
+ private class ResolutionSettingsDropdown : SettingsDropdown
+ {
+ protected override OsuDropdown CreateDropdown() => new ResolutionDropdownControl { Items = Items };
+
+ private class ResolutionDropdownControl : DropdownControl
+ {
+ protected override string GenerateItemText(Size item)
+ {
+ if (item == new Size(9999, 9999))
+ return "Default";
+ return $"{item.Width}x{item.Height}";
+ }
+ }
}
}
}
diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs
index 7b9b7bf57f..c4d180790c 100644
--- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs
+++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs
@@ -59,8 +59,8 @@ namespace osu.Game.Overlays.Settings.Sections.Input
rawInputToggle.ValueChanged += enabled =>
{
// this is temporary until we support per-handler settings.
- const string raw_mouse_handler = @"OpenTKRawMouseHandler";
- const string standard_mouse_handler = @"OpenTKMouseHandler";
+ const string raw_mouse_handler = @"OsuTKRawMouseHandler";
+ const string standard_mouse_handler = @"OsuTKMouseHandler";
ignoredInputHandler.Value = enabled ? standard_mouse_handler : raw_mouse_handler;
};
diff --git a/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs b/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs
index aa933ca188..673a49ea8f 100644
--- a/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs
+++ b/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs
@@ -4,7 +4,7 @@
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Settings.Sections.Maintenance;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Settings.Sections
{
diff --git a/osu.Game/Overlays/Settings/Sections/Online/WebSettings.cs b/osu.Game/Overlays/Settings/Sections/Online/WebSettings.cs
new file mode 100644
index 0000000000..62e307f323
--- /dev/null
+++ b/osu.Game/Overlays/Settings/Sections/Online/WebSettings.cs
@@ -0,0 +1,27 @@
+// Copyright (c) 2007-2018 ppy Pty Ltd .
+// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+
+using osu.Framework.Allocation;
+using osu.Framework.Graphics;
+using osu.Game.Configuration;
+
+namespace osu.Game.Overlays.Settings.Sections.Online
+{
+ public class WebSettings : SettingsSubsection
+ {
+ protected override string Header => "Web";
+
+ [BackgroundDependencyLoader]
+ private void load(OsuConfigManager config)
+ {
+ Children = new Drawable[]
+ {
+ new SettingsCheckbox
+ {
+ LabelText = "Warn about opening external links",
+ Bindable = config.GetBindable(OsuSetting.ExternalLinkWarning)
+ },
+ };
+ }
+ }
+}
diff --git a/osu.Game/Overlays/Settings/Sections/OnlineSection.cs b/osu.Game/Overlays/Settings/Sections/OnlineSection.cs
index 28cb503288..3a2e52d2eb 100644
--- a/osu.Game/Overlays/Settings/Sections/OnlineSection.cs
+++ b/osu.Game/Overlays/Settings/Sections/OnlineSection.cs
@@ -3,6 +3,7 @@
using osu.Framework.Graphics;
using osu.Game.Graphics;
+using osu.Game.Overlays.Settings.Sections.Online;
namespace osu.Game.Overlays.Settings.Sections
{
@@ -15,6 +16,7 @@ namespace osu.Game.Overlays.Settings.Sections
{
Children = new Drawable[]
{
+ new WebSettings()
};
}
}
diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs
index 15787d29f7..938e2ca2c3 100644
--- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs
+++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs
@@ -1,26 +1,29 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
+using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Skinning;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Settings.Sections
{
public class SkinSection : SettingsSection
{
- private SettingsDropdown skinDropdown;
+ private SkinSettingsDropdown skinDropdown;
public override string Header => "Skin";
public override FontAwesome Icon => FontAwesome.fa_paint_brush;
+ private readonly Bindable dropdownBindable = new Bindable();
+ private readonly Bindable configBindable = new Bindable();
+
private SkinManager skins;
[BackgroundDependencyLoader]
@@ -31,7 +34,7 @@ namespace osu.Game.Overlays.Settings.Sections
FlowContent.Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
- skinDropdown = new SettingsDropdown(),
+ skinDropdown = new SkinSettingsDropdown(),
new SettingsSlider
{
LabelText = "Menu cursor size",
@@ -54,19 +57,21 @@ namespace osu.Game.Overlays.Settings.Sections
skins.ItemAdded += itemAdded;
skins.ItemRemoved += itemRemoved;
- skinDropdown.Items = skins.GetAllUsableSkins().Select(s => new KeyValuePair(s.ToString(), s.ID));
+ config.BindWith(OsuSetting.Skin, configBindable);
- var skinBindable = config.GetBindable(OsuSetting.Skin);
+ skinDropdown.Bindable = dropdownBindable;
+ skinDropdown.Items = skins.GetAllUsableSkins().ToArray();
// Todo: This should not be necessary when OsuConfigManager is databased
- if (skinDropdown.Items.All(s => s.Value != skinBindable.Value))
- skinBindable.Value = 0;
+ if (skinDropdown.Items.All(s => s.ID != configBindable.Value))
+ configBindable.Value = 0;
- skinDropdown.Bindable = skinBindable;
+ configBindable.BindValueChanged(v => dropdownBindable.Value = skinDropdown.Items.Single(s => s.ID == v), true);
+ dropdownBindable.BindValueChanged(v => configBindable.Value = v.ID);
}
- private void itemRemoved(SkinInfo s) => skinDropdown.Items = skinDropdown.Items.Where(i => i.Value != s.ID);
- private void itemAdded(SkinInfo s) => skinDropdown.Items = skinDropdown.Items.Append(new KeyValuePair(s.ToString(), s.ID));
+ private void itemRemoved(SkinInfo s) => Schedule(() => skinDropdown.Items = skinDropdown.Items.Where(i => i.ID != s.ID).ToArray());
+ private void itemAdded(SkinInfo s) => Schedule(() => skinDropdown.Items = skinDropdown.Items.Append(s).ToArray());
protected override void Dispose(bool isDisposing)
{
@@ -83,5 +88,15 @@ namespace osu.Game.Overlays.Settings.Sections
{
public override string TooltipText => Current.Value.ToString(@"0.##x");
}
+
+ private class SkinSettingsDropdown : SettingsDropdown
+ {
+ protected override OsuDropdown CreateDropdown() => new SkinDropdownControl { Items = Items };
+
+ private class SkinDropdownControl : DropdownControl
+ {
+ protected override string GenerateItemText(SkinInfo item) => item.ToString();
+ }
+ }
}
}
diff --git a/osu.Game/Overlays/Settings/SettingsDropdown.cs b/osu.Game/Overlays/Settings/SettingsDropdown.cs
index 33a8af7d91..1c3eb6c245 100644
--- a/osu.Game/Overlays/Settings/SettingsDropdown.cs
+++ b/osu.Game/Overlays/Settings/SettingsDropdown.cs
@@ -2,36 +2,41 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
+using System.Linq;
using osu.Framework.Graphics;
-using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Settings
{
public class SettingsDropdown : SettingsItem
{
- private Dropdown dropdown;
+ protected new OsuDropdown Control => (OsuDropdown)base.Control;
- private IEnumerable> items = new KeyValuePair[] { };
- public IEnumerable> Items
+ private IEnumerable items = Enumerable.Empty();
+
+ public IEnumerable Items
{
- get
- {
- return items;
- }
+ get => items;
set
{
items = value;
- if (dropdown != null)
- dropdown.Items = value;
+
+ if (Control != null)
+ Control.Items = value;
}
}
- protected override Drawable CreateControl() => dropdown = new OsuDropdown
+ protected sealed override Drawable CreateControl() => CreateDropdown();
+
+ protected virtual OsuDropdown CreateDropdown() => new DropdownControl { Items = Items };
+
+ protected class DropdownControl : OsuDropdown
{
- Margin = new MarginPadding { Top = 5 },
- RelativeSizeAxes = Axes.X,
- Items = Items,
- };
+ public DropdownControl()
+ {
+ Margin = new MarginPadding { Top = 5 };
+ RelativeSizeAxes = Axes.X;
+ }
+ }
}
}
diff --git a/osu.Game/Overlays/Settings/SettingsEnumDropdown.cs b/osu.Game/Overlays/Settings/SettingsEnumDropdown.cs
index 64811137a6..2a98b80816 100644
--- a/osu.Game/Overlays/Settings/SettingsEnumDropdown.cs
+++ b/osu.Game/Overlays/Settings/SettingsEnumDropdown.cs
@@ -8,10 +8,15 @@ namespace osu.Game.Overlays.Settings
{
public class SettingsEnumDropdown : SettingsDropdown
{
- protected override Drawable CreateControl() => new OsuEnumDropdown
+ protected override OsuDropdown CreateDropdown() => new DropdownControl();
+
+ protected class DropdownControl : OsuEnumDropdown
{
- Margin = new MarginPadding { Top = 5 },
- RelativeSizeAxes = Axes.X,
- };
+ public DropdownControl()
+ {
+ Margin = new MarginPadding { Top = 5 };
+ RelativeSizeAxes = Axes.X;
+ }
+ }
}
}
diff --git a/osu.Game/Overlays/Settings/SettingsFooter.cs b/osu.Game/Overlays/Settings/SettingsFooter.cs
index 909fc20446..ac1548f00d 100644
--- a/osu.Game/Overlays/Settings/SettingsFooter.cs
+++ b/osu.Game/Overlays/Settings/SettingsFooter.cs
@@ -9,8 +9,8 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using DebugUtils = osu.Game.Utils.DebugUtils;
namespace osu.Game.Overlays.Settings
diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs
index 4f947cd812..1d7e6350ae 100644
--- a/osu.Game/Overlays/Settings/SettingsItem.cs
+++ b/osu.Game/Overlays/Settings/SettingsItem.cs
@@ -3,7 +3,7 @@
using System.Collections.Generic;
using osu.Framework.Allocation;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Configuration;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
@@ -15,7 +15,7 @@ using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
-using OpenTK;
+using osuTK;
namespace osu.Game.Overlays.Settings
{
diff --git a/osu.Game/Overlays/Settings/SettingsSection.cs b/osu.Game/Overlays/Settings/SettingsSection.cs
index 58714208c0..b7fe748bad 100644
--- a/osu.Game/Overlays/Settings/SettingsSection.cs
+++ b/osu.Game/Overlays/Settings/SettingsSection.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game/Overlays/Settings/SettingsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs
index 9296972749..94a660d1c8 100644
--- a/osu.Game/Overlays/Settings/SettingsSubsection.cs
+++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
diff --git a/osu.Game/Overlays/Settings/SettingsTextBox.cs b/osu.Game/Overlays/Settings/SettingsTextBox.cs
index ce9218bbe7..fbfb5481c5 100644
--- a/osu.Game/Overlays/Settings/SettingsTextBox.cs
+++ b/osu.Game/Overlays/Settings/SettingsTextBox.cs
@@ -8,6 +8,10 @@ namespace osu.Game.Overlays.Settings
{
public class SettingsTextBox : SettingsItem
{
- protected override Drawable CreateControl() => new OsuTextBox();
+ protected override Drawable CreateControl() => new OsuTextBox
+ {
+ Margin = new MarginPadding { Top = 5 },
+ RelativeSizeAxes = Axes.X,
+ };
}
}
diff --git a/osu.Game/Overlays/Settings/Sidebar.cs b/osu.Game/Overlays/Settings/Sidebar.cs
index 862011b6e2..e43d4682b9 100644
--- a/osu.Game/Overlays/Settings/Sidebar.cs
+++ b/osu.Game/Overlays/Settings/Sidebar.cs
@@ -4,8 +4,8 @@
using System;
using System.Linq;
using osu.Framework;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
diff --git a/osu.Game/Overlays/Settings/SidebarButton.cs b/osu.Game/Overlays/Settings/SidebarButton.cs
index b6d1cf609e..1b23273c3c 100644
--- a/osu.Game/Overlays/Settings/SidebarButton.cs
+++ b/osu.Game/Overlays/Settings/SidebarButton.cs
@@ -2,8 +2,8 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs
index c971ab5005..df81421ea7 100644
--- a/osu.Game/Overlays/SettingsOverlay.cs
+++ b/osu.Game/Overlays/SettingsOverlay.cs
@@ -4,8 +4,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
diff --git a/osu.Game/Overlays/Social/FilterControl.cs b/osu.Game/Overlays/Social/FilterControl.cs
index 1b9ce1033f..72c3791f6f 100644
--- a/osu.Game/Overlays/Social/FilterControl.cs
+++ b/osu.Game/Overlays/Social/FilterControl.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.SearchableList;
diff --git a/osu.Game/Overlays/Social/Header.cs b/osu.Game/Overlays/Social/Header.cs
index df97bdf448..a23a96cdf4 100644
--- a/osu.Game/Overlays/Social/Header.cs
+++ b/osu.Game/Overlays/Social/Header.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Overlays.SearchableList;
-using OpenTK.Graphics;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game/Overlays/Social/SocialPanel.cs b/osu.Game/Overlays/Social/SocialPanel.cs
index cfee639d53..4dfeda9041 100644
--- a/osu.Game/Overlays/Social/SocialPanel.cs
+++ b/osu.Game/Overlays/Social/SocialPanel.cs
@@ -1,8 +1,8 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs
index 222035ab65..bd6cd3cba6 100644
--- a/osu.Game/Overlays/SocialOverlay.cs
+++ b/osu.Game/Overlays/SocialOverlay.cs
@@ -4,8 +4,8 @@
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs
index 611b42383e..341f5c3fd1 100644
--- a/osu.Game/Overlays/Toolbar/Toolbar.cs
+++ b/osu.Game/Overlays/Toolbar/Toolbar.cs
@@ -7,7 +7,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
-using OpenTK;
+using osuTK;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs
index 5cb26974e6..a9d8be6ff2 100644
--- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs
+++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs
@@ -8,8 +8,8 @@ using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Sprites;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Game.Graphics.Containers;
diff --git a/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs b/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs
index ef7e5f07bb..42d9527432 100644
--- a/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs
+++ b/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs
@@ -8,8 +8,8 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Toolbar
{
diff --git a/osu.Game/Overlays/Toolbar/ToolbarRulesetButton.cs b/osu.Game/Overlays/Toolbar/ToolbarRulesetButton.cs
index bbdf796e7a..b0801d95b0 100644
--- a/osu.Game/Overlays/Toolbar/ToolbarRulesetButton.cs
+++ b/osu.Game/Overlays/Toolbar/ToolbarRulesetButton.cs
@@ -3,7 +3,7 @@
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Toolbar
{
diff --git a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs
index fa35e53531..19777bfbeb 100644
--- a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs
+++ b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs
@@ -6,9 +6,9 @@ using osu.Framework.Allocation;
using osu.Framework.Caching;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
-using OpenTK.Input;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Input;
+using osuTK.Graphics;
using osu.Framework.Configuration;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs
index c30d58b0d6..d0cb3c0ff2 100644
--- a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs
+++ b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs
@@ -4,7 +4,7 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using OpenTK;
+using osuTK;
using RectangleF = osu.Framework.Graphics.Primitives.RectangleF;
namespace osu.Game.Overlays.Toolbar
diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs
index b01a4c48b6..017d748600 100644
--- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs
+++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs
@@ -7,8 +7,8 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Online.API;
using osu.Game.Users;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Toolbar
{
diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs
index c106446fe0..c15f464c7c 100644
--- a/osu.Game/Overlays/UserProfileOverlay.cs
+++ b/osu.Game/Overlays/UserProfileOverlay.cs
@@ -16,8 +16,8 @@ using osu.Game.Online.API.Requests;
using osu.Game.Overlays.Profile;
using osu.Game.Overlays.Profile.Sections;
using osu.Game.Users;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays
{
diff --git a/osu.Game/Overlays/Volume/MuteButton.cs b/osu.Game/Overlays/Volume/MuteButton.cs
index a099a10096..e31b349827 100644
--- a/osu.Game/Overlays/Volume/MuteButton.cs
+++ b/osu.Game/Overlays/Volume/MuteButton.cs
@@ -11,8 +11,8 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Volume
{
diff --git a/osu.Game/Overlays/Volume/VolumeMeter.cs b/osu.Game/Overlays/Volume/VolumeMeter.cs
index 86be652c8c..1263ecd303 100644
--- a/osu.Game/Overlays/Volume/VolumeMeter.cs
+++ b/osu.Game/Overlays/Volume/VolumeMeter.cs
@@ -15,8 +15,8 @@ using osu.Framework.Input.Events;
using osu.Framework.MathUtils;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays.Volume
{
@@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Volume
private CircularProgress volumeCircle;
private CircularProgress volumeCircleGlow;
- public BindableDouble Bindable { get; } = new BindableDouble { MinValue = 0, MaxValue = 1 };
+ public BindableDouble Bindable { get; } = new BindableDouble { MinValue = 0, MaxValue = 1, Precision = 0.01 };
private readonly float circleSize;
private readonly Color4 meterColour;
private readonly string name;
@@ -222,21 +222,25 @@ namespace osu.Game.Overlays.Volume
private set => Bindable.Value = value;
}
- private const float adjust_step = 0.05f;
+ private const double adjust_step = 0.05;
public void Increase(double amount = 1, bool isPrecise = false) => adjust(amount, isPrecise);
public void Decrease(double amount = 1, bool isPrecise = false) => adjust(-amount, isPrecise);
// because volume precision is set to 0.01, this local is required to keep track of more precise adjustments and only apply when possible.
- private double adjustAccumulator;
+ private double scrollAccumulation;
private void adjust(double delta, bool isPrecise)
{
- adjustAccumulator += delta * adjust_step * (isPrecise ? 0.1 : 1);
- if (Math.Abs(adjustAccumulator) < Bindable.Precision)
- return;
- Volume += adjustAccumulator;
- adjustAccumulator = 0;
+ scrollAccumulation += delta * adjust_step * (isPrecise ? 0.1 : 1);
+
+ var precision = Bindable.Precision;
+
+ while (Precision.AlmostBigger(Math.Abs(scrollAccumulation), precision))
+ {
+ Volume += Math.Sign(scrollAccumulation) * precision;
+ scrollAccumulation = scrollAccumulation < 0 ? Math.Min(0, scrollAccumulation + precision) : Math.Max(0, scrollAccumulation - precision);
+ }
}
protected override bool OnScroll(ScrollEvent e)
diff --git a/osu.Game/Overlays/VolumeOverlay.cs b/osu.Game/Overlays/VolumeOverlay.cs
index d45d097a09..cbe61b5896 100644
--- a/osu.Game/Overlays/VolumeOverlay.cs
+++ b/osu.Game/Overlays/VolumeOverlay.cs
@@ -14,8 +14,8 @@ using osu.Framework.Threading;
using osu.Game.Graphics;
using osu.Game.Input.Bindings;
using osu.Game.Overlays.Volume;
-using OpenTK;
-using OpenTK.Graphics;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Overlays
{
diff --git a/osu.Game/Rulesets/Edit/EditRulesetContainer.cs b/osu.Game/Rulesets/Edit/EditRulesetContainer.cs
index 3c493eb16f..6f81d47431 100644
--- a/osu.Game/Rulesets/Edit/EditRulesetContainer.cs
+++ b/osu.Game/Rulesets/Edit/EditRulesetContainer.cs
@@ -91,8 +91,8 @@ namespace osu.Game.Rulesets.Edit
// Process the beatmap
var processor = ruleset.CreateBeatmapProcessor(beatmap);
- processor.PreProcess();
- processor.PostProcess();
+ processor?.PreProcess();
+ processor?.PostProcess();
// Remove visual representation
var drawableObject = Playfield.AllHitObjects.Single(d => d.HitObject == hitObject);
diff --git a/osu.Game/Rulesets/Edit/HitObjectComposer.cs b/osu.Game/Rulesets/Edit/HitObjectComposer.cs
index 0afe33ff2e..d41fd5c201 100644
--- a/osu.Game/Rulesets/Edit/HitObjectComposer.cs
+++ b/osu.Game/Rulesets/Edit/HitObjectComposer.cs
@@ -8,6 +8,7 @@ using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
+using osu.Framework.Input;
using osu.Framework.Logging;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
@@ -37,6 +38,8 @@ namespace osu.Game.Rulesets.Edit
private BlueprintContainer blueprintContainer;
+ private InputManager inputManager;
+
internal HitObjectComposer(Ruleset ruleset)
{
Ruleset = ruleset;
@@ -114,6 +117,13 @@ namespace osu.Game.Rulesets.Edit
toolboxCollection.Items[0].Select();
}
+ protected override void LoadComplete()
+ {
+ base.LoadComplete();
+
+ inputManager = GetContainingInputManager();
+ }
+
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
@@ -137,6 +147,11 @@ namespace osu.Game.Rulesets.Edit
});
}
+ ///
+ /// Whether the user's cursor is currently in an area of the that is valid for placement.
+ ///
+ public virtual bool CursorInPlacementArea => RulesetContainer.Playfield.ReceivePositionalInputAt(inputManager.CurrentState.Mouse.Position);
+
///
/// Adds a to the and visualises it.
///
diff --git a/osu.Game/Rulesets/Edit/PlacementBlueprint.cs b/osu.Game/Rulesets/Edit/PlacementBlueprint.cs
index b726b683ea..1d568313ca 100644
--- a/osu.Game/Rulesets/Edit/PlacementBlueprint.cs
+++ b/osu.Game/Rulesets/Edit/PlacementBlueprint.cs
@@ -1,25 +1,36 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using System;
+using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
-using osu.Framework.Input;
using osu.Framework.Input.Events;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects;
using osu.Game.Screens.Edit.Compose;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Edit
{
///
/// A blueprint which governs the creation of a new to actualisation.
///
- public abstract class PlacementBlueprint : CompositeDrawable, IRequireHighFrequencyMousePosition
+ public abstract class PlacementBlueprint : CompositeDrawable, IStateful
{
+ ///
+ /// Invoked when has changed.
+ ///
+ public event Action StateChanged;
+
+ ///
+ /// Whether the is currently being placed, but has not necessarily finished being placed.
+ ///
+ public bool PlacementBegun { get; private set; }
+
///
/// The that is being placed.
///
@@ -37,6 +48,12 @@ namespace osu.Game.Rulesets.Edit
HitObject = hitObject;
RelativeSizeAxes = Axes.Both;
+
+ // This is required to allow the blueprint's position to be updated via OnMouseMove/Handle
+ // on the same frame it is made visible via a PlacementState change.
+ AlwaysPresent = true;
+
+ Alpha = 0;
}
[BackgroundDependencyLoader]
@@ -49,7 +66,25 @@ namespace osu.Game.Rulesets.Edit
ApplyDefaultsToHitObject();
}
- private bool placementBegun;
+ private PlacementState state;
+
+ public PlacementState State
+ {
+ get => state;
+ set
+ {
+ if (state == value)
+ return;
+ state = value;
+
+ if (state == PlacementState.Shown)
+ Show();
+ else
+ Hide();
+
+ StateChanged?.Invoke(value);
+ }
+ }
///
/// Signals that the placement of has started.
@@ -57,7 +92,7 @@ namespace osu.Game.Rulesets.Edit
protected void BeginPlacement()
{
placementHandler.BeginPlacement(HitObject);
- placementBegun = true;
+ PlacementBegun = true;
}
///
@@ -66,7 +101,7 @@ namespace osu.Game.Rulesets.Edit
///
protected void EndPlacement()
{
- if (!placementBegun)
+ if (!PlacementBegun)
BeginPlacement();
placementHandler.EndPlacement(HitObject);
}
@@ -93,4 +128,10 @@ namespace osu.Game.Rulesets.Edit
}
}
}
+
+ public enum PlacementState
+ {
+ Hidden,
+ Shown,
+ }
}
diff --git a/osu.Game/Rulesets/Edit/SelectionBlueprint.cs b/osu.Game/Rulesets/Edit/SelectionBlueprint.cs
index db35d47b2b..b94b6a89a7 100644
--- a/osu.Game/Rulesets/Edit/SelectionBlueprint.cs
+++ b/osu.Game/Rulesets/Edit/SelectionBlueprint.cs
@@ -10,7 +10,7 @@ using osu.Framework.Input.Events;
using osu.Framework.Input.States;
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets.Objects.Drawables;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Edit
{
diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs
index e8e775a20d..dd0152d957 100644
--- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs
+++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Framework.Allocation;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
@@ -12,7 +12,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring;
using osu.Game.Skinning;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Judgements
{
diff --git a/osu.Game/Rulesets/Mods/ModFlashlight.cs b/osu.Game/Rulesets/Mods/ModFlashlight.cs
index 223263195c..9388d40146 100644
--- a/osu.Game/Rulesets/Mods/ModFlashlight.cs
+++ b/osu.Game/Rulesets/Mods/ModFlashlight.cs
@@ -1,11 +1,27 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
+using System;
+using System.Collections.Generic;
+using osu.Framework.Allocation;
+using osu.Framework.Configuration;
+using osu.Framework.Graphics;
+using osu.Framework.Graphics.OpenGL.Vertices;
+using osu.Framework.Graphics.Primitives;
+using osu.Framework.Graphics.Shaders;
+using osu.Framework.Graphics.Textures;
+using osu.Game.Beatmaps.Timing;
using osu.Game.Graphics;
+using osu.Game.Rulesets.Objects;
+using osu.Game.Rulesets.Scoring;
+using osu.Game.Rulesets.UI;
+using osuTK;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Mods
{
- public abstract class ModFlashlight : Mod
+ public abstract class ModFlashlight : Mod, IApplicableToRulesetContainer, IApplicableToScoreProcessor
+ where T : HitObject
{
public override string Name => "Flashlight";
public override string ShortenedName => "FL";
@@ -13,5 +29,125 @@ namespace osu.Game.Rulesets.Mods
public override ModType Type => ModType.DifficultyIncrease;
public override string Description => "Restricted view area.";
public override bool Ranked => true;
+
+ public const double FLASHLIGHT_FADE_DURATION = 800;
+ protected readonly BindableInt Combo = new BindableInt();
+
+ public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
+ {
+ Combo.BindTo(scoreProcessor.Combo);
+ }
+
+ public virtual void ApplyToRulesetContainer(RulesetContainer rulesetContainer)
+ {
+ var flashlight = CreateFlashlight();
+ flashlight.Combo = Combo;
+ flashlight.RelativeSizeAxes = Axes.Both;
+ flashlight.Colour = Color4.Black;
+ rulesetContainer.KeyBindingInputManager.Add(flashlight);
+
+ flashlight.Breaks = rulesetContainer.Beatmap.Breaks;
+ }
+
+ public abstract Flashlight CreateFlashlight();
+
+ public abstract class Flashlight : Drawable
+ {
+ internal BindableInt Combo;
+ private Shader shader;
+
+ protected override DrawNode CreateDrawNode() => new FlashlightDrawNode();
+
+ public override bool RemoveCompletedTransforms => false;
+
+ public List Breaks;
+
+ protected override void ApplyDrawNode(DrawNode node)
+ {
+ base.ApplyDrawNode(node);
+
+ var flashNode = (FlashlightDrawNode)node;
+
+ flashNode.Shader = shader;
+ flashNode.ScreenSpaceDrawQuad = ScreenSpaceDrawQuad;
+ flashNode.FlashlightPosition = Vector2Extensions.Transform(FlashlightPosition, DrawInfo.Matrix);
+ flashNode.FlashlightSize = Vector2Extensions.Transform(FlashlightSize, DrawInfo.Matrix);
+ }
+
+ [BackgroundDependencyLoader]
+ private void load(ShaderManager shaderManager)
+ {
+ shader = shaderManager.Load("PositionAndColour", FragmentShader);
+ }
+
+ protected override void LoadComplete()
+ {
+ base.LoadComplete();
+
+ Combo.ValueChanged += OnComboChange;
+
+ this.FadeInFromZero(FLASHLIGHT_FADE_DURATION);
+
+ foreach (var breakPeriod in Breaks)
+ {
+ if (breakPeriod.Duration < FLASHLIGHT_FADE_DURATION * 2) continue;
+
+ this.Delay(breakPeriod.StartTime + FLASHLIGHT_FADE_DURATION).FadeOutFromOne(FLASHLIGHT_FADE_DURATION);
+ this.Delay(breakPeriod.EndTime - FLASHLIGHT_FADE_DURATION).FadeInFromZero(FLASHLIGHT_FADE_DURATION);
+ }
+ }
+
+ protected abstract void OnComboChange(int newCombo);
+
+ protected abstract string FragmentShader { get; }
+
+ private Vector2 flashlightPosition;
+ protected Vector2 FlashlightPosition
+ {
+ get => flashlightPosition;
+ set
+ {
+ if (flashlightPosition == value) return;
+
+ flashlightPosition = value;
+ Invalidate(Invalidation.DrawNode);
+ }
+ }
+
+ private Vector2 flashlightSize;
+ protected Vector2 FlashlightSize
+ {
+ get => flashlightSize;
+ set
+ {
+ if (flashlightSize == value) return;
+
+ flashlightSize = value;
+ Invalidate(Invalidation.DrawNode);
+ }
+ }
+ }
+
+ private class FlashlightDrawNode : DrawNode
+ {
+ public Shader Shader;
+ public Quad ScreenSpaceDrawQuad;
+ public Vector2 FlashlightPosition;
+ public Vector2 FlashlightSize;
+
+ public override void Draw(Action vertexAction)
+ {
+ base.Draw(vertexAction);
+
+ Shader.Bind();
+
+ Shader.GetUniform("flashlightPos").UpdateValue(ref FlashlightPosition);
+ Shader.GetUniform("flashlightSize").UpdateValue(ref FlashlightSize);
+
+ Texture.WhitePixel.DrawQuad(ScreenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: vertexAction);
+
+ Shader.Unbind();
+ }
+ }
}
}
diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs
index e9e9d93ed5..8718269eed 100644
--- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs
+++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs
@@ -14,7 +14,7 @@ using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Scoring;
using osu.Game.Skinning;
-using OpenTK.Graphics;
+using osuTK.Graphics;
namespace osu.Game.Rulesets.Objects.Drawables
{
@@ -84,6 +84,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
public override bool RemoveCompletedTransforms => false;
protected override bool RequiresChildrenUpdate => true;
+ public override bool IsPresent => base.IsPresent || State.Value == ArmedState.Idle && Clock?.CurrentTime >= LifetimeStart;
+
public readonly Bindable State = new Bindable();
protected DrawableHitObject(HitObject hitObject)
diff --git a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs
index b167812c1d..e8962cd5ec 100644
--- a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs
+++ b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Game.Audio;
using osu.Game.Rulesets.Objects.Types;
using System.Collections.Generic;
diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs
index 3cc695447e..85eb29033e 100644
--- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs
+++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Game.Rulesets.Objects.Types;
using System;
using System.Collections.Generic;
diff --git a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs
index fa5e769d3c..b81fed9f03 100644
--- a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs
+++ b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Game.Audio;
using osu.Game.Rulesets.Objects.Types;
using System.Collections.Generic;
diff --git a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHit.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHit.cs
index 0062e83a28..c8d10816bd 100644
--- a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHit.cs
+++ b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHit.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Objects.Types;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Objects.Legacy.Osu
{
diff --git a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs
index e21903dc6d..f65452858a 100644
--- a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs
+++ b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
-using OpenTK;
+using osuTK;
using osu.Game.Rulesets.Objects.Types;
using System.Collections.Generic;
using osu.Game.Audio;
diff --git a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSlider.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSlider.cs
index 45f7bc9e67..bceca0675e 100644
--- a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSlider.cs
+++ b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSlider.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Objects.Types;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Objects.Legacy.Osu
{
diff --git a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSpinner.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSpinner.cs
index 3b349d9704..49f27b01f6 100644
--- a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSpinner.cs
+++ b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSpinner.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Objects.Types;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Objects.Legacy.Osu
{
diff --git a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs
index 8e1e01a9fd..16ed49ce2b 100644
--- a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs
+++ b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
using osu.Game.Rulesets.Objects.Types;
using System.Collections.Generic;
using osu.Game.Audio;
diff --git a/osu.Game/Rulesets/Objects/SliderPath.cs b/osu.Game/Rulesets/Objects/SliderPath.cs
index 74a312698c..fe38fd4f65 100644
--- a/osu.Game/Rulesets/Objects/SliderPath.cs
+++ b/osu.Game/Rulesets/Objects/SliderPath.cs
@@ -7,7 +7,7 @@ using System.Linq;
using Newtonsoft.Json;
using osu.Framework.MathUtils;
using osu.Game.Rulesets.Objects.Types;
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Objects
{
diff --git a/osu.Game/Rulesets/Objects/Types/IHasCurve.cs b/osu.Game/Rulesets/Objects/Types/IHasCurve.cs
index a097b62851..a6e2c15f5a 100644
--- a/osu.Game/Rulesets/Objects/Types/IHasCurve.cs
+++ b/osu.Game/Rulesets/Objects/Types/IHasCurve.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using OpenTK;
+using osuTK;
namespace osu.Game.Rulesets.Objects.Types
{
diff --git a/osu.Game/Rulesets/Objects/Types/IHasPosition.cs b/osu.Game/Rulesets/Objects/Types/IHasPosition.cs
index eabae611d5..d14e4cc1fb 100644
--- a/osu.Game/Rulesets/Objects/Types/IHasPosition.cs
+++ b/osu.Game/Rulesets/Objects/Types/IHasPosition.cs
@@ -1,7 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd