This commit is contained in:
DrabWeb
2017-02-22 12:35:55 -04:00
117 changed files with 1756 additions and 583 deletions

View File

@ -8,12 +8,12 @@ using osu.Game.Screens.Edit;
namespace osu.Game.Screens.Select
{
class EditSongSelect : GameModeWhiteBox
class EditSongSelect : ScreenWhiteBox
{
protected override IEnumerable<Type> PossibleChildren => new[] {
typeof(Editor)
};
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4");
}
}

View File

@ -47,18 +47,19 @@ namespace osu.Game.Screens.Select
Direction = FlowDirections.Vertical,
Children = new Drawable[]
{
searchTextBox = new SearchTextBox { RelativeSizeAxes = Axes.X },
searchTextBox = new SearchTextBox {
RelativeSizeAxes = Axes.X,
OnChange = (TextBox sender, bool newText) =>
{
if (newText)
FilterChanged?.Invoke();
},
Exit = () => Exit?.Invoke(),
},
new GroupSortTabs()
}
}
};
searchTextBox.OnChange += (TextBox sender, bool newText) =>
{
if (newText)
FilterChanged?.Invoke();
};
searchTextBox.Exit = () => Exit?.Invoke();
}
public void Deactivate()

View File

@ -25,6 +25,8 @@ namespace osu.Game.Screens.Select
private const float padding = 80;
public override bool Contains(Vector2 screenSpacePos) => true;
public Action OnBack;
public Action OnStart;

View File

@ -5,8 +5,8 @@ using osu.Game.Screens.Backgrounds;
namespace osu.Game.Screens.Select
{
class MatchSongSelect : GameModeWhiteBox
class MatchSongSelect : ScreenWhiteBox
{
protected override BackgroundMode CreateBackground() => new BackgroundModeCustom(@"Backgrounds/bg4");
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4");
}
}

View File

@ -9,7 +9,7 @@ using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Configuration;
using osu.Framework.GameModes;
using osu.Framework.Screens;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Game.Beatmaps;
@ -33,11 +33,11 @@ using osu.Game.Overlays.Mods;
namespace osu.Game.Screens.Select
{
public class PlaySongSelect : OsuGameMode
public class PlaySongSelect : OsuScreen
{
private Bindable<PlayMode> playMode;
private BeatmapDatabase database;
protected override BackgroundMode CreateBackground() => new BackgroundModeBeatmap(Beatmap);
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
private CarouselContainer carousel;
private TrackManager trackManager;
@ -50,8 +50,8 @@ namespace osu.Game.Screens.Select
private static readonly Vector2 background_blur = new Vector2(20);
private CancellationTokenSource initialAddSetsTask;
private AudioSample sampleChangeDifficulty;
private AudioSample sampleChangeBeatmap;
private SampleChannel sampleChangeDifficulty;
private SampleChannel sampleChangeBeatmap;
private List<BeatmapGroup> beatmapGroups;
@ -221,7 +221,7 @@ namespace osu.Game.Screens.Select
Schedule(() => addBeatmapSet(s, Game, true));
}
protected override void OnEntering(GameMode last)
protected override void OnEntering(Screen last)
{
base.OnEntering(last);
ensurePlayingSelected();
@ -236,7 +236,7 @@ namespace osu.Game.Screens.Select
filter.Activate();
}
protected override void OnResuming(GameMode last)
protected override void OnResuming(Screen last)
{
player = null;
@ -251,7 +251,7 @@ namespace osu.Game.Screens.Select
filter.Activate();
}
protected override void OnSuspending(GameMode next)
protected override void OnSuspending(Screen next)
{
Content.ScaleTo(1.1f, 250, EasingTypes.InSine);
@ -261,7 +261,7 @@ namespace osu.Game.Screens.Select
base.OnSuspending(next);
}
protected override bool OnExiting(GameMode next)
protected override bool OnExiting(Screen next)
{
beatmapInfoWedge.MoveToX(-100, 800, EasingTypes.InQuint);
beatmapInfoWedge.RotateTo(10, 800, EasingTypes.InQuint);
@ -290,7 +290,7 @@ namespace osu.Game.Screens.Select
private void changeBackground(WorkingBeatmap beatmap)
{
var backgroundModeBeatmap = Background as BackgroundModeBeatmap;
var backgroundModeBeatmap = Background as BackgroundScreenBeatmap;
if (backgroundModeBeatmap != null)
{
backgroundModeBeatmap.Beatmap = beatmap;
@ -336,7 +336,7 @@ namespace osu.Game.Screens.Select
private void ensurePlayingSelected(bool preview = false)
{
AudioTrack track = Beatmap?.Track;
Track track = Beatmap?.Track;
if (track != null)
{
@ -356,11 +356,13 @@ namespace osu.Game.Screens.Select
if (b.Metadata == null) b.Metadata = beatmapSet.Metadata;
});
foreach (var b in beatmapSet.Beatmaps)
b.ComputeDifficulty(database);
beatmapSet.Beatmaps = beatmapSet.Beatmaps.OrderBy(b => b.StarDifficulty).ToList();
var beatmap = new WorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault(), beatmapSet, database);
var group = new BeatmapGroup(beatmap, beatmapSet)
var group = new BeatmapGroup(beatmap)
{
SelectionChanged = selectionChanged,
StartRequested = b => start()

View File

@ -16,26 +16,8 @@ namespace osu.Game.Screens.Select
/// <summary>
/// A textbox which holds focus eagerly.
/// </summary>
public class SearchTextBox : OsuTextBox
public class SearchTextBox : FocusedTextBox
{
protected override Color4 BackgroundUnfocused => new Color4(10, 10, 10, 255);
protected override Color4 BackgroundFocused => new Color4(10, 10, 10, 255);
public Action Exit;
private bool focus;
public bool HoldFocus
{
get { return focus; }
set
{
focus = value;
if (!focus)
TriggerFocusLost();
}
}
public override bool RequestingFocus => HoldFocus;
public SearchTextBox()
{
Height = 35;
@ -53,25 +35,6 @@ namespace osu.Game.Screens.Select
PlaceholderText = "type to search";
}
protected override bool OnFocus(InputState state)
{
var result = base.OnFocus(state);
BorderThickness = 0;
return result;
}
protected override void OnFocusLost(InputState state)
{
if (state.Keyboard.Keys.Any(key => key == Key.Escape))
{
if (Text.Length > 0)
Text = string.Empty;
else
Exit?.Invoke();
}
base.OnFocusLost(state);
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (HandlePendingText(state)) return true;