Skip to content

Commit

Permalink
v1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
hiimjasmine00 committed May 27, 2024
1 parent ef5524a commit 44faf28
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Fake Rate Changelog
## v1.1.6 (2024-05-27)
- Fixed incompatibility with the mod "GDDP Integration" by Minemaker0430

## v1.1.5 (2024-05-25)
- Fixed incompatibility with the mod "Demons In Between" by me

Expand Down
4 changes: 2 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"geode": "2.0.0-beta.26",
"geode": "2.0.0-beta.27",
"gd": {
"android": "2.205",
"win": "2.204",
"mac": "2.200"
},
"version": "v1.1.5",
"version": "v1.1.6",
"id": "hiimjustin000.fake_rate",
"name": "Fake Rate",
"developer": "hiimjustin000",
Expand Down
24 changes: 15 additions & 9 deletions src/FREditPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,25 @@ void FRLevelInfoLayer::checkFakeRate() {

void FRLevelInfoLayer::updateFakeRate(int stars, int feature, int difficulty, bool update, bool coins) {
m_fields->m_fakeRateData = { .id = m_level->m_levelID, .stars = stars, .feature = feature, .difficulty = difficulty };
if (Loader::get()->isModLoaded("hiimjustin000.demons_in_between")) {
if (auto betweenDifficultySprite = static_cast<CCSprite*>(getChildByID("hiimjustin000.demons_in_between/between-difficulty-sprite"))) {
betweenDifficultySprite->setVisible(false);
m_difficultySprite->setOpacity(255);
}
if (auto betweenDifficultySprite = static_cast<CCSprite*>(getChildByID("hiimjustin000.demons_in_between/between-difficulty-sprite"))) {
betweenDifficultySprite->setVisible(false);
m_difficultySprite->setOpacity(255);
}
auto gddpOverride = false;
if (auto gddpDifficultySprite = static_cast<CCSprite*>(getChildByID("gddp-difficulty"))) {
gddpOverride = true;
gddpDifficultySprite->setVisible(false);
m_difficultySprite->setOpacity(255);
}
if (Loader::get()->isModLoaded("itzkiba.grandpa_demon")) {
if (Loader::get()->isModLoaded("itzkiba.grandpa_demon") && !gddpOverride) {
removeChildByTag(69420);
if (auto grdDifficulty = getChildByID("grd-difficulty")) grdDifficulty->setVisible(false);
if (auto grdInfinity = getChildByID("grd-infinity")) grdInfinity->setVisible(false);
for (auto child : CCArrayExt<CCNode*>(getChildren())) {
if (child->getID() == "grd-difficulty") child->setVisible(false);
}
m_difficultySprite->setVisible(true);
if (auto featureGlow = m_difficultySprite->getChildByTag(69420))
featureGlow->setPosition(m_difficultySprite->getContentWidth() * 0.5f, m_difficultySprite->getContentHeight() * 0.5f);
featureGlow->setPosition(m_difficultySprite->getContentSize() * 0.5f);
}
auto winSize = CCDirector::sharedDirector()->getWinSize();
auto gsm = GameStatsManager::sharedState();
Expand Down Expand Up @@ -175,7 +181,7 @@ void FRLevelInfoLayer::fixMoreDifficultiesIncompatibility(CCNode* difficultySpri
m_difficultySprite->getPositionX() + (legacy ? 0.0f : 0.25f),
m_difficultySprite->getPositionY() - (legacy ? 0.0f : 0.1f)
});
if (spriteName.compare("uproxide.more_difficulties/MD_DifficultyCP.png") == 0) {
if (spriteName == "uproxide.more_difficulties/MD_DifficultyCP.png") {
moreDifficultiesSprite->setVisible(true);
m_difficultySprite->setOpacity(0);
}
Expand Down
12 changes: 9 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ class $modify(FRLevelCell, LevelCell) {
betweenDifficultySprite->setVisible(false);
difficultySprite->setOpacity(255);
}
if (difficultyContainer->getID().compare("grd-demon-icon-layer") == 0) {
auto gddpOverride = false;
if (auto gddpDifficultySprite = static_cast<CCSprite*>(difficultyContainer->getChildByID("gddp-difficulty"))) {
gddpOverride = true;
gddpDifficultySprite->setVisible(false);
difficultySprite->setOpacity(255);
}
if (difficultyContainer->getID() == "grd-demon-icon-layer" && !gddpOverride) {
difficultyContainer->removeChildByTag(69420);
difficultySprite->setVisible(true);
if (auto grdInfinity = static_cast<CCSprite*>(difficultyContainer->getChildByID("grd-infinity"))) {
Expand All @@ -28,7 +34,7 @@ class $modify(FRLevelCell, LevelCell) {
}
else static_cast<CCSprite*>(difficultyContainer->getChildren()->lastObject())->setVisible(false);
if (auto featureGlow = difficultySprite->getChildByTag(69420))
featureGlow->setPosition(difficultySprite->getContentWidth() * 0.5f, difficultySprite->getContentHeight() * 0.5f);
featureGlow->setPosition(difficultySprite->getContentSize() * 0.5f);
}

auto& fakeRateData = *it;
Expand Down Expand Up @@ -144,7 +150,7 @@ class $modify(FRLevelCell, LevelCell) {

auto legacy = Loader::get()->getLoadedMod("uproxide.more_difficulties")->getSettingValue<bool>("legacy-difficulties");
auto pos = CCPoint { difficultySprite->getPositionX() + (legacy ? 0.0f : 0.25f), difficultySprite->getPositionY() - (legacy ? 0.0f : 0.1f) };
if (spriteName.compare("uproxide.more_difficulties/MD_DifficultyCP.png") == 0) {
if (spriteName == "uproxide.more_difficulties/MD_DifficultyCP.png") {
moreDifficultiesSprite->setVisible(true);
difficultySprite->setOpacity(0);
}
Expand Down

0 comments on commit 44faf28

Please sign in to comment.