Skip to content

Commit

Permalink
fix: android controller support disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Sep 10, 2024
1 parent 45dd036 commit dc5f6fc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,18 @@ class ControllerChecker : public CCObject {

public:
void checkController(float) {
if (m_cached != PlatformToolbox::isControllerConnected()) {
m_cached = PlatformToolbox::isControllerConnected();
//TODO: remove the android thingy once/if zmx figures out how to get the controller state through the launcher
bool controllerConnected = GEODE_ANDROID(true || ) PlatformToolbox::isControllerConnected();
if (m_cached != controllerConnected) {
m_cached = controllerConnected;
if (m_cached) {
BindManager::get()->attachDevice("controller"_spr, &ControllerBind::parse);
#ifndef GEODE_IS_ANDROID
Notification::create(
"Controller Attached",
CCSprite::createWithSpriteFrameName("controllerBtn_A_001.png")
)->show();
#endif
}
else {
BindManager::get()->detachDevice("controller"_spr);
Expand Down

0 comments on commit dc5f6fc

Please sign in to comment.