mirror of
https://github.com/ppy/osu.git
synced 2026-05-19 06:31:19 +08:00
0988552567
I don't really have much to say here. Instead, I'll give a brief history rundown that lists many pages of documentation you can read, if interested. - Started off as BTMC + Happy24 (Vivi)'s ["The Vision"](https://docs.google.com/document/d/1p1IpPmd2RICp8G4OqkCSs7u8Ug8FbFv8qqP0mfSrHf0/edit?tab=t.0#heading=h.fol093d9f9xi) - Initial [designs](https://www.figma.com/design/f5qqC57t9jFlgpzhRqUNVX/The-Vision?node-id=0-1&p=f) were led by Vivi. - Designs [morphed](https://www.figma.com/design/vtFmLrXKvWNyYiRjTezFTM/Untitled--Copy-?node-id=0-1&p=f) during development into what's currently present, led by @minetoblend. - There is some more ongoing work creating a [game design document](https://docs.google.com/document/d/1iffJFCsIBfYF0D4ogItSBEj6YBmbp-rdCpItAeaJiTA/edit?tab=t.0). **tl;dr:** Create something with the mechanics of a trading card game within osu!. The name of this is "ranked play". --- To be frank, a lot of stuff is missing here. Some of it I don't want to mention, because the point of this exercise is to get the system into the hands of players, gather feedback especially around mechanics, and discuss any further direction with the team. I am expecting a blanket approval on all of the new code, with particular attention to changes in existing components that I'll point out in a self review. There is also some [ongoing work](https://github.com/smoogipoo/osu/pulls) that may arrive in this branch prior to being merged. --------- Co-authored-by: maarvin <minetoblend@gmail.com> Co-authored-by: Marvin <m.schuerz@hautzy.com> Co-authored-by: Jamie Taylor <me@nekodex.net> Co-authored-by: ArijanJ <arijanj@proton.me> Co-authored-by: Dean Herbert <pe@ppy.sh> Co-authored-by: Tim Oliver <git@tim.dev> Co-authored-by: Joseph Madamba <madamba.joehu@outlook.com> Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com> Co-authored-by: nil <25884226+voidstar0@users.noreply.github.com> Co-authored-by: Ботников Максим <mr.botnikoff@ya.ru> Co-authored-by: Denis Titovets <den232titovets@yandex.ru> Co-authored-by: Michael Middlezong <119022671+mmiddlezong@users.noreply.github.com> Co-authored-by: SupDos <6813986+SupDos@users.noreply.github.com> Co-authored-by: failaip12 <86018517+failaip12@users.noreply.github.com>
181 lines
5.9 KiB
C#
181 lines
5.9 KiB
C#
// 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.
|
|
|
|
using System;
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Framework.Localisation;
|
|
using osu.Game.Graphics;
|
|
using osu.Game.Graphics.Containers;
|
|
using osu.Game.Graphics.Sprites;
|
|
using osu.Game.Graphics.UserInterface;
|
|
using osu.Game.Overlays;
|
|
using osuTK;
|
|
|
|
namespace osu.Game.Screens.Select
|
|
{
|
|
public partial class BeatmapMetadataWedge
|
|
{
|
|
public partial class MetadataDisplay : FillFlowContainer
|
|
{
|
|
private readonly OsuSpriteText labelText;
|
|
private readonly OsuSpriteText contentText;
|
|
private readonly OsuSpriteText contentLinkText;
|
|
private readonly OsuHoverContainer contentLink;
|
|
private readonly DrawableDate contentDate;
|
|
private readonly TagsLine contentTags;
|
|
private readonly LoadingSpinner contentLoading;
|
|
|
|
private (LocalisableString value, Action? linkAction)? data;
|
|
|
|
public (LocalisableString value, Action? linkAction)? Data
|
|
{
|
|
get => data;
|
|
set
|
|
{
|
|
data = value;
|
|
|
|
if (value?.linkAction != null)
|
|
setLink(value.Value.value, value.Value.linkAction);
|
|
else if (value.HasValue)
|
|
setText(value.Value.value);
|
|
else
|
|
setLoading();
|
|
}
|
|
}
|
|
|
|
public DateTimeOffset? Date
|
|
{
|
|
set
|
|
{
|
|
if (value != null)
|
|
setDate(value.Value);
|
|
else
|
|
setText("-");
|
|
}
|
|
}
|
|
|
|
public (string[] tags, Action<string> searchAction)? Tags
|
|
{
|
|
set
|
|
{
|
|
if (value != null)
|
|
setTags(value.Value.tags, value.Value.searchAction);
|
|
else
|
|
setLoading();
|
|
}
|
|
}
|
|
|
|
public MetadataDisplay(LocalisableString label)
|
|
{
|
|
RelativeSizeAxes = Axes.X;
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
Padding = new MarginPadding { Right = 10 };
|
|
|
|
InternalChildren = new Drawable[]
|
|
{
|
|
labelText = new OsuSpriteText
|
|
{
|
|
Text = label,
|
|
Font = OsuFont.Style.Caption1.With(weight: FontWeight.SemiBold),
|
|
},
|
|
new Container
|
|
{
|
|
RelativeSizeAxes = Axes.X,
|
|
Height = OsuFont.Style.Caption1.Size,
|
|
Children = new Drawable[]
|
|
{
|
|
contentText = new TruncatingSpriteText
|
|
{
|
|
RelativeSizeAxes = Axes.X,
|
|
Font = OsuFont.Style.Caption1,
|
|
},
|
|
contentLink = new OsuHoverContainer
|
|
{
|
|
AutoSizeAxes = Axes.Both,
|
|
Child = contentLinkText = new TruncatingSpriteText
|
|
{
|
|
Font = OsuFont.Style.Caption1,
|
|
},
|
|
},
|
|
contentDate = new DrawableDate(default, OsuFont.Style.Caption1.Size, false),
|
|
contentTags = new TagsLine(),
|
|
contentLoading = new LoadingSpinner
|
|
{
|
|
Anchor = Anchor.TopLeft,
|
|
Origin = Anchor.TopLeft,
|
|
Size = new Vector2(10),
|
|
Margin = new MarginPadding { Top = 3f },
|
|
State = { Value = Visibility.Visible },
|
|
}
|
|
},
|
|
},
|
|
};
|
|
}
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(OverlayColourProvider colourProvider)
|
|
{
|
|
labelText.Colour = colourProvider.Content1;
|
|
contentText.Colour = colourProvider.Content2;
|
|
contentLink.IdleColour = colourProvider.Light2;
|
|
}
|
|
|
|
protected override void Update()
|
|
{
|
|
base.Update();
|
|
contentLinkText.MaxWidth = ChildSize.X;
|
|
}
|
|
|
|
private void clear()
|
|
{
|
|
contentText.Text = string.Empty;
|
|
contentLinkText.Text = string.Empty;
|
|
contentDate.Hide();
|
|
contentTags.Tags = Array.Empty<string>();
|
|
contentLoading.Hide();
|
|
}
|
|
|
|
private void setText(LocalisableString text)
|
|
{
|
|
clear();
|
|
|
|
contentText.Text = text;
|
|
}
|
|
|
|
private void setLink(LocalisableString text, Action action)
|
|
{
|
|
clear();
|
|
|
|
contentLinkText.Text = text;
|
|
contentLink.Action = action;
|
|
}
|
|
|
|
private void setDate(DateTimeOffset date)
|
|
{
|
|
clear();
|
|
|
|
contentDate.Show();
|
|
contentDate.Date = date;
|
|
}
|
|
|
|
private void setTags(string[] tags, Action<string> searchAction)
|
|
{
|
|
clear();
|
|
|
|
contentTags.PerformSearch = searchAction;
|
|
contentTags.Tags = tags;
|
|
}
|
|
|
|
private void setLoading()
|
|
{
|
|
clear();
|
|
|
|
contentLoading.Show();
|
|
}
|
|
}
|
|
}
|
|
}
|