1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 23:27:25 +08:00

Move ModOverlay to SongSelect

This commit is contained in:
smoogipoo 2018-12-06 19:29:18 +09:00
parent 6ffd2190bc
commit 10b526504a
2 changed files with 23 additions and 21 deletions

View File

@ -9,12 +9,10 @@ using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Screens;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Overlays;
using osu.Game.Overlays.Mods;
using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Play;
using osu.Game.Screens.Ranking;
@ -25,19 +23,11 @@ namespace osu.Game.Screens.Select
public class PlaySongSelect : SongSelect
{
private OsuScreen player;
private readonly ModSelectOverlay modSelect;
protected readonly BeatmapDetailArea BeatmapDetails;
private bool removeAutoModOnResume;
public PlaySongSelect()
{
FooterPanels.Add(modSelect = new ModSelectOverlay
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.BottomCentre,
Anchor = Anchor.BottomCentre,
});
LeftContent.Add(BeatmapDetails = new BeatmapDetailArea
{
RelativeSizeAxes = Axes.Both,
@ -60,8 +50,6 @@ namespace osu.Game.Screens.Select
sampleConfirm = audio.Sample.Get(@"SongSelect/confirm-selection");
Footer.AddButton(@"mods", colours.Yellow, modSelect, Key.F1, float.MaxValue);
BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, colours.Purple, null, Key.Number1);
BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.fa_eraser, colours.Purple, null, Key.Number2);
BeatmapOptions.AddButton(@"Edit", @"beatmap", FontAwesome.fa_pencil, colours.Yellow, () =>
@ -115,7 +103,7 @@ namespace osu.Game.Screens.Select
if (removeAutoModOnResume)
{
var autoType = Ruleset.Value.CreateInstance().GetAutoplayMod().GetType();
modSelect.DeselectTypes(new[] { autoType }, true);
ModSelect.DeselectTypes(new[] { autoType }, true);
removeAutoModOnResume = false;
}
@ -126,13 +114,6 @@ namespace osu.Game.Screens.Select
base.OnResuming(last);
}
protected override void OnSuspending(Screen next)
{
modSelect.Hide();
base.OnSuspending(next);
}
protected override bool OnExiting(Screen next)
{
if (base.OnExiting(next))

View File

@ -21,6 +21,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Input.Bindings;
using osu.Game.Overlays;
using osu.Game.Overlays.Mods;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Backgrounds;
@ -67,6 +68,8 @@ namespace osu.Game.Screens.Select
private DialogOverlay dialogOverlay;
private BeatmapManager beatmaps;
protected readonly ModSelectOverlay ModSelect;
private SampleChannel sampleChangeDifficulty;
private SampleChannel sampleChangeBeatmap;
@ -194,7 +197,16 @@ namespace osu.Game.Screens.Select
OnBack = ExitFromBack,
});
FooterPanels.Add(BeatmapOptions = new BeatmapOptionsOverlay());
FooterPanels.AddRange(new Drawable[]
{
BeatmapOptions = new BeatmapOptionsOverlay(),
ModSelect = new ModSelectOverlay
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.BottomCentre,
Anchor = Anchor.BottomCentre,
}
});
}
}
@ -205,6 +217,7 @@ namespace osu.Game.Screens.Select
{
if (Footer != null)
{
Footer.AddButton(@"mods", colours.Yellow, ModSelect, Key.F1);
Footer.AddButton(@"random", colours.Green, triggerRandom, Key.F2);
Footer.AddButton(@"options", colours.Blue, BeatmapOptions, Key.F3);
@ -438,6 +451,8 @@ namespace osu.Game.Screens.Select
protected override void OnSuspending(Screen next)
{
ModSelect.Hide();
Content.ScaleTo(1.1f, 250, Easing.InSine);
Content.FadeOut(250);
@ -448,6 +463,12 @@ namespace osu.Game.Screens.Select
protected override bool OnExiting(Screen next)
{
if (ModSelect.State == Visibility.Visible)
{
ModSelect.Hide();
return true;
}
FinaliseSelection(performStartAction: false);
beatmapInfoWedge.State = Visibility.Hidden;