Skip to content

Commit

Permalink
added some, disabled some, fixed some, mods.
Browse files Browse the repository at this point in the history
  • Loading branch information
FireMario211 committed Jan 20, 2024
1 parent a656aea commit dae7975
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 32 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
uses: geode-sdk/build-geode-mod@main
with:
#sdk: nightly
build-config: 'RelWithDebInfo'
combine: true
configure-args: '-DGEODE_DISABLE_FMT_CONSTEVAL=1'
target: ${{ matrix.config.target }}
Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# v1.0.1
- Fixed issue with LevelInfoLayer crashing if its your own level and you have Copy Hack enabled.
- Fixed Force Platformer Mode and Gravity not working on Windows
# v1.0.0
- Geode public release
9 changes: 6 additions & 3 deletions resources/hacks/creator.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
"opcodes": [
{"addr": "0x1E4A32", "on": "90 90", "off": "75 6C"}
],
"type": "bool"
"type": "bool",
"winOnly": true
},
{
"name": "Verify Hack",
"desc": "Lets you upload unverified levels. Will automatically set levels to be verified.",
"opcodes": [
{"addr": "0x71D48", "on": "EB", "off": "74"}
],
"type": "bool"
"type": "bool",
"winOnly": true
},
{
"name": "Copy Hack",
Expand All @@ -28,7 +30,8 @@
{"addr": "0xA6B8B", "on": "2B 87 CC 02 00 00", "off": "2B 87 D0 02 00 00"},
{"addr": "0x70E87", "on": "EB 26", "off": "74 26"}
],
"type": "bool"
"type": "bool",
"winOnly": true
},
{
"name": "Hide Testmode",
Expand Down
6 changes: 4 additions & 2 deletions resources/hacks/player.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@
"name": "Force Platformer Mode",
"desc": "Forces you to be in platformer mode when playing a level.",
"opcodes": [],
"type": "bool"
"type": "bool",
"win": true
},
{
"name": "Change Gravity",
"desc": "Allows you to change gravity when jumping or falling.",
"opcodes": [],
"type": "bool"
"type": "bool",
"win": true
},
{
"name": "Gravity Value",
Expand Down
50 changes: 23 additions & 27 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,11 @@ class $modify(MyCustomMenu, MenuLayer) {
ImGui::BeginDisabled(true);
//#endif
}
if (obj.contains("win")) { // yeah idk what property okay
#ifndef GEODE_IS_WINDOWS
ImGui::BeginDisabled(true);
#endif
}
if (hack->value.type == ValueType::Int && hack->type != "dropdown") {
auto min = obj.get<int>("min");
auto max = obj.get<int>("max");
Expand Down Expand Up @@ -531,6 +536,11 @@ class $modify(MyCustomMenu, MenuLayer) {
ImGui::EndDisabled();
//#endif
}
if (obj.contains("win")) { // yeah idk what property okay
#ifndef GEODE_IS_WINDOWS
ImGui::EndDisabled();
#endif
}
if (ImGui::IsItemHovered() && Hacks::isHackEnabled("Show Tooltips")) {
if ((obj.contains("winOnly") && Hacks::isHackEnabled("Enable Patching")) || !obj.contains("winOnly")) {
ImGui::BeginTooltip();
Expand Down Expand Up @@ -706,10 +716,9 @@ class $modify(PlayLayer) {
}*\/
}*/
m_fields->m_gameLevel = p0;
std::cout << p0->m_levelLength << std::endl;
m_fields->oldLevelType = p0->m_levelType;
if (Hacks::isHackEnabled("Level Edit")) {
m_fields->m_gameLevel->m_levelType = static_cast<GJLevelType>(2);
//m_fields->m_gameLevel->m_levelType = static_cast<GJLevelType>(2);
}
auto testModeLabel = dynamic_cast<CCLabelBMFont*>(this->getChildren()->objectAtIndex(this->getChildrenCount() - 1));
if (testModeLabel != nullptr && !strcmp(testModeLabel->getString(), "Testmode") && Hacks::isHackEnabled("Hide Testmode")) {
Expand Down Expand Up @@ -861,24 +870,6 @@ class $modify(PlayLayer) {
}
return PlayLayer::init(p0);
}
// No Mirror Transition, Instant Mirror Portal
void toggleFlipped(bool p0, bool p1) { // i spent a lot of time figuring out why CCActionTween wont hook, only to realize that p1 instantly transitions it
if (Hacks::isHackEnabled("Enable Patching")) return PlayLayer::toggleFlipped(p0, p1);
/*
pCVar2 = (CCActionInterval *)cocos2d::CCActionTween::create((float)uVar8,(char *)0x3f000000,(float)((ulonglong)uVar8 >> 0x20),fVar7);
*\/
// MOV DWORD PTR [ESP], 3F
// ??* esp = 0x3F;
if (!Hacks::isHackEnabled("No Mirror Transition")) PlayLayer::toggleFlipped(p0, Hacks::isHackEnabled("Instant Mirror Portal"));
}
void togglePracticeMode(bool p0) {
PlayLayer::togglePracticeMode(p0);
if (Hacks::isHackEnabled("Enable Patching")) return;
if (Hacks::isHackEnabled("Practice Music") && p0) {
PlayLayer::markCheckpoint(); // a weird bug that i dont know how to fix! for some reason the music only works if you have one checkpoint, can someone tell me how to fix!
PlayLayer::startMusic();
}
}
// Accurate Percentage
void updateProgressbar() {
Expand All @@ -896,7 +887,7 @@ pCVar2 = (CCActionInterval *)cocos2d::CCActionTween::create((float)uVar8,(char *
}
}
/*void levelComplete() {
/\*void levelComplete() {
if (!Hacks::isHackEnabled("Safe Mode") || Hacks::isHackEnabled("Enable Patching")) return PlayLayer::levelComplete();
PlayLayer::resetLevel(); // haha
}
Expand All @@ -921,7 +912,6 @@ class $modify(PlayerObject) {
if (!Hacks::isHackEnabled("No Solids")) return PlayerObject::collidedWithObject(fl, obj);
return PlayerObject::collidedWithObject(fl, obj);
}*/
//GJBaseGameLayer* m_baseGame;
#ifndef GEODE_IS_ANDROID // for whatever reason, fields arent found!
bool was_platformer;
float old_gravity;
Expand All @@ -930,17 +920,18 @@ class $modify(PlayerObject) {
}*/
// Freeze Player
void update(float dt) {
if (!was_platformer) {
was_platformer = this->m_isPlatformer;
if (!m_fields->was_platformer) {
m_fields->was_platformer = this->m_isPlatformer;
}
if (Hacks::isHackEnabled("Force Platformer Mode")) {
this->m_isPlatformer = true;
togglePlatformerMode(true);
} else {
this->m_isPlatformer = m_fields->was_platformer;
togglePlatformerMode(m_fields->was_platformer);
}
auto gravityHack = Hacks::getHack("Gravity Value");
if (Hacks::isHackEnabled("Change Gravity")) { // assume its enabled
m_gravityMod = gravityHack->value.floatValue;
std::cout << gravityHack->value.floatValue;
} else {
m_gravityMod = m_fields->old_gravity;
}
Expand Down Expand Up @@ -1004,6 +995,7 @@ class $modify(GameObject) {
//}*/
// yes letes overwrite fields!
// plesae commit add paddings for android64 and windows kthx
if (!Hacks::isHackEnabled("Layout Mode")) return GameObject::setVisible(v);
int objectID = -1;
GameObjectType objectType;
int objectTypeInt = -1;
Expand All @@ -1018,7 +1010,6 @@ class $modify(GameObject) {
objectType = *reinterpret_cast<GameObjectType*>(reinterpret_cast<uintptr_t>(this) + 0x904);
#endif
#endif
if (!Hacks::isHackEnabled("Layout Mode")) return GameObject::setVisible(v);
GameObject::setVisible(v);
#ifdef GEODE_IS_WINDOWS
if (objectType == GameObjectType::Decoration && objectID != 44) { // 44 being practice mode checkpoint, because thats a "decoration"
Expand Down Expand Up @@ -1147,6 +1138,11 @@ class $modify(LevelInfoLayer) {
bool init(GJGameLevel *p0, bool p1) {
if (!LevelInfoLayer::init(p0, p1)) return false;
if (Hacks::isHackEnabled("Copy Hack")) {
auto gm = GameManager::sharedState();
if (gm->m_playerUserID_a == p0->m_userID) return true;
if (gm->m_playerUserID_b == p0->m_userID) return true;
if (gm->m_playerUserID == p0->m_userID) return true;
if ((gm->m_playerUserID_a + gm->m_playerUserID_b) == p0->m_userID) return true;
auto aCloneBtn = CCMenuItemSpriteExtra::create(CCSprite::createWithSpriteFrameName("GJ_duplicateBtn_001.png"), this, menu_selector(LevelInfoLayer::confirmClone));
aCloneBtn->setPosition(m_cloneBtn->getPosition());
m_cloneBtn->getParent()->addChild(aCloneBtn);
Expand Down

0 comments on commit dae7975

Please sign in to comment.