1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-17 17:33:03 +08:00

fix assigned hitsounds dont have bank or volume

This commit is contained in:
OliBomby 2023-05-08 14:42:15 +02:00
parent 3b5bae7742
commit 88d840a60d
2 changed files with 3 additions and 3 deletions

View File

@ -210,10 +210,10 @@ 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);
return hitnormalSample == null ? new HitSampleInfo(sampleName, SampleControlPoint.DEFAULT_BANK, volume: 100) : hitnormalSample.With(newName: sampleName);
}
}

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);
});
}