mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 03:30:13 +01:00
minor bug fix
This commit is contained in:
12
libs/tja.py
12
libs/tja.py
@@ -7,6 +7,7 @@ from dataclasses import dataclass, field, fields
|
||||
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
|
||||
|
||||
|
||||
@@ -818,7 +819,6 @@ class TJAParser:
|
||||
bisect.insort(curr_draw_list, note, key=lambda x: x.load_ms)
|
||||
self.get_moji(curr_note_list, ms_per_measure)
|
||||
index += 1
|
||||
# https://stackoverflow.com/questions/72899/how-to-sort-a-list-of-dictionaries-by-a-value-of-the-dictionary-in-python
|
||||
# Sorting by load_ms is necessary for drawing, as some notes appear on the
|
||||
# screen slower regardless of when they reach the judge circle
|
||||
# Bars can be sorted like this because they don't need hit detection
|
||||
@@ -887,12 +887,12 @@ def modifier_random(notes: NoteList, value: int):
|
||||
modded_notes[i].type = type_mapping[modded_notes[i].type]
|
||||
return modded_notes
|
||||
|
||||
def apply_modifiers(notes: NoteList):
|
||||
def apply_modifiers(notes: NoteList, modifiers: Modifiers):
|
||||
"""Applies all selected modifiers from global_data to the given NoteList."""
|
||||
if global_data.modifiers.display:
|
||||
if modifiers.display:
|
||||
draw_notes = modifier_display(notes)
|
||||
if global_data.modifiers.inverse:
|
||||
if modifiers.inverse:
|
||||
play_notes = modifier_inverse(notes)
|
||||
play_notes = modifier_random(notes, global_data.modifiers.random)
|
||||
draw_notes, bars = modifier_speed(notes, global_data.modifiers.speed)
|
||||
play_notes = modifier_random(notes, modifiers.random)
|
||||
draw_notes, bars = modifier_speed(notes, modifiers.speed)
|
||||
return deque(play_notes), deque(draw_notes), deque(bars)
|
||||
|
||||
@@ -96,7 +96,7 @@ def is_l_don_pressed() -> bool:
|
||||
"""Check if the left don button is pressed"""
|
||||
if global_data.input_locked:
|
||||
return False
|
||||
keys = global_data.config["keys"]["left_don"]
|
||||
keys = global_data.config["keys_1p"]["left_don"]
|
||||
gamepad_buttons = global_data.config["gamepad"]["left_don"]
|
||||
for key in keys:
|
||||
if ray.is_key_pressed(ord(key)):
|
||||
@@ -121,7 +121,7 @@ def is_r_don_pressed() -> bool:
|
||||
"""Check if the right don button is pressed"""
|
||||
if global_data.input_locked:
|
||||
return False
|
||||
keys = global_data.config["keys"]["right_don"]
|
||||
keys = global_data.config["keys_1p"]["right_don"]
|
||||
gamepad_buttons = global_data.config["gamepad"]["right_don"]
|
||||
for key in keys:
|
||||
if ray.is_key_pressed(ord(key)):
|
||||
@@ -148,7 +148,7 @@ def is_l_kat_pressed() -> bool:
|
||||
"""Check if the left kat button is pressed"""
|
||||
if global_data.input_locked:
|
||||
return False
|
||||
keys = global_data.config["keys"]["left_kat"]
|
||||
keys = global_data.config["keys_1p"]["left_kat"]
|
||||
gamepad_buttons = global_data.config["gamepad"]["left_kat"]
|
||||
for key in keys:
|
||||
if ray.is_key_pressed(ord(key)):
|
||||
@@ -175,7 +175,7 @@ def is_r_kat_pressed() -> bool:
|
||||
"""Check if the right kat button is pressed"""
|
||||
if global_data.input_locked:
|
||||
return False
|
||||
keys = global_data.config["keys"]["right_kat"]
|
||||
keys = global_data.config["keys_1p"]["right_kat"]
|
||||
gamepad_buttons = global_data.config["gamepad"]["right_kat"]
|
||||
for key in keys:
|
||||
if ray.is_key_pressed(ord(key)):
|
||||
|
||||
Reference in New Issue
Block a user