From c450962ede6b5024662d7855b5757589aabb7df6 Mon Sep 17 00:00:00 2001 From: ninXout <58670749+ninXout@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:21:04 -0400 Subject: [PATCH 01/25] Add 2 DrawGridLayer functions, fix FMODAudioEngine on mac --- bindings/GeometryDash.bro | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index 54dc755f2..d60c36883 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -1141,9 +1141,9 @@ class DrawGridLayer : cocos2d::CCLayer { return editorLayer->m_drawGridLayer; } - bool init(cocos2d::CCNode* grid, LevelEditorLayer* editor) = win 0x16c4d0; + bool init(cocos2d::CCNode* grid, LevelEditorLayer* editor) = win 0x16c4d0, mac 0x2729a0; virtual void draw() = win 0x16ce90, mac 0xa3c40; - virtual void update(float) = win 0x16cd80; + virtual void update(float) = win 0x16cd80, mac 0xa3b30; void clearPlayerPoints() { m_playerNodePoints->removeAllObjects(); m_player2NodePoints->removeAllObjects(); @@ -1736,7 +1736,7 @@ class FMODAudioEngine : cocos2d::CCNode { virtual void update(float) = win 0x23b20; cocos2d::CCDictionary* m_dictionary; - std::string m_filePath; + gd::string m_filePath; float m_backgroundMusicVolume; float m_effectsVolume; float m_pulse1; @@ -3847,7 +3847,7 @@ class LevelEditorLayer : GJBaseGameLayer, LevelSettingsDelegate { virtual void calculateColorValues(EffectGameObject*, EffectGameObject*, int, float, ColorActionSprite*, GJEffectManager*) = mac 0x9c590, win 0x166f90; virtual void addToGroup(GameObject*, int, bool) = mac 0x9dab0, win 0x167310; virtual void removeFromGroup(GameObject*, int) = mac 0x9db60, win 0x1673a0; - virtual void timeForXPos(float) = mac 0x9c7d0, win 0x167210; + virtual float timeForXPos(float) = mac 0x9c7d0, win 0x167210; virtual void xPosForTime(float) = mac 0x9c800, win 0x167250; virtual void levelSettingsUpdated() = mac 0x93f30, win 0x1606c0; static LevelEditorLayer* create(GJGameLevel* level) = mac 0x90fb0, win 0x15ed60, ios 0x261628; From a6c04dd7155c5c2d5eebdbbf7863c8b5de98deba Mon Sep 17 00:00:00 2001 From: Fleeym <61891787+Fleeym@users.noreply.github.com> Date: Fri, 6 Oct 2023 00:38:10 +0300 Subject: [PATCH 02/25] add SetupRotatePopup stuff --- bindings/GeometryDash.bro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index d60c36883..4d282ddf8 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -5414,6 +5414,11 @@ class SetupPulsePopup : FLAlertLayer, cocos2d::extension::ColorPickerDelegate, T int m_pulseMode; // 0x38c on mac } +class SetupRotatePopup : FLAlertLayer { + void onClose(cocos2d::CCObject*) = win 0x244150; + virtual void keyBackClicked() = win 0x2441a0; +} + class SetupShakePopup : FLAlertLayer { static SetupShakePopup* create(EffectGameObject*, cocos2d::CCArray*) = mac 0x3adc00; } From 7c9da85f9d74e569ccf3cd76c20230258ed5d7d7 Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Sat, 7 Oct 2023 16:40:38 +0300 Subject: [PATCH 03/25] add CCCallFuncND::create on mac --- bindings/Cocos2d.bro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bindings/Cocos2d.bro b/bindings/Cocos2d.bro index 9694c00b2..900aae677 100644 --- a/bindings/Cocos2d.bro +++ b/bindings/Cocos2d.bro @@ -87,6 +87,11 @@ class cocos2d::CCCallFuncO { static auto create(cocos2d::CCObject*, cocos2d::SEL_CallFuncO, cocos2d::CCObject*) = mac 0x455940; } +[[link(win)]] +class cocos2d::CCCallFuncND { + static auto create(cocos2d::CCObject*, cocos2d::SEL_CallFuncND, void*) = mac 0x455470; +} + [[link(win)]] class cocos2d::CCClippingNode { CCClippingNode() { From a01b29dcdf06f50b22ced4a167bdca4bd7134d43 Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Sat, 7 Oct 2023 17:33:38 +0300 Subject: [PATCH 04/25] add EditorUI::deactivateScaleControl --- bindings/GeometryDash.bro | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index 4d282ddf8..af43a9d38 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -1410,6 +1410,7 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ void onSettings(cocos2d::CCObject* sender) = win 0x77fe0; void activateRotationControl(cocos2d::CCObject* sender) = win 0x8fe70, mac 0x24480; void activateScaleControl(cocos2d::CCObject* sender) = mac 0x24c80, win 0x889b0; + void deactivateScaleControl() = win 0x88bf0, mac 0xb290; void dynamicGroupUpdate(bool idk) = win 0x8ad10; void createRockOutline() = win 0x89c10; void createRockEdges() = win 0x88ec0; From 64f6870f823063edc3a8b356676a4bb191c3efc3 Mon Sep 17 00:00:00 2001 From: Ashton <38200084+Alphatism@users.noreply.github.com> Date: Sun, 8 Oct 2023 01:52:55 -0400 Subject: [PATCH 05/25] Add some more bindings --- bindings/GeometryDash.bro | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index af43a9d38..d9a6a7e95 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -2438,10 +2438,14 @@ class GJGarageLayer : cocos2d::CCLayer, TextInputDelegate, FLAlertLayerProtocol, void onDartIcon(cocos2d::CCObject* sender) = win 0x128420; void onRobotIcon(cocos2d::CCObject* sender) = win 0x1286d0; void onSpiderIcon(cocos2d::CCObject* sender) = win 0x128890; + void onPlayerDeathEffect(cocos2d::CCObject* sender) = win 0x128a50; + void onPlayerTrail(cocos2d::CCObject* sender) = win 0x128af0; void onShards(cocos2d::CCObject* sender) = win 0x12ad70; void onBack(cocos2d::CCObject* sender) = win 0x12adf0; void onShop(cocos2d::CCObject* sender) = win 0x12ad90; void setupColorSelect() = mac 0x1b7500; + void showCircleWave() = win 0x12aad0; + void showBlackCircleWave() = win 0x12a9d0; PAD = mac 0x10, win 0x8; CCTextInputNode* m_nameInput; SimplePlayer* m_playerPreview; @@ -2553,6 +2557,7 @@ class GJRobotSprite : CCAnimatedSprite { virtual void hideSecondary() = mac 0x34c3b0, win 0x146c90; static GJRobotSprite* create() = mac 0x34ac00, win 0x1457a0; void updateColor02(cocos2d::_ccColor3B) = mac 0x34bbd0, win 0x1461c0; + void updateGlowColor(cocos2d::_ccColor3B, bool) = win 0x1460C0; void updateFrame(int) = mac 0x34bdd0, win 0x146700; void hideGlow() = mac 0x34b860; @@ -4040,8 +4045,13 @@ class LevelInfoLayer : cocos2d::CCLayer, LevelDownloadDelegate, LevelUpdateDeleg void setupLevelInfo() = mac 0x161C80, win 0x178680; void downloadLevel() = win 0x177d90, mac 0x161b90; void onPlay(cocos2d::CCObject* sender) = mac 0x161840, win 0x179730; + void onBack(cocos2d::CCObject* sender) = mac 0x163810, win 0x17C110; + void onDelete(cocos2d::CCObject* sender) = mac 0x162f30, win 0x17A2B0; + virtual void levelDownloadFinished(GJGameLevel*) = mac 0x164C00, win 0x1790C0; virtual void levelUpdateFinished(GJGameLevel*, UpdateResponse) = mac 0x164E60, win 0x1792B0; + virtual void keyBackClicked() = win 0x17C1D0; + void showUpdateAlert(UpdateResponse) = mac 0x164ED0, win 0x179300; void updateLabelValues() = mac 0x164090, win 0x17b170; @@ -4227,6 +4237,7 @@ class LikeItemLayer : FLAlertLayer { class ListButtonBar : cocos2d::CCNode { BoomScrollLayer* m_scrollLayer; + void switchedPage(int page) = win 0x29c50; } class ListButtonBarDelegate {} @@ -5049,7 +5060,7 @@ class PlayerObject : GameObject, AnimatedSpriteDelegate { PAD = mac 0x14, win 0x14; bool m_unk4D4; cocos2d::CCArray* m_particleSystems; - bool m_unk4DC; + bool m_hasGlow; bool m_isHidden; int m_hasGhostTrail; GhostTrailEffect* m_ghostTrail; From d4a760d6edc7f33a0f4b2efa3b4a5812cc452735 Mon Sep 17 00:00:00 2001 From: ConfiG Date: Sun, 8 Oct 2023 20:40:59 +0300 Subject: [PATCH 06/25] LevelSelectLayer::init --- bindings/GeometryDash.bro | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index d9a6a7e95..fc72ee994 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -4112,6 +4112,7 @@ class LevelSearchLayer : cocos2d::CCLayer { class LevelSelectLayer : cocos2d::CCLayer { static LevelSelectLayer* create(int lvl) = win 0x185500; + bool init(int lvl) = win 0x1855a0, mac 0x2384e0; PAD = win 0x10; BoomScrollLayer* m_scrollLayer; From cc812160f4b954335a5be0a170e354baf12dc91f Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Sun, 8 Oct 2023 16:01:47 -0300 Subject: [PATCH 07/25] add the cursed hasBeenActivatedByPlayer --- bindings/GeometryDash.bro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index fc72ee994..671feb067 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -3309,7 +3309,7 @@ class GameObject : CCSpritePlus { void groupWasDisabled() = mac 0x33b110; void groupWasEnabled() = mac 0x33b0f0; void hasBeenActivated() = mac 0x342a80; - void hasBeenActivatedByPlayer(GameObject*) = mac 0x342a50; + bool hasBeenActivatedByPlayer(GameObject*) = mac 0x342a50, win 0xEF110; void hasSecondaryColor() = mac 0x342f80; void ignoreEnter() = mac 0x3352a0; void ignoreFade() = mac 0x335290; From 0a113744821b2a79d30b54e4b137bd36a0cbd752 Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Sun, 8 Oct 2023 16:02:22 -0300 Subject: [PATCH 08/25] fix GEODE_CLI force caching when not found --- cmake/GeodeFile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/GeodeFile.cmake b/cmake/GeodeFile.cmake index f44b7d263..8348624da 100644 --- a/cmake/GeodeFile.cmake +++ b/cmake/GeodeFile.cmake @@ -1,7 +1,7 @@ set(GEODE_CLI_MINIMUM_VERSION 1.0.5) # Find Geode CLI -if (NOT DEFINED GEODE_CLI) +if (NOT DEFINED GEODE_CLI OR GEODE_CLI STREQUAL "GEODE_CLI-NOTFOUND") find_program(GEODE_CLI NAMES geode.exe geode-cli.exe geode geode-cli PATHS ${CLI_PATH}) endif() From 2f031487a398b0ad18de0ebf95d0eadc3ac5500c Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Sun, 8 Oct 2023 16:07:24 -0300 Subject: [PATCH 09/25] fix outdated link --- cmake/GeodeFile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/GeodeFile.cmake b/cmake/GeodeFile.cmake index 8348624da..1c67a290b 100644 --- a/cmake/GeodeFile.cmake +++ b/cmake/GeodeFile.cmake @@ -59,7 +59,7 @@ function(setup_geode_mod proname) if(GEODE_CLI STREQUAL "GEODE_CLI-NOTFOUND") message(FATAL_ERROR "setup_geode_mod called, but Geode CLI was not found - " - "Please install CLI: https://docs.geode-sdk.org/info/installcli/" + "Please install CLI: https://docs.geode-sdk.org/" ) return() endif() From 1eb72efa9a9ca523ca15e22c27cb7182787fda05 Mon Sep 17 00:00:00 2001 From: dankmeme01 <42031238+dankmeme01@users.noreply.github.com> Date: Fri, 6 Oct 2023 21:32:21 +0200 Subject: [PATCH 10/25] fix return types of timeForXPos and timeForXPos2 --- bindings/GeometryDash.bro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index 671feb067..21ad2ed4d 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -4681,8 +4681,8 @@ class PlayLayer : GJBaseGameLayer, CCCircleWaveDelegate, CurrencyRewardDelegate, void switchToRobotMode(PlayerObject*, GameObject*, bool) = mac 0x7bc80; void switchToRollMode(PlayerObject*, GameObject*, bool) = mac 0x7bbe0; void switchToSpiderMode(PlayerObject*, GameObject*, bool) = mac 0x7bd20; - void timeForXPos(float) = mac 0x7d120, win 0x2087d0; - void timeForXPos2(float, bool) = mac 0x293eb0, win 0x1fd3d0; + float timeForXPos(float) = mac 0x7d120, win 0x2087d0; + float timeForXPos2(float, bool) = mac 0x293eb0, win 0x1fd3d0; void toggleBGEffectVisibility(bool) = mac 0x7fe80; void toggleDualMode(GameObject*, bool, PlayerObject*, bool) = mac 0x7bf90, win 0x208880; void toggleFlipped(bool, bool) = mac 0x7bdc0, win 0x20ab20; From 572386c291133fb6faa16cc6badd38d95dd56ffb Mon Sep 17 00:00:00 2001 From: dankmeme01 <42031238+dankmeme01@users.noreply.github.com> Date: Sat, 7 Oct 2023 20:49:16 +0200 Subject: [PATCH 11/25] add callback to PlayLayer::timeForXPos fixes a crash when trying to use the function --- bindings/GeometryDash.bro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index 21ad2ed4d..a7eabf574 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -4681,7 +4681,7 @@ class PlayLayer : GJBaseGameLayer, CCCircleWaveDelegate, CurrencyRewardDelegate, void switchToRobotMode(PlayerObject*, GameObject*, bool) = mac 0x7bc80; void switchToRollMode(PlayerObject*, GameObject*, bool) = mac 0x7bbe0; void switchToSpiderMode(PlayerObject*, GameObject*, bool) = mac 0x7bd20; - float timeForXPos(float) = mac 0x7d120, win 0x2087d0; + callback float timeForXPos(float) = mac 0x7d120, win 0x2087d0; float timeForXPos2(float, bool) = mac 0x293eb0, win 0x1fd3d0; void toggleBGEffectVisibility(bool) = mac 0x7fe80; void toggleDualMode(GameObject*, bool, PlayerObject*, bool) = mac 0x7bf90, win 0x208880; From 960fa056af945fb230fab9134b8412206ffa5c99 Mon Sep 17 00:00:00 2001 From: alk <45172705+altalk23@users.noreply.github.com> Date: Tue, 10 Oct 2023 08:46:48 +0300 Subject: [PATCH 12/25] Bring back the checkbox --- .github/ISSUE_TEMPLATE/crash-report.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/crash-report.yml b/.github/ISSUE_TEMPLATE/crash-report.yml index f4c372a44..9e882af88 100644 --- a/.github/ISSUE_TEMPLATE/crash-report.yml +++ b/.github/ISSUE_TEMPLATE/crash-report.yml @@ -2,17 +2,16 @@ name: Crash Report description: Report a Geode bug (not mods themselves) that crashes the game or prevents startup caused by Geode Loader (not mods created by others). labels: [ "unverified", "crash" ] body: - - type: input - id: geode-confirmation + - type: checkboxes attributes: label: Geode Issue description: | The Geode repository is for issues of *Geode Loader*, not individual mods created by other developers. - When submitting a crash report, please make sure that the crash is *actually* related to ***Geode Loader itself*** and not to a mod or mod combination, after you do that type in "confirm" in the input field above. + When submitting a crash report, please make sure that the crash is *actually* related to ***Geode Loader itself*** and not to a mod or mod combination. Failing to do this will get your issue *closed without explanation*. - placeholder: "Please, read the text below." - validations: - required: true + options: + - label: I confirm that this crash is NOT related to a mod but directly to Geode Loader itself. + required: true - type: dropdown id: platform attributes: From c87e8f6b8dad32d466966d8dfea386ff8443f757 Mon Sep 17 00:00:00 2001 From: Catto_ <57293929+CattoDev@users.noreply.github.com> Date: Tue, 10 Oct 2023 22:23:52 +0200 Subject: [PATCH 13/25] Add processSelectObjects for windows (#292) --- bindings/GeometryDash.bro | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index a7eabf574..8693dcd3a 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -1431,6 +1431,7 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ void repositionObjectsToCenter(cocos2d::CCArray* objs, cocos2d::CCPoint center, bool ignoreGroupParent) = mac 0x1fcd0, win 0x88410; virtual void draw() = win 0x8fbe0; float valueFromXPos(float val) = win 0x78e30, mac 0x1c810; + void processSelectObjects(cocos2d::CCArray*) = win 0x86f70; bool m_isPlayingMusic; EditButtonBar* m_buttonBar; From b4fbea51e29d5db4a9d1001f29cdf4124cc9f484 Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:44:37 -0300 Subject: [PATCH 14/25] only write checksum file after unzipping --- loader/src/loader/Index.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/loader/src/loader/Index.cpp b/loader/src/loader/Index.cpp index acb950642..6340c360a 100644 --- a/loader/src/loader/Index.cpp +++ b/loader/src/loader/Index.cpp @@ -252,7 +252,7 @@ class Index::Impl final { friend class Index; void cleanupItems(); - void downloadIndex(); + void downloadIndex(std::string commitHash = ""); void checkForUpdates(); void updateFromLocalTree(); void installNext(size_t index, IndexInstallList const& list); @@ -296,7 +296,7 @@ bool Index::hasTriedToUpdate() const { return m_impl->m_triedToUpdate; } -void Index::Impl::downloadIndex() { +void Index::Impl::downloadIndex(std::string commitHash) { log::debug("Downloading index"); IndexUpdateEvent(UpdateProgress(0, "Beginning download")).post(); @@ -307,7 +307,7 @@ void Index::Impl::downloadIndex() { .join("index-download") .fetch("https://github.com/geode-sdk/mods/zipball/main") .into(targetFile) - .then([this, targetFile](auto) { + .then([this, targetFile, commitHash](auto) { auto targetDir = dirs::getIndexDir() / "v0"; // delete old unzipped index try { @@ -333,6 +333,10 @@ void Index::Impl::downloadIndex() { // remove the directory github adds to the root of the zip (void)flattenGithubRepo(targetDir); + if (!commitHash.empty()) { + auto const checksumPath = dirs::getIndexDir() / ".checksum"; + (void)file::writeString(checksumPath, commitHash); + } Loader::get()->queueInMainThread([this] { // update index @@ -387,8 +391,7 @@ void Index::Impl::checkForUpdates() { } // otherwise save hash and download source else { - (void)file::writeString(checksum, newSHA); - this->downloadIndex(); + this->downloadIndex(newSHA); } }) .expect([](std::string const& err) { From 924b7921aeb37aa735f006f3cefbd22a05125440 Mon Sep 17 00:00:00 2001 From: Fleeym <61891787+Fleeym@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:52:00 +0300 Subject: [PATCH 15/25] add LevelEditorLayer::getNextColorChannel to win --- bindings/GeometryDash.bro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index 8693dcd3a..2d22e793c 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -3873,7 +3873,7 @@ class LevelEditorLayer : GJBaseGameLayer, LevelSettingsDelegate { cocos2d::CCArray* createObjectsFromString(gd::string, bool) = mac 0x94730, win 0x160980; void getLastObjectX() = mac 0x9c860, win 0x167290; gd::string getLevelString() = mac 0x97790, win 0x162480; - void getNextColorChannel() = mac 0x9a610; + int getNextColorChannel() = mac 0x9a610, win 0x164e10; void getNextFreeBlockID(cocos2d::CCArray*) = mac 0x9a4e0; int getNextFreeGroupID(cocos2d::CCArray*) = mac 0x9a1b0, win 0x164ae0; void getNextFreeItemID(cocos2d::CCArray*) = mac 0x9a390; From 8762714c23f5fd7dc451d1e3f30f6e412334fcad Mon Sep 17 00:00:00 2001 From: Fleeym <61891787+Fleeym@users.noreply.github.com> Date: Wed, 11 Oct 2023 19:56:33 +0300 Subject: [PATCH 16/25] only show update indicator if mod is enabled --- loader/src/loader/Index.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/src/loader/Index.cpp b/loader/src/loader/Index.cpp index 6340c360a..ff1d4b1d1 100644 --- a/loader/src/loader/Index.cpp +++ b/loader/src/loader/Index.cpp @@ -594,7 +594,7 @@ bool Index::isUpdateAvailable(IndexItemHandle item) const { bool Index::areUpdatesAvailable() const { for (auto& mod : Loader::get()->getAllMods()) { auto item = this->getMajorItem(mod->getID()); - if (item && item->getMetadata().getVersion() > mod->getVersion()) { + if (item && item->getMetadata().getVersion() > mod->getVersion() && mod->isEnabled()) { return true; } } From 0bdb0df70225a3a008bf79b98175d9202efc84ae Mon Sep 17 00:00:00 2001 From: altalk23 <45172705+altalk23@users.noreply.github.com> Date: Wed, 11 Oct 2023 21:03:54 +0300 Subject: [PATCH 17/25] this code is still very sad --- loader/include/Geode/c++stl/gnustl.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/loader/include/Geode/c++stl/gnustl.hpp b/loader/include/Geode/c++stl/gnustl.hpp index b47afad8b..668c03337 100644 --- a/loader/include/Geode/c++stl/gnustl.hpp +++ b/loader/include/Geode/c++stl/gnustl.hpp @@ -405,9 +405,7 @@ namespace gd { } ~vector() { - for (auto i = m_start; i != m_finish; ++i) { - delete i; - } + if (m_start) delete m_start; } size_t size() const { From b55e6465ce7ba5013b44dfe74dc981b1f13fa99f Mon Sep 17 00:00:00 2001 From: mat <26722564+matcool@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:23:13 -0300 Subject: [PATCH 18/25] fix gnustl vector dtor --- loader/include/Geode/c++stl/gnustl.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/loader/include/Geode/c++stl/gnustl.hpp b/loader/include/Geode/c++stl/gnustl.hpp index 668c03337..a7d87cb6e 100644 --- a/loader/include/Geode/c++stl/gnustl.hpp +++ b/loader/include/Geode/c++stl/gnustl.hpp @@ -405,7 +405,12 @@ namespace gd { } ~vector() { - if (m_start) delete m_start; + if (m_start) { + for (auto& x : *this) { + x.~T(); + } + delete m_start; + } } size_t size() const { From c967b520dfebd92fc88d60ef6099115c85b2e96c Mon Sep 17 00:00:00 2001 From: altalk23 <45172705+altalk23@users.noreply.github.com> Date: Wed, 11 Oct 2023 22:16:12 +0300 Subject: [PATCH 19/25] fix the index notif staying on all the time --- loader/include/Geode/ui/SceneManager.hpp | 1 + loader/src/ui/nodes/Notification.cpp | 1 - loader/src/ui/nodes/SceneManager.cpp | 5 +++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/loader/include/Geode/ui/SceneManager.hpp b/loader/include/Geode/ui/SceneManager.hpp index 2539f1822..2077f49bc 100644 --- a/loader/include/Geode/ui/SceneManager.hpp +++ b/loader/include/Geode/ui/SceneManager.hpp @@ -13,6 +13,7 @@ namespace geode { class GEODE_DLL SceneManager { protected: cocos2d::CCArray* m_persistedNodes; + cocos2d::CCScene* m_lastScene = nullptr; bool setup(); diff --git a/loader/src/ui/nodes/Notification.cpp b/loader/src/ui/nodes/Notification.cpp index f9bad08ba..449ddde2c 100644 --- a/loader/src/ui/nodes/Notification.cpp +++ b/loader/src/ui/nodes/Notification.cpp @@ -173,7 +173,6 @@ void Notification::show() { auto winSize = CCDirector::get()->getWinSize(); this->setPosition(winSize.width / 2, winSize.height / 4); this->setZOrder(CCScene::get()->getHighestChildZ() + 100); - CCScene::get()->addChild(this); } SceneManager::get()->keepAcrossScenes(this); m_showing = true; diff --git a/loader/src/ui/nodes/SceneManager.cpp b/loader/src/ui/nodes/SceneManager.cpp index 0ec112d7e..ee7a4247a 100644 --- a/loader/src/ui/nodes/SceneManager.cpp +++ b/loader/src/ui/nodes/SceneManager.cpp @@ -23,6 +23,10 @@ SceneManager::~SceneManager() { } void SceneManager::keepAcrossScenes(CCNode* node) { + if (m_lastScene) { + node->removeFromParentAndCleanup(false); + m_lastScene->addChild(node); + } m_persistedNodes->addObject(node); } @@ -36,4 +40,5 @@ void SceneManager::willSwitchToScene(CCScene* scene) { node->removeFromParentAndCleanup(false); scene->addChild(node); } + m_lastScene = scene; } From bf2022aee4e9e63fc9607d33d78e8f85c48561f8 Mon Sep 17 00:00:00 2001 From: Cvolton Date: Fri, 13 Oct 2023 19:21:13 +0200 Subject: [PATCH 20/25] fix MoreSearchLayer::create on Mac --- bindings/GeometryDash.bro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index 2d22e793c..7a16adfdb 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -4354,7 +4354,7 @@ class MenuLayer : cocos2d::CCLayer, FLAlertLayerProtocol, GooglePlayDelegate { class MessageListDelegate {} class MoreSearchLayer : FLAlertLayer { - static MoreSearchLayer* create() = mac 0x38ab40, win 0x182520; + static MoreSearchLayer* create() = mac 0x388180, win 0x182520; virtual bool init() = mac 0x3896b0, win 0x1825c0; void onClose(cocos2d::CCObject*) = mac 0x38aa40, win 0x1848f0; } From 2b4825ae1335b408dc17b53972c2454f63e3413c Mon Sep 17 00:00:00 2001 From: ConfiG Date: Fri, 13 Oct 2023 23:57:07 +0300 Subject: [PATCH 21/25] bindings stuff --- bindings/GeometryDash.bro | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index 7a16adfdb..e113e63bf 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -1730,11 +1730,13 @@ class FLAlertLayerProtocol { class FMODAudioEngine : cocos2d::CCNode { static FMODAudioEngine* sharedEngine() = mac 0x20ef80, win 0x239f0; + void setupAudioEngine() = win 0x23a70; void preloadEffect(gd::string filename) = win 0x24240; bool isBackgroundMusicPlaying() = win 0x24050; bool isBackgroundMusicPlaying(gd::string path) = win 0x24080; void playBackgroundMusic(gd::string path, bool fade, bool paused) = win 0x23d80; - + void setBackgroundMusicTime(float time) = win 0x23fb0; + virtual void update(float) = win 0x23b20; cocos2d::CCDictionary* m_dictionary; @@ -2682,7 +2684,7 @@ class GJSpiderSprite : GJRobotSprite { class GJSpriteColor : cocos2d::CCNode { int m_colorID; int m_defaultColorID; - float m_unk_0F4; + float m_opacity; cocos2d::ccHSVValue m_hsv; bool m_usesHSV; float unk_10C; @@ -3282,15 +3284,16 @@ class GameObject : CCSpritePlus { void addToTempOffset(float, float) = mac 0x335700; void calculateOrientedBox() = mac 0x342b20, win 0xef1a0; void canChangeCustomColor() = mac 0x342db0; - cocos2d::_ccColor3B& colorForMode(int, bool) = mac 0x343460, win 0xef8d0; float groupOpacityMod() = win 0xebda0; + cocos2d::_ccColor3B& colorForMode(int colorMode, bool isMain) = mac 0x343460, win 0xef8d0; + cocos2d::_ccColor3B& groupColor(cocos2d::_ccColor3B const&, bool) = win 0xef9e0; + cocos2d::_ccColor3B& getActiveColorForMode(int, bool) = mac 0x343860, win 0xefb10; void commonSetup() = mac 0x2f5570, win 0xcfac0; void copyGroups(GameObject*) = mac 0x33ae30, win 0xeb9d0; static GameObject* createWithFrame(const char*) = mac 0x2f5490, win 0xcf8f0; static GameObject* createWithKey(int) = mac 0x2f4ce0, win 0xcf4f0; void destroyObject() = mac 0x336a00; void determineSlopeDirection() = mac 0x33a9e0, win 0xeb670; - cocos2d::_ccColor3B& getActiveColorForMode(int, bool) = mac 0x343860, win 0xefb10; void getBallFrame(int) = mac 0x341bf0; cocos2d::CCPoint getBoxOffset() = mac 0x3353d0, win 0xef350; const cocos2d::_ccColor3B& getColorIndex() = mac 0x343b90; @@ -3350,8 +3353,7 @@ class GameObject : CCSpritePlus { bool canAllowMultiActivate() = mac 0x343ca0, win 0xf06b0; void createGroupContainer(int size) = mac 0x33aca0, win 0xeb870; - bool m_unk3; - bool m_isBlueMaybe; + cocos2d::_ccColor3B m_color; float m_unk2; float m_unk; float m_unk3f; @@ -3454,7 +3456,7 @@ class GameObject : CCSpritePlus { int m_objectID; bool m_unk364; bool m_unk365; - bool m_unk366; + bool m_ignoreEnter; bool m_ignoreFade; bool m_unk368; bool m_unk369; @@ -4683,7 +4685,8 @@ class PlayLayer : GJBaseGameLayer, CCCircleWaveDelegate, CurrencyRewardDelegate, void switchToRollMode(PlayerObject*, GameObject*, bool) = mac 0x7bbe0; void switchToSpiderMode(PlayerObject*, GameObject*, bool) = mac 0x7bd20; callback float timeForXPos(float) = mac 0x7d120, win 0x2087d0; - float timeForXPos2(float, bool) = mac 0x293eb0, win 0x1fd3d0; + float timeForXPos2(float, bool) = mac 0x293eb0, win 0x208800; + callback float xPosForTime(float) = mac 0x7d140, win 0x208840; void toggleBGEffectVisibility(bool) = mac 0x7fe80; void toggleDualMode(GameObject*, bool, PlayerObject*, bool) = mac 0x7bf90, win 0x208880; void toggleFlipped(bool, bool) = mac 0x7bdc0, win 0x20ab20; @@ -4712,7 +4715,6 @@ class PlayLayer : GJBaseGameLayer, CCCircleWaveDelegate, CurrencyRewardDelegate, virtual void visit() = mac 0x75ef0, win 0x200020; void visitWithColorFlash() = mac 0x761f0, win 0x200190; void willSwitchToMode(int, PlayerObject*) = mac 0x7b9e0; - void xPosForTime(float) = mac 0x7d140, win 0x208840; ~PlayLayer() = mac 0x6b090, win 0x1fafc0; float unused4c8; @@ -4743,7 +4745,7 @@ class PlayLayer : GJBaseGameLayer, CCCircleWaveDelegate, CurrencyRewardDelegate, EndPortalObject* m_endPortal; cocos2d::CCArray* m_checkpoints; cocos2d::CCArray* m_speedObjects; - cocos2d::CCArray* unk340; + cocos2d::CCArray* m_allSpeedObjects; cocos2d::CCArray* unk344; cocos2d::CCSprite* unk348; float m_backgroundRepeat; @@ -4917,7 +4919,7 @@ class PlayerObject : GameObject, AnimatedSpriteDelegate { void boostPlayer(float) = mac 0x21d6b0, win 0x1f8f30; void bumpPlayer(float, int) = mac 0x22d890; void buttonDown(PlayerButton) = mac 0x22b7e0; - void checkSnapJumpToObject(GameObject*) = mac 0x2217f0; + void checkSnapJumpToObject(GameObject*) = mac 0x2217f0, win 0x1ece70; bool collidedWithObject(float fl, GameObject* obj) { auto rect = obj->getObjectRect(); return collidedWithObject(fl, obj, rect); @@ -5594,12 +5596,11 @@ class SpawnTriggerAction : cocos2d::CCNode { } class SpeedObject : cocos2d::CCNode { - float m_unknown; - float m_somethingToCompare; - float m_idk3; - float m_idk4; + Speed m_speed; + float m_xPos; + GameObject* m_object; - static SpeedObject* create(GameObject*, int, float) = win 0x20DE70; + static SpeedObject* create(GameObject* object, Speed speed, float x) = win 0x20de70; } class SpritePartDelegate {} From 4ec869ee1dac88ac24e66c9af8d7ab203913e32a Mon Sep 17 00:00:00 2001 From: Catto_ <57293929+CattoDev@users.noreply.github.com> Date: Sat, 14 Oct 2023 18:11:48 +0200 Subject: [PATCH 22/25] processSelectObjects mac binding --- bindings/GeometryDash.bro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index e113e63bf..968962a31 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -1431,7 +1431,7 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ void repositionObjectsToCenter(cocos2d::CCArray* objs, cocos2d::CCPoint center, bool ignoreGroupParent) = mac 0x1fcd0, win 0x88410; virtual void draw() = win 0x8fbe0; float valueFromXPos(float val) = win 0x78e30, mac 0x1c810; - void processSelectObjects(cocos2d::CCArray*) = win 0x86f70; + void processSelectObjects(cocos2d::CCArray*) = win 0x86f70, mac 0x24110; bool m_isPlayingMusic; EditButtonBar* m_buttonBar; From c03b30e8bd5b45083f50496cc6f3452ac4b5b647 Mon Sep 17 00:00:00 2001 From: ConfiG Date: Sat, 14 Oct 2023 20:14:25 +0300 Subject: [PATCH 23/25] some GameObject members --- bindings/GeometryDash.bro | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index 968962a31..ee7d9eec6 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -3324,7 +3324,15 @@ class GameObject : CCSpritePlus { void loadGroupsFromString(gd::string str) = mac 0x33b380, win 0xebcb0; static GameObject* objectFromString(gd::string, bool) = mac 0x33b720, win 0xebe50; void playShineEffect() = mac 0x2fa9d0, win 0xeab20; - void quickUpdatePosition() = mac 0x335790; + //void quickUpdatePosition() = mac 0x335790; + // inlined on windows + void quickUpdatePosition() { + cocos2d::CCPoint newPos = getRealPosition(); + this->setPosition(newPos); + if (m_detailSprite && !m_hasDetailColor) { + m_detailSprite->setPosition(newPos); + } + } void removeGlow() = mac 0x2f7f70; void resetGroupDisabled() = mac 0x2fa7e0; void saveActiveColors() = mac 0x33d250, win 0xee3e0; @@ -3510,8 +3518,8 @@ class GameObject : CCSpritePlus { int m_unk414; PAD = mac 0xc, win 0xc; cocos2d::CCPoint m_firstPosition; - bool m_unk42C; - bool m_unk42D; + bool m_queuedForPositionUpdate; + bool m_shouldUpdateFirstPosition; PAD = mac 0x6, win 0x6; bool m_isAnimated; PAD = mac 0x7, win 0x7; @@ -3528,7 +3536,7 @@ class GameObject : CCSpritePlus { GJEffectManager* m_effectManager; bool m_unk458; bool m_unk459; - bool m_unk45A; + bool m_inOptimizedGroup; bool m_wasForcedRotatedPositionUpdateIdk; PAD = mac 0x8, win 0x8; bool m_orbMultiActivate; From def813e6f3695d4f2d9a797bef3cfd1e44befe91 Mon Sep 17 00:00:00 2001 From: Fleeym <61891787+Fleeym@users.noreply.github.com> Date: Sun, 15 Oct 2023 02:32:18 +0300 Subject: [PATCH 24/25] custom song widget members and functions --- bindings/GeometryDash.bro | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index 968962a31..10cd86d9c 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -1012,16 +1012,46 @@ class CustomSongLayer : FLAlertLayer, FLAlertLayerProtocol, TextInputDelegate, G } class CustomSongWidget : cocos2d::CCNode, MusicDownloadDelegate, FLAlertLayerProtocol { - bool init(SongInfoObject*, LevelSettingsObject*, bool, bool, bool, bool, bool hideBackground) = mac 0x37be20, win 0x685b0; + bool init(SongInfoObject*, LevelSettingsObject*, bool, bool, bool, bool, bool) = mac 0x37be20, win 0x685b0; void FLAlert_Clicked(FLAlertLayer*, bool) {} void loadSongInfoFinished(SongInfoObject*) {} + void startDownload() = win 0x69610; + void startMonitorDownload() = win 0x696b0; + void updatePlaybackBtn() = win 0x69970; + void updateSongInfo() = win 0x69bf0; void updateSongObject(SongInfoObject* song) = win 0x69280, mac 0x37d690; + void onCancelDownload(CCObject*) = win 0x693b0; + void onDownload(CCObject*) = win 0x69540; + void onGetSongInfo(CCObject*) = win 0x69490; + void onMore(CCObject*) = win 0x68e20; + void onPlayback(CCObject*) = win 0x697b0; + void onSelect(CCObject*) = win 0x69760; SongInfoObject* m_songInfo; - PAD = win 0x1C; + cocos2d::CCMenu* m_buttonMenu; + cocos2d::CCLabelBMFont* m_songLabel; + cocos2d::CCLabelBMFont* m_artistLabel; + cocos2d::CCLabelBMFont* m_songIDLabel; + cocos2d::CCLabelBMFont* m_errorLabel; CCMenuItemSpriteExtra* m_downloadBtn; - PAD = win 0x30; + CCMenuItemSpriteExtra* m_cancelDownloadBtn; + CCMenuItemSpriteExtra* m_selectSongBtn; + CCMenuItemSpriteExtra* m_getSongInfoBtn; + CCMenuItemSpriteExtra* m_playMusicBtn; + CCMenuItemSpriteExtra* m_moreBtn; + cocos2d::CCSprite* m_sliderGroove; + cocos2d::CCSprite* m_sliderBar; + LevelSettingsObject* m_levelSettings; + bool m_showSelectSongBtn; + bool m_showPlayMusicBtn; + bool m_showDownloadButtons; + bool m_isNotDownloading; + bool m_hasDefaultSong; + PAD = win 0x3; + int m_customSongID; + bool m_unkBool; + PAD = win 0x3; } class CustomizeObjectLayer : FLAlertLayer, TextInputDelegate, HSVWidgetPopupDelegate, ColorSelectDelegate, ColorSetupDelegate { From b941ee2c7cb8ddb52af55ed56aafb4b9354e387b Mon Sep 17 00:00:00 2001 From: Fleeym <61891787+Fleeym@users.noreply.github.com> Date: Sun, 15 Oct 2023 02:35:52 +0300 Subject: [PATCH 25/25] bye bye pads --- bindings/GeometryDash.bro | 2 -- 1 file changed, 2 deletions(-) diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index 10cd86d9c..61f1b37a1 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -1048,10 +1048,8 @@ class CustomSongWidget : cocos2d::CCNode, MusicDownloadDelegate, FLAlertLayerPro bool m_showDownloadButtons; bool m_isNotDownloading; bool m_hasDefaultSong; - PAD = win 0x3; int m_customSongID; bool m_unkBool; - PAD = win 0x3; } class CustomizeObjectLayer : FLAlertLayer, TextInputDelegate, HSVWidgetPopupDelegate, ColorSelectDelegate, ColorSetupDelegate {