Skip to content

Commit 89d6c85

Browse files
authored
Fix fallback texture on controller notification (#99)
1 parent a9e9dd8 commit 89d6c85

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "4.4.0",
2+
"geode": "4.5.0",
33
"gd": {
44
"win": "2.2074",
55
"android": "2.2074",

src/main.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <Geode/binding/ButtonSprite.hpp>
66
#include <Geode/ui/Notification.hpp>
77
#include <Geode/modify/Modify.hpp>
8+
#include <Geode/loader/GameEvent.hpp>
89
#include <Geode/loader/Setting.hpp>
910
#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDelegate.h>
1011
#include <Geode/cocos/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h>
@@ -268,14 +269,16 @@ class ControllerChecker : public CCObject {
268269
};
269270

270271
$execute {
271-
// check every second if a controller has been connected
272-
Loader::get()->queueInMainThread([] {
272+
new EventListener([](auto) {
273+
// check every second if a controller has been connected
273274
CCScheduler::get()->scheduleSelector(
274275
schedule_selector(ControllerChecker::checkController),
275276
new ControllerChecker(), 1.f, false
276277
);
277-
});
278-
}
278+
279+
return ListenerResult::Propagate;
280+
}, GameEventFilter(GameEventType::Loaded));
281+
};
279282

280283
// Have to make a SettingValue even if it holds no value
281284
class DummySetting : public SettingBaseValue<int> {

0 commit comments

Comments
 (0)