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); 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/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/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; 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; diff --git a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs index 94694b8d5e..7ce71acf3e 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(); + 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); } /// 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); + } } } diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index bc9c983352..fb3f6acbdf 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,38 @@ 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 }, } } }; } + Player player; + + private void start() + { + 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, + PreferredPlayMode = playMode.Value + }; + + player.Preload(Game, delegate + { + if (!Push(player)) + { + player = null; + //error occured? + } + }); + } + [BackgroundDependencyLoader(permitNulls: true)] private void load(BeatmapDatabase beatmaps, AudioManager audio, BaseGame game, OsuGame osuGame) { @@ -199,6 +222,8 @@ namespace osu.Game.Screens.Select protected override void OnResuming(GameMode last) { + player = null; + changeBackground(Beatmap); ensurePlayingSelected(); base.OnResuming(last); @@ -316,10 +341,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 }; @@ -348,5 +378,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); + } } }