mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Merge https://github.com/ppy/osu into leaderboards
This commit is contained in:
@ -22,9 +22,11 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public BeatmapDeleteDialog(WorkingBeatmap beatmap)
|
||||
{
|
||||
if (beatmap == null) throw new ArgumentNullException(nameof(beatmap));
|
||||
|
||||
Icon = FontAwesome.fa_trash_o;
|
||||
HeaderText = @"Confirm deletion of";
|
||||
BodyText = $@"{beatmap?.Beatmap?.Metadata?.Artist} - {beatmap?.Beatmap?.Metadata?.Title}";
|
||||
BodyText = $@"{beatmap.Beatmap?.Metadata?.Artist} - {beatmap.Beatmap?.Metadata?.Title}";
|
||||
Buttons = new PopupDialogButton[]
|
||||
{
|
||||
new PopupDialogOkButton
|
||||
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using osu.Framework.Allocation;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
@ -23,7 +24,7 @@ using osu.Game.Modes;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
{
|
||||
class BeatmapInfoWedge : Container
|
||||
internal class BeatmapInfoWedge : Container
|
||||
{
|
||||
private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0);
|
||||
|
||||
@ -54,7 +55,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public void UpdateBeatmap(WorkingBeatmap beatmap)
|
||||
{
|
||||
if (beatmap == null)
|
||||
if (beatmap?.BeatmapInfo == null)
|
||||
return;
|
||||
|
||||
var lastContainer = beatmapInfoContainer;
|
||||
@ -208,12 +209,14 @@ namespace osu.Game.Screens.Select
|
||||
new TextAwesome
|
||||
{
|
||||
Icon = FontAwesome.fa_square,
|
||||
Origin = Anchor.Centre,
|
||||
Colour = new Color4(68, 17, 136, 255),
|
||||
Rotation = 45
|
||||
},
|
||||
new TextAwesome
|
||||
{
|
||||
Icon = statistic.Icon,
|
||||
Origin = Anchor.Centre,
|
||||
Colour = new Color4(255, 221, 85, 255),
|
||||
Scale = new Vector2(0.8f)
|
||||
},
|
||||
|
@ -9,9 +9,7 @@ using osu.Game.Database;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Lists;
|
||||
using osu.Game.Beatmaps.Drawables;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Framework.Input;
|
||||
using OpenTK.Input;
|
||||
using System.Collections;
|
||||
@ -20,7 +18,7 @@ using System.Diagnostics;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
{
|
||||
class CarouselContainer : ScrollContainer, IEnumerable<BeatmapGroup>
|
||||
internal class CarouselContainer : ScrollContainer, IEnumerable<BeatmapGroup>
|
||||
{
|
||||
private Container<Panel> scrollableContent;
|
||||
private List<BeatmapGroup> groups = new List<BeatmapGroup>();
|
||||
@ -164,13 +162,13 @@ namespace osu.Game.Screens.Select
|
||||
switch (mode)
|
||||
{
|
||||
case FilterControl.SortMode.Artist:
|
||||
sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Artist, y.BeatmapSet.Metadata.Artist));
|
||||
sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Artist, y.BeatmapSet.Metadata.Artist, StringComparison.InvariantCultureIgnoreCase));
|
||||
break;
|
||||
case FilterControl.SortMode.Title:
|
||||
sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Title, y.BeatmapSet.Metadata.Title));
|
||||
sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Title, y.BeatmapSet.Metadata.Title, StringComparison.InvariantCultureIgnoreCase));
|
||||
break;
|
||||
case FilterControl.SortMode.Author:
|
||||
sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Author, y.BeatmapSet.Metadata.Author));
|
||||
sortedGroups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Author, y.BeatmapSet.Metadata.Author, StringComparison.InvariantCultureIgnoreCase));
|
||||
break;
|
||||
case FilterControl.SortMode.Difficulty:
|
||||
sortedGroups.Sort((x, y) =>
|
||||
@ -356,7 +354,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public void SelectRandom()
|
||||
{
|
||||
List<BeatmapGroup> visibleGroups = this.groups.Where((BeatmapGroup selectGroup) => selectGroup.State != BeatmapGroupState.Hidden).ToList();
|
||||
List<BeatmapGroup> visibleGroups = groups.Where(selectGroup => selectGroup.State != BeatmapGroupState.Hidden).ToList();
|
||||
if (visibleGroups.Count < 1)
|
||||
return;
|
||||
BeatmapGroup group = visibleGroups[RNG.Next(visibleGroups.Count)];
|
||||
|
@ -8,7 +8,7 @@ using osu.Game.Screens.Edit;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
{
|
||||
class EditSongSelect : ScreenWhiteBox
|
||||
internal class EditSongSelect : ScreenWhiteBox
|
||||
{
|
||||
protected override IEnumerable<Type> PossibleChildren => new[] {
|
||||
typeof(Editor)
|
||||
|
@ -9,7 +9,6 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
@ -60,7 +59,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
searchTextBox = new SearchTextBox {
|
||||
RelativeSizeAxes = Axes.X,
|
||||
OnChange = (TextBox sender, bool newText) =>
|
||||
OnChange = (sender, newText) =>
|
||||
{
|
||||
if (newText)
|
||||
FilterChanged?.Invoke();
|
||||
|
@ -4,11 +4,11 @@
|
||||
using System;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Screens.Menu;
|
||||
|
||||
@ -95,7 +95,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
Position = new Vector2(BackButton.SIZE_EXTENDED.X + padding, 0),
|
||||
Position = new Vector2(TwoLayerButton.SIZE_EXTENDED.X + padding, 0),
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
AutoSizeAxes = Axes.X,
|
||||
Direction = FillDirection.Horizontal,
|
||||
|
@ -5,7 +5,7 @@ using osu.Game.Screens.Backgrounds;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
{
|
||||
class MatchSongSelect : ScreenWhiteBox
|
||||
internal class MatchSongSelect : ScreenWhiteBox
|
||||
{
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4");
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
|
@ -6,12 +6,11 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Screens.Select.Options
|
||||
{
|
||||
@ -125,7 +124,7 @@ namespace osu.Game.Screens.Select.Options
|
||||
};
|
||||
}
|
||||
|
||||
class ButtonFlow : FillFlowContainer<BeatmapOptionsButton>
|
||||
private class ButtonFlow : FillFlowContainer<BeatmapOptionsButton>
|
||||
{
|
||||
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer();
|
||||
protected override IEnumerable<BeatmapOptionsButton> FlowingChildren => base.FlowingChildren.Reverse();
|
||||
|
@ -60,7 +60,7 @@ namespace osu.Game.Screens.Select
|
||||
private BeatmapOptionsOverlay beatmapOptions;
|
||||
private Footer footer;
|
||||
|
||||
OsuScreen player;
|
||||
private OsuScreen player;
|
||||
|
||||
private FilterControl filter;
|
||||
public FilterControl Filter
|
||||
@ -160,10 +160,11 @@ namespace osu.Game.Screens.Select
|
||||
if (player != null || Beatmap == null)
|
||||
return;
|
||||
|
||||
Beatmap.PreferredPlayMode = playMode.Value;
|
||||
|
||||
(player = new PlayerLoader(new Player
|
||||
{
|
||||
BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap,
|
||||
PreferredPlayMode = playMode.Value
|
||||
Beatmap = Beatmap, //eagerly set this so it's present before push.
|
||||
})).LoadAsync(Game, l => Push(player));
|
||||
}
|
||||
},
|
||||
@ -337,9 +338,11 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
base.OnBeatmapChanged(beatmap);
|
||||
|
||||
beatmap.Mods.BindTo(modSelect.SelectedMods);
|
||||
|
||||
//todo: change background in selectionChanged instead; support per-difficulty backgrounds.
|
||||
changeBackground(beatmap);
|
||||
carousel.SelectBeatmap(beatmap?.BeatmapInfo);
|
||||
carousel.SelectBeatmap(beatmap.BeatmapInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -441,8 +444,19 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
if (args.Repeat) return false;
|
||||
|
||||
switch (args.Key)
|
||||
{
|
||||
case Key.F1:
|
||||
modSelect.ToggleVisibility();
|
||||
return true;
|
||||
case Key.F2:
|
||||
carousel.SelectRandom();
|
||||
return true;
|
||||
case Key.F3:
|
||||
beatmapOptions.ToggleVisibility();
|
||||
return true;
|
||||
case Key.Enter:
|
||||
footer.StartButton.TriggerClick();
|
||||
return true;
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
|
Reference in New Issue
Block a user