mirror of
https://github.com/ppy/osu
synced 2025-03-20 09:57:01 +00:00
Add support for sample changes
This commit is contained in:
parent
79983415a0
commit
4a87ac7840
@ -212,6 +212,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// <param name="sampleName">The name of the hit sample.</param>
|
/// <param name="sampleName">The name of the hit sample.</param>
|
||||||
public void AddHitSample(string sampleName)
|
public void AddHitSample(string sampleName)
|
||||||
{
|
{
|
||||||
|
changeHandler?.BeginChange();
|
||||||
|
|
||||||
foreach (var h in SelectedHitObjects)
|
foreach (var h in SelectedHitObjects)
|
||||||
{
|
{
|
||||||
// Make sure there isn't already an existing sample
|
// Make sure there isn't already an existing sample
|
||||||
@ -220,6 +222,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
h.Samples.Add(new HitSampleInfo { Name = sampleName });
|
h.Samples.Add(new HitSampleInfo { Name = sampleName });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeHandler?.EndChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -228,8 +232,12 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// <param name="sampleName">The name of the hit sample.</param>
|
/// <param name="sampleName">The name of the hit sample.</param>
|
||||||
public void RemoveHitSample(string sampleName)
|
public void RemoveHitSample(string sampleName)
|
||||||
{
|
{
|
||||||
|
changeHandler?.BeginChange();
|
||||||
|
|
||||||
foreach (var h in SelectedHitObjects)
|
foreach (var h in SelectedHitObjects)
|
||||||
h.SamplesBindable.RemoveAll(s => s.Name == sampleName);
|
h.SamplesBindable.RemoveAll(s => s.Name == sampleName);
|
||||||
|
|
||||||
|
changeHandler?.EndChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user