add lyric support

This commit is contained in:
Anthony Samms
2025-11-13 15:59:12 -05:00
parent 5d65f721ad
commit d0cdb7b866
2 changed files with 5 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ class Note:
moji: int = field(init=False) moji: int = field(init=False)
is_branch_start: bool = field(init=False) is_branch_start: bool = field(init=False)
branch_params: str = field(init=False) branch_params: str = field(init=False)
lyric: str = field(init=False)
def __lt__(self, other): def __lt__(self, other):
return self.hit_ms < other.hit_ms return self.hit_ms < other.hit_ms
@@ -630,6 +631,7 @@ class TJAParser:
prev_note = None prev_note = None
is_section_start = False is_section_start = False
section_bar = None section_bar = None
lyric = ""
for bar in notes: for bar in notes:
#Length of the bar is determined by number of notes excluding commands #Length of the bar is determined by number of notes excluding commands
bar_length = sum(len(part) for part in bar if '#' not in part) bar_length = sum(len(part) for part in bar if '#' not in part)
@@ -736,6 +738,7 @@ class TJAParser:
is_branching = True is_branching = True
continue continue
if '#LYRIC' in part: if '#LYRIC' in part:
lyric = part[6:]
continue continue
if '#JPOSSCROLL' in part: if '#JPOSSCROLL' in part:
continue continue
@@ -839,6 +842,7 @@ class TJAParser:
note.bpm = bpm note.bpm = bpm
note.gogo_time = gogo_time note.gogo_time = gogo_time
note.moji = -1 note.moji = -1
note.lyric = lyric
if item in {'5', '6'}: if item in {'5', '6'}:
note = Drumroll(note) note = Drumroll(note)
note.color = 255 note.color = 255

View File

@@ -1057,6 +1057,7 @@ class Player:
if note.display: if note.display:
tex.draw_texture('notes', str(note.type), frame=current_eighth % 2, x=x_position, y=y_position+192+(self.is_2p*176), center=True) tex.draw_texture('notes', str(note.type), frame=current_eighth % 2, x=x_position, y=y_position+192+(self.is_2p*176), center=True)
tex.draw_texture('notes', 'moji', frame=note.moji, x=x_position - (168//2) + 64, y=323 + y_position+(self.is_2p*176)) tex.draw_texture('notes', 'moji', frame=note.moji, x=x_position - (168//2) + 64, y=323 + y_position+(self.is_2p*176))
ray.draw_text(self.current_notes_draw[0].lyric, SCREEN_WIDTH//2 - (ray.measure_text(self.current_notes_draw[0].lyric, 40)//2), SCREEN_HEIGHT - 50, 40, ray.BLUE)
def draw_modifiers(self): def draw_modifiers(self):