1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-05 09:42:54 +08:00

Add default value for input boxes in tournament editor screens

This commit is contained in:
CloneWith 2024-10-02 12:07:24 +08:00
parent 6dffa948d4
commit c07e7da40f
No known key found for this signature in database
GPG Key ID: F4FC0D1E91D7FFD5
3 changed files with 10 additions and 4 deletions

View File

@ -38,6 +38,12 @@ namespace osu.Game.Tournament.Screens.Editors
{
Model = round;
Model.Name.Default = Model.Name.Value;
Model.Description.Default = Model.Description.Value;
Model.StartDate.Default = Model.StartDate.Value;
Model.BanCount.Default = Model.BanCount.Value;
Model.BestOf.Default = Model.BestOf.Value;
Masking = true;
CornerRadius = 10;
@ -232,7 +238,7 @@ namespace osu.Game.Tournament.Screens.Editors
[BackgroundDependencyLoader]
private void load()
{
beatmapId.Value = Model.ID;
beatmapId.Default = beatmapId.Value = Model.ID;
beatmapId.BindValueChanged(id =>
{
Model.ID = id.NewValue ?? 0;
@ -263,7 +269,7 @@ namespace osu.Game.Tournament.Screens.Editors
API.Queue(req);
}, true);
mods.Value = Model.Mods;
mods.Default = mods.Value = Model.Mods;
mods.BindValueChanged(modString => Model.Mods = modString.NewValue);
}

View File

@ -221,7 +221,7 @@ namespace osu.Game.Tournament.Screens.Editors
[BackgroundDependencyLoader]
private void load()
{
beatmapId.Value = Model.ID;
beatmapId.Default = beatmapId.Value = Model.ID;
beatmapId.BindValueChanged(id =>
{
Model.ID = id.NewValue ?? 0;

View File

@ -283,7 +283,7 @@ namespace osu.Game.Tournament.Screens.Editors
[BackgroundDependencyLoader]
private void load()
{
playerId.Value = user.OnlineID;
playerId.Default = playerId.Value = user.OnlineID;
playerId.BindValueChanged(id =>
{
user.OnlineID = id.NewValue ?? 0;