1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 10:57:27 +08:00
osu-lazer/osu.Game/Overlays/Changelog/ChangelogSupporterPromo.cs

132 lines
5.5 KiB
C#
Raw Normal View History

// 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.
2021-08-10 14:21:23 +08:00
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2021-08-10 13:11:21 +08:00
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
2021-08-10 14:21:23 +08:00
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
2021-08-10 13:11:21 +08:00
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays.Changelog
{
public class ChangelogSupporterPromo : CompositeDrawable
{
2021-08-10 14:53:06 +08:00
private const float image_width = 164;
2021-08-10 14:21:23 +08:00
private readonly LinkFlowContainer supportLinkText;
private readonly TextFlowContainer supportNoteText;
public ChangelogSupporterPromo()
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Padding = new MarginPadding
{
Vertical = 20,
Horizontal = 50,
};
2021-08-10 14:21:23 +08:00
InternalChildren = new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
2021-08-10 13:11:21 +08:00
Masking = true,
CornerRadius = 6,
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.25f),
Offset = new Vector2(0, 1),
Radius = 3,
},
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black.Opacity(0.3f),
},
2021-08-10 14:53:06 +08:00
new Container
{
RelativeSizeAxes = Axes.X,
Height = 200,
2021-08-10 14:21:23 +08:00
Padding = new MarginPadding { Horizontal = 75 },
Children = new Drawable[]
{
new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
2021-08-10 14:53:06 +08:00
Padding = new MarginPadding { Right = 50 + image_width },
2021-08-10 14:21:23 +08:00
Children = new Drawable[]
{
new OsuSpriteText
{
Text = ChangelogStrings.SupportHeading,
Font = OsuFont.GetFont(size: 22, weight: FontWeight.Light),
Margin = new MarginPadding { Bottom = 20 },
},
supportLinkText = new LinkFlowContainer(t =>
{
t.Font = t.Font.With(size: 17.5f);
})
{
2021-08-10 14:53:06 +08:00
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
2021-08-10 14:21:23 +08:00
},
supportNoteText = new TextFlowContainer(t =>
{
t.Font = t.Font.With(size: 15);
})
{
Margin = new MarginPadding { Top = 10 },
2021-08-10 14:53:06 +08:00
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
2021-08-10 14:21:23 +08:00
}
},
},
2021-08-10 14:53:06 +08:00
new Container
{
RelativeSizeAxes = Axes.Y,
Width = image_width,
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
}
2021-08-10 14:21:23 +08:00
}
},
}
},
};
}
2021-08-10 14:21:23 +08:00
[BackgroundDependencyLoader]
private void load(OsuColour colour)
{
void fontPinkColour(SpriteText t) => t.Colour = colour.PinkLighter;
supportLinkText.AddText("Support further development of osu! and ", fontPinkColour);
supportLinkText.AddLink("become an osu!supporter", "https://osu.ppy.sh/home/support", t =>
{
t.Colour = colour.PinkDark;
t.Font = t.Font.With(weight: FontWeight.Bold);
});
supportLinkText.AddText(" today!", fontPinkColour);
2021-08-10 14:53:06 +08:00
supportNoteText.AddText("Not only will you help speed development, but you will also get some extra features and customisations!", fontPinkColour);
2021-08-10 14:21:23 +08:00
}
}
}