mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 19:50:12 +01:00
Merge pull request #168 from splitlane/main
Fix delay for NMSCROLL, now it is the same as before
This commit is contained in:
29
libs/tja.py
29
libs/tja.py
@@ -809,12 +809,6 @@ class TJAParser:
|
|||||||
delay_current = 0
|
delay_current = 0
|
||||||
delay_last_note_ms = self.current_ms
|
delay_last_note_ms = self.current_ms
|
||||||
|
|
||||||
def add_delay_bar(hit_ms: float, delay: float):
|
|
||||||
delay_timeline = TimelineObject()
|
|
||||||
delay_timeline.hit_ms = hit_ms
|
|
||||||
delay_timeline.delay = delay
|
|
||||||
bisect.insort(curr_timeline, delay_timeline, key=lambda x: x.hit_ms)
|
|
||||||
|
|
||||||
for bar in notes:
|
for bar in notes:
|
||||||
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
|
||||||
@@ -1281,14 +1275,17 @@ class TJAParser:
|
|||||||
continue
|
continue
|
||||||
elif part.startswith("#DELAY"):
|
elif part.startswith("#DELAY"):
|
||||||
delay_ms = float(part[6:]) * 1000
|
delay_ms = float(part[6:]) * 1000
|
||||||
if delay_ms <= 0:
|
if scroll_type == ScrollType.BMSCROLL or scroll_type == ScrollType.HBSCROLL:
|
||||||
# No changes if not positive
|
if delay_ms <= 0:
|
||||||
pass
|
# No changes if not positive
|
||||||
else:
|
pass
|
||||||
# Do not modify current_ms, it will be modified live
|
else:
|
||||||
delay_current += delay_ms
|
# Do not modify current_ms, it will be modified live
|
||||||
|
delay_current += delay_ms
|
||||||
|
|
||||||
# Delays will be combined between notes, and attached to previous note
|
# Delays will be combined between notes, and attached to previous note
|
||||||
|
else:
|
||||||
|
self.current_ms += delay_ms
|
||||||
continue
|
continue
|
||||||
elif part.startswith("#SUDDEN"):
|
elif part.startswith("#SUDDEN"):
|
||||||
parts = part.split()
|
parts = part.split()
|
||||||
@@ -1357,7 +1354,11 @@ class TJAParser:
|
|||||||
|
|
||||||
if delay_current != 0:
|
if delay_current != 0:
|
||||||
# logger.debug(delay_current)
|
# logger.debug(delay_current)
|
||||||
add_delay_bar(delay_last_note_ms, delay_current)
|
delay_timeline = TimelineObject()
|
||||||
|
delay_timeline.hit_ms = delay_last_note_ms
|
||||||
|
delay_timeline.delay = delay_current
|
||||||
|
bisect.insort(curr_timeline, delay_timeline, key=lambda x: x.hit_ms)
|
||||||
|
|
||||||
delay_current = 0
|
delay_current = 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user