2017-03-06 08:20:19 +00: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;
|
|
|
|
|
using osu.Game.Graphics;
|
2017-08-03 05:36:21 +00:00
|
|
|
|
using osu.Game.Graphics.Containers;
|
2017-03-06 08:20:19 +00:00
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2017-07-26 04:22:46 +00:00
|
|
|
|
using osu.Game.Rulesets;
|
2017-03-06 08:20:19 +00:00
|
|
|
|
using OpenTK;
|
|
|
|
|
using OpenTK.Graphics;
|
|
|
|
|
|
2017-05-15 01:55:29 +00:00
|
|
|
|
namespace osu.Game.Overlays.Settings
|
2017-03-06 08:20:19 +00:00
|
|
|
|
{
|
2017-05-15 01:55:29 +00:00
|
|
|
|
public class SettingsFooter : FillFlowContainer
|
2017-03-06 08:20:19 +00:00
|
|
|
|
{
|
|
|
|
|
[BackgroundDependencyLoader]
|
2017-07-27 07:56:41 +00:00
|
|
|
|
private void load(OsuGameBase game, OsuColour colours, RulesetStore rulesets)
|
2017-03-06 08:20:19 +00: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 08:43:48 +00:00
|
|
|
|
foreach (var ruleset in rulesets.AllRulesets)
|
2017-04-14 20:22:41 +00:00
|
|
|
|
{
|
2017-08-03 05:36:21 +00:00
|
|
|
|
var icon = new ConstrainedIconContainer
|
2017-03-06 08:20:19 +00:00
|
|
|
|
{
|
2017-08-03 05:36:21 +00:00
|
|
|
|
Icon = ruleset.CreateInstance().CreateIcon(),
|
2017-03-06 08:20:19 +00:00
|
|
|
|
Colour = Color4.Gray,
|
2017-08-03 05:36:21 +00:00
|
|
|
|
Size = new Vector2(20),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
modes.Add(icon);
|
2017-04-14 20:22:41 +00:00
|
|
|
|
}
|
2017-03-06 08:20:19 +00: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,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|