From bb6478cdc3e98dee0cbfb8a6d722d012ae556233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Thu, 10 May 2018 10:15:47 +0200 Subject: [PATCH 01/56] Adds a check to disable music controller's seek --- osu.Game/Overlays/MusicController.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index b4021f2808..0605b211b0 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -206,7 +206,7 @@ namespace osu.Game.Overlays Anchor = Anchor.BottomCentre, Height = progress_height, FillColour = colours.Yellow, - OnSeek = progress => current?.Track.Seek(progress) + OnSeek = progress => ConditionalSeek(progress) } }, }, @@ -219,6 +219,13 @@ namespace osu.Game.Overlays playlist.StateChanged += s => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint); } + private bool? ConditionalSeek(double progress) + { + if (current.Track.Looping) + return current?.Track.Seek(progress); + return false; + } + protected override void LoadComplete() { beatmapBacking.ValueChanged += beatmapChanged; From 5b99d8df62c5176f1400d41c81e88905d7c108e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Thu, 10 May 2018 11:29:19 +0200 Subject: [PATCH 02/56] Fixes private method name capitalization --- osu.Game/Overlays/MusicController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 0605b211b0..ee928b3ccc 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -206,7 +206,7 @@ namespace osu.Game.Overlays Anchor = Anchor.BottomCentre, Height = progress_height, FillColour = colours.Yellow, - OnSeek = progress => ConditionalSeek(progress) + OnSeek = progress => conditionalSeek(progress) } }, }, @@ -219,7 +219,7 @@ namespace osu.Game.Overlays playlist.StateChanged += s => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint); } - private bool? ConditionalSeek(double progress) + private bool? conditionalSeek(double progress) { if (current.Track.Looping) return current?.Track.Seek(progress); From d54a7295f6a72a49cd7d7eece02cbb4cdb30f5b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Thu, 10 May 2018 13:20:04 +0200 Subject: [PATCH 03/56] Adds DisableSeek property to MusicController --- osu.Game/OsuGame.cs | 9 ++++++--- osu.Game/Overlays/MusicController.cs | 6 +++--- osu.Game/Screens/OsuScreen.cs | 2 ++ osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs | 2 ++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index d443ed36ae..4d6b4520fe 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -537,10 +537,13 @@ namespace osu.Game // we only want to apply these restrictions when we are inside a screen stack. // the use case for not applying is in visual/unit tests. - bool applyRestrictions = !currentScreen?.AllowBeatmapRulesetChange ?? false; + bool applyBeatmapRulesetRestrictions = !currentScreen?.AllowBeatmapRulesetChange ?? false; + bool applyUserSeekRestrictions = !currentScreen?.AllowUserSeek ?? false; - Ruleset.Disabled = applyRestrictions; - Beatmap.Disabled = applyRestrictions; + Ruleset.Disabled = applyBeatmapRulesetRestrictions; + Beatmap.Disabled = applyBeatmapRulesetRestrictions; + + musicController.DisableSeek = applyUserSeekRestrictions; mainContent.Padding = new MarginPadding { Top = ToolbarOffset }; diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index ee928b3ccc..9cfce04685 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -221,9 +221,7 @@ namespace osu.Game.Overlays private bool? conditionalSeek(double progress) { - if (current.Track.Looping) - return current?.Track.Seek(progress); - return false; + return DisableSeek ? false : current?.Track.Seek(progress); } protected override void LoadComplete() @@ -235,6 +233,8 @@ namespace osu.Game.Overlays base.LoadComplete(); } + public bool DisableSeek { get; set; } + private void beatmapDisabledChanged(bool disabled) { if (disabled) diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 7a910574e0..48c3d95b0c 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -50,6 +50,8 @@ namespace osu.Game.Screens /// public virtual bool AllowBeatmapRulesetChange => true; + public virtual bool AllowUserSeek => true; + protected readonly Bindable Beatmap = new Bindable(); protected virtual float BackgroundParallaxAmount => 1; diff --git a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs index 1ccc5e2fe8..add02732d4 100644 --- a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs +++ b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs @@ -17,6 +17,8 @@ namespace osu.Game.Screens.Play public override bool AllowBeatmapRulesetChange => false; + public override bool AllowUserSeek => false; + protected const float BACKGROUND_FADE_DURATION = 800; protected float BackgroundOpacity => 1 - (float)DimLevel; From a877855fc615f697d4d205a304d4dde62031e70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Fri, 11 May 2018 09:39:55 +0200 Subject: [PATCH 04/56] Changes conditionSeek return type to void --- osu.Game/Overlays/MusicController.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 9cfce04685..a0074ccee7 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -219,9 +219,11 @@ namespace osu.Game.Overlays playlist.StateChanged += s => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint); } - private bool? conditionalSeek(double progress) + private void conditionalSeek(double progress) { - return DisableSeek ? false : current?.Track.Seek(progress); + if (DisableSeek) + return; + current?.Track.Seek(progress); } protected override void LoadComplete() From 17ed5e48390cb3d19fb8ae2554b86c6aa60a3985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Fri, 11 May 2018 09:41:31 +0200 Subject: [PATCH 05/56] Moves seek restrictions to Player --- osu.Game/Screens/Play/Player.cs | 2 ++ osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 83958b2912..8989cbaad4 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -45,6 +45,8 @@ namespace osu.Game.Screens.Play public bool AllowLeadIn { get; set; } = true; public bool AllowResults { get; set; } = true; + public override bool AllowUserSeek => false; + private Bindable mouseWheelDisabled; private Bindable userAudioOffset; diff --git a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs index add02732d4..1ccc5e2fe8 100644 --- a/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs +++ b/osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs @@ -17,8 +17,6 @@ namespace osu.Game.Screens.Play public override bool AllowBeatmapRulesetChange => false; - public override bool AllowUserSeek => false; - protected const float BACKGROUND_FADE_DURATION = 800; protected float BackgroundOpacity => 1 - (float)DimLevel; From c55d47ff1085d0b215f3619678bcbac277c63adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Fri, 11 May 2018 09:56:23 +0200 Subject: [PATCH 06/56] Converts OnSeek assignment to method group --- osu.Game/Overlays/MusicController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index a0074ccee7..45a59a0f87 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -206,7 +206,7 @@ namespace osu.Game.Overlays Anchor = Anchor.BottomCentre, Height = progress_height, FillColour = colours.Yellow, - OnSeek = progress => conditionalSeek(progress) + OnSeek = conditionalSeek } }, }, From a7e7c3a74a2132d173f2be310e2583acd808d126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Sat, 12 May 2018 11:55:52 +0200 Subject: [PATCH 07/56] Enables/Disables seek and Play/Resume on call to beatmapDisabledChanged --- osu.Game/OsuGame.cs | 3 --- osu.Game/Overlays/MusicController.cs | 9 +++++---- osu.Game/Screens/OsuScreen.cs | 2 -- osu.Game/Screens/Play/Player.cs | 2 -- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 4d6b4520fe..4e79ea48ca 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -538,13 +538,10 @@ namespace osu.Game // we only want to apply these restrictions when we are inside a screen stack. // the use case for not applying is in visual/unit tests. bool applyBeatmapRulesetRestrictions = !currentScreen?.AllowBeatmapRulesetChange ?? false; - bool applyUserSeekRestrictions = !currentScreen?.AllowUserSeek ?? false; Ruleset.Disabled = applyBeatmapRulesetRestrictions; Beatmap.Disabled = applyBeatmapRulesetRestrictions; - musicController.DisableSeek = applyUserSeekRestrictions; - mainContent.Padding = new MarginPadding { Top = ToolbarOffset }; CursorOverrideContainer.CanShowCursor = currentScreen?.CursorVisible ?? false; diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 45a59a0f87..8ff8dfb3ad 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -221,9 +221,8 @@ namespace osu.Game.Overlays private void conditionalSeek(double progress) { - if (DisableSeek) - return; - current?.Track.Seek(progress); + if (EnableSeek) + current?.Track.Seek(progress); } protected override void LoadComplete() @@ -235,16 +234,18 @@ namespace osu.Game.Overlays base.LoadComplete(); } - public bool DisableSeek { get; set; } + private bool EnableSeek { get; set; } private void beatmapDisabledChanged(bool disabled) { if (disabled) playlist.Hide(); + playButton.Enabled.Value = !disabled; prevButton.Enabled.Value = !disabled; nextButton.Enabled.Value = !disabled; playlistButton.Enabled.Value = !disabled; + EnableSeek = !disabled; } protected override void UpdateAfterChildren() diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 48c3d95b0c..7a910574e0 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -50,8 +50,6 @@ namespace osu.Game.Screens /// public virtual bool AllowBeatmapRulesetChange => true; - public virtual bool AllowUserSeek => true; - protected readonly Bindable Beatmap = new Bindable(); protected virtual float BackgroundParallaxAmount => 1; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 2e6db93065..f397d0c3d4 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -45,8 +45,6 @@ namespace osu.Game.Screens.Play public bool AllowLeadIn { get; set; } = true; public bool AllowResults { get; set; } = true; - public override bool AllowUserSeek => false; - private Bindable mouseWheelDisabled; private Bindable userAudioOffset; From 861a8cf9a749a079f983ac38b4bb38fe0704f790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Sat, 12 May 2018 23:10:03 +0200 Subject: [PATCH 08/56] Fixes capitalization of enableSeek --- osu.Game/Overlays/MusicController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 8ff8dfb3ad..0406bb812c 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -221,7 +221,7 @@ namespace osu.Game.Overlays private void conditionalSeek(double progress) { - if (EnableSeek) + if (enableSeek) current?.Track.Seek(progress); } @@ -234,7 +234,7 @@ namespace osu.Game.Overlays base.LoadComplete(); } - private bool EnableSeek { get; set; } + private bool enableSeek { get; set; } private void beatmapDisabledChanged(bool disabled) { @@ -245,7 +245,7 @@ namespace osu.Game.Overlays prevButton.Enabled.Value = !disabled; nextButton.Enabled.Value = !disabled; playlistButton.Enabled.Value = !disabled; - EnableSeek = !disabled; + enableSeek = !disabled; } protected override void UpdateAfterChildren() From 2979cb96a6eae23852f245042a248966e5e802ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20Odg=C3=A5rd=20T=C3=B8rring?= Date: Wed, 4 Jul 2018 21:09:28 +0200 Subject: [PATCH 09/56] attemptSeek accesses beatmap Disabled directly --- osu.Game/Overlays/MusicController.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index f7f0d7ec6a..94b69271fd 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -183,7 +183,7 @@ namespace osu.Game.Overlays Anchor = Anchor.BottomCentre, Height = progress_height, FillColour = colours.Yellow, - OnSeek = conditionalSeek + OnSeek = attemptSeek } }, }, @@ -198,9 +198,9 @@ namespace osu.Game.Overlays playlist.StateChanged += s => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint); } - private void conditionalSeek(double progress) + private void attemptSeek(double progress) { - if (enableSeek) + if (!beatmap.Disabled) current?.Track.Seek(progress); } @@ -220,8 +220,6 @@ namespace osu.Game.Overlays base.LoadComplete(); } - private bool enableSeek { get; set; } - private void beatmapDisabledChanged(bool disabled) { if (disabled) @@ -231,7 +229,6 @@ namespace osu.Game.Overlays prevButton.Enabled.Value = !disabled; nextButton.Enabled.Value = !disabled; playlistButton.Enabled.Value = !disabled; - enableSeek = !disabled; } protected override void UpdateAfterChildren() From c6816a6cf3f638b5ee031280f6be7b1c9e79c4e9 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Tue, 17 Jul 2018 17:00:28 +0900 Subject: [PATCH 10/56] Fix potential quadratic complexity in taiko autoplay --- osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index cea59c3fea..7dd50ab8b8 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -88,7 +88,8 @@ namespace osu.Game.Rulesets.Taiko.Scoring AddJudgement(new TaikoStrongHitJudgement()); break; case DrumRoll drumRoll: - for (int i = 0; i < drumRoll.NestedHitObjects.OfType().Count(); i++) + var count = drumRoll.NestedHitObjects.OfType().Count(); + for (int i = 0; i < count; i++) { AddJudgement(new TaikoDrumRollTickJudgement { Result = HitResult.Great }); From e3fb781a5a712883a83380b2023e2e09f11d4b83 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 18 Jul 2018 12:58:28 +0900 Subject: [PATCH 11/56] Fix ArchiveModelManager's model import method not running import logic --- osu.Game/Beatmaps/BeatmapManager.cs | 3 +- osu.Game/Database/ArchiveModelManager.cs | 42 ++++++++++++-------- osu.Game/Database/SingletonContextFactory.cs | 2 +- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 78042349d1..4ff16b604a 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -91,7 +91,8 @@ namespace osu.Game.Beatmaps protected override void Populate(BeatmapSetInfo model, ArchiveReader archive) { - model.Beatmaps = createBeatmapDifficulties(archive); + if (archive != null) + model.Beatmaps = createBeatmapDifficulties(archive); foreach (BeatmapInfo b in model.Beatmaps) { diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index cbf0df3227..0465c0ad73 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using JetBrains.Annotations; using Microsoft.EntityFrameworkCore; using osu.Framework.IO.File; using osu.Framework.Logging; @@ -175,7 +176,24 @@ namespace osu.Game.Database /// The archive to be imported. public TModel Import(ArchiveReader archive) { - TModel item = null; + try + { + return Import(CreateModel(archive), archive); + } + catch (Exception e) + { + Logger.Error(e, $"Model creation of {archive.Name} failed.", LoggingTarget.Database); + return null; + } + } + + /// + /// Import an item from a . + /// + /// The model to be imported. + /// An optional archive to use for model population. + public TModel Import(TModel item, ArchiveReader archive = null) + { delayEvents(); try @@ -186,18 +204,16 @@ namespace osu.Game.Database { if (!write.IsTransactionLeader) throw new InvalidOperationException($"Ensure there is no parent transaction so errors can correctly be handled by {this}"); - // create a new model (don't yet add to database) - item = CreateModel(archive); - var existing = CheckForExisting(item); if (existing != null) { - Logger.Log($"Found existing {typeof(TModel)} for {archive.Name} (ID {existing.ID}). Skipping import.", LoggingTarget.Database); + Logger.Log($"Found existing {typeof(TModel)} for {item} (ID {existing.ID}). Skipping import.", LoggingTarget.Database); return existing; } - item.Files = createFileInfos(archive, Files); + if (archive != null) + item.Files = createFileInfos(archive, Files); Populate(item, archive); @@ -211,11 +227,11 @@ namespace osu.Game.Database } } - Logger.Log($"Import of {archive.Name} successfully completed!", LoggingTarget.Database); + Logger.Log($"Import of {item} successfully completed!", LoggingTarget.Database); } catch (Exception e) { - Logger.Error(e, $"Import of {archive.Name} failed and has been rolled back.", LoggingTarget.Database); + Logger.Error(e, $"Import of {item} failed and has been rolled back.", LoggingTarget.Database); item = null; } finally @@ -227,12 +243,6 @@ namespace osu.Game.Database return item; } - /// - /// Import an item from a . - /// - /// The model to be imported. - public void Import(TModel item) => ModelStore.Add(item); - /// /// Perform an update of the specified item. /// TODO: Support file changes. @@ -385,8 +395,8 @@ namespace osu.Game.Database /// After this method, the model should be in a state ready to commit to a store. /// /// The model to populate. - /// The archive to use as a reference for population. - protected virtual void Populate(TModel model, ArchiveReader archive) + /// The archive to use as a reference for population. May be null. + protected virtual void Populate(TModel model, [CanBeNull] ArchiveReader archive) { } diff --git a/osu.Game/Database/SingletonContextFactory.cs b/osu.Game/Database/SingletonContextFactory.cs index ce3fbf6881..a7158c0583 100644 --- a/osu.Game/Database/SingletonContextFactory.cs +++ b/osu.Game/Database/SingletonContextFactory.cs @@ -14,6 +14,6 @@ namespace osu.Game.Database public OsuDbContext Get() => context; - public DatabaseWriteUsage GetForWrite(bool withTransaction = true) => new DatabaseWriteUsage(context, null); + public DatabaseWriteUsage GetForWrite(bool withTransaction = true) => new DatabaseWriteUsage(context, null) { IsTransactionLeader = true }; } } From 0c242443400529b107b567c318198210f2a846f6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 18 Jul 2018 16:43:46 +0900 Subject: [PATCH 12/56] Remove SingletonContextFactory It is dangerous to use this as it doesn't correctly handle contexts and can cause issues that will never actually arise in normal execution. # Conflicts: # osu.Game/Database/SingletonContextFactory.cs --- .../Visual/TestCasePlaySongSelect.cs | 7 ++++++- osu.Game/Database/DatabaseContextFactory.cs | 10 +++++----- osu.Game/Database/SingletonContextFactory.cs | 19 ------------------- osu.Game/OsuGameBase.cs | 2 +- osu.Game/Tests/Platform/TestStorage.cs | 8 +++----- 5 files changed, 15 insertions(+), 31 deletions(-) delete mode 100644 osu.Game/Database/SingletonContextFactory.cs diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index dab7f7e037..4afb76a7e2 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -62,7 +62,12 @@ namespace osu.Game.Tests.Visual var storage = new TestStorage(@"TestCasePlaySongSelect"); // this is by no means clean. should be replacing inside of OsuGameBase somehow. - IDatabaseContextFactory factory = new SingletonContextFactory(new OsuDbContext()); + DatabaseContextFactory factory = new DatabaseContextFactory(storage); + + factory.ResetDatabase(); + + using (var usage = factory.Get()) + usage.Migrate(); Dependencies.Cache(rulesets = new RulesetStore(factory)); Dependencies.Cache(manager = new BeatmapManager(storage, factory, rulesets, null, null) diff --git a/osu.Game/Database/DatabaseContextFactory.cs b/osu.Game/Database/DatabaseContextFactory.cs index 5160239c38..c20d4569f6 100644 --- a/osu.Game/Database/DatabaseContextFactory.cs +++ b/osu.Game/Database/DatabaseContextFactory.cs @@ -11,7 +11,7 @@ namespace osu.Game.Database { public class DatabaseContextFactory : IDatabaseContextFactory { - private readonly GameHost host; + private readonly Storage storage; private const string database_name = @"client"; @@ -26,9 +26,9 @@ namespace osu.Game.Database private IDbContextTransaction currentWriteTransaction; - public DatabaseContextFactory(GameHost host) + public DatabaseContextFactory(Storage storage) { - this.host = host; + this.storage = storage; recycleThreadContexts(); } @@ -117,7 +117,7 @@ namespace osu.Game.Database private void recycleThreadContexts() => threadContexts = new ThreadLocal(CreateContext); - protected virtual OsuDbContext CreateContext() => new OsuDbContext(host.Storage.GetDatabaseConnectionString(database_name)) + protected virtual OsuDbContext CreateContext() => new OsuDbContext(storage.GetDatabaseConnectionString(database_name)) { Database = { AutoTransactionsEnabled = false } }; @@ -129,7 +129,7 @@ namespace osu.Game.Database recycleThreadContexts(); GC.Collect(); GC.WaitForPendingFinalizers(); - host.Storage.DeleteDatabase(database_name); + storage.DeleteDatabase(database_name); } } } diff --git a/osu.Game/Database/SingletonContextFactory.cs b/osu.Game/Database/SingletonContextFactory.cs deleted file mode 100644 index ce3fbf6881..0000000000 --- a/osu.Game/Database/SingletonContextFactory.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -namespace osu.Game.Database -{ - public class SingletonContextFactory : IDatabaseContextFactory - { - private readonly OsuDbContext context; - - public SingletonContextFactory(OsuDbContext context) - { - this.context = context; - } - - public OsuDbContext Get() => context; - - public DatabaseWriteUsage GetForWrite(bool withTransaction = true) => new DatabaseWriteUsage(context, null); - } -} diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index a9b74d6740..63cc883844 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -107,7 +107,7 @@ namespace osu.Game { Resources.AddStore(new DllResourceStore(@"osu.Game.Resources.dll")); - dependencies.Cache(contextFactory = new DatabaseContextFactory(Host)); + dependencies.Cache(contextFactory = new DatabaseContextFactory(Host.Storage)); dependencies.Cache(new LargeTextureStore(new RawTextureLoaderStore(new NamespacedResourceStore(Resources, @"Textures")))); diff --git a/osu.Game/Tests/Platform/TestStorage.cs b/osu.Game/Tests/Platform/TestStorage.cs index 5b31c7b4d0..a6b6b5530d 100644 --- a/osu.Game/Tests/Platform/TestStorage.cs +++ b/osu.Game/Tests/Platform/TestStorage.cs @@ -7,13 +7,11 @@ namespace osu.Game.Tests.Platform { public class TestStorage : DesktopStorage { - public TestStorage(string baseName) : base(baseName, null) + public TestStorage(string baseName) + : base(baseName, null) { } - public override string GetDatabaseConnectionString(string name) - { - return "DataSource=:memory:"; - } + public override string GetDatabaseConnectionString(string name) => "Data Source=" + GetUsablePathFor($"{(object)name}.db", true); } } From ffd3040fe2da3de865f3b28b9e10c43a9835144d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 10 Jul 2018 14:41:07 +0900 Subject: [PATCH 13/56] Fix GameplayCursor state not restoring correctly after Show/Hide --- osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 35146dfe29..4d6722b61b 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -39,6 +39,11 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor private int downCount; + private const float pressed_scale = 1.2f; + private const float released_scale = 1f; + + private float targetScale => downCount > 0 ? pressed_scale : released_scale; + public bool OnPressed(OsuAction action) { switch (action) @@ -46,7 +51,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor case OsuAction.LeftButton: case OsuAction.RightButton: downCount++; - ActiveCursor.ScaleTo(1).ScaleTo(1.2f, 100, Easing.OutQuad); + ActiveCursor.ScaleTo(released_scale).ScaleTo(targetScale, 100, Easing.OutQuad); break; } @@ -60,7 +65,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor case OsuAction.LeftButton: case OsuAction.RightButton: if (--downCount == 0) - ActiveCursor.ScaleTo(1, 200, Easing.OutQuad); + ActiveCursor.ScaleTo(targetScale, 200, Easing.OutQuad); break; } @@ -72,13 +77,13 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor protected override void PopIn() { fadeContainer.FadeTo(1, 300, Easing.OutQuint); - ActiveCursor.ScaleTo(1, 400, Easing.OutQuint); + ActiveCursor.ScaleTo(targetScale, 400, Easing.OutQuint); } protected override void PopOut() { fadeContainer.FadeTo(0.05f, 450, Easing.OutQuint); - ActiveCursor.ScaleTo(0.8f, 450, Easing.OutQuint); + ActiveCursor.ScaleTo(targetScale * 0.8f, 450, Easing.OutQuint); } public class OsuCursor : Container From c2cdf12986a1e879a700b4a411b345df8a3f92ed Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 11 Jul 2018 17:01:27 +0900 Subject: [PATCH 14/56] Better pause logic --- osu.Game/Rulesets/UI/RulesetContainer.cs | 13 +++++++++++++ osu.Game/Screens/Play/PauseContainer.cs | 12 ++++-------- osu.Game/Screens/Play/Player.cs | 8 ++------ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index d68afdfedc..ee34e2df04 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -89,6 +89,14 @@ namespace osu.Game.Rulesets.UI Ruleset = ruleset; playfield = new Lazy(CreatePlayfield); + IsPaused.ValueChanged += paused => + { + if (HasReplayLoaded) + return; + + KeyBindingInputManager.UseParentInput = !paused; + }; + Cursor = CreateCursor(); } @@ -120,6 +128,11 @@ namespace osu.Game.Rulesets.UI public Replay Replay { get; private set; } + /// + /// Whether the game is paused. Used to block user input. + /// + public readonly BindableBool IsPaused = new BindableBool(); + /// /// Sets a replay to be used, overriding local input. /// diff --git a/osu.Game/Screens/Play/PauseContainer.cs b/osu.Game/Screens/Play/PauseContainer.cs index e2f133dde3..d9677e5daf 100644 --- a/osu.Game/Screens/Play/PauseContainer.cs +++ b/osu.Game/Screens/Play/PauseContainer.cs @@ -4,6 +4,7 @@ using System; using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Timing; @@ -18,7 +19,7 @@ namespace osu.Game.Screens.Play /// public class PauseContainer : Container { - public bool IsPaused { get; private set; } + public readonly BindableBool IsPaused = new BindableBool(); public Func CheckCanPause; @@ -39,9 +40,6 @@ namespace osu.Game.Screens.Play public Action OnRetry; public Action OnQuit; - public Action OnResume; - public Action OnPause; - private readonly FramedClock framedClock; private readonly DecoupleableInterpolatingFramedClock decoupledClock; @@ -84,9 +82,8 @@ namespace osu.Game.Screens.Play // stop the seekable clock (stops the audio eventually) decoupledClock.Stop(); - IsPaused = true; + IsPaused.Value = true; - OnPause?.Invoke(); pauseOverlay.Show(); lastPauseActionTime = Time.Current; @@ -96,7 +93,7 @@ namespace osu.Game.Screens.Play { if (!IsPaused) return; - IsPaused = false; + IsPaused.Value = false; IsResuming = false; lastPauseActionTime = Time.Current; @@ -105,7 +102,6 @@ namespace osu.Game.Screens.Play decoupledClock.Seek(decoupledClock.CurrentTime); decoupledClock.Start(); - OnResume?.Invoke(); pauseOverlay.Hide(); } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index fc439a48c5..e92805bf57 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -165,12 +165,6 @@ namespace osu.Game.Screens.Play OnRetry = Restart, OnQuit = Exit, CheckCanPause = () => AllowPause && ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded, - OnPause = () => - { - pauseContainer.Retries = RestartCount; - hudOverlay.KeyCounter.IsCounting = !pauseContainer.IsPaused; - }, - OnResume = () => hudOverlay.KeyCounter.IsCounting = true, Children = new[] { storyboardContainer = new Container @@ -227,6 +221,8 @@ namespace osu.Game.Screens.Play hudOverlay.HoldToQuit.Action = Exit; hudOverlay.KeyCounter.Visible.BindTo(RulesetContainer.HasReplayLoaded); + RulesetContainer.IsPaused.BindTo(pauseContainer.IsPaused); + if (ShowStoryboard) initializeStoryboard(false); From a01361f8334f0bf2cfdfb4c76a7abf38f7a46428 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 18 Jul 2018 22:05:24 +0900 Subject: [PATCH 15/56] Set restart count --- osu.Game/Screens/Play/Player.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index e92805bf57..f28ddb09a2 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -162,6 +162,7 @@ namespace osu.Game.Screens.Play { pauseContainer = new PauseContainer(offsetClock, adjustableClock) { + Retries = RestartCount, OnRetry = Restart, OnQuit = Exit, CheckCanPause = () => AllowPause && ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded, From 8414fe9d05ff2e948a25e6e46d551bc0d4a92a21 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 18 Jul 2018 22:19:32 +0900 Subject: [PATCH 16/56] Add key counter exceptions for paused state --- osu.Game/Screens/Play/Player.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index f28ddb09a2..28ae77a53c 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -223,6 +223,7 @@ namespace osu.Game.Screens.Play hudOverlay.KeyCounter.Visible.BindTo(RulesetContainer.HasReplayLoaded); RulesetContainer.IsPaused.BindTo(pauseContainer.IsPaused); + RulesetContainer.IsPaused.ValueChanged += paused => hudOverlay.KeyCounter.IsCounting = !paused; if (ShowStoryboard) initializeStoryboard(false); From 41441771ae2d4cb0bc95ecceef32b3a8d2b19593 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 18 Jul 2018 22:22:28 +0900 Subject: [PATCH 17/56] Remove unnecessary cast --- osu.Game/Tests/Platform/TestStorage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Tests/Platform/TestStorage.cs b/osu.Game/Tests/Platform/TestStorage.cs index a6b6b5530d..8391de3405 100644 --- a/osu.Game/Tests/Platform/TestStorage.cs +++ b/osu.Game/Tests/Platform/TestStorage.cs @@ -12,6 +12,6 @@ namespace osu.Game.Tests.Platform { } - public override string GetDatabaseConnectionString(string name) => "Data Source=" + GetUsablePathFor($"{(object)name}.db", true); + public override string GetDatabaseConnectionString(string name) => "Data Source=" + GetUsablePathFor($"{name}.db", true); } } From 82ddbb3f5d1126cb570110e9226d3498fd7668f9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 19 Jul 2018 01:18:07 +0900 Subject: [PATCH 18/56] Delay key count stop --- osu.Game/Screens/Play/Player.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 28ae77a53c..427519bff8 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -223,7 +223,9 @@ namespace osu.Game.Screens.Play hudOverlay.KeyCounter.Visible.BindTo(RulesetContainer.HasReplayLoaded); RulesetContainer.IsPaused.BindTo(pauseContainer.IsPaused); - RulesetContainer.IsPaused.ValueChanged += paused => hudOverlay.KeyCounter.IsCounting = !paused; + + // schedule to ensure we count any key presses from the current frame (which may affect gameplay). + RulesetContainer.IsPaused.ValueChanged += paused => Schedule(() => hudOverlay.KeyCounter.IsCounting = !paused); if (ShowStoryboard) initializeStoryboard(false); From 68614f1512e2becfb23b2845e90265a1d54540e2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 19 Jul 2018 13:41:09 +0900 Subject: [PATCH 19/56] Ensure online IDs are validated for imports that don't have an associated archive too --- osu.Game/Beatmaps/BeatmapManager.cs | 73 ++++++++++++----------------- 1 file changed, 30 insertions(+), 43 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 4ff16b604a..3bd5c440c1 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -89,34 +89,46 @@ namespace osu.Game.Beatmaps this.audioManager = audioManager; } - protected override void Populate(BeatmapSetInfo model, ArchiveReader archive) + protected override void Populate(BeatmapSetInfo beatmapSet, ArchiveReader archive) { if (archive != null) - model.Beatmaps = createBeatmapDifficulties(archive); + beatmapSet.Beatmaps = createBeatmapDifficulties(archive); - foreach (BeatmapInfo b in model.Beatmaps) + foreach (BeatmapInfo b in beatmapSet.Beatmaps) { // remove metadata from difficulties where it matches the set - if (model.Metadata.Equals(b.Metadata)) + if (beatmapSet.Metadata.Equals(b.Metadata)) b.Metadata = null; - // by setting the model here, we can update the noline set id below. - b.BeatmapSet = model; - - fetchAndPopulateOnlineIDs(b, model.Beatmaps); + b.BeatmapSet = beatmapSet; } // check if a set already exists with the same online id, delete if it does. - if (model.OnlineBeatmapSetID != null) + if (beatmapSet.OnlineBeatmapSetID != null) { - var existingOnlineId = beatmaps.ConsumableItems.FirstOrDefault(b => b.OnlineBeatmapSetID == model.OnlineBeatmapSetID); + var existingOnlineId = beatmaps.ConsumableItems.FirstOrDefault(b => b.OnlineBeatmapSetID == beatmapSet.OnlineBeatmapSetID); if (existingOnlineId != null) { Delete(existingOnlineId); beatmaps.PurgeDeletable(s => s.ID == existingOnlineId.ID); - Logger.Log($"Found existing beatmap set with same OnlineBeatmapSetID ({model.OnlineBeatmapSetID}). It has been purged.", LoggingTarget.Database); + Logger.Log($"Found existing beatmap set with same OnlineBeatmapSetID ({beatmapSet.OnlineBeatmapSetID}). It has been purged.", LoggingTarget.Database); } } + + validateOnlineIds(beatmapSet.Beatmaps); + + foreach (BeatmapInfo b in beatmapSet.Beatmaps) + fetchAndPopulateOnlineIDs(b, beatmapSet.Beatmaps); + } + + private void validateOnlineIds(List beatmaps) + { + var beatmapIds = beatmaps.Where(b => b.OnlineBeatmapID.HasValue).Select(b => b.OnlineBeatmapID); + + // ensure all IDs are unique in this set and none match existing IDs in the local beatmap store. + if (beatmapIds.GroupBy(b => b).Any(g => g.Count() > 1) || QueryBeatmaps(b => beatmapIds.Contains(b.OnlineBeatmapID)).Any()) + // remove all online IDs if any problems were found. + beatmaps.ForEach(b => b.OnlineBeatmapID = null); } protected override BeatmapSetInfo CheckForExisting(BeatmapSetInfo model) @@ -297,7 +309,7 @@ namespace osu.Game.Beatmaps /// /// The query. /// Results from the provided query. - public IEnumerable QueryBeatmaps(Expression> query) => beatmaps.Beatmaps.AsNoTracking().Where(query); + public IQueryable QueryBeatmaps(Expression> query) => beatmaps.Beatmaps.AsNoTracking().Where(query); /// /// Denotes whether an osu-stable installation is present to perform automated imports from. @@ -360,8 +372,6 @@ namespace osu.Game.Beatmaps { var beatmapInfos = new List(); - bool invalidateOnlineIDs = false; - foreach (var name in reader.Filenames.Where(f => f.EndsWith(".osu"))) { using (var raw = reader.GetStream(name)) @@ -378,38 +388,15 @@ namespace osu.Game.Beatmaps beatmap.BeatmapInfo.Hash = ms.ComputeSHA2Hash(); beatmap.BeatmapInfo.MD5Hash = ms.ComputeMD5Hash(); - if (beatmap.BeatmapInfo.OnlineBeatmapID.HasValue) - { - var ourId = beatmap.BeatmapInfo.OnlineBeatmapID; - - // check that no existing beatmap in database exists that is imported with the same online beatmap ID. if so, give it precedence. - if (QueryBeatmap(b => b.OnlineBeatmapID.Value == ourId) != null) - beatmap.BeatmapInfo.OnlineBeatmapID = null; - - // check that no other beatmap in this imported set has a conflicting online beatmap ID. If so, presume *all* are incorrect. - if (beatmapInfos.Any(b => b.OnlineBeatmapID == ourId)) - invalidateOnlineIDs = true; - } - - RulesetInfo ruleset = rulesets.GetRuleset(beatmap.BeatmapInfo.RulesetID); - + var ruleset = rulesets.GetRuleset(beatmap.BeatmapInfo.RulesetID); beatmap.BeatmapInfo.Ruleset = ruleset; - - if (ruleset != null) - { - // TODO: this should be done in a better place once we actually need to dynamically update it. - beatmap.BeatmapInfo.StarDifficulty = ruleset.CreateInstance().CreateDifficultyCalculator(new DummyConversionBeatmap(beatmap)).Calculate().StarRating; - } - else - beatmap.BeatmapInfo.StarDifficulty = 0; + // TODO: this should be done in a better place once we actually need to dynamically update it. + beatmap.BeatmapInfo.StarDifficulty = ruleset?.CreateInstance().CreateDifficultyCalculator(new DummyConversionBeatmap(beatmap)).Calculate().StarRating ?? 0; beatmapInfos.Add(beatmap.BeatmapInfo); } } - if (invalidateOnlineIDs) - beatmapInfos.ForEach(b => b.OnlineBeatmapID = null); - return beatmapInfos; } @@ -422,12 +409,12 @@ namespace osu.Game.Beatmaps /// True if population was successful. private bool fetchAndPopulateOnlineIDs(BeatmapInfo beatmap, IEnumerable otherBeatmaps, bool force = false) { + if (api?.State != APIState.Online) + return false; + if (!force && beatmap.OnlineBeatmapID != null && beatmap.BeatmapSet.OnlineBeatmapSetID != null) return true; - if (api.State != APIState.Online) - return false; - Logger.Log("Attempting online lookup for IDs...", LoggingTarget.Database); try From 7be3a5d466bafa64a4e462a5c1ec0ca70f6d5d7b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 19 Jul 2018 14:07:55 +0900 Subject: [PATCH 20/56] Centralise test storage logic --- osu.Game.Tests/Visual/TestCasePlaySongSelect.cs | 10 +++------- osu.Game/Tests/Platform/TestStorage.cs | 17 ----------------- osu.Game/Tests/Visual/OsuTestCase.cs | 13 +++++++++++++ 3 files changed, 16 insertions(+), 24 deletions(-) delete mode 100644 osu.Game/Tests/Platform/TestStorage.cs diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index 4afb76a7e2..b94fb42bf0 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -16,7 +16,6 @@ using osu.Game.Rulesets; using osu.Game.Screens.Select; using osu.Game.Screens.Select.Carousel; using osu.Game.Screens.Select.Filter; -using osu.Game.Tests.Platform; namespace osu.Game.Tests.Visual { @@ -28,6 +27,7 @@ namespace osu.Game.Tests.Visual private RulesetStore rulesets; private WorkingBeatmap defaultBeatmap; + private DatabaseContextFactory factory; public override IReadOnlyList RequiredTypes => new[] { @@ -59,18 +59,14 @@ namespace osu.Game.Tests.Visual { TestSongSelect songSelect = null; - var storage = new TestStorage(@"TestCasePlaySongSelect"); - - // this is by no means clean. should be replacing inside of OsuGameBase somehow. - DatabaseContextFactory factory = new DatabaseContextFactory(storage); - + factory = new DatabaseContextFactory(LocalStorage); factory.ResetDatabase(); using (var usage = factory.Get()) usage.Migrate(); Dependencies.Cache(rulesets = new RulesetStore(factory)); - Dependencies.Cache(manager = new BeatmapManager(storage, factory, rulesets, null, null) + Dependencies.Cache(manager = new BeatmapManager(LocalStorage, factory, rulesets, null, null) { DefaultBeatmap = defaultBeatmap = Beatmap.Default }); diff --git a/osu.Game/Tests/Platform/TestStorage.cs b/osu.Game/Tests/Platform/TestStorage.cs deleted file mode 100644 index 8391de3405..0000000000 --- a/osu.Game/Tests/Platform/TestStorage.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Platform; - -namespace osu.Game.Tests.Platform -{ - public class TestStorage : DesktopStorage - { - public TestStorage(string baseName) - : base(baseName, null) - { - } - - public override string GetDatabaseConnectionString(string name) => "Data Source=" + GetUsablePathFor($"{name}.db", true); - } -} diff --git a/osu.Game/Tests/Visual/OsuTestCase.cs b/osu.Game/Tests/Visual/OsuTestCase.cs index fcbab5b8f5..8e09ec849c 100644 --- a/osu.Game/Tests/Visual/OsuTestCase.cs +++ b/osu.Game/Tests/Visual/OsuTestCase.cs @@ -1,10 +1,12 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Configuration; +using osu.Framework.Platform; using osu.Framework.Testing; using osu.Game.Beatmaps; using osu.Game.Rulesets; @@ -20,6 +22,9 @@ namespace osu.Game.Tests.Visual protected DependencyContainer Dependencies { get; private set; } + private readonly Lazy localStorage; + protected Storage LocalStorage => localStorage.Value; + protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) { Dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); @@ -33,6 +38,11 @@ namespace osu.Game.Tests.Visual return Dependencies; } + protected OsuTestCase() + { + localStorage = new Lazy(() => new DesktopStorage($"{GetType().Name}-{Guid.NewGuid()}", null)); + } + [BackgroundDependencyLoader] private void load(AudioManager audioManager, RulesetStore rulesets) { @@ -50,6 +60,9 @@ namespace osu.Game.Tests.Visual beatmap.Disabled = true; beatmap.Value.Track.Stop(); } + + if (localStorage.IsValueCreated) + localStorage.Value.DeleteDirectory("."); } protected override ITestCaseTestRunner CreateRunner() => new OsuTestCaseTestRunner(); From 4e72794101d75c52b93acd1659d52079d5128b2b Mon Sep 17 00:00:00 2001 From: David V Date: Thu, 19 Jul 2018 15:55:38 +0200 Subject: [PATCH 21/56] Converts float to int. --- osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index 48512a71c2..1b6c6f5ce8 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -41,14 +41,14 @@ namespace osu.Game.Rulesets.Objects.Legacy if (type.HasFlag(ConvertHitObjectType.Circle)) { - result = CreateHit(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo); + result = CreateHit(new Vector2((int)float.Parse(split[0]), (int)float.Parse(split[1])), combo); if (split.Length > 5) readCustomSampleBanks(split[5], bankInfo); } else if (type.HasFlag(ConvertHitObjectType.Slider)) { - var pos = new Vector2(int.Parse(split[0]), int.Parse(split[1])); + var pos = new Vector2((int)float.Parse(split[0]), (int)float.Parse(split[1])); CurveType curveType = CurveType.Catmull; double length = 0; @@ -170,7 +170,7 @@ namespace osu.Game.Rulesets.Objects.Legacy readCustomSampleBanks(string.Join(":", ss.Skip(1)), bankInfo); } - result = CreateHold(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo, endTime + offset); + result = CreateHold(new Vector2((int)float.Parse(split[0]), (int)float.Parse(split[1])), combo, endTime + offset); } if (result == null) From 9eb69a1e768848ab304b5134d8f3ca8fcfde098a Mon Sep 17 00:00:00 2001 From: David V Date: Thu, 19 Jul 2018 17:47:55 +0200 Subject: [PATCH 22/56] Restructure + corrects converting to support all systems --- .../Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index 1b6c6f5ce8..dc1cd5ed3b 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -30,6 +30,8 @@ namespace osu.Game.Rulesets.Objects.Legacy { string[] split = text.Split(','); + Vector2 pos = new Vector2((int)Convert.ToSingle(split[0], CultureInfo.InvariantCulture), (int)Convert.ToSingle(split[1], CultureInfo.InvariantCulture)); + ConvertHitObjectType type = (ConvertHitObjectType)int.Parse(split[3]) & ~ConvertHitObjectType.ColourHax; bool combo = type.HasFlag(ConvertHitObjectType.NewCombo); type &= ~ConvertHitObjectType.NewCombo; @@ -41,15 +43,13 @@ namespace osu.Game.Rulesets.Objects.Legacy if (type.HasFlag(ConvertHitObjectType.Circle)) { - result = CreateHit(new Vector2((int)float.Parse(split[0]), (int)float.Parse(split[1])), combo); + result = CreateHit(pos, combo); if (split.Length > 5) readCustomSampleBanks(split[5], bankInfo); } else if (type.HasFlag(ConvertHitObjectType.Slider)) { - var pos = new Vector2((int)float.Parse(split[0]), (int)float.Parse(split[1])); - CurveType curveType = CurveType.Catmull; double length = 0; var points = new List { Vector2.Zero }; @@ -170,7 +170,7 @@ namespace osu.Game.Rulesets.Objects.Legacy readCustomSampleBanks(string.Join(":", ss.Skip(1)), bankInfo); } - result = CreateHold(new Vector2((int)float.Parse(split[0]), (int)float.Parse(split[1])), combo, endTime + offset); + result = CreateHold(pos, combo, endTime + offset); } if (result == null) From 967d0c3c72269e9fad90d090601c71a25a186ec5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 20 Jul 2018 15:12:04 +0900 Subject: [PATCH 23/56] Adjust testcase --- .../Formats/LegacyBeatmapDecoderTest.cs | 18 +++++++++--------- ....osu => controlpoint-custom-samplebank.osu} | 0 ...-samples.osu => hitobject-file-samples.osu} | 0 3 files changed, 9 insertions(+), 9 deletions(-) rename osu.Game.Tests/Resources/{custom-samples.osu => controlpoint-custom-samplebank.osu} (100%) rename osu.Game.Tests/Resources/{custom-hitobject-samples.osu => hitobject-file-samples.osu} (100%) diff --git a/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs index 2f5b4a13d9..6b72dc5733 100644 --- a/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs @@ -214,10 +214,10 @@ namespace osu.Game.Tests.Beatmaps.Formats } [Test] - public void TestDecodeCustomSamples() + public void TestDecodeControlPointCustomSampleBank() { var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false }; - using (var resStream = Resource.OpenResource("custom-samples.osu")) + using (var resStream = Resource.OpenResource("controlpoint-custom-samplebank.osu")) using (var stream = new StreamReader(resStream)) { var hitObjects = decoder.Decode(stream).HitObjects; @@ -228,25 +228,25 @@ namespace osu.Game.Tests.Beatmaps.Formats Assert.AreEqual("normal-hitnormal", getTestableSampleInfo(hitObjects[3]).LookupNames.First()); } - SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(new SampleInfo { Name = "hitnormal" }); + SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(hitObject.Samples[0]); } [Test] - public void TestDecodeCustomHitObjectSamples() + public void TestDecodeHitObjectCustomSampleBank() { var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false }; - using (var resStream = Resource.OpenResource("custom-hitobject-samples.osu")) + using (var resStream = Resource.OpenResource("hitobject-custom-samplebank.osu")) using (var stream = new StreamReader(resStream)) { var hitObjects = decoder.Decode(stream).HitObjects; - Assert.AreEqual("hit_1.wav", hitObjects[0].Samples[0].LookupNames.First()); - Assert.AreEqual("hit_2.wav", hitObjects[1].Samples[0].LookupNames.First()); + Assert.AreEqual("hit_1.wav", getTestableSampleInfo(hitObjects[0]).LookupNames.First()); + Assert.AreEqual("hit_2.wav", getTestableSampleInfo(hitObjects[1]).LookupNames.First()); Assert.AreEqual("normal-hitnormal2", getTestableSampleInfo(hitObjects[2]).LookupNames.First()); - Assert.AreEqual("hit_1.wav", hitObjects[3].Samples[0].LookupNames.First()); + Assert.AreEqual("hit_1.wav", getTestableSampleInfo(hitObjects[3]).LookupNames.First()); } - SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(new SampleInfo { Name = "hitnormal" }); + SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(hitObject.Samples[0]); } } } diff --git a/osu.Game.Tests/Resources/custom-samples.osu b/osu.Game.Tests/Resources/controlpoint-custom-samplebank.osu similarity index 100% rename from osu.Game.Tests/Resources/custom-samples.osu rename to osu.Game.Tests/Resources/controlpoint-custom-samplebank.osu diff --git a/osu.Game.Tests/Resources/custom-hitobject-samples.osu b/osu.Game.Tests/Resources/hitobject-file-samples.osu similarity index 100% rename from osu.Game.Tests/Resources/custom-hitobject-samples.osu rename to osu.Game.Tests/Resources/hitobject-file-samples.osu From de8d05bb0cbc64c80877ca2ee98a5388ff56c037 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 20 Jul 2018 15:12:21 +0900 Subject: [PATCH 24/56] Remove unnecessary setting of sample name to same value --- osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs b/osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs index acccbcde46..18680f9985 100644 --- a/osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs +++ b/osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs @@ -40,7 +40,6 @@ namespace osu.Game.Beatmaps.ControlPoints { var newSampleInfo = sampleInfo.Clone(); newSampleInfo.Bank = sampleInfo.Bank ?? SampleBank; - newSampleInfo.Name = sampleInfo.Name; newSampleInfo.Volume = sampleInfo.Volume > 0 ? sampleInfo.Volume : SampleVolume; return newSampleInfo; } From c087a73f403c73bdfb428d4b5bd1880097da2df4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 20 Jul 2018 15:12:44 +0900 Subject: [PATCH 25/56] Implement per-hitobject custom sample banks --- .../Formats/LegacyBeatmapDecoderTest.cs | 17 ++++++++ .../Resources/hitobject-custom-samplebank.osu | 13 ++++++ osu.Game/Beatmaps/Formats/LegacyDecoder.cs | 2 +- .../Objects/Legacy/ConvertHitObjectParser.cs | 41 ++++++++++++++----- 4 files changed, 62 insertions(+), 11 deletions(-) create mode 100644 osu.Game.Tests/Resources/hitobject-custom-samplebank.osu diff --git a/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs index 6b72dc5733..400380b407 100644 --- a/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs @@ -240,6 +240,23 @@ namespace osu.Game.Tests.Beatmaps.Formats { var hitObjects = decoder.Decode(stream).HitObjects; + Assert.AreEqual("normal-hitnormal", getTestableSampleInfo(hitObjects[0]).LookupNames.First()); + Assert.AreEqual("normal-hitnormal2", getTestableSampleInfo(hitObjects[1]).LookupNames.First()); + Assert.AreEqual("normal-hitnormal3", getTestableSampleInfo(hitObjects[2]).LookupNames.First()); + } + + SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(hitObject.Samples[0]); + } + + [Test] + public void TestDecodeHitObjectFileSamples() + { + var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false }; + using (var resStream = Resource.OpenResource("hitobject-file-samples.osu")) + using (var stream = new StreamReader(resStream)) + { + var hitObjects = decoder.Decode(stream).HitObjects; + Assert.AreEqual("hit_1.wav", getTestableSampleInfo(hitObjects[0]).LookupNames.First()); Assert.AreEqual("hit_2.wav", getTestableSampleInfo(hitObjects[1]).LookupNames.First()); Assert.AreEqual("normal-hitnormal2", getTestableSampleInfo(hitObjects[2]).LookupNames.First()); diff --git a/osu.Game.Tests/Resources/hitobject-custom-samplebank.osu b/osu.Game.Tests/Resources/hitobject-custom-samplebank.osu new file mode 100644 index 0000000000..56b1a8762f --- /dev/null +++ b/osu.Game.Tests/Resources/hitobject-custom-samplebank.osu @@ -0,0 +1,13 @@ +osu file format v14 + +[General] +SampleSet: Normal + +[TimingPoints] +2170,468.75,4,1,0,40,1,0 +3107,-100,4,1,2,40,0,0 + +[HitObjects] +255,193,2170,1,0,0:0:0:0: +256,191,3107,5,0,0:0:0:0: +255,193,4000,1,0,0:0:3:70: diff --git a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs index 91c1c98438..76a3d75e36 100644 --- a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs @@ -188,7 +188,7 @@ namespace osu.Game.Beatmaps.Formats { var baseInfo = base.ApplyTo(sampleInfo); - if (CustomSampleBank > 1) + if (string.IsNullOrEmpty(baseInfo.Suffix) && CustomSampleBank > 1) baseInfo.Suffix = CustomSampleBank.ToString(); return baseInfo; diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index 48512a71c2..5de05a99cc 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -194,8 +194,8 @@ namespace osu.Game.Rulesets.Objects.Legacy string[] split = str.Split(':'); - var bank = (LegacyBeatmapDecoder.LegacySampleBank)Convert.ToInt32(split[0]); - var addbank = (LegacyBeatmapDecoder.LegacySampleBank)Convert.ToInt32(split[1]); + var bank = (LegacyBeatmapDecoder.LegacySampleBank)int.Parse(split[0]); + var addbank = (LegacyBeatmapDecoder.LegacySampleBank)int.Parse(split[1]); string stringBank = bank.ToString().ToLower(); if (stringBank == @"none") @@ -207,6 +207,9 @@ namespace osu.Game.Rulesets.Objects.Legacy bankInfo.Normal = stringBank; bankInfo.Add = stringAddBank; + if (split.Length > 2) + bankInfo.CustomSampleBank = int.Parse(split[2]); + if (split.Length > 3) bankInfo.Volume = int.Parse(split[3]); @@ -258,41 +261,45 @@ namespace osu.Game.Rulesets.Objects.Legacy var soundTypes = new List { - new SampleInfo + new LegacySampleInfo { Bank = bankInfo.Normal, Name = SampleInfo.HIT_NORMAL, - Volume = bankInfo.Volume + Volume = bankInfo.Volume, + CustomSampleBank = bankInfo.CustomSampleBank } }; if (type.HasFlag(LegacySoundType.Finish)) { - soundTypes.Add(new SampleInfo + soundTypes.Add(new LegacySampleInfo { Bank = bankInfo.Add, Name = SampleInfo.HIT_FINISH, - Volume = bankInfo.Volume + Volume = bankInfo.Volume, + CustomSampleBank = bankInfo.CustomSampleBank }); } if (type.HasFlag(LegacySoundType.Whistle)) { - soundTypes.Add(new SampleInfo + soundTypes.Add(new LegacySampleInfo { Bank = bankInfo.Add, Name = SampleInfo.HIT_WHISTLE, - Volume = bankInfo.Volume + Volume = bankInfo.Volume, + CustomSampleBank = bankInfo.CustomSampleBank }); } if (type.HasFlag(LegacySoundType.Clap)) { - soundTypes.Add(new SampleInfo + soundTypes.Add(new LegacySampleInfo { Bank = bankInfo.Add, Name = SampleInfo.HIT_CLAP, - Volume = bankInfo.Volume + Volume = bankInfo.Volume, + CustomSampleBank = bankInfo.CustomSampleBank }); } @@ -307,9 +314,23 @@ namespace osu.Game.Rulesets.Objects.Legacy public string Add; public int Volume; + public int CustomSampleBank; + public SampleBankInfo Clone() => (SampleBankInfo)MemberwiseClone(); } + private class LegacySampleInfo : SampleInfo + { + public int CustomSampleBank + { + set + { + if (value > 1) + Suffix = value.ToString(); + } + } + } + private class FileSampleInfo : SampleInfo { public string Filename; From 7fea2b3a8b683e433451c7a504de0569bfd06de8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 20 Jul 2018 16:38:02 +0900 Subject: [PATCH 26/56] Add ToList --- osu.Game/Beatmaps/BeatmapManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 3bd5c440c1..67f02c8ac4 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -123,7 +123,7 @@ namespace osu.Game.Beatmaps private void validateOnlineIds(List beatmaps) { - var beatmapIds = beatmaps.Where(b => b.OnlineBeatmapID.HasValue).Select(b => b.OnlineBeatmapID); + var beatmapIds = beatmaps.Where(b => b.OnlineBeatmapID.HasValue).Select(b => b.OnlineBeatmapID).ToList(); // ensure all IDs are unique in this set and none match existing IDs in the local beatmap store. if (beatmapIds.GroupBy(b => b).Any(g => g.Count() > 1) || QueryBeatmaps(b => beatmapIds.Contains(b.OnlineBeatmapID)).Any()) From 1139f0dbf248ebf29dc96d53faa64aae26de8c55 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 20 Jul 2018 17:04:33 +0900 Subject: [PATCH 27/56] Centralise method of disabling playfield judgements --- osu.Game.Rulesets.Mania/UI/Column.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 6 ------ osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 2 +- osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs | 12 ------------ .../Edit/OsuEditRulesetContainer.cs | 3 --- osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 2 -- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 3 +++ osu.Game/Rulesets/Edit/HitObjectComposer.cs | 7 +++++++ osu.Game/Rulesets/UI/Playfield.cs | 8 ++++++++ 9 files changed, 20 insertions(+), 25 deletions(-) delete mode 100644 osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 063531da45..877189dd61 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -138,7 +138,7 @@ namespace osu.Game.Rulesets.Mania.UI internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { - if (!judgement.IsHit || !judgedObject.DisplayJudgement) + if (!judgement.IsHit || !judgedObject.DisplayJudgement || !DisplayJudgements) return; explosionContainer.Add(new HitExplosion(judgedObject) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index d6781a6e8f..f88169726e 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; -using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Mania.Configuration; @@ -74,10 +73,5 @@ namespace osu.Game.Rulesets.Mania.UI { maniaConfig.BindWith(ManiaSetting.ScrollTime, VisibleTimeRange); } - - internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) - { - getStageByColumn(((ManiaHitObject)judgedObject.HitObject).Column).OnJudgement(judgedObject, judgement); - } } } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index a0ff8780ad..f386cf15a2 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -163,7 +163,7 @@ namespace osu.Game.Rulesets.Mania.UI internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { - if (!judgedObject.DisplayJudgement) + if (!judgedObject.DisplayJudgement || !DisplayJudgements) return; judgements.Clear(); diff --git a/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs b/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs deleted file mode 100644 index 6213bb1329..0000000000 --- a/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Rulesets.Osu.UI; - -namespace osu.Game.Rulesets.Osu.Edit -{ - public class OsuEditPlayfield : OsuPlayfield - { - protected override bool DisplayJudgements => false; - } -} diff --git a/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs b/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs index ea33ec9ae0..6efa16bf56 100644 --- a/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs +++ b/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs @@ -4,7 +4,6 @@ using osu.Framework.Graphics.Cursor; using osu.Game.Beatmaps; using osu.Game.Rulesets.Osu.UI; -using osu.Game.Rulesets.UI; using OpenTK; namespace osu.Game.Rulesets.Osu.Edit @@ -16,8 +15,6 @@ namespace osu.Game.Rulesets.Osu.Edit { } - protected override Playfield CreatePlayfield() => new OsuEditPlayfield(); - protected override Vector2 PlayfieldArea => Vector2.One; protected override CursorContainer CreateCursor() => null; diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 04724931ae..b0ba9afee6 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -20,8 +20,6 @@ namespace osu.Game.Rulesets.Osu.UI private readonly JudgementContainer judgementLayer; private readonly ConnectionRenderer connectionLayer; - protected virtual bool DisplayJudgements => true; - public static readonly Vector2 BASE_SIZE = new Vector2(512, 384); public OsuPlayfield() diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index bb5994c2f2..4cb8dd48a7 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -226,6 +226,9 @@ namespace osu.Game.Rulesets.Taiko.UI internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { + if (!DisplayJudgements) + return; + if (judgedObject.DisplayJudgement && judgementContainer.FirstOrDefault(j => j.JudgedObject == judgedObject) == null) { judgementContainer.Add(new DrawableTaikoJudgement(judgement, judgedObject) diff --git a/osu.Game/Rulesets/Edit/HitObjectComposer.cs b/osu.Game/Rulesets/Edit/HitObjectComposer.cs index 0c91c9f548..b2f6e909d2 100644 --- a/osu.Game/Rulesets/Edit/HitObjectComposer.cs +++ b/osu.Game/Rulesets/Edit/HitObjectComposer.cs @@ -110,6 +110,13 @@ namespace osu.Game.Rulesets.Edit toolboxCollection.Items[0].Select(); } + protected override void LoadComplete() + { + base.LoadComplete(); + + rulesetContainer.Playfield.DisplayJudgements.Value = false; + } + protected override void UpdateAfterChildren() { base.UpdateAfterChildren(); diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index f2c9b49900..2f44d99e18 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Allocation; +using osu.Framework.Configuration; namespace osu.Game.Rulesets.UI { @@ -21,6 +22,11 @@ namespace osu.Game.Rulesets.UI public IReadOnlyList NestedPlayfields => nestedPlayfields; private List nestedPlayfields; + /// + /// Whether judgements should be displayed by this and and all nested s. + /// + public readonly BindableBool DisplayJudgements = new BindableBool(true); + /// /// A container for keeping track of DrawableHitObjects. /// @@ -73,6 +79,8 @@ namespace osu.Game.Rulesets.UI nestedPlayfields = new List(); nestedPlayfields.Add(otherPlayfield); + + otherPlayfield.DisplayJudgements.BindTo(DisplayJudgements); } /// From 241437c819e89db8b6e06d45405d6d8fef30b689 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 20 Jul 2018 17:08:25 +0900 Subject: [PATCH 28/56] Remove unnecessary counting change logic --- osu.Game.Tests/Visual/TestCaseKeyCounter.cs | 1 - osu.Game/Screens/Play/HUDOverlay.cs | 1 - osu.Game/Screens/Play/KeyCounter.cs | 2 +- osu.Game/Screens/Play/KeyCounterCollection.cs | 3 +-- osu.Game/Screens/Play/Player.cs | 3 --- 5 files changed, 2 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs index a20f67e336..b98875cd6a 100644 --- a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs +++ b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs @@ -18,7 +18,6 @@ namespace osu.Game.Tests.Visual { Origin = Anchor.Centre, Anchor = Anchor.Centre, - IsCounting = true, Children = new KeyCounter[] { new KeyCounterKeyboard(Key.Z), diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index f920b20649..4f3fe15211 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -195,7 +195,6 @@ namespace osu.Game.Screens.Play protected virtual KeyCounterCollection CreateKeyCounter() => new KeyCounterCollection { - IsCounting = true, FadeTime = 50, Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, diff --git a/osu.Game/Screens/Play/KeyCounter.cs b/osu.Game/Screens/Play/KeyCounter.cs index 2a0587133b..2c31e61114 100644 --- a/osu.Game/Screens/Play/KeyCounter.cs +++ b/osu.Game/Screens/Play/KeyCounter.cs @@ -19,7 +19,7 @@ namespace osu.Game.Screens.Play private Container textLayer; private SpriteText countSpriteText; - public bool IsCounting { get; set; } + public bool IsCounting { get; set; } = true; private int countPresses; public int CountPresses { diff --git a/osu.Game/Screens/Play/KeyCounterCollection.cs b/osu.Game/Screens/Play/KeyCounterCollection.cs index 114ea83ba6..721d925d63 100644 --- a/osu.Game/Screens/Play/KeyCounterCollection.cs +++ b/osu.Game/Screens/Play/KeyCounterCollection.cs @@ -53,8 +53,7 @@ namespace osu.Game.Screens.Play configVisibility.BindValueChanged(_ => updateVisibility(), true); } - //further: change default values here and in KeyCounter if needed, instead of passing them in every constructor - private bool isCounting; + private bool isCounting = true; public bool IsCounting { get { return isCounting; } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 427519bff8..f28ddb09a2 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -224,9 +224,6 @@ namespace osu.Game.Screens.Play RulesetContainer.IsPaused.BindTo(pauseContainer.IsPaused); - // schedule to ensure we count any key presses from the current frame (which may affect gameplay). - RulesetContainer.IsPaused.ValueChanged += paused => Schedule(() => hudOverlay.KeyCounter.IsCounting = !paused); - if (ShowStoryboard) initializeStoryboard(false); From f200cfe40dec998572f43a1ed1c859c97c7c9d15 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Fri, 20 Jul 2018 13:05:19 +0300 Subject: [PATCH 29/56] Add labelled text box files --- .../LabelledComponents/LabelledTextBox.cs | 207 ++++++++++++++++++ .../Setup/Components/OsuSetupTextBox.cs | 24 ++ 2 files changed, 231 insertions(+) create mode 100644 osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs create mode 100644 osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs new file mode 100644 index 0000000000..e0c734f764 --- /dev/null +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -0,0 +1,207 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Graphics; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using System; + +namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents +{ + public class LabelledTextBox : CompositeDrawable + { + private readonly OsuSetupTextBox textBox; + private readonly Container content; + private readonly OsuSpriteText label; + + public const float LABEL_CONTAINER_WIDTH = 150; + public const float OUTER_CORNER_RADIUS = 15; + public const float INNER_CORNER_RADIUS = 10; + public const float DEFAULT_HEIGHT = 40; + public const float DEFAULT_LABEL_LEFT_PADDING = 15; + public const float DEFAULT_LABEL_TOP_PADDING = 12; + public const float DEFAULT_LABEL_TEXT_SIZE = 16; + + public event Action TextBoxTextChanged; + + public void TriggerTextBoxTextChanged(string newText) + { + TextBoxTextChanged?.Invoke(newText); + } + + private bool readOnly; + public bool ReadOnly + { + get => readOnly; + set + { + textBox.ReadOnly = value; + readOnly = value; + } + } + + private string labelText; + public string LabelText + { + get => labelText; + set + { + labelText = value; + label.Text = value; + } + } + + private float labelTextSize; + public float LabelTextSize + { + get => labelTextSize; + set + { + labelTextSize = value; + label.TextSize = value; + } + } + + private string textBoxPlaceholderText; + public string TextBoxPlaceholderText + { + get => textBoxPlaceholderText; + set + { + textBoxPlaceholderText = value; + textBox.PlaceholderText = value; + } + } + + private string textBoxText; + public string TextBoxText + { + get => textBoxText; + set + { + textBoxText = value; + textBox.Text = value; + TextBoxTextChanged?.Invoke(value); + } + } + + private float height = DEFAULT_HEIGHT; + public float Height + { + get => height; + private set + { + height = value; + textBox.Height = value; + content.Height = value; + } + } + + public MarginPadding Padding + { + get => base.Padding; + set + { + base.Padding = value; + base.Height = Height + base.Padding.Top; + } + } + + public MarginPadding LabelPadding + { + get => label.Padding; + set => label.Padding = value; + } + + public MarginPadding TextBoxPadding + { + get => textBox.Padding; + set => textBox.Padding = value; + } + + public Color4 LabelTextColour + { + get => label.Colour; + set => label.Colour = value; + } + + public Color4 BackgroundColour + { + get => content.Colour; + set => content.Colour = value; + } + + public LabelledTextBox() + { + Masking = true; + CornerRadius = OUTER_CORNER_RADIUS; + RelativeSizeAxes = Axes.X; + base.Height = DEFAULT_HEIGHT + Padding.Top; + + InternalChildren = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.X, + Height = DEFAULT_HEIGHT, + CornerRadius = OUTER_CORNER_RADIUS, + Masking = true, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.X, + Height = DEFAULT_HEIGHT, + Colour = OsuColour.FromHex("1c2125"), + }, + new Container + { + RelativeSizeAxes = Axes.X, + Height = DEFAULT_HEIGHT, + Child = new GridContainer + { + RelativeSizeAxes = Axes.X, + Height = DEFAULT_HEIGHT, + Content = new[] + { + new Drawable[] + { + label = new OsuSpriteText + { + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + Padding = new MarginPadding { Left = DEFAULT_LABEL_LEFT_PADDING, Top = DEFAULT_LABEL_TOP_PADDING }, + Colour = Color4.White, + TextSize = DEFAULT_LABEL_TEXT_SIZE, + Text = LabelText, + Font = @"Exo2.0-Bold", + }, + textBox = new OsuSetupTextBox + { + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + RelativeSizeAxes = Axes.X, + Height = DEFAULT_HEIGHT, + ReadOnly = ReadOnly, + CornerRadius = INNER_CORNER_RADIUS, + }, + }, + }, + ColumnDimensions = new[] + { + new Dimension(GridSizeMode.Absolute, LABEL_CONTAINER_WIDTH), + new Dimension() + } + } + } + } + } + }; + + textBox.OnCommit += delegate { TriggerTextBoxTextChanged(textBox.Text); }; + } + } +} diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs new file mode 100644 index 0000000000..1a31582291 --- /dev/null +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs @@ -0,0 +1,24 @@ +// 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.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; + +namespace osu.Game.Screens.Edit.Screens.Setup.Components +{ + public class OsuSetupTextBox : OsuTextBox + { + protected override float LeftRightPadding => 15; + + [BackgroundDependencyLoader] + private void load(OsuColour osuColour) + { + BorderColour = osuColour.Blue; + } + + protected override Drawable GetDrawableCharacter(char c) => new OsuSpriteText { Text = c.ToString(), Colour = BorderColour, TextSize = CalculatedTextSize }; + } +} From 6dd5c7e5ab46b6fe548eff85ffc6871c232b71d9 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Fri, 20 Jul 2018 14:28:39 +0300 Subject: [PATCH 30/56] Add test case --- .../Visual/TestCaseLabelledTextBox.cs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs diff --git a/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs b/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs new file mode 100644 index 0000000000..a9f0375d39 --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs @@ -0,0 +1,37 @@ +// 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.Allocation; +using osu.Framework.Graphics; +using osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents; +using System; +using System.Collections.Generic; + +namespace osu.Game.Tests.Visual +{ + [TestFixture] + public class TestCaseLabelledTextBox : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(LabelledTextBox), + }; + + [BackgroundDependencyLoader] + private void load() + { + Children = new Drawable[] + { + new LabelledTextBox + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + LabelText = "Testing text", + TextBoxPlaceholderText = "This is definitely working as intended", + Padding = new MarginPadding { Left = 150, Right = 150 } + } + }; + } + } +} From 0f37758314c9f74b2119de35d5a3abc775fe52af Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 21 Jul 2018 11:38:28 +0900 Subject: [PATCH 31/56] Update framework --- .../Replays/CatchFramedReplayInputHandler.cs | 2 +- .../Replays/ManiaFramedReplayInputHandler.cs | 2 +- .../Objects/Drawables/Pieces/SliderBall.cs | 3 ++- .../Objects/Drawables/Pieces/SpinnerDisc.cs | 2 +- osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs | 2 +- osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs | 1 + .../Replays/TaikoFramedReplayInputHandler.cs | 2 +- osu.Game.Tests/Visual/TestCaseCursors.cs | 2 +- osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs | 2 +- osu.Game/Beatmaps/IBeatmapConverter.cs | 1 + osu.Game/Beatmaps/IBeatmapProcessor.cs | 3 +++ osu.Game/Beatmaps/WorkingBeatmap.cs | 1 + osu.Game/Beatmaps/WorkingBeatmap_VirtualBeatmapTrack.cs | 1 + .../Graphics/Containers/OsuFocusedOverlayContainer.cs | 2 +- osu.Game/Graphics/Containers/OsuHoverContainer.cs | 2 +- osu.Game/Graphics/Containers/OsuScrollContainer.cs | 3 ++- osu.Game/Graphics/Cursor/MenuCursor.cs | 3 ++- osu.Game/Graphics/UserInterface/DialogButton.cs | 2 +- osu.Game/Graphics/UserInterface/ExternalLinkButton.cs | 2 +- osu.Game/Graphics/UserInterface/FocusedTextBox.cs | 3 ++- osu.Game/Graphics/UserInterface/HoverClickSounds.cs | 2 +- osu.Game/Graphics/UserInterface/HoverSounds.cs | 2 +- osu.Game/Graphics/UserInterface/IconButton.cs | 2 +- osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs | 3 ++- osu.Game/Graphics/UserInterface/OsuCheckbox.cs | 2 +- osu.Game/Graphics/UserInterface/OsuMenu.cs | 2 +- osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs | 3 ++- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 3 ++- osu.Game/Graphics/UserInterface/OsuTabControl.cs | 2 +- osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs | 2 +- osu.Game/Graphics/UserInterface/OsuTextBox.cs | 2 +- osu.Game/Graphics/UserInterface/PageTabControl.cs | 2 +- osu.Game/Graphics/UserInterface/SearchTextBox.cs | 3 ++- osu.Game/Graphics/UserInterface/TriangleButton.cs | 3 ++- osu.Game/Graphics/UserInterface/TwoLayerButton.cs | 3 ++- osu.Game/Input/Handlers/ReplayInputHandler.cs | 3 ++- .../20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs | 2 -- .../Migrations/20171209034410_AddRulesetInfoShortName.cs | 2 -- osu.Game/Migrations/20180125143340_Settings.cs | 2 -- osu.Game/Migrations/20180131154205_AddMuteBinding.cs | 2 -- osu.Game/Migrations/20180219060912_AddSkins.cs | 2 -- .../20180529055154_RemoveUniqueHashConstraints.cs | 2 -- .../20180621044111_UpdateTaikoDefaultBindings.cs | 1 - osu.Game/Migrations/OsuDbContextModelSnapshot.cs | 3 +-- osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs | 2 +- osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs | 2 +- osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs | 2 +- osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs | 2 +- osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs | 2 +- osu.Game/Overlays/BeatmapSetOverlay.cs | 2 +- osu.Game/Overlays/Chat/ChannelListItem.cs | 2 +- osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs | 2 +- osu.Game/Overlays/Chat/ChatTabControl.cs | 3 ++- osu.Game/Overlays/ChatOverlay.cs | 2 +- osu.Game/Overlays/Dialog/PopupDialog.cs | 3 ++- osu.Game/Overlays/Direct/DirectGridPanel.cs | 2 +- osu.Game/Overlays/Direct/DirectListPanel.cs | 2 +- osu.Game/Overlays/Direct/DirectPanel.cs | 2 +- osu.Game/Overlays/Direct/PlayButton.cs | 2 +- osu.Game/Overlays/KeyBinding/KeyBindingRow.cs | 8 +++++--- osu.Game/Overlays/MainSettings.cs | 3 ++- osu.Game/Overlays/MedalOverlay.cs | 4 ++-- osu.Game/Overlays/Mods/ModButton.cs | 3 ++- osu.Game/Overlays/Mods/ModSection.cs | 3 ++- osu.Game/Overlays/Music/PlaylistItem.cs | 3 ++- osu.Game/Overlays/Music/PlaylistList.cs | 2 +- osu.Game/Overlays/MusicController.cs | 2 +- osu.Game/Overlays/Notifications/Notification.cs | 2 +- osu.Game/Overlays/Profile/Header/BadgeContainer.cs | 2 +- osu.Game/Overlays/Profile/Header/RankGraph.cs | 2 +- osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs | 2 +- osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs | 2 +- osu.Game/Overlays/SearchableList/SearchableListOverlay.cs | 2 +- .../Overlays/Settings/Sections/General/LoginSettings.cs | 2 +- .../Overlays/Settings/Sections/Input/MouseSettings.cs | 1 + osu.Game/Overlays/Settings/SettingsItem.cs | 3 ++- osu.Game/Overlays/Settings/Sidebar.cs | 2 +- osu.Game/Overlays/Settings/SidebarButton.cs | 2 +- osu.Game/Overlays/SettingsOverlay.cs | 2 +- osu.Game/Overlays/Social/SocialPanel.cs | 2 +- osu.Game/Overlays/Toolbar/Toolbar.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 3 ++- osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs | 3 ++- osu.Game/Overlays/Volume/MuteButton.cs | 2 +- osu.Game/Overlays/Volume/VolumeMeter.cs | 2 +- osu.Game/Overlays/VolumeOverlay.cs | 2 +- osu.Game/Rulesets/Edit/HitObjectMask.cs | 3 ++- osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs | 8 +++----- osu.Game/Rulesets/UI/RulesetInputManager.cs | 3 +++ osu.Game/Screens/BackgroundScreen.cs | 3 ++- osu.Game/Screens/Edit/Components/PlaybackControl.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/MarkerPart.cs | 3 ++- osu.Game/Screens/Edit/Editor.cs | 2 +- osu.Game/Screens/Edit/Menus/EditorMenuBar.cs | 2 +- .../Screens/Edit/Screens/Compose/BeatDivisorControl.cs | 3 ++- osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs | 2 +- .../Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs | 3 ++- .../Screens/Edit/Screens/Compose/Layers/MaskContainer.cs | 2 +- .../Screens/Edit/Screens/Compose/Layers/MaskSelection.cs | 2 +- .../Screens/Compose/RadioButtons/DrawableRadioButton.cs | 2 +- .../Screens/Edit/Screens/Compose/Timeline/Timeline.cs | 3 ++- .../Screens/Compose/Timeline/ZoomableScrollContainer.cs | 2 +- osu.Game/Screens/Menu/Button.cs | 3 ++- osu.Game/Screens/Menu/MainMenu.cs | 3 ++- osu.Game/Screens/Menu/OsuLogo.cs | 3 ++- osu.Game/Screens/Multi/Components/DrawableRoom.cs | 2 +- osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs | 2 +- osu.Game/Screens/Multi/Screens/Match/Header.cs | 3 ++- osu.Game/Screens/Play/GameplayMenuOverlay.cs | 3 ++- osu.Game/Screens/Play/HUD/ModDisplay.cs | 2 +- osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs | 3 ++- osu.Game/Screens/Play/HUD/QuitButton.cs | 3 ++- osu.Game/Screens/Play/HUDOverlay.cs | 3 ++- osu.Game/Screens/Play/KeyCounterCollection.cs | 3 ++- osu.Game/Screens/Play/KeyCounterKeyboard.cs | 3 ++- osu.Game/Screens/Play/KeyCounterMouse.cs | 3 ++- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Screens/Play/PlayerLoader.cs | 3 ++- .../Screens/Play/PlayerSettings/PlayerSettingsGroup.cs | 3 ++- osu.Game/Screens/Play/SkipOverlay.cs | 3 ++- osu.Game/Screens/Select/BeatmapCarousel.cs | 3 ++- .../Screens/Select/Carousel/DrawableCarouselBeatmap.cs | 2 +- osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs | 2 +- osu.Game/Screens/Select/FilterControl.cs | 3 ++- osu.Game/Screens/Select/Footer.cs | 3 ++- osu.Game/Screens/Select/FooterButton.cs | 3 ++- osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs | 2 +- .../Select/Leaderboards/RetrievalFailurePlaceholder.cs | 3 ++- osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs | 3 ++- osu.Game/Screens/Select/SongSelect.cs | 3 ++- osu.Game/Tests/Visual/EditorClockTestCase.cs | 2 +- osu.Game/osu.Game.csproj | 2 +- 132 files changed, 183 insertions(+), 139 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Replays/CatchFramedReplayInputHandler.cs b/osu.Game.Rulesets.Catch/Replays/CatchFramedReplayInputHandler.cs index 8d3d898655..f05eb31454 100644 --- a/osu.Game.Rulesets.Catch/Replays/CatchFramedReplayInputHandler.cs +++ b/osu.Game.Rulesets.Catch/Replays/CatchFramedReplayInputHandler.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using osu.Framework.Input; +using osu.Framework.Input.StateChanges; using osu.Framework.MathUtils; using osu.Game.Rulesets.Replays; diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs b/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs index 29eeb1cab5..ea239bf80f 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; -using osu.Framework.Input; +using osu.Framework.Input.StateChanges; using osu.Game.Rulesets.Replays; namespace osu.Game.Rulesets.Mania.Replays diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index 894d972e47..92c42af861 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -5,7 +5,8 @@ using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Rulesets.Objects.Types; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs index bb5fa1b575..5aba60ba03 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs @@ -4,7 +4,7 @@ using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs b/osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs index 2eed41d13f..5c07860b19 100644 --- a/osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs +++ b/osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; -using osu.Framework.Input; +using osu.Framework.Input.StateChanges; using osu.Framework.MathUtils; using osu.Game.Rulesets.Replays; using OpenTK; diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs index 7bd80b5718..0532fe0223 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Shaders; using osu.Framework.Graphics.Textures; using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.Timing; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game.Rulesets.Taiko/Replays/TaikoFramedReplayInputHandler.cs b/osu.Game.Rulesets.Taiko/Replays/TaikoFramedReplayInputHandler.cs index eae033401e..ab7856eb8f 100644 --- a/osu.Game.Rulesets.Taiko/Replays/TaikoFramedReplayInputHandler.cs +++ b/osu.Game.Rulesets.Taiko/Replays/TaikoFramedReplayInputHandler.cs @@ -4,7 +4,7 @@ using osu.Game.Rulesets.Replays; using System.Collections.Generic; using System.Linq; -using osu.Framework.Input; +using osu.Framework.Input.StateChanges; namespace osu.Game.Rulesets.Taiko.Replays { diff --git a/osu.Game.Tests/Visual/TestCaseCursors.cs b/osu.Game.Tests/Visual/TestCaseCursors.cs index 0aa8e9691e..361e255894 100644 --- a/osu.Game.Tests/Visual/TestCaseCursors.cs +++ b/osu.Game.Tests/Visual/TestCaseCursors.cs @@ -7,7 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.MathUtils; using osu.Game.Graphics.Cursor; using osu.Game.Graphics.Sprites; diff --git a/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs b/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs index 130685a4cf..45b5ec2c11 100644 --- a/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs @@ -8,7 +8,7 @@ using System.Linq; using OpenTK.Input; using osu.Framework.Allocation; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; using osu.Framework.Logging; using osu.Game.Screens.Play; diff --git a/osu.Game/Beatmaps/IBeatmapConverter.cs b/osu.Game/Beatmaps/IBeatmapConverter.cs index cbf9d184ac..a710afad16 100644 --- a/osu.Game/Beatmaps/IBeatmapConverter.cs +++ b/osu.Game/Beatmaps/IBeatmapConverter.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using osu.Game.Rulesets; using osu.Game.Rulesets.Objects; namespace osu.Game.Beatmaps diff --git a/osu.Game/Beatmaps/IBeatmapProcessor.cs b/osu.Game/Beatmaps/IBeatmapProcessor.cs index 282662373a..4d634d7912 100644 --- a/osu.Game/Beatmaps/IBeatmapProcessor.cs +++ b/osu.Game/Beatmaps/IBeatmapProcessor.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.Game.Rulesets; +using osu.Game.Rulesets.Objects; + namespace osu.Game.Beatmaps { /// diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 74da978d9c..cfd34d44e7 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -14,6 +14,7 @@ using osu.Framework.IO.File; using System.IO; using osu.Game.IO.Serialization; using osu.Game.Rulesets; +using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.UI; using osu.Game.Skinning; diff --git a/osu.Game/Beatmaps/WorkingBeatmap_VirtualBeatmapTrack.cs b/osu.Game/Beatmaps/WorkingBeatmap_VirtualBeatmapTrack.cs index 0e0a9a3bb9..d2e6ac1db8 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap_VirtualBeatmapTrack.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap_VirtualBeatmapTrack.cs @@ -3,6 +3,7 @@ using System.Linq; using osu.Framework.Audio.Track; +using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Beatmaps diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index 0dc6297ad2..d2ab8441eb 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -5,10 +5,10 @@ using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; using OpenTK; using osu.Framework.Configuration; using osu.Framework.Input.Bindings; +using osu.Framework.Input.States; using osu.Game.Audio; using osu.Game.Input.Bindings; using osu.Game.Overlays; diff --git a/osu.Game/Graphics/Containers/OsuHoverContainer.cs b/osu.Game/Graphics/Containers/OsuHoverContainer.cs index e88dad93ef..12df19e7c0 100644 --- a/osu.Game/Graphics/Containers/OsuHoverContainer.cs +++ b/osu.Game/Graphics/Containers/OsuHoverContainer.cs @@ -6,7 +6,7 @@ using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; -using osu.Framework.Input; +using osu.Framework.Input.States; namespace osu.Game.Graphics.Containers { diff --git a/osu.Game/Graphics/Containers/OsuScrollContainer.cs b/osu.Game/Graphics/Containers/OsuScrollContainer.cs index ebea9c49de..6d42be6fca 100644 --- a/osu.Game/Graphics/Containers/OsuScrollContainer.cs +++ b/osu.Game/Graphics/Containers/OsuScrollContainer.cs @@ -2,7 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.Containers; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using OpenTK.Input; namespace osu.Game.Graphics.Containers diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index 517be4c055..b55e1aa5dd 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -8,11 +8,12 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; using osu.Game.Configuration; using System; using JetBrains.Annotations; using osu.Framework.Graphics.Textures; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using OpenTK.Input; namespace osu.Game.Graphics.Cursor diff --git a/osu.Game/Graphics/UserInterface/DialogButton.cs b/osu.Game/Graphics/UserInterface/DialogButton.cs index 17d22587ad..ee2448ff02 100644 --- a/osu.Game/Graphics/UserInterface/DialogButton.cs +++ b/osu.Game/Graphics/UserInterface/DialogButton.cs @@ -13,7 +13,7 @@ using osu.Game.Graphics.Sprites; using osu.Framework.Extensions.Color4Extensions; using osu.Game.Graphics.Containers; using osu.Framework.Configuration; -using osu.Framework.Input; +using osu.Framework.Input.States; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/Graphics/UserInterface/ExternalLinkButton.cs b/osu.Game/Graphics/UserInterface/ExternalLinkButton.cs index be2412ccad..fe8995f310 100644 --- a/osu.Game/Graphics/UserInterface/ExternalLinkButton.cs +++ b/osu.Game/Graphics/UserInterface/ExternalLinkButton.cs @@ -5,7 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.Platform; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs index 28d04c9a82..e4fd71e17e 100644 --- a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs +++ b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs @@ -2,8 +2,9 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; -using osu.Framework.Input; using System; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Input.Bindings; using OpenTK.Input; diff --git a/osu.Game/Graphics/UserInterface/HoverClickSounds.cs b/osu.Game/Graphics/UserInterface/HoverClickSounds.cs index 1a9d124dfb..27a06ba0b7 100644 --- a/osu.Game/Graphics/UserInterface/HoverClickSounds.cs +++ b/osu.Game/Graphics/UserInterface/HoverClickSounds.cs @@ -5,7 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Extensions; -using osu.Framework.Input; +using osu.Framework.Input.States; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/Graphics/UserInterface/HoverSounds.cs b/osu.Game/Graphics/UserInterface/HoverSounds.cs index dc35c75cd6..821305bc92 100644 --- a/osu.Game/Graphics/UserInterface/HoverSounds.cs +++ b/osu.Game/Graphics/UserInterface/HoverSounds.cs @@ -8,7 +8,7 @@ using osu.Framework.Audio.Sample; using osu.Framework.Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; +using osu.Framework.Input.States; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/Graphics/UserInterface/IconButton.cs b/osu.Game/Graphics/UserInterface/IconButton.cs index eca7bf57c8..be60812ba6 100644 --- a/osu.Game/Graphics/UserInterface/IconButton.cs +++ b/osu.Game/Graphics/UserInterface/IconButton.cs @@ -4,7 +4,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics; -using osu.Framework.Input; +using osu.Framework.Input.States; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs b/osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs index 990a2f20a9..4428a058db 100644 --- a/osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuAnimatedButton.cs @@ -6,7 +6,8 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics.Containers; using OpenTK.Graphics; diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index ea337d5f42..68f59bd8cd 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -8,7 +8,7 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics.Sprites; using OpenTK.Graphics; diff --git a/osu.Game/Graphics/UserInterface/OsuMenu.cs b/osu.Game/Graphics/UserInterface/OsuMenu.cs index 41aeb534f0..abb077e94f 100644 --- a/osu.Game/Graphics/UserInterface/OsuMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuMenu.cs @@ -10,7 +10,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics.Sprites; using OpenTK; diff --git a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs index 07920865c0..75655ddb36 100644 --- a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs @@ -9,7 +9,8 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Framework.Platform; namespace osu.Game.Graphics.UserInterface diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 7604009aab..b7b5319e06 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -11,9 +11,10 @@ using osu.Framework.Audio.Sample; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs index d015a563f6..1b91d0cad3 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -14,7 +14,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.MathUtils; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs index 13740c935f..04ba111153 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs @@ -10,7 +10,7 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics.Sprites; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.States; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 88b0543de0..7a45ffdd4b 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -5,11 +5,11 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; using osu.Game.Graphics.Sprites; using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Input.Bindings; +using osu.Framework.Input.States; using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface diff --git a/osu.Game/Graphics/UserInterface/PageTabControl.cs b/osu.Game/Graphics/UserInterface/PageTabControl.cs index 3a8c72725e..d203532f9c 100644 --- a/osu.Game/Graphics/UserInterface/PageTabControl.cs +++ b/osu.Game/Graphics/UserInterface/PageTabControl.cs @@ -10,7 +10,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics.Sprites; namespace osu.Game.Graphics.UserInterface diff --git a/osu.Game/Graphics/UserInterface/SearchTextBox.cs b/osu.Game/Graphics/UserInterface/SearchTextBox.cs index 7d53c9e9d9..6067481979 100644 --- a/osu.Game/Graphics/UserInterface/SearchTextBox.cs +++ b/osu.Game/Graphics/UserInterface/SearchTextBox.cs @@ -2,7 +2,8 @@ // 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.EventArgs; +using osu.Framework.Input.States; using OpenTK; using OpenTK.Input; diff --git a/osu.Game/Graphics/UserInterface/TriangleButton.cs b/osu.Game/Graphics/UserInterface/TriangleButton.cs index a6492ddd63..bfdc0c3bef 100644 --- a/osu.Game/Graphics/UserInterface/TriangleButton.cs +++ b/osu.Game/Graphics/UserInterface/TriangleButton.cs @@ -9,7 +9,8 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs index dd5454314d..4e6361d1ae 100644 --- a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs +++ b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs @@ -4,7 +4,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; using OpenTK; using OpenTK.Graphics; using osu.Game.Graphics.Sprites; @@ -14,6 +13,8 @@ using osu.Game.Beatmaps.ControlPoints; using osu.Framework.Audio.Track; using System; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/Input/Handlers/ReplayInputHandler.cs b/osu.Game/Input/Handlers/ReplayInputHandler.cs index 57a2e5df6d..5f53868b28 100644 --- a/osu.Game/Input/Handlers/ReplayInputHandler.cs +++ b/osu.Game/Input/Handlers/ReplayInputHandler.cs @@ -3,8 +3,9 @@ using System; using System.Collections.Generic; -using osu.Framework.Input; using osu.Framework.Input.Handlers; +using osu.Framework.Input.StateChanges; +using osu.Framework.Input.States; using osu.Framework.Platform; using OpenTK; diff --git a/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs b/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs index 66ebda785b..084ae67940 100644 --- a/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs +++ b/osu.Game/Migrations/20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace osu.Game.Migrations { diff --git a/osu.Game/Migrations/20171209034410_AddRulesetInfoShortName.cs b/osu.Game/Migrations/20171209034410_AddRulesetInfoShortName.cs index 5227d1f8f9..09cf0af89c 100644 --- a/osu.Game/Migrations/20171209034410_AddRulesetInfoShortName.cs +++ b/osu.Game/Migrations/20171209034410_AddRulesetInfoShortName.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace osu.Game.Migrations { diff --git a/osu.Game/Migrations/20180125143340_Settings.cs b/osu.Game/Migrations/20180125143340_Settings.cs index 20701d672a..2e2768dc7c 100644 --- a/osu.Game/Migrations/20180125143340_Settings.cs +++ b/osu.Game/Migrations/20180125143340_Settings.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace osu.Game.Migrations { diff --git a/osu.Game/Migrations/20180131154205_AddMuteBinding.cs b/osu.Game/Migrations/20180131154205_AddMuteBinding.cs index 374830ad93..5564a30bbf 100644 --- a/osu.Game/Migrations/20180131154205_AddMuteBinding.cs +++ b/osu.Game/Migrations/20180131154205_AddMuteBinding.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Infrastructure; using osu.Game.Database; using osu.Game.Input.Bindings; diff --git a/osu.Game/Migrations/20180219060912_AddSkins.cs b/osu.Game/Migrations/20180219060912_AddSkins.cs index 6cce4354d9..a0270ab0fd 100644 --- a/osu.Game/Migrations/20180219060912_AddSkins.cs +++ b/osu.Game/Migrations/20180219060912_AddSkins.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace osu.Game.Migrations { diff --git a/osu.Game/Migrations/20180529055154_RemoveUniqueHashConstraints.cs b/osu.Game/Migrations/20180529055154_RemoveUniqueHashConstraints.cs index fe8c983a3f..27269cc5fc 100644 --- a/osu.Game/Migrations/20180529055154_RemoveUniqueHashConstraints.cs +++ b/osu.Game/Migrations/20180529055154_RemoveUniqueHashConstraints.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace osu.Game.Migrations { diff --git a/osu.Game/Migrations/20180621044111_UpdateTaikoDefaultBindings.cs b/osu.Game/Migrations/20180621044111_UpdateTaikoDefaultBindings.cs index 1f3c015614..71304ea979 100644 --- a/osu.Game/Migrations/20180621044111_UpdateTaikoDefaultBindings.cs +++ b/osu.Game/Migrations/20180621044111_UpdateTaikoDefaultBindings.cs @@ -1,5 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using osu.Framework.Logging; namespace osu.Game.Migrations { diff --git a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs index bd80cb743b..6dbeaed62f 100644 --- a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs +++ b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs @@ -1,8 +1,7 @@ // -using System; + using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using osu.Game.Database; namespace osu.Game.Migrations diff --git a/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs b/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs index 6b75ac095d..8186bf8685 100644 --- a/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs +++ b/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs @@ -10,7 +10,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs index 505b7a7540..18391c1177 100644 --- a/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs +++ b/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs @@ -7,7 +7,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Audio; using osu.Game.Beatmaps; using osu.Game.Graphics; diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs index 1f1a2a68d2..dc350d2c4c 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs @@ -3,10 +3,10 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Input.States; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Users; -using osu.Framework.Input; namespace osu.Game.Overlays.BeatmapSet.Scores { diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs index fc8b3a6800..d9af81c19a 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs @@ -6,7 +6,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Online.API.Requests.Responses; diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs index b3ceffd35e..a1ebab09b1 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs @@ -8,7 +8,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Online.API.Requests.Responses; diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 88f0a72ddf..02cc89e57e 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -7,7 +7,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Containers; diff --git a/osu.Game/Overlays/Chat/ChannelListItem.cs b/osu.Game/Overlays/Chat/ChannelListItem.cs index 910c87e0a8..7a60bf9f47 100644 --- a/osu.Game/Overlays/Chat/ChannelListItem.cs +++ b/osu.Game/Overlays/Chat/ChannelListItem.cs @@ -9,7 +9,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.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Online.Chat; diff --git a/osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs b/osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs index 57f2cd405d..4e4fe4f10a 100644 --- a/osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs +++ b/osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs @@ -10,7 +10,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Overlays/Chat/ChatTabControl.cs b/osu.Game/Overlays/Chat/ChatTabControl.cs index 91b790ece4..2e3c9f9c5f 100644 --- a/osu.Game/Overlays/Chat/ChatTabControl.cs +++ b/osu.Game/Overlays/Chat/ChatTabControl.cs @@ -8,7 +8,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; @@ -17,6 +16,8 @@ using OpenTK; using OpenTK.Graphics; using osu.Framework.Configuration; using System; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics.Containers; namespace osu.Game.Overlays.Chat diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index a2542c537f..8e20d76914 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -13,7 +13,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.Threading; using osu.Game.Configuration; using osu.Game.Graphics; diff --git a/osu.Game/Overlays/Dialog/PopupDialog.cs b/osu.Game/Overlays/Dialog/PopupDialog.cs index e32d7fb036..c9c90b4555 100644 --- a/osu.Game/Overlays/Dialog/PopupDialog.cs +++ b/osu.Game/Overlays/Dialog/PopupDialog.cs @@ -8,7 +8,8 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Containers; diff --git a/osu.Game/Overlays/Direct/DirectGridPanel.cs b/osu.Game/Overlays/Direct/DirectGridPanel.cs index c9e6f39270..eb940bff60 100644 --- a/osu.Game/Overlays/Direct/DirectGridPanel.cs +++ b/osu.Game/Overlays/Direct/DirectGridPanel.cs @@ -11,7 +11,7 @@ using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; diff --git a/osu.Game/Overlays/Direct/DirectListPanel.cs b/osu.Game/Overlays/Direct/DirectListPanel.cs index 17c5153dab..45e1164a57 100644 --- a/osu.Game/Overlays/Direct/DirectListPanel.cs +++ b/osu.Game/Overlays/Direct/DirectListPanel.cs @@ -12,7 +12,7 @@ using osu.Game.Graphics.Sprites; using osu.Framework.Allocation; using osu.Framework.Localisation; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Beatmaps; namespace osu.Game.Overlays.Direct diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 76da4b61b0..7d5c0c16cc 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -10,7 +10,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Audio; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index 28cc484109..092c9ddbea 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -5,7 +5,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.Input.States; using osu.Game.Audio; using osu.Game.Beatmaps; using osu.Game.Graphics; diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs index d407dc9cf9..86baaf3905 100644 --- a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs +++ b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs @@ -9,14 +9,16 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; using osu.Framework.Input.Bindings; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; 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 JoystickEventArgs = osu.Framework.Input.EventArgs.JoystickEventArgs; namespace osu.Game.Overlays.KeyBinding { @@ -230,7 +232,7 @@ namespace osu.Game.Overlays.KeyBinding return true; } - protected override bool OnJoystickPress(InputState state, Framework.Input.JoystickEventArgs args) + protected override bool OnJoystickPress(InputState state, JoystickEventArgs args) { if (!HasFocus) return false; @@ -241,7 +243,7 @@ namespace osu.Game.Overlays.KeyBinding return true; } - protected override bool OnJoystickRelease(InputState state, Framework.Input.JoystickEventArgs args) + protected override bool OnJoystickRelease(InputState state, JoystickEventArgs args) { if (!HasFocus) return base.OnJoystickRelease(state, args); diff --git a/osu.Game/Overlays/MainSettings.cs b/osu.Game/Overlays/MainSettings.cs index 99a86f19a1..6e8b4494dc 100644 --- a/osu.Game/Overlays/MainSettings.cs +++ b/osu.Game/Overlays/MainSettings.cs @@ -5,8 +5,9 @@ using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; using osu.Framework.Input.Bindings; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Overlays/MedalOverlay.cs b/osu.Game/Overlays/MedalOverlay.cs index 97a9217b23..bd67a718a7 100644 --- a/osu.Game/Overlays/MedalOverlay.cs +++ b/osu.Game/Overlays/MedalOverlay.cs @@ -16,11 +16,11 @@ using osu.Framework.Allocation; using osu.Framework.Audio.Sample; using osu.Framework.Audio; using osu.Framework.Graphics.Textures; -using osu.Framework.Input; using OpenTK.Input; -using System.Linq; using osu.Framework.Graphics.Shapes; using System; +using System.Linq; +using osu.Framework.Input.States; using osu.Framework.MathUtils; namespace osu.Game.Overlays diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index f4e0e3db04..8024f9a732 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -7,13 +7,14 @@ using OpenTK.Input; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.UI; using System; using System.Linq; using osu.Framework.Graphics.Cursor; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Mods diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 48f51f72ca..2fb44bb927 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -6,12 +6,13 @@ using OpenTK.Graphics; using OpenTK.Input; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Mods; using System; using System.Linq; using System.Collections.Generic; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; namespace osu.Game.Overlays.Mods { diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs index a630a86fce..62c9020160 100644 --- a/osu.Game/Overlays/Music/PlaylistItem.cs +++ b/osu.Game/Overlays/Music/PlaylistItem.cs @@ -8,7 +8,8 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Framework.Localisation; using osu.Game.Beatmaps; using osu.Game.Graphics; diff --git a/osu.Game/Overlays/Music/PlaylistList.cs b/osu.Game/Overlays/Music/PlaylistList.cs index 19ce0cf932..32674f0a84 100644 --- a/osu.Game/Overlays/Music/PlaylistList.cs +++ b/osu.Game/Overlays/Music/PlaylistList.cs @@ -8,7 +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.Input.States; using osu.Game.Beatmaps; using osu.Game.Graphics.Containers; using OpenTK; diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 56af04c498..3def4c144e 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -13,7 +13,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.Localisation; using osu.Framework.Threading; using osu.Game.Beatmaps; diff --git a/osu.Game/Overlays/Notifications/Notification.cs b/osu.Game/Overlays/Notifications/Notification.cs index 3a3fcb54e0..6798ae2bb2 100644 --- a/osu.Game/Overlays/Notifications/Notification.cs +++ b/osu.Game/Overlays/Notifications/Notification.cs @@ -7,11 +7,11 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.States; using osu.Game.Graphics.Containers; namespace osu.Game.Overlays.Notifications diff --git a/osu.Game/Overlays/Profile/Header/BadgeContainer.cs b/osu.Game/Overlays/Profile/Header/BadgeContainer.cs index f968f94187..bfade5e45c 100644 --- a/osu.Game/Overlays/Profile/Header/BadgeContainer.cs +++ b/osu.Game/Overlays/Profile/Header/BadgeContainer.cs @@ -9,7 +9,7 @@ using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Users; diff --git a/osu.Game/Overlays/Profile/Header/RankGraph.cs b/osu.Game/Overlays/Profile/Header/RankGraph.cs index 2c70507536..a059792796 100644 --- a/osu.Game/Overlays/Profile/Header/RankGraph.cs +++ b/osu.Game/Overlays/Profile/Header/RankGraph.cs @@ -10,7 +10,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs b/osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs index 3c841cbf14..3a4bfc6804 100644 --- a/osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs +++ b/osu.Game/Overlays/Profile/Sections/DrawableProfileRow.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 osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 15b446efa5..38bc419838 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -8,7 +8,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs b/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs index 47cdb4a765..f9e4a983bb 100644 --- a/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs +++ b/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs @@ -5,7 +5,7 @@ using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Containers; diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 9a42bdd2aa..c7f98f4107 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -11,12 +11,12 @@ using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using OpenTK; -using osu.Framework.Input; using osu.Game.Users; using System.ComponentModel; using osu.Game.Graphics; using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Input.States; using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; using Container = osu.Framework.Graphics.Containers.Container; diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index 51a624330b..71ab4d3782 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -5,6 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index 4c1ea1f32e..0f8d3aa2ac 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -12,7 +12,8 @@ using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using OpenTK; diff --git a/osu.Game/Overlays/Settings/Sidebar.cs b/osu.Game/Overlays/Settings/Sidebar.cs index 50452a7110..fdda5b870e 100644 --- a/osu.Game/Overlays/Settings/Sidebar.cs +++ b/osu.Game/Overlays/Settings/Sidebar.cs @@ -9,7 +9,7 @@ using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.Threading; using osu.Game.Overlays.Toolbar; diff --git a/osu.Game/Overlays/Settings/SidebarButton.cs b/osu.Game/Overlays/Settings/SidebarButton.cs index 0a3a30480b..ac2c840c94 100644 --- a/osu.Game/Overlays/Settings/SidebarButton.cs +++ b/osu.Game/Overlays/Settings/SidebarButton.cs @@ -9,7 +9,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index 55326b53ed..83e121e998 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -11,7 +11,7 @@ using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; diff --git a/osu.Game/Overlays/Social/SocialPanel.cs b/osu.Game/Overlays/Social/SocialPanel.cs index 2411db7535..b0455f7edd 100644 --- a/osu.Game/Overlays/Social/SocialPanel.cs +++ b/osu.Game/Overlays/Social/SocialPanel.cs @@ -6,7 +6,7 @@ using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Users; namespace osu.Game.Overlays.Social diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index eeace2f11c..2eabf1eb74 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -6,12 +6,12 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; using osu.Game.Graphics; using OpenTK; using osu.Framework.Graphics.Shapes; using osu.Framework.Allocation; using osu.Framework.Configuration; +using osu.Framework.Input.States; namespace osu.Game.Overlays.Toolbar { diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index 4514f3c33c..74af5d7e9c 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -5,13 +5,14 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs index b1af3f0d62..f2744ae83f 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs @@ -6,12 +6,13 @@ using osu.Framework.Allocation; using osu.Framework.Caching; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; using OpenTK; using OpenTK.Input; using OpenTK.Graphics; using osu.Framework.Configuration; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Rulesets; namespace osu.Game.Overlays.Toolbar diff --git a/osu.Game/Overlays/Volume/MuteButton.cs b/osu.Game/Overlays/Volume/MuteButton.cs index d0aa58e668..47169d7a7b 100644 --- a/osu.Game/Overlays/Volume/MuteButton.cs +++ b/osu.Game/Overlays/Volume/MuteButton.cs @@ -9,7 +9,7 @@ using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game/Overlays/Volume/VolumeMeter.cs b/osu.Game/Overlays/Volume/VolumeMeter.cs index 9aeca1f35f..a6c98aa97e 100644 --- a/osu.Game/Overlays/Volume/VolumeMeter.cs +++ b/osu.Game/Overlays/Volume/VolumeMeter.cs @@ -11,7 +11,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.MathUtils; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Overlays/VolumeOverlay.cs b/osu.Game/Overlays/VolumeOverlay.cs index e40597b2d4..4dcdd23768 100644 --- a/osu.Game/Overlays/VolumeOverlay.cs +++ b/osu.Game/Overlays/VolumeOverlay.cs @@ -9,7 +9,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.Threading; using osu.Game.Graphics; using osu.Game.Input.Bindings; diff --git a/osu.Game/Rulesets/Edit/HitObjectMask.cs b/osu.Game/Rulesets/Edit/HitObjectMask.cs index 61fb700dd3..ada026b32f 100644 --- a/osu.Game/Rulesets/Edit/HitObjectMask.cs +++ b/osu.Game/Rulesets/Edit/HitObjectMask.cs @@ -5,7 +5,8 @@ using System; using osu.Framework; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; diff --git a/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs b/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs index f13d96b35e..edad5cff80 100644 --- a/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs +++ b/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs @@ -3,12 +3,10 @@ using System; using System.Collections.Generic; -using osu.Framework.Input; +using osu.Framework.Input.StateChanges; using osu.Game.Input.Handlers; using OpenTK; using OpenTK.Input; -using KeyboardState = osu.Framework.Input.KeyboardState; -using MouseState = osu.Framework.Input.MouseState; namespace osu.Game.Rulesets.Replays { @@ -107,7 +105,7 @@ namespace osu.Game.Rulesets.Replays return CurrentTime = time; } - protected class ReplayMouseState : MouseState + protected class ReplayMouseState : osu.Framework.Input.States.MouseState { public ReplayMouseState(Vector2 position) { @@ -115,7 +113,7 @@ namespace osu.Game.Rulesets.Replays } } - protected class ReplayKeyboardState : KeyboardState + protected class ReplayKeyboardState : osu.Framework.Input.States.KeyboardState { public ReplayKeyboardState(List keys) { diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index a3120179a4..b05efce146 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -9,6 +9,9 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; using osu.Framework.Input.Bindings; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.StateChanges; +using osu.Framework.Input.States; using osu.Framework.Timing; using osu.Game.Configuration; using osu.Game.Input.Bindings; diff --git a/osu.Game/Screens/BackgroundScreen.cs b/osu.Game/Screens/BackgroundScreen.cs index 9d9432b2ce..46d1260410 100644 --- a/osu.Game/Screens/BackgroundScreen.cs +++ b/osu.Game/Screens/BackgroundScreen.cs @@ -5,7 +5,8 @@ using System; using System.Threading; using osu.Framework.Screens; using osu.Framework.Graphics; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using OpenTK; namespace osu.Game.Screens diff --git a/osu.Game/Screens/Edit/Components/PlaybackControl.cs b/osu.Game/Screens/Edit/Components/PlaybackControl.cs index 5f62843faf..6cd7fd52d4 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackControl.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackControl.cs @@ -8,7 +8,7 @@ using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.Timing; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs index 0dc110951b..7ff3849361 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs @@ -6,7 +6,8 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Framework.Timing; using osu.Game.Beatmaps; using osu.Game.Graphics; diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index a52fa3b462..7159cd919c 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -12,7 +12,7 @@ using osu.Game.Screens.Edit.Menus; using osu.Game.Screens.Edit.Components.Timelines.Summary; using osu.Framework.Allocation; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.Platform; using osu.Framework.Timing; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs index cb7c0fa803..c6351c8520 100644 --- a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs +++ b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs @@ -6,12 +6,12 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using OpenTK; using OpenTK.Graphics; using osu.Framework.Configuration; +using osu.Framework.Input.States; using osu.Game.Screens.Edit.Screens; namespace osu.Game.Screens.Edit.Menus diff --git a/osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs b/osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs index 21e48d8b0a..63df143ca8 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/BeatDivisorControl.cs @@ -12,7 +12,8 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using OpenTK; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs index d8200d6c37..c4392bbc60 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs @@ -7,7 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Rulesets.Edit; using OpenTK.Graphics; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs index b9a8e9914a..03ac8e91f0 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs @@ -5,7 +5,8 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskContainer.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskContainer.cs index df2691c28e..5ee31769a3 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskContainer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskContainer.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Rulesets.Edit; using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskSelection.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskSelection.cs index 54697bad77..927e7a2342 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskSelection.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskSelection.cs @@ -7,7 +7,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Edit.Types; diff --git a/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/DrawableRadioButton.cs b/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/DrawableRadioButton.cs index 0a009d9958..803a1275d7 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/DrawableRadioButton.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/DrawableRadioButton.cs @@ -10,7 +10,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Timeline/Timeline.cs b/osu.Game/Screens/Edit/Screens/Compose/Timeline/Timeline.cs index 8cb0fdd908..30205c5aa1 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Timeline/Timeline.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Timeline/Timeline.cs @@ -7,7 +7,8 @@ using osu.Framework.Configuration; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Audio; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Framework.Timing; using osu.Game.Beatmaps; using osu.Game.Graphics; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Timeline/ZoomableScrollContainer.cs b/osu.Game/Screens/Edit/Screens/Compose/Timeline/ZoomableScrollContainer.cs index 0bfea68e50..d30aaacc6a 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Timeline/ZoomableScrollContainer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Timeline/ZoomableScrollContainer.cs @@ -5,7 +5,7 @@ using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Transforms; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.MathUtils; using OpenTK; diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index 29820f234d..e53905a102 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -9,7 +9,6 @@ using osu.Framework.Audio.Sample; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using OpenTK; @@ -18,6 +17,8 @@ using OpenTK.Input; using osu.Framework.Extensions.Color4Extensions; using osu.Game.Graphics.Containers; using osu.Framework.Audio.Track; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Beatmaps.ControlPoints; namespace osu.Game.Screens.Menu diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 4790996833..7e97859be6 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -6,7 +6,8 @@ using OpenTK.Graphics; using OpenTK.Input; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Framework.Screens; using osu.Game.Beatmaps; using osu.Game.Graphics.Containers; diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index b74546310f..f0f765a4c9 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -11,7 +11,8 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Framework.MathUtils; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Graphics; diff --git a/osu.Game/Screens/Multi/Components/DrawableRoom.cs b/osu.Game/Screens/Multi/Components/DrawableRoom.cs index 54bd0ae7cc..739346fabe 100644 --- a/osu.Game/Screens/Multi/Components/DrawableRoom.cs +++ b/osu.Game/Screens/Multi/Components/DrawableRoom.cs @@ -10,7 +10,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; diff --git a/osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs b/osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs index 51dea355bf..1a47829ad7 100644 --- a/osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs +++ b/osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs @@ -6,7 +6,7 @@ using System.Linq; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.Screens; using osu.Game.Graphics.UserInterface; using osu.Game.Online.Multiplayer; diff --git a/osu.Game/Screens/Multi/Screens/Match/Header.cs b/osu.Game/Screens/Multi/Screens/Match/Header.cs index 02e717d4be..cc31f10fd2 100644 --- a/osu.Game/Screens/Multi/Screens/Match/Header.cs +++ b/osu.Game/Screens/Multi/Screens/Match/Header.cs @@ -8,7 +8,8 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; diff --git a/osu.Game/Screens/Play/GameplayMenuOverlay.cs b/osu.Game/Screens/Play/GameplayMenuOverlay.cs index 52c08bb351..1ca3bc2189 100644 --- a/osu.Game/Screens/Play/GameplayMenuOverlay.cs +++ b/osu.Game/Screens/Play/GameplayMenuOverlay.cs @@ -5,7 +5,6 @@ using System; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; @@ -17,6 +16,8 @@ using OpenTK.Input; using System.Collections.Generic; using System.Linq; using osu.Framework.Input.Bindings; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Input.Bindings; namespace osu.Game.Screens.Play diff --git a/osu.Game/Screens/Play/HUD/ModDisplay.cs b/osu.Game/Screens/Play/HUD/ModDisplay.cs index 33a8e1d7cf..894322dd41 100644 --- a/osu.Game/Screens/Play/HUD/ModDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ModDisplay.cs @@ -10,9 +10,9 @@ using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.UI; using OpenTK; -using osu.Framework.Input; using osu.Game.Graphics.Containers; using System.Linq; +using osu.Framework.Input.States; namespace osu.Game.Screens.Play.HUD { diff --git a/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs index 9025f323be..e5e2ed7ee0 100644 --- a/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs +++ b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs @@ -3,8 +3,9 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using OpenTK; -using osu.Framework.Input; using osu.Game.Screens.Play.PlayerSettings; using OpenTK.Input; diff --git a/osu.Game/Screens/Play/HUD/QuitButton.cs b/osu.Game/Screens/Play/HUD/QuitButton.cs index 29382c25f3..2a4b1f408d 100644 --- a/osu.Game/Screens/Play/HUD/QuitButton.cs +++ b/osu.Game/Screens/Play/HUD/QuitButton.cs @@ -8,7 +8,8 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Framework.MathUtils; using osu.Game.Graphics; using osu.Game.Graphics.Containers; diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 4f3fe15211..f51ea6fe3e 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -5,7 +5,8 @@ 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.EventArgs; +using osu.Framework.Input.States; using osu.Framework.Timing; using osu.Game.Beatmaps; using osu.Game.Configuration; diff --git a/osu.Game/Screens/Play/KeyCounterCollection.cs b/osu.Game/Screens/Play/KeyCounterCollection.cs index 721d925d63..5cb5bb152a 100644 --- a/osu.Game/Screens/Play/KeyCounterCollection.cs +++ b/osu.Game/Screens/Play/KeyCounterCollection.cs @@ -6,9 +6,10 @@ using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using OpenTK.Graphics; -using osu.Framework.Input; using osu.Framework.Configuration; using osu.Framework.Allocation; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Configuration; using OpenTK; diff --git a/osu.Game/Screens/Play/KeyCounterKeyboard.cs b/osu.Game/Screens/Play/KeyCounterKeyboard.cs index cfa6efbd12..1c2f2c0ac4 100644 --- a/osu.Game/Screens/Play/KeyCounterKeyboard.cs +++ b/osu.Game/Screens/Play/KeyCounterKeyboard.cs @@ -1,7 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using OpenTK.Input; namespace osu.Game.Screens.Play diff --git a/osu.Game/Screens/Play/KeyCounterMouse.cs b/osu.Game/Screens/Play/KeyCounterMouse.cs index 7c680efcba..20cc53caee 100644 --- a/osu.Game/Screens/Play/KeyCounterMouse.cs +++ b/osu.Game/Screens/Play/KeyCounterMouse.cs @@ -1,7 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using OpenTK.Input; using OpenTK; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index f28ddb09a2..4f37b59e6e 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -12,7 +12,7 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.Logging; using osu.Framework.Screens; using osu.Framework.Threading; diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 6e1c3d24f0..4abc0dfcd9 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -6,7 +6,8 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Framework.Localisation; using osu.Framework.Screens; using osu.Framework.Threading; diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index cff3eca895..1813d02d02 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -5,7 +5,8 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Screens/Play/SkipOverlay.cs b/osu.Game/Screens/Play/SkipOverlay.cs index 383addc607..3e946288d9 100644 --- a/osu.Game/Screens/Play/SkipOverlay.cs +++ b/osu.Game/Screens/Play/SkipOverlay.cs @@ -6,7 +6,6 @@ using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; using osu.Framework.Threading; using osu.Framework.Timing; using osu.Game.Graphics; @@ -17,6 +16,8 @@ using OpenTK.Graphics; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics.Containers; using osu.Framework.Input.Bindings; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Input.Bindings; namespace osu.Game.Screens.Play diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 3c9a14e1f4..f1721d8941 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Game.Configuration; -using osu.Framework.Input; using OpenTK.Input; using osu.Framework.MathUtils; using System.Diagnostics; @@ -18,6 +17,8 @@ using osu.Framework.Caching; using osu.Framework.Threading; using osu.Framework.Configuration; using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Beatmaps; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Cursor; diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs index c5996327b9..6071e163cf 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs @@ -10,7 +10,7 @@ using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics; diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs index b6dd6cad65..8a0052559e 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs @@ -8,7 +8,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.MathUtils; using osu.Game.Graphics; using OpenTK; diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 278d32b2d5..274b859e82 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -13,8 +13,9 @@ using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Select.Filter; using Container = osu.Framework.Graphics.Containers.Container; -using osu.Framework.Input; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Configuration; using osu.Game.Rulesets; diff --git a/osu.Game/Screens/Select/Footer.cs b/osu.Game/Screens/Select/Footer.cs index 8f07e0a763..bc4d216f00 100644 --- a/osu.Game/Screens/Select/Footer.cs +++ b/osu.Game/Screens/Select/Footer.cs @@ -11,7 +11,8 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Select diff --git a/osu.Game/Screens/Select/FooterButton.cs b/osu.Game/Screens/Select/FooterButton.cs index 3fa12283b5..1b0e3a1620 100644 --- a/osu.Game/Screens/Select/FooterButton.cs +++ b/osu.Game/Screens/Select/FooterButton.cs @@ -8,7 +8,8 @@ using OpenTK.Input; using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Containers; diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 19732107c7..95e9dde68e 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -10,7 +10,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Screens/Select/Leaderboards/RetrievalFailurePlaceholder.cs b/osu.Game/Screens/Select/Leaderboards/RetrievalFailurePlaceholder.cs index 99b0c53835..19cba72f1f 100644 --- a/osu.Game/Screens/Select/Leaderboards/RetrievalFailurePlaceholder.cs +++ b/osu.Game/Screens/Select/Leaderboards/RetrievalFailurePlaceholder.cs @@ -3,7 +3,8 @@ using System; using osu.Framework.Graphics; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using OpenTK; diff --git a/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs b/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs index d789d41ef4..d4cd882433 100644 --- a/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs +++ b/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs @@ -5,7 +5,8 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using OpenTK; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 234508a195..3cf406fabb 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -12,7 +12,8 @@ using osu.Framework.Audio.Track; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; +using osu.Framework.Input.EventArgs; +using osu.Framework.Input.States; using osu.Framework.Screens; using osu.Framework.Threading; using osu.Game.Beatmaps; diff --git a/osu.Game/Tests/Visual/EditorClockTestCase.cs b/osu.Game/Tests/Visual/EditorClockTestCase.cs index 22f3e5b6df..0ca7ff011f 100644 --- a/osu.Game/Tests/Visual/EditorClockTestCase.cs +++ b/osu.Game/Tests/Visual/EditorClockTestCase.cs @@ -2,7 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; -using osu.Framework.Input; +using osu.Framework.Input.States; using osu.Framework.Timing; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index c8db3e4d66..56a1979382 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - + From 41ffc17fe3f268e2aa55e0721866fe1e15496912 Mon Sep 17 00:00:00 2001 From: VperuS Date: Sat, 21 Jul 2018 13:27:45 +0300 Subject: [PATCH 32/56] Small clarification about to run dotnet restore --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fd0ba838cc..07d9ccf8ad 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Build and run - Using Visual Studio 2017, Rider or Visual Studio Code (configurations are included) - From command line using `dotnet run --project osu.Desktop --framework netcoreapp2.1` -The above methods should automatically do so, but if you run into issues building you may need to restore nuget packages (commonly via `dotnet restore`). +If you run into issues building you may need to restore nuget packages (commonly via `dotnet restore`). VScode users must run `Restore` task from debug tab before attempt to build. # Contributing From 717345f2608b1c43e82f351ff4282db8f8f65495 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 22 Jul 2018 20:00:34 +0200 Subject: [PATCH 33/56] Use full application name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 07d9ccf8ad..a1932b0fdf 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Build and run - Using Visual Studio 2017, Rider or Visual Studio Code (configurations are included) - From command line using `dotnet run --project osu.Desktop --framework netcoreapp2.1` -If you run into issues building you may need to restore nuget packages (commonly via `dotnet restore`). VScode users must run `Restore` task from debug tab before attempt to build. +If you run into issues building you may need to restore nuget packages (commonly via `dotnet restore`). Visual Studio Code users must run `Restore` task from debug tab before attempt to build. # Contributing From 3c59ccadd05e22af7e8ec7e3dff722e6736ab4dc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 22 Jul 2018 22:19:58 +0200 Subject: [PATCH 34/56] Fix gameplay always skipping to first hitobject time Regresssed with previous build --- osu.Game/Screens/Play/Player.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 4f37b59e6e..e9e353d698 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -139,7 +139,7 @@ namespace osu.Game.Screens.Play adjustableClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; adjustableClock.Seek(AllowLeadIn - ? Math.Min(RulesetContainer.GameplayStartTime, beatmap.HitObjects.First().StartTime - beatmap.BeatmapInfo.AudioLeadIn) + ? Math.Min(0, beatmap.HitObjects.First().StartTime - beatmap.BeatmapInfo.AudioLeadIn) : RulesetContainer.GameplayStartTime); adjustableClock.ProcessFrame(); From 8501967b6a3a61c38a1499e53914a5d5030860a0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 22 Jul 2018 22:47:25 +0200 Subject: [PATCH 35/56] Fix testing regression --- osu.Game.Tests/Visual/TestCasePlaySongSelect.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index b94fb42bf0..41c45f00f3 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -54,6 +54,12 @@ namespace osu.Game.Tests.Visual public new BeatmapCarousel Carousel => base.Carousel; } + protected override void Dispose(bool isDisposing) + { + factory.ResetDatabase(); + base.Dispose(isDisposing); + } + [BackgroundDependencyLoader] private void load() { From 44a2ae5f9ac83238d151d848580a8ee33bedfdc8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 23 Jul 2018 08:33:47 +0200 Subject: [PATCH 36/56] Fix incorrect variable usage --- osu.Game/Screens/Play/Player.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index e9e353d698..00ba1a8d12 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -139,7 +139,7 @@ namespace osu.Game.Screens.Play adjustableClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false }; adjustableClock.Seek(AllowLeadIn - ? Math.Min(0, beatmap.HitObjects.First().StartTime - beatmap.BeatmapInfo.AudioLeadIn) + ? Math.Min(0, RulesetContainer.GameplayStartTime - beatmap.BeatmapInfo.AudioLeadIn) : RulesetContainer.GameplayStartTime); adjustableClock.ProcessFrame(); From 82ea4456e42d7dd4b96243f5e97cb78347ecd2d7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 22 Jul 2018 22:47:25 +0200 Subject: [PATCH 37/56] Fix testing regression --- osu.Game.Tests/Visual/TestCasePlaySongSelect.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index b94fb42bf0..41c45f00f3 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -54,6 +54,12 @@ namespace osu.Game.Tests.Visual public new BeatmapCarousel Carousel => base.Carousel; } + protected override void Dispose(bool isDisposing) + { + factory.ResetDatabase(); + base.Dispose(isDisposing); + } + [BackgroundDependencyLoader] private void load() { From 2169a473253247b8bddeee98b27b9511b181c6f7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 23 Jul 2018 10:39:43 +0200 Subject: [PATCH 38/56] Prevent fatal failures on delete failures --- osu.Game/Tests/Visual/OsuTestCase.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game/Tests/Visual/OsuTestCase.cs b/osu.Game/Tests/Visual/OsuTestCase.cs index 8e09ec849c..67a13bd850 100644 --- a/osu.Game/Tests/Visual/OsuTestCase.cs +++ b/osu.Game/Tests/Visual/OsuTestCase.cs @@ -62,7 +62,16 @@ namespace osu.Game.Tests.Visual } if (localStorage.IsValueCreated) - localStorage.Value.DeleteDirectory("."); + { + try + { + localStorage.Value.DeleteDirectory("."); + } + catch + { + // we don't really care if this fails; it will just leave folders lying around from test runs. + } + } } protected override ITestCaseTestRunner CreateRunner() => new OsuTestCaseTestRunner(); From 1b456fd7166a5645d9b3b058a8fbd7783a345518 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 23 Jul 2018 13:11:06 +0200 Subject: [PATCH 39/56] Fix a potential InvalidOperationException when entering song select Closes #3052. --- osu.Game/Screens/Select/Carousel/CarouselGroup.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs index 2118cfdc78..ea461e7bd5 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs @@ -79,8 +79,13 @@ namespace osu.Game.Screens.Select.Carousel public override void Filter(FilterCriteria criteria) { base.Filter(criteria); - InternalChildren.Sort((x, y) => x.CompareTo(criteria, y)); - InternalChildren.ForEach(c => c.Filter(criteria)); + + var children = new List(InternalChildren); + + children.Sort((x, y) => x.CompareTo(criteria, y)); + children.ForEach(c => c.Filter(criteria)); + + InternalChildren = children; } protected virtual void ChildItemStateChanged(CarouselItem item, CarouselItemState value) From dd56a2d95fc15a3db53fbf4ad5d3252e79686072 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Mon, 23 Jul 2018 15:44:10 +0300 Subject: [PATCH 40/56] Apply proposed changes (untested) --- .../Visual/TestCaseLabelledTextBox.cs | 2 +- .../LabelledComponents/LabelledTextBox.cs | 74 +++++++++---------- .../{OsuSetupTextBox.cs => SetupTextBox.cs} | 2 +- 3 files changed, 36 insertions(+), 42 deletions(-) rename osu.Game/Screens/Edit/Screens/Setup/Components/{OsuSetupTextBox.cs => SetupTextBox.cs} (94%) diff --git a/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs b/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs index a9f0375d39..be11562bb0 100644 --- a/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs +++ b/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs @@ -28,7 +28,7 @@ namespace osu.Game.Tests.Visual Anchor = Anchor.Centre, Origin = Anchor.Centre, LabelText = "Testing text", - TextBoxPlaceholderText = "This is definitely working as intended", + PlaceholderText = "This is definitely working as intended", Padding = new MarginPadding { Left = 150, Right = 150 } } }; diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index e0c734f764..806e6b6f6d 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -8,29 +8,25 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using System; +using static osu.Framework.Graphics.UserInterface.TextBox; namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents { public class LabelledTextBox : CompositeDrawable { - private readonly OsuSetupTextBox textBox; + private readonly SetupTextBox textBox; private readonly Container content; private readonly OsuSpriteText label; - public const float LABEL_CONTAINER_WIDTH = 150; - public const float OUTER_CORNER_RADIUS = 15; - public const float INNER_CORNER_RADIUS = 10; - public const float DEFAULT_HEIGHT = 40; - public const float DEFAULT_LABEL_LEFT_PADDING = 15; - public const float DEFAULT_LABEL_TOP_PADDING = 12; - public const float DEFAULT_LABEL_TEXT_SIZE = 16; + private const float label_container_width = 150; + private const float outer_corner_radius = 15; + private const float inner_corner_radius = 10; + private const float default_height = 40; + private const float default_label_left_padding = 15; + private const float default_label_top_padding = 12; + private const float default_label_text_size = 16; - public event Action TextBoxTextChanged; - - public void TriggerTextBoxTextChanged(string newText) - { - TextBoxTextChanged?.Invoke(newText); - } + public event OnCommitHandler TextBoxTextChanged; private bool readOnly; public bool ReadOnly @@ -65,30 +61,30 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents } } - private string textBoxPlaceholderText; - public string TextBoxPlaceholderText + private string placeholderText; + public string PlaceholderText { - get => textBoxPlaceholderText; + get => placeholderText; set { - textBoxPlaceholderText = value; + placeholderText = value; textBox.PlaceholderText = value; } } - private string textBoxText; - public string TextBoxText + private string text; + public string Text { - get => textBoxText; + get => text; set { - textBoxText = value; + text = value; textBox.Text = value; - TextBoxTextChanged?.Invoke(value); + TextBoxTextChanged?.Invoke(textBox, true); } } - private float height = DEFAULT_HEIGHT; + private float height = default_height; public float Height { get => height; @@ -137,34 +133,32 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents public LabelledTextBox() { Masking = true; - CornerRadius = OUTER_CORNER_RADIUS; + CornerRadius = outer_corner_radius; RelativeSizeAxes = Axes.X; - base.Height = DEFAULT_HEIGHT + Padding.Top; + base.Height = default_height + Padding.Top; InternalChildren = new Drawable[] { new Container { - RelativeSizeAxes = Axes.X, - Height = DEFAULT_HEIGHT, - CornerRadius = OUTER_CORNER_RADIUS, + RelativeSizeAxes = Axes.Both, + CornerRadius = outer_corner_radius, Masking = true, Children = new Drawable[] { new Box { - RelativeSizeAxes = Axes.X, - Height = DEFAULT_HEIGHT, + RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex("1c2125"), }, new Container { RelativeSizeAxes = Axes.X, - Height = DEFAULT_HEIGHT, + Height = default_height, Child = new GridContainer { RelativeSizeAxes = Axes.X, - Height = DEFAULT_HEIGHT, + Height = default_height, Content = new[] { new Drawable[] @@ -173,26 +167,26 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents { Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, - Padding = new MarginPadding { Left = DEFAULT_LABEL_LEFT_PADDING, Top = DEFAULT_LABEL_TOP_PADDING }, + Padding = new MarginPadding { Left = default_label_left_padding, Top = default_label_top_padding }, Colour = Color4.White, - TextSize = DEFAULT_LABEL_TEXT_SIZE, + TextSize = default_label_text_size, Text = LabelText, Font = @"Exo2.0-Bold", }, - textBox = new OsuSetupTextBox + textBox = new SetupTextBox { Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, RelativeSizeAxes = Axes.X, - Height = DEFAULT_HEIGHT, + Height = default_height, ReadOnly = ReadOnly, - CornerRadius = INNER_CORNER_RADIUS, + CornerRadius = inner_corner_radius, }, }, }, ColumnDimensions = new[] { - new Dimension(GridSizeMode.Absolute, LABEL_CONTAINER_WIDTH), + new Dimension(GridSizeMode.Absolute, label_container_width), new Dimension() } } @@ -201,7 +195,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents } }; - textBox.OnCommit += delegate { TriggerTextBoxTextChanged(textBox.Text); }; + textBox.OnCommit += (_, a) => TextBoxTextChanged?.Invoke(textBox, a); } } } diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs similarity index 94% rename from osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs rename to osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs index 1a31582291..206170e1eb 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/OsuSetupTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs @@ -9,7 +9,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Edit.Screens.Setup.Components { - public class OsuSetupTextBox : OsuTextBox + public class SetupTextBox : OsuTextBox { protected override float LeftRightPadding => 15; From a833fa3d924e05df4047d5ba00965819156f4a2a Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Tue, 24 Jul 2018 09:19:45 +0300 Subject: [PATCH 41/56] Update framework and apply suggested changes --- .../Setup/Components/LabelledComponents/LabelledTextBox.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 806e6b6f6d..09797e3180 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -26,7 +26,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents private const float default_label_top_padding = 12; private const float default_label_text_size = 16; - public event OnCommitHandler TextBoxTextChanged; + public event OnCommitHandler OnCommit; private bool readOnly; public bool ReadOnly @@ -80,7 +80,6 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents { text = value; textBox.Text = value; - TextBoxTextChanged?.Invoke(textBox, true); } } @@ -195,7 +194,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents } }; - textBox.OnCommit += (_, a) => TextBoxTextChanged?.Invoke(textBox, a); + textBox.OnCommit += OnCommit; } } } From 2f452c162cb9b9c09dd21dba9780f6630fdb3270 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Tue, 24 Jul 2018 09:21:01 +0300 Subject: [PATCH 42/56] Make text colour white --- .../Screens/Edit/Screens/Setup/Components/SetupTextBox.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs index 206170e1eb..c3938fae9c 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs @@ -12,13 +12,5 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components public class SetupTextBox : OsuTextBox { protected override float LeftRightPadding => 15; - - [BackgroundDependencyLoader] - private void load(OsuColour osuColour) - { - BorderColour = osuColour.Blue; - } - - protected override Drawable GetDrawableCharacter(char c) => new OsuSpriteText { Text = c.ToString(), Colour = BorderColour, TextSize = CalculatedTextSize }; } } From 765c6e4eccbe0a3744fd6c3dfca1f42aa1522f34 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Tue, 24 Jul 2018 09:46:24 +0300 Subject: [PATCH 43/56] Remove custom text box --- .../LabelledComponents/LabelledTextBox.cs | 5 +++-- .../Screens/Setup/Components/SetupTextBox.cs | 16 ---------------- 2 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 09797e3180..15723c0eaf 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; using System; using static osu.Framework.Graphics.UserInterface.TextBox; @@ -14,7 +15,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents { public class LabelledTextBox : CompositeDrawable { - private readonly SetupTextBox textBox; + private readonly OsuTextBox textBox; private readonly Container content; private readonly OsuSpriteText label; @@ -172,7 +173,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents Text = LabelText, Font = @"Exo2.0-Bold", }, - textBox = new SetupTextBox + textBox = new OsuTextBox { Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft, diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs deleted file mode 100644 index c3938fae9c..0000000000 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/SetupTextBox.cs +++ /dev/null @@ -1,16 +0,0 @@ -// 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.Graphics; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; - -namespace osu.Game.Screens.Edit.Screens.Setup.Components -{ - public class SetupTextBox : OsuTextBox - { - protected override float LeftRightPadding => 15; - } -} From 0e50e4ee346d6e7f1d06e89a7749b72d95cd239c Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Tue, 24 Jul 2018 10:10:17 +0300 Subject: [PATCH 44/56] Clean code --- .../LabelledComponents/LabelledTextBox.cs | 82 +++++++++---------- 1 file changed, 38 insertions(+), 44 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 15723c0eaf..5f4e88b52c 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -8,7 +8,6 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; -using System; using static osu.Framework.Graphics.UserInterface.TextBox; namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents @@ -132,63 +131,58 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents public LabelledTextBox() { - Masking = true; - CornerRadius = outer_corner_radius; RelativeSizeAxes = Axes.X; base.Height = default_height + Padding.Top; + CornerRadius = outer_corner_radius; + Masking = true; - InternalChildren = new Drawable[] + InternalChild = new Container { - new Container + RelativeSizeAxes = Axes.Both, + CornerRadius = outer_corner_radius, + Masking = true, + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - CornerRadius = outer_corner_radius, - Masking = true, - Children = new Drawable[] + new Box { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.FromHex("1c2125"), - }, - new Container + RelativeSizeAxes = Axes.Both, + Colour = OsuColour.FromHex("1c2125"), + }, + new Container + { + RelativeSizeAxes = Axes.X, + Height = default_height, + Child = new GridContainer { RelativeSizeAxes = Axes.X, Height = default_height, - Child = new GridContainer + Content = new[] { - RelativeSizeAxes = Axes.X, - Height = default_height, - Content = new[] + new Drawable[] { - new Drawable[] + label = new OsuSpriteText { - label = new OsuSpriteText - { - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, - Padding = new MarginPadding { Left = default_label_left_padding, Top = default_label_top_padding }, - Colour = Color4.White, - TextSize = default_label_text_size, - Text = LabelText, - Font = @"Exo2.0-Bold", - }, - textBox = new OsuTextBox - { - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, - RelativeSizeAxes = Axes.X, - Height = default_height, - ReadOnly = ReadOnly, - CornerRadius = inner_corner_radius, - }, + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + Padding = new MarginPadding { Left = default_label_left_padding, Top = default_label_top_padding }, + Colour = Color4.White, + TextSize = default_label_text_size, + Font = @"Exo2.0-Bold", + }, + textBox = new OsuTextBox + { + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + RelativeSizeAxes = Axes.X, + Height = default_height, + CornerRadius = inner_corner_radius, }, }, - ColumnDimensions = new[] - { - new Dimension(GridSizeMode.Absolute, label_container_width), - new Dimension() - } + }, + ColumnDimensions = new[] + { + new Dimension(GridSizeMode.Absolute, label_container_width), + new Dimension() } } } From ab9340f4be8ab5410177a0eb4b611437177a28b4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Jul 2018 11:34:06 +0200 Subject: [PATCH 45/56] Fix usage of culture local ToUpper causing incorrect display on Turkish machines Closes #3098. --- osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs | 3 ++- osu.Game/Overlays/Chat/ChannelSection.cs | 3 ++- osu.Game/Overlays/MedalSplash/DrawableMedal.cs | 3 ++- osu.Game/Overlays/Notifications/NotificationSection.cs | 7 ++++--- osu.Game/Overlays/OnScreenDisplay.cs | 5 +++-- osu.Game/Overlays/Settings/SettingsSubsection.cs | 3 ++- osu.Game/Rulesets/Judgements/DrawableJudgement.cs | 3 ++- osu.Game/Screens/Play/Break/BreakInfo.cs | 3 ++- .../Screens/Play/PlayerSettings/PlayerSettingsGroup.cs | 3 ++- osu.Game/Screens/Tournament/Drawings.cs | 3 ++- osu.Game/Screens/Tournament/Group.cs | 5 +++-- 11 files changed, 26 insertions(+), 15 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs index 24e6021421..4e92f49937 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Globalization; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -23,7 +24,7 @@ namespace osu.Game.Beatmaps.Drawables if (value == status) return; status = value; - statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpper(); + statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpper(CultureInfo.InvariantCulture); } } diff --git a/osu.Game/Overlays/Chat/ChannelSection.cs b/osu.Game/Overlays/Chat/ChannelSection.cs index 89d9d2231c..2d0c406ef2 100644 --- a/osu.Game/Overlays/Chat/ChannelSection.cs +++ b/osu.Game/Overlays/Chat/ChannelSection.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Globalization; using System.Linq; using OpenTK; using osu.Framework.Graphics; @@ -30,7 +31,7 @@ namespace osu.Game.Overlays.Chat public string Header { get { return header.Text; } - set { header.Text = value.ToUpper(); } + set { header.Text = value.ToUpper(CultureInfo.InvariantCulture); } } public IEnumerable Channels diff --git a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs index ce79e70b1c..222c966a2b 100644 --- a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs +++ b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Globalization; using osu.Framework; using OpenTK; using osu.Framework.Allocation; @@ -62,7 +63,7 @@ namespace osu.Game.Overlays.MedalSplash { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "Medal Unlocked".ToUpper(), + Text = "Medal Unlocked".ToUpper(CultureInfo.InvariantCulture), TextSize = 24, Font = @"Exo2.0-Light", Alpha = 0f, diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index c166624d2b..1537c65a1f 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; @@ -55,7 +56,7 @@ namespace osu.Game.Overlays.Notifications set { title = value; - if (titleText != null) titleText.Text = title.ToUpper(); + if (titleText != null) titleText.Text = title.ToUpper(CultureInfo.InvariantCulture); } } @@ -101,7 +102,7 @@ namespace osu.Game.Overlays.Notifications { titleText = new OsuSpriteText { - Text = title.ToUpper(), + Text = title.ToUpper(CultureInfo.InvariantCulture), Font = @"Exo2.0-Black", }, countText = new OsuSpriteText @@ -154,7 +155,7 @@ namespace osu.Game.Overlays.Notifications public string Text { get { return text.Text; } - set { text.Text = value.ToUpper(); } + set { text.Text = value.ToUpper(CultureInfo.InvariantCulture); } } } diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index 5a5b90ee25..ba5bb9c49e 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Configuration.Tracking; @@ -176,9 +177,9 @@ namespace osu.Game.Overlays { Schedule(() => { - textLine1.Text = description.Name.ToUpper(); + textLine1.Text = description.Name.ToUpper(CultureInfo.InvariantCulture); textLine2.Text = description.Value; - textLine3.Text = description.Shortcut.ToUpper(); + textLine3.Text = description.Shortcut.ToUpper(CultureInfo.InvariantCulture); if (string.IsNullOrEmpty(textLine3.Text)) textLine3.Text = "NO KEY BOUND"; diff --git a/osu.Game/Overlays/Settings/SettingsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs index 82589a99bd..4498828118 100644 --- a/osu.Game/Overlays/Settings/SettingsSubsection.cs +++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; using System.Collections.Generic; +using System.Globalization; using System.Linq; using osu.Framework.Allocation; @@ -51,7 +52,7 @@ namespace osu.Game.Overlays.Settings { new OsuSpriteText { - Text = Header.ToUpper(), + Text = Header.ToUpper(CultureInfo.InvariantCulture), Margin = new MarginPadding { Bottom = 10, Left = SettingsOverlay.CONTENT_MARGINS, Right = SettingsOverlay.CONTENT_MARGINS }, Font = @"Exo2.0-Black", }, diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 74ee025823..6fa10977d0 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.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 System.Globalization; using OpenTK; using osu.Framework.Allocation; using osu.Framework.Extensions; @@ -51,7 +52,7 @@ namespace osu.Game.Rulesets.Judgements Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText { - Text = Judgement.Result.GetDescription().ToUpper(), + Text = Judgement.Result.GetDescription().ToUpper(CultureInfo.InvariantCulture), Font = @"Venera", Colour = judgementColour(Judgement.Result), Scale = new Vector2(0.85f, 1), diff --git a/osu.Game/Screens/Play/Break/BreakInfo.cs b/osu.Game/Screens/Play/Break/BreakInfo.cs index 77c9c967b4..fb7f6cd03b 100644 --- a/osu.Game/Screens/Play/Break/BreakInfo.cs +++ b/osu.Game/Screens/Play/Break/BreakInfo.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 System.Globalization; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -28,7 +29,7 @@ namespace osu.Game.Screens.Play.Break { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "current progress".ToUpper(), + Text = "current progress".ToUpper(CultureInfo.InvariantCulture), TextSize = 15, Font = "Exo2.0-Black", }, diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index 1813d02d02..9a17e7708b 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.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 System.Globalization; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -94,7 +95,7 @@ namespace osu.Game.Screens.Play.PlayerSettings { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Text = Title.ToUpper(), + Text = Title.ToUpper(CultureInfo.InvariantCulture), TextSize = 17, Font = @"Exo2.0-Bold", Margin = new MarginPadding { Left = 10 }, diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index 49a46b96e3..7bc8217329 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -323,7 +324,7 @@ namespace osu.Game.Screens.Tournament if (string.IsNullOrEmpty(line)) continue; - if (line.ToUpper().StartsWith("GROUP")) + if (line.ToUpper(CultureInfo.InvariantCulture).StartsWith("GROUP")) continue; // ReSharper disable once AccessToModifiedClosure diff --git a/osu.Game/Screens/Tournament/Group.cs b/osu.Game/Screens/Tournament/Group.cs index b1bcd6052c..f62c26a62e 100644 --- a/osu.Game/Screens/Tournament/Group.cs +++ b/osu.Game/Screens/Tournament/Group.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; using osu.Framework.Allocation; @@ -51,7 +52,7 @@ namespace osu.Game.Screens.Tournament Position = new Vector2(0, 7f), - Text = $"GROUP {name.ToUpper()}", + Text = $"GROUP {name.ToUpper(CultureInfo.InvariantCulture)}", TextSize = 8f, Font = @"Exo2.0-Bold", Colour = new Color4(255, 204, 34, 255), @@ -161,7 +162,7 @@ namespace osu.Game.Screens.Tournament Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = team.Acronym.ToUpper(), + Text = team.Acronym.ToUpper(CultureInfo.InvariantCulture), TextSize = 10f, Font = @"Exo2.0-Bold" } From b38da34da9df8e8910e293a3a93766b58aab4bf0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Jul 2018 12:11:14 +0200 Subject: [PATCH 46/56] Fix resetting database failing due to incorrect disposal logic --- osu.Game/Database/DatabaseContextFactory.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game/Database/DatabaseContextFactory.cs b/osu.Game/Database/DatabaseContextFactory.cs index c20d4569f6..e70d753114 100644 --- a/osu.Game/Database/DatabaseContextFactory.cs +++ b/osu.Game/Database/DatabaseContextFactory.cs @@ -5,6 +5,7 @@ using System; using System.Linq; using System.Threading; using Microsoft.EntityFrameworkCore.Storage; +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Platform; namespace osu.Game.Database @@ -115,7 +116,11 @@ namespace osu.Game.Database } } - private void recycleThreadContexts() => threadContexts = new ThreadLocal(CreateContext); + private void recycleThreadContexts() + { + threadContexts?.Values.ForEach(c => c.Dispose()); + threadContexts = new ThreadLocal(CreateContext, true); + } protected virtual OsuDbContext CreateContext() => new OsuDbContext(storage.GetDatabaseConnectionString(database_name)) { @@ -127,8 +132,6 @@ namespace osu.Game.Database lock (writeLock) { recycleThreadContexts(); - GC.Collect(); - GC.WaitForPendingFinalizers(); storage.DeleteDatabase(database_name); } } From 1d86083981b80ee725645ce9b10719c384a9687a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Jul 2018 12:11:20 +0200 Subject: [PATCH 47/56] Hide unnecessary log output --- osu.Game/OsuGameBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 63cc883844..bada2a794d 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -224,7 +224,7 @@ namespace osu.Game // todo: we probably want a better (non-destructive) migrations/recovery process at a later point than this. contextFactory.ResetDatabase(); - Logger.Log("Database purged successfully.", LoggingTarget.Database, LogLevel.Important); + Logger.Log("Database purged successfully.", LoggingTarget.Database); // only run once more, then hard bail. using (var db = contextFactory.GetForWrite(false)) From 5364a6148a2b6adcbd77fbde14359cc1d6b9b259 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Jul 2018 14:42:06 +0200 Subject: [PATCH 48/56] Use ToUpperInvariant --- osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs | 3 +-- osu.Game/Overlays/Chat/ChannelSection.cs | 3 +-- osu.Game/Overlays/MedalSplash/DrawableMedal.cs | 3 +-- osu.Game/Overlays/Notifications/NotificationSection.cs | 7 +++---- osu.Game/Overlays/OnScreenDisplay.cs | 5 ++--- osu.Game/Overlays/Settings/SettingsSubsection.cs | 3 +-- osu.Game/Rulesets/Judgements/DrawableJudgement.cs | 3 +-- osu.Game/Screens/Play/Break/BreakInfo.cs | 3 +-- .../Screens/Play/PlayerSettings/PlayerSettingsGroup.cs | 3 +-- osu.Game/Screens/Tournament/Drawings.cs | 3 +-- osu.Game/Screens/Tournament/Group.cs | 5 ++--- 11 files changed, 15 insertions(+), 26 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs index 4e92f49937..c7e97cef55 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Globalization; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -24,7 +23,7 @@ namespace osu.Game.Beatmaps.Drawables if (value == status) return; status = value; - statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpper(CultureInfo.InvariantCulture); + statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpperInvariant(); } } diff --git a/osu.Game/Overlays/Chat/ChannelSection.cs b/osu.Game/Overlays/Chat/ChannelSection.cs index 2d0c406ef2..85fdecaaba 100644 --- a/osu.Game/Overlays/Chat/ChannelSection.cs +++ b/osu.Game/Overlays/Chat/ChannelSection.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using System.Globalization; using System.Linq; using OpenTK; using osu.Framework.Graphics; @@ -31,7 +30,7 @@ namespace osu.Game.Overlays.Chat public string Header { get { return header.Text; } - set { header.Text = value.ToUpper(CultureInfo.InvariantCulture); } + set { header.Text = value.ToUpperInvariant(); } } public IEnumerable Channels diff --git a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs index 222c966a2b..a27278e002 100644 --- a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs +++ b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Globalization; using osu.Framework; using OpenTK; using osu.Framework.Allocation; @@ -63,7 +62,7 @@ namespace osu.Game.Overlays.MedalSplash { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "Medal Unlocked".ToUpper(CultureInfo.InvariantCulture), + Text = "Medal Unlocked".ToUpperInvariant(), TextSize = 24, Font = @"Exo2.0-Light", Alpha = 0f, diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index 1537c65a1f..f41e3e876f 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; @@ -56,7 +55,7 @@ namespace osu.Game.Overlays.Notifications set { title = value; - if (titleText != null) titleText.Text = title.ToUpper(CultureInfo.InvariantCulture); + if (titleText != null) titleText.Text = title.ToUpperInvariant(); } } @@ -102,7 +101,7 @@ namespace osu.Game.Overlays.Notifications { titleText = new OsuSpriteText { - Text = title.ToUpper(CultureInfo.InvariantCulture), + Text = title.ToUpperInvariant(), Font = @"Exo2.0-Black", }, countText = new OsuSpriteText @@ -155,7 +154,7 @@ namespace osu.Game.Overlays.Notifications public string Text { get { return text.Text; } - set { text.Text = value.ToUpper(CultureInfo.InvariantCulture); } + set { text.Text = value.ToUpperInvariant(); } } } diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index ba5bb9c49e..041ceab365 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Configuration.Tracking; @@ -177,9 +176,9 @@ namespace osu.Game.Overlays { Schedule(() => { - textLine1.Text = description.Name.ToUpper(CultureInfo.InvariantCulture); + textLine1.Text = description.Name.ToUpperInvariant(); textLine2.Text = description.Value; - textLine3.Text = description.Shortcut.ToUpper(CultureInfo.InvariantCulture); + textLine3.Text = description.Shortcut.ToUpperInvariant(); if (string.IsNullOrEmpty(textLine3.Text)) textLine3.Text = "NO KEY BOUND"; diff --git a/osu.Game/Overlays/Settings/SettingsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs index 4498828118..9296972749 100644 --- a/osu.Game/Overlays/Settings/SettingsSubsection.cs +++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; using System.Collections.Generic; -using System.Globalization; using System.Linq; using osu.Framework.Allocation; @@ -52,7 +51,7 @@ namespace osu.Game.Overlays.Settings { new OsuSpriteText { - Text = Header.ToUpper(CultureInfo.InvariantCulture), + Text = Header.ToUpperInvariant(), Margin = new MarginPadding { Bottom = 10, Left = SettingsOverlay.CONTENT_MARGINS, Right = SettingsOverlay.CONTENT_MARGINS }, Font = @"Exo2.0-Black", }, diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 6fa10977d0..5de14ae579 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Globalization; using OpenTK; using osu.Framework.Allocation; using osu.Framework.Extensions; @@ -52,7 +51,7 @@ namespace osu.Game.Rulesets.Judgements Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText { - Text = Judgement.Result.GetDescription().ToUpper(CultureInfo.InvariantCulture), + Text = Judgement.Result.GetDescription().ToUpperInvariant(), Font = @"Venera", Colour = judgementColour(Judgement.Result), Scale = new Vector2(0.85f, 1), diff --git a/osu.Game/Screens/Play/Break/BreakInfo.cs b/osu.Game/Screens/Play/Break/BreakInfo.cs index fb7f6cd03b..51d39762d2 100644 --- a/osu.Game/Screens/Play/Break/BreakInfo.cs +++ b/osu.Game/Screens/Play/Break/BreakInfo.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Globalization; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -29,7 +28,7 @@ namespace osu.Game.Screens.Play.Break { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = "current progress".ToUpper(CultureInfo.InvariantCulture), + Text = "current progress".ToUpperInvariant(), TextSize = 15, Font = "Exo2.0-Black", }, diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index 9a17e7708b..c4767f404d 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -95,7 +94,7 @@ namespace osu.Game.Screens.Play.PlayerSettings { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Text = Title.ToUpper(CultureInfo.InvariantCulture), + Text = Title.ToUpperInvariant(), TextSize = 17, Font = @"Exo2.0-Bold", Margin = new MarginPadding { Left = 10 }, diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index 7bc8217329..63d29d5cd7 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; using System.Threading.Tasks; @@ -324,7 +323,7 @@ namespace osu.Game.Screens.Tournament if (string.IsNullOrEmpty(line)) continue; - if (line.ToUpper(CultureInfo.InvariantCulture).StartsWith("GROUP")) + if (line.ToUpperInvariant().StartsWith("GROUP")) continue; // ReSharper disable once AccessToModifiedClosure diff --git a/osu.Game/Screens/Tournament/Group.cs b/osu.Game/Screens/Tournament/Group.cs index f62c26a62e..6845d8fc48 100644 --- a/osu.Game/Screens/Tournament/Group.cs +++ b/osu.Game/Screens/Tournament/Group.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using System.Globalization; using System.Linq; using System.Text; using osu.Framework.Allocation; @@ -52,7 +51,7 @@ namespace osu.Game.Screens.Tournament Position = new Vector2(0, 7f), - Text = $"GROUP {name.ToUpper(CultureInfo.InvariantCulture)}", + Text = $"GROUP {name.ToUpperInvariant()}", TextSize = 8f, Font = @"Exo2.0-Bold", Colour = new Color4(255, 204, 34, 255), @@ -162,7 +161,7 @@ namespace osu.Game.Screens.Tournament Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Text = team.Acronym.ToUpper(CultureInfo.InvariantCulture), + Text = team.Acronym.ToUpperInvariant(), TextSize = 10f, Font = @"Exo2.0-Bold" } From 3ca112aef0779c29fd7eaeca0dd9d9d24656e661 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Tue, 24 Jul 2018 22:04:02 +0300 Subject: [PATCH 49/56] Clean code and apply requested changes --- .../LabelledComponents/LabelledTextBox.cs | 124 ++++++------------ 1 file changed, 39 insertions(+), 85 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 5f4e88b52c..9f364c6cf4 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -27,82 +27,41 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents private const float default_label_text_size = 16; public event OnCommitHandler OnCommit; - - private bool readOnly; + public bool ReadOnly { - get => readOnly; - set - { - textBox.ReadOnly = value; - readOnly = value; - } + get => textBox.ReadOnly; + set => textBox.ReadOnly = value; } - - private string labelText; + public string LabelText { - get => labelText; - set - { - labelText = value; - label.Text = value; - } + get => label.Text; + set => label.Text = value; } - - private float labelTextSize; + public float LabelTextSize { - get => labelTextSize; - set - { - labelTextSize = value; - label.TextSize = value; - } + get => label.TextSize; + set => label.TextSize = value; } - - private string placeholderText; + public string PlaceholderText { - get => placeholderText; - set - { - placeholderText = value; - textBox.PlaceholderText = value; - } + get => textBox.PlaceholderText; + set => textBox.PlaceholderText = value; } - private string text; public string Text { - get => text; - set - { - text = value; - textBox.Text = value; - } - } - - private float height = default_height; - public float Height - { - get => height; - private set - { - height = value; - textBox.Height = value; - content.Height = value; - } + get => textBox.Text; + set => textBox.Text = value; } public MarginPadding Padding { get => base.Padding; - set - { - base.Padding = value; - base.Height = Height + base.Padding.Top; - } + set => base.Padding = value; } public MarginPadding LabelPadding @@ -132,7 +91,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents public LabelledTextBox() { RelativeSizeAxes = Axes.X; - base.Height = default_height + Padding.Top; + Height = default_height; CornerRadius = outer_corner_radius; Masking = true; @@ -148,42 +107,37 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex("1c2125"), }, - new Container + new GridContainer { RelativeSizeAxes = Axes.X, Height = default_height, - Child = new GridContainer + Content = new[] { - RelativeSizeAxes = Axes.X, - Height = default_height, - Content = new[] + new Drawable[] { - new Drawable[] + label = new OsuSpriteText { - label = new OsuSpriteText - { - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, - Padding = new MarginPadding { Left = default_label_left_padding, Top = default_label_top_padding }, - Colour = Color4.White, - TextSize = default_label_text_size, - Font = @"Exo2.0-Bold", - }, - textBox = new OsuTextBox - { - Anchor = Anchor.TopLeft, - Origin = Anchor.TopLeft, - RelativeSizeAxes = Axes.X, - Height = default_height, - CornerRadius = inner_corner_radius, - }, + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + Padding = new MarginPadding { Left = default_label_left_padding, Top = default_label_top_padding }, + Colour = Color4.White, + TextSize = default_label_text_size, + Font = @"Exo2.0-Bold", + }, + textBox = new OsuTextBox + { + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft, + RelativeSizeAxes = Axes.Both, + Height = 1, + CornerRadius = inner_corner_radius, }, }, - ColumnDimensions = new[] - { - new Dimension(GridSizeMode.Absolute, label_container_width), - new Dimension() - } + }, + ColumnDimensions = new[] + { + new Dimension(GridSizeMode.Absolute, label_container_width), + new Dimension() } } } From 6675c455f3d6761343b969849db8d92d376238c5 Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Tue, 24 Jul 2018 22:33:19 +0300 Subject: [PATCH 50/56] Trim whitespace that magically appeared --- .../Components/LabelledComponents/LabelledTextBox.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 9f364c6cf4..fbfb771c8a 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -27,25 +27,25 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents private const float default_label_text_size = 16; public event OnCommitHandler OnCommit; - + public bool ReadOnly { get => textBox.ReadOnly; set => textBox.ReadOnly = value; } - + public string LabelText { get => label.Text; set => label.Text = value; } - + public float LabelTextSize { get => label.TextSize; set => label.TextSize = value; } - + public string PlaceholderText { get => textBox.PlaceholderText; From da8fc0ee5dd169946155aa4150bf34354c14255e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 25 Jul 2018 07:37:05 +0200 Subject: [PATCH 51/56] ToLower -> ToLowerInvariant --- osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs | 4 ++-- osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs | 2 +- osu.Game/Graphics/ScreenshotManager.cs | 2 +- osu.Game/Online/API/Requests/GetUserScoresRequest.cs | 2 +- osu.Game/Online/API/Requests/PostMessageRequest.cs | 2 +- osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 4 ++-- osu.Game/Screens/Multi/Header.cs | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs b/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs index 64ed08373a..fdc8f362f7 100644 --- a/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs +++ b/osu.Game.Rulesets.Mania.Tests/TestCaseNotes.cs @@ -62,7 +62,7 @@ namespace osu.Game.Rulesets.Mania.Tests return new ScrollingTestContainer(direction) { AutoSizeAxes = Axes.Both, - Child = new NoteContainer(direction, $"note, scrolling {direction.ToString().ToLower()}") + Child = new NoteContainer(direction, $"note, scrolling {direction.ToString().ToLowerInvariant()}") { Child = new DrawableNote(note) { AccentColour = Color4.OrangeRed } } @@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Mania.Tests return new ScrollingTestContainer(direction) { AutoSizeAxes = Axes.Both, - Child = new NoteContainer(direction, $"hold note, scrolling {direction.ToString().ToLower()}") + Child = new NoteContainer(direction, $"hold note, scrolling {direction.ToString().ToLowerInvariant()}") { Child = new DrawableHoldNote(note) { diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index 52d9f31814..26f28c86ca 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -312,7 +312,7 @@ namespace osu.Game.Beatmaps.Formats omitFirstBarSignature = effectFlags.HasFlag(EffectFlags.OmitFirstBarLine); } - string stringSampleSet = sampleSet.ToString().ToLower(); + string stringSampleSet = sampleSet.ToString().ToLowerInvariant(); if (stringSampleSet == @"none") stringSampleSet = @"normal"; diff --git a/osu.Game/Graphics/ScreenshotManager.cs b/osu.Game/Graphics/ScreenshotManager.cs index 90580c50df..7b3337cb23 100644 --- a/osu.Game/Graphics/ScreenshotManager.cs +++ b/osu.Game/Graphics/ScreenshotManager.cs @@ -134,7 +134,7 @@ namespace osu.Game.Graphics private string getFileName() { var dt = DateTime.Now; - var fileExt = screenshotFormat.ToString().ToLower(); + var fileExt = screenshotFormat.ToString().ToLowerInvariant(); var withoutIndex = $"osu_{dt:yyyy-MM-dd_HH-mm-ss}.{fileExt}"; if (!storage.Exists(withoutIndex)) diff --git a/osu.Game/Online/API/Requests/GetUserScoresRequest.cs b/osu.Game/Online/API/Requests/GetUserScoresRequest.cs index ea14135a61..4d4aa4d957 100644 --- a/osu.Game/Online/API/Requests/GetUserScoresRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserScoresRequest.cs @@ -20,7 +20,7 @@ namespace osu.Game.Online.API.Requests } // ReSharper disable once ImpureMethodCallOnReadonlyValueField - protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLower()}?offset={offset}"; + protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLowerInvariant()}?offset={offset}"; } public enum ScoreType diff --git a/osu.Game/Online/API/Requests/PostMessageRequest.cs b/osu.Game/Online/API/Requests/PostMessageRequest.cs index 44429bdcd5..e0a9fb83b2 100644 --- a/osu.Game/Online/API/Requests/PostMessageRequest.cs +++ b/osu.Game/Online/API/Requests/PostMessageRequest.cs @@ -23,7 +23,7 @@ namespace osu.Game.Online.API.Requests req.Method = HttpMethod.POST; req.AddParameter(@"target_type", message.TargetType.GetDescription()); req.AddParameter(@"target_id", message.TargetId.ToString()); - req.AddParameter(@"is_action", message.IsAction.ToString().ToLower()); + req.AddParameter(@"is_action", message.IsAction.ToString().ToLowerInvariant()); req.AddParameter(@"message", message.Content); return req; diff --git a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs index 2a154d1230..3c808d1bee 100644 --- a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs +++ b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs @@ -29,7 +29,7 @@ namespace osu.Game.Online.API.Requests } // ReSharper disable once ImpureMethodCallOnReadonlyValueField - protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)searchCategory}&sort={sortCriteria.ToString().ToLower()}_{directionString}"; + protected override string Target => $@"beatmapsets/search?q={query}&m={ruleset.ID ?? 0}&s={(int)searchCategory}&sort={sortCriteria.ToString().ToLowerInvariant()}_{directionString}"; } public enum BeatmapSearchCategory diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index 0ac8e585f8..c48060bfa9 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -197,10 +197,10 @@ namespace osu.Game.Rulesets.Objects.Legacy var bank = (LegacyBeatmapDecoder.LegacySampleBank)int.Parse(split[0]); var addbank = (LegacyBeatmapDecoder.LegacySampleBank)int.Parse(split[1]); - string stringBank = bank.ToString().ToLower(); + string stringBank = bank.ToString().ToLowerInvariant(); if (stringBank == @"none") stringBank = null; - string stringAddBank = addbank.ToString().ToLower(); + string stringAddBank = addbank.ToString().ToLowerInvariant(); if (stringAddBank == @"none") stringAddBank = null; diff --git a/osu.Game/Screens/Multi/Header.cs b/osu.Game/Screens/Multi/Header.cs index 46610a36d8..809fc25083 100644 --- a/osu.Game/Screens/Multi/Header.cs +++ b/osu.Game/Screens/Multi/Header.cs @@ -86,7 +86,7 @@ namespace osu.Game.Screens.Multi }, }; - breadcrumbs.Current.ValueChanged += s => screenType.Text = ((MultiplayerScreen)s).Type.ToLower(); + breadcrumbs.Current.ValueChanged += s => screenType.Text = ((MultiplayerScreen)s).Type.ToLowerInvariant(); breadcrumbs.Current.TriggerChange(); } From b60e4b0728cc24a0067d673c6552f12de6e331e9 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 25 Jul 2018 18:34:47 +0900 Subject: [PATCH 52/56] Cleanup --- .../Components/LabelledComponents/LabelledTextBox.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index fbfb771c8a..4c8e90400a 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -5,19 +5,15 @@ using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; -using static osu.Framework.Graphics.UserInterface.TextBox; namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents { public class LabelledTextBox : CompositeDrawable { - private readonly OsuTextBox textBox; - private readonly Container content; - private readonly OsuSpriteText label; - private const float label_container_width = 150; private const float outer_corner_radius = 15; private const float inner_corner_radius = 10; @@ -26,7 +22,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents private const float default_label_top_padding = 12; private const float default_label_text_size = 16; - public event OnCommitHandler OnCommit; + public event TextBox.OnCommitHandler OnCommit; public bool ReadOnly { @@ -88,6 +84,10 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents set => content.Colour = value; } + private readonly OsuTextBox textBox; + private readonly Container content; + private readonly OsuSpriteText label; + public LabelledTextBox() { RelativeSizeAxes = Axes.X; From 206e3686f2dc2fd98273892f6d5faeee4dfad304 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 25 Jul 2018 18:38:50 +0900 Subject: [PATCH 53/56] Add back blue border --- .../Setup/Components/LabelledComponents/LabelledTextBox.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 4c8e90400a..736d785b41 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.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 OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -145,5 +146,11 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents textBox.OnCommit += OnCommit; } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + textBox.BorderColour = colours.Blue; + } } } From c4b1ba2979ede6c0b00c29c6912801ad6e4d0adf Mon Sep 17 00:00:00 2001 From: AlFasGD Date: Wed, 25 Jul 2018 15:14:40 +0300 Subject: [PATCH 54/56] Remove padding, fix corner radiuses --- .../Visual/TestCaseLabelledTextBox.cs | 10 ++++--- .../LabelledComponents/LabelledTextBox.cs | 27 +++---------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs b/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs index be11562bb0..d41739bfb5 100644 --- a/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs +++ b/osu.Game.Tests/Visual/TestCaseLabelledTextBox.cs @@ -4,6 +4,7 @@ using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents; using System; using System.Collections.Generic; @@ -21,15 +22,18 @@ namespace osu.Game.Tests.Visual [BackgroundDependencyLoader] private void load() { - Children = new Drawable[] + Child = new Container { - new LabelledTextBox + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.X, + Padding = new MarginPadding { Left = 150, Right = 150 }, + Child = new LabelledTextBox { Anchor = Anchor.Centre, Origin = Anchor.Centre, LabelText = "Testing text", PlaceholderText = "This is definitely working as intended", - Padding = new MarginPadding { Left = 150, Right = 150 } } }; } diff --git a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs index 736d785b41..94200b7f4e 100644 --- a/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs +++ b/osu.Game/Screens/Edit/Screens/Setup/Components/LabelledComponents/LabelledTextBox.cs @@ -16,8 +16,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents public class LabelledTextBox : CompositeDrawable { private const float label_container_width = 150; - private const float outer_corner_radius = 15; - private const float inner_corner_radius = 10; + private const float corner_radius = 15; private const float default_height = 40; private const float default_label_left_padding = 15; private const float default_label_top_padding = 12; @@ -55,24 +54,6 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents set => textBox.Text = value; } - public MarginPadding Padding - { - get => base.Padding; - set => base.Padding = value; - } - - public MarginPadding LabelPadding - { - get => label.Padding; - set => label.Padding = value; - } - - public MarginPadding TextBoxPadding - { - get => textBox.Padding; - set => textBox.Padding = value; - } - public Color4 LabelTextColour { get => label.Colour; @@ -93,13 +74,13 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents { RelativeSizeAxes = Axes.X; Height = default_height; - CornerRadius = outer_corner_radius; + CornerRadius = corner_radius; Masking = true; InternalChild = new Container { RelativeSizeAxes = Axes.Both, - CornerRadius = outer_corner_radius, + CornerRadius = corner_radius, Masking = true, Children = new Drawable[] { @@ -131,7 +112,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents Origin = Anchor.TopLeft, RelativeSizeAxes = Axes.Both, Height = 1, - CornerRadius = inner_corner_radius, + CornerRadius = corner_radius, }, }, }, From ff2a3a6e9208c6d3fb7324cecea974eef9d2785f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 26 Jul 2018 20:07:16 +0900 Subject: [PATCH 55/56] Fix hitobjects not properly expiring if scrolling in the editor --- .../Objects/Drawables/DrawableOsuHitObject.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 02def2189f..5dc141bed0 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -1,11 +1,13 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.ComponentModel; using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Graphics; using System.Linq; using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Scoring; using osu.Game.Skinning; using OpenTK.Graphics; @@ -32,7 +34,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { UpdatePreemptState(); - using (BeginDelayedSequence(HitObject.TimePreempt + (Judgements.FirstOrDefault()?.TimeOffset ?? 0), true)) + var judgementOffset = Math.Min(HitObject.HitWindows.HalfWindowFor(HitResult.Miss), Judgements.FirstOrDefault()?.TimeOffset ?? 0); + + using (BeginDelayedSequence(HitObject.TimePreempt + judgementOffset, true)) UpdateCurrentState(state); } } From 71c49de0312c769922b91250a1de42eb8f7f5831 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 26 Jul 2018 21:00:18 +0900 Subject: [PATCH 56/56] Fix possible nullref if no fruits are ever caught --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 2f42902fd0..7b06426b07 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -52,6 +52,9 @@ namespace osu.Game.Rulesets.Catch.UI { void runAfterLoaded(Action action) { + if (lastPlateableFruit == null) + return; + // this is required to make this run after the last caught fruit runs UpdateState at least once. // TODO: find a better alternative if (lastPlateableFruit.IsLoaded)