diff --git a/CMakeLists.txt b/CMakeLists.txt index fbfeeb9..058bd03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") set(CMAKE_CXX_VISIBILITY_PRESET hidden) -project(FakeRate VERSION 1.2.3) +project(FakeRate VERSION 1.2.4) add_library(${PROJECT_NAME} SHARED src/FakeRate.cpp diff --git a/changelog.md b/changelog.md index 65f27d2..bb0da9c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,7 @@ # Fake Rate Changelog +## v1.2.4 (2024-06-27) +- Fixed a bug that caused orbs not to display correctly in map packs + ## v1.2.3 (2024-06-27) - Fixed a bug that caused the game to crash when a difficulty face in the difficulty selection popup was clicked with More Difficulties uninstalled or disabled diff --git a/mod.json b/mod.json index a78df26..5d0be84 100644 --- a/mod.json +++ b/mod.json @@ -5,7 +5,7 @@ "win": "2.206", "mac": "2.206" }, - "version": "v1.2.3", + "version": "v1.2.4", "id": "hiimjustin000.fake_rate", "name": "Fake Rate", "developer": "hiimjustin000", diff --git a/src/main.cpp b/src/main.cpp index 15757b0..261abef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -124,7 +124,7 @@ class $modify(FRLevelInfoLayer, LevelInfoLayer) { m_starsLabel->setPosition(m_starsIcon->getPositionX() - 8.0f, m_starsIcon->getPositionY()); m_starsLabel->setString(std::to_string(stars).c_str()); m_starsLabel->setVisible(showStars); - m_starsLabel->setColor({ 255, 255, (unsigned char)(gsm->hasCompletedLevel(m_level) ? 50 : 255) }); + if (gsm->hasCompletedLevel(m_level)) m_starsLabel->setColor({ 255, 255, 50 }); for (int i = 0; i < m_coins->count(); i++) { auto coin = static_cast(m_coins->objectAtIndex(i)); coin->setPositionY(position.y - 31.5f - (showStars ? 14.0f : 0.0f) @@ -279,7 +279,7 @@ class $modify(FRLevelCell, LevelCell) { difficultyContainer->addChild(starsLabel); } starsLabel->setString(std::to_string(fakeRateData.stars).c_str()); - starsLabel->setColor({ 255, 255, (unsigned char)(gsm->hasCompletedLevel(level) ? 50 : 255) }); + if (gsm->hasCompletedLevel(level)) starsLabel->setColor({ 255, 255, 50 }); } else { if (auto starsIcon = static_cast(difficultyContainer->getChildByID("stars-icon"))) starsIcon->removeFromParent(); @@ -336,11 +336,12 @@ class $modify(FRLevelCell, LevelCell) { } auto orbs = FakeRate::getBaseCurrency(fakeRateData.stars); auto totalOrbs = (int)floorf(orbs * 1.25f); - orbsLabel->setString((level->m_normalPercent == 100 ? - fmt::format("{}", totalOrbs) : - fmt::format("{}/{}", (int)floorf(orbs * level->m_normalPercent / 100.0f), totalOrbs)).c_str()); + auto percent = level->m_normalPercent.value(); + auto savedLevel = GameLevelManager::sharedState()->getSavedLevel(level->m_levelID); + if (savedLevel) percent = savedLevel->m_normalPercent.value(); + orbsLabel->setString((percent == 100 ? fmt::format("{}", totalOrbs) : fmt::format("{}/{}", (int)floorf(orbs * percent / 100.0f), totalOrbs)).c_str()); orbsLabel->limitLabelWidth(45.0f, m_compactView ? 0.3f : 0.4f, 0.0f); - if (level->m_normalPercent == 100) orbsLabel->setColor({ 100, 255, 255 }); + if (percent == 100) orbsLabel->setColor({ 100, 255, 255 }); } else { if (auto orbsIcon = static_cast(m_mainLayer->getChildByID("orbs-icon"))) orbsIcon->removeFromParent();