mirror of
https://github.com/ppy/osu.git
synced 2024-12-17 20:02:58 +08:00
fix assigned hitsounds dont have bank or volume
This commit is contained in:
parent
3b5bae7742
commit
88d840a60d
@ -210,10 +210,10 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sampleName">The name of the sample.</param>
|
/// <param name="sampleName">The name of the sample.</param>
|
||||||
/// <returns>A populated <see cref="HitSampleInfo"/>.</returns>
|
/// <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);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
if (h.Samples.Any(s => s.Name == sampleName))
|
if (h.Samples.Any(s => s.Name == sampleName))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
h.Samples.Add(new HitSampleInfo(sampleName));
|
h.Samples.Add(h.GetSampleInfo(sampleName));
|
||||||
EditorBeatmap.Update(h);
|
EditorBeatmap.Update(h);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user