mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Merge branch 'master' into tournament-tools
# Conflicts: # osu.Game/Online/API/Requests/Responses/APIBeatmap.cs # osu.Game/OsuGameBase.cs # osu.Game/Overlays/ChatOverlay.cs # osu.Game/Screens/Menu/MainMenu.cs # osu.Game/Screens/Tournament/Drawings.cs # osu.Game/Screens/Tournament/Teams/DrawingsTeam.cs # osu.Game/osu.Game.csproj # osu.sln
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
@ -22,28 +22,25 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
private readonly ButtonSystem buttons;
|
||||
|
||||
protected override bool HideOverlaysOnEnter => buttons.State == ButtonSystemState.Initial;
|
||||
public override bool HideOverlaysOnEnter => buttons.State == ButtonSystemState.Initial;
|
||||
|
||||
protected override bool AllowBackButton => buttons.State != ButtonSystemState.Initial;
|
||||
|
||||
public override bool AllowExternalScreenChange => true;
|
||||
|
||||
private readonly BackgroundScreenDefault background;
|
||||
private Screen songSelect;
|
||||
|
||||
private readonly MenuSideFlashes sideFlashes;
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => background;
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault();
|
||||
|
||||
public MainMenu()
|
||||
{
|
||||
background = new BackgroundScreenDefault();
|
||||
|
||||
Children = new Drawable[]
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
new ExitConfirmOverlay
|
||||
{
|
||||
Action = Exit,
|
||||
Action = this.Exit,
|
||||
},
|
||||
new ParallaxContainer
|
||||
{
|
||||
@ -52,12 +49,12 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
buttons = new ButtonSystem
|
||||
{
|
||||
OnChart = delegate { Push(new ChartListing()); },
|
||||
OnDirect = delegate { Push(new OnlineListing()); },
|
||||
OnEdit = delegate { Push(new Editor()); },
|
||||
OnChart = delegate { this.Push(new ChartListing()); },
|
||||
OnDirect = delegate {this.Push(new OnlineListing()); },
|
||||
OnEdit = delegate {this.Push(new Editor()); },
|
||||
OnSolo = onSolo,
|
||||
OnMulti = delegate { Push(new Multiplayer()); },
|
||||
OnExit = Exit,
|
||||
OnMulti = delegate {this.Push(new Multiplayer()); },
|
||||
OnExit = this.Exit,
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -70,10 +67,10 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
case ButtonSystemState.Initial:
|
||||
case ButtonSystemState.Exit:
|
||||
background.FadeColour(Color4.White, 500, Easing.OutSine);
|
||||
Background.FadeColour(Color4.White, 500, Easing.OutSine);
|
||||
break;
|
||||
default:
|
||||
background.FadeColour(OsuColour.Gray(0.8f), 500, Easing.OutSine);
|
||||
Background.FadeColour(OsuColour.Gray(0.8f), 500, Easing.OutSine);
|
||||
break;
|
||||
}
|
||||
};
|
||||
@ -82,8 +79,6 @@ namespace osu.Game.Screens.Menu
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuGame game = null)
|
||||
{
|
||||
LoadComponentAsync(background);
|
||||
|
||||
if (game != null)
|
||||
{
|
||||
buttons.OnSettings = game.ToggleSettings;
|
||||
@ -101,7 +96,7 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
public void LoadToSolo() => Schedule(onSolo);
|
||||
|
||||
private void onSolo() => Push(consumeSongSelect());
|
||||
private void onSolo() =>this.Push(consumeSongSelect());
|
||||
|
||||
private Screen consumeSongSelect()
|
||||
{
|
||||
@ -110,7 +105,7 @@ namespace osu.Game.Screens.Menu
|
||||
return s;
|
||||
}
|
||||
|
||||
protected override void OnEntering(Screen last)
|
||||
public override void OnEntering(IScreen last)
|
||||
{
|
||||
base.OnEntering(last);
|
||||
buttons.FadeInFromZero(500);
|
||||
@ -145,8 +140,8 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
const float length = 300;
|
||||
|
||||
Content.FadeIn(length, Easing.OutQuint);
|
||||
Content.MoveTo(new Vector2(0, 0), length, Easing.OutQuint);
|
||||
this.FadeIn(length, Easing.OutQuint);
|
||||
this.MoveTo(new Vector2(0, 0), length, Easing.OutQuint);
|
||||
|
||||
sideFlashes.Delay(length).FadeIn(64, Easing.InQuint);
|
||||
}
|
||||
@ -161,13 +156,13 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
private void beatmap_ValueChanged(WorkingBeatmap newValue)
|
||||
{
|
||||
if (!IsCurrentScreen)
|
||||
if (!this.IsCurrentScreen())
|
||||
return;
|
||||
|
||||
background.Next();
|
||||
((BackgroundScreenDefault)Background).Next();
|
||||
}
|
||||
|
||||
protected override void OnSuspending(Screen next)
|
||||
public override void OnSuspending(IScreen next)
|
||||
{
|
||||
base.OnSuspending(next);
|
||||
|
||||
@ -175,26 +170,26 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
buttons.State = ButtonSystemState.EnteringMode;
|
||||
|
||||
Content.FadeOut(length, Easing.InSine);
|
||||
Content.MoveTo(new Vector2(-800, 0), length, Easing.InSine);
|
||||
this.FadeOut(length, Easing.InSine);
|
||||
this.MoveTo(new Vector2(-800, 0), length, Easing.InSine);
|
||||
|
||||
sideFlashes.FadeOut(64, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void OnResuming(Screen last)
|
||||
public override void OnResuming(IScreen last)
|
||||
{
|
||||
base.OnResuming(last);
|
||||
|
||||
background.Next();
|
||||
((BackgroundScreenDefault)Background).Next();
|
||||
|
||||
//we may have consumed our preloaded instance, so let's make another.
|
||||
preloadSongSelect();
|
||||
}
|
||||
|
||||
protected override bool OnExiting(Screen next)
|
||||
public override bool OnExiting(IScreen next)
|
||||
{
|
||||
buttons.State = ButtonSystemState.Exit;
|
||||
Content.FadeOut(3000);
|
||||
this.FadeOut(3000);
|
||||
return base.OnExiting(next);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user