1
0
mirror of synced 2025-02-21 20:59:45 +01:00

[jbsq] use the correct magic bytes for long note charts

This commit is contained in:
Stepland 2022-12-24 12:48:36 +01:00
parent 5524656cf2
commit 6b7b2cc9f0
2 changed files with 19 additions and 1 deletions

View File

@ -7,6 +7,13 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
I try to follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## v2.0.3
### Fixed
- [jbsq] Use "IJSQ" as magic bytes when dumping charts with hold notes so that
the hold symbol shows up properly on a song's preview pane when the song is
downloaded from the Gift Store or transferred via local matching
(contributed by [kis](https://gitlab.com/_kis))
## v2.0.2
### Fixed
- Bump the required versions of

View File

@ -55,7 +55,7 @@ def make_jbsq_chart(events: List[konami.Event], notes: List[AnyNote]) -> constru
density_graph=densities,
events=jbsq_events,
)
jbsq_chart.magic = b"JBSQ"
jbsq_chart.magic = choose_magic_bytes(notes)
return jbsq_chart
@ -100,3 +100,14 @@ def compute_density_graph(events: List[konami.Event], end_time: int) -> List[int
res.append(density_byte)
return res
def choose_magic_bytes(notes: List[AnyNote]) -> bytes:
# The magic bytes are actually checked by the app to decide whether or not
# to display the "hold note" icon next to the song jacket
if any(isinstance(note, song.LongNote) for note in notes):
return b"IJSQ"
else:
# Could have also used IJBQ here instead, I don't know if that makes a
# difference
return b"JBSQ"