1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Fix bank not correctly being assigned when adding sample additions in editor

This commit is contained in:
Dean Herbert 2023-05-16 16:34:49 +09:00
parent 83dcd78826
commit d9ae822966
3 changed files with 3 additions and 3 deletions

View File

@ -210,7 +210,7 @@ namespace osu.Game.Rulesets.Objects
/// </summary>
/// <param name="sampleName">The name of the sample.</param>
/// <returns>A populated <see cref="HitSampleInfo"/>.</returns>
protected HitSampleInfo GetSampleInfo(string sampleName = HitSampleInfo.HIT_NORMAL)
public HitSampleInfo GetSampleInfo(string sampleName = HitSampleInfo.HIT_NORMAL)
{
var hitnormalSample = Samples.FirstOrDefault(s => s.Name == HitSampleInfo.HIT_NORMAL);
return hitnormalSample == null ? new HitSampleInfo(sampleName) : hitnormalSample.With(newName: sampleName);

View File

@ -185,7 +185,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
case TernaryState.True:
if (existingSample == null)
samples.Add(new HitSampleInfo(sampleName));
samples.Add(CurrentPlacement.HitObject.GetSampleInfo(sampleName));
break;
}
}

View File

@ -122,7 +122,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
if (h.Samples.Any(s => s.Name == sampleName))
return;
h.Samples.Add(new HitSampleInfo(sampleName));
h.Samples.Add(h.GetSampleInfo(sampleName));
EditorBeatmap.Update(h);
});
}