mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
minor bug fixes
This commit is contained in:
@@ -551,7 +551,6 @@ class ScoreHistory:
|
||||
current_ms (int): The current time in milliseconds.
|
||||
"""
|
||||
self.scores = {k: v for k, v in scores.items() if v is not None}
|
||||
print(self.scores)
|
||||
self.difficulty_keys = list(self.scores.keys())
|
||||
self.curr_difficulty_index = 0
|
||||
self.curr_difficulty_index = (self.curr_difficulty_index + 1) % len(self.difficulty_keys)
|
||||
|
||||
@@ -120,9 +120,21 @@ def build_song_hashes(output_dir=Path("cache")):
|
||||
|
||||
try:
|
||||
for diff in tja.metadata.course_data:
|
||||
diff_notes, _, _, _ = TJAParser.notes_to_position(TJAParser(tja.file_path), diff)
|
||||
diff_notes, branch_m, branch_e, branch_n = TJAParser.notes_to_position(TJAParser(tja.file_path), diff)
|
||||
diff_hashes[diff] = tja.hash_note_data(diff_notes)
|
||||
all_notes.play_notes.extend(diff_notes.play_notes)
|
||||
if branch_m:
|
||||
for branch in branch_m:
|
||||
all_notes.play_notes.extend(branch.play_notes)
|
||||
all_notes.bars.extend(branch.bars)
|
||||
if branch_e:
|
||||
for branch in branch_e:
|
||||
all_notes.play_notes.extend(branch.play_notes)
|
||||
all_notes.bars.extend(branch.bars)
|
||||
if branch_n:
|
||||
for branch in branch_n:
|
||||
all_notes.play_notes.extend(branch.play_notes)
|
||||
all_notes.bars.extend(branch.bars)
|
||||
all_notes.bars.extend(diff_notes.bars)
|
||||
except Exception as e:
|
||||
print(f"Failed to parse TJA {tja_path}: {e}")
|
||||
@@ -230,9 +242,27 @@ def process_tja_file(tja_file):
|
||||
tja = TJAParser(tja_file)
|
||||
all_notes = NoteList()
|
||||
for diff in tja.metadata.course_data:
|
||||
notes, _, _, _ = TJAParser.notes_to_position(TJAParser(tja.file_path), diff)
|
||||
notes, branch_m, branch_e, branch_n = TJAParser.notes_to_position(TJAParser(tja.file_path), diff)
|
||||
all_notes.play_notes.extend(notes.play_notes)
|
||||
if branch_m:
|
||||
for branch in branch_m:
|
||||
all_notes.play_notes.extend(branch.play_notes)
|
||||
if branch_e:
|
||||
for branch in branch_e:
|
||||
all_notes.play_notes.extend(branch.play_notes)
|
||||
if branch_n:
|
||||
for branch in branch_n:
|
||||
all_notes.play_notes.extend(branch.play_notes)
|
||||
all_notes.bars.extend(notes.bars)
|
||||
if branch_m:
|
||||
for branch in branch_m:
|
||||
all_notes.bars.extend(branch.bars)
|
||||
if branch_e:
|
||||
for branch in branch_e:
|
||||
all_notes.bars.extend(branch.bars)
|
||||
if branch_n:
|
||||
for branch in branch_n:
|
||||
all_notes.bars.extend(branch.bars)
|
||||
if all_notes == []:
|
||||
return ''
|
||||
hash = tja.hash_note_data(all_notes)
|
||||
|
||||
@@ -8,7 +8,7 @@ from functools import lru_cache
|
||||
from pathlib import Path
|
||||
|
||||
from libs.global_data import Modifiers
|
||||
from libs.utils import get_pixels_per_frame, global_data, strip_comments
|
||||
from libs.utils import get_pixels_per_frame, strip_comments
|
||||
|
||||
|
||||
@lru_cache(maxsize=64)
|
||||
|
||||
Reference in New Issue
Block a user