1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 21:23:19 +08:00

dont assign custom sample bank and volume to hitobjects in non-mania gamemodes

this makes it easier to edit hitsounds in the stable editor after export because the sample control point effects wont get overwritten by the properties of the hitobject
This commit is contained in:
OliBomby 2023-05-01 12:31:27 +02:00
parent 2a94757154
commit cef9f73d34

View File

@ -520,6 +520,14 @@ namespace osu.Game.Beatmaps.Formats
string sampleFilename = samples.FirstOrDefault(s => string.IsNullOrEmpty(s.Name))?.LookupNames.First() ?? string.Empty;
int volume = samples.FirstOrDefault()?.Volume ?? 100;
// We want to ignore custom sample banks and volume when not encoding to the mania game mode,
// because they cause unexpected results in the editor and are already satisfied by the control points.
if (onlineRulesetID != 3)
{
customSampleBank = "0";
volume = 0;
}
sb.Append(':');
sb.Append(FormattableString.Invariant($"{customSampleBank}:"));
sb.Append(FormattableString.Invariant($"{volume}:"));