Skip to content

Commit 1753284

Browse files
committed
fix threading in amazon check
1 parent 327c986 commit 1753284

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

src/main.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,13 @@ class BI_DLL $modify(MenuLayer) {
7474
fixLevelLists();
7575
}
7676

77-
/*Notification::create("important notification")->show();
78-
BetterInfo::showUnimportantNotification("unimportant 1", NotificationIcon::Success);
79-
BetterInfo::showUnimportantNotification("unimportant 2", NotificationIcon::Success);
80-
BetterInfo::showUnimportantNotification("unimportant 3", NotificationIcon::Success);
81-
BetterInfo::showUnimportantNotification("unimportant 4", NotificationIcon::Success);
82-
BetterInfo::showUnimportantNotification("unimportant 5", NotificationIcon::Success);
83-
BetterInfo::showUnimportantNotification("unimportant 6", NotificationIcon::Success);
84-
Notification::create("important notification 2")->show();*/
85-
8677
return true;
8778
}
8879
};
8980

90-
$execute {
91-
Loader::get()->queueInMainThread([] {
92-
loadManagers();
93-
});
81+
$on_mod(Loaded) {
82+
#ifdef GEODE_IS_ANDROID
83+
BetterInfo::setAmazon((GJMoreGamesLayer* volatile)nullptr)->getMoreGamesList()->count() == 0);
84+
#endif
85+
loadManagers();
9486
}

src/utils.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,11 @@ void BetterInfo::refreshAlertPrio(CCNode* node) {
11101110
}
11111111
}
11121112

1113+
static bool s_isAmazon = false;
11131114
bool BetterInfo::isAmazon() {
1114-
return GEODE_ANDROID(!((GJMoreGamesLayer* volatile)nullptr)->getMoreGamesList()->count() ||) false;
1115+
return s_isAmazon;
1116+
}
1117+
1118+
void BetterInfo::setAmazon(bool value) {
1119+
s_isAmazon = value;
11151120
}

src/utils.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,5 @@ namespace BetterInfo {
112112

113113
BI_DLL void refreshAlertPrio(CCNode* node);
114114
BI_DLL bool isAmazon();
115+
BI_DLL void setAmazon(bool value);
115116
}

0 commit comments

Comments
 (0)