2019-10-08 10:34:09 +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;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-12-06 08:09:48 +00:00
|
|
|
using osu.Game.Configuration;
|
2019-10-08 10:34:09 +00:00
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
using osu.Game.Rulesets.Mods;
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Mods
|
|
|
|
{
|
|
|
|
public class ModControlSection : Container
|
|
|
|
{
|
|
|
|
protected FillFlowContainer FlowContent;
|
|
|
|
protected override Container<Drawable> Content => FlowContent;
|
|
|
|
|
|
|
|
public readonly Mod Mod;
|
|
|
|
|
|
|
|
public ModControlSection(Mod mod)
|
|
|
|
{
|
|
|
|
Mod = mod;
|
|
|
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
|
|
|
FlowContent = new FillFlowContainer
|
|
|
|
{
|
|
|
|
Margin = new MarginPadding { Top = 30 },
|
|
|
|
Spacing = new Vector2(0, 5),
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
};
|
|
|
|
|
2019-12-06 08:09:48 +00:00
|
|
|
AddRange(Mod.CreateSettingsControls());
|
2019-10-08 10:34:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
{
|
|
|
|
AddRangeInternal(new Drawable[]
|
|
|
|
{
|
|
|
|
new OsuSpriteText
|
|
|
|
{
|
|
|
|
Text = Mod.Name,
|
|
|
|
Font = OsuFont.GetFont(weight: FontWeight.Bold),
|
|
|
|
Colour = colours.Yellow,
|
|
|
|
},
|
|
|
|
FlowContent
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2019-12-06 08:09:48 +00:00
|
|
|
}
|