From 91b828d522164475157cc07196e9f0f91cf9dd7c Mon Sep 17 00:00:00 2001 From: Minemaker0430 <85040155+Minemaker0430@users.noreply.github.com> Date: Thu, 1 Aug 2024 18:14:47 -0600 Subject: [PATCH] beta 36 --- changelog.md | 6 ++++++ mod.json | 2 +- src/StatsPopup.cpp | 23 +++++++++++++++++------ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/changelog.md b/changelog.md index ec3cbe5..2d08f60 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,10 @@ +# v1.0.0-beta.36 + +* Fixed Titles not showing correctly +* Having a rank without having the requirements overwrites percent progress for Titles + # v1.0.0-beta.35 + * Fixed Rate All Demons * Spreadsheet Parsing Code borrowed from hiimjustin * Still investigating mobile crashes diff --git a/mod.json b/mod.json index 3bd013a..6e4dde6 100644 --- a/mod.json +++ b/mod.json @@ -4,7 +4,7 @@ "win": "2.206", "android": "2.206" }, - "version": "v1.0.0-beta.35", + "version": "v1.0.0-beta.36", "id": "minemaker0430.gddp_integration", "name": "GDDP Integration", "developer": "Minemaker0430", diff --git a/src/StatsPopup.cpp b/src/StatsPopup.cpp index 1a192ab..f2f6924 100644 --- a/src/StatsPopup.cpp +++ b/src/StatsPopup.cpp @@ -434,7 +434,8 @@ void StatsPopup::loadTab(int id) { } } - auto progressPercent = getPercentToRank(data["main"].as_array().size(), true); + //Absolute Perfection Progress + auto progressPercent = getPercentToRank(data["main"].as_array().size() - 1, true); auto bonusProgress = 0; auto bonusTotalLevels = 0; @@ -456,7 +457,7 @@ void StatsPopup::loadTab(int id) { auto plusTitleStr = "None"; ccColor3B plusTitleColor = { 130, 130, 130 }; - if (highestPlusTitle != -1) { + if (highestPlusTitle > -1) { plusTitleStr = PlusTitles[highestPlusTitle].c_str(); plusTitleColor = PlusTitleColors[highestPlusTitle]; } @@ -910,7 +911,7 @@ void StatsPopup::loadTab(int id) { packProgressFront->setZOrder(1); packProgressFront->setColor({ 255, 190, 255 }); - auto progressPercent = getPercentToRank(data["main"].as_array().size(), true); + auto progressPercent = getPercentToRank(data["main"].as_array().size() - 1, true); //Get All Bonus Progress auto bonusProgress = 0; @@ -1142,12 +1143,17 @@ float StatsPopup::getPercentToRank(int rankID, bool isPlus) { totalLvls += totalLevels; } else { - progress += clamp(listSave.progress, 0, reqLevels); + if (listSave.hasRank) { + progress += reqLevels; + } + else { + progress += clamp(listSave.progress, 0, reqLevels); + } totalLvls += reqLevels; } } else { - for (int i = 0; i < rankID; i++) { + for (int i = 0; i <= rankID; i++) { auto saveID = data["main"][i]["saveID"].as_string(); auto reqLevels = data["main"][i]["reqLevels"].as_int(); auto totalLevels = data["main"][i]["levelIDs"].as_array().size(); @@ -1158,7 +1164,12 @@ float StatsPopup::getPercentToRank(int rankID, bool isPlus) { totalLvls += totalLevels; } else { - progress += clamp(listSave.progress, 0, reqLevels); + if (listSave.hasRank) { + progress += reqLevels; + } + else { + progress += clamp(listSave.progress, 0, reqLevels); + } totalLvls += reqLevels; } }