mirror of
https://github.com/ppy/osu
synced 2024-12-11 17:42:28 +00:00
Merge pull request #18530 from peppy/add-cloen-button
Change text on timing group add button when it is going to clone instead
This commit is contained in:
commit
fcf51a6f51
@ -53,6 +53,8 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
|
||||
private readonly IBindableList<ControlPointGroup> controlPointGroups = new BindableList<ControlPointGroup>();
|
||||
|
||||
private RoundedButton addButton;
|
||||
|
||||
[Resolved]
|
||||
private EditorClock clock { get; set; }
|
||||
|
||||
@ -107,9 +109,8 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
Anchor = Anchor.BottomRight,
|
||||
Origin = Anchor.BottomRight,
|
||||
},
|
||||
new RoundedButton
|
||||
addButton = new RoundedButton
|
||||
{
|
||||
Text = "+ Add at current time",
|
||||
Action = addNew,
|
||||
Size = new Vector2(160, 30),
|
||||
Anchor = Anchor.BottomRight,
|
||||
@ -124,7 +125,14 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
selectedGroup.BindValueChanged(selected => { deleteButton.Enabled.Value = selected.NewValue != null; }, true);
|
||||
selectedGroup.BindValueChanged(selected =>
|
||||
{
|
||||
deleteButton.Enabled.Value = selected.NewValue != null;
|
||||
|
||||
addButton.Text = selected.NewValue != null
|
||||
? "+ Clone to current time"
|
||||
: "+ Add at current time";
|
||||
}, true);
|
||||
|
||||
controlPointGroups.BindTo(Beatmap.ControlPointInfo.Groups);
|
||||
controlPointGroups.BindCollectionChanged((sender, args) =>
|
||||
@ -145,6 +153,8 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
base.Update();
|
||||
|
||||
trackActivePoint();
|
||||
|
||||
addButton.Enabled.Value = clock.CurrentTimeAccurate != selectedGroup.Value?.Time;
|
||||
}
|
||||
|
||||
private Type trackedType;
|
||||
|
Loading…
Reference in New Issue
Block a user