Skip to content

Commit

Permalink
Merge pull request #2 from undefined06855/patch-1
Browse files Browse the repository at this point in the history
a few things
  • Loading branch information
GDColon authored Jun 23, 2024
2 parents 4f6687a + 5a695fb commit 6c05e90
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ using namespace geode::prelude;
bool swappedTextures = false;

class $modify(MenuLayer) {

bool init() {
MenuLayer::init();
if (!MenuLayer::init()) return false;

// test if already swapped textures
if (swappedTextures) return true;
else swappedTextures = true;

Expand All @@ -21,17 +21,7 @@ class $modify(MenuLayer) {
swapTexture("secretCoin_01" + suffix, "secretCoin_2_01" + suffix);
swapTexture("secretCoin_b_01" + suffix, "secretCoin_2_b_01" + suffix);
}

// applies a patch that prevents the game from making the particles in coinEffect.plist silver
// it's somewhere in EnhancedGameObject::updateUserCoin
// first one makes it so (if (isCoin && objectID != 142) { ... }) never runs, 142 is secret coin ID
// second and third changes the coin pickup effect to not be silver for user coins
Mod::get()->patch(reinterpret_cast<void*>(geode::base::get() + 0x14740a), { 0xEB });
Mod::get()->patch(reinterpret_cast<void*>(geode::base::get() + 0x14afa8), { 0xEB }); // something 0xc8ffff
Mod::get()->patch(reinterpret_cast<void*>(geode::base::get() + 0x14b035), { 0xEB }); // something concat21 0xffff

// todo: android support. but that requires arm knowledge


return true;
}

Expand All @@ -44,12 +34,11 @@ class $modify(MenuLayer) {
};

class $modify(CCSprite) {

// removes the bronze tint on unverified coins
void setColor(cocos2d::ccColor3B const& col) {
GameObject* gameObj = typeinfo_cast<GameObject*>(this);
if (gameObj && gameObj->m_objectID == 1329) return CCSprite::setColor({255, 255, 255});
else return CCSprite::setColor(col);
if (gameObj && gameObj->m_objectID == 1329) CCSprite::setColor({255, 255, 255});
else CCSprite::setColor(col);
}
};

Expand All @@ -58,4 +47,16 @@ class $modify(LoadingLayer) {
swappedTextures = false;
return LoadingLayer::init(p0);
}
};
};

$execute {
// applies a patch that prevents the game from making the particles in coinEffect.plist silver
// it's somewhere in EnhancedGameObject::updateUserCoin
// first one makes it so (if (isCoin && objectID != 142) { ... }) never runs, 142 is secret coin ID
// second and third changes the coin pickup effect to not be silver for user coins
Mod::get()->patch(reinterpret_cast<void*>(geode::base::get() + 0x14740a), { 0xEB });
Mod::get()->patch(reinterpret_cast<void*>(geode::base::get() + 0x14afa8), { 0xEB }); // something 0xc8ffff
Mod::get()->patch(reinterpret_cast<void*>(geode::base::get() + 0x14b035), { 0xEB }); // something concat21 0xffff

// todo: android support. but that requires arm knowledge
}

2 comments on commit 6c05e90

@Braite1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for keeping this updated, I appreciate it!

@Braite1
Copy link

@Braite1 Braite1 commented on 6c05e90 Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for keeping this updated, I appreciate it!

nevermind T^T

Please sign in to comment.