Skip to content

Commit

Permalink
beta 36
Browse files Browse the repository at this point in the history
  • Loading branch information
Minemaker0430 committed Aug 2, 2024
1 parent 540c5f6 commit 91b828d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
23 changes: 17 additions & 6 deletions src/StatsPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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];
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 91b828d

Please sign in to comment.