mirror of
https://github.com/ppy/osu.git
synced 2026-05-23 02:39:52 +08:00
Code quality fixes
This commit is contained in:
committed by
Salman Alshamrani
Unverified
parent
da163c1751
commit
bb8d3bcf66
@@ -356,13 +356,11 @@ namespace osu.Game.Graphics.Carousel
|
||||
{
|
||||
switch (e.Key)
|
||||
{
|
||||
// this is a special hard-coded case to allow activating item with modifier keys pressed
|
||||
// (e.g. press Ctrl+Enter to start beatmap with autoplay mod selected).
|
||||
// We can't rely on GlobalAction.Select as it only responds to pressing the key without any modifiers.
|
||||
// this is a special hard-coded case; we can't rely on OnPressed as GlobalActionContainer is
|
||||
// matching with exact modifier consideration (so Ctrl+Enter would be ignored).
|
||||
case Key.Enter:
|
||||
case Key.KeypadEnter:
|
||||
if (currentKeyboardSelection.CarouselItem != null)
|
||||
Activate(currentKeyboardSelection.CarouselItem);
|
||||
activateSelection();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -374,8 +372,7 @@ namespace osu.Game.Graphics.Carousel
|
||||
switch (e.Action)
|
||||
{
|
||||
case GlobalAction.Select:
|
||||
if (currentKeyboardSelection.CarouselItem != null)
|
||||
Activate(currentKeyboardSelection.CarouselItem);
|
||||
activateSelection();
|
||||
return true;
|
||||
|
||||
case GlobalAction.SelectNext:
|
||||
@@ -402,6 +399,12 @@ namespace osu.Game.Graphics.Carousel
|
||||
{
|
||||
}
|
||||
|
||||
private void activateSelection()
|
||||
{
|
||||
if (currentKeyboardSelection.CarouselItem != null)
|
||||
Activate(currentKeyboardSelection.CarouselItem);
|
||||
}
|
||||
|
||||
private void traverseKeyboardSelection(int direction)
|
||||
{
|
||||
if (carouselItems == null || carouselItems.Count == 0) return;
|
||||
|
||||
@@ -6,12 +6,10 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Localisation;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Utils;
|
||||
|
||||
@@ -19,20 +17,6 @@ namespace osu.Game.Screens.SelectV2
|
||||
{
|
||||
public partial class SoloSongSelect : SongSelect
|
||||
{
|
||||
[Resolved]
|
||||
private BeatmapManager beatmaps { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Opens beatmap editor with the given beatmap.
|
||||
/// </summary>
|
||||
public void Edit(BeatmapInfo beatmap)
|
||||
{
|
||||
// Forced refetch is important here to guarantee correct invalidation across all difficulties.
|
||||
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmap, true);
|
||||
|
||||
this.Push(new EditorLoader());
|
||||
}
|
||||
|
||||
private PlayerLoader? playerLoader;
|
||||
private IReadOnlyList<Mod>? modsAtGameplayStart;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user