Skip to content

Commit 98fe3f6

Browse files
committed
Merge remote-tracking branch 'origin' into signals
2 parents 05b368f + e7eed58 commit 98fe3f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+985
-240
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ body:
2222
- "Windows"
2323
- "Android64"
2424
- "Android32"
25+
- "iOS"
2526
validations:
2627
required: true
2728
- type: input

.github/ISSUE_TEMPLATE/crash-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ body:
2222
- "Windows"
2323
- "Android64"
2424
- "Android32"
25+
- "iOS"
2526
validations:
2627
required: true
2728
- type: input

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Geode Changelog
22

3+
## v4.8.0
4+
* Fix `geode::Notification` z ordering (127733e)
5+
* Add `CCNode::getChildrenExt` (d198df5)
6+
* Add `CCNode::getChildByIndex` (0ba1f2a)
7+
* Fix `GEODE_MOD_STATIC_PATCH` not using the geode namespace (#1456)
8+
* Fix Linux install script flatpak directory (2cf1e57)
9+
* Document return paths for `dirs` functions (d821172)
10+
* Add `VMTHookManager` for hooking virtual functions that have not been defined by virtual table patching (383f8fd)
11+
* Fix Unicode logging on Windows (c5e93b9)
12+
* Remove all `std::filesystem::path::string` calls as they can crash on Unicode paths (#1473)
13+
* Replace all `A` WinApi calls with `W` calls (#1473)
14+
* Hook and patch toggling (#1468)
15+
* Added option to force cURL to use IPv4 (#1412)
16+
17+
## v4.7.0
18+
* Change from copying queue to moving queue for main thread (9b8fb73)
19+
* Add reading from unzipped/launch-args.txt on iOS as an option (ae90fc9)
20+
* Add new "binary-dir" launcher flag for changing the path of mod binaries (0b71c3c)
21+
* Use ColorProvider for SwelvyBG colors (01ee436)
22+
* Deprecate the usage of geode::cast::as (9d28ab9)
23+
* Return success for patching if there is nothing to do (f92e5b6)
24+
* Updated TulipHook to 3.1.4 (f469696)
25+
* Fixes struct params and enabling after disabled.
26+
327
## v4.6.3
428
* Fix Windows crashlogs not appearing (for real this time) (dedf1eb)
529

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ if (DEFINED GEODE_TULIPHOOK_REPO_PATH)
283283
message(STATUS "Using ${GEODE_TULIPHOOK_REPO_PATH} for TulipHook")
284284
add_subdirectory(${GEODE_TULIPHOOK_REPO_PATH} ${GEODE_TULIPHOOK_REPO_PATH}/build)
285285
else()
286-
CPMAddPackage("gh:geode-sdk/TulipHook@3.1.3")
286+
CPMAddPackage("gh:geode-sdk/TulipHook@3.1.4")
287287
endif()
288288
set(CMAKE_WARN_DEPRECATED ON CACHE BOOL "" FORCE)
289289

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.6.3
1+
4.8.0

installer/linux/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ find_gd_installation() {
7171
verbose_log "Searching for Geometry Dash..."
7272
local DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
7373

74-
for GD_IDX in "$DATA_HOME/Steam" "$HOME/Steam" "$HOME/.var/com.valvesoftware.Steam/data/Steam"; do
74+
for GD_IDX in "$DATA_HOME/Steam" "$HOME/Steam" "$HOME/.var/app/com.valvesoftware.Steam/data/Steam"; do
7575
local PATH_TEST="$GD_IDX/steamapps/common/Geometry Dash"
7676
verbose_log "- Testing path ${YELLOW}$PATH_TEST${NC}"
7777

loader/include/Geode/cocos/base_nodes/CCNode.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ namespace geode {
4444
class Layout;
4545
class LayoutOptions;
4646
enum class Anchor;
47+
48+
template <typename T, typename>
49+
struct CCArrayExtCheck {
50+
using type = void;
51+
};
4752
}
4853

4954
NS_CC_BEGIN
@@ -635,6 +640,21 @@ class CC_DLL CCNode : public CCObject
635640
*/
636641
virtual CCArray* getChildren();
637642

643+
/*
644+
* Like `getChildren()`, but returns a `CCArrayExt<CCNode>` instead.
645+
* You must include `<Geode/utils/cocos.hpp>` to use this, otherwise it won't compile
646+
*/
647+
template <typename T = CCNode, typename PleaseDontChangeMe = void>
648+
inline auto getChildrenExt() {
649+
// CCArrayExt is defined in geode/utils/cocos.hpp, which we cannot include due to circular includes.
650+
// This is an incredibly hacky way to still be able to use the type
651+
652+
using CCArrayExt = geode::CCArrayExtCheck<T, PleaseDontChangeMe>::type;
653+
static_assert(!std::is_void_v<CCArrayExt>, "Please include <Geode/utils/cocos.hpp> to use getChildrenExt()");
654+
655+
return CCArrayExt(getChildren());
656+
}
657+
638658
/**
639659
* Get the amount of children.
640660
*
@@ -1126,6 +1146,23 @@ class CC_DLL CCNode : public CCObject
11261146

11271147
GEODE_DLL void reactToChanges(std::function<void()> onChanges);
11281148

1149+
/**
1150+
* Get child at index. Checks bounds. A negative
1151+
* index will get the child starting from the end
1152+
* @returns Child at index cast to the given type,
1153+
* or nullptr if index exceeds bounds
1154+
*/
1155+
template <class InpT = cocos2d::CCNode*, class T = std::remove_pointer_t<InpT>>
1156+
T* getChildByIndex(int i) {
1157+
// start from end for negative index
1158+
if (i < 0) i = this->getChildrenCount() + i;
1159+
// check if backwards index is out of bounds
1160+
if (i < 0) return nullptr;
1161+
// check if forwards index is out of bounds
1162+
if (static_cast<int>(this->getChildrenCount()) <= i) return nullptr;
1163+
return static_cast<T*>(this->getChildren()->objectAtIndex(i));
1164+
}
1165+
11291166
/**
11301167
* Get nth child that is a given type. Checks bounds.
11311168
* @returns Child at index cast to the given type,

loader/include/Geode/cocos/support/data_support/ccCArray.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ void ccArrayFullRemoveArray(ccArray *arr, ccArray *minusArr);
138138

139139
typedef struct _ccCArray {
140140
unsigned int num, max;
141+
unsigned int unk1, unk2;
141142
void** arr;
142143
} ccCArray;
143144

loader/include/Geode/loader/Dirs.hpp

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,72 +6,99 @@
66
namespace geode::dirs {
77
/**
88
* Directory where Geometry Dash is
9+
*
10+
* Windows: {GD installation folder}/ (traditionally Geometry Dash)
11+
* macOS: {GD installation folder}/ (traditionally GeometryDash.app)
12+
* Android: {Android Launcher's media directory}/game
13+
* iOS: Documents/game (within the launcher's sandbox)
914
*/
1015
GEODE_DLL std::filesystem::path getGameDir();
1116
/**
1217
* Directory where GD saves its files
18+
*
19+
* Windows: %LOCALAPPDATA%/{executable name}
20+
* macOS: ~/Library/Application Support/GeometryDash
21+
* Android: {Android Launcher's media directory}/save
22+
* iOS: Documents/save (within the launcher's sandbox)
1323
*/
1424
GEODE_DLL std::filesystem::path getSaveDir();
1525
/**
1626
* Directory where Geode is
27+
* `getGameDir()`/geode
1728
*/
1829
GEODE_DLL std::filesystem::path getGeodeDir();
1930
/**
2031
* Directory where Geode saves its files
32+
* `getSaveDir()`/geode
2133
*/
2234
GEODE_DLL std::filesystem::path getGeodeSaveDir();
2335
/**
2436
* Directory where Geode's resources are stored
37+
* `getGeodeDir()`/resources
2538
*/
2639
GEODE_DLL std::filesystem::path getGeodeResourcesDir();
2740
/**
28-
* Directory where Geode's resources are stored
41+
* Directory where Geode's logs are stored
42+
* `getGeodeDir()`/logs
2943
*/
3044
GEODE_DLL std::filesystem::path getGeodeLogDir();
3145
/**
3246
* Directory to store temporary files
47+
* `getGeodeDir()`/temp
3348
*/
3449
GEODE_DLL std::filesystem::path getTempDir();
3550
/**
3651
* Directory where mods are stored by default
52+
* `getGeodeDir()`/mods
3753
*/
3854
GEODE_DLL std::filesystem::path getModsDir();
3955
/**
4056
* Directory where mods' save data is stored
57+
* `getGeodeSaveDir()`/mods
4158
*/
4259
GEODE_DLL std::filesystem::path getModsSaveDir();
4360
/**
4461
* Directory where mods' unzipped packages are stored at runtime
62+
*
63+
* Windows/macOS/iOS: `getGeodeDir()`/unzipped
64+
* Android: {Android Launcher's internal files directory}/geode/unzipped
4565
*/
4666
GEODE_DLL std::filesystem::path getModRuntimeDir();
4767
/**
4868
* Directory where mods' unzipped binary files are stored
4969
* This is used in order to override existing unzip binaries,
5070
* such as on iOS where signing the binary is required
5171
*
52-
* TODO: enable on 4.7.0
72+
* TODO: enable on ~~4.7.0~~ nice job
5373
*/
5474
// GEODE_DLL std::filesystem::path getModBinariesDir();
5575
/**
5676
* Directory where mods' config files lie
77+
* `getGeodeDir()`/config
5778
*/
5879
GEODE_DLL std::filesystem::path getModConfigDir();
5980
/**
6081
* Directory where Geode stores the cached index
82+
* `getGeodeDir()`/index
6183
*/
6284
GEODE_DLL std::filesystem::path getIndexDir();
6385
/**
6486
* Directory where crashlogs are stored
87+
* `getGeodeDir()`/crashlogs
6588
*/
6689
GEODE_DLL std::filesystem::path getCrashlogsDir();
6790
/**
6891
* Directory where mods' persistent files lie
6992
* This directory is not deleted even when Geode is uninstalled
93+
* `getSaveDir()`/geode-persistent
7094
*/
7195
GEODE_DLL std::filesystem::path getModPersistentDir();
7296
/**
7397
* Directory where Geometry Dash's resources are stored
74-
* On Android, the resources are stored in the APK, so this just returns "assets"
98+
*
99+
* Windows/macOS: `getGameDir()`/Resources
100+
* Android: assets
101+
* iOS: {GD bundle path}/Resources
75102
*/
76103
GEODE_DLL std::filesystem::path getResourcesDir();
77104
}

loader/include/Geode/loader/Hook.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ namespace geode {
8888

8989
Result<> disable();
9090

91+
Result<> toggle();
92+
Result<> toggle(bool enable);
93+
9194
/**
9295
* Get whether the hook should be auto enabled or not.
9396
* @returns Auto enable
@@ -176,6 +179,9 @@ namespace geode {
176179

177180
Result<> disable();
178181

182+
Result<> toggle();
183+
Result<> toggle(bool enable);
184+
179185
/**
180186
* Get whether the patch should be auto enabled or not.
181187
* @returns Auto enable

0 commit comments

Comments
 (0)