diff --git a/loader/include/Geode/ui/Popup.hpp b/loader/include/Geode/ui/Popup.hpp index 3f0b7c4d..b0e4544a 100644 --- a/loader/include/Geode/ui/Popup.hpp +++ b/loader/include/Geode/ui/Popup.hpp @@ -33,8 +33,7 @@ namespace geode { m_buttonMenu->setZOrder(100); m_mainLayer->addChild(m_buttonMenu); - cocos2d::CCDirector::sharedDirector()->getTouchDispatcher()->incrementForcePrio(2); - this->registerWithTouchDispatcher(); + this->setTouchEnabled(true); auto closeSpr = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png"); closeSpr->setScale(.8f); diff --git a/loader/include/Geode/ui/SelectList.hpp b/loader/include/Geode/ui/SelectList.hpp index ffb56dc0..3815151f 100644 --- a/loader/include/Geode/ui/SelectList.hpp +++ b/loader/include/Geode/ui/SelectList.hpp @@ -51,8 +51,7 @@ namespace geode { this->updateLabel(); - cocos2d::CCDirector::sharedDirector()->getTouchDispatcher()->incrementForcePrio(2); - this->registerWithTouchDispatcher(); + this->setTouchEnabled(true); return true; } diff --git a/loader/src/ui/internal/info/ModInfoPopup.cpp b/loader/src/ui/internal/info/ModInfoPopup.cpp index 7cd71d3d..22374958 100644 --- a/loader/src/ui/internal/info/ModInfoPopup.cpp +++ b/loader/src/ui/internal/info/ModInfoPopup.cpp @@ -91,8 +91,7 @@ bool ModInfoPopup::init(ModInfo const& info, ModListLayer* list) { versionLabel->setColor({0, 255, 0}); m_mainLayer->addChild(versionLabel); - CCDirector::sharedDirector()->getTouchDispatcher()->incrementForcePrio(2); - this->registerWithTouchDispatcher(); + this->setTouchEnabled(true); m_detailsArea = MDTextArea::create( (info.details() ? info.details().value() : "### No description provided."), diff --git a/loader/src/ui/internal/settings/GeodeSettingNode.hpp b/loader/src/ui/internal/settings/GeodeSettingNode.hpp index 074b1ee6..c32a6066 100644 --- a/loader/src/ui/internal/settings/GeodeSettingNode.hpp +++ b/loader/src/ui/internal/settings/GeodeSettingNode.hpp @@ -107,8 +107,7 @@ protected: ); m_menu->addChild(m_resetBtn); - CCDirector::sharedDirector()->getTouchDispatcher()->incrementForcePrio(2); - m_menu->registerWithTouchDispatcher(); + m_menu->setTouchEnabled(true); if (!this->setup(setting, width)) return false; diff --git a/loader/src/ui/internal/settings/ModSettingsPopup.cpp b/loader/src/ui/internal/settings/ModSettingsPopup.cpp index f3852c44..60f4b6f6 100644 --- a/loader/src/ui/internal/settings/ModSettingsPopup.cpp +++ b/loader/src/ui/internal/settings/ModSettingsPopup.cpp @@ -25,9 +25,7 @@ bool ModSettingsPopup::setup(Mod* mod) { auto layer = ScrollLayer::create(layerSize); layer->setPosition(winSize / 2 - layerSize / 2); - - CCDirector::sharedDirector()->getTouchDispatcher()->incrementForcePrio(2); - layer->registerWithTouchDispatcher(); + layer->setTouchEnabled(true); float totalHeight = .0f; std::vector rendered; diff --git a/loader/src/ui/nodes/MDTextArea.cpp b/loader/src/ui/nodes/MDTextArea.cpp index 48cf9025..051d5bcd 100644 --- a/loader/src/ui/nodes/MDTextArea.cpp +++ b/loader/src/ui/nodes/MDTextArea.cpp @@ -128,8 +128,7 @@ bool MDTextArea::init(std::string const& str, CCSize const& size) { m_content->setZOrder(2); m_scrollLayer->m_contentLayer->addChild(m_content); - CCDirector::sharedDirector()->getTouchDispatcher()->incrementForcePrio(2); - m_scrollLayer->registerWithTouchDispatcher(); + m_scrollLayer->setTouchEnabled(true); this->addChild(m_scrollLayer); diff --git a/loader/src/ui/nodes/Scrollbar.cpp b/loader/src/ui/nodes/Scrollbar.cpp index 406fe80c..2edf8f57 100644 --- a/loader/src/ui/nodes/Scrollbar.cpp +++ b/loader/src/ui/nodes/Scrollbar.cpp @@ -177,7 +177,7 @@ bool Scrollbar::init(CCScrollLayerExt* target) { this->addChild(m_track); this->addChild(m_thumb); - this->registerWithTouchDispatcher(); + this->setTouchEnabled(true); return true; }