Skip to content

Commit fd4cf2c

Browse files
committed
Fix file select displaying None with no music
1 parent 4e00862 commit fd4cf2c

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Cosmetics.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -987,11 +987,14 @@ def patch_song_names(rom: Rom, settings: Settings, log: CosmeticsLog, symbols: d
987987
for index, song_name in enumerate(log.bgm.values()):
988988
if index >= 47:
989989
break
990-
if len(song_name) > 50:
991-
song_name_cropped = song_name[:50]
992-
text_bytes = [ord(c) for c in song_name_cropped]
990+
if song_name == 'None':
991+
text_bytes = [ord('\0')] * 50
993992
else:
994-
text_bytes = [ord(c) for c in song_name] + [ord('\0')] * (50 - len(song_name))
993+
if len(song_name) > 50:
994+
song_name_cropped = song_name[:50]
995+
text_bytes = [ord(c) for c in song_name_cropped]
996+
else:
997+
text_bytes = [ord(c) for c in song_name] + [ord('\0')] * (50 - len(song_name))
995998
bytes_to_write += text_bytes
996999
rom.write_bytes(symbols['CFG_SONG_NAMES'], bytes_to_write)
9971000
log.display_custom_song_names = settings.display_custom_song_names

0 commit comments

Comments
 (0)