mirror of https://github.com/ppy/osu
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 @@ public class ControlPointList : CompositeDrawable
|
||||||
|
|
||||||
private readonly IBindableList<ControlPointGroup> controlPointGroups = new BindableList<ControlPointGroup>();
|
private readonly IBindableList<ControlPointGroup> controlPointGroups = new BindableList<ControlPointGroup>();
|
||||||
|
|
||||||
|
private RoundedButton addButton;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private EditorClock clock { get; set; }
|
private EditorClock clock { get; set; }
|
||||||
|
|
||||||
|
@ -107,9 +109,8 @@ private void load(OverlayColourProvider colours)
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
},
|
},
|
||||||
new RoundedButton
|
addButton = new RoundedButton
|
||||||
{
|
{
|
||||||
Text = "+ Add at current time",
|
|
||||||
Action = addNew,
|
Action = addNew,
|
||||||
Size = new Vector2(160, 30),
|
Size = new Vector2(160, 30),
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
|
@ -124,7 +125,14 @@ protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
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.BindTo(Beatmap.ControlPointInfo.Groups);
|
||||||
controlPointGroups.BindCollectionChanged((sender, args) =>
|
controlPointGroups.BindCollectionChanged((sender, args) =>
|
||||||
|
@ -145,6 +153,8 @@ protected override void Update()
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
trackActivePoint();
|
trackActivePoint();
|
||||||
|
|
||||||
|
addButton.Enabled.Value = clock.CurrentTimeAccurate != selectedGroup.Value?.Time;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Type trackedType;
|
private Type trackedType;
|
||||||
|
|
Loading…
Reference in New Issue