Fix the dreaded font reloading bug

This commit is contained in:
Anthony Samms
2025-11-25 00:57:00 -05:00
parent 600307f1c1
commit 78c4f5af95
4 changed files with 43 additions and 1 deletions

View File

@@ -3,6 +3,8 @@ from enum import IntEnum
from pathlib import Path
from typing import Any
import pyray as ray
from libs.config import Config
class PlayerNum(IntEnum):
@@ -137,6 +139,8 @@ class GlobalData:
session_data (list[SessionData]): Session data for both players.
"""
songs_played: int = 0
font: ray.Font = ray.get_font_default()
font_codepoints = set()
config: Config = field(default_factory=dict)
song_hashes: dict[str, list[dict]] = field(default_factory=lambda: dict()) #Hash to path
song_paths: dict[Path, str] = field(default_factory=lambda: dict()) #path to hash