mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 19:50:12 +01:00
minor fixes
This commit is contained in:
@@ -13,7 +13,6 @@ from libs import song_hash
|
|||||||
from libs.audio import audio
|
from libs.audio import audio
|
||||||
from libs.utils import (
|
from libs.utils import (
|
||||||
get_config,
|
get_config,
|
||||||
get_current_ms,
|
|
||||||
global_data,
|
global_data,
|
||||||
load_all_textures_from_zip,
|
load_all_textures_from_zip,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import sys
|
|||||||
import time
|
import time
|
||||||
from collections import deque
|
from collections import deque
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
from git import Repo
|
from git import Repo
|
||||||
|
|
||||||
@@ -12,11 +11,7 @@ from libs.tja import TJAParser
|
|||||||
from libs.utils import get_config, global_data
|
from libs.utils import get_config, global_data
|
||||||
|
|
||||||
|
|
||||||
class DiffHashesDecoder(json.JSONDecoder):
|
def diff_hashes_object_hook(obj):
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
super().__init__(object_hook=self.object_hook, *args, **kwargs)
|
|
||||||
|
|
||||||
def object_hook(self, obj):
|
|
||||||
if "diff_hashes" in obj:
|
if "diff_hashes" in obj:
|
||||||
obj["diff_hashes"] = {
|
obj["diff_hashes"] = {
|
||||||
int(key): value
|
int(key): value
|
||||||
@@ -24,6 +19,10 @@ class DiffHashesDecoder(json.JSONDecoder):
|
|||||||
}
|
}
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
class DiffHashesDecoder(json.JSONDecoder):
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(object_hook=diff_hashes_object_hook, *args, **kwargs)
|
||||||
|
|
||||||
def build_song_hashes(output_dir=Path("cache")):
|
def build_song_hashes(output_dir=Path("cache")):
|
||||||
song_hashes: dict[str, list[dict]] = dict()
|
song_hashes: dict[str, list[dict]] = dict()
|
||||||
path_to_hash: dict[str, str] = dict() # New index for O(1) path lookups
|
path_to_hash: dict[str, str] = dict() # New index for O(1) path lookups
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ class GameScreen:
|
|||||||
for zip in self.textures:
|
for zip in self.textures:
|
||||||
for texture in self.textures[zip]:
|
for texture in self.textures[zip]:
|
||||||
ray.unload_texture(texture)
|
ray.unload_texture(texture)
|
||||||
|
if self.song_music is not None:
|
||||||
audio.unload_sound(self.song_music)
|
audio.unload_sound(self.song_music)
|
||||||
del self.song_music
|
del self.song_music
|
||||||
self.song_started = False
|
self.song_started = False
|
||||||
|
|||||||
Reference in New Issue
Block a user