Skip to content

Commit

Permalink
Fix really old PlayerStageStats Grade related function
Browse files Browse the repository at this point in the history
and remove dead metrics
  • Loading branch information
poco0317 committed Feb 17, 2020
1 parent 45f3051 commit 664ffaa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 28 deletions.
10 changes: 1 addition & 9 deletions Themes/_fallback/base._ini
Original file line number Diff line number Diff line change
Expand Up @@ -3356,15 +3356,7 @@ DeltaSecondsHeldCommand=shadowlength,4;diffusealpha,1;zoom,1.25;linear,0.3;zoomx
DeltaSecondsGainLifeCommand=

[PlayerStageStats]
NumGradeTiersUsed=8
GradePercentTier01=1.00
GradePercentTier02=0.99
GradePercentTier03=0.97
GradePercentTier04=0.93
GradePercentTier05=0.80
GradePercentTier06=0.65
GradePercentTier07=0.45
GradePercentTier08=-99999.000000
NumGradeTiersUsed=16
GradeTier01IsAllW2s=false
GradeTier02IsAllW2s=false
GradeTier02IsFullCombo=false
Expand Down
10 changes: 1 addition & 9 deletions Themes/_fallback/metrics.ini
Original file line number Diff line number Diff line change
Expand Up @@ -688,18 +688,10 @@ Bar16thAlpha=1
AreaHighlightColor=color("1,0,0,0.3")

[PlayerStageStats]
# Original CVS Grading
GradePercentTier01=1.000000
GradePercentTier02=1.000000
GradePercentTier03=0.930000
GradePercentTier04=0.800000
GradePercentTier05=0.650000
GradePercentTier06=0.450000
GradePercentTier07=-99999.000000
GradeTier01IsAllW2s=false
GradeTier02IsAllW2s=true
GradeTier02IsFullCombo=false
NumGradeTiersUsed=7
NumGradeTiersUsed=16

[Player]
ReceptorArrowsYStandard=-144
Expand Down
16 changes: 6 additions & 10 deletions src/Etterna/Models/Misc/PlayerStageStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
#include "Etterna/Models/StepsAndStyles/Steps.h"
#include "Etterna/Singletons/ThemeManager.h"

#define GRADE_PERCENT_TIER(i) \
THEME->GetMetricF( \
"PlayerStageStats", \
ssprintf("GradePercent%s", GradeToString((Grade)(i)).c_str()))
// deprecated, but no solution to replace them exists yet:
#define GRADE_TIER02_IS_ALL_W2S \
THEME->GetMetricB("PlayerStageStats", "GradeTier02IsAllW2s")
Expand Down Expand Up @@ -287,24 +283,24 @@ PlayerStageStats::GetGrade() const
// TODO: Change these conditions to use Lua instead. -aj
if (GRADE_TIER02_IS_ALL_W2S) {
if (FullComboOfScore(TNS_W1))
return Grade_Tier01;
return Grade_Tier04; // quad

if (FullComboOfScore(TNS_W2))
return Grade_Tier02;
return Grade_Tier07; // triple

grade = max(grade, Grade_Tier03);
}

if (GRADE_TIER01_IS_ALL_W2S) {
if (FullComboOfScore(TNS_W2))
return Grade_Tier01;
grade = max(grade, Grade_Tier02);
return Grade_Tier04; // quad
grade = max(grade, Grade_Tier07); // triple
}

if (GRADE_TIER02_IS_FULL_COMBO) {
if (FullComboOfScore(g_MinScoreToMaintainCombo))
return Grade_Tier02;
grade = max(grade, Grade_Tier03);
return Grade_Tier07; // triple
grade = max(grade, Grade_Tier10); // double
}

return grade;
Expand Down

0 comments on commit 664ffaa

Please sign in to comment.