Skip to content

Commit a4844db

Browse files
committed
feat(android): Manually call CacheManager::save since it never gets destructed
1 parent 4463582 commit a4844db

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

.github/ISSUE_TEMPLATE/report-bug.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ body:
2121
label: Version
2222
description: What version of GD-Roulette are you running?
2323
options:
24+
- 4.0.1
2425
- 4.0.0
2526
- 3.1.0
2627
- 3.0.1

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/.vs
22
/.vscode
33
/build
4-
/build-msvc
5-
/build-ninja
6-
/build-clang
4+
/build-*
75

86
# clangd stuff
97
/.cache

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Fixed
1111

1212
- Android crash
13+
- Android not saving cache.json
1314
- Roulette would only show the same levels from page 1
1415
- Weird blink transition when exiting Roulette layer
1516

src/main.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#ifdef GEODE_IS_ANDROID
2+
#include <Geode/modify/AppDelegate.hpp>
3+
#endif
4+
15
#include "managers/CacheManager.hpp"
26
#include "listfetcher/ListFetcher.hpp"
37

@@ -7,3 +11,20 @@
711
ListFetcher::normalListCacheFunction
812
);
913
}
14+
15+
#ifdef GEODE_IS_ANDROID
16+
class $modify(RLAppDelegate, AppDelegate)
17+
{
18+
void applicationDidEnterBackground()
19+
{
20+
CacheManager::get().save();
21+
AppDelegate::applicationDidEnterBackground();
22+
}
23+
24+
void trySaveGame(bool p0)
25+
{
26+
CacheManager::get().save();
27+
AppDelegate::trySaveGame(p0);
28+
}
29+
};
30+
#endif

0 commit comments

Comments
 (0)