diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5107645..812a71d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,6 +37,8 @@ jobs: with: build-config: RelWithDebInfo export-pdb: true + cli: v3.0.0-beta.1 + sdk: v3.0.0-alpha.1 combine: true target: ${{ matrix.config.target }} diff --git a/CMakeSettings.json b/CMakeSettings.json index 2f569e8..0b6f7ad 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -9,7 +9,7 @@ "cmakeCommandArgs": "", "buildCommandArgs": "", "ctestCommandArgs": "", - "inheritEnvironments": [ "msvc_x86" ], + "inheritEnvironments": [ "msvc_x64" ], "variables": [] }, { @@ -21,7 +21,7 @@ "cmakeCommandArgs": "", "buildCommandArgs": "", "ctestCommandArgs": "", - "inheritEnvironments": [ "msvc_x86" ], + "inheritEnvironments": [ "msvc_x64" ], "variables": [] } ] diff --git a/README.md b/README.md index 0bfe6eb..0e01157 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Fake Rate -Give online levels a fake rate. +A mod that allows you to assign a fake rating to online levels. # Features - Ability to give online levels a fake rating diff --git a/about.md b/about.md index b38b525..e251f7f 100644 --- a/about.md +++ b/about.md @@ -1,5 +1,5 @@ # Fake Rate -Give online levels a fake rate. +A mod that allows you to assign a fake rating to online levels. # Features - Ability to give online levels a fake rating diff --git a/changelog.md b/changelog.md index c6567f2..a0384f6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,7 @@ # Fake Rate Changelog +## v1.1.8 (2024-06-07) +- Ported to Geometry Dash v2.206 + ## v1.1.7 (2024-05-27) - Fixed a few bugs with compatibilty with other mods diff --git a/mod.json b/mod.json index 374df6c..f6538fd 100644 --- a/mod.json +++ b/mod.json @@ -1,20 +1,20 @@ { - "geode": "2.0.0-beta.27", + "geode": "3.0.0-alpha.1", "gd": { - "android": "2.205", - "win": "2.204", - "mac": "2.200" + "android": "2.206", + "win": "2.206", + "mac": "2.206" }, - "version": "v1.1.7", + "version": "v1.1.8", "id": "hiimjustin000.fake_rate", "name": "Fake Rate", "developer": "hiimjustin000", - "description": "Give online levels a fake rate.", + "description": "A mod that allows you to assign a fake rating to online levels.", "repository": "https://github.com/hiimjustin000/FakeRate", "dependencies": [ { "id": "geode.node-ids", - "version": ">=v1.9.1", + "version": ">=v1.12.0-beta.1", "importance": "required" } ], diff --git a/src/FREditPopup.cpp b/src/FREditPopup.cpp index da3f248..a2598d8 100644 --- a/src/FREditPopup.cpp +++ b/src/FREditPopup.cpp @@ -10,11 +10,13 @@ void FRLevelInfoLayer::onModify(auto& self) { bool FRLevelInfoLayer::init(GJGameLevel* level, bool challenge) { if (!LevelInfoLayer::init(level, challenge)) return false; - auto leftSideMenu = getChildByID("left-side-menu"); auto buttonSprite = CircleButtonSprite::createWithSprite("FR_fakeRateBtn_001.png"_spr, 1.0f, CircleBaseColor::Green, CircleBaseSize::Medium); buttonSprite->getTopNode()->setScale(1.0f); - auto fakeRateButton = CCMenuItemSpriteExtra::create(buttonSprite, this, menu_selector(FRLevelInfoLayer::onFakeRate)); + auto fakeRateButton = CCMenuItemExt::createSpriteExtra(buttonSprite, [this](auto) { + FREditPopup::create(this, m_level, m_fields->m_fakeRateData.stars, m_fields->m_fakeRateData.feature, m_fields->m_fakeRateData.difficulty)->show(); + }); fakeRateButton->setID("fake-rate-button"_spr); + auto leftSideMenu = getChildByID("left-side-menu"); leftSideMenu->addChild(fakeRateButton); leftSideMenu->updateLayout(); @@ -64,8 +66,9 @@ void FRLevelInfoLayer::updateFakeRate(int stars, int feature, int difficulty, bo } if (Loader::get()->isModLoaded("itzkiba.grandpa_demon") && !gddpOverride) { removeChildByTag(69420); - for (auto child : CCArrayExt(getChildren())) { - if (child->getID() == "grd-difficulty") child->setVisible(false); + auto children = reinterpret_cast(getChildren()->data->arr); + for (int i = 0; i < getChildrenCount(); i++) { + if (children[i]->getID() == "grd-difficulty") children[i]->setVisible(false); } if (auto grdInfinity = getChildByID("grd-infinity")) grdInfinity->setVisible(false); m_difficultySprite->setVisible(true); @@ -158,17 +161,6 @@ void FRLevelInfoLayer::updateFakeRate(int stars, int feature, int difficulty, bo if (Loader::get()->isModLoaded("uproxide.more_difficulties")) fixMoreDifficultiesIncompatibility(difficultySpriteParent); } -void FRLevelInfoLayer::onFakeRate(CCObject*) { - auto popup = FREditPopup::create( - m_level, - m_fields->m_fakeRateData.stars, - m_fields->m_fakeRateData.feature, - m_fields->m_fakeRateData.difficulty - ); - popup->m_delegate = this; - popup->show(); -} - void FRLevelInfoLayer::fixMoreDifficultiesIncompatibility(CCNode* difficultySpriteParent) { auto spriteName = std::string(); auto moreDifficultiesSprite = static_cast(getChildByID("uproxide.more_difficulties/more-difficulties-spr")); @@ -233,9 +225,9 @@ void FRLevelInfoLayer::fixMoreDifficultiesIncompatibility(CCNode* difficultySpri } } -FREditPopup* FREditPopup::create(GJGameLevel* level, int stars, int feature, int difficulty) { +FREditPopup* FREditPopup::create(FRLevelInfoLayer* delegate, GJGameLevel* level, int stars, int feature, int difficulty) { auto ret = new FREditPopup(); - if (ret && ret->initAnchored(200.0f, 150.0f, level, stars, feature, difficulty)) { + if (ret && ret->initAnchored(200.0f, 150.0f, delegate, level, stars, feature, difficulty)) { ret->autorelease(); return ret; } @@ -243,8 +235,9 @@ FREditPopup* FREditPopup::create(GJGameLevel* level, int stars, int feature, int return nullptr; } -bool FREditPopup::setup(GJGameLevel* level, int stars, int feature, int difficulty) { +bool FREditPopup::setup(FRLevelInfoLayer* delegate, GJGameLevel* level, int stars, int feature, int difficulty) { setTitle("Fake Rate"); + m_delegate = delegate; m_level = level; m_stars = stars; m_feature = feature; diff --git a/src/FREditPopup.hpp b/src/FREditPopup.hpp index a19ade6..377e60c 100644 --- a/src/FREditPopup.hpp +++ b/src/FREditPopup.hpp @@ -20,12 +20,12 @@ class FRLevelInfoLayerDummy; struct FRLevelInfoLayer : Modify { +class FREditPopup : public Popup { protected: + FRLevelInfoLayer* m_delegate; GJGameLevel* m_level; int m_stars; int m_feature; @@ -43,11 +43,10 @@ class FREditPopup : public Popup { CCMenuItemSpriteExtra* m_featureLeftArrow; CCMenuItemSpriteExtra* m_featureRightArrow; - bool setup(GJGameLevel*, int, int, int) override; + bool setup(FRLevelInfoLayer*, GJGameLevel*, int, int, int) override; void updateLabels(); public: - FRLevelInfoLayer* m_delegate; - static FREditPopup* create(GJGameLevel*, int, int, int); + static FREditPopup* create(FRLevelInfoLayer*, GJGameLevel*, int, int, int); void onStarLeft(CCObject*); void onStarRight(CCObject*);