2021-08-10 04:43:11 +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.
|
|
|
|
|
|
2021-08-12 13:36:47 +00:00
|
|
|
|
using System;
|
2021-08-10 06:21:23 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2021-08-10 04:43:11 +00:00
|
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-08-10 05:11:21 +00:00
|
|
|
|
using osu.Framework.Graphics.Effects;
|
2021-08-10 04:43:11 +00:00
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
2021-08-10 06:21:23 +00:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2021-08-10 07:07:20 +00:00
|
|
|
|
using osu.Framework.Graphics.Textures;
|
2021-08-10 06:21:23 +00:00
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2021-08-12 13:36:47 +00:00
|
|
|
|
using osu.Game.Online.Chat;
|
2021-08-10 06:21:23 +00:00
|
|
|
|
using osu.Game.Resources.Localisation.Web;
|
2021-08-10 05:11:21 +00:00
|
|
|
|
using osuTK;
|
2021-08-10 04:43:11 +00:00
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Changelog
|
|
|
|
|
{
|
|
|
|
|
public partial class ChangelogSupporterPromo : CompositeDrawable
|
|
|
|
|
{
|
2021-08-10 07:07:20 +00:00
|
|
|
|
private const float image_container_width = 164;
|
2021-08-15 01:48:57 +00:00
|
|
|
|
private const float heart_size = 75;
|
2021-08-10 06:53:06 +00:00
|
|
|
|
|
2021-08-10 04:43:11 +00:00
|
|
|
|
public ChangelogSupporterPromo()
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
Padding = new MarginPadding
|
|
|
|
|
{
|
|
|
|
|
Vertical = 20,
|
2023-04-03 00:12:27 +00:00
|
|
|
|
Horizontal = WaveOverlayContainer.HORIZONTAL_PADDING,
|
2021-08-10 04:43:11 +00:00
|
|
|
|
};
|
2021-09-10 04:11:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colour, TextureStore textures, OverlayColourProvider colourProvider)
|
|
|
|
|
{
|
|
|
|
|
SupporterPromoLinkFlowContainer supportLinkText;
|
2021-08-10 06:21:23 +00:00
|
|
|
|
|
2021-08-10 04:43:11 +00:00
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
2021-08-10 05:11:21 +00:00
|
|
|
|
Masking = true,
|
|
|
|
|
CornerRadius = 6,
|
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
|
Colour = Color4.Black.Opacity(0.25f),
|
|
|
|
|
Offset = new Vector2(0, 1),
|
|
|
|
|
Radius = 3,
|
|
|
|
|
},
|
2021-08-10 04:43:11 +00:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2021-09-10 04:11:55 +00:00
|
|
|
|
new Box
|
2021-08-10 04:43:11 +00:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2021-09-10 04:11:55 +00:00
|
|
|
|
Colour = colourProvider.Background5,
|
2021-08-10 04:43:11 +00:00
|
|
|
|
},
|
2021-08-10 06:53:06 +00:00
|
|
|
|
new Container
|
2021-08-10 04:43:11 +00:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Height = 200,
|
2021-08-10 06:21:23 +00:00
|
|
|
|
Padding = new MarginPadding { Horizontal = 75 },
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2021-09-10 04:11:55 +00:00
|
|
|
|
new FillFlowContainer
|
2021-08-10 06:21:23 +00:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
|
Origin = Anchor.CentreLeft,
|
2023-04-03 00:12:27 +00:00
|
|
|
|
Padding = new MarginPadding { Right = WaveOverlayContainer.HORIZONTAL_PADDING + image_container_width },
|
2021-09-10 04:11:55 +00:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Text = ChangelogStrings.SupportHeading,
|
|
|
|
|
Font = OsuFont.GetFont(size: 20, weight: FontWeight.Light),
|
|
|
|
|
Margin = new MarginPadding { Bottom = 20 },
|
|
|
|
|
},
|
|
|
|
|
supportLinkText = new SupporterPromoLinkFlowContainer(t =>
|
|
|
|
|
{
|
|
|
|
|
t.Font = t.Font.With(size: 14);
|
|
|
|
|
t.Colour = colour.PinkLighter;
|
|
|
|
|
})
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
},
|
|
|
|
|
new OsuTextFlowContainer(t =>
|
|
|
|
|
{
|
|
|
|
|
t.Font = t.Font.With(size: 12);
|
|
|
|
|
t.Colour = colour.PinkLighter;
|
|
|
|
|
})
|
|
|
|
|
{
|
2021-10-30 16:50:34 +00:00
|
|
|
|
Text = ChangelogStrings.SupportText2,
|
2021-09-10 04:11:55 +00:00
|
|
|
|
Margin = new MarginPadding { Top = 10 },
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-08-10 06:21:23 +00:00
|
|
|
|
},
|
2021-09-10 04:11:55 +00:00
|
|
|
|
new Container
|
2021-08-10 06:53:06 +00:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
2021-08-10 07:07:20 +00:00
|
|
|
|
Width = image_container_width,
|
2021-08-10 06:53:06 +00:00
|
|
|
|
Anchor = Anchor.CentreRight,
|
|
|
|
|
Origin = Anchor.CentreRight,
|
2021-09-10 04:11:55 +00:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Sprite
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Margin = new MarginPadding { Bottom = 28 },
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
FillMode = FillMode.Fill,
|
|
|
|
|
Texture = textures.Get(@"Online/supporter-pippi"),
|
|
|
|
|
},
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Size = new Vector2(heart_size),
|
|
|
|
|
Margin = new MarginPadding { Top = 70 },
|
|
|
|
|
Masking = true,
|
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
|
Colour = colour.Pink,
|
|
|
|
|
Radius = 10,
|
|
|
|
|
Roundness = heart_size / 2,
|
|
|
|
|
},
|
|
|
|
|
Child = new Sprite
|
|
|
|
|
{
|
|
|
|
|
Size = new Vector2(heart_size),
|
|
|
|
|
Texture = textures.Get(@"Online/supporter-heart"),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
2021-08-10 06:53:06 +00:00
|
|
|
|
}
|
2021-08-10 06:21:23 +00:00
|
|
|
|
}
|
2021-08-10 04:43:11 +00:00
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
2021-08-10 06:21:23 +00:00
|
|
|
|
|
2021-08-11 05:49:22 +00:00
|
|
|
|
supportLinkText.AddText("Support further development of osu! and ");
|
2021-09-08 06:52:01 +00:00
|
|
|
|
supportLinkText.AddLink("become an osu!supporter", @"https://osu.ppy.sh/home/support", t => t.Font = t.Font.With(weight: FontWeight.Bold));
|
2021-08-11 05:49:22 +00:00
|
|
|
|
supportLinkText.AddText(" today!");
|
2021-08-10 06:21:23 +00:00
|
|
|
|
}
|
2021-08-12 13:36:47 +00:00
|
|
|
|
|
|
|
|
|
private partial class SupporterPromoLinkFlowContainer : LinkFlowContainer
|
|
|
|
|
{
|
|
|
|
|
public SupporterPromoLinkFlowContainer(Action<SpriteText> defaultCreationParameters)
|
|
|
|
|
: base(defaultCreationParameters)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-01 15:12:04 +00:00
|
|
|
|
protected override DrawableLinkCompiler CreateLinkCompiler(ITextPart textPart) => new SupporterPromoLinkCompiler(textPart);
|
2021-08-12 13:36:47 +00:00
|
|
|
|
|
|
|
|
|
private partial class SupporterPromoLinkCompiler : DrawableLinkCompiler
|
|
|
|
|
{
|
2021-08-01 15:12:04 +00:00
|
|
|
|
public SupporterPromoLinkCompiler(ITextPart part)
|
|
|
|
|
: base(part)
|
2021-08-12 13:36:47 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colour)
|
|
|
|
|
{
|
|
|
|
|
IdleColour = colour.PinkDark;
|
|
|
|
|
HoverColour = Color4.White;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-08-10 04:43:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|