mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
refactoring, minor bug fixes
This commit is contained in:
@@ -9,7 +9,7 @@ import pyray as ray
|
||||
|
||||
from libs.animation import Animation
|
||||
from libs.audio import audio
|
||||
from libs.backgrounds import Background
|
||||
from libs.background import Background
|
||||
from libs.global_objects import Nameplate
|
||||
from libs.texture import tex
|
||||
from libs.tja import (
|
||||
@@ -263,7 +263,7 @@ class Player:
|
||||
self.last_subdivision = -1
|
||||
|
||||
def get_result_score(self):
|
||||
return self.score, self.good_count, self.ok_count, self.bad_count, self.total_drumroll, self.max_combo
|
||||
return self.score, self.good_count, self.ok_count, self.bad_count, self.max_combo, self.total_drumroll
|
||||
|
||||
def get_position_x(self, width: int, current_ms: float, load_ms: float, pixels_per_frame: float) -> int:
|
||||
return int(width + pixels_per_frame * (60 / 1000) * (load_ms - current_ms) - 64) - self.visual_offset
|
||||
@@ -1300,7 +1300,7 @@ class Gauge:
|
||||
self.previous_length = 0
|
||||
self.total_notes = total_notes
|
||||
self.difficulty = min(3, difficulty)
|
||||
self.clear_start = [0, 0, 68, 68]
|
||||
self.clear_start = [68, 68, 68, 68]
|
||||
self.level = min(10, level)
|
||||
self.table = [
|
||||
[
|
||||
|
||||
@@ -168,19 +168,19 @@ class ResultScreen:
|
||||
self.nameplate.update(get_current_ms())
|
||||
|
||||
def draw_score_info(self):
|
||||
if self.good:
|
||||
if self.good != '':
|
||||
for i in range(len(str(self.good))):
|
||||
tex.draw_texture('score', 'judge_num', frame=int(str(self.good)[::-1][i]), x=943-(i*24), y=186)
|
||||
if self.ok:
|
||||
if self.ok != '':
|
||||
for i in range(len(str(self.ok))):
|
||||
tex.draw_texture('score', 'judge_num', frame=int(str(self.ok)[::-1][i]), x=943-(i*24), y=227)
|
||||
if self.bad:
|
||||
if self.bad != '':
|
||||
for i in range(len(str(self.bad))):
|
||||
tex.draw_texture('score', 'judge_num', frame=int(str(self.bad)[::-1][i]), x=943-(i*24), y=267)
|
||||
if self.max_combo:
|
||||
if self.max_combo != '':
|
||||
for i in range(len(str(self.max_combo))):
|
||||
tex.draw_texture('score', 'judge_num', frame=int(str(self.max_combo)[::-1][i]), x=1217-(i*24), y=186)
|
||||
if self.total_drumroll:
|
||||
if self.total_drumroll != '':
|
||||
for i in range(len(str(self.total_drumroll))):
|
||||
tex.draw_texture('score', 'judge_num', frame=int(str(self.total_drumroll)[::-1][i]), x=1217-(i*24), y=227)
|
||||
|
||||
@@ -188,7 +188,7 @@ class ResultScreen:
|
||||
if not self.fade_in.is_finished:
|
||||
return
|
||||
tex.draw_texture('score', 'score_shinuchi')
|
||||
if self.score:
|
||||
if self.score != '':
|
||||
for i in range(len(str(self.score))):
|
||||
tex.draw_texture('score', 'score_num', x=-(i*21), frame=int(str(self.score)[::-1][i]))
|
||||
|
||||
|
||||
@@ -949,15 +949,26 @@ class GenreBG:
|
||||
offset = -150 if self.start_box.is_open else 0
|
||||
|
||||
tex.draw_texture('box', 'folder_background_edge', frame=self.end_box.texture_index, x=self.start_position+offset, y=y, mirror="horizontal", fade=self.fade_in.attribute)
|
||||
extra_distance = 155 if self.end_box.is_open or self.start_box.is_open else 0
|
||||
|
||||
|
||||
extra_distance = 155 if self.end_box.is_open or (self.start_box.is_open and 844 <= self.end_position <= 1144) else 0
|
||||
if self.start_position >= -56 and self.end_position < self.start_position:
|
||||
x2 = self.start_position + 1336
|
||||
x2 = self.start_position + 1400
|
||||
x = self.start_position+offset
|
||||
elif (self.start_position <= -56) and (self.end_position < self.start_position):
|
||||
x = 0
|
||||
x2 = 1280
|
||||
else:
|
||||
x2 = abs(self.end_position) - self.start_position + extra_distance + 57
|
||||
tex.draw_texture('box', 'folder_background', x=self.start_position+offset, y=y, x2=x2, frame=self.end_box.texture_index)
|
||||
x = self.start_position+offset
|
||||
tex.draw_texture('box', 'folder_background', x=x, y=y, x2=x2, frame=self.end_box.texture_index)
|
||||
|
||||
|
||||
if self.end_position < self.start_position and self.end_position >= -56:
|
||||
x2 = min(self.end_position+75, 1280) + extra_distance
|
||||
tex.draw_texture('box', 'folder_background', x=-18, y=y, x2=x2, frame=self.end_box.texture_index)
|
||||
|
||||
|
||||
offset = 150 if self.end_box.is_open else 0
|
||||
tex.draw_texture('box', 'folder_background_edge', x=self.end_position+80+offset, y=y, fade=self.fade_in.attribute, frame=self.end_box.texture_index)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user