add epilepsy warning in metadata display

This commit is contained in:
Gagah Pangeran 2020-07-20 17:24:17 +07:00
parent d0aa30680f
commit 6a144fba80

View File

@ -49,6 +49,37 @@ namespace osu.Game.Screens.Play
} }
} }
private class EpilepsyWarning : FillFlowContainer
{
public EpilepsyWarning()
{
AutoSizeAxes = Axes.Both;
Direction = FillDirection.Vertical;
Children = new Drawable[]
{
new SpriteIcon
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Icon = FontAwesome.Solid.ExclamationTriangle,
Size = new Vector2(40)
},
new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Text = "This beatmap contains scenes with rapidly flashing colours."
},
new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Text = "Please take caution if you are affected by epilepsy."
}
};
}
}
private readonly WorkingBeatmap beatmap; private readonly WorkingBeatmap beatmap;
private readonly Bindable<IReadOnlyList<Mod>> mods; private readonly Bindable<IReadOnlyList<Mod>> mods;
private readonly Drawable facade; private readonly Drawable facade;
@ -162,6 +193,12 @@ namespace osu.Game.Screens.Play
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Top = 20 }, Margin = new MarginPadding { Top = 20 },
Current = mods Current = mods
},
new EpilepsyWarning
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Margin = new MarginPadding { Top = 20 },
} }
}, },
} }