From 532037000a0056354eb72420680f788af6efb25f Mon Sep 17 00:00:00 2001 From: Anthony Samms Date: Fri, 19 Dec 2025 09:40:36 -0500 Subject: [PATCH] add graphics --- config.toml | 2 +- libs/config.py | 1 + scenes/game.py | 17 ++++++++++++----- scenes/result.py | 6 +++++- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/config.toml b/config.toml index 7d769f8..e1ecb43 100644 --- a/config.toml +++ b/config.toml @@ -9,7 +9,7 @@ nijiiro_notes = false log_level = 30 fake_online = false practice_mode_bar_delay = 1 -score_method = "gen3" +score_method = "shinuchi" [nameplate_1p] name = 'どんちゃん' diff --git a/libs/config.py b/libs/config.py index eb47ee7..f07a7b4 100644 --- a/libs/config.py +++ b/libs/config.py @@ -18,6 +18,7 @@ class GeneralConfig(TypedDict): log_level: int fake_online: bool practice_mode_bar_delay: int + score_method: str class NameplateConfig(TypedDict): name: str diff --git a/scenes/game.py b/scenes/game.py index e6fcb1b..bed2290 100644 --- a/scenes/game.py +++ b/scenes/game.py @@ -58,6 +58,10 @@ class Judgments(IntEnum): OK = 1 BAD = 2 +class ScoreMethod(): + GEN3 = "gen3" + SHINUCHI = "shinuchi" + class GameScreen(Screen): JUDGE_X = 414 * tex.screen_scale JUDGE_Y = 256 * tex.screen_scale @@ -409,9 +413,9 @@ class Player: self.base_score = 0 self.score_init = 0 self.score_diff = 0 - if self.score_method =="shinuchi": + if self.score_method == ScoreMethod.SHINUCHI: self.base_score = calculate_base_score(total_notes) - elif self.score_method == "gen3": + elif self.score_method == ScoreMethod.GEN3: self.score_diff = self.tja.metadata.course_data[self.difficulty].scorediff if self.score_diff <= 0: logger.warning("Error: No scorediff specified or scorediff less than 0 | Using shinuchi scoring method instead") @@ -880,7 +884,7 @@ class Player: ok_window_ms = Player.TIMING_OK bad_window_ms = Player.TIMING_BAD - if self.score_method == "gen3": + if self.score_method == ScoreMethod.GEN3: self.base_score = self.score_init if 9 < self.combo and self.combo < 30: self.base_score = math.floor(self.score_init + 1 * self.score_diff) @@ -986,7 +990,7 @@ class Player: self.chara.set_animation('balloon_popping') self.balloon_anim.update(current_time, self.curr_balloon_count, not self.is_balloon) if self.balloon_anim.is_finished: - if self.score_method == "gen3": + if self.score_method == ScoreMethod.GEN3: self.score += 5000 self.base_score_list.append(ScoreCounterAnimation(self.player_num, 5000, self.is_2p)) self.balloon_anim = None @@ -1264,7 +1268,10 @@ class Player: def draw_modifiers(self): """Shows the currently selected modifiers""" - modifiers_to_draw = ['mod_shinuchi'] + modifiers_to_draw = [] + + if self.score_method == ScoreMethod.SHINUCHI: + modifiers_to_draw.append('mod_shinuchi') # Speed modifiers if global_data.modifiers[self.player_num].speed >= 4: diff --git a/scenes/result.py b/scenes/result.py index badf62d..f8b733b 100644 --- a/scenes/result.py +++ b/scenes/result.py @@ -14,6 +14,7 @@ from libs.utils import ( is_l_don_pressed, is_r_don_pressed ) +from scenes.game import ScoreMethod logger = logging.getLogger(__name__) @@ -218,7 +219,10 @@ class ResultPlayer: """ if not self.fade_in_finished: return - tex.draw_texture('score', 'score_shinuchi', index=self.is_2p) + if global_data.config["general"]["score_method"] == ScoreMethod.SHINUCHI: + tex.draw_texture('score', 'score_shinuchi', index=self.is_2p) + else: + tex.draw_texture('score', 'score', index=self.is_2p) if self.score != '': for i in range(len(str(self.score))): tex.draw_texture('score', 'score_num', x=-(i*tex.skin_config["result_score_margin"].x), frame=int(str(self.score)[::-1][i]), index=self.is_2p)