private static Drawable createCover(IBeatmapSetOnlineInfo onlineInfo) => new OnlineBeatmapSetCover(onlineInfo) { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fill };
public OnlineBeatmapSetCover(IBeatmapSetOnlineInfo set, BeatmapSetCoverType type = BeatmapSetCoverType.Cover) { if (set == null) { throw new ArgumentNullException(nameof(set)); } this.set = set; this.type = type; }
public static BeatmapCardDateStatistic?CreateFor(IBeatmapSetOnlineInfo beatmapSetInfo) { var displayDate = displayDateFor(beatmapSetInfo); if (displayDate == null) { return(null); } return(new BeatmapCardDateStatistic(displayDate.Value)); }
public BeatmapCardContentBackground(IBeatmapSetOnlineInfo onlineInfo) { InternalChildren = new Drawable[] { background = new Box { RelativeSizeAxes = Axes.Both, }, cover = new DelayedLoadUnloadWrapper(() => createCover(onlineInfo), 500, 500) { RelativeSizeAxes = Axes.Both, Colour = Colour4.Transparent } }; }
private static DateTimeOffset?displayDateFor(IBeatmapSetOnlineInfo beatmapSetInfo) { // reference: https://github.com/ppy/osu-web/blob/ef432c11719fd1207bec5f9194b04f0033bdf02c/resources/assets/lib/beatmapset-panel.tsx#L36-L44 switch (beatmapSetInfo.Status) { case BeatmapSetOnlineStatus.Ranked: case BeatmapSetOnlineStatus.Approved: case BeatmapSetOnlineStatus.Loved: case BeatmapSetOnlineStatus.Qualified: return(beatmapSetInfo.Ranked); default: return(beatmapSetInfo.LastUpdated); } }
protected override Drawable CreateDrawable(IBeatmapSetOnlineInfo model) { if (model == null) { return(null); } return(new TestOnlineBeatmapSetCover(model, loadDelay) { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, FillMode = FillMode.Fill, }); }
public static HypesStatistic?CreateFor(IBeatmapSetOnlineInfo beatmapSetOnlineInfo) => beatmapSetOnlineInfo.HypeStatus == null ? null : new HypesStatistic(beatmapSetOnlineInfo.HypeStatus);
public TestOnlineBeatmapSetCover(IBeatmapSetOnlineInfo set, int loadDelay) : base(set) { this.loadDelay = loadDelay; }
public static NominationsStatistic?CreateFor(IBeatmapSetOnlineInfo beatmapSetOnlineInfo) // web does not show nominations unless hypes are also present. // see: https://github.com/ppy/osu-web/blob/8ed7d071fd1d3eaa7e43cf0e4ff55ca2fef9c07c/resources/assets/lib/beatmapset-panel.tsx#L443 => beatmapSetOnlineInfo.HypeStatus == null || beatmapSetOnlineInfo.NominationStatus == null ? null : new NominationsStatistic(beatmapSetOnlineInfo.NominationStatus);
public PlayCountStatistic(IBeatmapSetOnlineInfo onlineInfo) { Icon = FontAwesome.Regular.PlayCircle; Text = onlineInfo.PlayCount.ToMetric(decimals: 1); TooltipText = BeatmapsStrings.PanelPlaycount(onlineInfo.PlayCount.ToLocalisableString(@"N0")); }