Skip to content

Commit

Permalink
v1.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
hiimjasmine00 committed Jun 7, 2024
1 parent 742bc5d commit eda631a
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
4 changes: 2 additions & 2 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x86" ],
"inheritEnvironments": [ "msvc_x64" ],
"variables": []
},
{
Expand All @@ -21,7 +21,7 @@
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x86" ],
"inheritEnvironments": [ "msvc_x64" ],
"variables": []
}
]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion about.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
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.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

Expand Down
14 changes: 7 additions & 7 deletions mod.json
Original file line number Diff line number Diff line change
@@ -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"
}
],
Expand Down
29 changes: 11 additions & 18 deletions src/FREditPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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<CCNode*>(getChildren())) {
if (child->getID() == "grd-difficulty") child->setVisible(false);
auto children = reinterpret_cast<CCNode**>(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);
Expand Down Expand Up @@ -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<CCSprite*>(getChildByID("uproxide.more_difficulties/more-difficulties-spr"));
Expand Down Expand Up @@ -233,18 +225,19 @@ 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;
}
CC_SAFE_DELETE(ret);
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;
Expand Down
9 changes: 4 additions & 5 deletions src/FREditPopup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class FRLevelInfoLayerDummy; struct FRLevelInfoLayer : Modify<FRLevelInfoLayer,
void likedItem(LikeItemType, int, bool);
void checkFakeRate();
void updateFakeRate(int, int, int, bool, bool);
void onFakeRate(CCObject*);
void fixMoreDifficultiesIncompatibility(CCNode*);
};

class FREditPopup : public Popup<GJGameLevel*, int, int, int> {
class FREditPopup : public Popup<FRLevelInfoLayer*, GJGameLevel*, int, int, int> {
protected:
FRLevelInfoLayer* m_delegate;
GJGameLevel* m_level;
int m_stars;
int m_feature;
Expand All @@ -43,11 +43,10 @@ class FREditPopup : public Popup<GJGameLevel*, int, int, int> {
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*);
Expand Down

0 comments on commit eda631a

Please sign in to comment.