1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Add options footer.

This commit is contained in:
Dean Herbert 2017-03-06 17:20:19 +09:00
parent 0ee38571a6
commit b5aff9df5f
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
4 changed files with 71 additions and 15 deletions

View File

@ -0,0 +1,68 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Modes;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Game.Overlays.Options
{
public class OptionsFooter : FillFlowContainer
{
[BackgroundDependencyLoader]
private void load(OsuGameBase game, OsuColour colours)
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FillDirection.Vertical;
Padding = new MarginPadding { Top = 20, Bottom = 30 };
var modes = new List<Drawable>();
foreach (PlayMode m in Enum.GetValues(typeof(PlayMode)))
modes.Add(new TextAwesome
{
Icon = Ruleset.GetRuleset(m).Icon,
Colour = Color4.Gray,
});
Children = new Drawable[]
{
new FillFlowContainer
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Direction = FillDirection.Full,
AutoSizeAxes = Axes.Both,
Children = modes,
Spacing = new Vector2(5),
Padding = new MarginPadding { Bottom = 10 },
},
new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Text = game.Name,
TextSize = 18,
Font = @"Exo2.0-Bold",
},
new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
TextSize = 14,
Text = game.Version,
Colour = game.IsDebug ? colours.Red : Color4.White,
},
};
}
}
}

View File

@ -39,20 +39,6 @@ namespace osu.Game.Overlays.Options.Sections
RelativeSizeAxes = Axes.X,
Text = "Run osu! updater",
},
new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Children = new[]
{
new OptionLabel
{
Text = "osu!lazer",
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
}
}
};
}
}

View File

@ -100,7 +100,8 @@ namespace osu.Game.Overlays
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical,
Children = sections,
}
},
new OptionsFooter()
}
}
}

View File

@ -120,6 +120,7 @@
<Compile Include="Graphics\UserInterface\OsuDropDownHeader.cs" />
<Compile Include="Graphics\UserInterface\OsuDropDownMenu.cs" />
<Compile Include="Graphics\UserInterface\OsuDropDownMenuItem.cs" />
<Compile Include="Overlays\Options\OptionsFooter.cs" />
<Compile Include="Overlays\Options\Sections\DebugSection.cs" />
<Compile Include="Overlays\Options\Sections\Debug\GCOptions.cs" />
<Compile Include="Overlays\Toolbar\ToolbarHomeButton.cs" />