mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Change text on timing group add button when it is going to clone instead
Also disables the button when it would otherwise have no effect.
This commit is contained in:
parent
c06045f41f
commit
2fa4d46f73
@ -51,6 +51,8 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
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; }
|
||||||
|
|
||||||
@ -105,9 +107,8 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
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,
|
||||||
@ -122,7 +123,14 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
{
|
{
|
||||||
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) =>
|
||||||
@ -137,6 +145,8 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
trackActivePoint();
|
trackActivePoint();
|
||||||
|
|
||||||
|
addButton.Enabled.Value = clock.CurrentTimeAccurate != selectedGroup.Value?.Time;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user