1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 17:13:06 +08:00

Add source and tags text boxes to metadata section

This commit is contained in:
Bartłomiej Dach 2021-06-10 14:02:17 +02:00
parent 5a2e710095
commit 252fe0a6cc
2 changed files with 12 additions and 4 deletions

View File

@ -3,7 +3,6 @@
using System.Linq; using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Graphics.UserInterfaceV2;
@ -14,20 +13,26 @@ namespace osu.Game.Screens.Edit.Setup
{ {
private LabelledTextBox artistTextBox; private LabelledTextBox artistTextBox;
private LabelledTextBox titleTextBox; private LabelledTextBox titleTextBox;
private LabelledTextBox creatorTextBox; private LabelledTextBox creatorTextBox;
private LabelledTextBox difficultyTextBox; private LabelledTextBox difficultyTextBox;
private LabelledTextBox sourceTextBox;
private LabelledTextBox tagsTextBox;
public override LocalisableString Title => "Metadata"; public override LocalisableString Title => "Metadata";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
Children = new Drawable[] Children = new[]
{ {
artistTextBox = createTextBox("Artist", Beatmap.Metadata.Artist), artistTextBox = createTextBox("Artist", Beatmap.Metadata.Artist),
titleTextBox = createTextBox("Title", Beatmap.Metadata.Title), titleTextBox = createTextBox("Title", Beatmap.Metadata.Title),
Empty(),
creatorTextBox = createTextBox("Creator", Beatmap.Metadata.AuthorString), creatorTextBox = createTextBox("Creator", Beatmap.Metadata.AuthorString),
difficultyTextBox = createTextBox("Difficulty Name", Beatmap.BeatmapInfo.Version) difficultyTextBox = createTextBox("Difficulty Name", Beatmap.BeatmapInfo.Version),
sourceTextBox = createTextBox("Source", Beatmap.Metadata.Source),
tagsTextBox = createTextBox("Tags", Beatmap.Metadata.Tags)
}; };
foreach (var item in Children.OfType<LabelledTextBox>()) foreach (var item in Children.OfType<LabelledTextBox>())
@ -58,8 +63,11 @@ namespace osu.Game.Screens.Edit.Setup
// after switching database engines we can reconsider if switching to bindables is a good direction. // after switching database engines we can reconsider if switching to bindables is a good direction.
Beatmap.Metadata.Artist = artistTextBox.Current.Value; Beatmap.Metadata.Artist = artistTextBox.Current.Value;
Beatmap.Metadata.Title = titleTextBox.Current.Value; Beatmap.Metadata.Title = titleTextBox.Current.Value;
Beatmap.Metadata.AuthorString = creatorTextBox.Current.Value; Beatmap.Metadata.AuthorString = creatorTextBox.Current.Value;
Beatmap.BeatmapInfo.Version = difficultyTextBox.Current.Value; Beatmap.BeatmapInfo.Version = difficultyTextBox.Current.Value;
Beatmap.Metadata.Source = sourceTextBox.Current.Value;
Beatmap.Metadata.Tags = tagsTextBox.Current.Value;
} }
} }
} }

View File

@ -59,7 +59,7 @@ namespace osu.Game.Screens.Edit.Setup
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Spacing = new Vector2(20), Spacing = new Vector2(10),
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
} }
} }