2020-02-03 19:35:07 +08: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.
|
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2021-01-19 06:34:37 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2020-02-03 19:35:07 +08:00
|
|
|
|
using osu.Framework.Bindables;
|
2021-01-19 06:34:37 +08:00
|
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
2020-02-03 19:35:07 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2021-01-19 06:34:37 +08:00
|
|
|
|
using osu.Framework.Graphics.Effects;
|
2021-10-29 16:58:46 +08:00
|
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
2021-08-03 15:34:21 +08:00
|
|
|
|
using osu.Game.Resources.Localisation.Web;
|
2020-02-03 19:35:07 +08:00
|
|
|
|
using osu.Game.Rulesets;
|
2021-01-19 06:34:37 +08:00
|
|
|
|
using osuTK;
|
|
|
|
|
using osuTK.Graphics;
|
2020-02-03 19:35:07 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.BeatmapSet
|
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class BeatmapSetHeader : OverlayHeader
|
2020-02-03 19:35:07 +08:00
|
|
|
|
{
|
2021-10-29 16:58:46 +08:00
|
|
|
|
public readonly Bindable<APIBeatmapSet> BeatmapSet = new Bindable<APIBeatmapSet>();
|
2021-01-19 06:34:37 +08:00
|
|
|
|
|
2021-01-20 09:56:46 +08:00
|
|
|
|
public BeatmapSetHeaderContent HeaderContent { get; private set; }
|
2020-02-04 11:55:09 +08:00
|
|
|
|
|
2021-01-20 09:56:46 +08:00
|
|
|
|
[Cached]
|
2020-02-04 11:55:09 +08:00
|
|
|
|
public BeatmapRulesetSelector RulesetSelector { get; private set; }
|
2020-02-03 19:35:07 +08:00
|
|
|
|
|
2021-01-19 06:34:37 +08:00
|
|
|
|
[Cached(typeof(IBindable<RulesetInfo>))]
|
|
|
|
|
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
|
|
|
|
|
|
|
|
|
public BeatmapSetHeader()
|
|
|
|
|
{
|
|
|
|
|
Masking = true;
|
|
|
|
|
|
|
|
|
|
EdgeEffect = new EdgeEffectParameters
|
|
|
|
|
{
|
|
|
|
|
Colour = Color4.Black.Opacity(0.25f),
|
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
|
Radius = 3,
|
|
|
|
|
Offset = new Vector2(0f, 1f),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-20 09:56:46 +08:00
|
|
|
|
protected override Drawable CreateContent() => HeaderContent = new BeatmapSetHeaderContent
|
2021-01-19 06:34:37 +08:00
|
|
|
|
{
|
2021-01-20 09:56:46 +08:00
|
|
|
|
BeatmapSet = { BindTarget = BeatmapSet }
|
2021-01-19 06:34:37 +08:00
|
|
|
|
};
|
|
|
|
|
|
2020-02-03 19:35:07 +08:00
|
|
|
|
protected override Drawable CreateTitleContent() => RulesetSelector = new BeatmapRulesetSelector
|
|
|
|
|
{
|
2021-01-19 06:34:37 +08:00
|
|
|
|
Current = ruleset
|
2020-02-03 19:35:07 +08:00
|
|
|
|
};
|
|
|
|
|
|
2021-01-20 09:56:46 +08:00
|
|
|
|
protected override OverlayTitle CreateTitle() => new BeatmapHeaderTitle();
|
|
|
|
|
|
2022-11-24 13:32:20 +08:00
|
|
|
|
private partial class BeatmapHeaderTitle : OverlayTitle
|
2020-02-03 19:35:07 +08:00
|
|
|
|
{
|
|
|
|
|
public BeatmapHeaderTitle()
|
|
|
|
|
{
|
2021-08-03 15:34:21 +08:00
|
|
|
|
Title = PageTitleStrings.MainBeatmapsetsControllerShow;
|
2020-09-03 16:05:45 +08:00
|
|
|
|
IconTexture = "Icons/Hexacons/beatmap";
|
2020-02-03 19:35:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|