1
0
mirror of synced 2025-02-10 16:03:09 +01:00

Fix note.type -> note.note_type

This commit is contained in:
Viv 2023-07-24 15:50:42 -04:00
parent 9f71a801ce
commit 4f269630a5
2 changed files with 10 additions and 10 deletions

View File

@ -330,33 +330,33 @@ def convert_tja_to_fumen(tja):
# Handle note metadata # Handle note metadata
note = FumenNote() note = FumenNote()
note.pos = note_pos note.pos = note_pos
note.type = data.value note.note_type = data.value
note.score_init = tja.score_init note.score_init = tja.score_init
note.score_diff = tja.score_diff note.score_diff = tja.score_diff
# Handle drumroll notes # Handle drumroll notes
if note.type in ["Balloon", "Kusudama"]: if note.note_type in ["Balloon", "Kusudama"]:
try: try:
note.hits = course_balloons.pop(0) note.hits = course_balloons.pop(0)
except IndexError: except IndexError:
raise ValueError(f"Not enough values for 'BALLOON: " raise ValueError(f"Not enough values for 'BALLOON: "
f"{','.join(course_balloons)}'") f"{','.join(course_balloons)}'")
current_drumroll = note current_drumroll = note
elif note.type in ["Drumroll", "DRUMROLL"]: elif note.note_type in ["Drumroll", "DRUMROLL"]:
current_drumroll = note current_drumroll = note
# Track Don/Ka notes (to later compute header values) # Track Don/Ka notes (to later compute header values)
elif note.type.lower() in ['don', 'ka']: elif note.note_type.lower() in ['don', 'ka']:
total_notes[current_branch] += 1 total_notes[current_branch] += 1
# Track branch points (to later compute `#BRANCHSTART p` vals) # Track branch points (to later compute `#BRANCHSTART p` vals)
if note.type in ['Don', 'Ka']: if note.note_type in ['Don', 'Ka']:
pts_to_add = fumen.header.b468_b471_branch_points_good pts_to_add = fumen.header.b468_b471_branch_points_good
elif note.type in ['DON', 'KA']: elif note.note_type in ['DON', 'KA']:
pts_to_add = fumen.header.b484_b487_branch_points_good_big pts_to_add = fumen.header.b484_b487_branch_points_good_big
elif note.type == 'Balloon': elif note.note_type == 'Balloon':
pts_to_add = fumen.header.b496_b499_branch_points_balloon pts_to_add = fumen.header.b496_b499_branch_points_balloon
elif note.type == 'Kusudama': elif note.note_type == 'Kusudama':
pts_to_add = fumen.header.b500_b503_branch_points_kusudama pts_to_add = fumen.header.b500_b503_branch_points_kusudama
else: else:
pts_to_add = 0 # Drumrolls not relevant for `p` conditions pts_to_add = 0 # Drumrolls not relevant for `p` conditions

View File

@ -26,7 +26,7 @@ def write_fumen(path_out, song):
for note_number in range(branch.length): for note_number in range(branch.length):
note = branch.notes[note_number] note = branch.notes[note_number]
note_struct = [FUMEN_TYPE_NOTES[note.type], note.pos, note_struct = [FUMEN_TYPE_NOTES[note.note_type], note.pos,
note.item, note.padding] note.item, note.padding]
if note.hits: if note.hits:
extra_vals = [note.hits, note.hits_padding] extra_vals = [note.hits, note.hits_padding]
@ -37,7 +37,7 @@ def write_fumen(path_out, song):
format_string="ififHHf", format_string="ififHHf",
value_list=note_struct) value_list=note_struct)
if note.type.lower() == "drumroll": if note.note_type.lower() == "drumroll":
file.write(note.drumroll_bytes) file.write(note.drumroll_bytes)