From 2cbc5289710cccf674fe907fc32aca551b4727aa Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Dec 2016 16:50:39 +0900 Subject: [PATCH 1/4] Remove janky beatmap info wedge animation, restore pixel snapping. --- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 1 + osu.Game/Screens/Select/PlaySongSelect.cs | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index e4aa8f27b9..81cd55d429 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -61,6 +61,7 @@ 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 fb3f6acbdf..78423c06f1 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -213,11 +213,8 @@ namespace osu.Game.Screens.Select 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); + beatmapInfoWedge.MoveToX(wedged_container_start_position.X - 50); + beatmapInfoWedge.MoveToX(wedged_container_start_position.X, 800, EasingTypes.OutQuint); } protected override void OnResuming(GameMode last) From 6e10a9bb2973cbfae0b1f84e5c5c704d401be53c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Dec 2016 16:59:13 +0900 Subject: [PATCH 2/4] Allow starting maps by clicking an active panel a second time. --- osu.Game/Beatmaps/Drawables/BeatmapGroup.cs | 6 ++++++ osu.Game/Beatmaps/Drawables/BeatmapPanel.cs | 12 +++++++++++- osu.Game/Screens/Select/PlaySongSelect.cs | 6 +++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs index db769bccc9..f8d72ad67f 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs @@ -19,6 +19,11 @@ namespace osu.Game.Beatmaps.Drawables /// public Action SelectionChanged; + /// + /// Fires when one of our difficulties is clicked when already selected. Should start playing the map. + /// + public Action StartRequested; + public BeatmapSetHeader Header; private BeatmapGroupState state; @@ -68,6 +73,7 @@ namespace osu.Game.Beatmaps.Drawables { Alpha = 0, GainedSelection = panelGainedSelection, + StartRequested = p => { StartRequested?.Invoke(p.Beatmap); }, RelativeSizeAxes = Axes.X, }).ToList(); } diff --git a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs index 72d1e2f05d..e8b60bab81 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs @@ -16,7 +16,8 @@ using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.UserInterface; using OpenTK; using OpenTK.Graphics; - +using osu.Framework.Input; + namespace osu.Game.Beatmaps.Drawables { class BeatmapPanel : Panel @@ -25,6 +26,7 @@ namespace osu.Game.Beatmaps.Drawables private Sprite background; public Action GainedSelection; + public Action StartRequested; Color4 deselectedColour = new Color4(20, 43, 51, 255); @@ -45,6 +47,14 @@ namespace osu.Game.Beatmaps.Drawables background.Colour = deselectedColour; } + protected override bool OnClick(InputState state) + { + if (State == PanelSelectedState.Selected) + StartRequested?.Invoke(this); + + return base.OnClick(state); + } + public BeatmapPanel(BeatmapInfo beatmap) { Beatmap = beatmap; diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 78423c06f1..944b20eb65 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -348,7 +348,11 @@ namespace osu.Game.Screens.Select var beatmap = new WorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault(), beatmapSet, database); - var group = new BeatmapGroup(beatmap) { SelectionChanged = selectionChanged }; + var group = new BeatmapGroup(beatmap) + { + SelectionChanged = selectionChanged, + StartRequested = b => start() + }; //for the time being, let's completely load the difficulty panels in the background. //this likely won't scale so well, but allows us to completely async the loading flow. From 5ac9402d5fa1b4202c0883b66f5b2a4e3874b5d3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Dec 2016 17:06:03 +0900 Subject: [PATCH 3/4] Adjust fade out transform of difficulty panels to avoid overlap. --- osu.Game/Beatmaps/Drawables/BeatmapGroup.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs index f8d72ad67f..7014ada35f 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using osu.Framework; using osu.Framework.Graphics; +using osu.Framework.Graphics.Transformations; using osu.Game.Database; namespace osu.Game.Beatmaps.Drawables @@ -53,7 +54,7 @@ namespace osu.Game.Beatmaps.Drawables SelectedPanel.State = PanelSelectedState.NotSelected; foreach (BeatmapPanel panel in BeatmapPanels) - panel.FadeOut(250); + panel.FadeOut(300, EasingTypes.OutQuint); break; } } From f14a9e7d6bb6b35b1014e46d9703edb42d6d1082 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Dec 2016 17:06:56 +0900 Subject: [PATCH 4/4] Remove unused beatmap reference in BeatmapGroup. --- osu.Game/Beatmaps/Drawables/BeatmapGroup.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs index 7014ada35f..7799095a77 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs @@ -30,7 +30,6 @@ namespace osu.Game.Beatmaps.Drawables private BeatmapGroupState state; public List BeatmapPanels; - private WorkingBeatmap beatmap; public BeatmapGroupState State { @@ -62,8 +61,6 @@ namespace osu.Game.Beatmaps.Drawables public BeatmapGroup(WorkingBeatmap beatmap, BeatmapSetInfo set = null) { - this.beatmap = beatmap; - Header = new BeatmapSetHeader(beatmap) { GainedSelection = headerGainedSelection,