2019-05-26 16:36:07 +00:00
|
|
|
// 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 osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
2019-12-08 18:51:25 +00:00
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-05-26 16:36:07 +00:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2019-12-08 18:51:25 +00:00
|
|
|
using osu.Game.Graphics.UserInterface;
|
2019-05-26 16:36:07 +00:00
|
|
|
using osu.Game.Overlays.Settings;
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays
|
|
|
|
{
|
|
|
|
public abstract class SettingsSubPanel : SettingsPanel
|
|
|
|
{
|
|
|
|
protected SettingsSubPanel()
|
|
|
|
: base(true)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
|
|
|
AddInternal(new BackButton
|
|
|
|
{
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
Action = Hide
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-06-27 04:16:16 +00:00
|
|
|
protected override bool DimMainContent => false; // dimming is handled by main overlay
|
|
|
|
|
2019-12-08 18:51:25 +00:00
|
|
|
private class BackButton : OsuButton
|
2019-05-26 16:36:07 +00:00
|
|
|
{
|
2021-10-09 18:29:44 +00:00
|
|
|
[Resolved]
|
|
|
|
private OverlayColourProvider colourProvider { get; set; }
|
|
|
|
|
2019-05-26 16:36:07 +00:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
|
|
|
Size = new Vector2(Sidebar.DEFAULT_WIDTH);
|
2019-12-08 18:51:25 +00:00
|
|
|
|
2021-10-09 18:29:44 +00:00
|
|
|
BackgroundColour = colourProvider.Background5;
|
|
|
|
Hover.Colour = Colour4.Transparent;
|
2019-12-08 18:51:25 +00:00
|
|
|
|
|
|
|
AddRange(new Drawable[]
|
2019-05-26 16:36:07 +00:00
|
|
|
{
|
2019-12-08 18:51:25 +00:00
|
|
|
new Container
|
2019-05-26 16:36:07 +00:00
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
new SpriteIcon
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
Size = new Vector2(15),
|
|
|
|
Shadow = true,
|
|
|
|
Icon = FontAwesome.Solid.ChevronLeft
|
|
|
|
},
|
|
|
|
new OsuSpriteText
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
Y = 15,
|
|
|
|
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
|
|
|
|
Text = @"back",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2019-12-08 18:51:25 +00:00
|
|
|
});
|
2019-05-26 16:36:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|