mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
squashed remaining bugs
This commit is contained in:
@@ -8,6 +8,7 @@ class Nameplate:
|
|||||||
def __init__(self, name: str, title: str, player_num: int, dan: int, is_gold: bool):
|
def __init__(self, name: str, title: str, player_num: int, dan: int, is_gold: bool):
|
||||||
self.name = OutlinedText(name, 22, ray.WHITE, ray.BLACK, outline_thickness=3.0)
|
self.name = OutlinedText(name, 22, ray.WHITE, ray.BLACK, outline_thickness=3.0)
|
||||||
self.title = OutlinedText(title, 20, ray.BLACK, ray.WHITE, outline_thickness=0)
|
self.title = OutlinedText(title, 20, ray.BLACK, ray.WHITE, outline_thickness=0)
|
||||||
|
print(self.name.texture.width)
|
||||||
self.dan_index = dan
|
self.dan_index = dan
|
||||||
self.player_num = player_num
|
self.player_num = player_num
|
||||||
self.is_gold = is_gold
|
self.is_gold = is_gold
|
||||||
@@ -39,9 +40,9 @@ class Nameplate:
|
|||||||
if self.player_num != -1:
|
if self.player_num != -1:
|
||||||
tex.draw_texture('nameplate', f'{self.player_num}p', x=x, y=y, fade=fade)
|
tex.draw_texture('nameplate', f'{self.player_num}p', x=x, y=y, fade=fade)
|
||||||
|
|
||||||
dest = ray.Rectangle(x+136 - (self.name.texture.width//2) + offset, y+24, self.name.texture.width, self.name.texture.height)
|
dest = ray.Rectangle(x+136 - (min(255 - offset*4, self.name.texture.width)//2) + offset, y+24, min(255 - offset*4, self.name.texture.width), self.name.texture.height)
|
||||||
self.name.draw(self.name.default_src, dest, ray.Vector2(0, 0), 0, ray.fade(ray.WHITE, fade))
|
self.name.draw(self.name.default_src, dest, ray.Vector2(0, 0), 0, ray.fade(ray.WHITE, fade))
|
||||||
dest = ray.Rectangle(x+136 - (self.title.texture.width//2) + title_offset, y-3, self.title.texture.width, self.title.texture.height)
|
dest = ray.Rectangle(x+136 - (min(255 - offset*2, self.title.texture.width)//2) + title_offset, y-3, min(255 - offset*2, self.title.texture.width), self.title.texture.height)
|
||||||
self.title.draw(self.title.default_src, dest, ray.Vector2(0, 0), 0, ray.fade(ray.WHITE, fade))
|
self.title.draw(self.title.default_src, dest, ray.Vector2(0, 0), 0, ray.fade(ray.WHITE, fade))
|
||||||
|
|
||||||
class Indicator:
|
class Indicator:
|
||||||
|
|||||||
17
libs/tja.py
17
libs/tja.py
@@ -427,11 +427,16 @@ class TJAParser:
|
|||||||
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)
|
||||||
barline_added = False
|
barline_added = False
|
||||||
for part in bar:
|
for part in bar:
|
||||||
if '#LYRIC' in part:
|
|
||||||
continue
|
|
||||||
if part.startswith('#BRANCHSTART'):
|
if part.startswith('#BRANCHSTART'):
|
||||||
skip_branch = True
|
skip_branch = True
|
||||||
continue
|
continue
|
||||||
|
if part == '#M':
|
||||||
|
skip_branch = False
|
||||||
|
continue
|
||||||
|
if skip_branch:
|
||||||
|
continue
|
||||||
|
if '#LYRIC' in part:
|
||||||
|
continue
|
||||||
if '#JPOSSCROLL' in part:
|
if '#JPOSSCROLL' in part:
|
||||||
continue
|
continue
|
||||||
elif '#NMSCROLL' in part:
|
elif '#NMSCROLL' in part:
|
||||||
@@ -525,14 +530,9 @@ class TJAParser:
|
|||||||
elif '#GOGOEND' in part:
|
elif '#GOGOEND' in part:
|
||||||
gogo_time = False
|
gogo_time = False
|
||||||
continue
|
continue
|
||||||
elif part.startswith('#M'):
|
|
||||||
skip_branch = False
|
|
||||||
continue
|
|
||||||
#Unrecognized commands will be skipped for now
|
#Unrecognized commands will be skipped for now
|
||||||
elif len(part) > 0 and not part[0].isdigit():
|
elif len(part) > 0 and not part[0].isdigit():
|
||||||
continue
|
continue
|
||||||
if skip_branch:
|
|
||||||
continue
|
|
||||||
|
|
||||||
ms_per_measure = get_ms_per_measure(bpm, time_signature)
|
ms_per_measure = get_ms_per_measure(bpm, time_signature)
|
||||||
|
|
||||||
@@ -571,6 +571,9 @@ class TJAParser:
|
|||||||
if item == '0' or (not item.isdigit()):
|
if item == '0' or (not item.isdigit()):
|
||||||
self.current_ms += increment
|
self.current_ms += increment
|
||||||
continue
|
continue
|
||||||
|
if item == '9' and play_note_list and play_note_list[-1].type == 9:
|
||||||
|
self.current_ms += increment
|
||||||
|
continue
|
||||||
note = Note()
|
note = Note()
|
||||||
note.hit_ms = self.current_ms
|
note.hit_ms = self.current_ms
|
||||||
note.display = True
|
note.display = True
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ class ResultScreen:
|
|||||||
|
|
||||||
self.fade_out.update(current_time)
|
self.fade_out.update(current_time)
|
||||||
if self.fade_out.is_finished:
|
if self.fade_out.is_finished:
|
||||||
|
self.fade_out.update(current_time)
|
||||||
return self.on_screen_end()
|
return self.on_screen_end()
|
||||||
|
|
||||||
if self.crown is not None:
|
if self.crown is not None:
|
||||||
|
|||||||
@@ -2203,6 +2203,8 @@ class FileNavigator:
|
|||||||
return False
|
return False
|
||||||
favorites_path = self.favorite_folder.path / 'song_list.txt'
|
favorites_path = self.favorite_folder.path / 'song_list.txt'
|
||||||
lines = []
|
lines = []
|
||||||
|
if not Path(favorites_path).exists():
|
||||||
|
Path(favorites_path).touch()
|
||||||
with open(favorites_path, 'r', encoding='utf-8-sig') as song_list:
|
with open(favorites_path, 'r', encoding='utf-8-sig') as song_list:
|
||||||
for line in song_list:
|
for line in song_list:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
|||||||
Reference in New Issue
Block a user