finish song select

This commit is contained in:
Yonokid
2025-05-15 20:06:07 -04:00
parent 36b0bbd0dd
commit a846b0d5a0
6 changed files with 265 additions and 121 deletions

View File

@@ -2,6 +2,7 @@ import hashlib
import math
from collections import deque
from dataclasses import dataclass, field, fields
import os
from pathlib import Path
from libs.utils import get_pixels_per_frame, strip_comments
@@ -63,7 +64,10 @@ class TJAParser:
#Defined on startup
self.folder_path = Path(path)
self.folder_name = self.folder_path.name
self.file_path = self.folder_path / f"{self.folder_name}.tja"
for _, _, files in os.walk(self.folder_path):
for file in files:
if file.endswith('tja'):
self.file_path = self.folder_path / f'{file}'
#Defined on file_to_data()
self.data = []

View File

@@ -102,7 +102,6 @@ def draw_scaled_texture(texture: ray.Texture, x: int, y: int, scale: float, colo
@dataclass
class SessionData:
selected_song: str = '' #Path
selected_difficulty: int = 0
song_title: str = ''
result_score: int = 0
@@ -120,6 +119,7 @@ def reset_session():
@dataclass
class GlobalData:
selected_song: str = '' #Path
textures: dict[str, list[ray.Texture]] = field(default_factory=lambda: dict())
songs_played: int = 0