From 492b391282314d3e431d679ea5cb1cc3ae12f561 Mon Sep 17 00:00:00 2001 From: teejusb <5017202+teejusb@users.noreply.github.com> Date: Thu, 15 Jun 2023 00:36:42 -0700 Subject: [PATCH] Rename to MinTNSToScoreNotes for the preference --- src/Player.cpp | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/Player.cpp b/src/Player.cpp index df849e8a44..18a65aecbc 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -146,21 +146,19 @@ void TimingWindowSecondsInit( std::size_t /*TimingWindow*/ i, RString &sNameOut, } } -TapNoteScore MinTnsToScoreTapNote(int i) { - switch (i) { - case 1: - return TNS_W1; - case 2: - return TNS_W2; - case 3: - return TNS_W3; - case 4: - return TNS_W4; - case 5: - return TNS_W5; +TapNoteScore ValidateMinTNSToScoreNotes(TapNoteScore tns) { + switch (tns) { + case TNS_W1: + case TNS_W2: + case TNS_W3: + case TNS_W4: + case TNS_W5: + case TNS_None: + break; default: return TNS_None; } + return tns; } static Preference m_fTimingWindowScale ( "TimingWindowScale", 1.0f ); @@ -170,7 +168,7 @@ static Preference m_fTimingWindowJump ( "TimingWindowJump", 0.25 ); static Preference m_fMaxInputLatencySeconds ( "MaxInputLatencySeconds", 0.0 ); static Preference g_bEnableAttackSoundPlayback ( "EnableAttackSounds", true ); static Preference g_bEnableMineSoundPlayback ( "EnableMineHitSound", true ); -static Preference g_iMinTnsToScoreTapNote ( "MinTnsToScoreTapNote", 3 ); // Default to great and above. Use -1 to indicate None. +static Preference g_MinTNSToScoreNotes ( "MinTNSToScoreNotes", TNS_W3 ); // Default to great and above. /** @brief How much life is in a hold note when you start on it? */ ThemeMetric INITIAL_HOLD_LIFE ( "Player", "InitialHoldLife" ); @@ -2490,15 +2488,15 @@ void Player::Step( int col, int row, const RageTimer &tm, bool bHeld, bool bRele if( score != TNS_None) { - TapNoteScore minTnsToScore = MinTnsToScoreTapNote(g_iMinTnsToScoreTapNote); + TapNoteScore minTnsToScore = ValidateMinTNSToScoreNotes(g_MinTNSToScoreNotes); bool badTns = false; if (minTnsToScore != TNS_None) { switch (score) { - case TNS_W5: - case TNS_W4: - case TNS_W3: - case TNS_W2: case TNS_W1: + case TNS_W2: + case TNS_W3: + case TNS_W4: + case TNS_W5: if (score < minTnsToScore) { badTns = true; }