1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 14:02:55 +08:00

Rename Text to Metadata

This commit is contained in:
Joseph Madamba 2022-12-23 11:11:15 -08:00
parent e1e6d76f30
commit 494886ef92
8 changed files with 27 additions and 27 deletions

View File

@ -121,10 +121,10 @@ namespace osu.Game.Overlays.BeatmapSet
BeatmapSet.ValueChanged += b =>
{
source.Text = b.NewValue?.Source ?? string.Empty;
tags.Text = b.NewValue?.Tags ?? string.Empty;
genre.Text = b.NewValue?.Genre ?? new BeatmapSetOnlineGenre { Id = 1 };
language.Text = b.NewValue?.Language ?? new BeatmapSetOnlineLanguage { Id = 1 };
source.Metadata = b.NewValue?.Source ?? string.Empty;
tags.Metadata = b.NewValue?.Tags ?? string.Empty;
genre.Metadata = b.NewValue?.Genre ?? new BeatmapSetOnlineGenre { Id = 1 };
language.Metadata = b.NewValue?.Language ?? new BeatmapSetOnlineLanguage { Id = 1 };
bool setHasLeaderboard = b.NewValue?.Status > 0;
successRate.Alpha = setHasLeaderboard ? 1 : 0;
notRankedPlaceholder.Alpha = setHasLeaderboard ? 0 : 1;

View File

@ -16,7 +16,7 @@ namespace osu.Game.Overlays.BeatmapSet
{
public abstract partial class MetadataSection : MetadataSection<string>
{
public override string Text
public override string Metadata
{
set
{
@ -26,7 +26,7 @@ namespace osu.Game.Overlays.BeatmapSet
return;
}
base.Text = value;
base.Metadata = value;
}
}
@ -78,7 +78,7 @@ namespace osu.Game.Overlays.BeatmapSet
};
}
public virtual T Text
public virtual T Metadata
{
set
{
@ -90,11 +90,11 @@ namespace osu.Game.Overlays.BeatmapSet
this.FadeIn(TRANSITION_DURATION);
setTextAsync(value);
setTextFlowAsync(value);
}
}
private void setTextAsync(T text)
private void setTextFlowAsync(T metadata)
{
LoadComponentAsync(new LinkFlowContainer(s => s.Font = s.Font.With(size: 14))
{
@ -105,7 +105,7 @@ namespace osu.Game.Overlays.BeatmapSet
{
textFlow?.Expire();
AddMetadata(text, loaded);
AddMetadata(metadata, loaded);
textContainer.Add(textFlow = loaded);
@ -114,6 +114,6 @@ namespace osu.Game.Overlays.BeatmapSet
});
}
protected abstract void AddMetadata(T text, LinkFlowContainer loaded);
protected abstract void AddMetadata(T metadata, LinkFlowContainer loaded);
}
}

View File

@ -13,9 +13,9 @@ namespace osu.Game.Overlays.BeatmapSet
{
}
protected override void AddMetadata(string text, LinkFlowContainer loaded)
protected override void AddMetadata(string metadata, LinkFlowContainer loaded)
{
loaded.AddText(text);
loaded.AddText(metadata);
}
}
}

View File

@ -17,14 +17,14 @@ namespace osu.Game.Overlays.BeatmapSet
{
}
protected override void AddMetadata(BeatmapSetOnlineGenre text, LinkFlowContainer loaded)
protected override void AddMetadata(BeatmapSetOnlineGenre metadata, LinkFlowContainer loaded)
{
var genre = (SearchGenre)text.Id;
var genre = (SearchGenre)metadata.Id;
if (Enum.IsDefined(genre))
loaded.AddLink(genre.GetLocalisableDescription(), LinkAction.FilterBeatmapSetGenre, genre);
else
loaded.AddText(text.Name);
loaded.AddText(metadata.Name);
}
}
}

View File

@ -17,14 +17,14 @@ namespace osu.Game.Overlays.BeatmapSet
{
}
protected override void AddMetadata(BeatmapSetOnlineLanguage text, LinkFlowContainer loaded)
protected override void AddMetadata(BeatmapSetOnlineLanguage metadata, LinkFlowContainer loaded)
{
var language = (SearchLanguage)text.Id;
var language = (SearchLanguage)metadata.Id;
if (Enum.IsDefined(language))
loaded.AddLink(language.GetLocalisableDescription(), LinkAction.FilterBeatmapSetLanguage, language);
else
loaded.AddText(text.Name);
loaded.AddText(metadata.Name);
}
}
}

View File

@ -14,12 +14,12 @@ namespace osu.Game.Overlays.BeatmapSet
{
}
protected override void AddMetadata(string text, LinkFlowContainer loaded)
protected override void AddMetadata(string metadata, LinkFlowContainer loaded)
{
if (SearchAction != null)
loaded.AddLink(text, () => SearchAction(text));
loaded.AddLink(metadata, () => SearchAction(metadata));
else
loaded.AddLink(text, LinkAction.SearchBeatmapSet, text);
loaded.AddLink(metadata, LinkAction.SearchBeatmapSet, metadata);
}
}
}

View File

@ -14,9 +14,9 @@ namespace osu.Game.Overlays.BeatmapSet
{
}
protected override void AddMetadata(string text, LinkFlowContainer loaded)
protected override void AddMetadata(string metadata, LinkFlowContainer loaded)
{
string[] tags = text.Split(" ");
string[] tags = metadata.Split(" ");
for (int i = 0; i <= tags.Length - 1; i++)
{

View File

@ -187,9 +187,9 @@ namespace osu.Game.Screens.Select
private void updateStatistics()
{
advanced.BeatmapInfo = BeatmapInfo;
description.Text = BeatmapInfo?.DifficultyName ?? string.Empty;
source.Text = BeatmapInfo?.Metadata.Source ?? string.Empty;
tags.Text = BeatmapInfo?.Metadata.Tags ?? string.Empty;
description.Metadata = BeatmapInfo?.DifficultyName ?? string.Empty;
source.Metadata = BeatmapInfo?.Metadata.Source ?? string.Empty;
tags.Metadata = BeatmapInfo?.Metadata.Tags ?? string.Empty;
// failTimes may have been previously fetched
if (ratings != null && failTimes != null)