mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 19:50:12 +01:00
add nameplates
This commit is contained in:
@@ -22,7 +22,7 @@ class DevScreen:
|
||||
return self.on_screen_end('GAME')
|
||||
|
||||
def draw(self):
|
||||
pass
|
||||
ray.draw_rectangle(0, 0, 1280, 720, ray.GREEN)
|
||||
|
||||
def draw_3d(self):
|
||||
pass
|
||||
|
||||
@@ -3,6 +3,7 @@ from pathlib import Path
|
||||
import pyray as ray
|
||||
|
||||
from libs.audio import audio
|
||||
from libs.global_objects import Nameplate
|
||||
from libs.texture import tex
|
||||
from libs.utils import (
|
||||
OutlinedText,
|
||||
@@ -39,6 +40,8 @@ class EntryScreen:
|
||||
self.side = 1
|
||||
self.box_manager = BoxManager()
|
||||
self.state = State.SELECT_SIDE
|
||||
plate_info = global_data.config['nameplate']
|
||||
self.nameplate = Nameplate(plate_info['name'], plate_info['title'], -1, -1, False)
|
||||
self.screen_init = True
|
||||
self.side_select_fade = tex.get_animation(0)
|
||||
self.bg_flicker = tex.get_animation(1)
|
||||
@@ -49,6 +52,7 @@ class EntryScreen:
|
||||
self.cloud_resize_loop = tex.get_animation(6)
|
||||
self.cloud_texture_change = tex.get_animation(7)
|
||||
self.cloud_fade = tex.get_animation(8)
|
||||
self.nameplate_fadein = tex.get_animation(12)
|
||||
self.side_select_fade.start()
|
||||
audio.play_sound(self.bgm)
|
||||
|
||||
@@ -56,6 +60,7 @@ class EntryScreen:
|
||||
self.screen_init = False
|
||||
global_data.player_num = round((self.side/3) + 1)
|
||||
audio.stop_sound(self.bgm)
|
||||
self.nameplate.unload()
|
||||
tex.unload_textures()
|
||||
audio.unload_all_sounds()
|
||||
return next_screen
|
||||
@@ -74,6 +79,10 @@ class EntryScreen:
|
||||
self.cloud_resize_loop.start()
|
||||
self.cloud_texture_change.start()
|
||||
self.cloud_fade.start()
|
||||
plate_info = global_data.config['nameplate']
|
||||
self.nameplate.unload()
|
||||
self.nameplate = Nameplate(plate_info['name'], plate_info['title'], round((self.side/3) + 1), plate_info['dan'], plate_info['gold'])
|
||||
self.nameplate_fadein.start()
|
||||
self.state = State.SELECT_MODE
|
||||
audio.play_sound(self.sound_don)
|
||||
if is_l_kat_pressed():
|
||||
@@ -105,6 +114,8 @@ class EntryScreen:
|
||||
self.cloud_fade.update(get_current_ms())
|
||||
self.cloud_resize_loop.update(get_current_ms())
|
||||
self.box_manager.update(get_current_ms())
|
||||
self.nameplate_fadein.update(get_current_ms())
|
||||
self.nameplate.update(get_current_ms())
|
||||
if self.box_manager.is_finished():
|
||||
return self.on_screen_end(self.box_manager.selected_box())
|
||||
return self.handle_input()
|
||||
@@ -152,6 +163,7 @@ class EntryScreen:
|
||||
tex.draw_texture('side_select', '2P_highlight', fade=fade)
|
||||
tex.draw_texture('side_select', '1P2P_outline', index=1, fade=fade)
|
||||
tex.draw_texture('side_select', 'cancel_text', fade=fade)
|
||||
self.nameplate.draw(500, 185)
|
||||
|
||||
def draw_player_drum(self):
|
||||
move_x = self.drum_move_3.attribute
|
||||
@@ -183,6 +195,12 @@ class EntryScreen:
|
||||
self.draw_mode_select()
|
||||
self.draw_footer()
|
||||
|
||||
if self.state == State.SELECT_MODE:
|
||||
if self.side == 0:
|
||||
self.nameplate.draw(30, 640, fade=self.nameplate_fadein.attribute)
|
||||
else:
|
||||
self.nameplate.draw(950, 640, fade=self.nameplate_fadein.attribute)
|
||||
|
||||
tex.draw_texture('global', 'player_entry')
|
||||
|
||||
if self.box_manager.is_finished():
|
||||
|
||||
@@ -10,6 +10,7 @@ import pyray as ray
|
||||
from libs.animation import Animation
|
||||
from libs.audio import audio
|
||||
from libs.backgrounds import Background
|
||||
from libs.global_objects import Nameplate
|
||||
from libs.texture import tex
|
||||
from libs.tja import (
|
||||
Balloon,
|
||||
@@ -246,6 +247,8 @@ class Player:
|
||||
self.base_score_list: list[ScoreCounterAnimation] = []
|
||||
self.combo_display = Combo(self.combo, get_current_ms())
|
||||
self.score_counter = ScoreCounter(self.score)
|
||||
plate_info = global_data.config['nameplate']
|
||||
self.nameplate = Nameplate(plate_info['name'], plate_info['title'], global_data.player_num, plate_info['dan'], plate_info['gold'])
|
||||
|
||||
self.input_log: dict[float, tuple] = dict()
|
||||
|
||||
@@ -573,7 +576,7 @@ class Player:
|
||||
self.score_counter.update(get_current_ms(), self.score)
|
||||
self.autoplay_manager(game_screen)
|
||||
self.handle_input(game_screen)
|
||||
|
||||
self.nameplate.update(get_current_ms())
|
||||
self.gauge.update(get_current_ms())
|
||||
|
||||
def draw_drumroll(self, game_screen: GameScreen, head: Drumroll, current_eighth: int):
|
||||
@@ -694,6 +697,7 @@ class Player:
|
||||
tex.draw_texture('lane', 'lane_score_cover')
|
||||
tex.draw_texture('lane', f'{self.player_number}p_icon')
|
||||
tex.draw_texture('lane', 'lane_difficulty', frame=self.difficulty)
|
||||
self.nameplate.draw(-62, 285)
|
||||
self.draw_modifiers()
|
||||
if self.drumroll_counter is not None:
|
||||
self.drumroll_counter.draw()
|
||||
|
||||
@@ -5,6 +5,7 @@ from raylib import SHADER_UNIFORM_FLOAT
|
||||
|
||||
from libs import utils
|
||||
from libs.audio import audio
|
||||
from libs.global_objects import Nameplate
|
||||
from libs.texture import tex
|
||||
from libs.utils import (
|
||||
OutlinedText,
|
||||
@@ -54,6 +55,8 @@ class ResultScreen:
|
||||
self.crown = None
|
||||
self.state = None
|
||||
self.high_score_indicator = None
|
||||
plate_info = global_data.config['nameplate']
|
||||
self.nameplate = Nameplate(plate_info['name'], plate_info['title'], global_data.player_num, plate_info['dan'], plate_info['gold'])
|
||||
self.score_animator = ScoreAnimator(session_data.result_score)
|
||||
self.score = ''
|
||||
self.good = ''
|
||||
@@ -162,6 +165,8 @@ class ResultScreen:
|
||||
if self.crown is not None:
|
||||
self.crown.update(get_current_ms())
|
||||
|
||||
self.nameplate.update(get_current_ms())
|
||||
|
||||
def draw_score_info(self):
|
||||
if self.good:
|
||||
for i in range(len(str(self.good))):
|
||||
@@ -246,6 +251,8 @@ class ResultScreen:
|
||||
if self.crown is not None:
|
||||
self.crown.draw(self.crown_type)
|
||||
|
||||
self.nameplate.draw(265, 80)
|
||||
|
||||
self.draw_modifiers()
|
||||
|
||||
if self.high_score_indicator is not None:
|
||||
|
||||
@@ -9,6 +9,7 @@ import pyray as ray
|
||||
|
||||
from libs.animation import Animation, MoveAnimation
|
||||
from libs.audio import audio
|
||||
from libs.global_objects import Nameplate
|
||||
from libs.texture import tex
|
||||
from libs.tja import TJAParser, test_encodings
|
||||
from libs.transition import Transition
|
||||
@@ -80,6 +81,8 @@ class SongSelectScreen:
|
||||
self.is_ura = False
|
||||
self.screen_init = True
|
||||
self.ura_switch_animation = UraSwitchAnimation()
|
||||
plate_info = global_data.config['nameplate']
|
||||
self.nameplate = self.nameplate = Nameplate(plate_info['name'], plate_info['title'], global_data.player_num, plate_info['dan'], plate_info['gold'])
|
||||
|
||||
if self.navigator.items == []:
|
||||
return self.on_screen_end("ENTRY")
|
||||
@@ -101,6 +104,7 @@ class SongSelectScreen:
|
||||
self.navigator.reset_items()
|
||||
audio.unload_all_sounds()
|
||||
tex.unload_textures()
|
||||
self.nameplate.unload()
|
||||
return next_screen
|
||||
|
||||
def reset_demo_music(self):
|
||||
@@ -355,6 +359,7 @@ class SongSelectScreen:
|
||||
self.ura_switch_animation.update(get_current_ms())
|
||||
self.diff_selector_move_1.update(get_current_ms())
|
||||
self.diff_selector_move_2.update(get_current_ms())
|
||||
self.nameplate.update(get_current_ms())
|
||||
|
||||
if self.text_fade_out.is_finished:
|
||||
self.selected_song = True
|
||||
@@ -461,6 +466,11 @@ class SongSelectScreen:
|
||||
|
||||
tex.draw_texture('global', 'footer')
|
||||
|
||||
if self.nameplate.player_num == 1:
|
||||
self.nameplate.draw(30, 640)
|
||||
else:
|
||||
self.nameplate.draw(950, 640)
|
||||
|
||||
self.ura_switch_animation.draw()
|
||||
|
||||
if self.state == State.BROWSING and self.navigator.items != []:
|
||||
|
||||
Reference in New Issue
Block a user