mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 09:22:54 +08:00
Make disclaimer actually be a thing.
This commit is contained in:
parent
76cab600d9
commit
bf33cc6f53
@ -14,6 +14,7 @@ using osu.Game.Database;
|
|||||||
using osu.Desktop.Overlays;
|
using osu.Desktop.Overlays;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using osu.Game.Screens.Menu;
|
||||||
|
|
||||||
namespace osu.Desktop
|
namespace osu.Desktop
|
||||||
{
|
{
|
||||||
@ -26,14 +27,19 @@ namespace osu.Desktop
|
|||||||
public OsuGameDesktop(string[] args = null)
|
public OsuGameDesktop(string[] args = null)
|
||||||
: base(args)
|
: base(args)
|
||||||
{
|
{
|
||||||
versionManager = new VersionManager();
|
versionManager = new VersionManager { Depth = int.MinValue };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
versionManager.Preload(this, Add);
|
versionManager.Preload(this);
|
||||||
|
ModeChanged += m =>
|
||||||
|
{
|
||||||
|
if (!versionManager.IsAlive && m is Intro)
|
||||||
|
Add(versionManager);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetHost(BasicGameHost host)
|
public override void SetHost(BasicGameHost host)
|
||||||
|
@ -216,7 +216,7 @@ namespace osu.Game
|
|||||||
return base.OnKeyDown(state, args);
|
return base.OnKeyDown(state, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Action<Screen> ModeChanged;
|
public event Action<Screen> ModeChanged;
|
||||||
|
|
||||||
private Container mainContent;
|
private Container mainContent;
|
||||||
|
|
||||||
@ -247,6 +247,10 @@ namespace osu.Game
|
|||||||
|
|
||||||
protected override bool OnExiting()
|
protected override bool OnExiting()
|
||||||
{
|
{
|
||||||
|
if (screenStack.ChildScreen == null) return false;
|
||||||
|
|
||||||
|
if (intro == null) return true;
|
||||||
|
|
||||||
if (!intro.DidLoadMenu || intro.ChildScreen != null)
|
if (!intro.DidLoadMenu || intro.ChildScreen != null)
|
||||||
{
|
{
|
||||||
Scheduler.Add(intro.MakeCurrent);
|
Scheduler.Add(intro.MakeCurrent);
|
||||||
|
@ -7,32 +7,113 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Menu
|
namespace osu.Game.Screens.Menu
|
||||||
{
|
{
|
||||||
class Disclaimer : OsuScreen
|
class Disclaimer : OsuScreen
|
||||||
{
|
{
|
||||||
private Intro intro;
|
private Intro intro;
|
||||||
|
private TextAwesome icon;
|
||||||
|
private Color4 iconColour;
|
||||||
|
|
||||||
internal override bool ShowOverlays => false;
|
internal override bool ShowOverlays => false;
|
||||||
|
|
||||||
|
public Disclaimer()
|
||||||
|
{
|
||||||
|
ValidForResume = false;
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new FlowContainer
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Direction = FlowDirections.Vertical,
|
||||||
|
Spacing = new Vector2(0, 2),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
icon = new TextAwesome
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Icon = FontAwesome.fa_warning,
|
||||||
|
TextSize = 30,
|
||||||
|
},
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
TextSize = 30,
|
||||||
|
Text = "This is a development build",
|
||||||
|
Margin = new MarginPadding
|
||||||
|
{
|
||||||
|
Bottom = 20
|
||||||
|
},
|
||||||
|
},
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Text = "Don't expect shit to work perfectly as this is very much a work in progress."
|
||||||
|
},
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Text = "Don't report bugs because we are aware. Don't complain about missing features because we are adding them."
|
||||||
|
},
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Text = "Sit back and enjoy. Visit discord.gg/ppy if you want to help out!",
|
||||||
|
Margin = new MarginPadding { Bottom = 20 },
|
||||||
|
},
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
TextSize = 12,
|
||||||
|
Text = "oh and yes, you will get seizures.",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuGame game)
|
private void load(OsuGame game, OsuColour colours)
|
||||||
{
|
{
|
||||||
(intro = new Intro()).Preload(game);
|
(intro = new Intro()).Preload(game);
|
||||||
|
|
||||||
|
iconColour = colours.Yellow;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnEntering(Screen last)
|
protected override void OnEntering(Screen last)
|
||||||
{
|
{
|
||||||
base.OnEntering(last);
|
base.OnEntering(last);
|
||||||
|
|
||||||
FadeInFromZero(100);
|
Content.FadeInFromZero(500);
|
||||||
|
|
||||||
Delay(5000);
|
icon.Delay(1500);
|
||||||
|
icon.FadeColour(iconColour, 200);
|
||||||
|
|
||||||
FadeOut(100);
|
Delay(6000, true);
|
||||||
|
|
||||||
Push(intro);
|
Content.FadeOut(250);
|
||||||
|
|
||||||
|
Delay(250);
|
||||||
|
|
||||||
|
Schedule(() => Push(intro));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ using OpenTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Menu
|
namespace osu.Game.Screens.Menu
|
||||||
{
|
{
|
||||||
class Intro : OsuScreen
|
public class Intro : OsuScreen
|
||||||
{
|
{
|
||||||
private OsuLogo logo;
|
private OsuLogo logo;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user