mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Resolve review comments
This commit is contained in:
@ -195,8 +195,8 @@ namespace osu.Game.Beatmaps
|
||||
/// </summary>
|
||||
/// <param name="info">The <see cref="BeatmapInfo"/> to save the content against. The file referenced by <see cref="BeatmapInfo.Path"/> will be replaced.</param>
|
||||
/// <param name="beatmapContent">The <see cref="IBeatmap"/> content to write.</param>
|
||||
/// <param name="skin">Optional beatmap skin for inline skin configuration in beatmap files.</param>
|
||||
public void Save(BeatmapInfo info, IBeatmap beatmapContent, ISkin skin)
|
||||
/// <param name="beatmapSkin">The beatmap <see cref="ISkin"/> content to write, or null if not to be changed.</param>
|
||||
public void Save(BeatmapInfo info, IBeatmap beatmapContent, LegacyBeatmapSkin beatmapSkin = null)
|
||||
{
|
||||
var setInfo = QueryBeatmapSet(s => s.Beatmaps.Any(b => b.ID == info.ID));
|
||||
|
||||
@ -204,7 +204,13 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
using (var sw = new StreamWriter(stream, Encoding.UTF8, 1024, true))
|
||||
{
|
||||
new LegacyBeatmapEncoder(beatmapContent, skin).Encode(sw);
|
||||
if (beatmapSkin == null)
|
||||
{
|
||||
var workingBeatmap = GetWorkingBeatmap(info);
|
||||
beatmapSkin = (workingBeatmap.Skin is LegacyBeatmapSkin legacy) ? legacy : null;
|
||||
}
|
||||
|
||||
new LegacyBeatmapEncoder(beatmapContent, beatmapSkin).Encode(sw);
|
||||
}
|
||||
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
|
Reference in New Issue
Block a user