diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 8847d1ff..1c0a4994 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,7 +1,17 @@ name: Bug Report -description: Report a bug where something is not working as expected in Geode Loader (not specific mods), which does not crash the game. +description: Report a Geode bug (not mods themselves) where something is not working as expected in Geode Loader (not mods created by others), which does not crash the game. labels: [ "unverified", "bug" ] body: + - 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 bug report, please make sure that the bug 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*. + options: + - label: I confirm that this bug is NOT related to a mod but directly to Geode Loader itself. + required: true - type: dropdown id: platform attributes: diff --git a/.github/ISSUE_TEMPLATE/crash-report.yml b/.github/ISSUE_TEMPLATE/crash-report.yml index a0f69868..9e882af8 100644 --- a/.github/ISSUE_TEMPLATE/crash-report.yml +++ b/.github/ISSUE_TEMPLATE/crash-report.yml @@ -1,7 +1,17 @@ name: Crash Report -description: Report a bug that crashes the game or prevents startup caused by Geode Loader (not individual mods). +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: 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. + Failing to do this will get your issue *closed without explanation*. + 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: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8597aa34..a0cdd586 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -146,21 +146,13 @@ jobs: files: geode-win/XInput9_1_0.dll geode-win/Geode.dll geode-win/GeodeUpdater.exe geode-win/Geode.lib geode-win/Geode.pdb dest: geode-${{ steps.ref.outputs.hash }}-win.zip - # TODO change in 2.0.0 - - name: Zip Windows Resources - uses: vimtor/action-zip@v1.1 - with: - files: geode-win/resources - dest: resources-win.zip - - # This is basically a hack because of line endings. Blame windows. - - name: Zip MacOS Resources + - name: Zip Resources uses: vimtor/action-zip@v1.1 with: files: geode-mac/resources - dest: resources-mac.zip + dest: resources.zip - - name: Update Nightly Release + - name: Update Development Release uses: andelf/nightly-release@main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -174,5 +166,4 @@ jobs: ./geode-installer-${{ steps.ref.outputs.hash }}-win.exe ./geode-${{ steps.ref.outputs.hash }}-mac.zip ./geode-${{ steps.ref.outputs.hash }}-win.zip - ./resources-win.zip - ./resources-mac.zip + ./resources.zip diff --git a/.github/workflows/draft.yml b/.github/workflows/draft.yml index 34f757d2..d6051f79 100644 --- a/.github/workflows/draft.yml +++ b/.github/workflows/draft.yml @@ -28,8 +28,7 @@ jobs: mv dev/geode-installer-*-win.exe geode-installer-v${{ steps.ref.outputs.version }}-win.exe mv dev/geode-*-mac.zip geode-v${{ steps.ref.outputs.version }}-mac.zip mv dev/geode-*-win.zip geode-v${{ steps.ref.outputs.version }}-win.zip - mv dev/resources-win.zip resources-win.zip - mv dev/resources-mac.zip resources-mac.zip + mv dev/resources.zip resources.zip - name: Create Draft Release uses: softprops/action-gh-release@v1 @@ -49,5 +48,4 @@ jobs: ./geode-installer-v${{ steps.ref.outputs.version }}-win.exe ./geode-v${{ steps.ref.outputs.version }}-mac.zip ./geode-v${{ steps.ref.outputs.version }}-win.zip - ./resources-win.zip - ./resources-mac.zip + ./resources.zip diff --git a/.github/workflows/test-offsets.yml b/.github/workflows/test-offsets.yml index 66cfcf47..23403f67 100644 --- a/.github/workflows/test-offsets.yml +++ b/.github/workflows/test-offsets.yml @@ -3,6 +3,9 @@ name: Test Offsets on: workflow_dispatch: push: + paths: + - 'bindings/**' # only when adjusting bindings + - 'loader/test/members/**' branches: - '**' # every branch - '!no-build-**' # unless marked as no-build diff --git a/.gitignore b/.gitignore index 6149f067..e8badae0 100644 --- a/.gitignore +++ b/.gitignore @@ -45,20 +45,29 @@ build2 build-docs/ bin +# Ignore docs folders docs/** docs +# Ignore codegenned files loader/src/internal/about.hpp loader/src/internal/resources.hpp loader/resources/mod.json loader/resources/version loader/resources/blanks/rename.js +loader/resources/about.md loader/resources/changelog.md +loader/resources/support.md + +# Ignore generated files +installer/mac/*.pkg +installer/windows/*.exe + +# Ignore fod's include directories which are stored in this funny file fods-catgirl-hideout.txt + +# Ignore I don't even know what that is probably fod's flash testing script test-docs.bat -# krita files too because alk is funny +# Ignore krita files too because we don't want our project files shaking my head **/*.kra - -installer/mac/*.pkg -installer/windows/*.exe \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 27b007a2..094bce59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Geode Changelog +## v1.3.5 + * Follow redirect in web::utils functions (a942a45) + * Lots of bindings + * Make codegen symbols private visibility (696a2ca) + * Add deadstrip to macos (0d62940) + * Readd the nullptr check in InstallListPopup::createCells (499f256) + * Fix garagelayer ids on not logged in users (dd0179c) + +## v1.3.4 + * Implement string setting character filters (cf8fbba) + * Update bindings + +## v1.3.3 + * Reunify resources.zip (81de161) + +## v1.3.2 + * Fix alignment of some textures (8f39c38) + * Bring back unknown problems (0663569) + * Fix some Windows 7 incompatibility (2d2bdd1) + * Remove enabled from the crashlogs (5b7d318) + * Make index unzipping async (7c582f1) + * Fix mods by developer crashing when mod was toggled (a6a47bf) + * Fix nested lists in the markdown (2723588) + * Fix search paths (8f39c38, aa55ebe) + +## v1.3.1 + * Fix TulipHook not relocating RIP relative operands on MacOS (6cad19d) + ## v1.3.0 * Completely remove runtime enabling & disabling of mods (d817749) * Patches auto enabling can be disabled (69821f3) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62e9b72c..fd0548ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,7 +96,7 @@ if (PROJECT_IS_TOP_LEVEL AND NOT GEODE_BUILDING_DOCS) set(TULIP_LINK_SOURCE ON) endif() set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE) -CPMAddPackage("gh:geode-sdk/TulipHook#2e4cb5a") +CPMAddPackage("gh:geode-sdk/TulipHook#3423a29") set(CMAKE_WARN_DEPRECATED ON CACHE BOOL "" FORCE) # Silence warnings from dependencies @@ -185,7 +185,14 @@ target_include_directories(GeodeCodegenSources PRIVATE ${GEODE_LOADER_PATH}/include/Geode/cocos/extensions ${GEODE_LOADER_PATH}/include/Geode/fmod ) +set_target_properties(GeodeCodegenSources PROPERTIES CXX_VISIBILITY_PRESET hidden) target_compile_features(GeodeCodegenSources PUBLIC cxx_std_20) + +if (APPLE) + target_compile_options(GeodeCodegenSources PUBLIC -ffunction-sections -fdata-sections) + target_link_options(GeodeCodegenSources PUBLIC -dead_strip) +endif() + if (NOT GEODE_DISABLE_PRECOMPILED_HEADERS) target_precompile_headers(GeodeCodegenSources INTERFACE "${GEODE_LOADER_PATH}/include/Geode/Bindings.hpp" @@ -218,6 +225,11 @@ else() set(GEODE_PLATFORM_BIN_PATH ${GEODE_BIN_PATH}/${PROJECT_VERSION}/${GEODE_PLATFORM_BINARY}) endif() +if (WIN32) + # This allows you to compile in debug mode + add_compile_definitions(_HAS_ITERATOR_DEBUGGING=0) +endif() + if (PROJECT_IS_TOP_LEVEL) add_subdirectory(loader) diff --git a/VERSION b/VERSION index f0bb29e7..80e78df6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.0 +1.3.5 diff --git a/bindings/Cocos2d.bro b/bindings/Cocos2d.bro index 692b6ce9..900aae67 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() { @@ -121,6 +126,11 @@ class cocos2d::CCClippingNode { // void updateConnected() = win 0xc7fb0; //} +[[link(win)]] +class cocos2d::CCConfiguration { + void gatherGPUInfo() = mac 0x2a6e10; +} + [[link(win)]] class cocos2d::CCDelayTime { static cocos2d::CCDelayTime* create(float) = mac 0x1f4380; @@ -174,7 +184,7 @@ class cocos2d::CCDirector { auto convertToGL(cocos2d::CCPoint const&) = mac 0x24a210; auto convertToUI(cocos2d::CCPoint const&) = mac 0x24a340; auto drawScene() = mac 0x249690; - auto willSwitchToScene(cocos2d::CCScene* scene); + auto willSwitchToScene(cocos2d::CCScene* scene) = mac 0x24a520; auto setOpenGLView(cocos2d::CCEGLView *pobOpenGLView) = mac 0x249be0; auto updateScreenScale(cocos2d::CCSize) = mac 0x249f10; auto setContentScaleFactor(float); @@ -291,7 +301,7 @@ class cocos2d::CCEGLViewProtocol { auto getScaleX() const = mac 0x29e300; auto getScaleY() const = mac 0x29e310; virtual auto setDesignResolutionSize(float, float, ResolutionPolicy); - auto setFrameSize(float, float) = mac 0x29d960; + virtual void setFrameSize(float, float) = mac 0x29d960; } [[link(win)]] @@ -318,6 +328,7 @@ class cocos2d::CCFileUtils : cocos2d::TypeInfo { class cocos2d::CCGLProgram { auto setUniformsForBuiltins() = mac 0x232c70; auto use() = mac 0x231d70; + bool compileShader(unsigned int* shader, unsigned int type, const char* source) = mac 0x231a30; } [[link(win)]] @@ -359,6 +370,7 @@ class cocos2d::CCImage { class cocos2d::CCKeyboardDispatcher { bool dispatchKeyboardMSG(cocos2d::enumKeyCodes, bool) = mac 0xe8190; const char* keyToString(cocos2d::enumKeyCodes) = mac 0xe8450; + void updateModifierKeys(bool shft, bool ctrl, bool alt, bool cmd) = mac 0xe8430; } [[link(win)]] @@ -379,6 +391,7 @@ class cocos2d::CCKeypadHandler { [[link(win)]] class cocos2d::CCLabelBMFont { + CCLabelBMFont() = mac 0x347b60; static cocos2d::CCLabelBMFont* create(char const*, char const*) = mac 0x347660; auto limitLabelWidth(float, float, float) = mac 0x34a6e0, ios 0x21b740; auto setFntFile(char const*) = mac 0x34a5f0; @@ -386,7 +399,7 @@ class cocos2d::CCLabelBMFont { static auto create() = mac 0x3473f0; virtual auto init() = mac 0x347b10, ios 0x2198e0; - bool initWithString(const char* str, const char* fnt, float width, cocos2d::CCTextAlignment align, cocos2d::CCPoint offset); + bool initWithString(const char* str, const char* fnt, float width, cocos2d::CCTextAlignment align, cocos2d::CCPoint offset) = mac 0x347710; virtual auto setScaleX(float) = mac 0x34a5b0, ios 0x21b6e8; virtual auto setScaleY(float) = mac 0x34a5d0, ios 0x21b714; virtual auto setScale(float) = mac 0x34a590, ios 0x21b6bc; @@ -630,6 +643,12 @@ class cocos2d::CCNode { virtual auto cleanup() = mac 0x123100, ios 0x15e3a4; auto convertToNodeSpace(cocos2d::CCPoint const&) = mac 0x124750, ios 0x15f55c; auto convertToWorldSpace(cocos2d::CCPoint const&) = mac 0x124790; + cocos2d::CCPoint convertToNodeSpaceAR(cocos2d::CCPoint const& worldPoint) { + return convertToNodeSpace(worldPoint) - getAnchorPointInPoints(); + } + cocos2d::CCPoint convertToWorldSpaceAR(cocos2d::CCPoint const& nodePoint) { + return convertToWorldSpace(nodePoint + getAnchorPointInPoints()); + } static cocos2d::CCNode* create() = mac 0x1230a0; virtual auto draw() = mac 0x123840, ios 0x15e974; auto getActionByTag(int) = mac 0x123ee0; @@ -891,6 +910,7 @@ class cocos2d::CCSet { class cocos2d::CCShaderCache { static auto sharedShaderCache() = mac 0xe6d10; auto programForKey(const char*) = mac 0xe7d40; + void reloadDefaultShaders(); } [[link(win)]] @@ -1127,6 +1147,7 @@ class cocos2d::CCTouchHandler { [[link(win)]] class cocos2d::CCTransitionFade { static cocos2d::CCTransitionFade* create(float, cocos2d::CCScene*) = mac 0x8ea30, ios 0x12c244; + virtual bool initWithDuration(float t, cocos2d::CCScene* scene, cocos2d::ccColor3B const& color) = mac 0x8e930; } [[link(win)]] @@ -1248,16 +1269,30 @@ class cocos2d::extension::CCScrollView { [[link(win)]] class cocos2d { static auto FNTConfigLoadFile(char const*) = mac 0x344f10; + static auto ccGLUseProgram(GLuint) = mac 0x1ae540; static auto ccGLBlendFunc(GLenum, GLenum) = mac 0x1ae560; static auto ccDrawSolidRect(cocos2d::CCPoint, cocos2d::CCPoint, cocos2d::_ccColor4F) = mac 0xecf00; static auto ccGLEnableVertexAttribs(unsigned int) = mac 0x1ae740; static auto ccGLBindTexture2D(GLuint) = mac 0x1ae610; + static auto ccGLBindTexture2DN(GLuint, GLuint) = mac 0x1ae650; static float ccpDistance(cocos2d::CCPoint const&, cocos2d::CCPoint const&) = mac 0x1aaf90; + static auto ccDrawLine(cocos2d::CCPoint const&, cocos2d::CCPoint const&) = mac 0xeccc0; static void ccDrawPoly(cocos2d::CCPoint const*, unsigned int, bool) = mac 0xed0a0; static void ccDrawColor4B(GLubyte, GLubyte, GLubyte, GLubyte) = mac 0xeddd0; static void CCMessageBox(const char* msg, const char* title) = mac 0xbabc0; } +//uintptr_t macNumberOfDraws() { +// return geode::base::get() + 0x69ae90; +//} +//void ccIncrementGLDraws(int n) { +//#ifdef GEODE_IS_MACOS +// *reinterpret_cast(macNumberOfDraws()) += n; +//#else +// CC_INCREMENT_GL_DRAWS(n); +//#endif +//} + [[link(win)]] class DS_Dictionary { DS_Dictionary() = mac 0xbe9a0; @@ -1277,4 +1312,4 @@ class pugi::xml_document { ~xml_document() = mac 0x393b50; } -// clang-format on \ No newline at end of file +// clang-format on diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro index 91387bac..dabc81c0 100644 --- a/bindings/GeometryDash.bro +++ b/bindings/GeometryDash.bro @@ -253,7 +253,7 @@ class ButtonSprite : cocos2d::CCSprite { void updateBGImage(const char*) = mac 0x502d0, win 0x13af0; static ButtonSprite* create(char const*, float) = mac 0x4fa60; void setString(const char* txt) = mac 0x4fec0, win 0x14030; - void updateSpriteBGSize() = win 0x13c00; + void updateSpriteBGSize() = mac 0x4f5d0, win 0x13c00; void setColor(cocos2d::ccColor3B color) = mac 0x50410, win 0x143e0; PAD = mac 0x18, win 0x18; @@ -261,7 +261,7 @@ class ButtonSprite : cocos2d::CCSprite { cocos2d::CCSprite* m_subSprite; cocos2d::CCSprite* m_subBGSprite; cocos2d::extension::CCScale9Sprite* m_BGSprite; - PAD = win 0x8; + PAD = mac 0xC, win 0x8; cocos2d::CCPoint m_spritePosition; } @@ -280,6 +280,10 @@ class CCAnimatedSprite : cocos2d::CCSprite { class CCAnimateFrameCache : cocos2d::CCObject { static CCAnimateFrameCache* sharedSpriteFrameCache() = mac 0x2e4df0, win 0x158f0; void addSpriteFramesWithFile(const char* file) = win 0x159b0; + + cocos2d::CCDictionary* m_unknown1; + cocos2d::CCDictionary* m_unknown2; + cocos2d::CCDictionary* m_unknown3; } class CCBlockLayer : cocos2d::CCLayerColor { @@ -905,6 +909,8 @@ class CommentUploadDelegate { } class ConfigureHSVWidget : cocos2d::CCNode { + bool init(int abs, cocos2d::ccHSVValue val) = win 0x4a3f0, mac 0x237310; + void updateLabels() = win 0x4adf0, mac 0x237df0; cocos2d::CCLabelBMFont* m_hueLabel; cocos2d::CCLabelBMFont* m_saturationLabel; cocos2d::CCLabelBMFont* m_brightnessLabel; @@ -945,15 +951,15 @@ class CreateMenuItem : CCMenuItemSpriteExtra { class CreatorLayer : cocos2d::CCLayer, cocos2d::CCSceneTransitionDelegate, DialogDelegate { void onBack(cocos2d::CCObject*) = win 0x4fae0; void onChallenge(cocos2d::CCObject*) = mac 0x142960, win 0x4f1b0; - void onLeaderboards(cocos2d::CCObject*) = win 0x4ed20; + void onLeaderboards(cocos2d::CCObject*) = mac 0x142920, win 0x4ed20; void onMyLevels(cocos2d::CCObject*) = mac 0x142b70, win 0x4eaa0; void onSavedLevels(cocos2d::CCObject*) = mac 0x142860, win 0x4ebe0; - void onDailyLevel(cocos2d::CCObject*) = win 0x4f170; - void onWeeklyLevel(cocos2d::CCObject*) = win 0x4f190; - void onFeaturedLevels(cocos2d::CCObject*) = win 0x4edf0; - void onFameLevels(cocos2d::CCObject*) = win 0x4ee70; - void onMapPacks(cocos2d::CCObject*) = win 0x4efb0; - void onOnlineLevels(cocos2d::CCObject*) = win 0x4ef60; + void onDailyLevel(cocos2d::CCObject*) = mac 0x142980, win 0x4f170; + void onWeeklyLevel(cocos2d::CCObject*) = mac 0x1429a0, win 0x4f190; + void onFeaturedLevels(cocos2d::CCObject*) = mac 0x142a20, win 0x4edf0; + void onFameLevels(cocos2d::CCObject*) = mac 0x142a80, win 0x4ee70; + void onMapPacks(cocos2d::CCObject*) = mac 0x1429c0, win 0x4efb0; + void onOnlineLevels(cocos2d::CCObject*) = mac 0x142ae0, win 0x4ef60; void onGauntlets(cocos2d::CCObject*) = mac 0x142b20, win 0x4f0a0; void onSecretVault(cocos2d::CCObject*) = win 0x4f1d0; void onTreasureRoom(cocos2d::CCObject*) = win 0x4f540; @@ -1007,16 +1013,44 @@ 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(cocos2d::CCObject*) = win 0x693b0; + void onDownload(cocos2d::CCObject*) = win 0x69540; + void onGetSongInfo(cocos2d::CCObject*) = win 0x69490; + void onMore(cocos2d::CCObject*) = win 0x68e20; + void onPlayback(cocos2d::CCObject*) = win 0x697b0; + void onSelect(cocos2d::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; + int m_customSongID; + bool m_unkBool; } class CustomizeObjectLayer : FLAlertLayer, TextInputDelegate, HSVWidgetPopupDelegate, ColorSelectDelegate, ColorSetupDelegate { @@ -1027,7 +1061,7 @@ class CustomizeObjectLayer : FLAlertLayer, TextInputDelegate, HSVWidgetPopupDele void onClose(cocos2d::CCObject*) = mac 0xdf660, win 0x57ac0; void updateSelected(int channelID) = mac 0xe0970, win 0x57850; bool init(GameObject* target, cocos2d::CCArray* targets) = mac 0xdd560, win 0x53e00; - void onHSV(cocos2d::CCObject* sender) = win 0x567c0; + void onHSV(cocos2d::CCObject* sender) = win 0x567c0, mac 0xdfa00; void toggleVisible() = mac 0xe1140, win 0x56fb0; void highlightSelected(ButtonSprite* target) = mac 0xe0aa0, win 0x579d0; void updateCustomColorLabels() = mac 0xdff40, win 0x576d0; @@ -1036,8 +1070,8 @@ class CustomizeObjectLayer : FLAlertLayer, TextInputDelegate, HSVWidgetPopupDele // inlined in most places void updateChannelLabel(int channel) = mac 0xe06e0, win 0x56f50; virtual void hsvPopupClosed(HSVWidgetPopup* popup, cocos2d::ccHSVValue value) = win 0x56990; - virtual void colorSelectClosed(cocos2d::CCNode*) = mac 0xe0c70, win 0x564a0; - virtual void textChanged(CCTextInputNode* input) = mac 0xe16a0, win 0x574d0; + virtual void colorSelectClosed(cocos2d::CCNode*) = mac 0xe0610, win 0x564a0; + virtual void textChanged(CCTextInputNode* input) = mac 0xe1470, win 0x574d0; inline CustomizeObjectLayer() {} ~CustomizeObjectLayer() = win 0x53c30; @@ -1074,7 +1108,7 @@ class CustomizeObjectLayer : FLAlertLayer, TextInputDelegate, HSVWidgetPopupDele } class DailyLevelPage : FLAlertLayer, FLAlertLayerProtocol, GJDailyLevelDelegate, LevelDownloadDelegate { - static DailyLevelPage* create(bool weekly) = win 0x6a860; + static DailyLevelPage* create(bool weekly) = mac 0x108ac0, win 0x6a860; bool init(bool weekly) = mac 0x108C90, win 0x6a900; virtual void updateTimers(float) = mac 0x109780, win 0x6bef0; virtual void show() = mac 0x10a4b0, win 0x3f360; @@ -1136,9 +1170,9 @@ class DrawGridLayer : cocos2d::CCLayer { return editorLayer->m_drawGridLayer; } - bool init(cocos2d::CCNode* grid, LevelEditorLayer* editor) = win 0x16c4d0; - void draw() = win 0x16ce90; - virtual void update(float) = win 0x16cd80; + bool init(cocos2d::CCNode* grid, LevelEditorLayer* editor) = win 0x16c4d0, mac 0x2729a0; + virtual void draw() = win 0x16ce90, mac 0xa3c40; + virtual void update(float) = win 0x16cd80, mac 0xa3b30; void clearPlayerPoints() { m_playerNodePoints->removeAllObjects(); m_player2NodePoints->removeAllObjects(); @@ -1207,6 +1241,7 @@ class EditButtonBar : cocos2d::CCNode { int rowCount, int columnCount ) = mac 0x350e60, win 0x6e450; + bool init(cocos2d::CCArray* buttons, int, bool, int rowCount, int columnCount, cocos2d::CCPoint pos) = win 0x6e550; cocos2d::CCPoint m_position; int m_unknown; bool m_unknownBool; @@ -1273,7 +1308,7 @@ class EditorPauseLayer : CCBlockLayer, FLAlertLayerProtocol { bool init(LevelEditorLayer*) = mac 0x13c7a0, win 0x730e0, ios 0x280cb8; void onExitEditor(cocos2d::CCObject* sender) = mac 0x13f180, win 0x75660; void playStep2() = mac 0x13f040, win 0x75440; - void onResume(cocos2d::CCObject* sender) = win 0x74fe0; + void onResume(cocos2d::CCObject* sender) = mac 0x13e170, win 0x74fe0; void onSaveAndPlay(cocos2d::CCObject* sender) = mac 0x13e1b0, win 0x753d0; void onSaveAndExit(cocos2d::CCObject* sender) = mac 0x13e230, win 0x75620; void onSave(cocos2d::CCObject* sender) = mac 0x13e290, win 0x755a0; @@ -1304,6 +1339,8 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ void create(LevelEditorLayer*) = mac 0x8a80, win 0x76270; cocos2d::CCArray* createCustomItems() = mac 0x1ddf0, win 0x7a370; + void onDeleteCustomItem(cocos2d::CCObject* pSender) = win 0x7a280, mac 0x29860; + void onNewCustomItem(cocos2d::CCObject* pSender) = win 0x79fd0, mac 0x24480; void deselectAll() = mac 0x1f300, win 0x86af0; void onDeselectAll(cocos2d::CCObject*) = mac 0x19cd0, win 0x86ac0; void disableButton(CreateMenuItem*) = mac 0x1c0f0, win 0x78af0; @@ -1353,8 +1390,8 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ void onCreateButton(cocos2d::CCObject* sender) = mac 0x1fd70, win 0x854f0; CCMenuItemSpriteExtra* getSpriteButton(const char* sprite, cocos2d::SEL_MenuHandler callback, cocos2d::CCMenu* menu, float scale) = mac 0xb500, win 0x78bf0; cocos2d::CCPoint offsetForKey(int objID) = win 0x92310; - void updateDeleteMenu() = win 0x7c5d0; - void updateCreateMenu(bool updateTab) = mac 0x1e960, win 0x85530; + void updateDeleteMenu() = win 0x7c5d0, mac 0x1e960; + void updateCreateMenu(bool updateTab) = mac 0x1ba80, win 0x85530; void toggleMode(cocos2d::CCObject* sender) = mac 0x187b0, win 0x7ad20; void zoomIn(cocos2d::CCObject* sender) = mac 0xc0c0, win 0x877c0; void zoomOut(cocos2d::CCObject* sender) = mac 0xc120, win 0x87830; @@ -1379,6 +1416,7 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ void editGroup(cocos2d::CCObject* sender) = win 0x8d720; void moveObjectCall(cocos2d::CCObject* sender) = mac 0x29830, win 0x8db30; void moveObjectCall(EditCommand command) = mac 0x29b80, win 0x8db50; + cocos2d::CCPoint* moveForCommand(cocos2d::CCPoint* point, EditCommand command) = win 0x8d890; void transformObjectCall(cocos2d::CCObject* sender) = mac 0x29860, win 0x8def0; void transformObjectCall(EditCommand command) = mac 0x29d90, win 0x8df10; void transformObject(GameObject* obj, EditCommand command, bool snap) = mac 0x2b0b0, win 0x8e250; @@ -1403,6 +1441,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; @@ -1412,8 +1451,8 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ void onPasteState(cocos2d::CCObject* sender) = mac 0x19ee0, win 0x884c0; void onGroupSticky(cocos2d::CCObject* sender) = mac 0xc180, win 0x87a80; void onUngroupSticky(cocos2d::CCObject* sender) = mac 0xc1d0, win 0x87ac0; - void onGoToLayer(cocos2d::CCObject* sender) = win 0x886b0; - void onGoToBaseLayer(cocos2d::CCObject* sender) = win 0x88790; + void onGoToLayer(cocos2d::CCObject* sender) = mac 0x19fa0, win 0x886b0; + void onGoToBaseLayer(cocos2d::CCObject* sender) = mac 0x1a270, win 0x88790; void onToggleGuide(cocos2d::CCObject* sender) = mac 0x19da0, win 0x79160; void editColor(cocos2d::CCObject* sender) = mac 0x19190, win 0x8d3c0; void alignObjects(cocos2d::CCArray* objs, bool alignY) = mac 0x2cea0, win 0x8f320; @@ -1422,6 +1461,8 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ void sliderChanged(cocos2d::CCObject* slider) = mac 0xaed0, win 0x78cc0; 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, mac 0x24110; bool m_isPlayingMusic; EditButtonBar* m_buttonBar; @@ -1629,9 +1670,12 @@ class EffectGameObject : GameObject { PAD = mac 0x28, win 0x24; } -class EndLevelLayer { +class EndLevelLayer : cocos2d::CCLayer { static EndLevelLayer* create() = mac 0x2787d0, win 0x94b50; + void customSetup() = win 0x94cb0; + const char* getCoinString(void* p0) = win 0x96270; + const char* getEndText() = win 0x964A0; void onMenu(cocos2d::CCObject* sender) = mac 0x27a500, win 0x96c10; void onEdit(cocos2d::CCObject* sender) = mac 0x27a640, win 0x96d30; } @@ -1705,7 +1749,7 @@ class FLAlertLayer : cocos2d::CCLayerColor { cocos2d::ccColor3B m_color2; ButtonSprite* m_button1; ButtonSprite* m_button2; - cocos2d::CCLayerColor* m_scrollingLayer; + ScrollingLayer* m_scrollingLayer; int m_joystickConnected; bool m_containsBorder; bool m_noAction; @@ -1717,15 +1761,17 @@ 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; - std::string m_filePath; + gd::string m_filePath; float m_backgroundMusicVolume; float m_effectsVolume; float m_pulse1; @@ -1756,8 +1802,8 @@ class FMODSound : cocos2d::CCNode { class FriendRequestDelegate {} class FriendsProfilePage : FLAlertLayer, FLAlertLayerProtocol, UploadActionDelegate, UploadPopupDelegate, UserListDelegate { - static FriendsProfilePage* create(UserListType) = win 0x9ce80; - bool init(UserListType) = win 0x9cf30; + static FriendsProfilePage* create(UserListType) = win 0x9ce80, mac 0x3a9570; + bool init(UserListType) = win 0x9cf30, mac 0x3a9770; } class GJAccountBackupDelegate { @@ -1786,11 +1832,16 @@ class GJAccountLoginDelegate { class GJAccountManager : cocos2d::CCNode { static GJAccountManager* sharedState() = mac 0x85070, win 0x107d50; + static GJAccountManager* get() { + return GJAccountManager::sharedState(); + } + gd::string getGJP() = mac 0x89520, win 0x10abb0; PAD = mac 0x8, win 0x4; gd::string m_password; gd::string m_username; int m_accountID; + int m_playerID; } class GJAccountSyncDelegate { @@ -2282,7 +2333,7 @@ class GJGameLevel : cocos2d::CCNode { void getLengthKey(int) = mac 0x2dbba0; void getNormalPercent() = mac 0x2b8b20; void levelWasAltered() = mac 0x2db530, win 0xbd550; - void savePercentage(int, bool, int, int, bool) = mac 0x2db700; + void savePercentage(int, bool, int, int, bool) = mac 0x2db700, win 0xbd5c0; void dataLoaded(DS_Dictionary* dict) = mac 0x2dc0e0, win 0xbded0, ios 0x6fca4; GJDifficulty getAverageDifficulty() = win 0xbd9b0; gd::string getUnpackedLevelDescription() = mac 0x2DDB50, win 0xbf890; @@ -2421,11 +2472,15 @@ 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; - PAD = mac 0x10, win 0x8; + void showCircleWave() = win 0x12aad0; + void showBlackCircleWave() = win 0x12a9d0; + PAD = mac 0x10, win 0x4; CCTextInputNode* m_nameInput; SimplePlayer* m_playerPreview; PAD = mac 0x10, win 0x8; @@ -2536,6 +2591,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; @@ -2582,21 +2638,21 @@ class GJScaleControl : cocos2d::CCLayer { virtual void ccTouchMoved(cocos2d::CCTouch*, cocos2d::CCEvent*) = mac 0x31e60, win 0x94840; virtual void ccTouchEnded(cocos2d::CCTouch*, cocos2d::CCEvent*) = mac 0x31fb0, win 0x94940; virtual void ccTouchCancelled(cocos2d::CCTouch*, cocos2d::CCEvent*) = mac 0x32060, win 0x2dea0; // shared with many others - void updateLabel(float value) = win 0x94990; + void updateLabel(float value) = win 0x94990, mac 0x31c90; void loadValues(GameObject* obj, cocos2d::CCArray* objs) = win 0x94590, mac 0x24f40; Slider* m_slider; unsigned int m_touchID; float m_value; - PAD = mac 0x8, win 0x4; + bool m_shouldSnapAt1; cocos2d::CCLabelBMFont* m_label; GJScaleControlDelegate* m_delegate; } class GJScaleControlDelegate { + virtual void scaleChanged(float) {} virtual void scaleChangeBegin() {} virtual void scaleChangeEnded() {} - virtual void scaleChanged(float) {} } class GJScoreCell : TableViewCell, FLAlertLayerProtocol { @@ -2659,7 +2715,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; @@ -3046,7 +3102,9 @@ class GameManager : GManager { void loadGround(int) = mac 0x1cc8e0, win 0xc9a50; void reloadAll(bool, bool, bool) = mac 0x1d08a0, win 0xce950; void reloadAllStep2() = mac 0x1d0940, win 0xce9e0, ios 0x23b1f4; - void reloadAllStep5() = mac 0x1d0b00; + void reloadAllStep3() = win 0xceb10; + void reloadAllStep4() = win 0xceb80; + void reloadAllStep5() = mac 0x1d0b00, win 0xcebf0; void reportPercentageForLevel(int, int, bool) = mac 0x1c5b00; void setGameVariable(const char*, bool) = mac 0x1cca80, win 0xc9b50; void setIntGameVariable(const char*, int) = mac 0x1cd0e0, win 0xca230; @@ -3257,15 +3315,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; @@ -3285,7 +3344,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; @@ -3296,7 +3355,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; @@ -3325,8 +3392,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; @@ -3429,7 +3495,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; @@ -3483,8 +3549,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; @@ -3501,7 +3567,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; @@ -3546,7 +3612,8 @@ class GameStatsManager : cocos2d::CCNode { int getBaseCurrencyForLevel(GJGameLevel*) = mac 0x43470, win 0xf8530; GJChallengeItem* getChallenge(int id) = mac 0x451f0, win 0xa2fb0; void getSecretCoinKey(char const*) = mac 0x429f0; - int getStat(char const*) = mac 0x3d310, win 0xf3580; + int getStat(char const* type) = mac 0x3d310, win 0xf3580; + void setStat(char const* type, int amount) = win 0xf3690; void hasPendingUserCoin(char const*) = mac 0x42730, win 0xf7c50; void hasSecretCoin(char const*) = mac 0x40730, win 0xf7dc0; void hasUserCoin(char const*) = mac 0x427e0, win 0xf7ae0; @@ -3558,6 +3625,7 @@ class GameStatsManager : cocos2d::CCNode { void storeSecretCoin(char const*) = mac 0x42a10; void storeUserCoin(char const*) = mac 0x42890; bool isItemUnlocked(UnlockType type, int id) = win 0xfbb80; + void checkAchievement(char const* type) = win 0xf37c0; PAD = mac 0x50, win 0x28; cocos2d::CCDictionary* m_dailyChests; @@ -3594,7 +3662,7 @@ class GameToolbox { static cocos2d::CCDictionary* stringSetupToDict(gd::string text, char const* delimeter) = mac 0x28d700, win 0x272a0; static CCMenuItemToggler* createToggleButton(gd::string text, cocos2d::SEL_MenuHandler onToggled, bool isToggled, cocos2d::CCMenu* toggleMenu, cocos2d::CCPoint position, cocos2d::CCNode* callbackTarget, cocos2d::CCNode* labelParent, cocos2d::CCArray* toggleArray) = mac 0x28bc90, win 0x25fe0; static CCMenuItemToggler* createToggleButton(gd::string text, cocos2d::SEL_MenuHandler onToggled, bool isToggled, cocos2d::CCMenu* toggleMenu, cocos2d::CCPoint position, cocos2d::CCNode* callbackTarget, cocos2d::CCNode* labelParent, float checkboxScale, float labelSize, float maxWidth, cocos2d::CCPoint labelOffset, const char* unknown, bool anchorHorizontally, int toggleTag, cocos2d::CCArray* toggleArray) = mac 0x28bdd0, win 0x25fe0; - static cocos2d::ccColor3B transformColor(cocos2d::ccColor3B const& src, cocos2d::ccHSVValue hsv) = win 0x26a60; + static cocos2d::ccColor3B transformColor(cocos2d::ccColor3B const& src, cocos2d::ccHSVValue hsv) = win 0x26a60, mac 0x28c950; static void alignItemsHorisontally(cocos2d::CCArray* array, float pad, cocos2d::CCPoint start, bool idk) = win 0x25b20; static gd::map stringSetupToMap(gd::string, char const*) = mac 0x28d4c0; static cocos2d::ccColor3B multipliedColorValue(cocos2d::ccColor3B color1, cocos2d::ccColor3B color2, float factor) = win 0x26CE0; @@ -3633,7 +3701,7 @@ class GauntletSelectLayer { class GhostTrailEffect {} class HSVWidgetPopup : FLAlertLayer { - bool init(cocos2d::_ccHSVValue value, HSVWidgetPopupDelegate* delegate, gd::string title); + bool init(cocos2d::_ccHSVValue value, HSVWidgetPopupDelegate* delegate, gd::string title) = win 0x49f10, mac 0x236d30; void onClose(cocos2d::CCObject* sender) = win 0x4a280; ConfigureHSVWidget* m_configureWidget; @@ -3656,7 +3724,7 @@ class HardStreak : cocos2d::CCDrawNode { void reset() = mac 0x5c930; void resumeStroke() = mac 0x5c210; void stopStroke() = mac 0x5c8f0, win 0x14e460; - void updateStroke(float) = mac 0x5c240, win 0x14e530; + callback void updateStroke(float) = mac 0x5c240, win 0x14e530; cocos2d::CCArray* m_pointsArr; cocos2d::CCPoint m_currentPoint; @@ -3752,6 +3820,7 @@ class LevelBrowserLayer : cocos2d::CCLayer, LevelManagerDelegate, FLAlertLayerPr void updateLevelsLabel() = mac 0x255450, win 0x15c350; void onRefresh(cocos2d::CCObject* sender) = mac 0x253090; void onInfo(cocos2d::CCObject* sender) = mac 0x253170, win 0x15cb00; + void onNew(cocos2d::CCObject* sender) = win 0x15cbf0, mac 0x252ac0; static LevelBrowserLayer* create(GJSearchObject* search) = mac 0x251210, win 0x159fa0, ios 0x2d0a00; PAD = win 0x4, mac 0x8; @@ -3826,7 +3895,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; @@ -3845,7 +3914,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; @@ -4011,16 +4080,24 @@ class LevelEditorLayer : GJBaseGameLayer, LevelSettingsDelegate { class LevelInfoLayer : cocos2d::CCLayer, LevelDownloadDelegate, LevelUpdateDelegate, RateLevelDelegate, LikeItemDelegate, FLAlertLayerProtocol, LevelDeleteDelegate, NumberInputDelegate, SetIDPopupDelegate { static LevelInfoLayer* create(GJGameLevel* level) = mac 0x15f290, win 0x175d50; bool init(GJGameLevel* level) = win 0x175df0, mac 0x15f520; - void onGarage(cocos2d::CCObject* sender) = win 0x177c10; + void onGarage(cocos2d::CCObject* sender) = win 0x177c10, mac 0x163ac0; void onViewProfile(cocos2d::CCObject* sender) = mac 0x1617d0, win 0x17ac90; void onLevelInfo(cocos2d::CCObject* sender) = mac 0x163880, win 0x17acf0; - void setupProgressBars() = win 0x177fc0; + void setupProgressBars() = win 0x177fc0, mac 0x1627e0; void setupLevelInfo() = mac 0x161C80, win 0x178680; - void downloadLevel() = win 0x177d90; + 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; + + void onRate(cocos2d::CCObject* sender) = win 0x17a530; PAD = win 0x4, mac 0x8; cocos2d::CCMenu* m_playBtnMenu; @@ -4030,13 +4107,13 @@ class LevelInfoLayer : cocos2d::CCLayer, LevelDownloadDelegate, LevelUpdateDeleg CCMenuItemSpriteExtra* m_starRateBtn; CCMenuItemSpriteExtra* m_demonRateBtn; PAD = win 0x4, mac 0x8; - CCMenuItemToggler* m_toggler; - cocos2d::CCLabelBMFont* m_label0; - cocos2d::CCLabelBMFont* m_label1; - cocos2d::CCLabelBMFont* m_label2; - cocos2d::CCLabelBMFont* m_label3; - cocos2d::CCLabelBMFont* m_label4; - cocos2d::CCLabelBMFont* m_label5; + CCMenuItemToggler* m_ldmToggler; + cocos2d::CCLabelBMFont* m_ldmLabel; + cocos2d::CCLabelBMFont* m_lengthLabel; + cocos2d::CCLabelBMFont* m_downloadsLabel; + cocos2d::CCLabelBMFont* m_likesLabel; + cocos2d::CCLabelBMFont* m_orbsLabel; + cocos2d::CCLabelBMFont* m_folderLabel; CCMenuItemSpriteExtra* m_cloneBtn; PAD = win 0x4, mac 0x8; } @@ -4079,6 +4156,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; @@ -4088,6 +4166,15 @@ class LevelSettingsDelegate { virtual void levelSettingsUpdated() {} } +class SecretLayer2 : cocos2d::CCLayer, TextInputDelegate, FLAlertLayerProtocol, DialogDelegate { + static SecretLayer2* create() = win 0x21FD70; + + bool init() = win 0x21FE10, mac 0x25fe70; + bool onSubmit(cocos2d::CCObject*) = win 0x221ac0, mac 0x2611a0; + void updateSearchLabel(const char* text) = win 0x222FC0, mac 0x260e10; + void showCompletedLevel() = win 0x220C10; +} + class SecretLayer4 : cocos2d::CCLayer, TextInputDelegate, FLAlertLayerProtocol, DialogDelegate { static SecretLayer4* create() = mac 0x1ed500; static cocos2d::CCScene* scene() = mac 0x1ed4c0; @@ -4195,6 +4282,7 @@ class LikeItemLayer : FLAlertLayer { class ListButtonBar : cocos2d::CCNode { BoomScrollLayer* m_scrollLayer; + void switchedPage(int page) = win 0x29c50; } class ListButtonBarDelegate {} @@ -4257,7 +4345,6 @@ class LocalLevelManager : GManager { cocos2d::CCDictionary* getAllLevelsInDict() = mac 0x35e3d0, win 0x18d7c0; - PAD = mac 0x4, win 0x1C; cocos2d::CCDictionary* m_loadData; cocos2d::CCDictionary* m_levelData; cocos2d::CCArray* m_localLevels; @@ -4310,7 +4397,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; } @@ -4319,7 +4406,7 @@ class MoreOptionsLayer : FLAlertLayer, TextInputDelegate, GooglePlayDelegate { static MoreOptionsLayer* create() = win 0x1de850; virtual bool init() = mac 0x43f470, win 0x1DE8F0; void addToggle(const char* name, const char* key, const char* info) = mac 0x440430, win 0x1df6b0; - void onKeybindings(cocos2d::CCObject* sender) = win 0x749d0; + void onKeybindings(cocos2d::CCObject* sender) = mac 0x4410e0, win 0x749d0; void onToggle(cocos2d::CCObject* sender) = mac 0x441370; } @@ -4467,11 +4554,14 @@ class PauseLayer : CCBlockLayer { void createToggleButton(gd::string caption, cocos2d::SEL_MenuHandler callback, bool on, cocos2d::CCMenu* menu, cocos2d::CCPoint pos) = mac 0x20c890, win 0x1e5570; virtual void customSetup() = mac 0x20b300, win 0x1e4620; - void onRestart(cocos2d::CCObject* sender) = win 0x1e6040; + void onRestart(cocos2d::CCObject* sender) = mac 0x20c860, win 0x1e6040; + void onPracticeMode(cocos2d::CCObject* sender) = mac 0x20c6d0, win 0x1e5f30; + void onNormalMode(cocos2d::CCObject* sender) = mac 0x20c720, win 0x1e5f60; + void onResume(cocos2d::CCObject* sender) = mac 0x20c760, win 0x1e5fa0; virtual void keyDown(cocos2d::enumKeyCodes) = mac 0x20cc80, win 0x1E6580; - void musicSliderChanged(cocos2d::CCObject* sender) = win 0x1e5ce0; - void sfxSliderChanged(cocos2d::CCObject* sender) = win 0x1ddfa0; + void musicSliderChanged(cocos2d::CCObject* sender) = win 0x1e5ce0, mac 0x20cb00; + void sfxSliderChanged(cocos2d::CCObject* sender) = win 0x1ddfa0, mac 0x20cb40; bool m_unknown; bool m_unknown2; @@ -4624,7 +4714,7 @@ class PlayLayer : GJBaseGameLayer, CCCircleWaveDelegate, CurrencyRewardDelegate, void spawnFirework() = mac 0x74200; void spawnParticle(char const*, int, cocos2d::tCCPositionType, cocos2d::CCPoint) = mac 0x76330; void spawnPlayer2() = mac 0x7d170, win 0x2089e0; - void startGame() = mac 0x726b0; + void startGame() = mac 0x726b0, win 0x1fd390; void startMusic() = mac 0x72910, win 0x20C8F0; void startRecording() = mac 0x7fec0; void startRecordingDelayed() = mac 0x7fed0; @@ -4635,12 +4725,13 @@ 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; + callback float timeForXPos(float) = mac 0x7d120, win 0x2087d0; + 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; - void toggleGhostEffect(int) = mac 0x7fe40; + void toggleGhostEffect(int) = mac 0x7fe40, win 0x1f8930; void toggleGlitter(bool) = mac 0x70e00, win 0x20a0d0; void togglePracticeMode(bool) = mac 0x7f9e0, win 0x20d0d0; void toggleProgressbar() = mac 0x6eeb0, win 0x208160; @@ -4665,7 +4756,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; @@ -4696,7 +4786,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; @@ -4870,7 +4960,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); @@ -5015,7 +5105,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; @@ -5177,8 +5267,15 @@ class RateStarsLayer : FLAlertLayer, UploadPopupDelegate, UploadActionDelegate { UploadActionPopup* m_rateAction; RateLevelDelegate* m_rateDelegate; - static RateStarsLayer* create(int levelID, bool isModSuggest) = mac 0x135e50; - bool init(int levelID, bool isModSuggest) = mac 0x136050; + static RateStarsLayer* create(int levelID, bool isModSuggest) = mac 0x135e50, win 0x2155f0; + bool init(int levelID, bool isModSuggest) = mac 0x136050, win 0x2156a0; +} + +class RateLevelLayer : FLAlertLayer { + RateLevelLayer() = win 0x214a80; + virtual ~RateLevelLayer() = win 0x214b40; + + bool init(int levelID) = win 0x214cb0; } class RetryLevelLayer { @@ -5206,6 +5303,11 @@ class RingObject : EffectGameObject { class ScrollingLayer : cocos2d::CCLayerColor { static ScrollingLayer* create(cocos2d::CCSize, cocos2d::CCPoint, float) = mac 0x41a900, win 0x2d8e0; + PAD = win 0x28; + float m_layerHeight; + PAD = win 0x4; + cocos2d::CCLayer* m_scrollLayer; + cocos2d::CCNode* m_parent; } class SelectArtLayer { @@ -5239,6 +5341,9 @@ class SetGroupIDLayer : FLAlertLayer, TextInputDelegate { void updateZOrder() = win 0x22e3d0; void onAddGroup(cocos2d::CCObject* sender) = mac 0x1967d0, win 0x22de20; void onClose(cocos2d::CCObject* sender) = mac 0x1966a0, win 0x22e830; + void onEditorLayer(cocos2d::CCObject* sender) = win 0x22d690, mac 0x196800; + void onEditorLayer2(cocos2d::CCObject* sender) = win 0x22d710, mac 0x196a40; + void onZOrder(cocos2d::CCObject* sender) = win 0x22de80, mac 0x196920; GameObject* m_targetObject; cocos2d::CCArray* m_targetObjects; @@ -5349,12 +5454,14 @@ class SetupOpacityPopup : FLAlertLayer { class SetupPickupTriggerPopup : FLAlertLayer { static SetupPickupTriggerPopup* create(EffectGameObject*, cocos2d::CCArray*) = mac 0x35e70, win 0x23d4a0; + bool init(EffectGameObject* obj, cocos2d::CCArray* arr) = win 0x23d550, mac 0x36070; void onItemIDArrow(cocos2d::CCObject*) = mac 0x37100; void onNextItemID(cocos2d::CCObject*) = mac 0x37260; void textChanged(CCTextInputNode*) = mac 0x37ca0; void updateItemID() = mac 0x37ab0, win 0x23e4f0; - PAD = win 0xc; + PAD = win 0xc, mac 0x18; + CCTextInputNode* m_itemIDInput; CCTextInputNode* m_countInput; } @@ -5376,6 +5483,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; } @@ -5431,9 +5543,9 @@ class SimplePlayer : cocos2d::CCSprite { static SimplePlayer* create(int iconID) = mac 0x1b6140, win 0x12bd80; void updatePlayerFrame(int iconID, IconType iconType) = mac 0x1b62f0, win 0x12c650; void updateColors() = mac 0x1ba1f0, win 0x12c440, ios 0x224f2c; - void setFrames(const char* firstLayer, const char* secondLayer, const char* birdDome, const char* outlineSprite, const char* detailSprite) = win 0x12c9e0; + void setFrames(const char* firstLayer, const char* secondLayer, const char* birdDome, const char* outlineSprite, const char* detailSprite) = mac 0x1bca10, win 0x12c9e0; virtual void setColor(const cocos2d::ccColor3B& color) = mac 0x1bc9b0, win 0x12c410; - virtual void setOpacity(unsigned char opacity) = win 0x12cb90; + virtual void setOpacity(unsigned char opacity) = mac 0x135370, win 0x12cb90; cocos2d::CCSprite* m_firstLayer; cocos2d::CCSprite* m_secondLayer; @@ -5464,7 +5576,7 @@ class Slider : cocos2d::CCLayer { SliderTouchLogic* m_touchLogic; cocos2d::CCSprite* m_sliderBar; cocos2d::CCSprite* m_groove; - float m_unknown; + float m_width; float m_height; } @@ -5537,10 +5649,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* object, Speed speed, float x) = win 0x20de70; } class SpritePartDelegate {} @@ -5740,7 +5853,7 @@ class UILayer : cocos2d::CCLayerColor { virtual void keyDown(cocos2d::enumKeyCodes key) = mac 0x280470, win 0x25f890; virtual void keyUp(cocos2d::enumKeyCodes key) = mac 0x280600, win 0x25fa10; UILayer() = win 0x25f230; - ~UILayer() = win 0x25fef0; + ~UILayer() = win 0x25fef0, mac 0x280c90; PAD = mac 0x16, win 0x8, android 0x8; cocos2d::CCMenu* m_checkPointMenu; diff --git a/cmake/GeodeFile.cmake b/cmake/GeodeFile.cmake index 4c7efaff..1c67a290 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() @@ -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() @@ -307,6 +307,8 @@ function(package_geode_resources_now proname src dest header_dest) if (NOT FILE_NAME STREQUAL ".geode_cache" AND NOT FILE_SHOULD_HASH EQUAL -1) file(SHA256 ${file} COMPUTED_HASH) + file(SIZE ${file} FILE_SIZE) + message(STATUS "Hashed ${file} to ${COMPUTED_HASH} (${FILE_SIZE} bytes)") list(APPEND HEADER_FILE "\t{ \"${FILE_NAME}\", \"${COMPUTED_HASH}\" },\n") # list(APPEND HEADER_FILE "\t\"${FILE_NAME}\",\n") diff --git a/cmake/Platform.cmake b/cmake/Platform.cmake index 89f4fa89..22602b4b 100644 --- a/cmake/Platform.cmake +++ b/cmake/Platform.cmake @@ -46,6 +46,7 @@ elseif (GEODE_TARGET_PLATFORM STREQUAL "MacOS") target_link_libraries(${PROJECT_NAME} INTERFACE "-framework Cocoa" + "-framework OpenGL" ${CURL_LIBRARIES} ${GEODE_LOADER_PATH}/include/link/libfmod.dylib ) diff --git a/codegen/src/BindingGen.cpp b/codegen/src/BindingGen.cpp index eb4359c3..199e2555 100644 --- a/codegen/src/BindingGen.cpp +++ b/codegen/src/BindingGen.cpp @@ -185,7 +185,8 @@ std::string generateBindingHeader(Root const& root, ghc::filesystem::path const& single_output += fmt::format(::format_strings::class_start, fmt::arg("class_name", cls.name), - fmt::arg("base_classes", supers) + fmt::arg("base_classes", supers)//, + // fmt::arg("hidden", str_if("GEODE_HIDDEN ", (codegen::platform & (Platform::Mac | Platform::iOS)) != Platform::None)) ); // what. diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 4258f77a..422bf8d5 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -27,10 +27,13 @@ execute_process( ) # Package info file for internal representation +set(GEODE_RESOURCES_PATH ${CMAKE_CURRENT_SOURCE_DIR}/resources) configure_file(resources/mod.json.in ${CMAKE_CURRENT_SOURCE_DIR}/resources/mod.json) file(READ resources/mod.json LOADER_MOD_JSON) -configure_file(${GEODE_ROOT_PATH}/VERSION ${CMAKE_CURRENT_SOURCE_DIR}/resources/version COPYONLY) -configure_file(${GEODE_ROOT_PATH}/CHANGELOG.md ${CMAKE_CURRENT_SOURCE_DIR}/resources/changelog.md COPYONLY) +configure_file(${GEODE_ROOT_PATH}/VERSION ${GEODE_RESOURCES_PATH}/version COPYONLY) +configure_file(${GEODE_RESOURCES_PATH}/about.md.in ${GEODE_RESOURCES_PATH}/about.md NEWLINE_STYLE LF) +configure_file(${GEODE_ROOT_PATH}/CHANGELOG.md ${GEODE_RESOURCES_PATH}/changelog.md NEWLINE_STYLE LF) +configure_file(${GEODE_RESOURCES_PATH}/support.md.in ${GEODE_RESOURCES_PATH}/support.md NEWLINE_STYLE LF) configure_file(src/internal/about.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/src/internal/about.hpp) # Source files diff --git a/loader/include/Geode/c++stl/gnustl.hpp b/loader/include/Geode/c++stl/gnustl.hpp index b47afad8..a7d87cb6 100644 --- a/loader/include/Geode/c++stl/gnustl.hpp +++ b/loader/include/Geode/c++stl/gnustl.hpp @@ -405,8 +405,11 @@ namespace gd { } ~vector() { - for (auto i = m_start; i != m_finish; ++i) { - delete i; + if (m_start) { + for (auto& x : *this) { + x.~T(); + } + delete m_start; } } diff --git a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransition.h b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransition.h index 8ebcda4e..d55ec10d 100644 --- a/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransition.h +++ b/loader/include/Geode/cocos/layers_scenes_transitions_nodes/CCTransition.h @@ -90,6 +90,7 @@ protected: bool m_bIsSendCleanupToScene; public: + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionScene, CCScene) /** * @js ctor */ @@ -147,6 +148,7 @@ public: * @js ctor */ CCTransitionSceneOriented(); + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionSceneOriented, CCTransitionScene) /** * @js NA * @lua NA @@ -171,6 +173,7 @@ public: * @js ctor */ CCTransitionRotoZoom(); + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionRotoZoom, CCTransitionScene) /** * @js NA * @lua NA @@ -623,6 +626,7 @@ public: * @js ctor */ CCTransitionFade(); + GEODE_CUSTOM_CONSTRUCTOR_COCOS(CCTransitionFade, CCTransitionScene) /** * @js NA * @lua NA diff --git a/loader/include/Geode/cocos/platform/android/CCPlatformDefine.h b/loader/include/Geode/cocos/platform/android/CCPlatformDefine.h index 93fe1c46..3f9a88d1 100644 --- a/loader/include/Geode/cocos/platform/android/CCPlatformDefine.h +++ b/loader/include/Geode/cocos/platform/android/CCPlatformDefine.h @@ -3,12 +3,8 @@ #include -#ifdef GEODE_EXPORTING - #define CC_DLL __attribute__((visibility("default"))) -#else - #define CC_DLL -#endif -#define ACTUAL_CC_DLL CC_DLL +#define CC_DLL +#define ACTUAL_CC_DLL #define CC_NO_MESSAGE_PSEUDOASSERT(cond) \ if (!(cond)) { \ diff --git a/loader/include/Geode/cocos/platform/ios/CCPlatformDefine.h b/loader/include/Geode/cocos/platform/ios/CCPlatformDefine.h index 74bc5d07..df4e4242 100644 --- a/loader/include/Geode/cocos/platform/ios/CCPlatformDefine.h +++ b/loader/include/Geode/cocos/platform/ios/CCPlatformDefine.h @@ -3,12 +3,8 @@ #include -#ifdef GEODE_EXPORTING - #define CC_DLL __attribute__((visibility("default"))) -#else - #define CC_DLL -#endif -#define ACTUAL_CC_DLL CC_DLL +#define CC_DLL //__attribute__((visibility("hidden"))) +#define ACTUAL_CC_DLL #define CC_ASSERT(cond) assert(cond) diff --git a/loader/include/Geode/cocos/platform/mac/CCPlatformDefine.h b/loader/include/Geode/cocos/platform/mac/CCPlatformDefine.h index e542eecb..8ccb4edd 100644 --- a/loader/include/Geode/cocos/platform/mac/CCPlatformDefine.h +++ b/loader/include/Geode/cocos/platform/mac/CCPlatformDefine.h @@ -3,12 +3,8 @@ #include -#ifdef GEODE_EXPORTING - #define CC_DLL __attribute__((visibility("default"))) -#else - #define CC_DLL -#endif -#define ACTUAL_CC_DLL CC_DLL +#define CC_DLL //__attribute__((visibility("hidden"))) +#define ACTUAL_CC_DLL #if CC_DISABLE_ASSERT > 0 diff --git a/loader/include/Geode/cocos/shaders/CCGLProgram.h b/loader/include/Geode/cocos/shaders/CCGLProgram.h index 35412ec0..f1fa89fd 100644 --- a/loader/include/Geode/cocos/shaders/CCGLProgram.h +++ b/loader/include/Geode/cocos/shaders/CCGLProgram.h @@ -271,7 +271,7 @@ public: */ inline const GLuint getProgram() { return m_uProgram; } -protected: +private: bool updateUniformLocation(GLint location, GLvoid* data, unsigned int bytes); const char* description(); bool compileShader(GLuint * shader, GLenum type, const GLchar* source); diff --git a/loader/include/Geode/fmod/fmod.h b/loader/include/Geode/fmod/fmod.h index c12bc9e4..43f26439 100644 --- a/loader/include/Geode/fmod/fmod.h +++ b/loader/include/Geode/fmod/fmod.h @@ -31,7 +31,7 @@ FMOD_RESULT F_API FMOD_File_GetDiskBusy (int *busy); /* FMOD System factory functions. Use this to create an FMOD System Instance. below you will see FMOD_System_Init/Close to get started. */ -FMOD_RESULT F_API FMOD_System_Create (FMOD_SYSTEM **system); +FMOD_RESULT /*F_API*/ FMOD_System_Create (FMOD_SYSTEM **system); FMOD_RESULT F_API FMOD_System_Release (FMOD_SYSTEM *system); /* diff --git a/loader/include/Geode/loader/Mod.hpp b/loader/include/Geode/loader/Mod.hpp index 27f8eb44..0cf2ed64 100644 --- a/loader/include/Geode/loader/Mod.hpp +++ b/loader/include/Geode/loader/Mod.hpp @@ -85,14 +85,14 @@ namespace geode { ghc::filesystem::path getPackagePath() const; VersionInfo getVersion() const; bool isEnabled() const; - bool isLoaded() const; + [[deprecated("use isEnabled instead")]] bool isLoaded() const; bool supportsDisabling() const; - bool canDisable() const; - bool canEnable() const; + [[deprecated("always true")]] bool canDisable() const; + [[deprecated("always true")]] bool canEnable() const; bool needsEarlyLoad() const; - [[deprecated]] bool supportsUnloading() const; - [[deprecated("use wasSuccessfullyLoaded instead")]] bool wasSuccesfullyLoaded() const; - bool wasSuccessfullyLoaded() const; + [[deprecated("always false")]] bool supportsUnloading() const; + [[deprecated("use isEnabled instead")]] bool wasSuccesfullyLoaded() const; + [[deprecated("use isEnabled instead")]] bool wasSuccessfullyLoaded() const; [[deprecated("use getMetadata instead")]] ModInfo getModInfo() const; ModMetadata getMetadata() const; ghc::filesystem::path getTempDir() const; @@ -398,6 +398,6 @@ namespace geode { }; } -inline char const* operator"" _spr(char const* str, size_t) { +GEODE_HIDDEN inline char const* operator"" _spr(char const* str, size_t) { return geode::Mod::get()->expandSpriteName(str); } diff --git a/loader/include/Geode/loader/Setting.hpp b/loader/include/Geode/loader/Setting.hpp index fca764c9..5425687a 100644 --- a/loader/include/Geode/loader/Setting.hpp +++ b/loader/include/Geode/loader/Setting.hpp @@ -96,6 +96,11 @@ namespace geode { */ std::optional match; + /** + * The CCTextInputNode's allowed character filter + */ + std::optional filter; + static Result parse(JsonMaybeObject& obj); }; diff --git a/loader/include/Geode/modify/Addresses.hpp b/loader/include/Geode/modify/Addresses.hpp index 4f0d9518..bea14fdf 100644 --- a/loader/include/Geode/modify/Addresses.hpp +++ b/loader/include/Geode/modify/Addresses.hpp @@ -5,7 +5,7 @@ namespace geode::modifier { template - uintptr_t address(); + GEODE_HIDDEN uintptr_t address(); Result handlerMetadataForAddress(uintptr_t address); } diff --git a/loader/include/Geode/ui/SceneManager.hpp b/loader/include/Geode/ui/SceneManager.hpp index 2539f182..2077f49b 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/include/Geode/utils/cocos.hpp b/loader/include/Geode/utils/cocos.hpp index d8a66905..edc4fd2e 100644 --- a/loader/include/Geode/utils/cocos.hpp +++ b/loader/include/Geode/utils/cocos.hpp @@ -953,7 +953,7 @@ namespace geode::cocos { return m_arr ? m_arr->count() : 0; } - T operator[](size_t index) { + T* operator[](size_t index) { return static_cast(m_arr->objectAtIndex(index)); } diff --git a/loader/resources/about.md b/loader/resources/about.md.in similarity index 100% rename from loader/resources/about.md rename to loader/resources/about.md.in diff --git a/loader/resources/blanks/baseAccount_Normal_Blue.png b/loader/resources/blanks/baseAccount_Normal_Blue.png index 559538ec..442fc794 100644 Binary files a/loader/resources/blanks/baseAccount_Normal_Blue.png and b/loader/resources/blanks/baseAccount_Normal_Blue.png differ diff --git a/loader/resources/blanks/baseAccount_Normal_Gray.png b/loader/resources/blanks/baseAccount_Normal_Gray.png index 74a96ca2..d09dbd52 100644 Binary files a/loader/resources/blanks/baseAccount_Normal_Gray.png and b/loader/resources/blanks/baseAccount_Normal_Gray.png differ diff --git a/loader/resources/blanks/baseAccount_Normal_Purple.png b/loader/resources/blanks/baseAccount_Normal_Purple.png index 97b90e4f..75239f60 100644 Binary files a/loader/resources/blanks/baseAccount_Normal_Purple.png and b/loader/resources/blanks/baseAccount_Normal_Purple.png differ diff --git a/loader/resources/blanks/baseCategory_Big_Green.png b/loader/resources/blanks/baseCategory_Big_Green.png index ae02fce5..ff67b43f 100644 Binary files a/loader/resources/blanks/baseCategory_Big_Green.png and b/loader/resources/blanks/baseCategory_Big_Green.png differ diff --git a/loader/resources/blanks/baseCircle_BigAlt_Blue.png b/loader/resources/blanks/baseCircle_BigAlt_Blue.png index 205e4fdd..ef69e647 100644 Binary files a/loader/resources/blanks/baseCircle_BigAlt_Blue.png and b/loader/resources/blanks/baseCircle_BigAlt_Blue.png differ diff --git a/loader/resources/blanks/baseCircle_BigAlt_Cyan.png b/loader/resources/blanks/baseCircle_BigAlt_Cyan.png index d5a0ad42..40130cba 100644 Binary files a/loader/resources/blanks/baseCircle_BigAlt_Cyan.png and b/loader/resources/blanks/baseCircle_BigAlt_Cyan.png differ diff --git a/loader/resources/blanks/baseCircle_BigAlt_Gray.png b/loader/resources/blanks/baseCircle_BigAlt_Gray.png index ea73faba..aa77f001 100644 Binary files a/loader/resources/blanks/baseCircle_BigAlt_Gray.png and b/loader/resources/blanks/baseCircle_BigAlt_Gray.png differ diff --git a/loader/resources/blanks/baseCircle_BigAlt_Green.png b/loader/resources/blanks/baseCircle_BigAlt_Green.png index 7c042572..d22bc68f 100644 Binary files a/loader/resources/blanks/baseCircle_BigAlt_Green.png and b/loader/resources/blanks/baseCircle_BigAlt_Green.png differ diff --git a/loader/resources/blanks/baseCircle_BigAlt_Pink.png b/loader/resources/blanks/baseCircle_BigAlt_Pink.png index 886024e3..4891b1f5 100644 Binary files a/loader/resources/blanks/baseCircle_BigAlt_Pink.png and b/loader/resources/blanks/baseCircle_BigAlt_Pink.png differ diff --git a/loader/resources/blanks/baseCircle_Big_Blue.png b/loader/resources/blanks/baseCircle_Big_Blue.png index 21957129..128d1331 100644 Binary files a/loader/resources/blanks/baseCircle_Big_Blue.png and b/loader/resources/blanks/baseCircle_Big_Blue.png differ diff --git a/loader/resources/blanks/baseCircle_Big_Cyan.png b/loader/resources/blanks/baseCircle_Big_Cyan.png index a06d3814..5b6a0bea 100644 Binary files a/loader/resources/blanks/baseCircle_Big_Cyan.png and b/loader/resources/blanks/baseCircle_Big_Cyan.png differ diff --git a/loader/resources/blanks/baseCircle_Big_Gray.png b/loader/resources/blanks/baseCircle_Big_Gray.png index 85ce3a8b..1cc9c125 100644 Binary files a/loader/resources/blanks/baseCircle_Big_Gray.png and b/loader/resources/blanks/baseCircle_Big_Gray.png differ diff --git a/loader/resources/blanks/baseCircle_Big_Green.png b/loader/resources/blanks/baseCircle_Big_Green.png index 4bec4026..ec3f451c 100644 Binary files a/loader/resources/blanks/baseCircle_Big_Green.png and b/loader/resources/blanks/baseCircle_Big_Green.png differ diff --git a/loader/resources/blanks/baseCircle_Big_Pink.png b/loader/resources/blanks/baseCircle_Big_Pink.png index eade39db..889eeee1 100644 Binary files a/loader/resources/blanks/baseCircle_Big_Pink.png and b/loader/resources/blanks/baseCircle_Big_Pink.png differ diff --git a/loader/resources/blanks/baseCircle_Large_Blue.png b/loader/resources/blanks/baseCircle_Large_Blue.png index fa5d25f6..3a42af72 100644 Binary files a/loader/resources/blanks/baseCircle_Large_Blue.png and b/loader/resources/blanks/baseCircle_Large_Blue.png differ diff --git a/loader/resources/blanks/baseCircle_Large_Cyan.png b/loader/resources/blanks/baseCircle_Large_Cyan.png index 50d04df2..cea77e2f 100644 Binary files a/loader/resources/blanks/baseCircle_Large_Cyan.png and b/loader/resources/blanks/baseCircle_Large_Cyan.png differ diff --git a/loader/resources/blanks/baseCircle_Large_Gray.png b/loader/resources/blanks/baseCircle_Large_Gray.png index 0cd467cc..3cecc3ab 100644 Binary files a/loader/resources/blanks/baseCircle_Large_Gray.png and b/loader/resources/blanks/baseCircle_Large_Gray.png differ diff --git a/loader/resources/blanks/baseCircle_Large_Green.png b/loader/resources/blanks/baseCircle_Large_Green.png index b8c12356..6100ff10 100644 Binary files a/loader/resources/blanks/baseCircle_Large_Green.png and b/loader/resources/blanks/baseCircle_Large_Green.png differ diff --git a/loader/resources/blanks/baseCircle_Large_Pink.png b/loader/resources/blanks/baseCircle_Large_Pink.png index efd3874a..97b3d246 100644 Binary files a/loader/resources/blanks/baseCircle_Large_Pink.png and b/loader/resources/blanks/baseCircle_Large_Pink.png differ diff --git a/loader/resources/blanks/baseCircle_MediumAlt_Blue.png b/loader/resources/blanks/baseCircle_MediumAlt_Blue.png index 667a1f59..b5cdf449 100644 Binary files a/loader/resources/blanks/baseCircle_MediumAlt_Blue.png and b/loader/resources/blanks/baseCircle_MediumAlt_Blue.png differ diff --git a/loader/resources/blanks/baseCircle_MediumAlt_Cyan.png b/loader/resources/blanks/baseCircle_MediumAlt_Cyan.png index 61ffcd7d..daed179f 100644 Binary files a/loader/resources/blanks/baseCircle_MediumAlt_Cyan.png and b/loader/resources/blanks/baseCircle_MediumAlt_Cyan.png differ diff --git a/loader/resources/blanks/baseCircle_MediumAlt_Gray.png b/loader/resources/blanks/baseCircle_MediumAlt_Gray.png index ceb93598..aa7a993f 100644 Binary files a/loader/resources/blanks/baseCircle_MediumAlt_Gray.png and b/loader/resources/blanks/baseCircle_MediumAlt_Gray.png differ diff --git a/loader/resources/blanks/baseCircle_MediumAlt_Green.png b/loader/resources/blanks/baseCircle_MediumAlt_Green.png index de9bcacd..d1afa1f0 100644 Binary files a/loader/resources/blanks/baseCircle_MediumAlt_Green.png and b/loader/resources/blanks/baseCircle_MediumAlt_Green.png differ diff --git a/loader/resources/blanks/baseCircle_MediumAlt_Pink.png b/loader/resources/blanks/baseCircle_MediumAlt_Pink.png index 2734e40b..9717f081 100644 Binary files a/loader/resources/blanks/baseCircle_MediumAlt_Pink.png and b/loader/resources/blanks/baseCircle_MediumAlt_Pink.png differ diff --git a/loader/resources/blanks/baseCircle_Medium_Blue.png b/loader/resources/blanks/baseCircle_Medium_Blue.png index fb174e72..964b312d 100644 Binary files a/loader/resources/blanks/baseCircle_Medium_Blue.png and b/loader/resources/blanks/baseCircle_Medium_Blue.png differ diff --git a/loader/resources/blanks/baseCircle_Medium_Cyan.png b/loader/resources/blanks/baseCircle_Medium_Cyan.png index 374fef8f..01589f7a 100644 Binary files a/loader/resources/blanks/baseCircle_Medium_Cyan.png and b/loader/resources/blanks/baseCircle_Medium_Cyan.png differ diff --git a/loader/resources/blanks/baseCircle_Medium_Gray.png b/loader/resources/blanks/baseCircle_Medium_Gray.png index e2b59434..663f92ce 100644 Binary files a/loader/resources/blanks/baseCircle_Medium_Gray.png and b/loader/resources/blanks/baseCircle_Medium_Gray.png differ diff --git a/loader/resources/blanks/baseCircle_Medium_Green.png b/loader/resources/blanks/baseCircle_Medium_Green.png index b50d38f7..ecf70e53 100644 Binary files a/loader/resources/blanks/baseCircle_Medium_Green.png and b/loader/resources/blanks/baseCircle_Medium_Green.png differ diff --git a/loader/resources/blanks/baseCircle_Medium_Pink.png b/loader/resources/blanks/baseCircle_Medium_Pink.png index cf609277..8ca18621 100644 Binary files a/loader/resources/blanks/baseCircle_Medium_Pink.png and b/loader/resources/blanks/baseCircle_Medium_Pink.png differ diff --git a/loader/resources/blanks/baseCircle_SmallAlt_Blue.png b/loader/resources/blanks/baseCircle_SmallAlt_Blue.png index 958f148e..a72d42c8 100644 Binary files a/loader/resources/blanks/baseCircle_SmallAlt_Blue.png and b/loader/resources/blanks/baseCircle_SmallAlt_Blue.png differ diff --git a/loader/resources/blanks/baseCircle_SmallAlt_Cyan.png b/loader/resources/blanks/baseCircle_SmallAlt_Cyan.png index c777f6ab..1e1583bd 100644 Binary files a/loader/resources/blanks/baseCircle_SmallAlt_Cyan.png and b/loader/resources/blanks/baseCircle_SmallAlt_Cyan.png differ diff --git a/loader/resources/blanks/baseCircle_SmallAlt_Gray.png b/loader/resources/blanks/baseCircle_SmallAlt_Gray.png index dcc712c6..5319559a 100644 Binary files a/loader/resources/blanks/baseCircle_SmallAlt_Gray.png and b/loader/resources/blanks/baseCircle_SmallAlt_Gray.png differ diff --git a/loader/resources/blanks/baseCircle_SmallAlt_Green.png b/loader/resources/blanks/baseCircle_SmallAlt_Green.png index 831acf9b..811f2fc3 100644 Binary files a/loader/resources/blanks/baseCircle_SmallAlt_Green.png and b/loader/resources/blanks/baseCircle_SmallAlt_Green.png differ diff --git a/loader/resources/blanks/baseCircle_SmallAlt_Pink.png b/loader/resources/blanks/baseCircle_SmallAlt_Pink.png index d139fd9c..41c6334b 100644 Binary files a/loader/resources/blanks/baseCircle_SmallAlt_Pink.png and b/loader/resources/blanks/baseCircle_SmallAlt_Pink.png differ diff --git a/loader/resources/blanks/baseCircle_Small_Blue.png b/loader/resources/blanks/baseCircle_Small_Blue.png index 00e86d9e..49eed3bc 100644 Binary files a/loader/resources/blanks/baseCircle_Small_Blue.png and b/loader/resources/blanks/baseCircle_Small_Blue.png differ diff --git a/loader/resources/blanks/baseCircle_Small_Cyan.png b/loader/resources/blanks/baseCircle_Small_Cyan.png index 83c21119..3f539bc0 100644 Binary files a/loader/resources/blanks/baseCircle_Small_Cyan.png and b/loader/resources/blanks/baseCircle_Small_Cyan.png differ diff --git a/loader/resources/blanks/baseCircle_Small_Gray.png b/loader/resources/blanks/baseCircle_Small_Gray.png index de8b71dc..be7b3608 100644 Binary files a/loader/resources/blanks/baseCircle_Small_Gray.png and b/loader/resources/blanks/baseCircle_Small_Gray.png differ diff --git a/loader/resources/blanks/baseCircle_Small_Green.png b/loader/resources/blanks/baseCircle_Small_Green.png index 8f1690ec..34830d5d 100644 Binary files a/loader/resources/blanks/baseCircle_Small_Green.png and b/loader/resources/blanks/baseCircle_Small_Green.png differ diff --git a/loader/resources/blanks/baseCircle_Small_Pink.png b/loader/resources/blanks/baseCircle_Small_Pink.png index fd80a292..ecbf9d99 100644 Binary files a/loader/resources/blanks/baseCircle_Small_Pink.png and b/loader/resources/blanks/baseCircle_Small_Pink.png differ diff --git a/loader/resources/blanks/baseCircle_Tiny_Blue.png b/loader/resources/blanks/baseCircle_Tiny_Blue.png index f1d70b2b..f6f5e734 100644 Binary files a/loader/resources/blanks/baseCircle_Tiny_Blue.png and b/loader/resources/blanks/baseCircle_Tiny_Blue.png differ diff --git a/loader/resources/blanks/baseCircle_Tiny_Cyan.png b/loader/resources/blanks/baseCircle_Tiny_Cyan.png index f953b2fc..ea69dd86 100644 Binary files a/loader/resources/blanks/baseCircle_Tiny_Cyan.png and b/loader/resources/blanks/baseCircle_Tiny_Cyan.png differ diff --git a/loader/resources/blanks/baseCircle_Tiny_Gray.png b/loader/resources/blanks/baseCircle_Tiny_Gray.png index 1bd93285..4d3d9d53 100644 Binary files a/loader/resources/blanks/baseCircle_Tiny_Gray.png and b/loader/resources/blanks/baseCircle_Tiny_Gray.png differ diff --git a/loader/resources/blanks/baseCircle_Tiny_Green.png b/loader/resources/blanks/baseCircle_Tiny_Green.png index 1d0a28d7..8be15fca 100644 Binary files a/loader/resources/blanks/baseCircle_Tiny_Green.png and b/loader/resources/blanks/baseCircle_Tiny_Green.png differ diff --git a/loader/resources/blanks/baseCircle_Tiny_Pink.png b/loader/resources/blanks/baseCircle_Tiny_Pink.png index 02f86ec8..afa3f94a 100644 Binary files a/loader/resources/blanks/baseCircle_Tiny_Pink.png and b/loader/resources/blanks/baseCircle_Tiny_Pink.png differ diff --git a/loader/resources/blanks/baseCross_Huge_Green.png b/loader/resources/blanks/baseCross_Huge_Green.png index 619eb833..15411545 100644 Binary files a/loader/resources/blanks/baseCross_Huge_Green.png and b/loader/resources/blanks/baseCross_Huge_Green.png differ diff --git a/loader/resources/blanks/baseCross_Small_Green.png b/loader/resources/blanks/baseCross_Small_Green.png index 1d44a8d3..350c5f0c 100644 Binary files a/loader/resources/blanks/baseCross_Small_Green.png and b/loader/resources/blanks/baseCross_Small_Green.png differ diff --git a/loader/resources/blanks/baseEditor_Normal_Aqua.png b/loader/resources/blanks/baseEditor_Normal_Aqua.png index 1feb76a2..908e0920 100644 Binary files a/loader/resources/blanks/baseEditor_Normal_Aqua.png and b/loader/resources/blanks/baseEditor_Normal_Aqua.png differ diff --git a/loader/resources/blanks/baseEditor_Normal_Cyan.png b/loader/resources/blanks/baseEditor_Normal_Cyan.png index c726ca74..0943c41c 100644 Binary files a/loader/resources/blanks/baseEditor_Normal_Cyan.png and b/loader/resources/blanks/baseEditor_Normal_Cyan.png differ diff --git a/loader/resources/blanks/baseEditor_Normal_DarkGray.png b/loader/resources/blanks/baseEditor_Normal_DarkGray.png index a8ed3f93..56ba0849 100644 Binary files a/loader/resources/blanks/baseEditor_Normal_DarkGray.png and b/loader/resources/blanks/baseEditor_Normal_DarkGray.png differ diff --git a/loader/resources/blanks/baseEditor_Normal_Gray.png b/loader/resources/blanks/baseEditor_Normal_Gray.png index faeeb5a7..3f7f0023 100644 Binary files a/loader/resources/blanks/baseEditor_Normal_Gray.png and b/loader/resources/blanks/baseEditor_Normal_Gray.png differ diff --git a/loader/resources/blanks/baseEditor_Normal_Green.png b/loader/resources/blanks/baseEditor_Normal_Green.png index 9162a71f..db9c9250 100644 Binary files a/loader/resources/blanks/baseEditor_Normal_Green.png and b/loader/resources/blanks/baseEditor_Normal_Green.png differ diff --git a/loader/resources/blanks/baseEditor_Normal_LightBlue.png b/loader/resources/blanks/baseEditor_Normal_LightBlue.png index 00ccfe5d..f9f798e7 100644 Binary files a/loader/resources/blanks/baseEditor_Normal_LightBlue.png and b/loader/resources/blanks/baseEditor_Normal_LightBlue.png differ diff --git a/loader/resources/blanks/baseEditor_Normal_Orange.png b/loader/resources/blanks/baseEditor_Normal_Orange.png index b2ddde8d..55633876 100644 Binary files a/loader/resources/blanks/baseEditor_Normal_Orange.png and b/loader/resources/blanks/baseEditor_Normal_Orange.png differ diff --git a/loader/resources/blanks/baseEditor_Normal_Pink.png b/loader/resources/blanks/baseEditor_Normal_Pink.png index 8a5abb5c..9f67c3c9 100644 Binary files a/loader/resources/blanks/baseEditor_Normal_Pink.png and b/loader/resources/blanks/baseEditor_Normal_Pink.png differ diff --git a/loader/resources/blanks/baseEditor_Normal_Teal.png b/loader/resources/blanks/baseEditor_Normal_Teal.png index 4b492b41..bb31bce2 100644 Binary files a/loader/resources/blanks/baseEditor_Normal_Teal.png and b/loader/resources/blanks/baseEditor_Normal_Teal.png differ diff --git a/loader/resources/blanks/baseIconSelect_Normal_Selected.png b/loader/resources/blanks/baseIconSelect_Normal_Selected.png index 02d2ac37..b74ae53c 100644 Binary files a/loader/resources/blanks/baseIconSelect_Normal_Selected.png and b/loader/resources/blanks/baseIconSelect_Normal_Selected.png differ diff --git a/loader/resources/blanks/baseIconSelect_Normal_Unselected.png b/loader/resources/blanks/baseIconSelect_Normal_Unselected.png index 5dd3b93c..08c74ea1 100644 Binary files a/loader/resources/blanks/baseIconSelect_Normal_Unselected.png and b/loader/resources/blanks/baseIconSelect_Normal_Unselected.png differ diff --git a/loader/resources/blanks/baseLeaderboard_Normal_Blue.png b/loader/resources/blanks/baseLeaderboard_Normal_Blue.png index ded180c0..e628ba7d 100644 Binary files a/loader/resources/blanks/baseLeaderboard_Normal_Blue.png and b/loader/resources/blanks/baseLeaderboard_Normal_Blue.png differ diff --git a/loader/resources/blanks/baseTab_Normal_Selected.png b/loader/resources/blanks/baseTab_Normal_Selected.png index 49e45255..ec0b74b6 100644 Binary files a/loader/resources/blanks/baseTab_Normal_Selected.png and b/loader/resources/blanks/baseTab_Normal_Selected.png differ diff --git a/loader/resources/blanks/baseTab_Normal_Unselected.png b/loader/resources/blanks/baseTab_Normal_Unselected.png index e71e5450..16961c5f 100644 Binary files a/loader/resources/blanks/baseTab_Normal_Unselected.png and b/loader/resources/blanks/baseTab_Normal_Unselected.png differ diff --git a/loader/resources/blanks/baseTab_Normal_UnselectedDark.png b/loader/resources/blanks/baseTab_Normal_UnselectedDark.png index e063f2e0..a7da7b67 100644 Binary files a/loader/resources/blanks/baseTab_Normal_UnselectedDark.png and b/loader/resources/blanks/baseTab_Normal_UnselectedDark.png differ diff --git a/loader/resources/category-bg.png b/loader/resources/category-bg.png index e9df8e44..b75dd8e6 100644 Binary files a/loader/resources/category-bg.png and b/loader/resources/category-bg.png differ diff --git a/loader/resources/category-dot.png b/loader/resources/category-dot.png index 07d604fd..fdabdad9 100644 Binary files a/loader/resources/category-dot.png and b/loader/resources/category-dot.png differ diff --git a/loader/resources/filters.png b/loader/resources/filters.png index f4b718ce..54c0389c 100644 Binary files a/loader/resources/filters.png and b/loader/resources/filters.png differ diff --git a/loader/resources/gift.png b/loader/resources/gift.png index ad89c950..9015fd28 100644 Binary files a/loader/resources/gift.png and b/loader/resources/gift.png differ diff --git a/loader/resources/github.png b/loader/resources/github.png index a0ef002d..4e6d1a62 100644 Binary files a/loader/resources/github.png and b/loader/resources/github.png differ diff --git a/loader/resources/images/tab-gradient-mask.png b/loader/resources/images/tab-gradient-mask.png index d9a06ce7..32326688 100644 Binary files a/loader/resources/images/tab-gradient-mask.png and b/loader/resources/images/tab-gradient-mask.png differ diff --git a/loader/resources/info-warning.png b/loader/resources/info-warning.png index 64fab516..a986e6d6 100644 Binary files a/loader/resources/info-warning.png and b/loader/resources/info-warning.png differ diff --git a/loader/resources/pencil.png b/loader/resources/pencil.png index b94c2732..2ef2de73 100644 Binary files a/loader/resources/pencil.png and b/loader/resources/pencil.png differ diff --git a/loader/resources/support.md b/loader/resources/support.md.in similarity index 100% rename from loader/resources/support.md rename to loader/resources/support.md.in diff --git a/loader/src/hooks/CCTextInputNode.cpp b/loader/src/hooks/CCTextInputNode.cpp new file mode 100644 index 00000000..b94681f1 --- /dev/null +++ b/loader/src/hooks/CCTextInputNode.cpp @@ -0,0 +1,26 @@ +#include + +using namespace geode::prelude; + +// rob only uses `CCTextInputNode`s in mostly-flat hierarchies, which still +// happen to work with the weird vanilla code. this fix makes it work even in +// deep hierarchies, because the vanilla code uses `getParent` and manually +// calculates the child location in the world space based on that rather than +// using `convertToNodeSpace`. + +struct CCTextInputNodeFix : Modify { + bool ccTouchBegan(CCTouch* touch, CCEvent* event) { + auto const touchPos = touch->getLocation(); + auto const size = this->getContentSize(); + auto const pos = this->convertToNodeSpace(touchPos) + m_textField->getAnchorPoint() * size; + + if (pos.x < 0 || pos.x > size.width || pos.y < 0 || pos.y > size.height) + return false; + if (m_delegate && !m_delegate->allowTextInput(this)) + return false; + + this->onClickTrackNode(true); + + return true; + } +}; diff --git a/loader/src/hooks/LoadingLayer.cpp b/loader/src/hooks/LoadingLayer.cpp index 9307998c..b3a24bd0 100644 --- a/loader/src/hooks/LoadingLayer.cpp +++ b/loader/src/hooks/LoadingLayer.cpp @@ -16,7 +16,7 @@ struct CustomLoadingLayer : Modify { void updateLoadedModsLabel() { auto allMods = Loader::get()->getAllMods(); auto count = std::count_if(allMods.begin(), allMods.end(), [&](auto& item) { - return item->isLoaded(); + return item->isEnabled(); }); auto str = fmt::format("Geode: Loaded {}/{} mods", count, allMods.size()); m_fields->m_loadedModsLabel->setCString(str.c_str()); diff --git a/loader/src/hooks/MenuLayer.cpp b/loader/src/hooks/MenuLayer.cpp index 4942a0ec..869d1bce 100644 --- a/loader/src/hooks/MenuLayer.cpp +++ b/loader/src/hooks/MenuLayer.cpp @@ -208,14 +208,14 @@ struct CustomMenuLayer : Modify { #ifdef GEODE_IS_DESKTOP - (void) utils::file::createDirectoryAll(dirs::getGeodeDir() / "update" / "resources"); + (void) utils::file::createDirectoryAll(dirs::getGeodeDir() / "update" / "resources" / "geode.loader"); createQuickPopup( "Missing Textures", "You appear to be missing textures, and the automatic texture fixer " "hasn't fixed the issue.\n" "Download resources.zip from the latest release on GitHub, " - "and unzip its contents into geode/update/resources.\n" + "and unzip its contents into geode/update/resources/geode.loader.\n" "Afterwards, restart the game.\n" "You may also continue without installing resources, but be aware that " "you won't be able to open the Geode menu.", diff --git a/loader/src/ids/GJGarageLayer.cpp b/loader/src/ids/GJGarageLayer.cpp index 57d644c5..b4ea8425 100644 --- a/loader/src/ids/GJGarageLayer.cpp +++ b/loader/src/ids/GJGarageLayer.cpp @@ -7,8 +7,11 @@ using namespace geode::prelude; $register_ids(GJGarageLayer) { + // the lock does not exist for not logged in users + auto loggedInOffset = GJAccountManager::get()->m_accountID == GJAccountManager::get()->m_playerID ? -1 : 0; + setIDSafe(this, 2, "username-label"); - setIDSafe(this, 6, "player-icon"); + setIDSafe(this, 6 + loggedInOffset, "player-icon"); auto winSize = CCDirector::get()->getWinSize(); @@ -39,7 +42,7 @@ $register_ids(GJGarageLayer) { setIDs( this, - 10, + 10 + loggedInOffset, "cube-selection-menu", "ship-selection-menu", "ball-selection-menu", diff --git a/loader/src/internal/crashlog.cpp b/loader/src/internal/crashlog.cpp index 486ed09f..7f698616 100644 --- a/loader/src/internal/crashlog.cpp +++ b/loader/src/internal/crashlog.cpp @@ -24,14 +24,13 @@ static void printGeodeInfo(std::stringstream& stream) { static void printMods(std::stringstream& stream) { auto mods = Loader::get()->getAllMods(); - if (!mods.size()) { + if (mods.empty()) { stream << "\n"; } using namespace std::string_view_literals; for (auto& mod : mods) { - stream << fmt::format("{:>8} | {:>8} | [{}] {}\n", - mod->isLoaded() ? "Loaded"sv : "Unloaded"sv, - mod->isEnabled() ? "Enabled"sv : "Disabled"sv, + stream << fmt::format("{} | [{}] {}\n", + mod->isEnabled() ? "x"sv : " "sv, mod->getVersion().toString(), mod->getID() ); } diff --git a/loader/src/loader/Index.cpp b/loader/src/loader/Index.cpp index d223ae0c..ff1d4b1d 100644 --- a/loader/src/loader/Index.cpp +++ b/loader/src/loader/Index.cpp @@ -8,6 +8,8 @@ #include #include +#include + #ifdef GEODE_IS_WINDOWS #include #endif @@ -250,7 +252,7 @@ private: friend class Index; void cleanupItems(); - void downloadIndex(); + void downloadIndex(std::string commitHash = ""); void checkForUpdates(); void updateFromLocalTree(); void installNext(size_t index, IndexInstallList const& list); @@ -294,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(); @@ -305,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 { @@ -318,19 +320,29 @@ void Index::Impl::downloadIndex() { return; } - // unzip new index - auto unzip = file::Unzip::intoDir(targetFile, targetDir, true) - .expect("Unable to unzip new index"); - if (!unzip) { - IndexUpdateEvent(UpdateFailed(unzip.unwrapErr())).post(); - return; - } + std::thread([=, this]() { + // unzip new index + auto unzip = file::Unzip::intoDir(targetFile, targetDir, true) + .expect("Unable to unzip new index"); + if (!unzip) { + Loader::get()->queueInMainThread([unzip] { + IndexUpdateEvent(UpdateFailed(unzip.unwrapErr())).post(); + }); + return; + } - // remove the directory github adds to the root of the zip - (void)flattenGithubRepo(targetDir); + // 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); + } - // update index - this->updateFromLocalTree(); + Loader::get()->queueInMainThread([this] { + // update index + this->updateFromLocalTree(); + }); + }).detach(); }) .expect([](std::string const& err) { IndexUpdateEvent(UpdateFailed(fmt::format("Error downloading: {}", err))).post(); @@ -379,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) { @@ -448,7 +459,8 @@ void Index::update(bool force) { // update sources if (force) { m_impl->downloadIndex(); - } else { + } + else { m_impl->checkForUpdates(); } } @@ -582,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; } } diff --git a/loader/src/loader/LoaderImpl.cpp b/loader/src/loader/LoaderImpl.cpp index 61afcb13..52727ff0 100644 --- a/loader/src/loader/LoaderImpl.cpp +++ b/loader/src/loader/LoaderImpl.cpp @@ -201,13 +201,13 @@ Mod* Loader::Impl::getInstalledMod(std::string const& id) const { } bool Loader::Impl::isModLoaded(std::string const& id) const { - return m_mods.count(id) && m_mods.at(id)->isLoaded(); + return m_mods.count(id) && m_mods.at(id)->isEnabled(); } Mod* Loader::Impl::getLoadedMod(std::string const& id) const { if (m_mods.count(id)) { auto mod = m_mods.at(id); - if (mod->isLoaded()) { + if (mod->isEnabled()) { return mod; } } @@ -225,8 +225,6 @@ void Loader::Impl::updateModResources(Mod* mod) { if (mod->getMetadata().getSpritesheets().empty()) return; - auto searchPath = mod->getResourcesDir(); - log::debug("Adding resources for {}", mod->getID()); // add spritesheets @@ -402,7 +400,7 @@ void Loader::Impl::loadModGraph(Mod* node, bool early) { log::debug("{} {}", node->getID(), node->getVersion()); log::pushNest(); - if (node->isLoaded()) { + if (node->isEnabled()) { for (auto const& dep : node->m_impl->m_dependants) { this->loadModGraph(dep, early); } @@ -438,7 +436,7 @@ void Loader::Impl::findProblems() { log::pushNest(); for (auto const& dep : mod->getMetadata().getDependencies()) { - if (dep.mod && dep.mod->isLoaded() && dep.version.compare(dep.mod->getVersion())) + if (dep.mod && dep.mod->isEnabled() && dep.version.compare(dep.mod->getVersion())) continue; switch(dep.importance) { case ModMetadata::Dependency::Importance::Suggested: @@ -493,19 +491,21 @@ void Loader::Impl::findProblems() { Mod* myEpicMod = mod; // clang fix // if the mod is not loaded but there are no problems related to it - // if (!mod->isLoaded() && !std::any_of(m_problems.begin(), m_problems.end(), [myEpicMod](auto& item) { - // return std::holds_alternative(item.cause) && - // std::get(item.cause).getID() == myEpicMod->getID() || - // std::holds_alternative(item.cause) && - // std::get(item.cause) == myEpicMod; - // })) { - // m_problems.push_back({ - // LoadProblem::Type::Unknown, - // mod, - // "" - // }); - // log::error("{} failed to load for an unknown reason", id); - // } + if (!mod->isEnabled() && + Mod::get()->getSavedValue("should-load-" + mod->getID(), true) && + !std::any_of(m_problems.begin(), m_problems.end(), [myEpicMod](auto& item) { + return std::holds_alternative(item.cause) && + std::get(item.cause).getID() == myEpicMod->getID() || + std::holds_alternative(item.cause) && + std::get(item.cause) == myEpicMod; + })) { + m_problems.push_back({ + LoadProblem::Type::Unknown, + mod, + "" + }); + log::error("{} failed to load for an unknown reason", id); + } log::popNest(); } @@ -777,7 +777,7 @@ void Loader::Impl::downloadLoaderResources(bool useLatestRelease) { .json() .then([this](json::Value const& json) { this->tryDownloadLoaderResources(fmt::format( - "https://github.com/geode-sdk/geode/releases/download/{}/resources-" GEODE_PLATFORM_SHORT_IDENTIFIER ".zip", + "https://github.com/geode-sdk/geode/releases/download/{}/resources.zip", this->getVersion().toString() ), true); }) @@ -805,7 +805,7 @@ void Loader::Impl::downloadLoaderResources(bool useLatestRelease) { // find release asset for (auto asset : root.needs("assets").iterate()) { auto obj = asset.obj(); - if (obj.needs("name").template get() == "resources-" GEODE_PLATFORM_SHORT_IDENTIFIER ".zip") { + if (obj.needs("name").template get() == "resources.zip") { this->tryDownloadLoaderResources( obj.needs("browser_download_url").template get(), false diff --git a/loader/src/loader/LoaderImpl.hpp b/loader/src/loader/LoaderImpl.hpp index 92468f2a..38d618eb 100644 --- a/loader/src/loader/LoaderImpl.hpp +++ b/loader/src/loader/LoaderImpl.hpp @@ -13,7 +13,6 @@ #include #include #include "ModImpl.hpp" -#include #include #include #include diff --git a/loader/src/loader/Mod.cpp b/loader/src/loader/Mod.cpp index 392d91c4..9eead765 100644 --- a/loader/src/loader/Mod.cpp +++ b/loader/src/loader/Mod.cpp @@ -47,7 +47,7 @@ bool Mod::isEnabled() const { } bool Mod::isLoaded() const { - return m_impl->isLoaded(); + return this->isEnabled(); } bool Mod::supportsDisabling() const { @@ -55,11 +55,11 @@ bool Mod::supportsDisabling() const { } bool Mod::canDisable() const { - return m_impl->canDisable(); + return true; } bool Mod::canEnable() const { - return m_impl->canEnable(); + return true; } bool Mod::needsEarlyLoad() const { @@ -71,10 +71,10 @@ bool Mod::supportsUnloading() const { } bool Mod::wasSuccesfullyLoaded() const { - return this->wasSuccessfullyLoaded(); + return this->isEnabled(); } bool Mod::wasSuccessfullyLoaded() const { - return m_impl->wasSuccessfullyLoaded(); + return this->isEnabled(); } ModInfo Mod::getModInfo() const { diff --git a/loader/src/loader/ModImpl.cpp b/loader/src/loader/ModImpl.cpp index dc1c838a..73849f7a 100644 --- a/loader/src/loader/ModImpl.cpp +++ b/loader/src/loader/ModImpl.cpp @@ -42,8 +42,10 @@ Result<> Mod::Impl::setup() { if (!loadRes) { log::warn("Unable to load data for \"{}\": {}", m_metadata.getID(), loadRes.unwrapErr()); } - if (LoaderImpl::get()->m_isSetup) { - Loader::get()->updateResources(false); + if (!m_resourcesLoaded) { + auto searchPathRoot = dirs::getModRuntimeDir() / m_metadata.getID() / "resources"; + CCFileUtils::get()->addSearchPath(searchPathRoot.string().c_str()); + m_resourcesLoaded = true; } return Ok(); @@ -112,22 +114,10 @@ bool Mod::Impl::isEnabled() const { return m_enabled; } -bool Mod::Impl::isLoaded() const { - return m_binaryLoaded; -} - bool Mod::Impl::supportsDisabling() const { return m_metadata.getID() != "geode.loader"; } -bool Mod::Impl::canDisable() const { - return true; -} - -bool Mod::Impl::canEnable() const { - return true; -} - bool Mod::Impl::needsEarlyLoad() const { auto deps = m_dependants; return getMetadata().needsEarlyLoad() || @@ -136,10 +126,6 @@ bool Mod::Impl::needsEarlyLoad() const { }); } -bool Mod::Impl::wasSuccessfullyLoaded() const { - return !this->isEnabled() || this->isLoaded(); -} - std::vector Mod::Impl::getHooks() const { return m_hooks; } @@ -321,7 +307,7 @@ bool Mod::Impl::hasSetting(std::string const& key) const { Result<> Mod::Impl::loadBinary() { log::debug("Loading binary for mod {}", m_metadata.getID()); - if (m_binaryLoaded) + if (m_enabled) return Ok(); LoaderImpl::get()->provideNextMod(m_self); @@ -333,7 +319,6 @@ Result<> Mod::Impl::loadBinary() { log::error("Failed to load binary for mod {}: {}", m_metadata.getID(), res.unwrapErr()); return res; } - m_binaryLoaded = true; LoaderImpl::get()->releaseNextMod(); @@ -588,14 +573,13 @@ ghc::filesystem::path Mod::Impl::getConfigDir(bool create) const { } char const* Mod::Impl::expandSpriteName(char const* name) { - static std::unordered_map expanded = {}; - if (expanded.count(name)) return expanded[name]; + if (m_expandedSprites.count(name)) return m_expandedSprites[name]; auto exp = new char[strlen(name) + 2 + m_metadata.getID().size()]; auto exps = m_metadata.getID() + "/" + name; memcpy(exp, exps.c_str(), exps.size() + 1); - expanded[name] = exp; + m_expandedSprites[name] = exp; return exp; } @@ -612,8 +596,9 @@ ModJson Mod::Impl::getRuntimeInfo() const { for (auto patch : m_patches) { obj["patches"].as_array().push_back(ModJson(patch->getRuntimeInfo())); } + // TODO: so which one is it // obj["enabled"] = m_enabled; - obj["loaded"] = m_binaryLoaded; + obj["loaded"] = m_enabled; obj["temp-dir"] = this->getTempDir(); obj["save-dir"] = this->getSaveDir(); obj["config-dir"] = this->getConfigDir(false); @@ -652,7 +637,6 @@ Mod* Loader::Impl::createInternalMod() { else { mod = new Mod(infoRes.unwrap()); } - mod->m_impl->m_binaryLoaded = true; mod->m_impl->m_enabled = true; m_mods.insert({ mod->getID(), mod }); return mod; diff --git a/loader/src/loader/ModImpl.hpp b/loader/src/loader/ModImpl.hpp index 9048036d..a8bdc09f 100644 --- a/loader/src/loader/ModImpl.hpp +++ b/loader/src/loader/ModImpl.hpp @@ -26,10 +26,6 @@ namespace geode { * Whether the mod is enabled or not */ bool m_enabled = false; - /** - * Whether the mod binary is loaded or not - */ - bool m_binaryLoaded = false; /** * Mod temp directory name */ @@ -61,6 +57,12 @@ namespace geode { * Whether the mod resources are loaded or not */ bool m_resourcesLoaded = false; + /** + * Whether logging is enabled for this mod + */ + bool m_loggingEnabled = true; + + std::unordered_map m_expandedSprites; ModRequestedAction m_requestedAction = ModRequestedAction::None; @@ -84,12 +86,8 @@ namespace geode { ghc::filesystem::path getPackagePath() const; VersionInfo getVersion() const; bool isEnabled() const; - bool isLoaded() const; bool supportsDisabling() const; - bool canDisable() const; - bool canEnable() const; bool needsEarlyLoad() const; - bool wasSuccessfullyLoaded() const; ModMetadata getMetadata() const; ghc::filesystem::path getTempDir() const; ghc::filesystem::path getBinaryPath() const; diff --git a/loader/src/loader/ModInfoImpl.cpp b/loader/src/loader/ModInfoImpl.cpp index c482b7b6..f10f6f8c 100644 --- a/loader/src/loader/ModInfoImpl.cpp +++ b/loader/src/loader/ModInfoImpl.cpp @@ -15,7 +15,7 @@ ModInfo::Impl& ModInfoImpl::getImpl(ModInfo& info) { bool Dependency::isResolved() const { return !this->required || - (this->mod && this->mod->isLoaded() && this->mod->isEnabled() && + (this->mod && this->mod->isEnabled() && this->version.compare(this->mod->getVersion())); } diff --git a/loader/src/loader/ModMetadataImpl.cpp b/loader/src/loader/ModMetadataImpl.cpp index 884ace85..0265f8af 100644 --- a/loader/src/loader/ModMetadataImpl.cpp +++ b/loader/src/loader/ModMetadataImpl.cpp @@ -18,7 +18,7 @@ ModMetadata::Impl& ModMetadataImpl::getImpl(ModMetadata& info) { bool ModMetadata::Dependency::isResolved() const { return this->importance != Importance::Required || - this->mod && this->mod->isLoaded() && this->version.compare(this->mod->getVersion()); + this->mod && this->mod->isEnabled() && this->version.compare(this->mod->getVersion()); } bool ModMetadata::Incompatibility::isResolved() const { diff --git a/loader/src/loader/Setting.cpp b/loader/src/loader/Setting.cpp index ccce4622..e5dcda72 100644 --- a/loader/src/loader/Setting.cpp +++ b/loader/src/loader/Setting.cpp @@ -62,6 +62,7 @@ Result StringSetting::parse(JsonMaybeObject& obj) { StringSetting sett; parseCommon(sett, obj); obj.has("match").into(sett.match); + obj.has("filter").into(sett.filter); return Ok(sett); } diff --git a/loader/src/platform/mac/crashlog.mm b/loader/src/platform/mac/crashlog.mm index 1c7704f8..7a104e86 100644 --- a/loader/src/platform/mac/crashlog.mm +++ b/loader/src/platform/mac/crashlog.mm @@ -151,7 +151,7 @@ static Mod* modFromAddress(void const* addr) { } for (auto& mod : Loader::get()->getAllMods()) { - if (!mod->isLoaded() || !ghc::filesystem::exists(mod->getBinaryPath())) { + if (!mod->isEnabled() || !ghc::filesystem::exists(mod->getBinaryPath())) { continue; } if (ghc::filesystem::equivalent(imagePath, mod->getBinaryPath())) { diff --git a/loader/src/platform/windows/LoaderImpl.cpp b/loader/src/platform/windows/LoaderImpl.cpp index a3f632eb..df77a0a9 100644 --- a/loader/src/platform/windows/LoaderImpl.cpp +++ b/loader/src/platform/windows/LoaderImpl.cpp @@ -126,7 +126,7 @@ void Loader::Impl::setupIPC() { if (ConnectNamedPipe(pipe, nullptr)) { // log::debug("Got connection, creating thread"); std::thread pipeThread(&ipcPipeThread, pipe); - SetThreadDescription(pipeThread.native_handle(), L"Geode IPC Pipe"); + // SetThreadDescription(pipeThread.native_handle(), L"Geode IPC Pipe"); pipeThread.detach(); } else { @@ -135,7 +135,7 @@ void Loader::Impl::setupIPC() { } } }); - SetThreadDescription(ipcThread.native_handle(), L"Geode Main IPC"); + // SetThreadDescription(ipcThread.native_handle(), L"Geode Main IPC"); ipcThread.detach(); log::debug("IPC set up"); diff --git a/loader/src/ui/internal/info/DevProfilePopup.cpp b/loader/src/ui/internal/info/DevProfilePopup.cpp index f5146e84..6571b078 100644 --- a/loader/src/ui/internal/info/DevProfilePopup.cpp +++ b/loader/src/ui/internal/info/DevProfilePopup.cpp @@ -5,8 +5,9 @@ #include "../list/ModListCell.hpp" #include "../list/ModListLayer.hpp" -bool DevProfilePopup::setup(std::string const& developer) { +bool DevProfilePopup::setup(std::string const& developer, ModListLayer* list) { m_noElasticity = true; + m_layer = list; this->setTitle("Mods by " + developer); @@ -18,7 +19,7 @@ bool DevProfilePopup::setup(std::string const& developer) { for (auto& mod : Loader::get()->getAllMods()) { if (mod->getDeveloper() == developer) { auto cell = ModCell::create( - mod, nullptr, ModListDisplay::Concise, { 358.f, 40.f } + mod, m_layer, ModListDisplay::Concise, { 358.f, 40.f } ); cell->disableDeveloperButton(); items->addObject(cell); @@ -31,7 +32,7 @@ bool DevProfilePopup::setup(std::string const& developer) { continue; } auto cell = IndexItemCell::create( - item, nullptr, ModListDisplay::Concise, { 358.f, 40.f } + item, m_layer, ModListDisplay::Concise, { 358.f, 40.f } ); cell->disableDeveloperButton(); items->addObject(cell); @@ -39,18 +40,18 @@ bool DevProfilePopup::setup(std::string const& developer) { // mods list auto listSize = CCSize { 358.f, 160.f }; - auto list = ListView::create(items, 40.f, listSize.width, listSize.height); - list->setPosition(winSize / 2 - listSize / 2); - m_mainLayer->addChild(list); + auto cellList = ListView::create(items, 40.f, listSize.width, listSize.height); + cellList->setPosition(winSize / 2 - listSize / 2); + m_mainLayer->addChild(cellList); addListBorders(m_mainLayer, winSize / 2, listSize); return true; } -DevProfilePopup* DevProfilePopup::create(std::string const& developer) { +DevProfilePopup* DevProfilePopup::create(std::string const& developer, ModListLayer* list) { auto ret = new DevProfilePopup(); - if (ret && ret->init(420.f, 260.f, developer)) { + if (ret && ret->init(420.f, 260.f, developer, list)) { ret->autorelease(); return ret; } diff --git a/loader/src/ui/internal/info/DevProfilePopup.hpp b/loader/src/ui/internal/info/DevProfilePopup.hpp index af47a572..5ff3b631 100644 --- a/loader/src/ui/internal/info/DevProfilePopup.hpp +++ b/loader/src/ui/internal/info/DevProfilePopup.hpp @@ -4,10 +4,14 @@ using namespace geode::prelude; -class DevProfilePopup : public Popup { +class ModListLayer; + +class DevProfilePopup : public Popup { protected: - bool setup(std::string const& developer) override; + ModListLayer* m_layer; + + bool setup(std::string const& developer, ModListLayer* list) override; public: - static DevProfilePopup* create(std::string const& developer); + static DevProfilePopup* create(std::string const& developer, ModListLayer* list); }; diff --git a/loader/src/ui/internal/info/ModInfoPopup.cpp b/loader/src/ui/internal/info/ModInfoPopup.cpp index 1ec147d1..10c0ab37 100644 --- a/loader/src/ui/internal/info/ModInfoPopup.cpp +++ b/loader/src/ui/internal/info/ModInfoPopup.cpp @@ -4,6 +4,7 @@ #include "../list/ModListLayer.hpp" #include "../settings/ModSettingsPopup.hpp" #include +#include #include #include diff --git a/loader/src/ui/internal/list/InstallListCell.cpp b/loader/src/ui/internal/list/InstallListCell.cpp index 07daca20..352d8aaf 100644 --- a/loader/src/ui/internal/list/InstallListCell.cpp +++ b/loader/src/ui/internal/list/InstallListCell.cpp @@ -53,24 +53,21 @@ void InstallListCell::setupInfo( } this->addChild(m_titleLabel); - m_developerBtn = nullptr; + m_creatorLabel = nullptr; if (developer) { auto creatorStr = "by " + *developer; - auto creatorLabel = CCLabelBMFont::create(creatorStr.c_str(), "goldFont.fnt"); - creatorLabel->setScale(.34f); + m_creatorLabel = CCLabelBMFont::create(creatorStr.c_str(), "goldFont.fnt"); + m_creatorLabel->setScale(.34f); if (inactive) { - creatorLabel->setColor({ 163, 163, 163 }); + m_creatorLabel->setColor({ 163, 163, 163 }); } - m_developerBtn = CCMenuItemSpriteExtra::create( - creatorLabel, this, menu_selector(InstallListCell::onViewDev) - ); - m_developerBtn->setPosition( + m_creatorLabel->setPosition( m_titleLabel->getPositionX() + m_titleLabel->getScaledContentSize().width + 3.f + - creatorLabel->getScaledContentSize().width / 2, + m_creatorLabel->getScaledContentSize().width / 2, m_height / 2 ); - m_menu->addChild(m_developerBtn); + m_menu->addChild(m_creatorLabel); } this->setupVersion(version); @@ -96,7 +93,7 @@ void InstallListCell::setupVersion(std::variantsetScale(.2f); m_versionLabel->setPosition( m_titleLabel->getPositionX() + m_titleLabel->getScaledContentSize().width + 3.f + - (m_developerBtn ? m_developerBtn->getScaledContentSize().width + 3.f : 0.f), + (m_creatorLabel ? m_creatorLabel->getScaledContentSize().width + 3.f : 0.f), m_titleLabel->getPositionY() - 1.f ); m_versionLabel->setColor({ 0, 255, 0 }); @@ -123,7 +120,7 @@ void InstallListCell::setupInfo(ModMetadata const& metadata, bool inactive) { } void InstallListCell::onViewDev(CCObject*) { - DevProfilePopup::create(getDeveloper())->show(); + // DevProfilePopup::create(getDeveloper(), m_layer)->show(); } bool InstallListCell::init(InstallListPopup* list, CCSize const& size) { diff --git a/loader/src/ui/internal/list/InstallListCell.hpp b/loader/src/ui/internal/list/InstallListCell.hpp index f2fd677c..ce5927ea 100644 --- a/loader/src/ui/internal/list/InstallListCell.hpp +++ b/loader/src/ui/internal/list/InstallListCell.hpp @@ -21,7 +21,7 @@ protected: float m_height; InstallListPopup* m_layer = nullptr; CCMenu* m_menu = nullptr; - CCMenuItemSpriteExtra* m_developerBtn = nullptr; + CCLabelBMFont* m_creatorLabel = nullptr; CCLabelBMFont* m_titleLabel = nullptr; CCLabelBMFont* m_versionLabel = nullptr; TagNode* m_tagLabel = nullptr; diff --git a/loader/src/ui/internal/list/InstallListPopup.cpp b/loader/src/ui/internal/list/InstallListPopup.cpp index e561ca9b..42beb812 100644 --- a/loader/src/ui/internal/list/InstallListPopup.cpp +++ b/loader/src/ui/internal/list/InstallListPopup.cpp @@ -113,7 +113,7 @@ CCArray* InstallListPopup::createCells(std::unordered_mapisUninstalled()*/item.mod->getMetadata().getID() == "geode.loader") { + if (item.mod && /*!item.mod->isUninstalled()*/item.mod->getMetadata().getID() == "geode.loader") { bottom.push_back(ModInstallListCell::create(item.mod, this, this->getCellSize())); for (auto const& dep : item.mod->getMetadata().getDependencies()) { queue.push(dep); diff --git a/loader/src/ui/internal/list/ModListCell.cpp b/loader/src/ui/internal/list/ModListCell.cpp index 3c9c199d..f715132f 100644 --- a/loader/src/ui/internal/list/ModListCell.cpp +++ b/loader/src/ui/internal/list/ModListCell.cpp @@ -178,7 +178,7 @@ void ModListCell::setupInfo( } void ModListCell::onViewDev(CCObject*) { - DevProfilePopup::create(this->getDeveloper())->show(); + DevProfilePopup::create(this->getDeveloper(), m_layer)->show(); } bool ModListCell::init(ModListLayer* list, CCSize const& size) { @@ -227,7 +227,9 @@ void ModCell::onEnable(CCObject* sender) { else { tryOrAlert(m_mod->disable(), "Error disabling mod"); } - m_layer->reloadList(); + if (m_layer) { + m_layer->reloadList(); + } } void ModCell::onUnresolvedInfo(CCObject*) { @@ -291,7 +293,7 @@ bool ModCell::init( auto viewBtn = CCMenuItemSpriteExtra::create(viewSpr, this, menu_selector(ModCell::onInfo)); m_menu->addChild(viewBtn); - if (m_mod->wasSuccessfullyLoaded()) { + if (m_mod->isEnabled()) { auto latestIndexItem = Index::get()->getMajorItem( mod->getMetadata().getID() ); @@ -314,7 +316,7 @@ bool ModCell::init( } } - if (m_mod->wasSuccessfullyLoaded() && m_mod->getMetadata().getID() != "geode.loader") { + if (m_mod->getMetadata().getID() != "geode.loader") { m_enableToggle = CCMenuItemToggler::createWithStandardSprites(this, menu_selector(ModCell::onEnable), .7f); m_enableToggle->setPosition(-45.f, 0.f); @@ -322,8 +324,6 @@ bool ModCell::init( } } - - auto exMark = CCSprite::createWithSpriteFrameName("exMark_001.png"); exMark->setScale(.5f); diff --git a/loader/src/ui/internal/list/ModListLayer.cpp b/loader/src/ui/internal/list/ModListLayer.cpp index df4fbecc..79b16369 100644 --- a/loader/src/ui/internal/list/ModListLayer.cpp +++ b/loader/src/ui/internal/list/ModListLayer.cpp @@ -349,7 +349,7 @@ bool ModListLayer::init() { m_tabsGradientNode->ignoreAnchorPointForPosition(true); m_tabsGradientNode->setZOrder(9); m_tabsGradientNode->setInverted(false); - m_tabsGradientNode->setAlphaThreshold(0.f); + m_tabsGradientNode->setAlphaThreshold(0.7f); m_tabsGradientSprite = CCSprite::create("tab-gradient.png"_spr); m_tabsGradientNode->addChild(m_tabsGradientSprite); @@ -682,7 +682,7 @@ void ModListLayer::onTab(CCObject* pSender) { member->release(); } if (isSelected && m_tabsGradientStencil) - m_tabsGradientStencil->setPosition(member->m_onButton->convertToWorldSpace({0.f, -1.f})); + m_tabsGradientStencil->setPosition(member->m_onButton->convertToWorldSpace({0.f, 0.f})); }; toggleTab(m_downloadTabBtn); diff --git a/loader/src/ui/internal/settings/GeodeSettingNode.cpp b/loader/src/ui/internal/settings/GeodeSettingNode.cpp index 70b14542..28a37e1e 100644 --- a/loader/src/ui/internal/settings/GeodeSettingNode.cpp +++ b/loader/src/ui/internal/settings/GeodeSettingNode.cpp @@ -324,6 +324,11 @@ bool StringSettingNode::setup(StringSettingValue* setting, float width) { m_input = InputNode::create(width / 2 - 10.f, "Text", "chatFont.fnt"); m_input->setPosition({ -(width / 2 - 70.f) / 2, .0f }); m_input->setScale(.65f); + + if (setting->castDefinition().filter.has_value()) { + m_input->getInput()->setAllowedChars(setting->castDefinition().filter.value()); + } + m_input->getInput()->setDelegate(this); m_menu->addChild(m_input); diff --git a/loader/src/ui/nodes/MDTextArea.cpp b/loader/src/ui/nodes/MDTextArea.cpp index 051d5bcd..c6afcda2 100644 --- a/loader/src/ui/nodes/MDTextArea.cpp +++ b/loader/src/ui/nodes/MDTextArea.cpp @@ -209,6 +209,7 @@ struct MDParser { static float s_codeStart; static size_t s_orderedListNum; static std::vector s_codeSpans; + static bool s_breakListLine; static int parseText(MD_TEXTTYPE type, MD_CHAR const* rawText, MD_SIZE size, void* mdtextarea) { auto textarea = static_cast(mdtextarea); @@ -364,6 +365,10 @@ struct MDParser { renderer->pushIndent(g_indent); s_isOrderedList = type == MD_BLOCKTYPE::MD_BLOCK_OL; s_orderedListNum = 0; + if (s_breakListLine) { + renderer->breakLine(); + s_breakListLine = false; + } } break; @@ -377,6 +382,10 @@ struct MDParser { case MD_BLOCKTYPE::MD_BLOCK_LI: { + if (s_breakListLine) { + renderer->breakLine(); + s_breakListLine = false; + } renderer->pushOpacity(renderer->getCurrentOpacity() / 2); auto lidetail = static_cast(detail); if (s_isOrderedList) { @@ -387,6 +396,7 @@ struct MDParser { renderer->renderString("• "); } renderer->popOpacity(); + s_breakListLine = true; } break; @@ -446,7 +456,13 @@ struct MDParser { case MD_BLOCKTYPE::MD_BLOCK_UL: { renderer->popIndent(); - renderer->breakLine(); + if (s_breakListLine) { + renderer->breakLine(); + s_breakListLine = false; + } + if (renderer->getCurrentIndent() == 0) { + renderer->breakLine(); + } } break; @@ -489,7 +505,6 @@ struct MDParser { case MD_BLOCKTYPE::MD_BLOCK_LI: { - renderer->breakLine(); } break; @@ -626,6 +641,7 @@ size_t MDParser::s_orderedListNum = 0; bool MDParser::s_isCodeBlock = false; float MDParser::s_codeStart = 0; decltype(MDParser::s_codeSpans) MDParser::s_codeSpans = {}; +bool MDParser::s_breakListLine = false; void MDTextArea::updateLabel() { m_renderer->begin(m_content, CCPointZero, m_size); diff --git a/loader/src/ui/nodes/Notification.cpp b/loader/src/ui/nodes/Notification.cpp index f9bad08b..449ddde2 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 0ec112d7..ee7a4247 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; } diff --git a/loader/src/ui/nodes/TextRenderer.cpp b/loader/src/ui/nodes/TextRenderer.cpp index fe2c712d..ca7396b3 100644 --- a/loader/src/ui/nodes/TextRenderer.cpp +++ b/loader/src/ui/nodes/TextRenderer.cpp @@ -341,8 +341,8 @@ std::vector TextRenderer::renderStringEx( auto lastIndent = m_indentationStack.size() > 1 ? m_indentationStack.at(m_indentationStack.size() - 1) : .0f; - if (m_cursor.x == m_origin.x + lastIndent && this->getCurrentIndent() > .0f) { - m_cursor.x += this->getCurrentIndent(); + if (m_cursor.x < m_origin.x + this->getCurrentIndent()) { + m_cursor.x = this->getCurrentIndent(); } auto createLabel = [&]() -> bool { @@ -487,7 +487,7 @@ void TextRenderer::breakLine(float incY) { } if (h > y) y = h; m_cursor.y -= y; - m_cursor.x = m_origin.x + getCurrentIndent(); + m_cursor.x = m_origin.x; } float TextRenderer::adjustLineAlignment() { diff --git a/loader/src/utils/file.cpp b/loader/src/utils/file.cpp index 8df76c0d..1f8a7ad6 100644 --- a/loader/src/utils/file.cpp +++ b/loader/src/utils/file.cpp @@ -21,48 +21,51 @@ using namespace geode::prelude; using namespace geode::utils::file; Result utils::file::readString(ghc::filesystem::path const& path) { + if (!ghc::filesystem::exists(path)) + return Err("File does not exist"); + #if _WIN32 std::ifstream in(path.wstring(), std::ios::in | std::ios::binary); #else std::ifstream in(path.string(), std::ios::in | std::ios::binary); #endif - if (in) { - std::string contents; - in.seekg(0, std::ios::end); - contents.resize((const size_t)in.tellg()); - in.seekg(0, std::ios::beg); - in.read(&contents[0], contents.size()); - in.close(); - return Ok(contents); - } - return Err("Unable to open file"); + if (!in) + return Err("Unable to open file"); + + std::string contents; + in.seekg(0, std::ios::end); + contents.resize((const size_t)in.tellg()); + in.seekg(0, std::ios::beg); + in.read(&contents[0], contents.size()); + in.close(); + return Ok(contents); } Result utils::file::readJson(ghc::filesystem::path const& path) { - auto str = utils::file::readString(path); - - if (str) { - try { - return Ok(json::parse(str.value())); - } catch(std::exception const& e) { - return Err("Unable to parse JSON: " + std::string(e.what())); - } - } else { - return Err("Unable to open file"); + if (!str) + return Err(str.unwrapErr()); + try { + return Ok(json::parse(str.value())); + } + catch(std::exception const& e) { + return Err("Unable to parse JSON: " + std::string(e.what())); } } Result utils::file::readBinary(ghc::filesystem::path const& path) { + if (!ghc::filesystem::exists(path)) + return Err("File does not exist"); + #if _WIN32 std::ifstream in(path.wstring(), std::ios::in | std::ios::binary); #else std::ifstream in(path.string(), std::ios::in | std::ios::binary); #endif - if (in) { - return Ok(ByteVector(std::istreambuf_iterator(in), {})); - } - return Err("Unable to open file"); + if (!in) + return Err("Unable to open file"); + + return Ok(ByteVector(std::istreambuf_iterator(in), {})); } Result<> utils::file::writeString(ghc::filesystem::path const& path, std::string const& data) { @@ -72,14 +75,14 @@ Result<> utils::file::writeString(ghc::filesystem::path const& path, std::string #else file.open(path.string()); #endif - if (file.is_open()) { - file << data; + if (!file.is_open()) { file.close(); - - return Ok(); + return Err("Unable to open file"); } + + file << data; file.close(); - return Err("Unable to open file"); + return Ok(); } Result<> utils::file::writeBinary(ghc::filesystem::path const& path, ByteVector const& data) { @@ -89,14 +92,14 @@ Result<> utils::file::writeBinary(ghc::filesystem::path const& path, ByteVector #else file.open(path.string(), std::ios::out | std::ios::binary); #endif - if (file.is_open()) { - file.write(reinterpret_cast(data.data()), data.size()); + if (!file.is_open()) { file.close(); - - return Ok(); + return Err("Unable to open file"); } + + file.write(reinterpret_cast(data.data()), data.size()); file.close(); - return Err("Unable to open file"); + return Ok(); } Result<> utils::file::createDirectory(ghc::filesystem::path const& path) { diff --git a/loader/src/utils/web.cpp b/loader/src/utils/web.cpp index 9bc7cd99..8dccd048 100644 --- a/loader/src/utils/web.cpp +++ b/loader/src/utils/web.cpp @@ -79,6 +79,7 @@ Result web::fetchBytes(std::string const& url) { curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ret); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, utils::fetch::writeBytes); auto res = curl_easy_perform(curl); if (res != CURLE_OK) { @@ -118,6 +119,7 @@ Result web::fetch(std::string const& url) { curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ret); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, utils::fetch::writeString); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); auto res = curl_easy_perform(curl); if (res != CURLE_OK) { curl_easy_cleanup(curl);