Skip to content

Commit

Permalink
Minor changes to score improvement text (#45)
Browse files Browse the repository at this point in the history
* simple visual fix, made negative improvements show as - rather than +-, also added % symbol to accuracy improvement (imo this should be replaced by FC acc/pp for parity)

* making this != is better

* honestly forgot this line, also added pp to the end

* made the improvement text easier to read

* now changes color depending on if the improvement is positive or negative

* should probably give these their own if checks

* cleaned it up, no more warnings or errors

* i missed some minor stuff lol
  • Loading branch information
DizzyJune authored Aug 7, 2024
1 parent 266a0bc commit 17c5ef0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/UI/ScoreDetails/GeneralScoreDetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ string FormatInt(int score) {
string FormatScore(Score const& score) {
string result = FormatInt(score.modifiedScore);

if (score.scoreImprovement.score > 0) {
result += "\n<color=#008800><size=55%>+" + FormatInt(score.scoreImprovement.score) + "</size></color>";
if (score.scoreImprovement.score != 0) {
result += (score.scoreImprovement.score > 0) ? ("\n<color=#20BB20><size=55%>+" + (FormatInt(score.scoreImprovement.score)) + "</size></color>") : "\n<color=#BB2020><size=55%>" + FormatInt(score.scoreImprovement.score) + "</size></color>";
}
return result;
}
Expand Down Expand Up @@ -91,17 +91,17 @@ string GetDetailsString(const Score& score) {
inline string FormatAcc(const Score& score) {
string result = FormatUtils::formatAcc(score.accuracy);

if (score.scoreImprovement.score > 0) {
result += "\n<color=#008800><size=55%>+" + to_string_wprecision(score.scoreImprovement.accuracy * 100, 2) + "</size></color>";
if (score.scoreImprovement.accuracy != 0) {
result += (score.scoreImprovement.accuracy > 0) ? ("\n<color=#20BB20><size=55%>+" + (to_string_wprecision(score.scoreImprovement.accuracy * 100, 2)) + "%</size></color>") : "\n<color=#BB2020><size=55%>" + to_string_wprecision(score.scoreImprovement.accuracy * 100, 2) + "%</size></color>";
}

return result;
}

inline string FormatPP(const Score& score) {
string result = FormatUtils::FormatPP(score.pp);
if (score.scoreImprovement.score > 0) {
result += "\n<color=#008800><size=55%>+" + to_string_wprecision(score.scoreImprovement.pp, 2) + "</size></color>";
if (score.scoreImprovement.pp != 0) {
result += "\n<color=#20BB20><size=55%>+" + to_string_wprecision(score.scoreImprovement.pp, 2) + "pp</size></color>";
}
return result;
}
Expand Down

0 comments on commit 17c5ef0

Please sign in to comment.