mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 03:30:13 +01:00
minor bug fixes
This commit is contained in:
@@ -33,6 +33,7 @@ class BaseAnimation():
|
||||
self.is_finished = False
|
||||
self.attribute = 0
|
||||
self.is_started = False
|
||||
self.unlocked = False
|
||||
self.loop = loop
|
||||
self.lock_input = lock_input
|
||||
|
||||
@@ -46,15 +47,17 @@ class BaseAnimation():
|
||||
"""Update the animation based on the current time."""
|
||||
if self.loop and self.is_finished:
|
||||
self.restart()
|
||||
if self.lock_input and self.is_finished:
|
||||
global_data.input_locked = False
|
||||
if self.lock_input and self.is_finished and not self.unlocked:
|
||||
self.unlocked = True
|
||||
global_data.input_locked -= 1
|
||||
|
||||
def restart(self) -> None:
|
||||
self.start_ms = get_current_ms()
|
||||
self.is_finished = False
|
||||
self.delay = self.delay_saved
|
||||
self.unlocked = False
|
||||
if self.lock_input:
|
||||
global_data.input_locked = True
|
||||
global_data.input_locked += 1
|
||||
|
||||
def start(self) -> None:
|
||||
self.is_started = True
|
||||
@@ -63,12 +66,12 @@ class BaseAnimation():
|
||||
def pause(self):
|
||||
self.is_started = False
|
||||
if self.lock_input:
|
||||
global_data.input_locked = False
|
||||
global_data.input_locked -= 1
|
||||
|
||||
def unpause(self):
|
||||
self.is_started = True
|
||||
if self.lock_input:
|
||||
global_data.input_locked = True
|
||||
global_data.input_locked += 1
|
||||
|
||||
def reset(self):
|
||||
self.restart()
|
||||
|
||||
@@ -20,7 +20,7 @@ class GlobalData:
|
||||
total_songs: int = 0
|
||||
hit_sound: int = 0
|
||||
player_num: int = 1
|
||||
input_locked: bool = False
|
||||
input_locked: int = 0
|
||||
modifiers: Modifiers = field(default_factory=lambda: Modifiers())
|
||||
|
||||
global_data = GlobalData()
|
||||
|
||||
Reference in New Issue
Block a user