mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
add indicator
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import pyray as ray
|
||||
|
||||
from libs.global_objects import Indicator
|
||||
from libs.utils import get_current_ms
|
||||
|
||||
|
||||
class DevScreen:
|
||||
def __init__(self):
|
||||
@@ -10,7 +13,7 @@ class DevScreen:
|
||||
def on_screen_start(self):
|
||||
if not self.screen_init:
|
||||
self.screen_init = True
|
||||
|
||||
self.indicator = Indicator(Indicator.State.SELECT)
|
||||
|
||||
def on_screen_end(self, next_screen: str):
|
||||
self.screen_init = False
|
||||
@@ -18,11 +21,13 @@ class DevScreen:
|
||||
|
||||
def update(self):
|
||||
self.on_screen_start()
|
||||
self.indicator.update(get_current_ms())
|
||||
if ray.is_key_pressed(ray.KeyboardKey.KEY_ENTER):
|
||||
return self.on_screen_end('GAME')
|
||||
|
||||
def draw(self):
|
||||
ray.draw_rectangle(0, 0, 1280, 720, ray.GREEN)
|
||||
self.indicator.draw(430, 575)
|
||||
|
||||
def draw_3d(self):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,7 @@ from pathlib import Path
|
||||
import pyray as ray
|
||||
|
||||
from libs.audio import audio
|
||||
from libs.global_objects import Nameplate
|
||||
from libs.global_objects import Nameplate, Indicator
|
||||
from libs.texture import tex
|
||||
from libs.utils import (
|
||||
OutlinedText,
|
||||
@@ -42,6 +42,7 @@ class EntryScreen:
|
||||
self.state = State.SELECT_SIDE
|
||||
plate_info = global_data.config['nameplate']
|
||||
self.nameplate = Nameplate(plate_info['name'], plate_info['title'], -1, -1, False)
|
||||
self.indicator = Indicator(Indicator.State.SELECT)
|
||||
self.screen_init = True
|
||||
self.side_select_fade = tex.get_animation(0)
|
||||
self.bg_flicker = tex.get_animation(1)
|
||||
@@ -116,6 +117,7 @@ class EntryScreen:
|
||||
self.box_manager.update(get_current_ms())
|
||||
self.nameplate_fadein.update(get_current_ms())
|
||||
self.nameplate.update(get_current_ms())
|
||||
self.indicator.update(get_current_ms())
|
||||
if self.box_manager.is_finished():
|
||||
return self.on_screen_end(self.box_manager.selected_box())
|
||||
return self.handle_input()
|
||||
@@ -198,8 +200,10 @@ class EntryScreen:
|
||||
if self.state == State.SELECT_MODE:
|
||||
if self.side == 0:
|
||||
self.nameplate.draw(30, 640, fade=self.nameplate_fadein.attribute)
|
||||
self.indicator.draw(50, 575, fade=self.nameplate_fadein.attribute)
|
||||
else:
|
||||
self.nameplate.draw(950, 640, fade=self.nameplate_fadein.attribute)
|
||||
self.indicator.draw(770, 575, fade=self.nameplate_fadein.attribute)
|
||||
|
||||
tex.draw_texture('global', 'player_entry')
|
||||
|
||||
|
||||
@@ -709,7 +709,8 @@ 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)
|
||||
if not global_data.modifiers.auto:
|
||||
self.nameplate.draw(-62, 285)
|
||||
self.draw_modifiers()
|
||||
if self.drumroll_counter is not None:
|
||||
self.drumroll_counter.draw()
|
||||
|
||||
@@ -9,7 +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.global_objects import Nameplate, Indicator
|
||||
from libs.texture import tex
|
||||
from libs.tja import TJAParser, test_encodings
|
||||
from libs.transition import Transition
|
||||
@@ -37,6 +37,7 @@ class SongSelectScreen:
|
||||
self.screen_init = False
|
||||
self.root_dir = global_data.config["paths"]["tja_path"]
|
||||
self.screen_width = screen_width
|
||||
self.indicator = Indicator(Indicator.State.SELECT)
|
||||
|
||||
def load_navigator(self):
|
||||
self.navigator = FileNavigator(self.root_dir)
|
||||
@@ -360,6 +361,7 @@ class SongSelectScreen:
|
||||
self.diff_selector_move_1.update(get_current_ms())
|
||||
self.diff_selector_move_2.update(get_current_ms())
|
||||
self.nameplate.update(get_current_ms())
|
||||
self.indicator.update(get_current_ms())
|
||||
|
||||
if self.text_fade_out.is_finished:
|
||||
self.selected_song = True
|
||||
@@ -495,6 +497,8 @@ class SongSelectScreen:
|
||||
if self.game_transition is not None:
|
||||
self.game_transition.draw()
|
||||
|
||||
self.indicator.draw(410, 575)
|
||||
|
||||
def draw_3d(self):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user