1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 00:02:54 +08:00
osu-lazer/osu.Game/Overlays/Settings/SettingsFooter.cs

69 lines
2.3 KiB
C#
Raw Normal View History

2017-03-06 16:20:19 +08:00
// 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.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2017-04-17 16:43:48 +08:00
using osu.Game.Database;
2017-03-06 16:20:19 +08:00
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Game.Overlays.Settings
2017-03-06 16:20:19 +08:00
{
public class SettingsFooter : FillFlowContainer
2017-03-06 16:20:19 +08:00
{
[BackgroundDependencyLoader]
2017-04-17 16:43:48 +08:00
private void load(OsuGameBase game, OsuColour colours, RulesetDatabase rulesets)
2017-03-06 16:20:19 +08:00
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FillDirection.Vertical;
Padding = new MarginPadding { Top = 20, Bottom = 30 };
var modes = new List<Drawable>();
2017-04-17 16:43:48 +08:00
foreach (var ruleset in rulesets.AllRulesets)
2017-04-15 04:22:41 +08:00
{
2017-03-06 16:20:19 +08:00
modes.Add(new TextAwesome
{
2017-04-17 16:43:48 +08:00
Icon = ruleset.CreateInstance().Icon,
2017-03-06 16:20:19 +08:00
Colour = Color4.Gray,
TextSize = 20
2017-03-06 16:20:19 +08:00
});
2017-04-15 04:22:41 +08:00
}
2017-03-06 16:20:19 +08:00
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,
},
};
}
}
}