From b815891871fce87013001b4e00656c9ab62d15ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Mon, 27 Aug 2018 03:59:58 +0200 Subject: [PATCH] Basic functionality obtained --- HitScoreVisualizer/Config.cs | 41 ++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/HitScoreVisualizer/Config.cs b/HitScoreVisualizer/Config.cs index e1f4f91..6c1d932 100644 --- a/HitScoreVisualizer/Config.cs +++ b/HitScoreVisualizer/Config.cs @@ -397,19 +397,48 @@ namespace HitScoreVisualizer afterCutScore = saberAfterCutSwingRatingCounter.rating; int beforeCutScore, accuracyScore, afterCutScore; + int beforeMax, accuracyMax, afterMax; + if (percentages) { - beforeCutScore = Mathf.Round(100f * beforeCut); - accuracyScore = Mathf.Round(100f * accuracy); - afterCutScore = Mathf.Round(100f * afterCut); + beforeMax = 100; + accuracyMax = 100; + afterMax = 100; } else { - beforeCutScore = Mathf.RoundToInt(70f * beforeCut); - accuracyScore = Mathf.RoundToInt(10f * accuracy); - afterCutScore = Mathf.RoundToInt(30f * afterCut); + beforeMax = 70; + accuracyMax = 10; + afterMax = 30; } + beforeCutScore = Mathf.Round((float) beforeMax * beforeCut); + accuracyScore = Mathf.Round((float) accuracyMax * accuracy); + afterCutScore = Mathf.Round((float) afterMax * afterCut); + if (beforeCutScore == beforeMax && accuracyScore == acMulti && afterCutScore == afterMax) + { + text.text = "Perfect!"; + return; + } + + StringBuilder formattedBuilder = new StringBuilder(); + + if (beforeCutScore == beforeMax) + formattedBuilder.Append("P | "); + else + formattedBuilder.Append(beforeCutScore + " | "); + + if (accuracyScore == accuracyMax) + formattedBuilder.Append("P | "); + else + formattedBuilder.Append(accuracyScore + " | "); + + if (afterCutScore == accuracyMax) + formattedBuilder.Append("P"); + else + formattedBuilder.Append(afterCutScore); + + text.text = formattedBuilder.ToString(); } else if (instance.displayMode == mode_format) {