From d4670fc64e194ca8b03a3d13a93082cb484e8888 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Dec 2016 18:34:40 +0900 Subject: [PATCH 01/79] Update framework. --- osu-framework | 2 +- osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu-framework b/osu-framework index 7b2f4dfce7..8dbc789266 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 7b2f4dfce7894ca7dea7626dcc34bcc32df651b9 +Subproject commit 8dbc789266c1bc3e46e364be824d69bcfac74e83 diff --git a/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs b/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs index a0ab68fa99..43a8aa1f92 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs @@ -44,8 +44,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables protected override void LoadComplete() { base.LoadComplete(); - line1.TransformSpacingTo(14, 1800, EasingTypes.OutQuint); - line2.TransformSpacingTo(14, 1800, EasingTypes.OutQuint); + line1.TransformSpacingTo(new Vector2(14, 0), 1800, EasingTypes.OutQuint); + line2.TransformSpacingTo(new Vector2(14, 0), 1800, EasingTypes.OutQuint); } } } \ No newline at end of file From 4d27101acab1bf3115360424fc586af33a18313b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Dec 2016 19:33:38 +0900 Subject: [PATCH 02/79] Add ability to adjust game clock's speed (pgup/pgdn). A bit hacky, probably need to expose rate better. --- osu.Game/OsuGame.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index c6e07c3a79..a4ca4c5817 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -20,6 +20,7 @@ using osu.Game.Graphics.UserInterface.Volume; using osu.Game.Database; using osu.Framework.Allocation; using osu.Framework.Graphics.Transformations; +using osu.Framework.Timing; using osu.Game.Modes; using osu.Game.Overlays.Toolbar; using osu.Game.Screens; @@ -154,11 +155,19 @@ namespace osu.Game private bool globalHotkeyPressed(InputState state, KeyDownEventArgs args) { + if (args.Repeat) return false; + switch (args.Key) { case Key.F8: chat.ToggleVisibility(); return true; + case Key.PageUp: + case Key.PageDown: + var rate = ((Clock as ThrottledFrameClock).Source as StopwatchClock).Rate * (args.Key == Key.PageUp ? 1.1f : 0.9f); + ((Clock as ThrottledFrameClock).Source as StopwatchClock).Rate = rate; + Logger.Log($@"Adjusting game clock to {rate}", LoggingTarget.Debug); + return true; } if (state.Keyboard.ControlPressed) From ff85ccca6d91db674d5080b364abd3c493a2a6b8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Dec 2016 19:34:52 +0900 Subject: [PATCH 03/79] Move the actual outro sequence into Intro rather than MainMenu. --- osu-resources | 2 +- osu.Game/Screens/Menu/ButtonSystem.cs | 1 - osu.Game/Screens/Menu/Intro.cs | 13 +++++++++++-- osu.Game/Screens/Menu/MainMenu.cs | 10 +++++++++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/osu-resources b/osu-resources index 6edd5eacdd..a3b2991157 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 6edd5eacdd25cc8c4f4dbca3414678c0b7dc5deb +Subproject commit a3b2991157ec0bdeb0e73d10e7b845aa16715420 diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index f5cf111269..3f2d7fcffc 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -144,7 +144,6 @@ namespace osu.Game.Screens.Menu private void onExit() { - State = MenuState.Exit; OnExit?.Invoke(); } diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index ed7c0fa7e9..ca85546b10 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -25,6 +25,7 @@ namespace osu.Game.Screens.Menu MainMenu mainMenu; private AudioSample welcome; + private AudioSample seeya; private AudioTrack bgm; internal override bool ShowOverlays => (ParentGameMode as OsuGameMode)?.ShowOverlays ?? false; @@ -58,6 +59,7 @@ namespace osu.Game.Screens.Menu private void load(AudioManager audio) { welcome = audio.Sample.Get(@"welcome"); + seeya = audio.Sample.Get(@"seeya"); bgm = audio.Track.Get(@"circles"); bgm.Looping = true; @@ -106,8 +108,15 @@ namespace osu.Game.Screens.Menu protected override void OnResuming(GameMode last) { - //we are just an intro. if we are resumed, we just want to exit after a short delay (to allow the last mode to transition out). - Scheduler.AddDelayed(Exit, 600); + //we also handle the exit transition. + seeya.Play(); + + double fadeOutTime = (last.LifetimeEnd - Time.Current) + 100; + + Scheduler.AddDelayed(Exit, fadeOutTime); + + //don't want to fade out completely else we will stop running updates and shit will hit the fan. + Game.FadeTo(0.01f, fadeOutTime); base.OnResuming(last); } diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index a6f8b51536..7b000ff7d5 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -1,6 +1,7 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Allocation; using osu.Framework.GameModes; using osu.Framework.GameModes.Testing; @@ -49,7 +50,7 @@ namespace osu.Game.Screens.Menu OnSolo = delegate { Push(new PlaySongSelect()); }, OnMulti = delegate { Push(new Lobby()); }, OnTest = delegate { Push(new TestBrowser()); }, - OnExit = delegate { Scheduler.AddDelayed(Exit, ButtonSystem.EXIT_DELAY); }, + OnExit = delegate { Exit(); }, } } } @@ -93,5 +94,12 @@ namespace osu.Game.Screens.Menu Content.FadeIn(length, EasingTypes.OutQuint); Content.MoveTo(new Vector2(0, 0), length, EasingTypes.OutQuint); } + + protected override bool OnExiting(GameMode next) + { + buttons.State = MenuState.Exit; + Content.FadeOut(ButtonSystem.EXIT_DELAY); + return base.OnExiting(next); + } } } From 590ca3108c30908c051c48abcf3f6650d82bd5f5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Dec 2016 19:45:54 +0900 Subject: [PATCH 04/79] Add checkbox sound effects. --- osu-resources | 2 +- osu.Game/Overlays/Options/CheckBoxOption.cs | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/osu-resources b/osu-resources index 6edd5eacdd..8ee9e6736f 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 6edd5eacdd25cc8c4f4dbca3414678c0b7dc5deb +Subproject commit 8ee9e6736fb3f656894baaef109a06fd25278fe6 diff --git a/osu.Game/Overlays/Options/CheckBoxOption.cs b/osu.Game/Overlays/Options/CheckBoxOption.cs index 18f0e59e03..ca346b1dd0 100644 --- a/osu.Game/Overlays/Options/CheckBoxOption.cs +++ b/osu.Game/Overlays/Options/CheckBoxOption.cs @@ -1,5 +1,8 @@ using System; using osu.Framework; +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -60,6 +63,8 @@ namespace osu.Game.Overlays.Options private Light light; private SpriteText labelSpriteText; + private AudioSample sampleChecked; + private AudioSample sampleUnchecked; public CheckBoxOption() { @@ -102,11 +107,19 @@ namespace osu.Game.Overlays.Options base.OnHoverLost(state); } + [BackgroundDependencyLoader] + private void load(AudioManager audio) + { + sampleChecked = audio.Sample.Get(@"Checkbox/check-on"); + sampleUnchecked = audio.Sample.Get(@"Checkbox/check-off"); + } + protected override void OnChecked() { if (bindable != null) bindable.Value = true; + sampleChecked?.Play(); light.State = CheckBoxState.Checked; } @@ -115,6 +128,7 @@ namespace osu.Game.Overlays.Options if (bindable != null) bindable.Value = false; + sampleUnchecked?.Play(); light.State = CheckBoxState.Unchecked; } From 8fc8ca3998093b2fb2a15ba1b21e10e8ed620821 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Dec 2016 20:09:56 +0900 Subject: [PATCH 05/79] Add song select panel sound effects. --- osu-resources | 2 +- osu.Game/Screens/Select/PlaySongSelect.cs | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/osu-resources b/osu-resources index 8ee9e6736f..1bf3167fa3 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 8ee9e6736fb3f656894baaef109a06fd25278fe6 +Subproject commit 1bf3167fa384c124f388a885f01613ed59fe8169 diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 983d5008df..729bf3aede 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -24,6 +24,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Game.Screens.Play; using osu.Framework; +using osu.Framework.Audio.Sample; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics.Containers; @@ -45,6 +46,9 @@ namespace osu.Game.Screens.Select private static readonly Vector2 BACKGROUND_BLUR = new Vector2(20); private CancellationTokenSource initialAddSetsTask; + private AudioSample sampleChangeDifficulty; + private AudioSample sampleChangeBeatmap; + class WedgeBackground : Container { public WedgeBackground() @@ -163,6 +167,9 @@ namespace osu.Game.Screens.Select trackManager = audio.Track; + sampleChangeDifficulty = audio.Sample.Get(@"SongSelect/select-difficulty"); + sampleChangeBeatmap = audio.Sample.Get(@"SongSelect/select-expand"); + initialAddSetsTask = new CancellationTokenSource(); Task.Factory.StartNew(() => addBeatmapSets(game, initialAddSetsTask.Token), initialAddSetsTask.Token); @@ -259,7 +266,14 @@ namespace osu.Game.Screens.Select private void selectionChanged(BeatmapGroup group, BeatmapInfo beatmap) { if (!beatmap.Equals(Beatmap?.BeatmapInfo)) + { + if (beatmap.BeatmapSetID == Beatmap?.BeatmapInfo.BeatmapSetID) + sampleChangeDifficulty.Play(); + else + sampleChangeBeatmap.Play(); + Beatmap = database.GetWorkingBeatmap(beatmap, Beatmap); + } ensurePlayingSelected(); } From 3056bbda5dc2abb8560d825309640a75cf50b793 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Dec 2016 21:09:17 +0900 Subject: [PATCH 06/79] Add temporary workaround for crash. --- osu.Game/Overlays/Toolbar/ToolbarUserButton.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index 3a91a007ff..09708fc403 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -113,7 +113,9 @@ namespace osu.Game.Overlays.Toolbar Add(s); - s.FadeInFromZero(200); + //todo: fix this... clock dependencies are a pain + if (s.Clock != null) + s.FadeInFromZero(200); }); } } From 7bd9a87bda2178d7e0a1d103a38b9c7c7348f93f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Dec 2016 21:09:41 +0900 Subject: [PATCH 07/79] Add menu button sound effects. --- osu-resources | 2 +- osu.Game/Graphics/UserInterface/BackButton.cs | 12 ++++++++++++ osu.Game/Overlays/Toolbar/ToolbarButton.cs | 11 +++++++++++ osu.Game/Screens/Menu/Button.cs | 17 ++++++++++++++--- osu.Game/Screens/Menu/ButtonSystem.cs | 13 ++++++++++++- 5 files changed, 50 insertions(+), 5 deletions(-) diff --git a/osu-resources b/osu-resources index 1bf3167fa3..73ddad1f01 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 1bf3167fa384c124f388a885f01613ed59fe8169 +Subproject commit 73ddad1f01f223c6c311f1302ed1658a2320813d diff --git a/osu.Game/Graphics/UserInterface/BackButton.cs b/osu.Game/Graphics/UserInterface/BackButton.cs index 7ccc5c061b..2f0f78b7a6 100644 --- a/osu.Game/Graphics/UserInterface/BackButton.cs +++ b/osu.Game/Graphics/UserInterface/BackButton.cs @@ -1,6 +1,9 @@ // Copyright (c) 2007-2016 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics; @@ -29,6 +32,7 @@ namespace osu.Game.Graphics.UserInterface private static readonly Vector2 size_extended = new Vector2(140, 50); private static readonly Vector2 size_retracted = new Vector2(100, 50); + private AudioSample sampleClick; public BackButton() { @@ -141,6 +145,12 @@ namespace osu.Game.Graphics.UserInterface }); } + [BackgroundDependencyLoader] + private void load(AudioManager audio) + { + sampleClick = audio.Sample.Get(@"Menu/menuback"); + } + protected override bool OnClick(InputState state) { var flash = new Box @@ -154,6 +164,8 @@ namespace osu.Game.Graphics.UserInterface flash.FadeOutFromOne(200); flash.Expire(); + sampleClick.Play(); + return base.OnClick(state); } } diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index 70462fa5fe..5976f64c41 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -2,6 +2,9 @@ //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; @@ -58,6 +61,7 @@ namespace osu.Game.Overlays.Toolbar private SpriteText tooltip1; private SpriteText tooltip2; protected FlowContainer Flow; + private AudioSample sampleClick; public ToolbarButton() { @@ -120,6 +124,12 @@ namespace osu.Game.Overlays.Toolbar RelativeSizeAxes = Axes.Y; } + [BackgroundDependencyLoader] + private void load(AudioManager audio) + { + sampleClick = audio.Sample.Get(@"Menu/menuclick"); + } + protected override void Update() { base.Update(); @@ -133,6 +143,7 @@ namespace osu.Game.Overlays.Toolbar protected override bool OnClick(InputState state) { Action?.Invoke(); + sampleClick.Play(); HoverBackground.FlashColour(new Color4(255, 255, 255, 100), 500, EasingTypes.OutQuint); return true; } diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index f0de6e7f74..92bbf0da68 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -1,5 +1,8 @@ using System; using osu.Framework; +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; @@ -28,6 +31,7 @@ namespace osu.Game.Screens.Menu private readonly float extraWidth; private Key triggerKey; private string text; + private AudioSample sampleClick; public override bool Contains(Vector2 screenSpacePos) { @@ -211,6 +215,14 @@ namespace osu.Game.Screens.Menu box.ScaleTo(new Vector2(1, 1), 500, EasingTypes.OutElastic); } + [BackgroundDependencyLoader] + private void load(AudioManager audio) + { + sampleClick = audio.Sample.Get($@"Menu/menu-{internalName}-click"); + if (sampleClick == null) + sampleClick = audio.Sample.Get(internalName.Contains(@"back") ? @"Menu/menuback" : @"Menu/menuhit"); + } + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) { trigger(); @@ -232,11 +244,9 @@ namespace osu.Game.Screens.Menu private void trigger() { - //Game.Audio.PlaySamplePositional($@"menu-{internalName}-click", internalName.Contains(@"back") ? @"menuback" : @"menuhit"); + sampleClick.Play(); clickAction?.Invoke(); - - //box.FlashColour(ColourHelper.Lighten2(colour, 0.7f), 200); } public override bool HandleInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f; @@ -250,6 +260,7 @@ namespace osu.Game.Screens.Menu public int ContractStyle; ButtonState state; + public ButtonState State { get { return state; } diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index f5cf111269..86db7f5e5f 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -5,6 +5,9 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Framework; +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; @@ -28,6 +31,8 @@ namespace osu.Game.Screens.Menu public Action OnChart; public Action OnTest; + private AudioSample sampleOsuClick; + private FlowContainerWithOrigin buttonFlow; //todo: make these non-internal somehow. @@ -111,6 +116,12 @@ namespace osu.Game.Screens.Menu buttonFlow.Add(buttonsTopLevel); } + [BackgroundDependencyLoader] + private void load(AudioManager audio) + { + sampleOsuClick = audio.Sample.Get(@"Menu/menuhit"); + } + protected override void LoadComplete() { base.LoadComplete(); @@ -158,7 +169,7 @@ namespace osu.Game.Screens.Menu switch (state) { case MenuState.Initial: - //Game.Audio.PlaySamplePositional(@"menuhit"); + sampleOsuClick.Play(); State = MenuState.TopLevel; return; case MenuState.TopLevel: From 3cb9cb647d447a00929a7621f35b95f5be35e8cc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Dec 2016 21:36:42 +0900 Subject: [PATCH 08/79] Tidy up BackButton and adjust transitions a bit. --- osu.Game/Graphics/UserInterface/BackButton.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/BackButton.cs b/osu.Game/Graphics/UserInterface/BackButton.cs index 7ccc5c061b..8d173384c3 100644 --- a/osu.Game/Graphics/UserInterface/BackButton.cs +++ b/osu.Game/Graphics/UserInterface/BackButton.cs @@ -16,13 +16,10 @@ namespace osu.Game.Graphics.UserInterface { private TextAwesome icon; - private Container leftContainer; - private Container rightContainer; - private Box leftBox; private Box rightBox; - private const double transform_time = 300.0; + private const double transform_time = 600; private const int pulse_length = 250; private const float shear = 0.1f; @@ -36,7 +33,7 @@ namespace osu.Game.Graphics.UserInterface Children = new Drawable[] { - leftContainer = new Container + new Container { RelativeSizeAxes = Axes.Both, Width = 0.4f, @@ -56,7 +53,7 @@ namespace osu.Game.Graphics.UserInterface }, } }, - rightContainer = new Container + new Container { Origin = Anchor.TopRight, Anchor = Anchor.TopRight, @@ -84,10 +81,7 @@ namespace osu.Game.Graphics.UserInterface }; } - public override bool Contains(Vector2 screenSpacePos) - { - return leftBox.Contains(screenSpacePos) || rightBox.Contains(screenSpacePos); - } + public override bool Contains(Vector2 screenSpacePos) => leftBox.Contains(screenSpacePos) || rightBox.Contains(screenSpacePos); protected override bool OnHover(InputState state) { From 29d15c3ab8e6cc8f9e35049a1db16829dbe02a72 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Dec 2016 16:58:12 +0900 Subject: [PATCH 09/79] Fix incorrect snaking on non-repeat sliders. --- .../Objects/Drawables/DrawableSlider.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index cd907fc001..3c49f5b2cd 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -93,26 +93,24 @@ namespace osu.Game.Modes.Osu.Objects.Drawables private void updateBody(int repeat, double progress) { - double drawStartProgress = 0; - double drawEndProgress = MathHelper.Clamp((Time.Current - slider.StartTime + TIME_PREEMPT) / TIME_FADEIN, 0, 1); + double start = 0; + double end = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - TIME_PREEMPT)) / TIME_FADEIN, 0, 1) : 1; if (repeat >= slider.RepeatCount - 1) { if (Math.Min(repeat, slider.RepeatCount - 1) % 2 == 1) { - drawStartProgress = 0; - drawEndProgress = progress; + start = 0; + end = snakingOut ? progress : 1; } else { - drawStartProgress = progress; - drawEndProgress = 1; + start = snakingOut ? progress : 0; + end = 1; } } - body.SetRange( - snakingOut ? drawStartProgress : 0, - snakingIn ? drawEndProgress : 1); + body.SetRange(start, end); } protected override void Update() From 421dd19aafaafc9c121ed23a6e98947651987109 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Dec 2016 18:26:21 +0900 Subject: [PATCH 10/79] Move initial state updates to DrawableHitObject. --- osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs | 8 -------- osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs | 2 -- osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs | 3 +++ 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs index 94e9a41c5a..c9d2901930 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -64,14 +64,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables Size = circle.DrawSize; } - protected override void LoadComplete() - { - base.LoadComplete(); - - //force application of the state that was set before we loaded. - UpdateState(State); - } - double hit50 = 150; double hit100 = 80; double hit300 = 30; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index 3c49f5b2cd..f41b88b21f 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -68,8 +68,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables { base.LoadComplete(); - //force application of the state that was set before we loaded. - UpdateState(State); body.PathWidth = 32; } diff --git a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs index ed57f06e51..352615eeab 100644 --- a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs @@ -48,6 +48,9 @@ namespace osu.Game.Modes.Objects.Drawables base.LoadComplete(); Judgement = CreateJudgementInfo(); + + //force application of the state that was set before we loaded. + UpdateState(State); } /// From f356640cb744f7beae66d9dbe78253c896ddbb1d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Dec 2016 18:56:20 +0900 Subject: [PATCH 11/79] Add missing licence headers. --- osu.Desktop.VisualTests/OpenTK.dll.config | 5 +++++ osu.Desktop.VisualTests/Platform/TestStorage.cs | 5 ++++- osu.Desktop.VisualTests/Program.cs | 4 ++-- osu.Desktop.VisualTests/VisualTestGame.cs | 4 ++-- osu.Desktop.VisualTests/packages.config | 5 +++++ osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs | 5 ++++- osu.Game.Mode.Osu/Objects/BezierApproximator.cs | 5 ++++- osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs | 5 ++++- .../Objects/Drawables/Pieces/ApproachCircle.cs | 5 ++++- osu.Game.Mode.Osu/Objects/Drawables/Pieces/CirclePiece.cs | 5 ++++- osu.Game.Mode.Osu/Objects/Drawables/Pieces/ExplodePiece.cs | 5 ++++- osu.Game.Mode.Osu/Objects/Drawables/Pieces/FlashPiece.cs | 5 ++++- osu.Game.Mode.Osu/Objects/Drawables/Pieces/GlowPiece.cs | 5 ++++- osu.Game.Mode.Osu/Objects/Drawables/Pieces/NumberPiece.cs | 5 ++++- osu.Game.Mode.Osu/Objects/Drawables/Pieces/RingPiece.cs | 5 ++++- osu.Game.Mode.Osu/Objects/Drawables/Pieces/Triangles.cs | 5 ++++- osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs | 5 ++++- osu.Game.Mode.Osu/Objects/SliderCurve.cs | 4 ++-- osu.Game.Mode.Osu/OpenTK.dll.config | 5 +++++ osu.Game.Mode.Osu/OsuScore.cs | 5 ++++- osu.Game.Mode.Osu/OsuScoreProcessor.cs | 5 ++++- osu.Game.Mode.Osu/Properties/AssemblyInfo.cs | 5 ++++- osu.Game.Mode.Osu/app.config | 5 +++++ osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj | 3 +++ osu.Game.Mode.Osu/packages.config | 5 +++++ osu.Game.Modes.Catch/OpenTK.dll.config | 5 +++++ osu.Game.Modes.Catch/Properties/AssemblyInfo.cs | 5 ++++- osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj | 3 +++ osu.Game.Modes.Catch/packages.config | 5 +++++ osu.Game.Modes.Mania/OpenTK.dll.config | 5 +++++ osu.Game.Modes.Mania/Properties/AssemblyInfo.cs | 5 ++++- osu.Game.Modes.Mania/app.config | 5 +++++ osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj | 3 +++ osu.Game.Modes.Mania/packages.config | 5 +++++ osu.Game.Modes.Taiko/OpenTK.dll.config | 5 +++++ osu.Game.Modes.Taiko/Properties/AssemblyInfo.cs | 5 ++++- osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj | 3 +++ osu.Game.Modes.Taiko/packages.config | 5 +++++ osu.Game/Beatmaps/Events/EventType.cs | 5 ++++- osu.Game/Beatmaps/Formats/BeatmapDecoder.cs | 5 ++++- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 5 ++++- osu.Game/Beatmaps/IO/ArchiveReader.cs | 5 ++++- osu.Game/Beatmaps/IO/OszArchiveReader.cs | 5 ++++- osu.Game/Database/BaseDifficulty.cs | 5 ++++- osu.Game/Database/BeatmapDatabase.cs | 5 ++++- osu.Game/Database/BeatmapInfo.cs | 5 ++++- osu.Game/Database/BeatmapSetInfo.cs | 5 ++++- osu.Game/Graphics/Containers/ParallaxContainer.cs | 5 ++++- osu.Game/Graphics/UserInterface/BackButton.cs | 4 ++-- osu.Game/Graphics/UserInterface/LoadingAnimation.cs | 5 ++++- osu.Game/Graphics/UserInterface/OsuButton.cs | 5 ++++- osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs | 5 ++++- osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs | 5 ++++- osu.Game/Modes/PlayMode.cs | 1 - osu.Game/Online/API/Requests/GetUserRequest.cs | 1 - osu.Game/OsuGameBase.cs | 4 ++-- osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs | 5 ++++- osu.Game/Overlays/Options/Audio/AudioSection.cs | 5 ++++- osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs | 5 ++++- osu.Game/Overlays/Options/Audio/VolumeOptions.cs | 5 ++++- osu.Game/Overlays/Options/CheckBoxOption.cs | 5 ++++- osu.Game/Overlays/Options/EditorSection.cs | 5 ++++- osu.Game/Overlays/Options/Gameplay/GameplaySection.cs | 5 ++++- .../Overlays/Options/Gameplay/GeneralGameplayOptions.cs | 5 ++++- .../Overlays/Options/Gameplay/SongSelectGameplayOptions.cs | 5 ++++- osu.Game/Overlays/Options/General/GeneralSection.cs | 5 ++++- osu.Game/Overlays/Options/General/LanguageOptions.cs | 5 ++++- osu.Game/Overlays/Options/General/LoginOptions.cs | 5 ++++- osu.Game/Overlays/Options/General/UpdateOptions.cs | 5 ++++- osu.Game/Overlays/Options/Graphics/DetailOptions.cs | 4 ++-- osu.Game/Overlays/Options/Graphics/GraphicsSection.cs | 5 ++++- osu.Game/Overlays/Options/Graphics/LayoutOptions.cs | 5 ++++- osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs | 5 ++++- osu.Game/Overlays/Options/Graphics/RendererOptions.cs | 5 ++++- .../Overlays/Options/Graphics/SongSelectGraphicsOptions.cs | 5 ++++- osu.Game/Overlays/Options/Input/InputSection.cs | 5 ++++- osu.Game/Overlays/Options/Input/KeyboardOptions.cs | 5 ++++- osu.Game/Overlays/Options/Input/MouseOptions.cs | 5 ++++- osu.Game/Overlays/Options/Input/OtherInputOptions.cs | 5 ++++- osu.Game/Overlays/Options/MaintenanceSection.cs | 5 ++++- osu.Game/Overlays/Options/Online/InGameChatOptions.cs | 5 ++++- osu.Game/Overlays/Options/Online/NotificationsOptions.cs | 5 ++++- .../Overlays/Options/Online/OnlineIntegrationOptions.cs | 5 ++++- osu.Game/Overlays/Options/Online/OnlineSection.cs | 5 ++++- osu.Game/Overlays/Options/Online/PrivacyOptions.cs | 5 ++++- osu.Game/Overlays/Options/OptionsSection.cs | 5 ++++- osu.Game/Overlays/Options/OptionsSidebar.cs | 5 ++++- osu.Game/Overlays/Options/OptionsSubsection.cs | 5 ++++- osu.Game/Overlays/Options/SidebarButton.cs | 5 ++++- osu.Game/Overlays/Options/SkinSection.cs | 5 ++++- osu.Game/Overlays/Options/TextBoxOption.cs | 5 ++++- osu.Game/Screens/Menu/Button.cs | 5 ++++- osu.Game/Screens/Menu/FlowContainerWithOrigin.cs | 5 ++++- osu.Game/Screens/Menu/MenuVisualisation.cs | 5 ++++- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 5 ++++- osu.Game/Screens/Select/CarouselContainer.cs | 6 +++--- osu.Game/packages.config | 1 + 97 files changed, 372 insertions(+), 88 deletions(-) diff --git a/osu.Desktop.VisualTests/OpenTK.dll.config b/osu.Desktop.VisualTests/OpenTK.dll.config index 5620e3d9e2..1dd145f0c4 100644 --- a/osu.Desktop.VisualTests/OpenTK.dll.config +++ b/osu.Desktop.VisualTests/OpenTK.dll.config @@ -1,3 +1,8 @@ + + diff --git a/osu.Desktop.VisualTests/Platform/TestStorage.cs b/osu.Desktop.VisualTests/Platform/TestStorage.cs index 2a6b5a787c..95b767a852 100644 --- a/osu.Desktop.VisualTests/Platform/TestStorage.cs +++ b/osu.Desktop.VisualTests/Platform/TestStorage.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Desktop.Platform; using SQLite.Net; using SQLite.Net.Interop; diff --git a/osu.Desktop.VisualTests/Program.cs b/osu.Desktop.VisualTests/Program.cs index f099f6c1a8..c4f5075ef9 100644 --- a/osu.Desktop.VisualTests/Program.cs +++ b/osu.Desktop.VisualTests/Program.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2016 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using osu.Framework.Desktop; diff --git a/osu.Desktop.VisualTests/VisualTestGame.cs b/osu.Desktop.VisualTests/VisualTestGame.cs index 0dc260e1fd..fb949cf1ea 100644 --- a/osu.Desktop.VisualTests/VisualTestGame.cs +++ b/osu.Desktop.VisualTests/VisualTestGame.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2016 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework; using osu.Framework.GameModes.Testing; diff --git a/osu.Desktop.VisualTests/packages.config b/osu.Desktop.VisualTests/packages.config index 720b1d8382..f39a585e49 100644 --- a/osu.Desktop.VisualTests/packages.config +++ b/osu.Desktop.VisualTests/packages.config @@ -1,4 +1,9 @@  + + diff --git a/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs b/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs index 12afbddcc1..b7f727f8fd 100644 --- a/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs +++ b/osu.Desktop/Beatmaps/IO/LegacyFilesystemReader.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.IO; using System.Collections.Generic; using System.Linq; diff --git a/osu.Game.Mode.Osu/Objects/BezierApproximator.cs b/osu.Game.Mode.Osu/Objects/BezierApproximator.cs index f08b7aa377..9a4be51240 100644 --- a/osu.Game.Mode.Osu/Objects/BezierApproximator.cs +++ b/osu.Game.Mode.Osu/Objects/BezierApproximator.cs @@ -1,4 +1,7 @@ -using System.Collections.Generic; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; using OpenTK; namespace osu.Game.Modes.Osu.Objects diff --git a/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs b/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs index 43a8aa1f92..ee86df04f7 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs @@ -1,4 +1,7 @@ -using osu.Framework.Extensions; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/ApproachCircle.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/ApproachCircle.cs index 0932fef28f..356a6c1c35 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/ApproachCircle.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/ApproachCircle.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/CirclePiece.cs index fd55a8315a..7cfd0d43ab 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/CirclePiece.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/ExplodePiece.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/ExplodePiece.cs index 20277f243a..6f9e2a979a 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/ExplodePiece.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/ExplodePiece.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using OpenTK; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/FlashPiece.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/FlashPiece.cs index 60ff8d5595..7ae3306be7 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/FlashPiece.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/FlashPiece.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using OpenTK; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/GlowPiece.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/GlowPiece.cs index 9a8118acbd..a9e1c9c369 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/GlowPiece.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/GlowPiece.cs @@ -1,4 +1,7 @@ -using osu.Framework.Allocation; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/NumberPiece.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/NumberPiece.cs index b005c7daae..0c5d2e9186 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/NumberPiece.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/NumberPiece.cs @@ -1,4 +1,7 @@ -using osu.Framework.Allocation; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/RingPiece.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/RingPiece.cs index 188346ce9d..c5fdbbfdfb 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/RingPiece.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/RingPiece.cs @@ -1,4 +1,7 @@ -using osu.Framework.Allocation; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/Triangles.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/Triangles.cs index 3ef13792de..95f25c43d1 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/Triangles.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/Triangles.cs @@ -1,4 +1,7 @@ -using osu.Framework.Allocation; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs b/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs index 932a997769..216c40b779 100644 --- a/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs +++ b/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/osu.Game.Mode.Osu/Objects/SliderCurve.cs b/osu.Game.Mode.Osu/Objects/SliderCurve.cs index d80a441daf..e8df4049f5 100644 --- a/osu.Game.Mode.Osu/Objects/SliderCurve.cs +++ b/osu.Game.Mode.Osu/Objects/SliderCurve.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2016 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using OpenTK; diff --git a/osu.Game.Mode.Osu/OpenTK.dll.config b/osu.Game.Mode.Osu/OpenTK.dll.config index 5620e3d9e2..1dd145f0c4 100644 --- a/osu.Game.Mode.Osu/OpenTK.dll.config +++ b/osu.Game.Mode.Osu/OpenTK.dll.config @@ -1,3 +1,8 @@ + + diff --git a/osu.Game.Mode.Osu/OsuScore.cs b/osu.Game.Mode.Osu/OsuScore.cs index 5a70cea434..d08f75fecf 100644 --- a/osu.Game.Mode.Osu/OsuScore.cs +++ b/osu.Game.Mode.Osu/OsuScore.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/osu.Game.Mode.Osu/OsuScoreProcessor.cs b/osu.Game.Mode.Osu/OsuScoreProcessor.cs index a5ebda6834..572506050b 100644 --- a/osu.Game.Mode.Osu/OsuScoreProcessor.cs +++ b/osu.Game.Mode.Osu/OsuScoreProcessor.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/osu.Game.Mode.Osu/Properties/AssemblyInfo.cs b/osu.Game.Mode.Osu/Properties/AssemblyInfo.cs index 1b0664acf5..81c3d6298a 100644 --- a/osu.Game.Mode.Osu/Properties/AssemblyInfo.cs +++ b/osu.Game.Mode.Osu/Properties/AssemblyInfo.cs @@ -1,4 +1,7 @@ -using System.Reflection; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/osu.Game.Mode.Osu/app.config b/osu.Game.Mode.Osu/app.config index 757f23cb22..c42343ec69 100644 --- a/osu.Game.Mode.Osu/app.config +++ b/osu.Game.Mode.Osu/app.config @@ -1,4 +1,9 @@ + + diff --git a/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj index ba6e714e0a..a8cfa38cae 100644 --- a/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj +++ b/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj @@ -81,6 +81,9 @@ + + osu.licenseheader + diff --git a/osu.Game.Mode.Osu/packages.config b/osu.Game.Mode.Osu/packages.config index e1adbd7260..10451d4b70 100644 --- a/osu.Game.Mode.Osu/packages.config +++ b/osu.Game.Mode.Osu/packages.config @@ -1,4 +1,9 @@  + + \ No newline at end of file diff --git a/osu.Game.Modes.Catch/OpenTK.dll.config b/osu.Game.Modes.Catch/OpenTK.dll.config index 5620e3d9e2..1dd145f0c4 100644 --- a/osu.Game.Modes.Catch/OpenTK.dll.config +++ b/osu.Game.Modes.Catch/OpenTK.dll.config @@ -1,3 +1,8 @@ + + diff --git a/osu.Game.Modes.Catch/Properties/AssemblyInfo.cs b/osu.Game.Modes.Catch/Properties/AssemblyInfo.cs index 4f0e60baaf..6dbfcd99a8 100644 --- a/osu.Game.Modes.Catch/Properties/AssemblyInfo.cs +++ b/osu.Game.Modes.Catch/Properties/AssemblyInfo.cs @@ -1,4 +1,7 @@ -using System.Reflection; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj index 1db852e438..219175dd2b 100644 --- a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj +++ b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj @@ -57,6 +57,9 @@ + + osu.licenseheader + diff --git a/osu.Game.Modes.Catch/packages.config b/osu.Game.Modes.Catch/packages.config index 4da07d9f06..3c9e7e3fdc 100644 --- a/osu.Game.Modes.Catch/packages.config +++ b/osu.Game.Modes.Catch/packages.config @@ -1,4 +1,9 @@  + + \ No newline at end of file diff --git a/osu.Game.Modes.Mania/OpenTK.dll.config b/osu.Game.Modes.Mania/OpenTK.dll.config index 5620e3d9e2..1dd145f0c4 100644 --- a/osu.Game.Modes.Mania/OpenTK.dll.config +++ b/osu.Game.Modes.Mania/OpenTK.dll.config @@ -1,3 +1,8 @@ + + diff --git a/osu.Game.Modes.Mania/Properties/AssemblyInfo.cs b/osu.Game.Modes.Mania/Properties/AssemblyInfo.cs index 0ac2657410..57e1595715 100644 --- a/osu.Game.Modes.Mania/Properties/AssemblyInfo.cs +++ b/osu.Game.Modes.Mania/Properties/AssemblyInfo.cs @@ -1,4 +1,7 @@ -using System.Reflection; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/osu.Game.Modes.Mania/app.config b/osu.Game.Modes.Mania/app.config index 44ccc4b77a..9bad888bf3 100644 --- a/osu.Game.Modes.Mania/app.config +++ b/osu.Game.Modes.Mania/app.config @@ -1,4 +1,9 @@  + + diff --git a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj b/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj index 2ccfff5dcd..89c8978bbf 100644 --- a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj +++ b/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj @@ -75,6 +75,9 @@ + + osu.licenseheader + diff --git a/osu.Game.Modes.Mania/packages.config b/osu.Game.Modes.Mania/packages.config index 4da07d9f06..3c9e7e3fdc 100644 --- a/osu.Game.Modes.Mania/packages.config +++ b/osu.Game.Modes.Mania/packages.config @@ -1,4 +1,9 @@  + + \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/OpenTK.dll.config b/osu.Game.Modes.Taiko/OpenTK.dll.config index 5620e3d9e2..1dd145f0c4 100644 --- a/osu.Game.Modes.Taiko/OpenTK.dll.config +++ b/osu.Game.Modes.Taiko/OpenTK.dll.config @@ -1,3 +1,8 @@ + + diff --git a/osu.Game.Modes.Taiko/Properties/AssemblyInfo.cs b/osu.Game.Modes.Taiko/Properties/AssemblyInfo.cs index fe4ac44ab7..6aef41bbf8 100644 --- a/osu.Game.Modes.Taiko/Properties/AssemblyInfo.cs +++ b/osu.Game.Modes.Taiko/Properties/AssemblyInfo.cs @@ -1,4 +1,7 @@ -using System.Reflection; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index d49c3c2466..ab8bc674d8 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -55,6 +55,9 @@ + + osu.licenseheader + diff --git a/osu.Game.Modes.Taiko/packages.config b/osu.Game.Modes.Taiko/packages.config index 4da07d9f06..3c9e7e3fdc 100644 --- a/osu.Game.Modes.Taiko/packages.config +++ b/osu.Game.Modes.Taiko/packages.config @@ -1,4 +1,9 @@  + + \ No newline at end of file diff --git a/osu.Game/Beatmaps/Events/EventType.cs b/osu.Game/Beatmaps/Events/EventType.cs index 1f7e8d2aa5..a982366401 100644 --- a/osu.Game/Beatmaps/Events/EventType.cs +++ b/osu.Game/Beatmaps/Events/EventType.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; namespace osu.Game.Beatmaps.Events { public enum EventType diff --git a/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs index b5dd0c995e..83cd60eca3 100644 --- a/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/BeatmapDecoder.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Collections.Generic; using System.IO; using osu.Game.Modes.Objects; diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index b1eaeb467d..12a26dafa8 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Collections.Generic; using System.Globalization; using System.IO; diff --git a/osu.Game/Beatmaps/IO/ArchiveReader.cs b/osu.Game/Beatmaps/IO/ArchiveReader.cs index a052b9eb0d..ca90b424a6 100644 --- a/osu.Game/Beatmaps/IO/ArchiveReader.cs +++ b/osu.Game/Beatmaps/IO/ArchiveReader.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Collections.Generic; using System.IO; using osu.Framework.IO.Stores; diff --git a/osu.Game/Beatmaps/IO/OszArchiveReader.cs b/osu.Game/Beatmaps/IO/OszArchiveReader.cs index 85ee2d19b9..14738802f6 100644 --- a/osu.Game/Beatmaps/IO/OszArchiveReader.cs +++ b/osu.Game/Beatmaps/IO/OszArchiveReader.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.IO; using System.Linq; using System.Security.Cryptography; diff --git a/osu.Game/Database/BaseDifficulty.cs b/osu.Game/Database/BaseDifficulty.cs index 265f933045..07bf971280 100644 --- a/osu.Game/Database/BaseDifficulty.cs +++ b/osu.Game/Database/BaseDifficulty.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using SQLite.Net.Attributes; namespace osu.Game.Database diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index 4bdfa1e275..896e742989 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Collections; using System.Collections.Generic; using System.IO; diff --git a/osu.Game/Database/BeatmapInfo.cs b/osu.Game/Database/BeatmapInfo.cs index 736f8b9927..be47891016 100644 --- a/osu.Game/Database/BeatmapInfo.cs +++ b/osu.Game/Database/BeatmapInfo.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Linq; using osu.Game.Beatmaps.Samples; using osu.Game.Modes; diff --git a/osu.Game/Database/BeatmapSetInfo.cs b/osu.Game/Database/BeatmapSetInfo.cs index 6dc0adfa01..0a83753963 100644 --- a/osu.Game/Database/BeatmapSetInfo.cs +++ b/osu.Game/Database/BeatmapSetInfo.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Collections.Generic; using SQLite.Net.Attributes; using SQLiteNetExtensions.Attributes; diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 5cc8a4097b..3e38ac0f09 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics.Containers; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.Containers; using osu.Framework.Graphics; using osu.Framework.Input; using OpenTK; diff --git a/osu.Game/Graphics/UserInterface/BackButton.cs b/osu.Game/Graphics/UserInterface/BackButton.cs index bd7ccfdb97..ade6cedc58 100644 --- a/osu.Game/Graphics/UserInterface/BackButton.cs +++ b/osu.Game/Graphics/UserInterface/BackButton.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2016 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Framework.Audio; diff --git a/osu.Game/Graphics/UserInterface/LoadingAnimation.cs b/osu.Game/Graphics/UserInterface/LoadingAnimation.cs index 2edc5397f4..49887dd8db 100644 --- a/osu.Game/Graphics/UserInterface/LoadingAnimation.cs +++ b/osu.Game/Graphics/UserInterface/LoadingAnimation.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using osu.Framework.Graphics.Sprites; namespace osu.Game.Graphics.UserInterface diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index fea9f907bc..476895e0b2 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using OpenTK.Graphics; using osu.Framework.Graphics.UserInterface; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 13accc4914..cfc6b3a1c7 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using osu.Framework; using osu.Framework.Configuration; using osu.Framework.Graphics; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs index 4416a1da80..37259289ce 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; diff --git a/osu.Game/Modes/PlayMode.cs b/osu.Game/Modes/PlayMode.cs index d1b0f23ee4..0d78436d9f 100644 --- a/osu.Game/Modes/PlayMode.cs +++ b/osu.Game/Modes/PlayMode.cs @@ -1,7 +1,6 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - using System.ComponentModel; namespace osu.Game.Modes diff --git a/osu.Game/Online/API/Requests/GetUserRequest.cs b/osu.Game/Online/API/Requests/GetUserRequest.cs index 1f6da1e1de..22b5f32ffd 100644 --- a/osu.Game/Online/API/Requests/GetUserRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserRequest.cs @@ -1,7 +1,6 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - namespace osu.Game.Online.API.Requests { public class GetUserRequest : APIRequest diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 4db582d799..7c1f620c93 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2016 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework; using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs b/osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs index fb0a227d08..5ad57bef53 100644 --- a/osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs +++ b/osu.Game/Overlays/Options/Audio/AudioDevicesOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics.Sprites; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.Sprites; namespace osu.Game.Overlays.Options.Audio { diff --git a/osu.Game/Overlays/Options/Audio/AudioSection.cs b/osu.Game/Overlays/Options/Audio/AudioSection.cs index 59fbda58c9..6b55944a5c 100644 --- a/osu.Game/Overlays/Options/Audio/AudioSection.cs +++ b/osu.Game/Overlays/Options/Audio/AudioSection.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Graphics; using osu.Game.Graphics; diff --git a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs index 9bb8fb30e8..29cf7ef589 100644 --- a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs +++ b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs index c8dac502f3..2216602a5f 100644 --- a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs +++ b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game/Overlays/Options/CheckBoxOption.cs b/osu.Game/Overlays/Options/CheckBoxOption.cs index ca346b1dd0..2ea176378c 100644 --- a/osu.Game/Overlays/Options/CheckBoxOption.cs +++ b/osu.Game/Overlays/Options/CheckBoxOption.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Audio; diff --git a/osu.Game/Overlays/Options/EditorSection.cs b/osu.Game/Overlays/Options/EditorSection.cs index bdd7c87431..9d7d9bde95 100644 --- a/osu.Game/Overlays/Options/EditorSection.cs +++ b/osu.Game/Overlays/Options/EditorSection.cs @@ -1,4 +1,7 @@ -using OpenTK; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Options/Gameplay/GameplaySection.cs b/osu.Game/Overlays/Options/Gameplay/GameplaySection.cs index af4728e0e2..3216d55837 100644 --- a/osu.Game/Overlays/Options/Gameplay/GameplaySection.cs +++ b/osu.Game/Overlays/Options/Gameplay/GameplaySection.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Game.Graphics; namespace osu.Game.Overlays.Options.Gameplay diff --git a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs index fe6f118643..d8fc71fb02 100644 --- a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs index b268fdcc5f..2a650ee177 100644 --- a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; namespace osu.Game.Overlays.Options.Gameplay diff --git a/osu.Game/Overlays/Options/General/GeneralSection.cs b/osu.Game/Overlays/Options/General/GeneralSection.cs index a9cea62270..d91734db1f 100644 --- a/osu.Game/Overlays/Options/General/GeneralSection.cs +++ b/osu.Game/Overlays/Options/General/GeneralSection.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Game.Graphics; namespace osu.Game.Overlays.Options.General diff --git a/osu.Game/Overlays/Options/General/LanguageOptions.cs b/osu.Game/Overlays/Options/General/LanguageOptions.cs index e9009836ab..351d541bd9 100644 --- a/osu.Game/Overlays/Options/General/LanguageOptions.cs +++ b/osu.Game/Overlays/Options/General/LanguageOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Options/General/LoginOptions.cs b/osu.Game/Overlays/Options/General/LoginOptions.cs index 94eb6b1c01..03789c59c9 100644 --- a/osu.Game/Overlays/Options/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/General/LoginOptions.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using OpenTK; using osu.Framework; using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Options/General/UpdateOptions.cs b/osu.Game/Overlays/Options/General/UpdateOptions.cs index 8e68b26c1c..f7dfc2d813 100644 --- a/osu.Game/Overlays/Options/General/UpdateOptions.cs +++ b/osu.Game/Overlays/Options/General/UpdateOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game/Overlays/Options/Graphics/DetailOptions.cs b/osu.Game/Overlays/Options/Graphics/DetailOptions.cs index 880677ff6a..a885b99b1c 100644 --- a/osu.Game/Overlays/Options/Graphics/DetailOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/DetailOptions.cs @@ -1,5 +1,5 @@ -// Copyright (c) 2007-2016 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Options/Graphics/GraphicsSection.cs b/osu.Game/Overlays/Options/Graphics/GraphicsSection.cs index ec0091edde..9c8c8043bf 100644 --- a/osu.Game/Overlays/Options/Graphics/GraphicsSection.cs +++ b/osu.Game/Overlays/Options/Graphics/GraphicsSection.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Game.Graphics; namespace osu.Game.Overlays.Options.Graphics diff --git a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs index c71c5f8cae..06e2be25d1 100644 --- a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs b/osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs index 8b1903e508..58f1bfb3b7 100644 --- a/osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/MainMenuOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; diff --git a/osu.Game/Overlays/Options/Graphics/RendererOptions.cs b/osu.Game/Overlays/Options/Graphics/RendererOptions.cs index bb46718bb6..b9d81944d4 100644 --- a/osu.Game/Overlays/Options/Graphics/RendererOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/RendererOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs b/osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs index cda97f6eb3..0dee3544a1 100644 --- a/osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/SongSelectGraphicsOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics.UserInterface; using osu.Game.Configuration; diff --git a/osu.Game/Overlays/Options/Input/InputSection.cs b/osu.Game/Overlays/Options/Input/InputSection.cs index 1bbf1ece38..c436a7439f 100644 --- a/osu.Game/Overlays/Options/Input/InputSection.cs +++ b/osu.Game/Overlays/Options/Input/InputSection.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Game.Graphics; namespace osu.Game.Overlays.Options.Input diff --git a/osu.Game/Overlays/Options/Input/KeyboardOptions.cs b/osu.Game/Overlays/Options/Input/KeyboardOptions.cs index cea5cf3b7a..521dfb88e6 100644 --- a/osu.Game/Overlays/Options/Input/KeyboardOptions.cs +++ b/osu.Game/Overlays/Options/Input/KeyboardOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options.Input diff --git a/osu.Game/Overlays/Options/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Input/MouseOptions.cs index c2887fe4c0..4e57d262f6 100644 --- a/osu.Game/Overlays/Options/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Input/MouseOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game/Overlays/Options/Input/OtherInputOptions.cs b/osu.Game/Overlays/Options/Input/OtherInputOptions.cs index d9cb8bb38f..02eb17c9b4 100644 --- a/osu.Game/Overlays/Options/Input/OtherInputOptions.cs +++ b/osu.Game/Overlays/Options/Input/OtherInputOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Options/MaintenanceSection.cs b/osu.Game/Overlays/Options/MaintenanceSection.cs index a76d338592..dcd90b8e50 100644 --- a/osu.Game/Overlays/Options/MaintenanceSection.cs +++ b/osu.Game/Overlays/Options/MaintenanceSection.cs @@ -1,4 +1,7 @@ -using OpenTK; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; diff --git a/osu.Game/Overlays/Options/Online/InGameChatOptions.cs b/osu.Game/Overlays/Options/Online/InGameChatOptions.cs index 91df397445..098fe39546 100644 --- a/osu.Game/Overlays/Options/Online/InGameChatOptions.cs +++ b/osu.Game/Overlays/Options/Online/InGameChatOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game/Overlays/Options/Online/NotificationsOptions.cs b/osu.Game/Overlays/Options/Online/NotificationsOptions.cs index dc08277b8e..1648d23528 100644 --- a/osu.Game/Overlays/Options/Online/NotificationsOptions.cs +++ b/osu.Game/Overlays/Options/Online/NotificationsOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs b/osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs index ea009e81ad..4799c5d5ca 100644 --- a/osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs +++ b/osu.Game/Overlays/Options/Online/OnlineIntegrationOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Options/Online/OnlineSection.cs b/osu.Game/Overlays/Options/Online/OnlineSection.cs index a29f18d768..d07c6e89df 100644 --- a/osu.Game/Overlays/Options/Online/OnlineSection.cs +++ b/osu.Game/Overlays/Options/Online/OnlineSection.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Game.Graphics; namespace osu.Game.Overlays.Options.Online diff --git a/osu.Game/Overlays/Options/Online/PrivacyOptions.cs b/osu.Game/Overlays/Options/Online/PrivacyOptions.cs index 38cfab321d..ac654cb3d4 100644 --- a/osu.Game/Overlays/Options/Online/PrivacyOptions.cs +++ b/osu.Game/Overlays/Options/Online/PrivacyOptions.cs @@ -1,4 +1,7 @@ -using osu.Framework; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs index 739504da80..256d5c8218 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Options/OptionsSection.cs @@ -1,4 +1,7 @@ -using OpenTK; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; diff --git a/osu.Game/Overlays/Options/OptionsSidebar.cs b/osu.Game/Overlays/Options/OptionsSidebar.cs index d4b64a5d60..201d7878ab 100644 --- a/osu.Game/Overlays/Options/OptionsSidebar.cs +++ b/osu.Game/Overlays/Options/OptionsSidebar.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Options/OptionsSubsection.cs b/osu.Game/Overlays/Options/OptionsSubsection.cs index ad98549e9e..b7b1ff4570 100644 --- a/osu.Game/Overlays/Options/OptionsSubsection.cs +++ b/osu.Game/Overlays/Options/OptionsSubsection.cs @@ -1,4 +1,7 @@ -using OpenTK; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; diff --git a/osu.Game/Overlays/Options/SidebarButton.cs b/osu.Game/Overlays/Options/SidebarButton.cs index 82a55e3fe5..a1edc997a1 100644 --- a/osu.Game/Overlays/Options/SidebarButton.cs +++ b/osu.Game/Overlays/Options/SidebarButton.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Options/SkinSection.cs b/osu.Game/Overlays/Options/SkinSection.cs index 814e0d56c2..e552b54160 100644 --- a/osu.Game/Overlays/Options/SkinSection.cs +++ b/osu.Game/Overlays/Options/SkinSection.cs @@ -1,4 +1,7 @@ -using OpenTK; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Options/TextBoxOption.cs b/osu.Game/Overlays/Options/TextBoxOption.cs index ffd9c86b71..c0ac08d149 100644 --- a/osu.Game/Overlays/Options/TextBoxOption.cs +++ b/osu.Game/Overlays/Options/TextBoxOption.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using osu.Framework.Configuration; using osu.Framework.Graphics.UserInterface; diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index 92bbf0da68..28158457dd 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Audio; diff --git a/osu.Game/Screens/Menu/FlowContainerWithOrigin.cs b/osu.Game/Screens/Menu/FlowContainerWithOrigin.cs index cb6bc26b8a..5d99158b7a 100644 --- a/osu.Game/Screens/Menu/FlowContainerWithOrigin.cs +++ b/osu.Game/Screens/Menu/FlowContainerWithOrigin.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using OpenTK; using System.Collections.Generic; diff --git a/osu.Game/Screens/Menu/MenuVisualisation.cs b/osu.Game/Screens/Menu/MenuVisualisation.cs index 194b0eee02..48a1ff532d 100644 --- a/osu.Game/Screens/Menu/MenuVisualisation.cs +++ b/osu.Game/Screens/Menu/MenuVisualisation.cs @@ -1,4 +1,7 @@ -using osu.Framework.Graphics; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; namespace osu.Game.Screens.Menu { diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 203d290fc3..81cd55d429 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using osu.Framework; using osu.Framework.Allocation; using OpenTK; diff --git a/osu.Game/Screens/Select/CarouselContainer.cs b/osu.Game/Screens/Select/CarouselContainer.cs index 98bcf093af..069c8d8d37 100644 --- a/osu.Game/Screens/Select/CarouselContainer.cs +++ b/osu.Game/Screens/Select/CarouselContainer.cs @@ -1,6 +1,6 @@ -//Copyright (c) 2007-2016 ppy Pty Ltd . -//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + using OpenTK; using osu.Framework.Caching; using osu.Framework.Graphics; diff --git a/osu.Game/packages.config b/osu.Game/packages.config index 30ac6bb021..98448d402f 100644 --- a/osu.Game/packages.config +++ b/osu.Game/packages.config @@ -3,6 +3,7 @@ Copyright (c) 2007-2016 ppy Pty Ltd . Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE --> + From 4042a9e71edf1bf93c12fdc3c1b9d58ac2ace423 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Dec 2016 18:54:32 +0900 Subject: [PATCH 12/79] Add preliminary (correctly) textured sliders; split out components into their own files. --- .../Objects/Drawables/DrawableOsuHitObject.cs | 11 +- .../Objects/Drawables/DrawableSlider.cs | 274 ++---------------- .../Objects/Drawables/Pieces/SliderBall.cs | 107 +++++++ .../Objects/Drawables/Pieces/SliderBody.cs | 204 +++++++++++++ osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj | 2 + 5 files changed, 347 insertions(+), 251 deletions(-) create mode 100644 osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs create mode 100644 osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 80e1f2bb7f..dca9ac9b28 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; @@ -11,9 +14,9 @@ namespace osu.Game.Modes.Osu.Objects.Drawables { public class DrawableOsuHitObject : DrawableHitObject { - protected const float TIME_PREEMPT = 600; - protected const float TIME_FADEIN = 400; - protected const float TIME_FADEOUT = 500; + public const float TIME_PREEMPT = 600; + public const float TIME_FADEIN = 400; + public const float TIME_FADEOUT = 500; public DrawableOsuHitObject(OsuHitObject hitObject) : base(hitObject) diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index f41b88b21f..e93ebba366 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -1,21 +1,11 @@ -// Copyright (c) 2007-2016 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Osu.Objects.Drawables.Pieces; using OpenTK; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Transformations; -using OpenTK.Graphics; -using osu.Framework.Input; -using OpenTK.Graphics.ES30; -using osu.Framework.Allocation; -using osu.Framework.Graphics.Textures; -using osu.Game.Configuration; -using osu.Framework.Configuration; -using System; namespace osu.Game.Modes.Osu.Objects.Drawables { @@ -24,11 +14,14 @@ namespace osu.Game.Modes.Osu.Objects.Drawables private Slider slider; private DrawableHitCircle startCircle; - private Container ball; - private Body body; + + private List components = new List(); public DrawableSlider(Slider s) : base(s) { + SliderBody body; + SliderBall ball; + slider = s; Origin = Anchor.TopLeft; @@ -37,11 +30,12 @@ namespace osu.Game.Modes.Osu.Objects.Drawables Children = new Drawable[] { - body = new Body(s) + body = new SliderBody(s) { Position = s.Position, + PathWidth = 36, }, - ball = new Ball(), + ball = new SliderBall(slider), startCircle = new DrawableHitCircle(new HitCircle { StartTime = s.StartTime, @@ -52,75 +46,24 @@ namespace osu.Game.Modes.Osu.Objects.Drawables Depth = -1 //override time-based depth. }, }; - } - private Bindable snakingIn; - private Bindable snakingOut; - - [BackgroundDependencyLoader] - private void load(OsuConfigManager config) - { - snakingIn = config.GetBindable(OsuConfig.SnakingInSliders); - snakingOut = config.GetBindable(OsuConfig.SnakingOutSliders); - } - - protected override void LoadComplete() - { - base.LoadComplete(); - - - body.PathWidth = 32; - } - - private void computeProgress(out int repeat, out double progress) - { - progress = MathHelper.Clamp((Time.Current - slider.StartTime) / slider.Duration, 0, 1); - - repeat = (int)(progress * slider.RepeatCount); - progress = (progress * slider.RepeatCount) % 1; - - if (repeat % 2 == 1) - progress = 1 - progress; - } - - private void updateBall(double progress) - { - ball.Alpha = Time.Current >= slider.StartTime && Time.Current <= slider.EndTime ? 1 : 0; - ball.Position = slider.Curve.PositionAt(progress); - } - - private void updateBody(int repeat, double progress) - { - double start = 0; - double end = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - TIME_PREEMPT)) / TIME_FADEIN, 0, 1) : 1; - - if (repeat >= slider.RepeatCount - 1) - { - if (Math.Min(repeat, slider.RepeatCount - 1) % 2 == 1) - { - start = 0; - end = snakingOut ? progress : 1; - } - else - { - start = snakingOut ? progress : 0; - end = 1; - } - } - - body.SetRange(start, end); + components.Add(body); + components.Add(ball); } protected override void Update() { base.Update(); - double progress; - int repeat; - computeProgress(out repeat, out progress); + double progress = MathHelper.Clamp((Time.Current - slider.StartTime) / slider.Duration, 0, 1); - updateBall(progress); - updateBody(repeat, progress); + int repeat = (int)(progress * slider.RepeatCount); + progress = (progress * slider.RepeatCount) % 1; + + if (repeat % 2 == 1) + progress = 1 - progress; + + components.ForEach(c => c.UpdateProgress(progress, repeat)); } protected override void CheckJudgement(bool userTriggered) @@ -142,173 +85,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables Delay(HitObject.Duration); FadeOut(300); } - - private class Ball : Container - { - private Box follow; - - public Ball() - { - Masking = true; - AutoSizeAxes = Axes.Both; - BlendingMode = BlendingMode.Additive; - Origin = Anchor.Centre; - - Children = new Drawable[] - { - follow = new Box - { - Origin = Anchor.Centre, - Anchor = Anchor.Centre, - Colour = Color4.Orange, - Width = 64, - Height = 64, - }, - new Container - { - Masking = true, - AutoSizeAxes = Axes.Both, - Origin = Anchor.Centre, - Anchor = Anchor.Centre, - Colour = Color4.Cyan, - CornerRadius = 32, - Children = new[] - { - new Box - { - - Width = 64, - Height = 64, - }, - } - } - - }; - } - - private InputState lastState; - - protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) - { - lastState = state; - return base.OnMouseDown(state, args); - } - - protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) - { - lastState = state; - return base.OnMouseUp(state, args); - } - - protected override bool OnMouseMove(InputState state) - { - lastState = state; - return base.OnMouseMove(state); - } - - bool tracking; - protected bool Tracking - { - get { return tracking; } - set - { - if (value == tracking) return; - - tracking = value; - - follow.ScaleTo(tracking ? 2.4f : 1, 140, EasingTypes.Out); - follow.FadeTo(tracking ? 0.8f : 0, 140, EasingTypes.Out); - } - } - - protected override void Update() - { - base.Update(); - - CornerRadius = DrawWidth / 2; - Tracking = lastState != null && Contains(lastState.Mouse.NativeState.Position) && lastState.Mouse.HasMainButtonPressed; - } - } - - private class Body : Container - { - private Path path; - private BufferedContainer container; - - public float PathWidth - { - get { return path.PathWidth; } - set { path.PathWidth = value; } - } - - private double? drawnProgressStart; - private double? drawnProgressEnd; - - private Slider slider; - public Body(Slider s) - { - slider = s; - - Children = new Drawable[] - { - container = new BufferedContainer - { - CacheDrawnFrameBuffer = true, - Children = new Drawable[] - { - path = new Path - { - Colour = s.Colour, - BlendingMode = BlendingMode.None, - }, - } - } - }; - - container.Attach(RenderbufferInternalFormat.DepthComponent16); - } - - [BackgroundDependencyLoader] - private void load(TextureStore textures) - { - // Surprisingly, this looks somewhat okay and works well as a test for self-overlaps. - // TODO: Don't do this. - path.Texture = textures.Get(@"Menu/logo"); - } - - public void SetRange(double p0, double p1) - { - if (p0 > p1) - MathHelper.Swap(ref p0, ref p1); - - if (updateSnaking(p0, p1)) - { - // Autosizing does not give us the desired behaviour here. - // We want the container to have the same size as the slider, - // and to be positioned such that the slider head is at (0,0). - container.Size = path.Size; - container.Position = -path.PositionInBoundingBox(slider.Curve.PositionAt(0) - currentCurve[0]); - - container.ForceRedraw(); - } - } - - private List currentCurve = new List(); - private bool updateSnaking(double p0, double p1) - { - if (drawnProgressStart == p0 && drawnProgressEnd == p1) return false; - - drawnProgressStart = p0; - drawnProgressEnd = p1; - - slider.Curve.GetPathToProgress(currentCurve, p0, p1); - - path.ClearVertices(); - foreach (Vector2 p in currentCurve) - path.AddVertex(p - currentCurve[0]); - - return true; - } - } } -} + + internal interface ISliderProgress + { + void UpdateProgress(double progress, int repeat); + } +} \ No newline at end of file diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs new file mode 100644 index 0000000000..f7765a5057 --- /dev/null +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -0,0 +1,107 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transformations; +using osu.Framework.Input; +using OpenTK.Graphics; + +namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +{ + public class SliderBall : Container, ISliderProgress + { + private readonly Slider slider; + private Box follow; + + public SliderBall(Slider slider) + { + this.slider = slider; + Masking = true; + AutoSizeAxes = Axes.Both; + BlendingMode = BlendingMode.Additive; + Origin = Anchor.Centre; + + Children = new Drawable[] + { + follow = new Box + { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + Colour = Color4.Orange, + Width = 64, + Height = 64, + }, + new Container + { + Masking = true, + AutoSizeAxes = Axes.Both, + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + Colour = Color4.Cyan, + CornerRadius = 32, + Children = new[] + { + new Box + { + + Width = 64, + Height = 64, + }, + } + } + + }; + } + + private InputState lastState; + + protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) + { + lastState = state; + return base.OnMouseDown(state, args); + } + + protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) + { + lastState = state; + return base.OnMouseUp(state, args); + } + + protected override bool OnMouseMove(InputState state) + { + lastState = state; + return base.OnMouseMove(state); + } + + bool tracking; + protected bool Tracking + { + get { return tracking; } + set + { + if (value == tracking) return; + + tracking = value; + + follow.ScaleTo(tracking ? 2.4f : 1, 140, EasingTypes.Out); + follow.FadeTo(tracking ? 0.8f : 0, 140, EasingTypes.Out); + } + } + + protected override void Update() + { + base.Update(); + + CornerRadius = DrawWidth / 2; + Tracking = lastState != null && Contains(lastState.Mouse.NativeState.Position) && lastState.Mouse.HasMainButtonPressed; + } + + public void UpdateProgress(double progress, int repeat) + { + Alpha = Time.Current >= slider.StartTime && Time.Current <= slider.EndTime ? 1 : 0; + Position = slider.Curve.PositionAt(progress); + } + } +} \ No newline at end of file diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs new file mode 100644 index 0000000000..354bf80619 --- /dev/null +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -0,0 +1,204 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using osu.Game.Configuration; +using OpenTK; +using OpenTK.Graphics; +using OpenTK.Graphics.ES30; + +namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +{ + public class SliderBody : Container, ISliderProgress + { + private Path path; + private BodyTexture pathTexture; + private BufferedContainer container; + + public float PathWidth + { + get { return path.PathWidth; } + set + { + path.PathWidth = value; + pathTexture.Size = new Vector2(value, 1); + } + } + + private double? drawnProgressStart; + private double? drawnProgressEnd; + + private Slider slider; + public SliderBody(Slider s) + { + slider = s; + + Children = new Drawable[] + { + pathTexture = new BodyTexture + { + MainColour = s.Colour + }, + container = new BufferedContainer + { + CacheDrawnFrameBuffer = true, + Children = new Drawable[] + { + path = new Path + { + BlendingMode = BlendingMode.None, + }, + } + }, + + }; + + container.Attach(RenderbufferInternalFormat.DepthComponent16); + } + + public void SetRange(double p0, double p1) + { + if (p0 > p1) + MathHelper.Swap(ref p0, ref p1); + + if (updateSnaking(p0, p1)) + { + // Autosizing does not give us the desired behaviour here. + // We want the container to have the same size as the slider, + // and to be positioned such that the slider head is at (0,0). + container.Size = path.Size; + container.Position = -path.PositionInBoundingBox(slider.Curve.PositionAt(0) - currentCurve[0]); + + container.ForceRedraw(); + } + } + + private Bindable snakingIn; + private Bindable snakingOut; + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + snakingIn = config.GetBindable(OsuConfig.SnakingInSliders); + snakingOut = config.GetBindable(OsuConfig.SnakingOutSliders); + } + + private List currentCurve = new List(); + private bool updateSnaking(double p0, double p1) + { + if (drawnProgressStart == p0 && drawnProgressEnd == p1) return false; + + drawnProgressStart = p0; + drawnProgressEnd = p1; + + slider.Curve.GetPathToProgress(currentCurve, p0, p1); + + path.ClearVertices(); + foreach (Vector2 p in currentCurve) + path.AddVertex(p - currentCurve[0]); + + return true; + } + + protected override void Update() + { + base.Update(); + + var texture = pathTexture.Texture; + if (texture != null) + { + path.Texture = texture; + pathTexture.Alpha = 0; + } + } + + public void UpdateProgress(double progress, int repeat) + { + double start = 0; + double end = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - DrawableOsuHitObject.TIME_PREEMPT)) / DrawableOsuHitObject.TIME_FADEIN, 0, 1) : 1; + + if (repeat >= slider.RepeatCount - 1) + { + if (Math.Min(repeat, slider.RepeatCount - 1) % 2 == 1) + { + start = 0; + end = snakingOut ? progress : 1; + } + else + { + start = snakingOut ? progress : 0; + } + } + + SetRange(start, end); + } + + public class BodyTexture : BufferedContainer + { + private Box gradientPortion; + private BufferedContainerDrawNode lastNode; + public Texture Texture => lastNode?.FrameBuffers[0].Texture != null ? new Texture(lastNode.FrameBuffers[0].Texture) : null; + + protected override void ApplyDrawNode(DrawNode node) + { + base.ApplyDrawNode(node); + lastNode = node as BufferedContainerDrawNode; + } + + public Color4 MainColour + { + set + { + gradientPortion.ColourInfo = ColourInfo.GradientHorizontal( + value, + new Color4(value.R, value.G, value.B, value.A * 0.4f) + ); + } + } + + public BodyTexture() + { + Children = new[] + { + new FlowContainer + { + RelativeSizeAxes = Axes.Both, + Direction = FlowDirection.HorizontalOnly, + Masking = true, + Children = new[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + ColourInfo = ColourInfo.GradientHorizontal( + new Color4(255, 255, 255, 0), + Color4.White + ), + Size = new Vector2(0.02f, 1), + }, + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White, + Size = new Vector2(0.13f, 1), + }, + gradientPortion = new Box + { + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.85f, 1), + }, + }, + } + }; + } + } + } +} \ No newline at end of file diff --git a/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj index ba6e714e0a..1f53c706cc 100644 --- a/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj +++ b/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj @@ -53,6 +53,8 @@ + + From ae72f91975aa946616368a4d58eb8c9c9f543105 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Dec 2016 21:14:38 +0900 Subject: [PATCH 13/79] Reshuffle hit explosions to be on their own layer. Style misses better. --- .../Objects/Drawables/DrawableHitCircle.cs | 11 ----- .../Objects/Drawables/DrawableSlider.cs | 2 +- .../Objects/Drawables/HitExplosion.cs | 42 ++++++++++++++++--- osu.Game.Mode.Osu/Objects/OsuHitObject.cs | 2 + osu.Game.Mode.Osu/Objects/Slider.cs | 3 ++ osu.Game.Mode.Osu/UI/OsuHitRenderer.cs | 1 - osu.Game.Mode.Osu/UI/OsuPlayfield.cs | 20 +++++++-- osu.Game/Modes/UI/Playfield.cs | 15 ++++++- 8 files changed, 72 insertions(+), 24 deletions(-) diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs index c9d2901930..b916a7bc74 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -22,7 +22,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables private ExplodePiece explode; private NumberPiece number; private GlowPiece glow; - private HitExplosion explosion; public DrawableHitCircle(OsuHitObject h) : base(h) { @@ -130,9 +129,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables case ArmedState.Idle: Delay(osuObject.Duration + TIME_PREEMPT); FadeOut(TIME_FADEOUT); - - explosion?.Expire(); - explosion = null; break; case ArmedState.Miss: ring.FadeOut(); @@ -140,11 +136,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables number.FadeOut(); glow.FadeOut(); - explosion?.Expire(); - explosion = null; - - Schedule(() => Add(explosion = new HitExplosion((OsuJudgementInfo)Judgement))); - FadeOut(800); break; case ArmedState.Hit: @@ -156,8 +147,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables explode.FadeIn(flash_in); - Schedule(() => Add(explosion = new HitExplosion((OsuJudgementInfo)Judgement))); - Delay(flash_in, true); //after the flash, we can hide some elements that were behind it diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index e93ebba366..34318d3cec 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -83,7 +83,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables base.UpdateState(state); Delay(HitObject.Duration); - FadeOut(300); + FadeOut(100); } } diff --git a/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs b/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs index 43a8aa1f92..a288e93068 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs @@ -5,22 +5,25 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Game.Modes.Objects.Drawables; using OpenTK; +using OpenTK.Graphics; namespace osu.Game.Modes.Osu.Objects.Drawables { public class HitExplosion : FlowContainer { + private readonly OsuJudgementInfo judgement; private SpriteText line1; private SpriteText line2; - public HitExplosion(OsuJudgementInfo judgement) + public HitExplosion(OsuJudgementInfo judgement, OsuHitObject h = null) { + this.judgement = judgement; AutoSizeAxes = Axes.Both; - Anchor = Anchor.Centre; Origin = Anchor.Centre; Direction = FlowDirection.VerticalOnly; Spacing = new Vector2(0, 2); + Position = (h?.EndPosition ?? Vector2.Zero) + judgement.PositionOffset; Children = new Drawable[] { @@ -30,13 +33,13 @@ namespace osu.Game.Modes.Osu.Objects.Drawables Origin = Anchor.TopCentre, Text = judgement.Score.GetDescription(), Font = @"Venera", - TextSize = 20, + TextSize = 16, }, line2 = new SpriteText { Text = judgement.Combo.GetDescription(), Font = @"Venera", - TextSize = 14, + TextSize = 11, } }; } @@ -44,8 +47,35 @@ namespace osu.Game.Modes.Osu.Objects.Drawables protected override void LoadComplete() { base.LoadComplete(); - line1.TransformSpacingTo(new Vector2(14, 0), 1800, EasingTypes.OutQuint); - line2.TransformSpacingTo(new Vector2(14, 0), 1800, EasingTypes.OutQuint); + + if (judgement.Result == HitResult.Miss) + { + FadeInFromZero(60); + + ScaleTo(1.6f); + ScaleTo(1, 100, EasingTypes.In); + + MoveToRelative(new Vector2(0, 100), 800, EasingTypes.InQuint); + RotateTo(40, 800, EasingTypes.InQuint); + + Delay(600); + FadeOut(200); + } + else + { + line1.TransformSpacingTo(new Vector2(14, 0), 1800, EasingTypes.OutQuint); + line2.TransformSpacingTo(new Vector2(14, 0), 1800, EasingTypes.OutQuint); + FadeOut(500); + } + + switch (judgement.Result) + { + case HitResult.Miss: + Colour = Color4.Red; + break; + } + + Expire(); } } } \ No newline at end of file diff --git a/osu.Game.Mode.Osu/Objects/OsuHitObject.cs b/osu.Game.Mode.Osu/Objects/OsuHitObject.cs index 35f24699f1..61932f80a3 100644 --- a/osu.Game.Mode.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Mode.Osu/Objects/OsuHitObject.cs @@ -12,6 +12,8 @@ namespace osu.Game.Modes.Osu.Objects { public Vector2 Position { get; set; } + public virtual Vector2 EndPosition => Position; + [Flags] internal enum HitObjectType { diff --git a/osu.Game.Mode.Osu/Objects/Slider.cs b/osu.Game.Mode.Osu/Objects/Slider.cs index a0cdbeae7c..3c11ead7e4 100644 --- a/osu.Game.Mode.Osu/Objects/Slider.cs +++ b/osu.Game.Mode.Osu/Objects/Slider.cs @@ -4,6 +4,7 @@ using osu.Game.Database; using osu.Game.Beatmaps; using System; +using OpenTK; namespace osu.Game.Modes.Osu.Objects { @@ -11,6 +12,8 @@ namespace osu.Game.Modes.Osu.Objects { public override double EndTime => StartTime + RepeatCount * Curve.Length / Velocity; + public override Vector2 EndPosition => RepeatCount % 2 == 0 ? Position : Curve.PositionAt(1); + public double Velocity; public override void SetDefaultsFromBeatmap(Beatmap beatmap) diff --git a/osu.Game.Mode.Osu/UI/OsuHitRenderer.cs b/osu.Game.Mode.Osu/UI/OsuHitRenderer.cs index 01f95de5fb..02e7521c4f 100644 --- a/osu.Game.Mode.Osu/UI/OsuHitRenderer.cs +++ b/osu.Game.Mode.Osu/UI/OsuHitRenderer.cs @@ -6,7 +6,6 @@ using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Osu.Objects; using osu.Game.Modes.Osu.Objects.Drawables; using osu.Game.Modes.UI; -using OsuConverter = osu.Game.Modes.Osu.Objects.OsuHitObjectConverter; namespace osu.Game.Modes.Osu.UI { diff --git a/osu.Game.Mode.Osu/UI/OsuPlayfield.cs b/osu.Game.Mode.Osu/UI/OsuPlayfield.cs index 1e69cd78a3..3ee3339f2a 100644 --- a/osu.Game.Mode.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Mode.Osu/UI/OsuPlayfield.cs @@ -3,19 +3,18 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Osu.Objects; using osu.Game.Modes.Osu.Objects.Drawables; using osu.Game.Modes.UI; using OpenTK; -using OpenTK.Graphics; namespace osu.Game.Modes.Osu.UI { public class OsuPlayfield : Playfield { private Container approachCircles; + private Container judgementLayer; public override Vector2 Size { @@ -35,11 +34,17 @@ namespace osu.Game.Modes.Osu.UI RelativeSizeAxes = Axes.Both; Size = new Vector2(0.75f); - AddInternal(new Drawable[] + Add(new Drawable[] { + judgementLayer = new Container + { + RelativeSizeAxes = Axes.Both, + Depth = 1, + }, approachCircles = new Container { RelativeSizeAxes = Axes.Both, + Depth = -1, } }); } @@ -52,7 +57,16 @@ namespace osu.Game.Modes.Osu.UI approachCircles.Add(c.ApproachCircle.CreateProxy()); } + h.OnJudgement += judgement; + base.Add(h); } + + private void judgement(DrawableHitObject h, JudgementInfo j) + { + HitExplosion explosion = new HitExplosion((OsuJudgementInfo)j, (OsuHitObject)h.HitObject); + + judgementLayer.Add(explosion); + } } } \ No newline at end of file diff --git a/osu.Game/Modes/UI/Playfield.cs b/osu.Game/Modes/UI/Playfield.cs index ff8a03db2a..ec91536f29 100644 --- a/osu.Game/Modes/UI/Playfield.cs +++ b/osu.Game/Modes/UI/Playfield.cs @@ -11,23 +11,34 @@ namespace osu.Game.Modes.UI public abstract class Playfield : Container { public HitObjectContainer HitObjects; + private Container content; public virtual void Add(DrawableHitObject h) => HitObjects.Add(h); public override bool Contains(Vector2 screenSpacePos) => true; + protected override Container Content => content; + public Playfield() { - AddInternal(HitObjects = new HitObjectContainer + AddInternal(content = new ScaledContainer() + { + RelativeSizeAxes = Axes.Both, + }); + + Add(HitObjects = new HitObjectContainer { RelativeSizeAxes = Axes.Both, }); } - public class HitObjectContainer : Container + public class ScaledContainer : Container { protected override Vector2 DrawScale => new Vector2(DrawSize.X / 512); + } + public class HitObjectContainer : Container + { public override bool Contains(Vector2 screenSpacePos) => true; } } From 7ab08945e4a0124b38f1efc7522606eb826b9b5e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Dec 2016 00:02:27 +0900 Subject: [PATCH 14/79] Add repeat graphics, fine-tune scale of various elements. --- .../Objects/Drawables/DrawableOsuHitObject.cs | 2 +- .../Objects/Drawables/DrawableSlider.cs | 31 ++++++++-- .../Objects/Drawables/Pieces/SliderBall.cs | 9 ++- .../Objects/Drawables/Pieces/SliderBody.cs | 9 +-- .../Objects/Drawables/Pieces/SliderBouncer.cs | 58 +++++++++++++++++++ osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj | 1 + 6 files changed, 96 insertions(+), 14 deletions(-) create mode 100644 osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs index dca9ac9b28..e6e948cf6f 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -29,7 +29,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables { if (!IsLoaded) return; - Flush(true); + Flush(); UpdateInitialState(); diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index 34318d3cec..7ffd93e3dc 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -3,9 +3,12 @@ using System.Collections.Generic; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Osu.Objects.Drawables.Pieces; using OpenTK; +using OpenTK.Graphics; namespace osu.Game.Modes.Osu.Objects.Drawables { @@ -13,13 +16,16 @@ namespace osu.Game.Modes.Osu.Objects.Drawables { private Slider slider; - private DrawableHitCircle startCircle; + private DrawableHitCircle initialCircle; private List components = new List(); + SliderBody body; + + SliderBouncer bouncer1, bouncer2; + public DrawableSlider(Slider s) : base(s) { - SliderBody body; SliderBall ball; slider = s; @@ -35,8 +41,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables Position = s.Position, PathWidth = 36, }, + bouncer1 = new SliderBouncer(slider, false) { Position = slider.Curve.PositionAt(1) }, + bouncer2 = new SliderBouncer(slider, true) { Position = slider.Position }, ball = new SliderBall(slider), - startCircle = new DrawableHitCircle(new HitCircle + initialCircle = new DrawableHitCircle(new HitCircle { StartTime = s.StartTime, Position = s.Position, @@ -49,6 +57,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables components.Add(body); components.Add(ball); + components.Add(bouncer1); + components.Add(bouncer2); } protected override void Update() @@ -63,13 +73,15 @@ namespace osu.Game.Modes.Osu.Objects.Drawables if (repeat % 2 == 1) progress = 1 - progress; + bouncer2.Position = slider.Curve.PositionAt(body.SnakedAmount); + components.ForEach(c => c.UpdateProgress(progress, repeat)); } protected override void CheckJudgement(bool userTriggered) { var j = Judgement as OsuJudgementInfo; - var sc = startCircle.Judgement as OsuJudgementInfo; + var sc = initialCircle.Judgement as OsuJudgementInfo; if (!userTriggered && Time.Current >= HitObject.EndTime) { @@ -78,12 +90,19 @@ namespace osu.Game.Modes.Osu.Objects.Drawables } } + protected override void UpdateInitialState() + { + base.UpdateInitialState(); + body.Alpha = 1; + } + protected override void UpdateState(ArmedState state) { base.UpdateState(state); - Delay(HitObject.Duration); - FadeOut(100); + Delay(HitObject.Duration, true); + body.FadeOut(160); + FadeOut(800); } } diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs index f7765a5057..cb6b6228ef 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Input; +using OpenTK; using OpenTK.Graphics; namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces @@ -30,8 +31,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces Origin = Anchor.Centre, Anchor = Anchor.Centre, Colour = Color4.Orange, - Width = 64, - Height = 64, + Width = 80, + Height = 80, }, new Container { @@ -51,8 +52,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces }, } } - }; + + Scale = new Vector2(0.94f); + } private InputState lastState; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs index 354bf80619..e3423e78a0 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -58,7 +58,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces }, } }, - }; container.Attach(RenderbufferInternalFormat.DepthComponent16); @@ -91,6 +90,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces snakingOut = config.GetBindable(OsuConfig.SnakingOutSliders); } + public double SnakedAmount { get; private set; } + private List currentCurve = new List(); private bool updateSnaking(double p0, double p1) { @@ -123,7 +124,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces public void UpdateProgress(double progress, int repeat) { double start = 0; - double end = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - DrawableOsuHitObject.TIME_PREEMPT)) / DrawableOsuHitObject.TIME_FADEIN, 0, 1) : 1; + double end = SnakedAmount = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - DrawableOsuHitObject.TIME_PREEMPT)) / DrawableOsuHitObject.TIME_FADEIN, 0, 1) : 1; if (repeat >= slider.RepeatCount - 1) { @@ -188,12 +189,12 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces { RelativeSizeAxes = Axes.Both, Colour = Color4.White, - Size = new Vector2(0.13f, 1), + Size = new Vector2(0.16f, 1), }, gradientPortion = new Box { RelativeSizeAxes = Axes.Both, - Size = new Vector2(0.85f, 1), + Size = new Vector2(0.82f, 1), }, }, } diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs new file mode 100644 index 0000000000..f8401e24a5 --- /dev/null +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs @@ -0,0 +1,58 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; + +namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces +{ + public class SliderBouncer : Container, ISliderProgress + { + private readonly Slider slider; + private readonly bool isEnd; + + public SliderBouncer(Slider slider, bool isEnd) + { + this.slider = slider; + this.isEnd = isEnd; + + Masking = true; + AutoSizeAxes = Axes.Both; + BlendingMode = BlendingMode.Additive; + Origin = Anchor.Centre; + + Children = new Drawable[] + { + new Container + { + Masking = true, + AutoSizeAxes = Axes.Both, + + CornerRadius = 16, + Children = new[] + { + new Box + { + Width = 32, + Height = 32, + }, + } + } + }; + } + + public void UpdateProgress(double progress, int repeat) + { + if (Time.Current < slider.StartTime) + Alpha = 0; + + Alpha = repeat + 1 < slider.RepeatCount && repeat % 2 == (isEnd ? 0 : 1) ? 1 : 0; + } + } +} diff --git a/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj index 1f53c706cc..f6b4436951 100644 --- a/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj +++ b/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj @@ -52,6 +52,7 @@ + From 27fafe419b91b3b385309975dbb7ffc8e98ccde9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Dec 2016 00:03:02 +0900 Subject: [PATCH 15/79] Add warnings. --- osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs index e3423e78a0..58a3147541 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -142,6 +142,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces SetRange(start, end); } + // --------------------------------------------- DO NOT MERGE THIS ----------------------------------------------------------------------- public class BodyTexture : BufferedContainer { private Box gradientPortion; @@ -201,5 +202,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces }; } } + // --------------------------------------------- DO NOT MERGE THIS ----------------------------------------------------------------------- } } \ No newline at end of file From 1fff21dc126129f191f4ed802182a65b474793fd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Dec 2016 14:52:34 +0900 Subject: [PATCH 16/79] Make initial circles of sliders follow snaking out. --- .../Objects/Drawables/DrawableHitCircle.cs | 7 +------ .../Objects/Drawables/DrawableSlider.cs | 6 +++++- .../Objects/Drawables/Pieces/SliderBody.cs | 15 ++++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs index b916a7bc74..ebb5057a49 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -131,12 +131,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables FadeOut(TIME_FADEOUT); break; case ArmedState.Miss: - ring.FadeOut(); - circle.FadeOut(); - number.FadeOut(); - glow.FadeOut(); - - FadeOut(800); + FadeOut(TIME_FADEOUT / 5); break; case ArmedState.Hit: const double flash_in = 30; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index 7ffd93e3dc..9f11a70a66 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -73,7 +73,11 @@ namespace osu.Game.Modes.Osu.Objects.Drawables if (repeat % 2 == 1) progress = 1 - progress; - bouncer2.Position = slider.Curve.PositionAt(body.SnakedAmount); + bouncer2.Position = slider.Curve.PositionAt(body.SnakedEnd); + + //todo: we probably want to reconsider this before adding scoring, but it looks and feels nice. + if (initialCircle.Judgement?.Result != HitResult.Hit) + initialCircle.Position = slider.Curve.PositionAt(body.SnakedStart); components.ForEach(c => c.UpdateProgress(progress, repeat)); } diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs index 58a3147541..c4c1cae7b6 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -90,7 +90,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces snakingOut = config.GetBindable(OsuConfig.SnakingOutSliders); } - public double SnakedAmount { get; private set; } + public double SnakedEnd { get; private set; } + public double SnakedStart { get; private set; } private List currentCurve = new List(); private bool updateSnaking(double p0, double p1) @@ -123,23 +124,23 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces public void UpdateProgress(double progress, int repeat) { - double start = 0; - double end = SnakedAmount = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - DrawableOsuHitObject.TIME_PREEMPT)) / DrawableOsuHitObject.TIME_FADEIN, 0, 1) : 1; + SnakedStart = 0; + SnakedEnd = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - DrawableOsuHitObject.TIME_PREEMPT)) / DrawableOsuHitObject.TIME_FADEIN, 0, 1) : 1; if (repeat >= slider.RepeatCount - 1) { if (Math.Min(repeat, slider.RepeatCount - 1) % 2 == 1) { - start = 0; - end = snakingOut ? progress : 1; + SnakedStart = 0; + SnakedEnd = snakingOut ? progress : 1; } else { - start = snakingOut ? progress : 0; + SnakedStart = snakingOut ? progress : 0; } } - SetRange(start, end); + SetRange(SnakedStart, SnakedEnd); } // --------------------------------------------- DO NOT MERGE THIS ----------------------------------------------------------------------- From 2ba77746c03f19b0213ffca84e53e4d1f22ffadc Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Dec 2016 15:45:17 +0900 Subject: [PATCH 17/79] Manually create slider textures rather than relying on draw calls. --- .../Objects/Drawables/Pieces/SliderBody.cs | 122 ++++++------------ 1 file changed, 40 insertions(+), 82 deletions(-) diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs index c4c1cae7b6..002976532f 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -6,13 +6,12 @@ using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; -using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.OpenGL.Textures; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Configuration; using OpenTK; -using OpenTK.Graphics; using OpenTK.Graphics.ES30; namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces @@ -20,7 +19,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces public class SliderBody : Container, ISliderProgress { private Path path; - private BodyTexture pathTexture; private BufferedContainer container; public float PathWidth @@ -29,7 +27,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces set { path.PathWidth = value; - pathTexture.Size = new Vector2(value, 1); } } @@ -43,10 +40,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces Children = new Drawable[] { - pathTexture = new BodyTexture - { - MainColour = s.Colour - }, container = new BufferedContainer { CacheDrawnFrameBuffer = true, @@ -88,6 +81,45 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces { snakingIn = config.GetBindable(OsuConfig.SnakingInSliders); snakingOut = config.GetBindable(OsuConfig.SnakingOutSliders); + + int textureWidth = (int)PathWidth * 2; + + //initialise background + var upload = new TextureUpload(textureWidth * 4); + var bytes = upload.Data; + + const float aa_portion = 0.02f; + const float border_portion = 0.18f; + const float gradient_portion = 1 - border_portion; + + const float opacity_at_centre = 0.3f; + const float opacity_at_edge = 0.8f; + + for (int i = 0; i < textureWidth; i++) + { + float progress = (float)i / (textureWidth - 1); + + if (progress <= border_portion) + { + bytes[i * 4] = 255; + bytes[i * 4 + 1] = 255; + bytes[i * 4 + 2] = 255; + bytes[i * 4 + 3] = (byte)(Math.Min(progress / aa_portion, 1) * 255); + } + else + { + progress -= border_portion; + + bytes[i * 4] = (byte)(slider.Colour.R * 255); + bytes[i * 4 + 1] = (byte)(slider.Colour.G * 255); + bytes[i * 4 + 2] = (byte)(slider.Colour.B * 255); + bytes[i * 4 + 3] = (byte)((opacity_at_edge - (opacity_at_edge - opacity_at_centre) * progress / gradient_portion) * (slider.Colour.A * 255)); + } + } + + var texture = new Texture(textureWidth, 1); + texture.SetData(upload); + path.Texture = texture; } public double SnakedEnd { get; private set; } @@ -110,18 +142,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces return true; } - protected override void Update() - { - base.Update(); - - var texture = pathTexture.Texture; - if (texture != null) - { - path.Texture = texture; - pathTexture.Alpha = 0; - } - } - public void UpdateProgress(double progress, int repeat) { SnakedStart = 0; @@ -142,67 +162,5 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces SetRange(SnakedStart, SnakedEnd); } - - // --------------------------------------------- DO NOT MERGE THIS ----------------------------------------------------------------------- - public class BodyTexture : BufferedContainer - { - private Box gradientPortion; - private BufferedContainerDrawNode lastNode; - public Texture Texture => lastNode?.FrameBuffers[0].Texture != null ? new Texture(lastNode.FrameBuffers[0].Texture) : null; - - protected override void ApplyDrawNode(DrawNode node) - { - base.ApplyDrawNode(node); - lastNode = node as BufferedContainerDrawNode; - } - - public Color4 MainColour - { - set - { - gradientPortion.ColourInfo = ColourInfo.GradientHorizontal( - value, - new Color4(value.R, value.G, value.B, value.A * 0.4f) - ); - } - } - - public BodyTexture() - { - Children = new[] - { - new FlowContainer - { - RelativeSizeAxes = Axes.Both, - Direction = FlowDirection.HorizontalOnly, - Masking = true, - Children = new[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - ColourInfo = ColourInfo.GradientHorizontal( - new Color4(255, 255, 255, 0), - Color4.White - ), - Size = new Vector2(0.02f, 1), - }, - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White, - Size = new Vector2(0.16f, 1), - }, - gradientPortion = new Box - { - RelativeSizeAxes = Axes.Both, - Size = new Vector2(0.82f, 1), - }, - }, - } - }; - } - } - // --------------------------------------------- DO NOT MERGE THIS ----------------------------------------------------------------------- } } \ No newline at end of file From 41b9a55460fe66256ec362a9e43e1a67bc4f26f3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Dec 2016 16:00:29 +0900 Subject: [PATCH 18/79] Simplify variables for snake start/end. --- .../Objects/Drawables/DrawableSlider.cs | 4 +-- .../Objects/Drawables/Pieces/SliderBody.cs | 25 ++++++++----------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index 9f11a70a66..9ce624ab42 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -73,11 +73,11 @@ namespace osu.Game.Modes.Osu.Objects.Drawables if (repeat % 2 == 1) progress = 1 - progress; - bouncer2.Position = slider.Curve.PositionAt(body.SnakedEnd); + bouncer2.Position = slider.Curve.PositionAt(body.SnakedEnd ?? 0); //todo: we probably want to reconsider this before adding scoring, but it looks and feels nice. if (initialCircle.Judgement?.Result != HitResult.Hit) - initialCircle.Position = slider.Curve.PositionAt(body.SnakedStart); + initialCircle.Position = slider.Curve.PositionAt(body.SnakedStart ?? 0); components.ForEach(c => c.UpdateProgress(progress, repeat)); } diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs index 002976532f..c0bd29bc02 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -30,8 +30,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces } } - private double? drawnProgressStart; - private double? drawnProgressEnd; + public double? SnakedStart { get; private set; } + public double? SnakedEnd { get; private set; } private Slider slider; public SliderBody(Slider s) @@ -122,16 +122,13 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces path.Texture = texture; } - public double SnakedEnd { get; private set; } - public double SnakedStart { get; private set; } - private List currentCurve = new List(); private bool updateSnaking(double p0, double p1) { - if (drawnProgressStart == p0 && drawnProgressEnd == p1) return false; + if (SnakedStart == p0 && SnakedEnd == p1) return false; - drawnProgressStart = p0; - drawnProgressEnd = p1; + SnakedStart = p0; + SnakedEnd = p1; slider.Curve.GetPathToProgress(currentCurve, p0, p1); @@ -144,23 +141,23 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces public void UpdateProgress(double progress, int repeat) { - SnakedStart = 0; - SnakedEnd = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - DrawableOsuHitObject.TIME_PREEMPT)) / DrawableOsuHitObject.TIME_FADEIN, 0, 1) : 1; + double start = 0; + double end = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - DrawableOsuHitObject.TIME_PREEMPT)) / DrawableOsuHitObject.TIME_FADEIN, 0, 1) : 1; if (repeat >= slider.RepeatCount - 1) { if (Math.Min(repeat, slider.RepeatCount - 1) % 2 == 1) { - SnakedStart = 0; - SnakedEnd = snakingOut ? progress : 1; + start = 0; + end = snakingOut ? progress : 1; } else { - SnakedStart = snakingOut ? progress : 0; + start = snakingOut ? progress : 0; } } - SetRange(SnakedStart, SnakedEnd); + SetRange(start, end); } } } \ No newline at end of file From b5e3dcbd1cf14ac77862817e3ab9be965dd16d9a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Dec 2016 16:37:03 +0900 Subject: [PATCH 19/79] Improve visuals of temporary sliderball. --- .../Objects/Drawables/DrawableSlider.cs | 3 -- .../Objects/Drawables/Pieces/SliderBall.cs | 29 +++++++++++-------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index 9ce624ab42..1cf3564f93 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -3,12 +3,9 @@ using System.Collections.Generic; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Osu.Objects.Drawables.Pieces; using OpenTK; -using OpenTK.Graphics; namespace osu.Game.Modes.Osu.Objects.Drawables { diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs index cb6b6228ef..ce34ef7c22 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -16,6 +16,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces private readonly Slider slider; private Box follow; + const float width = 70; + public SliderBall(Slider slider) { this.slider = slider; @@ -23,6 +25,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces AutoSizeAxes = Axes.Both; BlendingMode = BlendingMode.Additive; Origin = Anchor.Centre; + BorderThickness = 5; + BorderColour = Color4.Orange; Children = new Drawable[] { @@ -31,8 +35,9 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces Origin = Anchor.Centre, Anchor = Anchor.Centre, Colour = Color4.Orange, - Width = 80, - Height = 80, + Width = width, + Height = width, + Alpha = 0, }, new Container { @@ -40,22 +45,22 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces AutoSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, - Colour = Color4.Cyan, - CornerRadius = 32, + BorderThickness = 7, + BorderColour = Color4.White, + Alpha = 1, + CornerRadius = width / 2, Children = new[] { new Box { - - Width = 64, - Height = 64, + Colour = slider.Colour, + Alpha = 0.4f, + Width = width, + Height = width, }, } } }; - - Scale = new Vector2(0.94f); - } private InputState lastState; @@ -88,8 +93,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces tracking = value; - follow.ScaleTo(tracking ? 2.4f : 1, 140, EasingTypes.Out); - follow.FadeTo(tracking ? 0.8f : 0, 140, EasingTypes.Out); + follow.ScaleTo(tracking ? 2.8f : 1, 300, EasingTypes.OutQuint); + follow.FadeTo(tracking ? 0.2f : 0, 300, EasingTypes.OutQuint); } } From 83e7e67cc55490566a20b3b43acfc9c6fa867db1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Dec 2016 17:21:59 +0900 Subject: [PATCH 20/79] Improve repeat point visual. --- .../Objects/Drawables/Pieces/SliderBouncer.cs | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs index f8401e24a5..39d09e6d66 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces { @@ -16,37 +17,36 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces { private readonly Slider slider; private readonly bool isEnd; + private TextAwesome icon; public SliderBouncer(Slider slider, bool isEnd) { this.slider = slider; this.isEnd = isEnd; - Masking = true; AutoSizeAxes = Axes.Both; BlendingMode = BlendingMode.Additive; Origin = Anchor.Centre; Children = new Drawable[] { - new Container - { - Masking = true, - AutoSizeAxes = Axes.Both, - - CornerRadius = 16, - Children = new[] - { - new Box - { - Width = 32, - Height = 32, - }, - } - } + icon = new TextAwesome + { + Icon = FontAwesome.fa_eercast, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + TextSize = 24, + } }; } + protected override void LoadComplete() + { + base.LoadComplete(); + icon.RotateTo(360, 1000); + icon.Loop(); + } + public void UpdateProgress(double progress, int repeat) { if (Time.Current < slider.StartTime) From 87ad44b9015cfbe33c724d1ab1028b4d19c0872e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Dec 2016 18:18:36 +0900 Subject: [PATCH 21/79] Fix HitObject test case not displaying properly. --- osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs | 4 +++- osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs index 1e18ae4117..3c58ef207e 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs @@ -22,7 +22,7 @@ namespace osu.Desktop.VisualTests.Tests public TestCaseHitObjects() { - var swClock = new StopwatchClock(true) { Rate = 1 }; + var swClock = new StopwatchClock(true) { Rate = 0.2f }; Clock = new FramedClock(swClock); } @@ -52,8 +52,10 @@ namespace osu.Desktop.VisualTests.Tests Origin = Anchor.Centre, Depth = i, State = ArmedState.Hit, + Judgement = new OsuJudgementInfo { Result = HitResult.Hit } }; + approachContainer.Add(d.ApproachCircle.CreateProxy()); Add(d); } diff --git a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs index 352615eeab..9b5c268696 100644 --- a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs @@ -47,7 +47,9 @@ namespace osu.Game.Modes.Objects.Drawables { base.LoadComplete(); - Judgement = CreateJudgementInfo(); + //we may be setting a custom judgement in test cases or what not. + if (Judgement == null) + Judgement = CreateJudgementInfo(); //force application of the state that was set before we loaded. UpdateState(State); From bc6c57c619bf2a7a20674ca3a24b0e5d35f1f648 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Dec 2016 19:13:45 +0900 Subject: [PATCH 22/79] Make toolbar icons the same width as options icons. --- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index 5976f64c41..80b2fcdb42 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -79,7 +79,7 @@ namespace osu.Game.Overlays.Toolbar Direction = FlowDirection.HorizontalOnly, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Padding = new MarginPadding { Left = 15, Right = 15 }, + Padding = new MarginPadding { Left = 20, Right = 20 }, Spacing = new Vector2(5), RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, From bbc11c77ca6405ed37886b6d7117c51ffc5a14c7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Dec 2016 20:47:28 +0900 Subject: [PATCH 23/79] Add (temporary) transitions to songselect and player. --- osu-framework | 2 +- .../Tests/TestCaseGamefield.cs | 6 ----- .../Tests/TestCaseHitObjects.cs | 6 ----- .../Tests/TestCaseMusicController.cs | 6 ----- .../Tests/TestCasePlayer.cs | 6 ----- osu.Game/Screens/Play/Player.cs | 24 +++++++++++++------ osu.Game/Screens/Select/BeatmapInfoWedge.cs | 1 - osu.Game/Screens/Select/PlaySongSelect.cs | 14 +++++++++++ 8 files changed, 32 insertions(+), 33 deletions(-) diff --git a/osu-framework b/osu-framework index 8dbc789266..797576111a 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8dbc789266c1bc3e46e364be824d69bcfac74e83 +Subproject commit 797576111a7ba4c469cd1a7d74708014264155ec diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs index 14c44bbb43..3841420dad 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs @@ -85,11 +85,5 @@ namespace osu.Desktop.VisualTests.Tests } }); } - - protected override void Update() - { - base.Update(); - Clock.ProcessFrame(); - } } } diff --git a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs index 1e18ae4117..83ce89148c 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs @@ -58,11 +58,5 @@ namespace osu.Desktop.VisualTests.Tests Add(d); } } - - protected override void Update() - { - base.Update(); - Clock.ProcessFrame(); - } } } diff --git a/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs b/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs index 2be742580a..833cefc3d8 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseMusicController.cs @@ -32,11 +32,5 @@ namespace osu.Desktop.VisualTests.Tests Add(mc); AddToggle(@"Show", mc.ToggleVisibility); } - - protected override void Update() - { - base.Update(); - Clock.ProcessFrame(); - } } } diff --git a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs index 89bacb9b97..9e3ad1bbc8 100644 --- a/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCasePlayer.cs @@ -82,11 +82,5 @@ namespace osu.Desktop.VisualTests.Tests Beatmap = beatmap }); } - - protected override void Update() - { - base.Update(); - Clock.ProcessFrame(); - } } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 2f35f1b5d5..8b1e18ac00 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -67,12 +67,10 @@ namespace osu.Game.Screens.Play } sourceClock = (IAdjustableClock)track ?? new StopwatchClock(); - Clock = new InterpolatingFramedClock(sourceClock); Schedule(() => { sourceClock.Reset(); - sourceClock.Start(); }); var beatmap = Beatmap.Beatmap; @@ -103,6 +101,7 @@ namespace osu.Game.Screens.Play { new PlayerInputManager(game.Host) { + Clock = new InterpolatingFramedClock(sourceClock), PassThrough = false, Children = new Drawable[] { @@ -113,6 +112,21 @@ namespace osu.Game.Screens.Play }; } + protected override void LoadComplete() + { + base.LoadComplete(); + + Delay(250, true); + Content.FadeIn(250); + + Delay(500, true); + + Schedule(() => + { + sourceClock.Start(); + }); + } + private void hitRenderer_OnAllJudged() { Delay(1000); @@ -130,12 +144,8 @@ namespace osu.Game.Screens.Play base.OnEntering(last); (Background as BackgroundModeBeatmap)?.BlurTo(Vector2.Zero, 1000); - } - protected override void Update() - { - base.Update(); - Clock.ProcessFrame(); + Content.Alpha = 0; } class PlayerInputManager : UserInputManager diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 81cd55d429..e4aa8f27b9 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -61,7 +61,6 @@ namespace osu.Game.Screens.Select (beatmapInfoContainer = new BufferedContainer { Depth = newDepth, - PixelSnapping = true, CacheDrawnFrameBuffer = true, Shear = -Shear, RelativeSizeAxes = Axes.Both, diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 729bf3aede..9d2debb8aa 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -25,6 +25,7 @@ using OpenTK.Graphics; using osu.Game.Screens.Play; using osu.Framework; using osu.Framework.Audio.Sample; +using osu.Framework.Graphics.Transformations; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics.Containers; @@ -188,6 +189,12 @@ namespace osu.Game.Screens.Select changeBackground(Beatmap); Content.FadeInFromZero(250); + + beatmapInfoWedge.MoveTo(wedged_container_start_position + new Vector2(-100, 50)); + beatmapInfoWedge.RotateTo(10); + + beatmapInfoWedge.MoveTo(wedged_container_start_position, 800, EasingTypes.OutQuint); + beatmapInfoWedge.RotateTo(0, 800, EasingTypes.OutQuint); } protected override void OnResuming(GameMode last) @@ -197,16 +204,23 @@ namespace osu.Game.Screens.Select base.OnResuming(last); Content.FadeIn(250); + + Content.ScaleTo(1, 250, EasingTypes.OutSine); } protected override void OnSuspending(GameMode next) { + Content.ScaleTo(1.1f, 250, EasingTypes.InSine); + Content.FadeOut(250); base.OnSuspending(next); } protected override bool OnExiting(GameMode next) { + beatmapInfoWedge.MoveTo(wedged_container_start_position + new Vector2(-100, 50), 800, EasingTypes.InQuint); + beatmapInfoWedge.RotateTo(10, 800, EasingTypes.InQuint); + Content.FadeOut(100); return base.OnExiting(next); } From 08f8eb649c9cd09abbddf2019040d00b8965733c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Dec 2016 21:05:29 +0900 Subject: [PATCH 24/79] Make counters closer to what they should be looking like. --- osu.Game.Mode.Osu/UI/OsuComboCounter.cs | 2 +- osu.Game.Mode.Osu/UI/OsuScoreOverlay.cs | 18 ++++++++++-------- .../UserInterface/PercentageCounter.cs | 2 +- .../Graphics/UserInterface/RollingCounter.cs | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/osu.Game.Mode.Osu/UI/OsuComboCounter.cs b/osu.Game.Mode.Osu/UI/OsuComboCounter.cs index dc90ee2779..8a6e9a30e2 100644 --- a/osu.Game.Mode.Osu/UI/OsuComboCounter.cs +++ b/osu.Game.Mode.Osu/UI/OsuComboCounter.cs @@ -17,7 +17,7 @@ namespace osu.Game.Modes.Osu.UI protected virtual float PopOutSmallScale => 1.1f; protected virtual bool CanPopOutWhileRolling => false; - public Vector2 PopOutScale = new Vector2(2.5f); + public Vector2 PopOutScale = new Vector2(1.6f); protected override void LoadComplete() { diff --git a/osu.Game.Mode.Osu/UI/OsuScoreOverlay.cs b/osu.Game.Mode.Osu/UI/OsuScoreOverlay.cs index 0c967999b3..36a1f1c100 100644 --- a/osu.Game.Mode.Osu/UI/OsuScoreOverlay.cs +++ b/osu.Game.Mode.Osu/UI/OsuScoreOverlay.cs @@ -12,18 +12,20 @@ namespace osu.Game.Modes.Osu.UI { public class OsuScoreOverlay : ScoreOverlay { - protected override PercentageCounter CreateAccuracyCounter() => new PercentageCounter() - { - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - Position = new Vector2(0, 45) - }; - protected override ScoreCounter CreateScoreCounter() => new ScoreCounter() { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - TextSize = 60 + TextSize = 60, + Margin = new MarginPadding { Right = 5 }, + }; + + protected override PercentageCounter CreateAccuracyCounter() => new PercentageCounter() + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + Position = new Vector2(0, 55), + Margin = new MarginPadding { Right = 5 }, }; protected override ComboCounter CreateComboCounter() => new OsuComboCounter() diff --git a/osu.Game/Graphics/UserInterface/PercentageCounter.cs b/osu.Game/Graphics/UserInterface/PercentageCounter.cs index b045089dcd..63c15553d5 100644 --- a/osu.Game/Graphics/UserInterface/PercentageCounter.cs +++ b/osu.Game/Graphics/UserInterface/PercentageCounter.cs @@ -20,7 +20,7 @@ namespace osu.Game.Graphics.UserInterface { protected override Type TransformType => typeof(TransformAccuracy); - protected override double RollingDuration => 20; + protected override double RollingDuration => 150; protected override bool IsRollingProportional => true; private float epsilon => 1e-10f; diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index fd60a8ca8e..6a21da9bce 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -42,7 +42,7 @@ namespace osu.Game.Graphics.UserInterface /// /// Easing for the counter rollover animation. /// - protected virtual EasingTypes RollingEasing => EasingTypes.None; + protected virtual EasingTypes RollingEasing => EasingTypes.Out; private T displayedCount; From 112b2983acd56da2f6cbc5018cc3f4dd86209eba Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Dec 2016 21:46:06 +0900 Subject: [PATCH 25/79] Make start circle always follow current progress for now, not snaking. --- osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index 1cf3564f93..e0af180e95 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -74,7 +74,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables //todo: we probably want to reconsider this before adding scoring, but it looks and feels nice. if (initialCircle.Judgement?.Result != HitResult.Hit) - initialCircle.Position = slider.Curve.PositionAt(body.SnakedStart ?? 0); + initialCircle.Position = slider.Curve.PositionAt(progress); components.ForEach(c => c.UpdateProgress(progress, repeat)); } From a350e95e406606931a384a644c037e2452c96b0f Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 30 Nov 2016 09:08:11 -0500 Subject: [PATCH 26/79] Add OptionsSlider and wire up volume sliders --- .../Overlays/Options/Audio/VolumeOptions.cs | 17 +++---- osu.Game/Overlays/Options/OptionsSlider.cs | 48 +++++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 3 files changed, 55 insertions(+), 11 deletions(-) create mode 100644 osu.Game/Overlays/Options/OptionsSlider.cs diff --git a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs index 2216602a5f..f7d2614a96 100644 --- a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs +++ b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs @@ -3,6 +3,7 @@ using osu.Framework; using osu.Framework.Allocation; +using osu.Framework.Audio; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; @@ -14,21 +15,15 @@ namespace osu.Game.Overlays.Options.Audio { protected override string Header => "Volume"; - private CheckBoxOption ignoreHitsounds; - - public VolumeOptions() - { - } - [BackgroundDependencyLoader] - private void load(OsuConfigManager config) + private void load(OsuConfigManager config, AudioManager audio) { Children = new Drawable[] { - new SpriteText { Text = "Master: TODO slider" }, - new SpriteText { Text = "Music: TODO slider" }, - new SpriteText { Text = "Effect: TODO slider" }, - ignoreHitsounds = new CheckBoxOption + new OptionsSlider { Label = "Master", Bindable = audio.Volume }, + new OptionsSlider { Label = "Effect", Bindable = audio.VolumeSample }, + new OptionsSlider { Label = "Music", Bindable = audio.VolumeTrack }, + new CheckBoxOption { LabelText = "Ignore beatmap hitsounds", Bindable = config.GetBindable(OsuConfig.IgnoreBeatmapSamples) diff --git a/osu.Game/Overlays/Options/OptionsSlider.cs b/osu.Game/Overlays/Options/OptionsSlider.cs new file mode 100644 index 0000000000..a8d0a3da6f --- /dev/null +++ b/osu.Game/Overlays/Options/OptionsSlider.cs @@ -0,0 +1,48 @@ +using System; +using OpenTK.Graphics; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class OptionsSlider : FlowContainer + { + private SliderBar slider; + private SpriteText text; + + public string Label + { + get { return text.Text; } + set { text.Text = value; } + } + + public BindableDouble Bindable + { + get { return slider.Bindable; } + set { slider.Bindable = value; } + } + + public OptionsSlider() + { + Direction = FlowDirection.VerticalOnly; + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + Children = new Drawable[] + { + text = new SpriteText(), + slider = new SliderBar + { + Margin = new MarginPadding { Top = 5 }, + Height = 10, + RelativeSizeAxes = Axes.X, + Color = Color4.White, + SelectionColor = new Color4(255, 102, 170, 255), + } + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index c4915b7567..e03f8f3337 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -222,6 +222,7 @@ + From 3aefa4d6a5602e37ca26cfa98f8f8188873c6308 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 30 Nov 2016 10:32:07 -0500 Subject: [PATCH 27/79] Wire up remaining sliders, except for ints --- osu.Game/Configuration/OsuConfigManager.cs | 1 + .../Options/Audio/OffsetAdjustmentOptions.cs | 37 ++++--- .../Gameplay/GeneralGameplayOptions.cs | 104 ++++++++++-------- .../Gameplay/SongSelectGameplayOptions.cs | 50 +++++++-- .../Options/Graphics/LayoutOptions.cs | 18 ++- osu.Game/Overlays/Options/OptionsSlider.cs | 8 +- 6 files changed, 143 insertions(+), 75 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 8e5fbfad42..ef95a3ac3f 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -96,6 +96,7 @@ namespace osu.Game.Configuration Set(OsuConfig.MouseDisableWheel, false); Set(OsuConfig.MouseSpeed, 1, 0.4, 6); Set(OsuConfig.Offset, 0, -300, 300); + Set(OsuConfig.ScoreMeterScale, 1, 0.5, 2); //Set(OsuConfig.ScoreMeterScale, 1, 0.5, OsuGame.Tournament ? 10 : 2); Set(OsuConfig.DistanceSpacing, 0.8, 0.1, 6); Set(OsuConfig.EditorBeatDivisor, 1, 1, 16); diff --git a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs index 29cf7ef589..4d9598fabe 100644 --- a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs +++ b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs @@ -1,8 +1,11 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; +using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options.Audio @@ -10,18 +13,26 @@ namespace osu.Game.Overlays.Options.Audio public class OffsetAdjustmentOptions : OptionsSubsection { protected override string Header => "Offset Adjustment"; - - public OffsetAdjustmentOptions() - { - Children = new Drawable[] - { - new SpriteText { Text = "Universal Offset: TODO slider" }, - new OsuButton - { - RelativeSizeAxes = Axes.X, - Text = "Offset wizard" - } - }; + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + Children = new Drawable[] + { + // TODO: bindable int crap + /* + new OptionsSlider + { + Label = "Universal Offset", + Bindable = (BindableDouble)config.GetBindable(OsuConfig.Offset) + }, + */ + new OsuButton + { + RelativeSizeAxes = Axes.X, + Text = "Offset wizard" + } + }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs index d8fc71fb02..81143c6127 100644 --- a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs @@ -1,49 +1,61 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework; -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.UserInterface; -using osu.Game.Configuration; - -namespace osu.Game.Overlays.Options.Gameplay -{ - public class GeneralGameplayOptions : OptionsSubsection - { - protected override string Header => "General"; - - [BackgroundDependencyLoader] - private void load(OsuConfigManager config) - { - Children = new Drawable[] - { - new SpriteText { Text = "Background dim: TODO slider" }, - new SpriteText { Text = "Progress display: TODO dropdown" }, - new SpriteText { Text = "Score meter type: TODO dropdown" }, - new SpriteText { Text = "Score meter size: TODO slider" }, - new CheckBoxOption - { - LabelText = "Always show key overlay", - Bindable = config.GetBindable(OsuConfig.KeyOverlay) - }, - new CheckBoxOption - { - LabelText = "Show approach circle on first \"Hidden\" object", - Bindable = config.GetBindable(OsuConfig.HiddenShowFirstApproach) - }, - new CheckBoxOption - { - LabelText = "Scale osu!mania scroll speed with BPM", - Bindable = config.GetBindable(OsuConfig.ManiaSpeedBPMScale) - }, - new CheckBoxOption - { - LabelText = "Remember osu!mania scroll speed per beatmap", - Bindable = config.GetBindable(OsuConfig.UsePerBeatmapManiaSpeed) - }, - }; - } - } -} \ No newline at end of file +using osu.Framework; +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; +using osu.Game.Configuration; + +namespace osu.Game.Overlays.Options.Gameplay +{ + public class GeneralGameplayOptions : OptionsSubsection + { + protected override string Header => "General"; + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + Children = new Drawable[] + { + // TODO: bindable int stuff + /* + new OptionsSlider + { + Label = "Background dim", + Bindable = (BindableDouble)config.GetBindable(OsuConfig.DimLevel) + }, + */ + new SpriteText { Text = "Progress display: TODO dropdown" }, + new SpriteText { Text = "Score meter type: TODO dropdown" }, + new OptionsSlider + { + Label = "Score meter size", + Bindable = (BindableDouble)config.GetBindable(OsuConfig.ScoreMeterScale) + }, + new CheckBoxOption + { + LabelText = "Always show key overlay", + Bindable = config.GetBindable(OsuConfig.KeyOverlay) + }, + new CheckBoxOption + { + LabelText = "Show approach circle on first \"Hidden\" object", + Bindable = config.GetBindable(OsuConfig.HiddenShowFirstApproach) + }, + new CheckBoxOption + { + LabelText = "Scale osu!mania scroll speed with BPM", + Bindable = config.GetBindable(OsuConfig.ManiaSpeedBPMScale) + }, + new CheckBoxOption + { + LabelText = "Remember osu!mania scroll speed per beatmap", + Bindable = config.GetBindable(OsuConfig.UsePerBeatmapManiaSpeed) + }, + }; + } + } +} diff --git a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs index 2a650ee177..c4591976e3 100644 --- a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs @@ -1,23 +1,53 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; +using osu.Game.Configuration; +using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options.Gameplay { public class SongSelectGameplayOptions : OptionsSubsection { - protected override string Header => "Song Select"; - - public SongSelectGameplayOptions() - { - Children = new Drawable[] - { - new SpriteText { Text = "Display beatmaps from: TODO slider" }, - new SpriteText { Text = "up to: TODO slider" }, - }; - } + protected override string Header => "Song Select"; + + //private BindableInt starMinimum, starMaximum; + //private StarCounter counterMin, counterMax; + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + // TODO: Deal with bindable ints + /* + starMinimum = config.GetBindable(OsuConfig.DisplayStarsMinimum); + starMaximum = config.GetBindable(OsuConfig.DisplayStarsMaximum); + Children = new Drawable[] + { + new OptionsSlider { Label = "Display beatmaps from", Bindable = starMinimum }, + counterMin = new StarCounter { Count = starMinimum.Value }, + new OptionsSlider { Label = "up to", Bindable = starMaximum }, + counterMax = new StarCounter { Count = starMaximum.Value }, + }; + starMinimum.ValueChanged += starValueChanged; + starMaximum.ValueChanged += starValueChanged;*/ + } + + private void starValueChanged(object sender, EventArgs e) + { + //counterMin.Count = starMinimum.Value; + //counterMax.Count = starMaximum.Value; + } + + protected override void Dispose(bool isDisposing) + { + //starMinimum.ValueChanged -= starValueChanged; + //starMaximum.ValueChanged -= starValueChanged; + base.Dispose(isDisposing); + } } } diff --git a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs index 06e2be25d1..d4243a24b1 100644 --- a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs @@ -3,6 +3,7 @@ using osu.Framework; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; @@ -30,10 +31,19 @@ namespace osu.Game.Overlays.Options.Graphics LabelText = "Letterboxing", Bindable = config.GetBindable(OsuConfig.Letterboxing), }, - new SpriteText { Text = "Horizontal position" }, - new SpriteText { Text = "TODO: slider" }, - new SpriteText { Text = "Vertical position" }, - new SpriteText { Text = "TODO: slider" }, + // TODO: deal with bindable ints + /* + new OptionsSlider + { + Label = "Horizontal position", + Bindable = config.GetBindable(OsuConfig.LetterboxPositionX) + }, + new OptionsSlider + { + Label = "Vertical position", + Bindable = config.GetBindable(OsuConfig.LetterboxPositionY) + }, + */ }; } } diff --git a/osu.Game/Overlays/Options/OptionsSlider.cs b/osu.Game/Overlays/Options/OptionsSlider.cs index a8d0a3da6f..9f6e4e1552 100644 --- a/osu.Game/Overlays/Options/OptionsSlider.cs +++ b/osu.Game/Overlays/Options/OptionsSlider.cs @@ -17,7 +17,11 @@ namespace osu.Game.Overlays.Options public string Label { get { return text.Text; } - set { text.Text = value; } + set + { + text.Text = value; + text.Alpha = string.IsNullOrEmpty(value) ? 0 : 1; + } } public BindableDouble Bindable @@ -33,7 +37,7 @@ namespace osu.Game.Overlays.Options AutoSizeAxes = Axes.Y; Children = new Drawable[] { - text = new SpriteText(), + text = new SpriteText { Alpha = 0 }, slider = new SliderBar { Margin = new MarginPadding { Top = 5 }, From 92cf8415897a0d59f655f364649ce3eb13dec462 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 1 Dec 2016 16:14:28 -0500 Subject: [PATCH 28/79] Add and wire up all sliderbar-based options --- .../Options/Audio/OffsetAdjustmentOptions.cs | 7 ++---- .../Overlays/Options/Audio/VolumeOptions.cs | 6 ++--- .../Gameplay/GeneralGameplayOptions.cs | 9 +++---- .../Gameplay/SongSelectGameplayOptions.cs | 24 +++++++++---------- .../Options/Graphics/LayoutOptions.cs | 11 ++++----- osu.Game/Overlays/Options/OptionsSlider.cs | 9 +++---- 6 files changed, 28 insertions(+), 38 deletions(-) diff --git a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs index 4d9598fabe..edb22f2ed4 100644 --- a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs +++ b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs @@ -19,14 +19,11 @@ namespace osu.Game.Overlays.Options.Audio { Children = new Drawable[] { - // TODO: bindable int crap - /* - new OptionsSlider + new OptionsSlider { Label = "Universal Offset", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.Offset) + Bindable = (BindableInt)config.GetBindable(OsuConfig.Offset) }, - */ new OsuButton { RelativeSizeAxes = Axes.X, diff --git a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs index f7d2614a96..f5c209da22 100644 --- a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs +++ b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs @@ -20,9 +20,9 @@ namespace osu.Game.Overlays.Options.Audio { Children = new Drawable[] { - new OptionsSlider { Label = "Master", Bindable = audio.Volume }, - new OptionsSlider { Label = "Effect", Bindable = audio.VolumeSample }, - new OptionsSlider { Label = "Music", Bindable = audio.VolumeTrack }, + new OptionsSlider { Label = "Master", Bindable = audio.Volume }, + new OptionsSlider { Label = "Effect", Bindable = audio.VolumeSample }, + new OptionsSlider { Label = "Music", Bindable = audio.VolumeTrack }, new CheckBoxOption { LabelText = "Ignore beatmap hitsounds", diff --git a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs index 81143c6127..1fc06afa2a 100644 --- a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs @@ -20,17 +20,14 @@ namespace osu.Game.Overlays.Options.Gameplay { Children = new Drawable[] { - // TODO: bindable int stuff - /* - new OptionsSlider + new OptionsSlider { Label = "Background dim", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.DimLevel) + Bindable = (BindableInt)config.GetBindable(OsuConfig.DimLevel) }, - */ new SpriteText { Text = "Progress display: TODO dropdown" }, new SpriteText { Text = "Score meter type: TODO dropdown" }, - new OptionsSlider + new OptionsSlider { Label = "Score meter size", Bindable = (BindableDouble)config.GetBindable(OsuConfig.ScoreMeterScale) diff --git a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs index c4591976e3..638d12fd4a 100644 --- a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs @@ -15,37 +15,35 @@ namespace osu.Game.Overlays.Options.Gameplay { protected override string Header => "Song Select"; - //private BindableInt starMinimum, starMaximum; - //private StarCounter counterMin, counterMax; + private BindableInt starMinimum, starMaximum; + private StarCounter counterMin, counterMax; [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - // TODO: Deal with bindable ints - /* - starMinimum = config.GetBindable(OsuConfig.DisplayStarsMinimum); - starMaximum = config.GetBindable(OsuConfig.DisplayStarsMaximum); + starMinimum = (BindableInt)config.GetBindable(OsuConfig.DisplayStarsMinimum); + starMaximum = (BindableInt)config.GetBindable(OsuConfig.DisplayStarsMaximum); Children = new Drawable[] { - new OptionsSlider { Label = "Display beatmaps from", Bindable = starMinimum }, + new OptionsSlider { Label = "Display beatmaps from", Bindable = starMinimum }, counterMin = new StarCounter { Count = starMinimum.Value }, - new OptionsSlider { Label = "up to", Bindable = starMaximum }, + new OptionsSlider { Label = "up to", Bindable = starMaximum }, counterMax = new StarCounter { Count = starMaximum.Value }, }; starMinimum.ValueChanged += starValueChanged; - starMaximum.ValueChanged += starValueChanged;*/ + starMaximum.ValueChanged += starValueChanged; } private void starValueChanged(object sender, EventArgs e) { - //counterMin.Count = starMinimum.Value; - //counterMax.Count = starMaximum.Value; + counterMin.Count = starMinimum.Value; + counterMax.Count = starMaximum.Value; } protected override void Dispose(bool isDisposing) { - //starMinimum.ValueChanged -= starValueChanged; - //starMaximum.ValueChanged -= starValueChanged; + starMinimum.ValueChanged -= starValueChanged; + starMaximum.ValueChanged -= starValueChanged; base.Dispose(isDisposing); } } diff --git a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs index d4243a24b1..cd98eacd10 100644 --- a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs @@ -31,19 +31,16 @@ namespace osu.Game.Overlays.Options.Graphics LabelText = "Letterboxing", Bindable = config.GetBindable(OsuConfig.Letterboxing), }, - // TODO: deal with bindable ints - /* - new OptionsSlider + new OptionsSlider { Label = "Horizontal position", - Bindable = config.GetBindable(OsuConfig.LetterboxPositionX) + Bindable = (BindableInt)config.GetBindable(OsuConfig.LetterboxPositionX) }, - new OptionsSlider + new OptionsSlider { Label = "Vertical position", - Bindable = config.GetBindable(OsuConfig.LetterboxPositionY) + Bindable = (BindableInt)config.GetBindable(OsuConfig.LetterboxPositionY) }, - */ }; } } diff --git a/osu.Game/Overlays/Options/OptionsSlider.cs b/osu.Game/Overlays/Options/OptionsSlider.cs index 9f6e4e1552..5f335974be 100644 --- a/osu.Game/Overlays/Options/OptionsSlider.cs +++ b/osu.Game/Overlays/Options/OptionsSlider.cs @@ -9,9 +9,10 @@ using osu.Framework.Graphics.UserInterface; namespace osu.Game.Overlays.Options { - public class OptionsSlider : FlowContainer + public class OptionsSlider : FlowContainer where T : struct, + IComparable, IFormattable, IConvertible, IComparable, IEquatable { - private SliderBar slider; + private SliderBar slider; private SpriteText text; public string Label @@ -24,7 +25,7 @@ namespace osu.Game.Overlays.Options } } - public BindableDouble Bindable + public BindableNumber Bindable { get { return slider.Bindable; } set { slider.Bindable = value; } @@ -38,7 +39,7 @@ namespace osu.Game.Overlays.Options Children = new Drawable[] { text = new SpriteText { Alpha = 0 }, - slider = new SliderBar + slider = new SliderBar { Margin = new MarginPadding { Top = 5 }, Height = 10, From b97902d006fec571f324a660af08bde50692b3cd Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 1 Dec 2016 17:30:53 -0500 Subject: [PATCH 29/79] Add missing sliders --- osu.Game/Overlays/Options/Input/MouseOptions.cs | 6 ++++++ osu.Game/Overlays/Options/SkinSection.cs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/osu.Game/Overlays/Options/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Input/MouseOptions.cs index 4e57d262f6..785c55e148 100644 --- a/osu.Game/Overlays/Options/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Input/MouseOptions.cs @@ -3,6 +3,7 @@ using osu.Framework; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; @@ -26,6 +27,11 @@ namespace osu.Game.Overlays.Options.Input Children = new Drawable[] { new SpriteText { Text = "Sensitivity: TODO slider" }, + new OptionsSlider + { + Label = "Sensitivity", + Bindable = (BindableDouble)config.GetBindable(OsuConfig.MouseSpeed), + }, rawInput = new CheckBoxOption { LabelText = "Raw input", diff --git a/osu.Game/Overlays/Options/SkinSection.cs b/osu.Game/Overlays/Options/SkinSection.cs index e552b54160..e69cc1f119 100644 --- a/osu.Game/Overlays/Options/SkinSection.cs +++ b/osu.Game/Overlays/Options/SkinSection.cs @@ -4,6 +4,7 @@ using OpenTK; using osu.Framework; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; @@ -62,6 +63,11 @@ namespace osu.Game.Overlays.Options Bindable = config.GetBindable(OsuConfig.UseSkinCursor) }, new SpriteText { Text = "Cursor size: TODO slider" }, + new OptionsSlider + { + Label = "Cursor size", + Bindable = (BindableDouble)config.GetBindable(OsuConfig.CursorSize) + }, new CheckBoxOption { LabelText = "Automatic cursor size", From ff7ec88e66fa50a31cb3e5d0c11d3af2edf10dbb Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 1 Dec 2016 17:31:21 -0500 Subject: [PATCH 30/79] s/OptionsSlider/SliderOption/g --- .../Overlays/Options/Audio/OffsetAdjustmentOptions.cs | 4 ++-- osu.Game/Overlays/Options/Audio/VolumeOptions.cs | 6 +++--- .../Overlays/Options/Gameplay/GeneralGameplayOptions.cs | 8 ++++---- .../Options/Gameplay/SongSelectGameplayOptions.cs | 4 ++-- osu.Game/Overlays/Options/Graphics/LayoutOptions.cs | 8 ++++---- osu.Game/Overlays/Options/Input/MouseOptions.cs | 4 ++-- osu.Game/Overlays/Options/SkinSection.cs | 4 ++-- .../Options/{OptionsSlider.cs => SliderOption.cs} | 6 +++--- osu.Game/osu.Game.csproj | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) rename osu.Game/Overlays/Options/{OptionsSlider.cs => SliderOption.cs} (91%) diff --git a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs index edb22f2ed4..df1d6aa9f9 100644 --- a/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs +++ b/osu.Game/Overlays/Options/Audio/OffsetAdjustmentOptions.cs @@ -19,9 +19,9 @@ namespace osu.Game.Overlays.Options.Audio { Children = new Drawable[] { - new OptionsSlider + new SliderOption { - Label = "Universal Offset", + LabelText = "Universal Offset", Bindable = (BindableInt)config.GetBindable(OsuConfig.Offset) }, new OsuButton diff --git a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs index f5c209da22..216e2e866d 100644 --- a/osu.Game/Overlays/Options/Audio/VolumeOptions.cs +++ b/osu.Game/Overlays/Options/Audio/VolumeOptions.cs @@ -20,9 +20,9 @@ namespace osu.Game.Overlays.Options.Audio { Children = new Drawable[] { - new OptionsSlider { Label = "Master", Bindable = audio.Volume }, - new OptionsSlider { Label = "Effect", Bindable = audio.VolumeSample }, - new OptionsSlider { Label = "Music", Bindable = audio.VolumeTrack }, + new SliderOption { LabelText = "Master", Bindable = audio.Volume }, + new SliderOption { LabelText = "Effect", Bindable = audio.VolumeSample }, + new SliderOption { LabelText = "Music", Bindable = audio.VolumeTrack }, new CheckBoxOption { LabelText = "Ignore beatmap hitsounds", diff --git a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs index 1fc06afa2a..15607c9bde 100644 --- a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs @@ -20,16 +20,16 @@ namespace osu.Game.Overlays.Options.Gameplay { Children = new Drawable[] { - new OptionsSlider + new SliderOption { - Label = "Background dim", + LabelText = "Background dim", Bindable = (BindableInt)config.GetBindable(OsuConfig.DimLevel) }, new SpriteText { Text = "Progress display: TODO dropdown" }, new SpriteText { Text = "Score meter type: TODO dropdown" }, - new OptionsSlider + new SliderOption { - Label = "Score meter size", + LabelText = "Score meter size", Bindable = (BindableDouble)config.GetBindable(OsuConfig.ScoreMeterScale) }, new CheckBoxOption diff --git a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs index 638d12fd4a..63453f336d 100644 --- a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs @@ -25,9 +25,9 @@ namespace osu.Game.Overlays.Options.Gameplay starMaximum = (BindableInt)config.GetBindable(OsuConfig.DisplayStarsMaximum); Children = new Drawable[] { - new OptionsSlider { Label = "Display beatmaps from", Bindable = starMinimum }, + new SliderOption { LabelText = "Display beatmaps from", Bindable = starMinimum }, counterMin = new StarCounter { Count = starMinimum.Value }, - new OptionsSlider { Label = "up to", Bindable = starMaximum }, + new SliderOption { LabelText = "up to", Bindable = starMaximum }, counterMax = new StarCounter { Count = starMaximum.Value }, }; starMinimum.ValueChanged += starValueChanged; diff --git a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs index cd98eacd10..e050f7c70c 100644 --- a/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/LayoutOptions.cs @@ -31,14 +31,14 @@ namespace osu.Game.Overlays.Options.Graphics LabelText = "Letterboxing", Bindable = config.GetBindable(OsuConfig.Letterboxing), }, - new OptionsSlider + new SliderOption { - Label = "Horizontal position", + LabelText = "Horizontal position", Bindable = (BindableInt)config.GetBindable(OsuConfig.LetterboxPositionX) }, - new OptionsSlider + new SliderOption { - Label = "Vertical position", + LabelText = "Vertical position", Bindable = (BindableInt)config.GetBindable(OsuConfig.LetterboxPositionY) }, }; diff --git a/osu.Game/Overlays/Options/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Input/MouseOptions.cs index 785c55e148..b1a1dfa5bc 100644 --- a/osu.Game/Overlays/Options/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Input/MouseOptions.cs @@ -27,9 +27,9 @@ namespace osu.Game.Overlays.Options.Input Children = new Drawable[] { new SpriteText { Text = "Sensitivity: TODO slider" }, - new OptionsSlider + new SliderOption { - Label = "Sensitivity", + LabelText = "Sensitivity", Bindable = (BindableDouble)config.GetBindable(OsuConfig.MouseSpeed), }, rawInput = new CheckBoxOption diff --git a/osu.Game/Overlays/Options/SkinSection.cs b/osu.Game/Overlays/Options/SkinSection.cs index e69cc1f119..de88570a0e 100644 --- a/osu.Game/Overlays/Options/SkinSection.cs +++ b/osu.Game/Overlays/Options/SkinSection.cs @@ -63,9 +63,9 @@ namespace osu.Game.Overlays.Options Bindable = config.GetBindable(OsuConfig.UseSkinCursor) }, new SpriteText { Text = "Cursor size: TODO slider" }, - new OptionsSlider + new SliderOption { - Label = "Cursor size", + LabelText = "Cursor size", Bindable = (BindableDouble)config.GetBindable(OsuConfig.CursorSize) }, new CheckBoxOption diff --git a/osu.Game/Overlays/Options/OptionsSlider.cs b/osu.Game/Overlays/Options/SliderOption.cs similarity index 91% rename from osu.Game/Overlays/Options/OptionsSlider.cs rename to osu.Game/Overlays/Options/SliderOption.cs index 5f335974be..d00eeebe35 100644 --- a/osu.Game/Overlays/Options/OptionsSlider.cs +++ b/osu.Game/Overlays/Options/SliderOption.cs @@ -9,13 +9,13 @@ using osu.Framework.Graphics.UserInterface; namespace osu.Game.Overlays.Options { - public class OptionsSlider : FlowContainer where T : struct, + public class SliderOption : FlowContainer where T : struct, IComparable, IFormattable, IConvertible, IComparable, IEquatable { private SliderBar slider; private SpriteText text; - public string Label + public string LabelText { get { return text.Text; } set @@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Options set { slider.Bindable = value; } } - public OptionsSlider() + public SliderOption() { Direction = FlowDirection.VerticalOnly; RelativeSizeAxes = Axes.X; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index e03f8f3337..2e5367d44b 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -222,7 +222,7 @@ - + From 9daf52412091741cff8628a2b406e234aa50f0d3 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 1 Dec 2016 16:36:04 -0500 Subject: [PATCH 31/79] Add OptionsDropdown and wire up one example --- osu.Game/Configuration/OsuConfigManager.cs | 2 +- osu.Game/Configuration/ProgressBarType.cs | 12 ++++ .../Gameplay/GeneralGameplayOptions.cs | 6 +- osu.Game/Overlays/Options/OptionsDropdown.cs | 70 +++++++++++++++++++ osu.Game/osu.Game.csproj | 4 +- 5 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 osu.Game/Configuration/ProgressBarType.cs create mode 100644 osu.Game/Overlays/Options/OptionsDropdown.cs diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index ef95a3ac3f..5a1d6e79ef 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -110,7 +110,7 @@ namespace osu.Game.Configuration Set(OsuConfig.NotifyFriends, true); Set(OsuConfig.NotifySubmittedThread, true); Set(OsuConfig.PopupDuringGameplay, true); - //Set(OsuConfig.ProgressBarType, ProgressBarTypes.Pie); + Set(OsuConfig.ProgressBarType, ProgressBarType.Pie); //Set(OsuConfig.RankType, RankingType.Top); Set(OsuConfig.RefreshRate, 60); Set(OsuConfig.OverrideRefreshRate, Get(OsuConfig.RefreshRate) != 60); diff --git a/osu.Game/Configuration/ProgressBarType.cs b/osu.Game/Configuration/ProgressBarType.cs new file mode 100644 index 0000000000..15f1e35712 --- /dev/null +++ b/osu.Game/Configuration/ProgressBarType.cs @@ -0,0 +1,12 @@ +using System; +namespace osu.Game.Configuration +{ + public enum ProgressBarType + { + Off, + Pie, + TopRight, + BottomRight, + Bottom + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs index 15607c9bde..be791161ec 100644 --- a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs @@ -25,7 +25,11 @@ namespace osu.Game.Overlays.Options.Gameplay LabelText = "Background dim", Bindable = (BindableInt)config.GetBindable(OsuConfig.DimLevel) }, - new SpriteText { Text = "Progress display: TODO dropdown" }, + new OptionsDropdown + { + Label = "Progress display", + Bindable = config.GetBindable(OsuConfig.ProgressBarType) + }, new SpriteText { Text = "Score meter type: TODO dropdown" }, new SliderOption { diff --git a/osu.Game/Overlays/Options/OptionsDropdown.cs b/osu.Game/Overlays/Options/OptionsDropdown.cs new file mode 100644 index 0000000000..d1641cd8cf --- /dev/null +++ b/osu.Game/Overlays/Options/OptionsDropdown.cs @@ -0,0 +1,70 @@ +using System; +using System.Linq; +using OpenTK.Graphics; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; + +namespace osu.Game.Overlays.Options +{ + public class OptionsDropdown : FlowContainer + { + private DropDownMenu dropdown; + private SpriteText text; + + public string Label + { + get { return text.Text; } + set + { + text.Text = value; + text.Alpha = string.IsNullOrEmpty(value) ? 0 : 1; + } + } + + public Bindable Bindable + { + get { return bindable; } + set + { + if (bindable != null) + bindable.ValueChanged -= Bindable_ValueChanged; + bindable = value; + bindable.ValueChanged += Bindable_ValueChanged; + Bindable_ValueChanged(null, null); + } + } + + private Bindable bindable; + + void Bindable_ValueChanged(object sender, EventArgs e) + { + dropdown.SelectedValue = bindable.Value; + } + + public OptionsDropdown() + { + if (!typeof(T).IsEnum) + throw new InvalidOperationException("OptionsDropdown only supports enums as the generic type argument"); + Direction = FlowDirection.VerticalOnly; + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + var items = Enum.GetNames(typeof(T)).Zip( + (T[])Enum.GetValues(typeof(T)), (a, b) => new Tuple(a, b)); + Children = new Drawable[] + { + text = new SpriteText { Alpha = 0 }, + dropdown = new DropDownMenu + { + Margin = new MarginPadding { Top = 5 }, + Height = 10, + RelativeSizeAxes = Axes.X, + Items = items.Select(item => new DropDownMenuItem(item.Item1, item.Item2)) + } + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 2e5367d44b..eda53c848b 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -223,6 +223,8 @@ + + @@ -251,4 +253,4 @@ --> - \ No newline at end of file + From 0378de83466810fce0c867514e7a7e02da949d38 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 1 Dec 2016 16:45:43 -0500 Subject: [PATCH 32/79] Add DisplayName --- osu.Game/Configuration/DisplayNameAttribute.cs | 15 +++++++++++++++ osu.Game/Configuration/ProgressBarType.cs | 5 ++++- osu.Game/Overlays/Options/OptionsDropdown.cs | 7 +++++-- osu.Game/osu.Game.csproj | 1 + 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 osu.Game/Configuration/DisplayNameAttribute.cs diff --git a/osu.Game/Configuration/DisplayNameAttribute.cs b/osu.Game/Configuration/DisplayNameAttribute.cs new file mode 100644 index 0000000000..1665dec2dd --- /dev/null +++ b/osu.Game/Configuration/DisplayNameAttribute.cs @@ -0,0 +1,15 @@ +using System; +namespace osu.Game.Configuration +{ + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class DisplayNameAttribute : Attribute + { + public string Name { get; set; } + + public DisplayNameAttribute(string name) + { + Name = name; + } + } +} + diff --git a/osu.Game/Configuration/ProgressBarType.cs b/osu.Game/Configuration/ProgressBarType.cs index 15f1e35712..06db19d392 100644 --- a/osu.Game/Configuration/ProgressBarType.cs +++ b/osu.Game/Configuration/ProgressBarType.cs @@ -1,11 +1,14 @@ -using System; +using System; + namespace osu.Game.Configuration { public enum ProgressBarType { Off, Pie, + [DisplayName("Top Right")] TopRight, + [DisplayName("Bottom Right")] BottomRight, Bottom } diff --git a/osu.Game/Overlays/Options/OptionsDropdown.cs b/osu.Game/Overlays/Options/OptionsDropdown.cs index d1641cd8cf..8e5a14e32f 100644 --- a/osu.Game/Overlays/Options/OptionsDropdown.cs +++ b/osu.Game/Overlays/Options/OptionsDropdown.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Reflection; using OpenTK.Graphics; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -7,6 +8,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; +using osu.Game.Configuration; namespace osu.Game.Overlays.Options { @@ -52,8 +54,9 @@ namespace osu.Game.Overlays.Options Direction = FlowDirection.VerticalOnly; RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - var items = Enum.GetNames(typeof(T)).Zip( - (T[])Enum.GetValues(typeof(T)), (a, b) => new Tuple(a, b)); + var items = typeof(T).GetFields().Where(f => !f.IsSpecialName).Zip( + (T[])Enum.GetValues(typeof(T)), (a, b) => new Tuple( + a.GetCustomAttribute()?.Name ?? a.Name, b)); Children = new Drawable[] { text = new SpriteText { Alpha = 0 }, diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index eda53c848b..11dfe0eebe 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -225,6 +225,7 @@ + From 4757a1c4338cb2ba67a9e552c733f8db4623326c Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 1 Dec 2016 17:28:20 -0500 Subject: [PATCH 33/79] Wire up enum-backed dropdowns --- osu.Game/Configuration/ConfineMouseMode.cs | 10 +++++++++ osu.Game/Configuration/FrameSync.cs | 12 ++++++++++ osu.Game/Configuration/HiddenAttribute.cs | 10 +++++++++ osu.Game/Configuration/OsuConfigManager.cs | 16 ++++++++++---- osu.Game/Configuration/RankingType.cs | 14 ++++++++++++ osu.Game/Configuration/ReleaseStream.cs | 11 ++++++++++ osu.Game/Configuration/ScoreMeterType.cs | 10 +++++++++ osu.Game/Configuration/ScreenshotFormat.cs | 12 ++++++++++ .../Gameplay/GeneralGameplayOptions.cs | 8 +++++-- .../Overlays/Options/General/UpdateOptions.cs | 9 ++++++-- .../Options/Graphics/DetailOptions.cs | 6 ++++- .../Options/Graphics/RendererOptions.cs | 7 +++++- .../Overlays/Options/Input/MouseOptions.cs | 22 +++++++++---------- osu.Game/osu.Game.csproj | 6 +++++ 14 files changed, 131 insertions(+), 22 deletions(-) create mode 100644 osu.Game/Configuration/ConfineMouseMode.cs create mode 100644 osu.Game/Configuration/FrameSync.cs create mode 100644 osu.Game/Configuration/HiddenAttribute.cs create mode 100644 osu.Game/Configuration/RankingType.cs create mode 100644 osu.Game/Configuration/ReleaseStream.cs create mode 100644 osu.Game/Configuration/ScoreMeterType.cs create mode 100644 osu.Game/Configuration/ScreenshotFormat.cs diff --git a/osu.Game/Configuration/ConfineMouseMode.cs b/osu.Game/Configuration/ConfineMouseMode.cs new file mode 100644 index 0000000000..1af9f86d35 --- /dev/null +++ b/osu.Game/Configuration/ConfineMouseMode.cs @@ -0,0 +1,10 @@ +using System; +namespace osu.Game.Configuration +{ + public enum ConfineMouseMode + { + Never, + Fullscreen, + Always + } +} \ No newline at end of file diff --git a/osu.Game/Configuration/FrameSync.cs b/osu.Game/Configuration/FrameSync.cs new file mode 100644 index 0000000000..fc8a26db04 --- /dev/null +++ b/osu.Game/Configuration/FrameSync.cs @@ -0,0 +1,12 @@ +using System; +namespace osu.Game.Configuration +{ + public enum FrameSync + { + VSync = 1, + Limit120 = 0, + Unlimited = 2, + CompletelyUnlimited = 4, + Custom = 5 + } +} \ No newline at end of file diff --git a/osu.Game/Configuration/HiddenAttribute.cs b/osu.Game/Configuration/HiddenAttribute.cs new file mode 100644 index 0000000000..b8763a3fdd --- /dev/null +++ b/osu.Game/Configuration/HiddenAttribute.cs @@ -0,0 +1,10 @@ +using System; +namespace osu.Game.Configuration +{ + public class HiddenAttribute + { + public HiddenAttribute() + { + } + } +} \ No newline at end of file diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 5a1d6e79ef..ccfa323a8a 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -1,6 +1,7 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Configuration; using osu.Framework.Platform; using osu.Game.Modes; @@ -11,6 +12,7 @@ namespace osu.Game.Configuration { protected override void InitialiseDefaults() { +#pragma warning disable CS0612 // Type or member is obsolete Set(OsuConfig.Width, 1366, 640); Set(OsuConfig.Height, 768, 480); Set(OsuConfig.MouseSpeed, 1.0); @@ -111,17 +113,18 @@ namespace osu.Game.Configuration Set(OsuConfig.NotifySubmittedThread, true); Set(OsuConfig.PopupDuringGameplay, true); Set(OsuConfig.ProgressBarType, ProgressBarType.Pie); - //Set(OsuConfig.RankType, RankingType.Top); + Set(OsuConfig.RankType, RankingType.Top); Set(OsuConfig.RefreshRate, 60); Set(OsuConfig.OverrideRefreshRate, Get(OsuConfig.RefreshRate) != 60); //Set(OsuConfig.ScaleMode, ScaleMode.WidescreenConservative); Set(OsuConfig.ScoreboardVisible, true); + Set(OsuConfig.ScoreMeter, ScoreMeterType.Error); //Set(OsuConfig.ScoreMeter, OsuGame.Tournament ? ScoreMeterType.Colour : ScoreMeterType.Error); Set(OsuConfig.ScreenshotId, 0); Set(OsuConfig.MenuSnow, false); Set(OsuConfig.MenuTriangles, true); Set(OsuConfig.SongSelectThumbnails, true); - //Set(OsuConfig.ScreenshotFormat, ImageFileFormat.Jpg); + Set(OsuConfig.ScreenshotFormat, ScreenshotFormat.Jpg); Set(OsuConfig.ShowReplayComments, true); Set(OsuConfig.ShowSpectators, true); Set(OsuConfig.ShowStoryboard, true); @@ -154,7 +157,7 @@ namespace osu.Game.Configuration Set(OsuConfig.DisplayStarsMaximum, 10, 0, 10); Set(OsuConfig.DisplayStarsMinimum, 0, 0, 10); Set(OsuConfig.AudioDevice, string.Empty); - //Set(OsuConfig.ReleaseStream, ReleaseStream.Lazer, true); + Set(OsuConfig.ReleaseStream, ReleaseStream.Lazer); Set(OsuConfig.UpdateFailCount, 0); Set(OsuConfig.SavePassword, false); Set(OsuConfig.SaveUsername, true); @@ -163,7 +166,7 @@ namespace osu.Game.Configuration Set(OsuConfig.Letterboxing, Get(OsuConfig.Fullscreen)); Set(OsuConfig.LetterboxPositionX, 0, -100, 100); Set(OsuConfig.LetterboxPositionY, 0, -100, 100); - //Set(OsuConfig.FrameSync, FrameSync.Limit120); + Set(OsuConfig.FrameSync, FrameSync.Limit120); bool unicodeDefault = false; switch (Get(OsuConfig.Language)) { @@ -178,6 +181,9 @@ namespace osu.Game.Configuration Set(OsuConfig.Ticker, false); Set(OsuConfig.CompatibilityContext, false); Set(OsuConfig.CanForceOptimusCompatibility, true); + Set(OsuConfig.ConfineMouse, Get(OsuConfig.ConfineMouseToFullscreen) ? + ConfineMouseMode.Fullscreen : ConfineMouseMode.Never); +#pragma warning restore CS0612 // Type or member is obsolete } //todo: make a UnicodeString class/struct rather than requiring this helper method. @@ -322,6 +328,8 @@ namespace osu.Game.Configuration RawInput, AbsoluteToOsuWindow, ConfineMouse, + [Obsolete] + ConfineMouseToFullscreen, ShowMenuTips, HiddenShowFirstApproach, ComboColourSliderBall, diff --git a/osu.Game/Configuration/RankingType.cs b/osu.Game/Configuration/RankingType.cs new file mode 100644 index 0000000000..5cfc7df549 --- /dev/null +++ b/osu.Game/Configuration/RankingType.cs @@ -0,0 +1,14 @@ +using System; +namespace osu.Game.Configuration +{ + public enum RankingType + { + Local, + [DisplayName("Global")] + Top, + [DisplayName("Selected Mods")] + SelectedMod, + Friends, + Country + } +} \ No newline at end of file diff --git a/osu.Game/Configuration/ReleaseStream.cs b/osu.Game/Configuration/ReleaseStream.cs new file mode 100644 index 0000000000..a03b2376a3 --- /dev/null +++ b/osu.Game/Configuration/ReleaseStream.cs @@ -0,0 +1,11 @@ +using System; +namespace osu.Game.Configuration +{ + public enum ReleaseStream + { + Lazer, + //Stable40, + //Beta40, + //Stable + } +} \ No newline at end of file diff --git a/osu.Game/Configuration/ScoreMeterType.cs b/osu.Game/Configuration/ScoreMeterType.cs new file mode 100644 index 0000000000..786de6b6bf --- /dev/null +++ b/osu.Game/Configuration/ScoreMeterType.cs @@ -0,0 +1,10 @@ +using System; +namespace osu.Game.Configuration +{ + public enum ScoreMeterType + { + None, + Colour, + Error + } +} \ No newline at end of file diff --git a/osu.Game/Configuration/ScreenshotFormat.cs b/osu.Game/Configuration/ScreenshotFormat.cs new file mode 100644 index 0000000000..81a734283c --- /dev/null +++ b/osu.Game/Configuration/ScreenshotFormat.cs @@ -0,0 +1,12 @@ +using System; +namespace osu.Game.Configuration +{ + public enum ScreenshotFormat + { + Bmp = 0, // TODO: Figure out the best way to hide this from the dropdown + [DisplayName("JPG (web-friendly)")] + Jpg = 1, + [DisplayName("PNG (lossless)")] + Png = 2 + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs index be791161ec..e5b1ed2d90 100644 --- a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs @@ -30,7 +30,11 @@ namespace osu.Game.Overlays.Options.Gameplay Label = "Progress display", Bindable = config.GetBindable(OsuConfig.ProgressBarType) }, - new SpriteText { Text = "Score meter type: TODO dropdown" }, + new OptionsDropdown + { + Label = "Score meter type", + Bindable = config.GetBindable(OsuConfig.ScoreMeter) + }, new SliderOption { LabelText = "Score meter size", @@ -59,4 +63,4 @@ namespace osu.Game.Overlays.Options.Gameplay }; } } -} +} diff --git a/osu.Game/Overlays/Options/General/UpdateOptions.cs b/osu.Game/Overlays/Options/General/UpdateOptions.cs index f7dfc2d813..6401afc734 100644 --- a/osu.Game/Overlays/Options/General/UpdateOptions.cs +++ b/osu.Game/Overlays/Options/General/UpdateOptions.cs @@ -6,6 +6,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Platform; +using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Options.General @@ -15,11 +16,15 @@ namespace osu.Game.Overlays.Options.General protected override string Header => "Updates"; [BackgroundDependencyLoader] - private void load(BasicStorage storage) + private void load(BasicStorage storage, OsuConfigManager config) { Children = new Drawable[] { - new SpriteText { Text = "TODO: Dropdown" }, + new OptionsDropdown + { + Label = "Release stream", + Bindable = config.GetBindable(OsuConfig.ReleaseStream), + }, new SpriteText { Text = "Your osu! is up to date" }, // TODO: map this to reality new OsuButton { diff --git a/osu.Game/Overlays/Options/Graphics/DetailOptions.cs b/osu.Game/Overlays/Options/Graphics/DetailOptions.cs index a885b99b1c..e37d718e3e 100644 --- a/osu.Game/Overlays/Options/Graphics/DetailOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/DetailOptions.cs @@ -57,7 +57,11 @@ namespace osu.Game.Overlays.Options.Graphics LabelText = "Softening filter", Bindable = config.GetBindable(OsuConfig.BloomSoftening) }, - new SpriteText { Text = "Screenshot format TODO: dropdown" } + new OptionsDropdown + { + Label = "Screenshot", + Bindable = config.GetBindable(OsuConfig.ScreenshotFormat) + } }; } } diff --git a/osu.Game/Overlays/Options/Graphics/RendererOptions.cs b/osu.Game/Overlays/Options/Graphics/RendererOptions.cs index b9d81944d4..0c269d90c3 100644 --- a/osu.Game/Overlays/Options/Graphics/RendererOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/RendererOptions.cs @@ -20,7 +20,12 @@ namespace osu.Game.Overlays.Options.Graphics // NOTE: Compatability mode omitted Children = new Drawable[] { - new SpriteText { Text = "Frame limiter: TODO dropdown" }, + // TODO: this needs to be a custom dropdown at some point + new OptionsDropdown + { + Label = "Frame limiter", + Bindable = config.GetBindable(OsuConfig.FrameSync) + }, new CheckBoxOption { LabelText = "Show FPS counter", diff --git a/osu.Game/Overlays/Options/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Input/MouseOptions.cs index b1a1dfa5bc..3ab4959fbe 100644 --- a/osu.Game/Overlays/Options/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Input/MouseOptions.cs @@ -15,12 +15,6 @@ namespace osu.Game.Overlays.Options.Input { protected override string Header => "Mouse"; - private CheckBoxOption rawInput, mapRawInput, disableWheel, disableButtons, enableRipples; - - public MouseOptions() - { - } - [BackgroundDependencyLoader] private void load(OsuConfigManager config) { @@ -32,28 +26,32 @@ namespace osu.Game.Overlays.Options.Input LabelText = "Sensitivity", Bindable = (BindableDouble)config.GetBindable(OsuConfig.MouseSpeed), }, - rawInput = new CheckBoxOption + new CheckBoxOption { LabelText = "Raw input", Bindable = config.GetBindable(OsuConfig.RawInput) }, - mapRawInput = new CheckBoxOption + new CheckBoxOption { LabelText = "Map absolute raw input to the osu! window", Bindable = config.GetBindable(OsuConfig.AbsoluteToOsuWindow) }, - new SpriteText { Text = "Confine mouse cursor: TODO dropdown" }, - disableWheel = new CheckBoxOption + new OptionsDropdown + { + Label = "Confine mouse cursor", + Bindable = config.GetBindable(OsuConfig.ConfineMouse), + }, + new CheckBoxOption { LabelText = "Disable mouse wheel in play mode", Bindable = config.GetBindable(OsuConfig.MouseDisableWheel) }, - disableButtons = new CheckBoxOption + new CheckBoxOption { LabelText = "Disable mouse buttons in play mode", Bindable = config.GetBindable(OsuConfig.MouseDisableButtons) }, - enableRipples = new CheckBoxOption + new CheckBoxOption { LabelText = "Cursor ripples", Bindable = config.GetBindable(OsuConfig.CursorRipple) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 11dfe0eebe..a078a78baa 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -226,6 +226,12 @@ + + + + + + From 5456e0102c78ee6807b0677b4f291f111867284f Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 1 Dec 2016 17:33:30 -0500 Subject: [PATCH 34/79] s/OptionsDropdown/DropdownOption/g --- .../Options/{OptionsDropdown.cs => DropdownOption.cs} | 6 +++--- .../Overlays/Options/Gameplay/GeneralGameplayOptions.cs | 8 ++++---- osu.Game/Overlays/Options/General/UpdateOptions.cs | 2 +- osu.Game/Overlays/Options/Graphics/DetailOptions.cs | 4 ++-- osu.Game/Overlays/Options/Graphics/RendererOptions.cs | 4 ++-- osu.Game/Overlays/Options/Input/MouseOptions.cs | 4 ++-- osu.Game/osu.Game.csproj | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) rename osu.Game/Overlays/Options/{OptionsDropdown.cs => DropdownOption.cs} (92%) diff --git a/osu.Game/Overlays/Options/OptionsDropdown.cs b/osu.Game/Overlays/Options/DropdownOption.cs similarity index 92% rename from osu.Game/Overlays/Options/OptionsDropdown.cs rename to osu.Game/Overlays/Options/DropdownOption.cs index 8e5a14e32f..71fb4720c3 100644 --- a/osu.Game/Overlays/Options/OptionsDropdown.cs +++ b/osu.Game/Overlays/Options/DropdownOption.cs @@ -12,12 +12,12 @@ using osu.Game.Configuration; namespace osu.Game.Overlays.Options { - public class OptionsDropdown : FlowContainer + public class DropdownOption : FlowContainer { private DropDownMenu dropdown; private SpriteText text; - public string Label + public string LabelText { get { return text.Text; } set @@ -47,7 +47,7 @@ namespace osu.Game.Overlays.Options dropdown.SelectedValue = bindable.Value; } - public OptionsDropdown() + public DropdownOption() { if (!typeof(T).IsEnum) throw new InvalidOperationException("OptionsDropdown only supports enums as the generic type argument"); diff --git a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs index e5b1ed2d90..15ee80102d 100644 --- a/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/GeneralGameplayOptions.cs @@ -25,14 +25,14 @@ namespace osu.Game.Overlays.Options.Gameplay LabelText = "Background dim", Bindable = (BindableInt)config.GetBindable(OsuConfig.DimLevel) }, - new OptionsDropdown + new DropdownOption { - Label = "Progress display", + LabelText = "Progress display", Bindable = config.GetBindable(OsuConfig.ProgressBarType) }, - new OptionsDropdown + new DropdownOption { - Label = "Score meter type", + LabelText = "Score meter type", Bindable = config.GetBindable(OsuConfig.ScoreMeter) }, new SliderOption diff --git a/osu.Game/Overlays/Options/General/UpdateOptions.cs b/osu.Game/Overlays/Options/General/UpdateOptions.cs index 6401afc734..e00790765c 100644 --- a/osu.Game/Overlays/Options/General/UpdateOptions.cs +++ b/osu.Game/Overlays/Options/General/UpdateOptions.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Options.General { Children = new Drawable[] { - new OptionsDropdown + new DropdownOption { Label = "Release stream", Bindable = config.GetBindable(OsuConfig.ReleaseStream), diff --git a/osu.Game/Overlays/Options/Graphics/DetailOptions.cs b/osu.Game/Overlays/Options/Graphics/DetailOptions.cs index e37d718e3e..51720410a9 100644 --- a/osu.Game/Overlays/Options/Graphics/DetailOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/DetailOptions.cs @@ -57,9 +57,9 @@ namespace osu.Game.Overlays.Options.Graphics LabelText = "Softening filter", Bindable = config.GetBindable(OsuConfig.BloomSoftening) }, - new OptionsDropdown + new DropdownOption { - Label = "Screenshot", + LabelText = "Screenshot", Bindable = config.GetBindable(OsuConfig.ScreenshotFormat) } }; diff --git a/osu.Game/Overlays/Options/Graphics/RendererOptions.cs b/osu.Game/Overlays/Options/Graphics/RendererOptions.cs index 0c269d90c3..6dce562c4b 100644 --- a/osu.Game/Overlays/Options/Graphics/RendererOptions.cs +++ b/osu.Game/Overlays/Options/Graphics/RendererOptions.cs @@ -21,9 +21,9 @@ namespace osu.Game.Overlays.Options.Graphics Children = new Drawable[] { // TODO: this needs to be a custom dropdown at some point - new OptionsDropdown + new DropdownOption { - Label = "Frame limiter", + LabelText = "Frame limiter", Bindable = config.GetBindable(OsuConfig.FrameSync) }, new CheckBoxOption diff --git a/osu.Game/Overlays/Options/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Input/MouseOptions.cs index 3ab4959fbe..9d0823ce07 100644 --- a/osu.Game/Overlays/Options/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Input/MouseOptions.cs @@ -36,9 +36,9 @@ namespace osu.Game.Overlays.Options.Input LabelText = "Map absolute raw input to the osu! window", Bindable = config.GetBindable(OsuConfig.AbsoluteToOsuWindow) }, - new OptionsDropdown + new DropdownOption { - Label = "Confine mouse cursor", + LabelText = "Confine mouse cursor", Bindable = config.GetBindable(OsuConfig.ConfineMouse), }, new CheckBoxOption diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index a078a78baa..affbbad2fe 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -224,7 +224,7 @@ - + From cf60c52f0066535d0cced2921b8c779992c507ae Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 1 Dec 2016 17:45:31 -0500 Subject: [PATCH 35/79] Switch to System.ComponentModel.Description --- osu.Game/Configuration/DisplayNameAttribute.cs | 15 --------------- osu.Game/Configuration/HiddenAttribute.cs | 10 ---------- osu.Game/Configuration/ProgressBarType.cs | 5 +++-- osu.Game/Configuration/RankingType.cs | 6 ++++-- osu.Game/Configuration/ScreenshotFormat.cs | 6 ++++-- osu.Game/Overlays/Options/DropdownOption.cs | 3 ++- .../Overlays/Options/General/UpdateOptions.cs | 2 +- osu.Game/osu.Game.csproj | 1 - 8 files changed, 14 insertions(+), 34 deletions(-) delete mode 100644 osu.Game/Configuration/DisplayNameAttribute.cs delete mode 100644 osu.Game/Configuration/HiddenAttribute.cs diff --git a/osu.Game/Configuration/DisplayNameAttribute.cs b/osu.Game/Configuration/DisplayNameAttribute.cs deleted file mode 100644 index 1665dec2dd..0000000000 --- a/osu.Game/Configuration/DisplayNameAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -namespace osu.Game.Configuration -{ - [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] - public class DisplayNameAttribute : Attribute - { - public string Name { get; set; } - - public DisplayNameAttribute(string name) - { - Name = name; - } - } -} - diff --git a/osu.Game/Configuration/HiddenAttribute.cs b/osu.Game/Configuration/HiddenAttribute.cs deleted file mode 100644 index b8763a3fdd..0000000000 --- a/osu.Game/Configuration/HiddenAttribute.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -namespace osu.Game.Configuration -{ - public class HiddenAttribute - { - public HiddenAttribute() - { - } - } -} \ No newline at end of file diff --git a/osu.Game/Configuration/ProgressBarType.cs b/osu.Game/Configuration/ProgressBarType.cs index 06db19d392..e252c84558 100644 --- a/osu.Game/Configuration/ProgressBarType.cs +++ b/osu.Game/Configuration/ProgressBarType.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel; namespace osu.Game.Configuration { @@ -6,9 +7,9 @@ namespace osu.Game.Configuration { Off, Pie, - [DisplayName("Top Right")] + [Description("Top Right")] TopRight, - [DisplayName("Bottom Right")] + [Description("Bottom Right")] BottomRight, Bottom } diff --git a/osu.Game/Configuration/RankingType.cs b/osu.Game/Configuration/RankingType.cs index 5cfc7df549..e2f0b4cd00 100644 --- a/osu.Game/Configuration/RankingType.cs +++ b/osu.Game/Configuration/RankingType.cs @@ -1,12 +1,14 @@ using System; +using System.ComponentModel; + namespace osu.Game.Configuration { public enum RankingType { Local, - [DisplayName("Global")] + [Description("Global")] Top, - [DisplayName("Selected Mods")] + [Description("Selected Mods")] SelectedMod, Friends, Country diff --git a/osu.Game/Configuration/ScreenshotFormat.cs b/osu.Game/Configuration/ScreenshotFormat.cs index 81a734283c..993678f0b9 100644 --- a/osu.Game/Configuration/ScreenshotFormat.cs +++ b/osu.Game/Configuration/ScreenshotFormat.cs @@ -1,12 +1,14 @@ using System; +using System.ComponentModel; + namespace osu.Game.Configuration { public enum ScreenshotFormat { Bmp = 0, // TODO: Figure out the best way to hide this from the dropdown - [DisplayName("JPG (web-friendly)")] + [Description("JPG (web-friendly)")] Jpg = 1, - [DisplayName("PNG (lossless)")] + [Description("PNG (lossless)")] Png = 2 } } \ No newline at end of file diff --git a/osu.Game/Overlays/Options/DropdownOption.cs b/osu.Game/Overlays/Options/DropdownOption.cs index 71fb4720c3..a75824ddd5 100644 --- a/osu.Game/Overlays/Options/DropdownOption.cs +++ b/osu.Game/Overlays/Options/DropdownOption.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel; using System.Linq; using System.Reflection; using OpenTK.Graphics; @@ -56,7 +57,7 @@ namespace osu.Game.Overlays.Options AutoSizeAxes = Axes.Y; var items = typeof(T).GetFields().Where(f => !f.IsSpecialName).Zip( (T[])Enum.GetValues(typeof(T)), (a, b) => new Tuple( - a.GetCustomAttribute()?.Name ?? a.Name, b)); + a.GetCustomAttribute()?.Description ?? a.Name, b)); Children = new Drawable[] { text = new SpriteText { Alpha = 0 }, diff --git a/osu.Game/Overlays/Options/General/UpdateOptions.cs b/osu.Game/Overlays/Options/General/UpdateOptions.cs index e00790765c..77cfd11273 100644 --- a/osu.Game/Overlays/Options/General/UpdateOptions.cs +++ b/osu.Game/Overlays/Options/General/UpdateOptions.cs @@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Options.General { new DropdownOption { - Label = "Release stream", + LabelText = "Release stream", Bindable = config.GetBindable(OsuConfig.ReleaseStream), }, new SpriteText { Text = "Your osu! is up to date" }, // TODO: map this to reality diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index affbbad2fe..a15cd5db7d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -225,7 +225,6 @@ - From 0e07ce26bccf37ef866d8d11ce3097c248928d65 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 2 Dec 2016 06:35:55 -0500 Subject: [PATCH 36/79] Remove Height from dropdown --- osu.Game/Overlays/Options/DropdownOption.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Options/DropdownOption.cs b/osu.Game/Overlays/Options/DropdownOption.cs index a75824ddd5..567e2821ab 100644 --- a/osu.Game/Overlays/Options/DropdownOption.cs +++ b/osu.Game/Overlays/Options/DropdownOption.cs @@ -64,11 +64,10 @@ namespace osu.Game.Overlays.Options dropdown = new DropDownMenu { Margin = new MarginPadding { Top = 5 }, - Height = 10, RelativeSizeAxes = Axes.X, Items = items.Select(item => new DropDownMenuItem(item.Item1, item.Item2)) } }; } } -} \ No newline at end of file +} From b06f412ffb117b32a006497348315e5e9e36de29 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 2 Dec 2016 07:24:48 -0500 Subject: [PATCH 37/79] Use styled dropdown --- osu.Game/Overlays/Options/DropdownOption.cs | 84 ++++++++++++++++++++- 1 file changed, 82 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Options/DropdownOption.cs b/osu.Game/Overlays/Options/DropdownOption.cs index 567e2821ab..0ba9811d35 100644 --- a/osu.Game/Overlays/Options/DropdownOption.cs +++ b/osu.Game/Overlays/Options/DropdownOption.cs @@ -2,6 +2,7 @@ using System.ComponentModel; using System.Linq; using System.Reflection; +using OpenTK; using OpenTK.Graphics; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -61,13 +62,92 @@ namespace osu.Game.Overlays.Options Children = new Drawable[] { text = new SpriteText { Alpha = 0 }, - dropdown = new DropDownMenu + dropdown = new StyledDropDownMenu { Margin = new MarginPadding { Top = 5 }, RelativeSizeAxes = Axes.X, - Items = items.Select(item => new DropDownMenuItem(item.Item1, item.Item2)) + Items = items.Select(item => new StyledDropDownMenuItem(item.Item1, item.Item2)) } }; } + + private class StyledDropDownMenu : DropDownMenu + { + protected override float DropDownListSpacing => 4; + + protected override DropDownComboBox CreateComboBox() + { + return new StyledDropDownComboBox(); + } + + public StyledDropDownMenu() + { + ComboBox.CornerRadius = 4; + DropDown.CornerRadius = 4; + } + + protected override void AnimateOpen() + { + foreach (StyledDropDownMenuItem child in DropDownList.Children) + { + child.FadeIn(200); + child.ResizeTo(new Vector2(1, 24), 200); + } + DropDown.Show(); + } + + protected override void AnimateClose() + { + foreach (StyledDropDownMenuItem child in DropDownList.Children) + { + child.ResizeTo(new Vector2(1, 0), 200); + child.FadeOut(200); + } + } + } + + private class StyledDropDownComboBox : DropDownComboBox + { + protected override Color4 BackgroundColour => new Color4(255, 255, 255, 100); + protected override Color4 BackgroundColourHover => Color4.HotPink; + + public StyledDropDownComboBox() + { + Foreground.Padding = new MarginPadding(4); + } + } + + private class StyledDropDownMenuItem : DropDownMenuItem + { + public StyledDropDownMenuItem(string text, U value) : base(text, value) + { + AutoSizeAxes = Axes.None; + Height = 0; + Foreground.Padding = new MarginPadding(2); + } + + protected override void OnSelectChange() + { + if (!IsLoaded) + return; + + FormatBackground(); + FormatCaret(); + FormatLabel(); + } + + protected override void FormatCaret() + { + (Caret as SpriteText).Text = IsSelected ? @"+" : @"-"; + } + + protected override void FormatLabel() + { + if (IsSelected) + (Label as SpriteText).Text = @"*" + Value + @"*"; + else + (Label as SpriteText).Text = Value.ToString(); + } + } } } From 9db8e63f830a103e034dbf786ac436bb6f66dc68 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 5 Dec 2016 09:17:30 -0500 Subject: [PATCH 38/79] Make star display min/max a double --- osu.Game/Configuration/OsuConfigManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index ccfa323a8a..2c5c53cc3f 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -154,8 +154,8 @@ namespace osu.Game.Configuration Set(OsuConfig.AlternativeChatFont, false); Set(OsuConfig.Password, string.Empty); Set(OsuConfig.Username, string.Empty); - Set(OsuConfig.DisplayStarsMaximum, 10, 0, 10); - Set(OsuConfig.DisplayStarsMinimum, 0, 0, 10); + Set(OsuConfig.DisplayStarsMaximum, 10.0, 0.0, 10.0); + Set(OsuConfig.DisplayStarsMinimum, 0.0, 0.0, 10.0); Set(OsuConfig.AudioDevice, string.Empty); Set(OsuConfig.ReleaseStream, ReleaseStream.Lazer); Set(OsuConfig.UpdateFailCount, 0); From bf33bded242116abb2f5d97d1796d65cecd52937 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 5 Dec 2016 09:17:46 -0500 Subject: [PATCH 39/79] Update star min/max type, just use sliders for now --- .../Gameplay/SongSelectGameplayOptions.cs | 36 ++++++------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs index 63453f336d..e0f25cfea7 100644 --- a/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs +++ b/osu.Game/Overlays/Options/Gameplay/SongSelectGameplayOptions.cs @@ -13,38 +13,24 @@ namespace osu.Game.Overlays.Options.Gameplay { public class SongSelectGameplayOptions : OptionsSubsection { - protected override string Header => "Song Select"; - - private BindableInt starMinimum, starMaximum; - private StarCounter counterMin, counterMax; + protected override string Header => "Song Select"; [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - starMinimum = (BindableInt)config.GetBindable(OsuConfig.DisplayStarsMinimum); - starMaximum = (BindableInt)config.GetBindable(OsuConfig.DisplayStarsMaximum); Children = new Drawable[] { - new SliderOption { LabelText = "Display beatmaps from", Bindable = starMinimum }, - counterMin = new StarCounter { Count = starMinimum.Value }, - new SliderOption { LabelText = "up to", Bindable = starMaximum }, - counterMax = new StarCounter { Count = starMaximum.Value }, + new SliderOption + { + LabelText = "Display beatmaps from", + Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMinimum) + }, + new SliderOption + { + LabelText = "up to", + Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMaximum) + }, }; - starMinimum.ValueChanged += starValueChanged; - starMaximum.ValueChanged += starValueChanged; - } - - private void starValueChanged(object sender, EventArgs e) - { - counterMin.Count = starMinimum.Value; - counterMax.Count = starMaximum.Value; - } - - protected override void Dispose(bool isDisposing) - { - starMinimum.ValueChanged -= starValueChanged; - starMaximum.ValueChanged -= starValueChanged; - base.Dispose(isDisposing); } } } From bf7ec397dd365740027a3a582a191f578f184302 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 5 Dec 2016 09:24:54 -0500 Subject: [PATCH 40/79] Wire dropdowns back to bindables --- osu.Game/Overlays/Options/DropdownOption.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/osu.Game/Overlays/Options/DropdownOption.cs b/osu.Game/Overlays/Options/DropdownOption.cs index 0ba9811d35..3cdc6da2ab 100644 --- a/osu.Game/Overlays/Options/DropdownOption.cs +++ b/osu.Game/Overlays/Options/DropdownOption.cs @@ -49,6 +49,18 @@ namespace osu.Game.Overlays.Options dropdown.SelectedValue = bindable.Value; } + void Dropdown_ValueChanged(object sender, EventArgs e) + { + bindable.Value = dropdown.SelectedValue; + } + + protected override void Dispose(bool isDisposing) + { + bindable.ValueChanged -= Bindable_ValueChanged; + dropdown.ValueChanged -= Dropdown_ValueChanged; + base.Dispose(isDisposing); + } + public DropdownOption() { if (!typeof(T).IsEnum) @@ -69,6 +81,7 @@ namespace osu.Game.Overlays.Options Items = items.Select(item => new StyledDropDownMenuItem(item.Item1, item.Item2)) } }; + dropdown.ValueChanged += Dropdown_ValueChanged; } private class StyledDropDownMenu : DropDownMenu From 3224abfa902a93b5936c3b4fc1e42e1dddd89a67 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Dec 2016 13:30:13 +0900 Subject: [PATCH 41/79] Update framework. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 797576111a..1b0d7a584c 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 797576111a7ba4c469cd1a7d74708014264155ec +Subproject commit 1b0d7a584cad85efcdf25c5155e6e62a4ccb5758 From 391767e01d97f3be907255a98dab24a55bfad920 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Dec 2016 19:54:22 +0900 Subject: [PATCH 42/79] Add very basic hitsound support. --- osu-resources | 2 +- .../Objects/Drawables/DrawableSlider.cs | 13 ++++++++++-- .../Objects/Drawables/Pieces/SliderBall.cs | 2 +- .../Objects/OsuHitObjectParser.cs | 5 ++++- .../Objects/Drawables/DrawableHitObject.cs | 20 +++++++++++++++++++ 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/osu-resources b/osu-resources index 73ddad1f01..e24414a277 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 73ddad1f01f223c6c311f1302ed1658a2320813d +Subproject commit e24414a277e407ae2438e4b6d9fa9c7992dd6485 diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index e0af180e95..d5167f013b 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -18,13 +18,12 @@ namespace osu.Game.Modes.Osu.Objects.Drawables private List components = new List(); SliderBody body; + SliderBall ball; SliderBouncer bouncer1, bouncer2; public DrawableSlider(Slider s) : base(s) { - SliderBall ball; - slider = s; Origin = Anchor.TopLeft; @@ -46,6 +45,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables StartTime = s.StartTime, Position = s.Position, Colour = s.Colour, + Sample = s.Sample, }) { Depth = -1 //override time-based depth. @@ -58,6 +58,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables components.Add(bouncer2); } + int currentRepeat; + protected override void Update() { base.Update(); @@ -67,6 +69,13 @@ namespace osu.Game.Modes.Osu.Objects.Drawables int repeat = (int)(progress * slider.RepeatCount); progress = (progress * slider.RepeatCount) % 1; + if (repeat > currentRepeat) + { + if (ball.Tracking) + PlaySample(); + currentRepeat = repeat; + } + if (repeat % 2 == 1) progress = 1 - progress; diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs index ce34ef7c22..c0e2030a80 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -84,7 +84,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces } bool tracking; - protected bool Tracking + public bool Tracking { get { return tracking; } set diff --git a/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs b/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs index 216c40b779..ad0e45ade3 100644 --- a/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs +++ b/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs @@ -101,7 +101,10 @@ namespace osu.Game.Modes.Osu.Objects } result.Position = new Vector2(int.Parse(split[0]), int.Parse(split[1])); result.StartTime = double.Parse(split[2]); - result.Sample = new HitSampleInfo { Type = (SampleType)int.Parse(split[4]) }; + result.Sample = new HitSampleInfo { + Type = (SampleType)Math.Max(1, int.Parse(split[4])), + Set = SampleSet.Soft, + }; result.NewCombo = combo; // TODO: "addition" field return result; diff --git a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs index 9b5c268696..c7e29b1cad 100644 --- a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs @@ -5,7 +5,11 @@ using System; using System.ComponentModel; using System.Diagnostics; using osu.Framework; +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Graphics.Containers; +using osu.Game.Beatmaps.Samples; using OpenTK; using Container = osu.Framework.Graphics.Containers.Container; @@ -40,9 +44,25 @@ namespace osu.Game.Modes.Objects.Drawables state = value; UpdateState(state); + + if (State == ArmedState.Hit) + PlaySample(); } } + AudioSample sample; + + [BackgroundDependencyLoader] + private void load(AudioManager audio) + { + sample = audio.Sample.Get($@"Gameplay/{(HitObject.Sample.Set).ToString().ToLower()}-hit{HitObject.Sample.Type.ToString().ToLower()}"); + } + + protected void PlaySample() + { + sample?.Play(); + } + protected override void LoadComplete() { base.LoadComplete(); From c53743ca7deb615b52be53623ab5e5b1903a9bad Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Dec 2016 20:00:24 +0900 Subject: [PATCH 43/79] Fix unit test regression. --- osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs | 2 +- osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs b/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs index ad0e45ade3..143aaecb44 100644 --- a/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs +++ b/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs @@ -102,7 +102,7 @@ namespace osu.Game.Modes.Osu.Objects result.Position = new Vector2(int.Parse(split[0]), int.Parse(split[1])); result.StartTime = double.Parse(split[2]); result.Sample = new HitSampleInfo { - Type = (SampleType)Math.Max(1, int.Parse(split[4])), + Type = (SampleType)int.Parse(split[4]), Set = SampleSet.Soft, }; result.NewCombo = combo; diff --git a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs index c7e29b1cad..06d25f8cdd 100644 --- a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs @@ -55,7 +55,10 @@ namespace osu.Game.Modes.Objects.Drawables [BackgroundDependencyLoader] private void load(AudioManager audio) { - sample = audio.Sample.Get($@"Gameplay/{(HitObject.Sample.Set).ToString().ToLower()}-hit{HitObject.Sample.Type.ToString().ToLower()}"); + string hitType = (HitObject.Sample.Type == SampleType.None ? SampleType.Normal : HitObject.Sample.Type).ToString().ToLower(); + string sampleSet = HitObject.Sample.Set.ToString().ToLower(); + + sample = audio.Sample.Get($@"Gameplay/{sampleSet}-hit{hitType}"); } protected void PlaySample() From 6cfb174f02c9e3db080e585332aabb161b12f3e9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Dec 2016 20:03:18 +0900 Subject: [PATCH 44/79] Fix exiting results screen returning to player. --- 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 8b1e18ac00..7e6f5d2b55 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -132,6 +132,7 @@ namespace osu.Game.Screens.Play Delay(1000); Schedule(delegate { + ValidForResume = false; Push(new Results { Score = scoreProcessor.GetScore() From f8395c4d3f07785e0e9d48524e7e9f368ea054a0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Dec 2016 21:07:20 +0900 Subject: [PATCH 45/79] Fix slider ball not tracking when mouse hasn't been moved since slider appeared. --- .../Objects/Drawables/DrawableSlider.cs | 16 +++++++++++----- .../Objects/Drawables/Pieces/SliderBall.cs | 5 +++-- osu.Game.Mode.Osu/UI/OsuPlayfield.cs | 1 + .../Modes/Objects/Drawables/DrawableHitObject.cs | 1 - 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index d5167f013b..9e0ad36dd7 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -6,6 +6,7 @@ using osu.Framework.Graphics; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Osu.Objects.Drawables.Pieces; using OpenTK; +using osu.Framework.Input; namespace osu.Game.Modes.Osu.Objects.Drawables { @@ -39,17 +40,14 @@ namespace osu.Game.Modes.Osu.Objects.Drawables }, bouncer1 = new SliderBouncer(slider, false) { Position = slider.Curve.PositionAt(1) }, bouncer2 = new SliderBouncer(slider, true) { Position = slider.Position }, - ball = new SliderBall(slider), initialCircle = new DrawableHitCircle(new HitCircle { StartTime = s.StartTime, Position = s.Position, Colour = s.Colour, Sample = s.Sample, - }) - { - Depth = -1 //override time-based depth. - }, + }), + ball = new SliderBall(slider), }; components.Add(body); @@ -104,14 +102,22 @@ namespace osu.Game.Modes.Osu.Objects.Drawables { base.UpdateInitialState(); body.Alpha = 1; + + //we need to be visible to handle input events. note that we still don't get enough events (we don't get a position if the mouse hasn't moved since the slider appeared). + ball.Alpha = 0.01f; } protected override void UpdateState(ArmedState state) { base.UpdateState(state); + ball.FadeIn(); + Delay(HitObject.Duration, true); + body.FadeOut(160); + ball.FadeOut(160); + FadeOut(800); } } diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs index c0e2030a80..61ecc09301 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -98,17 +98,18 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces } } + private bool validTrackingTime => Time.Current >= slider.StartTime && Time.Current <= slider.EndTime; + protected override void Update() { base.Update(); CornerRadius = DrawWidth / 2; - Tracking = lastState != null && Contains(lastState.Mouse.NativeState.Position) && lastState.Mouse.HasMainButtonPressed; + Tracking = validTrackingTime && lastState != null && Contains(lastState.Mouse.NativeState.Position) && lastState.Mouse.HasMainButtonPressed; } public void UpdateProgress(double progress, int repeat) { - Alpha = Time.Current >= slider.StartTime && Time.Current <= slider.EndTime ? 1 : 0; Position = slider.Curve.PositionAt(progress); } } diff --git a/osu.Game.Mode.Osu/UI/OsuPlayfield.cs b/osu.Game.Mode.Osu/UI/OsuPlayfield.cs index 3ee3339f2a..9cf873dabf 100644 --- a/osu.Game.Mode.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Mode.Osu/UI/OsuPlayfield.cs @@ -51,6 +51,7 @@ namespace osu.Game.Modes.Osu.UI public override void Add(DrawableHitObject h) { + h.Depth = (float)h.HitObject.StartTime; DrawableHitCircle c = h as DrawableHitCircle; if (c != null) { diff --git a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs index 06d25f8cdd..94694b8d5e 100644 --- a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs @@ -30,7 +30,6 @@ namespace osu.Game.Modes.Objects.Drawables public DrawableHitObject(HitObject hitObject) { HitObject = hitObject; - Depth = (float)hitObject.StartTime; } private ArmedState state; From 40ea6e0d7295c19eeb732398cea9fb3b32cc28ec Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Dec 2016 21:36:34 +0900 Subject: [PATCH 46/79] Fix incorrect folder name. --- osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj | 2 +- osu.Desktop/osu.Desktop.csproj | 2 +- osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj | 2 +- osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj | 2 +- .../Objects/BezierApproximator.cs | 0 .../Objects/Drawables/DrawableHitCircle.cs | 0 .../Objects/Drawables/DrawableOsuHitObject.cs | 0 .../Objects/Drawables/DrawableSlider.cs | 0 .../Objects/Drawables/HitExplosion.cs | 0 .../Objects/Drawables/Pieces/ApproachCircle.cs | 0 .../Objects/Drawables/Pieces/CirclePiece.cs | 0 .../Objects/Drawables/Pieces/ExplodePiece.cs | 0 .../Objects/Drawables/Pieces/FlashPiece.cs | 0 .../Objects/Drawables/Pieces/GlowPiece.cs | 0 .../Objects/Drawables/Pieces/NumberPiece.cs | 0 .../Objects/Drawables/Pieces/RingPiece.cs | 0 .../Objects/Drawables/Pieces/SliderBall.cs | 0 .../Objects/Drawables/Pieces/SliderBody.cs | 0 .../Objects/Drawables/Pieces/SliderBouncer.cs | 0 .../Objects/Drawables/Pieces/Triangles.cs | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/HitCircle.cs | 0 .../Objects/OsuHitObject.cs | 0 .../Objects/OsuHitObjectConverter.cs | 0 .../Objects/OsuHitObjectParser.cs | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Slider.cs | 0 .../Objects/SliderCurve.cs | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Spinner.cs | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/OpenTK.dll.config | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/OsuRuleset.cs | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/OsuScore.cs | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/OsuScoreProcessor.cs | 0 .../Properties/AssemblyInfo.cs | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/UI/OsuComboCounter.cs | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/UI/OsuHitRenderer.cs | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/UI/OsuPlayfield.cs | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/UI/OsuScoreOverlay.cs | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/app.config | 0 .../osu.Game.Modes.Osu.csproj | 0 {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/packages.config | 0 osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- osu.sln | 2 +- 42 files changed, 7 insertions(+), 7 deletions(-) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/BezierApproximator.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/DrawableHitCircle.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/DrawableOsuHitObject.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/DrawableSlider.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/HitExplosion.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/Pieces/ApproachCircle.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/Pieces/CirclePiece.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/Pieces/ExplodePiece.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/Pieces/FlashPiece.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/Pieces/GlowPiece.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/Pieces/NumberPiece.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/Pieces/RingPiece.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/Pieces/SliderBall.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/Pieces/SliderBody.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/Pieces/SliderBouncer.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Drawables/Pieces/Triangles.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/HitCircle.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/OsuHitObject.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/OsuHitObjectConverter.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/OsuHitObjectParser.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Slider.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/SliderCurve.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Objects/Spinner.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/OpenTK.dll.config (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/OsuRuleset.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/OsuScore.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/OsuScoreProcessor.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/Properties/AssemblyInfo.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/UI/OsuComboCounter.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/UI/OsuHitRenderer.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/UI/OsuPlayfield.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/UI/OsuScoreOverlay.cs (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/app.config (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/osu.Game.Modes.Osu.csproj (100%) rename {osu.Game.Mode.Osu => osu.Game.Modes.Osu}/packages.config (100%) diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index d12ecc273d..70dd0fee46 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -150,7 +150,7 @@ {d9a367c9-4c1a-489f-9b05-a0cea2b53b58} osu.Game.Resources - + {c92a607b-1fdd-4954-9f92-03ff547d9080} osu.Game.Modes.Osu diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 95d3ad64c5..ce0e39b6d9 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -130,7 +130,7 @@ {d9a367c9-4c1a-489f-9b05-a0cea2b53b58} osu.Game.Resources - + {c92a607b-1fdd-4954-9f92-03ff547d9080} osu.Game.Modes.Osu diff --git a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj index 219175dd2b..e68203872e 100644 --- a/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj +++ b/osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj @@ -68,7 +68,7 @@ {C76BF5B3-985E-4D39-95FE-97C9C879B83A} osu.Framework - + {C92A607B-1FDD-4954-9F92-03FF547D9080} osu.Game.Modes.Osu diff --git a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj b/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj index 89c8978bbf..22b16c6a9a 100644 --- a/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj +++ b/osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj @@ -61,7 +61,7 @@ {C76BF5B3-985E-4D39-95FE-97C9C879B83A} osu.Framework - + {C92A607B-1FDD-4954-9F92-03FF547D9080} osu.Game.Modes.Osu diff --git a/osu.Game.Mode.Osu/Objects/BezierApproximator.cs b/osu.Game.Modes.Osu/Objects/BezierApproximator.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/BezierApproximator.cs rename to osu.Game.Modes.Osu/Objects/BezierApproximator.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/DrawableHitCircle.cs rename to osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/DrawableOsuHitObject.cs rename to osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs rename to osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs b/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/HitExplosion.cs rename to osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/ApproachCircle.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/ApproachCircle.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/Pieces/ApproachCircle.cs rename to osu.Game.Modes.Osu/Objects/Drawables/Pieces/ApproachCircle.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/CirclePiece.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/Pieces/CirclePiece.cs rename to osu.Game.Modes.Osu/Objects/Drawables/Pieces/CirclePiece.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/ExplodePiece.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/ExplodePiece.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/Pieces/ExplodePiece.cs rename to osu.Game.Modes.Osu/Objects/Drawables/Pieces/ExplodePiece.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/FlashPiece.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/FlashPiece.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/Pieces/FlashPiece.cs rename to osu.Game.Modes.Osu/Objects/Drawables/Pieces/FlashPiece.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/GlowPiece.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/GlowPiece.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/Pieces/GlowPiece.cs rename to osu.Game.Modes.Osu/Objects/Drawables/Pieces/GlowPiece.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/NumberPiece.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/NumberPiece.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/Pieces/NumberPiece.cs rename to osu.Game.Modes.Osu/Objects/Drawables/Pieces/NumberPiece.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/RingPiece.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/RingPiece.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/Pieces/RingPiece.cs rename to osu.Game.Modes.Osu/Objects/Drawables/Pieces/RingPiece.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBall.cs rename to osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBody.cs rename to osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBouncer.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/Pieces/SliderBouncer.cs rename to osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBouncer.cs diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/Triangles.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/Triangles.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Drawables/Pieces/Triangles.cs rename to osu.Game.Modes.Osu/Objects/Drawables/Pieces/Triangles.cs diff --git a/osu.Game.Mode.Osu/Objects/HitCircle.cs b/osu.Game.Modes.Osu/Objects/HitCircle.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/HitCircle.cs rename to osu.Game.Modes.Osu/Objects/HitCircle.cs diff --git a/osu.Game.Mode.Osu/Objects/OsuHitObject.cs b/osu.Game.Modes.Osu/Objects/OsuHitObject.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/OsuHitObject.cs rename to osu.Game.Modes.Osu/Objects/OsuHitObject.cs diff --git a/osu.Game.Mode.Osu/Objects/OsuHitObjectConverter.cs b/osu.Game.Modes.Osu/Objects/OsuHitObjectConverter.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/OsuHitObjectConverter.cs rename to osu.Game.Modes.Osu/Objects/OsuHitObjectConverter.cs diff --git a/osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs b/osu.Game.Modes.Osu/Objects/OsuHitObjectParser.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/OsuHitObjectParser.cs rename to osu.Game.Modes.Osu/Objects/OsuHitObjectParser.cs diff --git a/osu.Game.Mode.Osu/Objects/Slider.cs b/osu.Game.Modes.Osu/Objects/Slider.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Slider.cs rename to osu.Game.Modes.Osu/Objects/Slider.cs diff --git a/osu.Game.Mode.Osu/Objects/SliderCurve.cs b/osu.Game.Modes.Osu/Objects/SliderCurve.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/SliderCurve.cs rename to osu.Game.Modes.Osu/Objects/SliderCurve.cs diff --git a/osu.Game.Mode.Osu/Objects/Spinner.cs b/osu.Game.Modes.Osu/Objects/Spinner.cs similarity index 100% rename from osu.Game.Mode.Osu/Objects/Spinner.cs rename to osu.Game.Modes.Osu/Objects/Spinner.cs diff --git a/osu.Game.Mode.Osu/OpenTK.dll.config b/osu.Game.Modes.Osu/OpenTK.dll.config similarity index 100% rename from osu.Game.Mode.Osu/OpenTK.dll.config rename to osu.Game.Modes.Osu/OpenTK.dll.config diff --git a/osu.Game.Mode.Osu/OsuRuleset.cs b/osu.Game.Modes.Osu/OsuRuleset.cs similarity index 100% rename from osu.Game.Mode.Osu/OsuRuleset.cs rename to osu.Game.Modes.Osu/OsuRuleset.cs diff --git a/osu.Game.Mode.Osu/OsuScore.cs b/osu.Game.Modes.Osu/OsuScore.cs similarity index 100% rename from osu.Game.Mode.Osu/OsuScore.cs rename to osu.Game.Modes.Osu/OsuScore.cs diff --git a/osu.Game.Mode.Osu/OsuScoreProcessor.cs b/osu.Game.Modes.Osu/OsuScoreProcessor.cs similarity index 100% rename from osu.Game.Mode.Osu/OsuScoreProcessor.cs rename to osu.Game.Modes.Osu/OsuScoreProcessor.cs diff --git a/osu.Game.Mode.Osu/Properties/AssemblyInfo.cs b/osu.Game.Modes.Osu/Properties/AssemblyInfo.cs similarity index 100% rename from osu.Game.Mode.Osu/Properties/AssemblyInfo.cs rename to osu.Game.Modes.Osu/Properties/AssemblyInfo.cs diff --git a/osu.Game.Mode.Osu/UI/OsuComboCounter.cs b/osu.Game.Modes.Osu/UI/OsuComboCounter.cs similarity index 100% rename from osu.Game.Mode.Osu/UI/OsuComboCounter.cs rename to osu.Game.Modes.Osu/UI/OsuComboCounter.cs diff --git a/osu.Game.Mode.Osu/UI/OsuHitRenderer.cs b/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs similarity index 100% rename from osu.Game.Mode.Osu/UI/OsuHitRenderer.cs rename to osu.Game.Modes.Osu/UI/OsuHitRenderer.cs diff --git a/osu.Game.Mode.Osu/UI/OsuPlayfield.cs b/osu.Game.Modes.Osu/UI/OsuPlayfield.cs similarity index 100% rename from osu.Game.Mode.Osu/UI/OsuPlayfield.cs rename to osu.Game.Modes.Osu/UI/OsuPlayfield.cs diff --git a/osu.Game.Mode.Osu/UI/OsuScoreOverlay.cs b/osu.Game.Modes.Osu/UI/OsuScoreOverlay.cs similarity index 100% rename from osu.Game.Mode.Osu/UI/OsuScoreOverlay.cs rename to osu.Game.Modes.Osu/UI/OsuScoreOverlay.cs diff --git a/osu.Game.Mode.Osu/app.config b/osu.Game.Modes.Osu/app.config similarity index 100% rename from osu.Game.Mode.Osu/app.config rename to osu.Game.Modes.Osu/app.config diff --git a/osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj similarity index 100% rename from osu.Game.Mode.Osu/osu.Game.Modes.Osu.csproj rename to osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj diff --git a/osu.Game.Mode.Osu/packages.config b/osu.Game.Modes.Osu/packages.config similarity index 100% rename from osu.Game.Mode.Osu/packages.config rename to osu.Game.Modes.Osu/packages.config diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index ab8bc674d8..355f71d0df 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -66,7 +66,7 @@ {C76BF5B3-985E-4D39-95FE-97C9C879B83A} osu.Framework - + {C92A607B-1FDD-4954-9F92-03FF547D9080} osu.Game.Modes.Osu diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index d59e90c2f4..5e1ce553d8 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -66,7 +66,7 @@ {c76bf5b3-985e-4d39-95fe-97c9c879b83a} osu.Framework - + {c92a607b-1fdd-4954-9f92-03ff547d9080} osu.Game.Modes.Osu diff --git a/osu.sln b/osu.sln index 9677a752fb..f3736c16c0 100644 --- a/osu.sln +++ b/osu.sln @@ -21,7 +21,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Desktop.VisualTests", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tests", "osu.Game.Tests\osu.Game.Tests.csproj", "{54377672-20B1-40AF-8087-5CF73BF3953A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Modes.Osu", "osu.Game.Mode.Osu\osu.Game.Modes.Osu.csproj", "{C92A607B-1FDD-4954-9F92-03FF547D9080}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Modes.Osu", "osu.Game.Modes.Osu\osu.Game.Modes.Osu.csproj", "{C92A607B-1FDD-4954-9F92-03FF547D9080}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Modes.Catch", "osu.Game.Modes.Catch\osu.Game.Modes.Catch.csproj", "{58F6C80C-1253-4A0E-A465-B8C85EBEADF3}" EndProject From 359cb5ac6a22d13403c9eb803d6187085952cdeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Fri, 9 Dec 2016 18:03:17 +0100 Subject: [PATCH 47/79] Make bezier approximator slightly more correct (without affecting its behaviour). --- osu.Game.Modes.Osu/Objects/BezierApproximator.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game.Modes.Osu/Objects/BezierApproximator.cs b/osu.Game.Modes.Osu/Objects/BezierApproximator.cs index 9a4be51240..f03e1c0738 100644 --- a/osu.Game.Modes.Osu/Objects/BezierApproximator.cs +++ b/osu.Game.Modes.Osu/Objects/BezierApproximator.cs @@ -13,7 +13,7 @@ namespace osu.Game.Modes.Osu.Objects private Vector2[] subdivisionBuffer1; private Vector2[] subdivisionBuffer2; - private const float TOLERANCE = 0.5f; + private const float TOLERANCE = 0.25f; private const float TOLERANCE_SQ = TOLERANCE * TOLERANCE; public BezierApproximator(List controlPoints) @@ -36,7 +36,7 @@ namespace osu.Game.Modes.Osu.Objects private static bool IsFlatEnough(Vector2[] controlPoints) { for (int i = 1; i < controlPoints.Length - 1; i++) - if ((controlPoints[i - 1] - 2 * controlPoints[i] + controlPoints[i + 1]).LengthSquared > TOLERANCE_SQ) + if ((controlPoints[i - 1] - 2 * controlPoints[i] + controlPoints[i + 1]).LengthSquared > TOLERANCE_SQ * 4) return false; return true; @@ -96,7 +96,6 @@ namespace osu.Game.Modes.Osu.Objects /// Creates a piecewise-linear approximation of a bezier curve, by adaptively repeatedly subdividing /// the control points until their approximation error vanishes below a given threshold. /// - /// The control points describing the curve. /// A list of vectors representing the piecewise-linear approximation. public List CreateBezier() { From 38968ad6d2814642eb360a49858396229d61ca10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Fri, 9 Dec 2016 18:04:02 +0100 Subject: [PATCH 48/79] Add circular arc approximator for "perfect" sliders. --- .../Objects/CircularArcApproximator.cs | 102 ++++++++++++++++++ .../Objects/OsuHitObjectParser.cs | 2 +- osu.Game.Modes.Osu/Objects/SliderCurve.cs | 51 +++++---- osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj | 1 + 4 files changed, 137 insertions(+), 19 deletions(-) create mode 100644 osu.Game.Modes.Osu/Objects/CircularArcApproximator.cs diff --git a/osu.Game.Modes.Osu/Objects/CircularArcApproximator.cs b/osu.Game.Modes.Osu/Objects/CircularArcApproximator.cs new file mode 100644 index 0000000000..b8f84ed510 --- /dev/null +++ b/osu.Game.Modes.Osu/Objects/CircularArcApproximator.cs @@ -0,0 +1,102 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using osu.Framework.MathUtils; +using System; +using System.Collections.Generic; + +namespace osu.Game.Modes.Osu.Objects +{ + public class CircularArcApproximator + { + private Vector2 A; + private Vector2 B; + private Vector2 C; + + private int amountPoints; + + private const float TOLERANCE = 0.1f; + + public CircularArcApproximator(Vector2 A, Vector2 B, Vector2 C) + { + this.A = A; + this.B = B; + this.C = C; + } + + /// + /// Creates a piecewise-linear approximation of a circular arc curve. + /// + /// A list of vectors representing the piecewise-linear approximation. + public List CreateArc() + { + float aSq = (B - C).LengthSquared; + float bSq = (A - C).LengthSquared; + float cSq = (A - B).LengthSquared; + + // If we have a degenerate triangle where a side-length is almost zero, then give up and fall + // back to a more numerically stable method. + if (Precision.AlmostEquals(aSq, 0) || Precision.AlmostEquals(bSq, 0) || Precision.AlmostEquals(cSq, 0)) + return new List(); + + float s = aSq * (bSq + cSq - aSq); + float t = bSq * (aSq + cSq - bSq); + float u = cSq * (aSq + bSq - cSq); + + float sum = s + t + u; + + // If we have a degenerate triangle with an almost-zero size, then give up and fall + // back to a more numerically stable method. + if (Precision.AlmostEquals(sum, 0)) + return new List(); + + Vector2 centre = (s * A + t * B + u * C) / sum; + Vector2 dA = A - centre; + Vector2 dC = C - centre; + + float r = dA.Length; + + double thetaStart = Math.Atan2(dA.Y, dA.X); + double thetaEnd = Math.Atan2(dC.Y, dC.X); + + while (thetaEnd < thetaStart) + thetaEnd += 2 * Math.PI; + + double dir = 1; + double thetaRange = thetaEnd - thetaStart; + + // Decide in which direction to draw the circle, depending on which side of + // AC B lies. + Vector2 orthoAC = C - A; + orthoAC = new Vector2(orthoAC.Y, -orthoAC.X); + if (Vector2.Dot(orthoAC, B - A) < 0) + { + dir = -dir; + thetaRange = 2 * Math.PI - thetaRange; + } + + // We select the amount of points for the approximation by requiring the discrete curvature + // to be smaller than the provided tolerance. The exact angle required to meet the tolerance + // is: 2 * Math.Acos(1 - TOLERANCE / r) + if (2 * r <= TOLERANCE) + // This special case is required for extremely short sliders where the radius is smaller than + // the tolerance. This is a pathological rather than a realistic case. + amountPoints = 2; + else + amountPoints = Math.Max(2, (int)Math.Ceiling(thetaRange / (2 * Math.Acos(1 - TOLERANCE / r)))); + + List output = new List(amountPoints); + + for (int i = 0; i < amountPoints; ++i) + { + double fract = (double)i / (amountPoints - 1); + double theta = thetaStart + dir * fract * thetaRange; + Vector2 o = new Vector2((float)Math.Cos(theta), (float)Math.Sin(theta)) * r; + output.Add(centre + o); + } + + return output; + } + } +} diff --git a/osu.Game.Modes.Osu/Objects/OsuHitObjectParser.cs b/osu.Game.Modes.Osu/Objects/OsuHitObjectParser.cs index 216c40b779..9516006c57 100644 --- a/osu.Game.Modes.Osu/Objects/OsuHitObjectParser.cs +++ b/osu.Game.Modes.Osu/Objects/OsuHitObjectParser.cs @@ -83,7 +83,7 @@ namespace osu.Game.Modes.Osu.Objects s.Curve = new SliderCurve { - Path = points, + ControlPoints = points, Length = length, CurveType = curveType }; diff --git a/osu.Game.Modes.Osu/Objects/SliderCurve.cs b/osu.Game.Modes.Osu/Objects/SliderCurve.cs index e8df4049f5..961658112f 100644 --- a/osu.Game.Modes.Osu/Objects/SliderCurve.cs +++ b/osu.Game.Modes.Osu/Objects/SliderCurve.cs @@ -4,9 +4,8 @@ using System.Collections.Generic; using OpenTK; using System.Linq; -using System.Diagnostics; using osu.Framework.MathUtils; -using System; +using System.Diagnostics; namespace osu.Game.Modes.Osu.Objects { @@ -14,21 +13,39 @@ namespace osu.Game.Modes.Osu.Objects { public double Length; - public List Path; + public List ControlPoints; public CurveTypes CurveType; private List calculatedPath = new List(); private List cumulativeLength = new List(); - private List calculateSubpath(List subpath) + private List calculateSubpath(List subControlPoints) { switch (CurveType) { case CurveTypes.Linear: - return subpath; + return subControlPoints; + case CurveTypes.PerfectCurve: + // If we have a different amount than 3 control points, use bezier for perfect curves. + if (ControlPoints.Count != 3) + return new BezierApproximator(subControlPoints).CreateBezier(); + else + { + Debug.Assert(subControlPoints.Count == 3); + + // Here we have exactly 3 control points. Attempt to fit a circular arc. + List subpath = new CircularArcApproximator(subControlPoints[0], subControlPoints[1], subControlPoints[2]).CreateArc(); + + if (subpath.Count == 0) + // For some reason a circular arc could not be fit to the 3 given points. Fall back + // to a numerically stable bezier approximation. + subpath = new BezierApproximator(subControlPoints).CreateBezier(); + + return subpath; + } default: - return new BezierApproximator(subpath).CreateBezier(); + return new BezierApproximator(subControlPoints).CreateBezier(); } } @@ -39,21 +56,19 @@ namespace osu.Game.Modes.Osu.Objects // Sliders may consist of various subpaths separated by two consecutive vertices // with the same position. The following loop parses these subpaths and computes // their shape independently, consecutively appending them to calculatedPath. - List subpath = new List(); - for (int i = 0; i < Path.Count; ++i) + List subControlPoints = new List(); + for (int i = 0; i < ControlPoints.Count; ++i) { - subpath.Add(Path[i]); - if (i == Path.Count - 1 || Path[i] == Path[i + 1]) + subControlPoints.Add(ControlPoints[i]); + if (i == ControlPoints.Count - 1 || ControlPoints[i] == ControlPoints[i + 1]) { - // If we already constructed a subpath previously, then the new subpath - // will have as starting position the end position of the previous subpath. - // Hence we can and should remove the previous endpoint to avoid a segment - // with 0 length. - if (calculatedPath.Count > 0) - calculatedPath.RemoveAt(calculatedPath.Count - 1); + List subpath = calculateSubpath(subControlPoints); + for (int j = 0; j < subpath.Count; ++j) + // Only add those vertices that add a new segment to the path. + if (calculatedPath.Count == 0 || calculatedPath.Last() != subpath[j]) + calculatedPath.Add(subpath[j]); - calculatedPath.AddRange(calculateSubpath(subpath)); - subpath.Clear(); + subControlPoints.Clear(); } } } diff --git a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj index 503fabd28d..a9a346f563 100644 --- a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj +++ b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj @@ -42,6 +42,7 @@ + From 9c4c713aa01699c0a246fa86ed9ce69b7b7c396c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 10 Dec 2016 11:30:22 +0100 Subject: [PATCH 49/79] Fix panels that are moving off-screen having an incorrect X coordinate applied. --- osu.Game/Screens/Select/CarouselContainer.cs | 52 ++++++++++++-------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/osu.Game/Screens/Select/CarouselContainer.cs b/osu.Game/Screens/Select/CarouselContainer.cs index 069c8d8d37..2c59639ce7 100644 --- a/osu.Game/Screens/Select/CarouselContainer.cs +++ b/osu.Game/Screens/Select/CarouselContainer.cs @@ -190,18 +190,45 @@ namespace osu.Game.Screens.Select return 125 + x; } + /// + /// Update a panel's x position and multiplicative alpha based on its y position and + /// the current scroll position. + /// + /// The panel to be updated. + /// Half the draw height of the carousel container. + private void updatePanel(Panel p, float halfHeight) + { + float panelDrawY = p.Position.Y - Current + p.DrawHeight / 2; + float dist = Math.Abs(1f - panelDrawY / halfHeight); + + // Setting the origin position serves as an additive position on top of potential + // local transformation we may want to apply (e.g. when a panel gets selected, we + // may want to smoothly transform it leftwards.) + p.OriginPosition = new Vector2(-offsetX(dist, halfHeight), 0); + + // We are applying a multiplicative alpha (which is internally done by nesting an + // additional container and setting that container's alpha) such that we can + // layer transformations on top, with a similar reasoning to the previous comment. + p.SetMultiplicativeAlpha(MathHelper.Clamp(1.75f - 1.5f * dist, 0, 1)); + } + protected override void Update() { base.Update(); + // Determine which items stopped being on screen for future removal from the lifetimelist. float drawHeight = DrawHeight; + float halfHeight = drawHeight / 2; - Lifetime.AliveItems.ForEach(delegate (Panel p) + foreach (Panel p in Lifetime.AliveItems) { float panelPosY = p.Position.Y; p.IsOnScreen = panelPosY >= Current - p.DrawHeight && panelPosY <= Current + drawHeight; - }); + updatePanel(p, halfHeight); + } + // Determine range of indices for items that are now definitely on screen to be added + // to the lifetimelist in the future. int firstIndex = yPositions.BinarySearch(Current - Panel.MAX_HEIGHT); if (firstIndex < 0) firstIndex = ~firstIndex; int lastIndex = yPositions.BinarySearch(Current + drawHeight); @@ -210,26 +237,11 @@ namespace osu.Game.Screens.Select Lifetime.StartIndex = firstIndex; Lifetime.EndIndex = lastIndex; - float halfHeight = drawHeight / 2; - for (int i = firstIndex; i < lastIndex; ++i) { - var panel = Lifetime[i]; - - panel.IsOnScreen = true; - - float panelDrawY = panel.Position.Y - Current + panel.DrawHeight / 2; - float dist = Math.Abs(1f - panelDrawY / halfHeight); - - // Setting the origin position serves as an additive position on top of potential - // local transformation we may want to apply (e.g. when a panel gets selected, we - // may want to smoothly transform it leftwards.) - panel.OriginPosition = new Vector2(-offsetX(dist, halfHeight), 0); - - // We are applying a multiplicative alpha (which is internally done by nesting an - // additional container and setting that container's alpha) such that we can - // layer transformations on top, with a similar reasoning to the previous comment. - panel.SetMultiplicativeAlpha(MathHelper.Clamp(1.75f - 1.5f * dist, 0, 1)); + Panel p = Lifetime[i]; + p.IsOnScreen = true; + updatePanel(p, halfHeight); } } } From 2ced0a48e0343fa55a61e3615412e04a13451f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 10 Dec 2016 14:37:00 +0100 Subject: [PATCH 50/79] Update framework. --- osu-framework | 2 +- osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 1b0d7a584c..b918a5bb33 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 1b0d7a584cad85efcdf25c5155e6e62a4ccb5758 +Subproject commit b918a5bb33b18e194af265d82f9011a8ea2a4f3e diff --git a/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs b/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs index dd0738e6e5..cdb087f6c3 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs @@ -58,7 +58,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables ScaleTo(1.6f); ScaleTo(1, 100, EasingTypes.In); - MoveToRelative(new Vector2(0, 100), 800, EasingTypes.InQuint); + MoveToOffset(new Vector2(0, 100), 800, EasingTypes.InQuint); RotateTo(40, 800, EasingTypes.InQuint); Delay(600); From 882d5edf7d582a1f564119228156ce29b0ccc5ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 11 Dec 2016 10:09:58 +0100 Subject: [PATCH 51/79] Fix dropped input outside of playfield. --- osu.Game/Modes/UI/Playfield.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Modes/UI/Playfield.cs b/osu.Game/Modes/UI/Playfield.cs index ec91536f29..fc042d72a0 100644 --- a/osu.Game/Modes/UI/Playfield.cs +++ b/osu.Game/Modes/UI/Playfield.cs @@ -35,6 +35,8 @@ namespace osu.Game.Modes.UI public class ScaledContainer : Container { protected override Vector2 DrawScale => new Vector2(DrawSize.X / 512); + + public override bool Contains(Vector2 screenSpacePos) => true; } public class HitObjectContainer : Container From eef697d842456c2df5753f25dc417d461985bc56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 11 Dec 2016 10:11:22 +0100 Subject: [PATCH 52/79] Wire up CircleSize to hitobjects. Note, that circle sizes still are wrong compared to stable osu. In order to fix this, the base radius of hitcircles needs to become 64, but it currently is 72. --- .../Tests/TestCaseGamefield.cs | 3 +- .../Objects/Drawables/DrawableHitCircle.cs | 6 ++-- .../Objects/Drawables/DrawableOsuHitObject.cs | 5 ---- .../Objects/Drawables/DrawableSlider.cs | 28 +++++++++++++------ .../Objects/Drawables/Pieces/SliderBall.cs | 6 ++-- .../Objects/Drawables/Pieces/SliderBouncer.cs | 2 +- osu.Game.Modes.Osu/Objects/OsuHitObject.cs | 10 +++++++ osu.Game.Modes.Osu/Objects/Slider.cs | 4 +-- 8 files changed, 41 insertions(+), 23 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs index 3841420dad..d77e2d135b 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs @@ -42,7 +42,8 @@ namespace osu.Desktop.VisualTests.Tests objects.Add(new HitCircle() { StartTime = time, - Position = new Vector2(RNG.Next(0, 512), RNG.Next(0, 384)) + Position = new Vector2(RNG.Next(0, 512), RNG.Next(0, 384)), + Scale = RNG.NextSingle(0.5f, 1.0f), }); time += RNG.Next(50, 500); diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs index ebb5057a49..ccbfbb1db3 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -13,7 +13,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables { public class DrawableHitCircle : DrawableOsuHitObject { - private OsuHitObject osuObject; + private HitCircle osuObject; public ApproachCircle ApproachCircle; private CirclePiece circle; @@ -23,12 +23,13 @@ namespace osu.Game.Modes.Osu.Objects.Drawables private NumberPiece number; private GlowPiece glow; - public DrawableHitCircle(OsuHitObject h) : base(h) + public DrawableHitCircle(HitCircle h) : base(h) { osuObject = h; Origin = Anchor.Centre; Position = osuObject.Position; + Scale = new Vector2(osuObject.Scale); Children = new Drawable[] { @@ -104,7 +105,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables ApproachCircle.Alpha = 0; ApproachCircle.Scale = new Vector2(2); explode.Alpha = 0; - Scale = new Vector2(0.5f); //this will probably need to be moved to DrawableHitObject at some point. } protected override void UpdatePreemptState() diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs index e6e948cf6f..9e1fb93cd5 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -1,12 +1,7 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using osu.Game.Modes.Objects; using osu.Game.Modes.Objects.Drawables; diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs index e0af180e95..fcf480c384 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSlider.cs @@ -27,24 +27,32 @@ namespace osu.Game.Modes.Osu.Objects.Drawables slider = s; - Origin = Anchor.TopLeft; - Position = Vector2.Zero; - RelativeSizeAxes = Axes.Both; - Children = new Drawable[] { body = new SliderBody(s) { Position = s.Position, - PathWidth = 36, + PathWidth = s.Scale * 72, + }, + bouncer1 = new SliderBouncer(s, false) + { + Position = s.Curve.PositionAt(1), + Scale = new Vector2(s.Scale), + }, + bouncer2 = new SliderBouncer(s, true) + { + Position = s.Position, + Scale = new Vector2(s.Scale), + }, + ball = new SliderBall(s) + { + Scale = new Vector2(s.Scale), }, - bouncer1 = new SliderBouncer(slider, false) { Position = slider.Curve.PositionAt(1) }, - bouncer2 = new SliderBouncer(slider, true) { Position = slider.Position }, - ball = new SliderBall(slider), initialCircle = new DrawableHitCircle(new HitCircle { StartTime = s.StartTime, Position = s.Position, + Scale = s.Scale, Colour = s.Colour, }) { @@ -58,6 +66,10 @@ namespace osu.Game.Modes.Osu.Objects.Drawables components.Add(bouncer2); } + // Since the DrawableSlider itself is just a container without a size we need to + // pass all input through. + public override bool Contains(Vector2 screenSpacePos) => true; + protected override void Update() { base.Update(); diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs index ce34ef7c22..8d31acdf4e 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -16,7 +16,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces private readonly Slider slider; private Box follow; - const float width = 70; + const float width = 140; public SliderBall(Slider slider) { @@ -25,7 +25,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces AutoSizeAxes = Axes.Both; BlendingMode = BlendingMode.Additive; Origin = Anchor.Centre; - BorderThickness = 5; + BorderThickness = 10; BorderColour = Color4.Orange; Children = new Drawable[] @@ -45,7 +45,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces AutoSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, - BorderThickness = 7, + BorderThickness = 14, BorderColour = Color4.White, Alpha = 1, CornerRadius = width / 2, diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBouncer.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBouncer.cs index 39d09e6d66..47a345bdc3 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBouncer.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBouncer.cs @@ -35,7 +35,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces Icon = FontAwesome.fa_eercast, Anchor = Anchor.Centre, Origin = Anchor.Centre, - TextSize = 24, + TextSize = 48, } }; } diff --git a/osu.Game.Modes.Osu/Objects/OsuHitObject.cs b/osu.Game.Modes.Osu/Objects/OsuHitObject.cs index 61932f80a3..12fdf1a344 100644 --- a/osu.Game.Modes.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Modes.Osu/Objects/OsuHitObject.cs @@ -5,6 +5,7 @@ using System; using osu.Game.Beatmaps.Samples; using osu.Game.Modes.Objects; using OpenTK; +using osu.Game.Beatmaps; namespace osu.Game.Modes.Osu.Objects { @@ -12,8 +13,17 @@ namespace osu.Game.Modes.Osu.Objects { public Vector2 Position { get; set; } + public float Scale { get; set; } = 1; + public virtual Vector2 EndPosition => Position; + public override void SetDefaultsFromBeatmap(Beatmap beatmap) + { + base.SetDefaultsFromBeatmap(beatmap); + + Scale = (1.0f - 0.7f * (beatmap.BeatmapInfo.BaseDifficulty.CircleSize - 5) / 5) / 2; + } + [Flags] internal enum HitObjectType { diff --git a/osu.Game.Modes.Osu/Objects/Slider.cs b/osu.Game.Modes.Osu/Objects/Slider.cs index 3c11ead7e4..27210eec10 100644 --- a/osu.Game.Modes.Osu/Objects/Slider.cs +++ b/osu.Game.Modes.Osu/Objects/Slider.cs @@ -1,9 +1,7 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Database; using osu.Game.Beatmaps; -using System; using OpenTK; namespace osu.Game.Modes.Osu.Objects @@ -18,6 +16,8 @@ namespace osu.Game.Modes.Osu.Objects public override void SetDefaultsFromBeatmap(Beatmap beatmap) { + base.SetDefaultsFromBeatmap(beatmap); + Velocity = 100 / beatmap.BeatLengthAt(StartTime, true) * beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier; } From b94d11787e945ac956d8160249bcd3d34361d474 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 12 Dec 2016 15:38:26 +0900 Subject: [PATCH 53/79] Update framework. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index b918a5bb33..cea7e88cad 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit b918a5bb33b18e194af265d82f9011a8ea2a4f3e +Subproject commit cea7e88cad687a6a6613655ddd74be3f15bf49db From db5c2efa157fe4f7628f48864136cfe94edf814c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 13 Dec 2016 18:12:35 +0900 Subject: [PATCH 54/79] Rename tracking variable and change conditional as per feedback. --- osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs index 89df67757c..0df80984bb 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -98,14 +98,14 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces } } - private bool validTrackingTime => Time.Current >= slider.StartTime && Time.Current <= slider.EndTime; + private bool canCurrentlyTrack => Time.Current >= slider.StartTime && Time.Current < slider.EndTime; protected override void Update() { base.Update(); CornerRadius = DrawWidth / 2; - Tracking = validTrackingTime && lastState != null && Contains(lastState.Mouse.NativeState.Position) && lastState.Mouse.HasMainButtonPressed; + Tracking = canCurrentlyTrack && lastState != null && Contains(lastState.Mouse.NativeState.Position) && lastState.Mouse.HasMainButtonPressed; } public void UpdateProgress(double progress, int repeat) From 21f993d1492b18220168a320bab57214f22bcf4d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Dec 2016 22:57:14 +0900 Subject: [PATCH 55/79] Add ability to navigate song select carousel using arrow keys. --- osu.Game/Screens/Select/CarouselContainer.cs | 68 ++++++++++++++++---- 1 file changed, 56 insertions(+), 12 deletions(-) diff --git a/osu.Game/Screens/Select/CarouselContainer.cs b/osu.Game/Screens/Select/CarouselContainer.cs index 2c59639ce7..144e4cabba 100644 --- a/osu.Game/Screens/Select/CarouselContainer.cs +++ b/osu.Game/Screens/Select/CarouselContainer.cs @@ -1,19 +1,21 @@ //Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using osu.Framework.Caching; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Transformations; -using osu.Game.Database; -using System; -using System.Collections.Generic; -using System.Linq; -using osu.Framework.Extensions.IEnumerableExtensions; -using osu.Framework.Lists; -using osu.Game.Beatmaps.Drawables; +using OpenTK; +using osu.Framework.Caching; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Transformations; +using osu.Game.Database; +using System; +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.Lists; +using osu.Game.Beatmaps.Drawables; using osu.Framework.Timing; +using osu.Framework.Input; +using OpenTK.Input; namespace osu.Game.Screens.Select { @@ -244,5 +246,47 @@ namespace osu.Game.Screens.Select updatePanel(p, halfHeight); } } + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + int direction = 0; + bool skipDifficulties = false; + + switch (args.Key) + { + case Key.Up: + direction = -1; + break; + case Key.Down: + direction = 1; + break; + case Key.Left: + direction = -1; + skipDifficulties = true; + break; + case Key.Right: + direction = 1; + skipDifficulties = true; + break; + } + + if (direction != 0) + { + int index = SelectedGroup.BeatmapPanels.IndexOf(SelectedPanel) + direction; + + if (!skipDifficulties && index >= 0 && index < SelectedGroup.BeatmapPanels.Count) + //changing difficulty panel, not set. + SelectGroup(SelectedGroup, SelectedGroup.BeatmapPanels[index]); + else + { + index = (groups.IndexOf(SelectedGroup) + direction + groups.Count) % groups.Count; + SelectBeatmap(groups[index].BeatmapPanels.First().Beatmap); + } + + return true; + } + + return base.OnKeyDown(state, args); + } } } From 9557821776b5e71084a064b275fb65b567a0f768 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Dec 2016 20:55:37 +0900 Subject: [PATCH 56/79] Start a map using enter key. --- osu.Game/Screens/Select/PlaySongSelect.cs | 29 +++++++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 9d2debb8aa..e79278a742 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -28,6 +28,8 @@ using osu.Framework.Audio.Sample; using osu.Framework.Graphics.Transformations; using osu.Game.Beatmaps.Drawables; using osu.Game.Graphics.Containers; +using osu.Framework.Input; +using OpenTK.Input; namespace osu.Game.Screens.Select { @@ -141,17 +143,22 @@ namespace osu.Game.Screens.Select Width = 100, Text = "Play", Colour = new Color4(238, 51, 153, 255), - Action = () => Push(new Player - { - BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap, - PreferredPlayMode = playMode.Value - }) + Action = start }, } } }; } + private void start() + { + Push(new Player + { + BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap, + PreferredPlayMode = playMode.Value + }); + } + [BackgroundDependencyLoader(permitNulls: true)] private void load(BeatmapDatabase beatmaps, AudioManager audio, BaseGame game, OsuGame osuGame) { @@ -343,5 +350,17 @@ namespace osu.Game.Screens.Select addBeatmapSet(beatmapSet, game); } } + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + switch (args.Key) + { + case Key.Enter: + start(); + return true; + } + + return base.OnKeyDown(state, args); + } } } From 8d800dac992d0d941e80164eec78e0fe36a8b1e5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Dec 2016 21:18:30 +0900 Subject: [PATCH 57/79] Make Player load async. --- osu.Game/Screens/Select/PlaySongSelect.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index e79278a742..e9e5144159 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -150,12 +150,26 @@ namespace osu.Game.Screens.Select }; } + Player player; + private void start() { - Push(new Player + if (player != null) + return; + + player = new Player { BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap, PreferredPlayMode = playMode.Value + }; + + player.Preload(Game, delegate + { + if (!Push(player)) + { + player = null; + //error occured? + } }); } @@ -206,6 +220,8 @@ namespace osu.Game.Screens.Select protected override void OnResuming(GameMode last) { + player = null; + changeBackground(Beatmap); ensurePlayingSelected(); base.OnResuming(last); From 08ef8ed8ea22b3266937f0b463da005ef54db6b9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Dec 2016 21:20:27 +0900 Subject: [PATCH 58/79] Add comment about future implementation. --- osu.Game/Screens/Select/PlaySongSelect.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index e9e5144159..6e311d7dd5 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -157,6 +157,8 @@ namespace osu.Game.Screens.Select if (player != null) return; + //in the future we may want to move this logic to a PlayerLoader gamemode or similar, so we can rely on the SongSelect transition + //and provide a better loading experience (at the moment song select is still accepting input during preload). player = new Player { BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap, From 0a9e3ce1b081f053ff3cfecd6836297b657e9a9e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Dec 2016 21:47:32 +0900 Subject: [PATCH 59/79] Don't handle input in triangle particle effect containers. --- osu.Game.Modes.Osu/Objects/Drawables/Pieces/Triangles.cs | 2 ++ osu.Game/Graphics/Backgrounds/Triangles.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/Triangles.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/Triangles.cs index 95f25c43d1..2025934e71 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/Triangles.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/Triangles.cs @@ -13,6 +13,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces { public class Triangles : Container { + public override bool HandleInput => false; + protected override void LoadComplete() { base.LoadComplete(); diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index 34e65f0b2a..b68b5ebc4a 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -15,6 +15,8 @@ namespace osu.Game.Graphics.Backgrounds { public class Triangles : Container { + public override bool HandleInput => false; + public Triangles() { Alpha = 0.3f; From d8e40d4fb160a5b30b3de32e5f9daba07c1d8057 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Dec 2016 21:47:57 +0900 Subject: [PATCH 60/79] Add naive lifetime calculation for drawable HitObjects. --- osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs index 94694b8d5e..d18b3e2cbb 100644 --- a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs @@ -44,6 +44,8 @@ namespace osu.Game.Modes.Objects.Drawables UpdateState(state); + Expire(true); + if (State == ArmedState.Hit) PlaySample(); } @@ -75,6 +77,8 @@ namespace osu.Game.Modes.Objects.Drawables //force application of the state that was set before we loaded. UpdateState(State); + + Expire(true); } /// From cf8283582b6aa877439eb4b942efbf3c12820171 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Dec 2016 22:33:11 +0900 Subject: [PATCH 61/79] Don't update LifetimeStart on HitObject state change. --- osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs index d18b3e2cbb..7ce71acf3e 100644 --- a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs @@ -44,7 +44,7 @@ namespace osu.Game.Modes.Objects.Drawables UpdateState(state); - Expire(true); + Expire(); if (State == ArmedState.Hit) PlaySample(); From ec7bbd231f8ceff76195b19c41daaf3d92c8f3c6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Dec 2016 22:35:12 +0900 Subject: [PATCH 62/79] Make flash animation last slightly longer. --- osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs index ccbfbb1db3..b2179d95d0 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -134,7 +134,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables FadeOut(TIME_FADEOUT / 5); break; case ArmedState.Hit: - const double flash_in = 30; + const double flash_in = 40; flash.FadeTo(0.8f, flash_in); flash.Delay(flash_in); From 8ce18e89869b15af8bb98a8afd35169cc272eea0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Dec 2016 22:48:35 +0900 Subject: [PATCH 63/79] Improve song select startup time via better database querying. Also fix difficulty displays. --- osu.Game/Beatmaps/Drawables/BeatmapGroup.cs | 2 +- osu.Game/Screens/Select/PlaySongSelect.cs | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs index 3f5fe58ab5..db769bccc9 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs @@ -54,7 +54,7 @@ namespace osu.Game.Beatmaps.Drawables } } - public BeatmapGroup(WorkingBeatmap beatmap) + public BeatmapGroup(WorkingBeatmap beatmap, BeatmapSetInfo set = null) { this.beatmap = beatmap; diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 6e311d7dd5..bf4d2c84f1 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -164,7 +164,7 @@ namespace osu.Game.Screens.Select BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap, PreferredPlayMode = playMode.Value }; - + player.Preload(Game, delegate { if (!Push(player)) @@ -336,10 +336,15 @@ namespace osu.Game.Screens.Select private void addBeatmapSet(BeatmapSetInfo beatmapSet, BaseGame game) { beatmapSet = database.GetWithChildren(beatmapSet.BeatmapSetID); - beatmapSet.Beatmaps.ForEach(b => database.GetChildren(b)); + beatmapSet.Beatmaps.ForEach(b => + { + database.GetChildren(b); + if (b.Metadata == null) b.Metadata = beatmapSet.Metadata; + }); + beatmapSet.Beatmaps = beatmapSet.Beatmaps.OrderBy(b => b.BaseDifficulty.OverallDifficulty).ToList(); - var beatmap = database.GetWorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault()); + var beatmap = new WorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault(), beatmapSet, database); var group = new BeatmapGroup(beatmap) { SelectionChanged = selectionChanged }; From 20260b43d17d17d77004c9953ac9d4b828988d0b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 15 Dec 2016 22:51:35 +0900 Subject: [PATCH 64/79] Improve star animation. --- osu.Game/Graphics/UserInterface/StarCounter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/StarCounter.cs b/osu.Game/Graphics/UserInterface/StarCounter.cs index 097362bc77..fa8ca7e5a9 100644 --- a/osu.Game/Graphics/UserInterface/StarCounter.cs +++ b/osu.Game/Graphics/UserInterface/StarCounter.cs @@ -35,7 +35,7 @@ namespace osu.Game.Graphics.UserInterface protected set; } - private double animationDelay => 150; + private double animationDelay => 80; private double scalingDuration => 500; private EasingTypes scalingEasing => EasingTypes.OutElasticHalf; From a845a897b3e720de5cad7b3889246cfcffefed26 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 15 Dec 2016 17:11:48 -0600 Subject: [PATCH 65/79] Add Base Preview Time --- osu.Game/Screens/Select/PlaySongSelect.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 9d2debb8aa..1496727469 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -279,20 +279,28 @@ namespace osu.Game.Screens.Select /// private void selectionChanged(BeatmapGroup group, BeatmapInfo beatmap) { + bool beatmapSetChange = false; if (!beatmap.Equals(Beatmap?.BeatmapInfo)) { if (beatmap.BeatmapSetID == Beatmap?.BeatmapInfo.BeatmapSetID) + { sampleChangeDifficulty.Play(); + beatmapSetChange = false; + } else + { sampleChangeBeatmap.Play(); + beatmapSetChange = true; + + } Beatmap = database.GetWorkingBeatmap(beatmap, Beatmap); } - - ensurePlayingSelected(); + + ensurePlayingSelected(beatmapSetChange); } - private async Task ensurePlayingSelected() + private async Task ensurePlayingSelected(bool preview = false) { AudioTrack track = null; @@ -303,6 +311,8 @@ namespace osu.Game.Screens.Select if (track != null) { trackManager.SetExclusive(track); + if (preview) + track.Seek(Beatmap.Beatmap.Metadata.PreviewTime); track.Start(); } }); From b788878c95f8756825967990bea141577a0a5a36 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 15 Dec 2016 17:28:22 -0600 Subject: [PATCH 66/79] Unnecesary things were removed (I guess) --- osu.Game/Screens/Select/PlaySongSelect.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 1496727469..7eae136d5e 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -280,23 +280,19 @@ namespace osu.Game.Screens.Select private void selectionChanged(BeatmapGroup group, BeatmapInfo beatmap) { bool beatmapSetChange = false; + if (!beatmap.Equals(Beatmap?.BeatmapInfo)) { if (beatmap.BeatmapSetID == Beatmap?.BeatmapInfo.BeatmapSetID) - { sampleChangeDifficulty.Play(); - beatmapSetChange = false; - } else { sampleChangeBeatmap.Play(); beatmapSetChange = true; - } - Beatmap = database.GetWorkingBeatmap(beatmap, Beatmap); } - + ensurePlayingSelected(beatmapSetChange); } From d37ff8f153d9762fe7eab53e31b4171bb01b56da Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 15 Dec 2016 17:35:14 -0600 Subject: [PATCH 67/79] Deleted unnecesary things (I guess) --- osu.Game/Screens/Select/PlaySongSelect.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 7eae136d5e..bc9c983352 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -292,7 +292,6 @@ namespace osu.Game.Screens.Select } Beatmap = database.GetWorkingBeatmap(beatmap, Beatmap); } - ensurePlayingSelected(beatmapSetChange); } From c642f6c34f3cef27d924318891d464212d7dbb2e Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 7 Dec 2016 15:39:21 -0500 Subject: [PATCH 68/79] Add sliderbar L+F --- osu.Game/Overlays/Options/SliderOption.cs | 135 +++++++++++++++------- 1 file changed, 91 insertions(+), 44 deletions(-) diff --git a/osu.Game/Overlays/Options/SliderOption.cs b/osu.Game/Overlays/Options/SliderOption.cs index d00eeebe35..cbb6fc4148 100644 --- a/osu.Game/Overlays/Options/SliderOption.cs +++ b/osu.Game/Overlays/Options/SliderOption.cs @@ -1,53 +1,100 @@ -using System; +using System; +using OpenTK; using OpenTK.Graphics; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.UserInterface; -namespace osu.Game.Overlays.Options -{ - public class SliderOption : FlowContainer where T : struct, - IComparable, IFormattable, IConvertible, IComparable, IEquatable - { - private SliderBar slider; - private SpriteText text; - - public string LabelText - { - get { return text.Text; } - set - { - text.Text = value; - text.Alpha = string.IsNullOrEmpty(value) ? 0 : 1; - } - } - - public BindableNumber Bindable - { - get { return slider.Bindable; } - set { slider.Bindable = value; } - } - - public SliderOption() - { - Direction = FlowDirection.VerticalOnly; - RelativeSizeAxes = Axes.X; - AutoSizeAxes = Axes.Y; - Children = new Drawable[] - { - text = new SpriteText { Alpha = 0 }, - slider = new SliderBar - { - Margin = new MarginPadding { Top = 5 }, - Height = 10, - RelativeSizeAxes = Axes.X, - Color = Color4.White, - SelectionColor = new Color4(255, 102, 170, 255), - } - }; - } - } +namespace osu.Game.Overlays.Options +{ + public class SliderOption : FlowContainer where T : struct, + IComparable, IFormattable, IConvertible, IComparable, IEquatable + { + private SliderBar slider; + private SpriteText text; + + public string LabelText + { + get { return text.Text; } + set + { + text.Text = value; + text.Alpha = string.IsNullOrEmpty(value) ? 0 : 1; + } + } + + public BindableNumber Bindable + { + get { return slider.Bindable; } + set { slider.Bindable = value; } + } + + public SliderOption() + { + Direction = FlowDirection.VerticalOnly; + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + Children = new Drawable[] + { + text = new SpriteText { Alpha = 0 }, + slider = new OsuSliderBar + { + Margin = new MarginPadding { Top = 5 }, + RelativeSizeAxes = Axes.X, + } + }; + } + + private class OsuSliderBar : SliderBar where U : struct, + IComparable, IFormattable, IConvertible, IComparable, IEquatable + { + private Container nub; + + public OsuSliderBar() + { + Height = 22; + Color = Color4.White; + SelectionColor = new Color4(255, 102, 170, 255); + Add(nub = new Container + { + Width = Height, + Height = Height, + CornerRadius = Height / 2, + Origin = Anchor.TopCentre, + AutoSizeAxes = Axes.None, + RelativeSizeAxes = Axes.None, + RelativePositionAxes = Axes.X, + Masking = true, + BorderColour = new Color4(255, 102, 170, 255), + BorderThickness = 2, + Children = new[] + { + new Box { Colour = Color4.Transparent, RelativeSizeAxes = Axes.Both } + } + }); + Box.Height = SelectionBox.Height = 2; + Box.RelativePositionAxes = Axes.None; + Box.RelativeSizeAxes = SelectionBox.RelativeSizeAxes = Axes.None; + Box.Position = SelectionBox.Position = new Vector2(0, Height / 2 - 1); + Box.Colour = new Color4(255, 102, 170, 100); + } + + protected override void UpdateAmount(float amt) + { + nub.MoveToX(amt, 300, EasingTypes.OutQuint); + SelectionBox.ScaleTo( + new Vector2(DrawWidth * amt - Height / 2 + 1, 1), + 300, EasingTypes.OutQuint); + Box.MoveToX(DrawWidth * amt + Height / 2 - 1, + 300, EasingTypes.OutQuint); + Box.ScaleTo( + new Vector2(DrawWidth * (1 - amt) - Height / 2 + 1, 1), + 300, EasingTypes.OutQuint); + } + } + } } \ No newline at end of file From 22c2a4757cc1d079427124677d40259c212465e8 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 7 Dec 2016 15:56:00 -0500 Subject: [PATCH 69/79] Play slider sample as the value changes in 1/10ths --- osu.Game/Overlays/Options/SliderOption.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/osu.Game/Overlays/Options/SliderOption.cs b/osu.Game/Overlays/Options/SliderOption.cs index cbb6fc4148..c86e226672 100644 --- a/osu.Game/Overlays/Options/SliderOption.cs +++ b/osu.Game/Overlays/Options/SliderOption.cs @@ -1,6 +1,9 @@ using System; using OpenTK; using OpenTK.Graphics; +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -53,6 +56,8 @@ namespace osu.Game.Overlays.Options IComparable, IFormattable, IConvertible, IComparable, IEquatable { private Container nub; + private AudioSample sample; + private float prevAmount = -1; public OsuSliderBar() { @@ -83,8 +88,17 @@ namespace osu.Game.Overlays.Options Box.Colour = new Color4(255, 102, 170, 100); } + [BackgroundDependencyLoader] + private void load(AudioManager audio) + { + sample = audio.Sample.Get(@"Sliderbar/sliderbar"); + } + protected override void UpdateAmount(float amt) { + if (prevAmount != -1 && (int)(prevAmount * 10) != (int)(amt * 10)) + sample?.Play(); + prevAmount = amt; nub.MoveToX(amt, 300, EasingTypes.OutQuint); SelectionBox.ScaleTo( new Vector2(DrawWidth * amt - Height / 2 + 1, 1), From 9e75ecab4fdbc178f7350f16ee29e4e5bfca08fc Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 8 Dec 2016 17:12:12 -0500 Subject: [PATCH 70/79] Fix up slider bugs --- osu.Game/Overlays/Options/SliderOption.cs | 117 +++++++++++++++------- 1 file changed, 79 insertions(+), 38 deletions(-) diff --git a/osu.Game/Overlays/Options/SliderOption.cs b/osu.Game/Overlays/Options/SliderOption.cs index c86e226672..ac49c72e38 100644 --- a/osu.Game/Overlays/Options/SliderOption.cs +++ b/osu.Game/Overlays/Options/SliderOption.cs @@ -1,5 +1,6 @@ using System; using OpenTK; +using OpenTK.Input; using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Audio; @@ -11,6 +12,7 @@ using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.UserInterface; +using osu.Framework.Input; namespace osu.Game.Overlays.Options { @@ -55,37 +57,50 @@ namespace osu.Game.Overlays.Options private class OsuSliderBar : SliderBar where U : struct, IComparable, IFormattable, IConvertible, IComparable, IEquatable { - private Container nub; private AudioSample sample; - private float prevAmount = -1; - + private double lastSample; + + private Container nub; + private Box leftBox, rightBox; public OsuSliderBar() { Height = 22; - Color = Color4.White; - SelectionColor = new Color4(255, 102, 170, 255); - Add(nub = new Container + Children = new Drawable[] { - Width = Height, - Height = Height, - CornerRadius = Height / 2, - Origin = Anchor.TopCentre, - AutoSizeAxes = Axes.None, - RelativeSizeAxes = Axes.None, - RelativePositionAxes = Axes.X, - Masking = true, - BorderColour = new Color4(255, 102, 170, 255), - BorderThickness = 2, - Children = new[] + leftBox = new Box { - new Box { Colour = Color4.Transparent, RelativeSizeAxes = Axes.Both } - } - }); - Box.Height = SelectionBox.Height = 2; - Box.RelativePositionAxes = Axes.None; - Box.RelativeSizeAxes = SelectionBox.RelativeSizeAxes = Axes.None; - Box.Position = SelectionBox.Position = new Vector2(0, Height / 2 - 1); - Box.Colour = new Color4(255, 102, 170, 100); + Height = 2, + RelativeSizeAxes = Axes.None, + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Colour = new Color4(255, 102, 170, 255), + }, + rightBox = new Box + { + Height = 2, + RelativeSizeAxes = Axes.None, + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + Colour = new Color4(255, 102, 170, 255), + Alpha = 0.5f, + }, + nub = new Container + { + Width = Height, + Height = Height, + CornerRadius = Height / 2, + Origin = Anchor.TopCentre, + AutoSizeAxes = Axes.None, + RelativeSizeAxes = Axes.None, + Masking = true, + BorderColour = new Color4(255, 102, 170, 255), + BorderThickness = 3, + Children = new[] + { + new Box { Colour = Color4.Transparent, RelativeSizeAxes = Axes.Both } + } + }, + }; } [BackgroundDependencyLoader] @@ -94,20 +109,46 @@ namespace osu.Game.Overlays.Options sample = audio.Sample.Get(@"Sliderbar/sliderbar"); } - protected override void UpdateAmount(float amt) + private void playSample() { - if (prevAmount != -1 && (int)(prevAmount * 10) != (int)(amt * 10)) - sample?.Play(); - prevAmount = amt; - nub.MoveToX(amt, 300, EasingTypes.OutQuint); - SelectionBox.ScaleTo( - new Vector2(DrawWidth * amt - Height / 2 + 1, 1), - 300, EasingTypes.OutQuint); - Box.MoveToX(DrawWidth * amt + Height / 2 - 1, - 300, EasingTypes.OutQuint); - Box.ScaleTo( - new Vector2(DrawWidth * (1 - amt) - Height / 2 + 1, 1), - 300, EasingTypes.OutQuint); + if (Clock == null) + return; + if (Clock.CurrentTime - lastSample > 50) + { + lastSample = Clock.CurrentTime; + sample.Frequency.Value = 1 + NormalizedValue * 0.2f; + sample.Play(); + } + } + + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + { + if (args.Key == Key.Left || args.Key == Key.Right) + playSample(); + return base.OnKeyDown(state, args); + } + + protected override bool OnClick(InputState state) + { + playSample(); + return base.OnClick(state); + } + + protected override bool OnDrag(InputState state) + { + playSample(); + return base.OnDrag(state); + } + + protected override void UpdateValue(float value) + { + nub.MoveToX(DrawWidth * value, 300, EasingTypes.OutQuint); + leftBox.ScaleTo(new Vector2( + MathHelper.Clamp(DrawWidth * value - nub.Width / 2 + 2, 0, DrawWidth), + 1), 300, EasingTypes.OutQuint); + rightBox.ScaleTo(new Vector2( + MathHelper.Clamp(DrawWidth * (1 - value) - nub.Width / 2 + 2, 0, DrawWidth), + 1), 300, EasingTypes.OutQuint); } } } From 10cc6f7885d42fe359ea1a839bd9f28911d19438 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 9 Dec 2016 08:18:58 -0500 Subject: [PATCH 71/79] Move where clause to next line --- osu.Game/Overlays/Options/SliderOption.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Options/SliderOption.cs b/osu.Game/Overlays/Options/SliderOption.cs index ac49c72e38..010514efcd 100644 --- a/osu.Game/Overlays/Options/SliderOption.cs +++ b/osu.Game/Overlays/Options/SliderOption.cs @@ -16,8 +16,8 @@ using osu.Framework.Input; namespace osu.Game.Overlays.Options { - public class SliderOption : FlowContainer where T : struct, - IComparable, IFormattable, IConvertible, IComparable, IEquatable + public class SliderOption : FlowContainer + where T : struct, IComparable, IFormattable, IConvertible, IComparable, IEquatable { private SliderBar slider; private SpriteText text; @@ -54,8 +54,8 @@ namespace osu.Game.Overlays.Options }; } - private class OsuSliderBar : SliderBar where U : struct, - IComparable, IFormattable, IConvertible, IComparable, IEquatable + private class OsuSliderBar : SliderBar + where U : struct, IComparable, IFormattable, IConvertible, IComparable, IEquatable { private AudioSample sample; private double lastSample; @@ -152,4 +152,4 @@ namespace osu.Game.Overlays.Options } } } -} \ No newline at end of file +} From a751cfcba3cb6d029fe5a41de2869f19450c9033 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 14 Dec 2016 14:57:41 -0500 Subject: [PATCH 72/79] Update SliderOption implementation Per @Tom94's suggestion, the bars track the nub in Update instead of animating seperately. Also only animates when the event source is the keyboard. --- osu.Game/Overlays/Options/SliderOption.cs | 24 ++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/Options/SliderOption.cs b/osu.Game/Overlays/Options/SliderOption.cs index 010514efcd..a13bce6217 100644 --- a/osu.Game/Overlays/Options/SliderOption.cs +++ b/osu.Game/Overlays/Options/SliderOption.cs @@ -139,16 +139,22 @@ namespace osu.Game.Overlays.Options playSample(); return base.OnDrag(state); } - - protected override void UpdateValue(float value) + + protected override void Update() { - nub.MoveToX(DrawWidth * value, 300, EasingTypes.OutQuint); - leftBox.ScaleTo(new Vector2( - MathHelper.Clamp(DrawWidth * value - nub.Width / 2 + 2, 0, DrawWidth), - 1), 300, EasingTypes.OutQuint); - rightBox.ScaleTo(new Vector2( - MathHelper.Clamp(DrawWidth * (1 - value) - nub.Width / 2 + 2, 0, DrawWidth), - 1), 300, EasingTypes.OutQuint); + leftBox.Scale = new Vector2(MathHelper.Clamp( + nub.DrawPosition.X - nub.DrawSize.X / 2 + 2, 0, DrawWidth), 1); + rightBox.Scale = new Vector2(MathHelper.Clamp( + DrawWidth - nub.DrawPosition.X - nub.DrawSize.X / 2 + 2, 0, DrawWidth), 1); + base.Update(); + } + + protected override void UpdateValue(float value, SliderBarEventSource eventSource) + { + if (eventSource == SliderBarEventSource.Keyboard) + nub.MoveToX(DrawWidth * value, 300, EasingTypes.OutQuint); + else + nub.Position = new Vector2(DrawWidth * value, nub.Position.Y); } } } From abc6db18b39fbf26902ce3e8ce0f69449500f3e4 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 14 Dec 2016 14:59:23 -0500 Subject: [PATCH 73/79] Add license header --- osu.Game/Overlays/Options/SliderOption.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Options/SliderOption.cs b/osu.Game/Overlays/Options/SliderOption.cs index a13bce6217..83a6148e69 100644 --- a/osu.Game/Overlays/Options/SliderOption.cs +++ b/osu.Game/Overlays/Options/SliderOption.cs @@ -1,4 +1,7 @@ -using System; +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using OpenTK; using OpenTK.Input; using OpenTK.Graphics; From 80574423cbd82bc00bcacd6e681b810b21e2ef4c Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 15 Dec 2016 00:11:37 -0500 Subject: [PATCH 74/79] Drop SliderBarEventSource --- osu.Game/Overlays/Options/SliderOption.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/Options/SliderOption.cs b/osu.Game/Overlays/Options/SliderOption.cs index 83a6148e69..e20bc86c07 100644 --- a/osu.Game/Overlays/Options/SliderOption.cs +++ b/osu.Game/Overlays/Options/SliderOption.cs @@ -145,19 +145,16 @@ namespace osu.Game.Overlays.Options protected override void Update() { + base.Update(); leftBox.Scale = new Vector2(MathHelper.Clamp( nub.DrawPosition.X - nub.DrawSize.X / 2 + 2, 0, DrawWidth), 1); rightBox.Scale = new Vector2(MathHelper.Clamp( DrawWidth - nub.DrawPosition.X - nub.DrawSize.X / 2 + 2, 0, DrawWidth), 1); - base.Update(); } - protected override void UpdateValue(float value, SliderBarEventSource eventSource) + protected override void UpdateValue(float value) { - if (eventSource == SliderBarEventSource.Keyboard) - nub.MoveToX(DrawWidth * value, 300, EasingTypes.OutQuint); - else - nub.Position = new Vector2(DrawWidth * value, nub.Position.Y); + nub.Position = new Vector2(DrawWidth * value, nub.Position.Y); } } } From 96a6e30a212330c9c9d93bab8fb4e0d47e9f93e5 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 15 Dec 2016 22:50:23 -0500 Subject: [PATCH 75/79] Drop complicated type constraints --- osu.Game/Overlays/Options/SliderOption.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Options/SliderOption.cs b/osu.Game/Overlays/Options/SliderOption.cs index e20bc86c07..bdca93b341 100644 --- a/osu.Game/Overlays/Options/SliderOption.cs +++ b/osu.Game/Overlays/Options/SliderOption.cs @@ -19,8 +19,7 @@ using osu.Framework.Input; namespace osu.Game.Overlays.Options { - public class SliderOption : FlowContainer - where T : struct, IComparable, IFormattable, IConvertible, IComparable, IEquatable + public class SliderOption : FlowContainer where T : struct { private SliderBar slider; private SpriteText text; @@ -57,8 +56,7 @@ namespace osu.Game.Overlays.Options }; } - private class OsuSliderBar : SliderBar - where U : struct, IComparable, IFormattable, IConvertible, IComparable, IEquatable + private class OsuSliderBar : SliderBar where U : struct { private AudioSample sample; private double lastSample; From 6143a9f318d2a2f9d635ebe2d81d9591bc914375 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 16 Dec 2016 00:27:16 -0500 Subject: [PATCH 76/79] Update submodules --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index cea7e88cad..19008db380 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit cea7e88cad687a6a6613655ddd74be3f15bf49db +Subproject commit 19008db3800972e245f649468ac8330934c29a4c From 796858f86f2b5a3ac5eeb504dfa3e1a5183fb8a8 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 16 Dec 2016 00:37:37 -0500 Subject: [PATCH 77/79] Fix transparency issues --- osu.Game/Overlays/Options/SliderOption.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Options/SliderOption.cs b/osu.Game/Overlays/Options/SliderOption.cs index bdca93b341..179b3ed440 100644 --- a/osu.Game/Overlays/Options/SliderOption.cs +++ b/osu.Game/Overlays/Options/SliderOption.cs @@ -98,7 +98,11 @@ namespace osu.Game.Overlays.Options BorderThickness = 3, Children = new[] { - new Box { Colour = Color4.Transparent, RelativeSizeAxes = Axes.Both } + new Box + { + Colour = new Color4(255, 102, 170, 0), + RelativeSizeAxes = Axes.Both + } } }, }; From 67d748f677898cb62036637f7d0663597b00ba97 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 16 Dec 2016 01:27:57 -0500 Subject: [PATCH 78/79] Adjust padding on sliders --- osu.Game/Overlays/Options/SliderOption.cs | 31 ++++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/osu.Game/Overlays/Options/SliderOption.cs b/osu.Game/Overlays/Options/SliderOption.cs index 179b3ed440..44b7935945 100644 --- a/osu.Game/Overlays/Options/SliderOption.cs +++ b/osu.Game/Overlays/Options/SliderOption.cs @@ -59,13 +59,23 @@ namespace osu.Game.Overlays.Options private class OsuSliderBar : SliderBar where U : struct { private AudioSample sample; - private double lastSample; + private double lastSampleTime; private Container nub; private Box leftBox, rightBox; + + private float innerWidth + { + get + { + return DrawWidth - Height; + } + } + public OsuSliderBar() { Height = 22; + Padding = new MarginPadding { Left = Height / 2, Right = Height / 2 }; Children = new Drawable[] { leftBox = new Box @@ -104,7 +114,7 @@ namespace osu.Game.Overlays.Options RelativeSizeAxes = Axes.Both } } - }, + } }; } @@ -116,14 +126,11 @@ namespace osu.Game.Overlays.Options private void playSample() { - if (Clock == null) + if (Clock == null || Clock.CurrentTime - lastSampleTime <= 50) return; - if (Clock.CurrentTime - lastSample > 50) - { - lastSample = Clock.CurrentTime; - sample.Frequency.Value = 1 + NormalizedValue * 0.2f; - sample.Play(); - } + lastSampleTime = Clock.CurrentTime; + sample.Frequency.Value = 1 + NormalizedValue * 0.2f; + sample.Play(); } protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) @@ -149,14 +156,14 @@ namespace osu.Game.Overlays.Options { base.Update(); leftBox.Scale = new Vector2(MathHelper.Clamp( - nub.DrawPosition.X - nub.DrawSize.X / 2 + 2, 0, DrawWidth), 1); + nub.DrawPosition.X - nub.DrawWidth / 2 + 2, 0, innerWidth), 1); rightBox.Scale = new Vector2(MathHelper.Clamp( - DrawWidth - nub.DrawPosition.X - nub.DrawSize.X / 2 + 2, 0, DrawWidth), 1); + innerWidth - nub.DrawPosition.X - nub.DrawWidth / 2 + 2, 0, innerWidth), 1); } protected override void UpdateValue(float value) { - nub.Position = new Vector2(DrawWidth * value, nub.Position.Y); + nub.MoveToX(innerWidth * value); } } } From 400cb2da82d9afd0622e7fec5b81cdc649978e12 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 16 Dec 2016 01:44:23 -0500 Subject: [PATCH 79/79] Update submodules --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 19008db380..eab5cc9fde 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 19008db3800972e245f649468ac8330934c29a4c +Subproject commit eab5cc9fde277a9558712c69d92aed0671f2b0ad