From 41bc6e83d16bd244d675cc7fb4e97cea29349904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Mon, 27 Aug 2018 05:00:29 +0200 Subject: [PATCH] Different colors are now fading for how good the cut was --- HitScoreVisualizer/Config.cs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/HitScoreVisualizer/Config.cs b/HitScoreVisualizer/Config.cs index edd9c50..bbde384 100644 --- a/HitScoreVisualizer/Config.cs +++ b/HitScoreVisualizer/Config.cs @@ -361,6 +361,11 @@ namespace HitScoreVisualizer instance = DEFAULT_CONFIG; } + public static string floatToHexColor(float dec) + { + return ((int)(255f * dec)).ToString("X2"); + } + public static void judge(FlyingScoreTextEffect text, NoteCutInfo noteCutInfo, SaberAfterCutSwingRatingCounter saberAfterCutSwingRatingCounter, ref Color color, int score) { Judgment judgment = DEFAULT_JUDGMENT; @@ -412,9 +417,9 @@ namespace HitScoreVisualizer afterMax = 30; } - beforeCutScore = Mathf.RoundToInt((float) beforeMax * beforeCut); - accuracyScore = Mathf.RoundToInt((float) accuracyMax * accuracy); - afterCutScore = Mathf.RoundToInt((float) afterMax * afterCut); + beforeCutScore = Mathf.RoundToInt(beforeMax * beforeCut); + accuracyScore = Mathf.RoundToInt(accuracyMax * accuracy); + afterCutScore = Mathf.RoundToInt(afterMax * afterCut); if (beforeCutScore == beforeMax && accuracyScore == accuracyMax && afterCutScore == afterMax) { @@ -425,19 +430,21 @@ namespace HitScoreVisualizer StringBuilder formattedBuilder = new StringBuilder(); if (beforeCutScore == beforeMax) - formattedBuilder.Append("P | "); + formattedBuilder.Append("P "); else - formattedBuilder.Append(beforeCutScore + " | "); + formattedBuilder.Append("" + beforeCutScore + " "); if (accuracyScore == accuracyMax) - formattedBuilder.Append("P | "); + formattedBuilder.Append("P "); else - formattedBuilder.Append(accuracyScore + " | "); + formattedBuilder.Append("" + accuracyScore + " "); if (afterCutScore == accuracyMax) - formattedBuilder.Append("P"); + formattedBuilder.Append("P"); else - formattedBuilder.Append(afterCutScore); + formattedBuilder.Append("" + afterCutScore); + + formattedBuilder.Append("\n" + "" + score); text.text = formattedBuilder.ToString(); }