Merge pull request #12027 from peppy/new-beatmap-empty-fields

Don't fill beatmap metadata with template values on creating a new beatmap
This commit is contained in:
Dan Balasescu 2021-03-17 19:36:21 +09:00 committed by GitHub
commit 5a7e416495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 3 deletions

View File

@ -113,8 +113,6 @@ namespace osu.Game.Beatmaps
{ {
var metadata = new BeatmapMetadata var metadata = new BeatmapMetadata
{ {
Artist = "artist",
Title = "title",
Author = user, Author = user,
}; };
@ -128,7 +126,6 @@ namespace osu.Game.Beatmaps
BaseDifficulty = new BeatmapDifficulty(), BaseDifficulty = new BeatmapDifficulty(),
Ruleset = ruleset, Ruleset = ruleset,
Metadata = metadata, Metadata = metadata,
Version = "difficulty"
} }
} }
}; };

View File

@ -5,6 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
namespace osu.Game.Graphics.UserInterfaceV2 namespace osu.Game.Graphics.UserInterfaceV2
@ -53,6 +54,14 @@ namespace osu.Game.Graphics.UserInterfaceV2
CornerRadius = CORNER_RADIUS, CornerRadius = CORNER_RADIUS,
}; };
public override bool AcceptsFocus => true;
protected override void OnFocus(FocusEvent e)
{
base.OnFocus(e);
GetContainingInputManager().ChangeFocus(Component);
}
protected override OsuTextBox CreateComponent() => CreateTextBox().With(t => protected override OsuTextBox CreateComponent() => CreateTextBox().With(t =>
{ {
t.OnCommit += (sender, newText) => OnCommit?.Invoke(sender, newText); t.OnCommit += (sender, newText) => OnCommit?.Invoke(sender, newText);

View File

@ -56,6 +56,14 @@ namespace osu.Game.Screens.Edit.Setup
item.OnCommit += onCommit; item.OnCommit += onCommit;
} }
protected override void LoadComplete()
{
base.LoadComplete();
if (string.IsNullOrEmpty(artistTextBox.Current.Value))
GetContainingInputManager().ChangeFocus(artistTextBox);
}
private void onCommit(TextBox sender, bool newText) private void onCommit(TextBox sender, bool newText)
{ {
if (!newText) return; if (!newText) return;