Skip to content

Commit 28efcdc

Browse files
committed
FEAT: support for #BackBmp
1 parent 934a634 commit 28efcdc

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

BmsToOsu/Converter/Osu.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ public static (string, HashSet<string> fileToCp) ToOsuBeatMap(
6363

6464
var bg = "";
6565

66-
if (File.Exists(Path.Join(dir, data.Metadata.StageFile)))
66+
if (File.Exists(Path.Join(dir, data.Metadata.BackBmp)))
67+
{
68+
bg = data.Metadata.BackBmp;
69+
}
70+
else if (File.Exists(Path.Join(dir, data.Metadata.StageFile)))
6771
{
6872
bg = data.Metadata.StageFile;
6973
}

BmsToOsu/Entity/BmsFileData.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,16 @@ private static BmsFileData CompileBmsToObj(string fp)
193193

194194
metadata.StageFile = stageFile;
195195
}
196+
else if (line.WithCommand("#BACKBMP", out var backBmp))
197+
{
198+
if (backBmp.IsEmpty())
199+
{
200+
Log.Warn($"{fp}: #BACKBMP is invalid, ignoring (Line: {i})");
201+
continue;
202+
}
203+
204+
metadata.BackBmp = backBmp;
205+
}
196206
else if (line.WithCommand("#banner", out var banner))
197207
{
198208
if (banner.IsEmpty())

BmsToOsu/Entity/BmsMetadata.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class BmsMetadata
88
public string Difficulty = "";
99
public string StageFile = "";
1010
public string Subtitle = "";
11+
public string BackBmp = "";
1112
public List<string> SubArtists { get; } = new();
1213
public string Banner = "";
1314
}

0 commit comments

Comments
 (0)