mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
add genre below song name
This commit is contained in:
@@ -209,6 +209,7 @@ class Modifiers:
|
|||||||
class SessionData:
|
class SessionData:
|
||||||
selected_difficulty: int = 0
|
selected_difficulty: int = 0
|
||||||
song_title: str = ''
|
song_title: str = ''
|
||||||
|
genre_index: int = 0
|
||||||
result_score: int = 0
|
result_score: int = 0
|
||||||
result_good: int = 0
|
result_good: int = 0
|
||||||
result_ok: int = 0
|
result_ok: int = 0
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class GameScreen:
|
|||||||
ray.set_shader_value_texture(self.mask_shader, ray.get_shader_location(self.mask_shader, "texture1"), tex.textures['balloon']['rainbow'].texture)
|
ray.set_shader_value_texture(self.mask_shader, ray.get_shader_location(self.mask_shader, "texture1"), tex.textures['balloon']['rainbow'].texture)
|
||||||
self.load_sounds()
|
self.load_sounds()
|
||||||
self.init_tja(global_data.selected_song, session_data.selected_difficulty)
|
self.init_tja(global_data.selected_song, session_data.selected_difficulty)
|
||||||
self.song_info = SongInfo(session_data.song_title, 'TEST')
|
self.song_info = SongInfo(session_data.song_title, session_data.genre_index)
|
||||||
self.result_transition = ResultTransition(global_data.player_num)
|
self.result_transition = ResultTransition(global_data.player_num)
|
||||||
self.bpm = 120
|
self.bpm = 120
|
||||||
if self.tja is not None:
|
if self.tja is not None:
|
||||||
@@ -1281,7 +1281,7 @@ class ScoreCounterAnimation:
|
|||||||
tex.draw_texture('lane', 'score_number', frame=int(counter[i]), x=start_x + (i * margin), y=y, color=self.color)
|
tex.draw_texture('lane', 'score_number', frame=int(counter[i]), x=start_x + (i * margin), y=y, color=self.color)
|
||||||
|
|
||||||
class SongInfo:
|
class SongInfo:
|
||||||
def __init__(self, song_name: str, genre: str):
|
def __init__(self, song_name: str, genre: int):
|
||||||
self.song_name = song_name
|
self.song_name = song_name
|
||||||
self.genre = genre
|
self.genre = genre
|
||||||
self.song_title = OutlinedText(song_name, 40, ray.WHITE, ray.BLACK, outline_thickness=5)
|
self.song_title = OutlinedText(song_name, 40, ray.WHITE, ray.BLACK, outline_thickness=5)
|
||||||
@@ -1298,6 +1298,8 @@ class SongInfo:
|
|||||||
dest = ray.Rectangle(text_x, text_y, self.song_title.texture.width, self.song_title.texture.height)
|
dest = ray.Rectangle(text_x, text_y, self.song_title.texture.width, self.song_title.texture.height)
|
||||||
self.song_title.draw(self.song_title.default_src, dest, ray.Vector2(0, 0), 0, ray.fade(ray.WHITE, 1 - self.fade.attribute))
|
self.song_title.draw(self.song_title.default_src, dest, ray.Vector2(0, 0), 0, ray.fade(ray.WHITE, 1 - self.fade.attribute))
|
||||||
|
|
||||||
|
tex.draw_texture('song_info', 'genre', fade=1 - self.fade.attribute, frame=self.genre)
|
||||||
|
|
||||||
class ResultTransition:
|
class ResultTransition:
|
||||||
def __init__(self, player_num: int):
|
def __init__(self, player_num: int):
|
||||||
self.player_num = player_num
|
self.player_num = player_num
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ class SongSelectScreen:
|
|||||||
if self.navigator.items != []:
|
if self.navigator.items != []:
|
||||||
global_data.selected_song = self.navigator.get_current_item().path
|
global_data.selected_song = self.navigator.get_current_item().path
|
||||||
session_data.selected_difficulty = self.selected_difficulty
|
session_data.selected_difficulty = self.selected_difficulty
|
||||||
|
session_data.genre_index = self.navigator.get_current_item().box.texture_index
|
||||||
self.reset_demo_music()
|
self.reset_demo_music()
|
||||||
self.navigator.reset_items()
|
self.navigator.reset_items()
|
||||||
audio.unload_all_sounds()
|
audio.unload_all_sounds()
|
||||||
@@ -494,11 +495,11 @@ class SongSelectScreen:
|
|||||||
if self.modifier_selector is not None:
|
if self.modifier_selector is not None:
|
||||||
self.modifier_selector.draw()
|
self.modifier_selector.draw()
|
||||||
|
|
||||||
|
self.indicator.draw(410, 575)
|
||||||
|
|
||||||
if self.game_transition is not None:
|
if self.game_transition is not None:
|
||||||
self.game_transition.draw()
|
self.game_transition.draw()
|
||||||
|
|
||||||
self.indicator.draw(410, 575)
|
|
||||||
|
|
||||||
def draw_3d(self):
|
def draw_3d(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user