|
1 | 1 | using Newtonsoft.Json; |
2 | 2 | using System; |
3 | | -using System.Collections.Generic; |
4 | 3 | using System.ComponentModel; |
5 | 4 | using System.IO; |
6 | | -using System.Linq; |
7 | 5 | using System.Text; |
8 | | -using System.Threading.Tasks; |
9 | 6 | using TMPro; |
10 | 7 | using UnityEngine; |
11 | 8 |
|
@@ -78,7 +75,7 @@ public struct SegmentJudgment |
78 | 75 | // - %a: The score contributed by the part of the swing after cutting the block. |
79 | 76 | // - %B, %C, %A: As above, except using the appropriate judgment from that part of the swing (as configured for "beforeCutAngleJudgments", "accuracyJudgments", or "afterCutAngleJudgments"). |
80 | 77 | // - %s: The total score for the cut. |
81 | | - // - %p: The percent out of 110 you achieved with your swing's score |
| 78 | + // - %p: The percent out of 115 you achieved with your swing's score |
82 | 79 | // - %%: A literal percent symbol. |
83 | 80 | // - %n: A newline. |
84 | 81 | // |
@@ -109,8 +106,8 @@ public struct SegmentJudgment |
109 | 106 |
|
110 | 107 | private const string DEFAULT_JSON = @"{ |
111 | 108 | ""majorVersion"": 2, |
112 | | - ""minorVersion"": 1, |
113 | | - ""patchVersion"": 6, |
| 109 | + ""minorVersion"": 2, |
| 110 | + ""patchVersion"": 0, |
114 | 111 | ""isDefaultConfig"": true, |
115 | 112 | ""displayMode"": ""format"", |
116 | 113 | ""judgments"": [ |
@@ -267,11 +264,37 @@ public static void load() |
267 | 264 | loaded.patchVersion = 0; |
268 | 265 | isDirty = true; |
269 | 266 | } |
270 | | - if (loaded.majorVersion == 2 && loaded.minorVersion == 1 && loaded.patchVersion < Plugin.patchVersion) |
| 267 | + if (loaded.majorVersion == 2 && loaded.minorVersion == 1) |
271 | 268 | { |
272 | | - loaded.patchVersion = Plugin.patchVersion; |
| 269 | + // Beat Saber version 1.0.0 increased the max score given for cut accuracy from 10 to 15, and thus the max total score from 110 to 115. |
| 270 | + // We assume that anyone whose config contained a judgment requiring an accuracy score of 10 or a total score of 110 intended those values |
| 271 | + // to refer to the highest achievable score rather than those exact numbers, and thus update them accordingly. |
| 272 | + // As we can't know what users would want done with their other judgment thresholds, those are left unchanged. |
| 273 | + if (loaded.judgments != null) |
| 274 | + { |
| 275 | + for (int i = 0; i < loaded.judgments.Length; i++) |
| 276 | + { |
| 277 | + if (loaded.judgments[i].threshold == 110) |
| 278 | + { |
| 279 | + loaded.judgments[i].threshold = 115; |
| 280 | + } |
| 281 | + } |
| 282 | + } |
| 283 | + if (loaded.accuracyJudgments != null) |
| 284 | + { |
| 285 | + for (int i = 0; i < loaded.accuracyJudgments.Length; i++) |
| 286 | + { |
| 287 | + if (loaded.accuracyJudgments[i].threshold == 10) |
| 288 | + { |
| 289 | + loaded.accuracyJudgments[i].threshold = 15; |
| 290 | + } |
| 291 | + } |
| 292 | + } |
| 293 | + loaded.minorVersion = 2; |
| 294 | + loaded.patchVersion = 0; |
273 | 295 | isDirty = true; |
274 | 296 | } |
| 297 | + instance = loaded; |
275 | 298 | if (isDirty) save(); |
276 | 299 | } |
277 | 300 | instance = loaded; |
@@ -406,7 +429,7 @@ public static void judge(FlyingScoreEffect scoreEffect, NoteCutInfo noteCutInfo, |
406 | 429 | formattedBuilder.Append(score); |
407 | 430 | break; |
408 | 431 | case 'p': |
409 | | - formattedBuilder.Append(string.Format("{0:0}", score / 110d * 100)); |
| 432 | + formattedBuilder.Append(string.Format("{0:0}", score / 115d * 100)); |
410 | 433 | break; |
411 | 434 | case '%': |
412 | 435 | formattedBuilder.Append("%"); |
|
0 commit comments