update paths to pathlib for linux/mac support

This commit is contained in:
Yonokid
2025-04-26 02:09:18 -04:00
parent 3f0b538e2e
commit 2eb39610de
8 changed files with 47 additions and 29 deletions

View File

@@ -1,6 +1,7 @@
import bisect
import math
from collections import deque
from pathlib import Path
import pyray as ray
@@ -139,11 +140,11 @@ class GameScreen:
self.result_transition_2 = load_texture_from_zip('Graphics\\lumendata\\enso_result.zip', 'retry_game_img00126.png')
def load_sounds(self):
self.sound_don = audio.load_sound('Sounds\\inst_00_don.wav')
self.sound_kat = audio.load_sound('Sounds\\inst_00_katsu.wav')
self.sound_balloon_pop = audio.load_sound('Sounds\\balloon_pop.wav')
self.sound_result_transition = audio.load_sound('Sounds\\result\\VO_RESULT [1].ogg')
sounds_dir = Path("Sounds")
self.sound_don = audio.load_sound(str(sounds_dir / "inst_00_don.wav"))
self.sound_kat = audio.load_sound(str(sounds_dir / "inst_00_katsu.wav"))
self.sound_balloon_pop = audio.load_sound(str(sounds_dir / "balloon_pop.wav"))
self.sound_result_transition = audio.load_sound(str(sounds_dir / "result" / "VO_RESULT [1].ogg"))
def init_tja(self, song: str, difficulty: int):
self.load_textures()
@@ -170,7 +171,7 @@ class GameScreen:
global_data.song_title = self.tja.title
self.player_1 = Player(self, 1, difficulty, get_config()["general"]["judge_offset"])
self.song_music = audio.load_sound(self.tja.wave)
self.song_music = audio.load_sound(str(Path(self.tja.wave)))
self.start_ms = (get_current_ms() - self.tja.offset*1000) + self.start_delay
audio.play_sound(self.song_music)
@@ -618,7 +619,7 @@ class Player:
self.draw_balloon(game_screen, note, position, i)
else:
self.draw_note(game_screen, note_type, position, 255, note['se_note'])
ray.draw_text(str(i), position+64, 192, 25, ray.GREEN)
#ray.draw_text(str(i), position+64, 192, 25, ray.GREEN)
def draw_gauge(self, game_screen: GameScreen):
ray.draw_texture(game_screen.textures['gage_don_1p_hard'][0], 327, 128, ray.WHITE)

View File

@@ -1,3 +1,5 @@
from pathlib import Path
import pyray as ray
from libs.animation import Animation
@@ -21,8 +23,10 @@ class ResultScreen:
def __init__(self, width: int, height: int):
self.width = width
self.height = height
self.sound_don = audio.load_sound('Sounds\\inst_00_don.wav')
self.bgm = audio.load_sound('Sounds\\result\\JINGLE_SEISEKI [1].ogg')
sounds_dir = Path("Sounds")
self.sound_don = audio.load_sound(str(sounds_dir / "inst_00_don.wav"))
self.sound_kat = audio.load_sound(str(sounds_dir / "inst_00_katsu.wav"))
self.bgm = audio.load_sound(str(sounds_dir / "result" / "JINGLE_SEISEKI [1].ogg"))
zip_file = 'Graphics\\lumendata\\enso_result.zip'
self.textures = load_all_textures_from_zip(zip_file)

View File

@@ -1,4 +1,5 @@
import os
from pathlib import Path
import pyray as ray
@@ -17,8 +18,9 @@ class SongSelectScreen:
self.selected_song = 0
self.selected_difficulty = 0
self.selected_index = 0
self.sound_don = audio.load_sound('Sounds\\inst_00_don.wav')
self.sound_kat = audio.load_sound('Sounds\\inst_00_katsu.wav')
sounds_dir = Path("Sounds")
self.sound_don = audio.load_sound(str(sounds_dir / "inst_00_don.wav"))
self.sound_kat = audio.load_sound(str(sounds_dir / "inst_00_katsu.wav"))
for dirpath, dirnames, filenames in os.walk(f'{get_config()["paths"]["tja_path"]}'):
for filename in filenames:
if filename.endswith(".tja"):

View File

@@ -36,10 +36,13 @@ class TitleScreen:
def load_textures(self):
self.textures = load_all_textures_from_zip('Graphics\\lumendata\\attract\\keikoku.zip')
self.sound_bachi_swipe = audio.load_sound('Sounds\\title\\SE_ATTRACT_2.ogg')
self.sound_bachi_hit = audio.load_sound('Sounds\\title\\SE_ATTRACT_3.ogg')
self.sound_warning_message = audio.load_sound('Sounds\\title\\VO_ATTRACT_3.ogg')
self.sound_warning_error = audio.load_sound('Sounds\\title\\SE_ATTRACT_1.ogg')
sounds_dir = Path("Sounds")
title_dir = sounds_dir / "title"
self.sound_bachi_swipe = audio.load_sound(str(title_dir / "SE_ATTRACT_2.ogg"))
self.sound_bachi_hit = audio.load_sound(str(title_dir / "SE_ATTRACT_3.ogg"))
self.sound_warning_message = audio.load_sound(str(title_dir / "VO_ATTRACT_3.ogg"))
self.sound_warning_error = audio.load_sound(str(title_dir / "SE_ATTRACT_1.ogg"))
self.texture_black = load_texture_from_zip('Graphics\\lumendata\\attract\\movie.zip', 'movie_img00000.png')