From 1cddc4eb5be2686ac35eb85acd8d65507944ea42 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Mon, 14 Nov 2016 06:00:27 +0800 Subject: [PATCH 1/6] Use EqualityComparer to avoid boxing and casting when comparing. --- osu.Game/Graphics/UserInterface/RollingCounter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index 4fefc6b7b6..fd60a8ca8e 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -57,7 +57,7 @@ namespace osu.Game.Graphics.UserInterface } protected set { - if (displayedCount.Equals(value)) + if (EqualityComparer.Default.Equals(displayedCount, value)) return; displayedCount = value; DisplayedCountSpriteText.Text = FormatCount(value); From c8d23408d71ae71063055938b52577ff3f4b584d Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 15 Nov 2016 01:33:26 +0800 Subject: [PATCH 2/6] Fix ChatLine for now. --- osu.Game/Online/Chat/Display/ChatLine.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Online/Chat/Display/ChatLine.cs b/osu.Game/Online/Chat/Display/ChatLine.cs index 662a72f533..b4785593c6 100644 --- a/osu.Game/Online/Chat/Display/ChatLine.cs +++ b/osu.Game/Online/Chat/Display/ChatLine.cs @@ -63,6 +63,7 @@ namespace osu.Game.Online.Chat.Display { Text = Message.Content, TextSize = text_size, + AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, } } From f2f6fe8e008604531d960d5e37cc435a8e6840bc Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 15 Nov 2016 01:36:16 +0800 Subject: [PATCH 3/6] Set option object to members. --- osu.Game/Overlays/Options/Audio/VolumeOptions.cs | 6 +++--- osu.Game/Overlays/Options/Input/MouseOptions.cs | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs index e8ec4b7e86..c8dac502f3 100644 --- a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs +++ b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs @@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Options.Audio public VolumeOptions() { } - + [BackgroundDependencyLoader] private void load(OsuConfigManager config) { @@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Options.Audio new SpriteText { Text = "Master: TODO slider" }, new SpriteText { Text = "Music: TODO slider" }, new SpriteText { Text = "Effect: TODO slider" }, - new CheckBoxOption + ignoreHitsounds = new CheckBoxOption { LabelText = "Ignore beatmap hitsounds", Bindable = config.GetBindable(OsuConfig.IgnoreBeatmapSamples) @@ -33,4 +33,4 @@ namespace osu.Game.Overlays.Options.Audio }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Options/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Input/MouseOptions.cs index 316354fd4a..c2887fe4c0 100644 --- a/osu.Game/Overlays/Options/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Input/MouseOptions.cs @@ -23,28 +23,28 @@ namespace osu.Game.Overlays.Options.Input Children = new Drawable[] { new SpriteText { Text = "Sensitivity: TODO slider" }, - new CheckBoxOption + rawInput = new CheckBoxOption { LabelText = "Raw input", Bindable = config.GetBindable(OsuConfig.RawInput) }, - new CheckBoxOption + mapRawInput = new CheckBoxOption { LabelText = "Map absolute raw input to the osu! window", Bindable = config.GetBindable(OsuConfig.AbsoluteToOsuWindow) }, new SpriteText { Text = "Confine mouse cursor: TODO dropdown" }, - new CheckBoxOption + disableWheel = new CheckBoxOption { LabelText = "Disable mouse wheel in play mode", Bindable = config.GetBindable(OsuConfig.MouseDisableWheel) }, - new CheckBoxOption + disableButtons = new CheckBoxOption { LabelText = "Disable mouse buttons in play mode", Bindable = config.GetBindable(OsuConfig.MouseDisableButtons) }, - new CheckBoxOption + enableRipples = new CheckBoxOption { LabelText = "Cursor ripples", Bindable = config.GetBindable(OsuConfig.CursorRipple) @@ -52,4 +52,4 @@ namespace osu.Game.Overlays.Options.Input }; } } -} \ No newline at end of file +} From dcd3ba09159ed06e8b54646664a453f9bb3bc21e Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 15 Nov 2016 01:41:42 +0800 Subject: [PATCH 4/6] Make Player.Autoplay can be set. --- osu.Game/GameModes/Play/Player.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/GameModes/Play/Player.cs b/osu.Game/GameModes/Play/Player.cs index a511921c4e..7b7ce13785 100644 --- a/osu.Game/GameModes/Play/Player.cs +++ b/osu.Game/GameModes/Play/Player.cs @@ -26,7 +26,7 @@ namespace osu.Game.GameModes.Play { public class Player : OsuGameMode { - const bool autoplay = false; + public bool Autoplay; protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4"); @@ -61,7 +61,7 @@ namespace osu.Game.GameModes.Play break; } } - + } } @@ -129,7 +129,7 @@ namespace osu.Game.GameModes.Play hitRenderer.OnHit += delegate (HitObject h) { scoreOverlay.OnHit(h); }; hitRenderer.OnMiss += delegate (HitObject h) { scoreOverlay.OnMiss(h); }; - if (autoplay) + if (Autoplay) hitRenderer.Schedule(() => hitRenderer.DrawableObjects.ForEach(h => h.State = ArmedState.Armed)); Children = new Drawable[] @@ -152,4 +152,4 @@ namespace osu.Game.GameModes.Play playerClock.ProcessFrame(); } } -} \ No newline at end of file +} From 97005e033c33ecbaaccbf0384ebc060debb06ab1 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 15 Nov 2016 02:08:02 +0800 Subject: [PATCH 5/6] cctor->Register --- osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs | 8 ++++---- osu.Desktop/Program.cs | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs b/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs index 471f48c750..3d0869f54d 100644 --- a/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs +++ b/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs @@ -14,11 +14,11 @@ namespace osu.Desktop.Beatmaps.IO /// public class LegacyFilesystemReader : ArchiveReader { - static LegacyFilesystemReader() + public static void Register() { AddReader((storage, path) => Directory.Exists(path)); } - + private string basePath { get; set; } private string[] beatmaps { get; set; } private Beatmap firstMap { get; set; } @@ -50,10 +50,10 @@ namespace osu.Desktop.Beatmaps.IO { return firstMap.BeatmapInfo.Metadata; } - + public override void Dispose() { // no-op } } -} \ No newline at end of file +} diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 18009417cb..29a3c71394 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -4,6 +4,7 @@ using System; using System.IO; using System.Linq; +using osu.Desktop.Beatmaps.IO; using osu.Framework; using osu.Framework.Desktop; using osu.Framework.Desktop.Platform; @@ -18,6 +19,7 @@ namespace osu.Desktop [STAThread] public static int Main(string[] args) { + LegacyFilesystemReader.Register(); using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) { if (!host.IsPrimaryInstance) From 95600f872d9178b7b42162176d60330f7c777e94 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Wed, 16 Nov 2016 10:53:10 +0800 Subject: [PATCH 6/6] Expression body and spacing. --- osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs | 5 +---- osu.Desktop/Program.cs | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs b/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs index 3d0869f54d..12afbddcc1 100644 --- a/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs +++ b/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs @@ -14,10 +14,7 @@ namespace osu.Desktop.Beatmaps.IO /// public class LegacyFilesystemReader : ArchiveReader { - public static void Register() - { - AddReader((storage, path) => Directory.Exists(path)); - } + public static void Register() => AddReader((storage, path) => Directory.Exists(path)); private string basePath { get; set; } private string[] beatmaps { get; set; } diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 5c1d5374e4..d51f898870 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -25,6 +25,7 @@ namespace osu.Desktop public static int Main(string[] args) { LegacyFilesystemReader.Register(); + using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) { if (!host.IsPrimaryInstance)