replace uses of touch priority and registerWithTouchDispatcher

This commit is contained in:
HJfod 2023-07-29 20:56:55 +03:00
parent e00b3a6a7f
commit f78969ca83
7 changed files with 7 additions and 14 deletions

View file

@ -33,8 +33,7 @@ namespace geode {
m_buttonMenu->setZOrder(100); m_buttonMenu->setZOrder(100);
m_mainLayer->addChild(m_buttonMenu); m_mainLayer->addChild(m_buttonMenu);
cocos2d::CCDirector::sharedDirector()->getTouchDispatcher()->incrementForcePrio(2); this->setTouchEnabled(true);
this->registerWithTouchDispatcher();
auto closeSpr = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png"); auto closeSpr = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
closeSpr->setScale(.8f); closeSpr->setScale(.8f);

View file

@ -51,8 +51,7 @@ namespace geode {
this->updateLabel(); this->updateLabel();
cocos2d::CCDirector::sharedDirector()->getTouchDispatcher()->incrementForcePrio(2); this->setTouchEnabled(true);
this->registerWithTouchDispatcher();
return true; return true;
} }

View file

@ -91,8 +91,7 @@ bool ModInfoPopup::init(ModInfo const& info, ModListLayer* list) {
versionLabel->setColor({0, 255, 0}); versionLabel->setColor({0, 255, 0});
m_mainLayer->addChild(versionLabel); m_mainLayer->addChild(versionLabel);
CCDirector::sharedDirector()->getTouchDispatcher()->incrementForcePrio(2); this->setTouchEnabled(true);
this->registerWithTouchDispatcher();
m_detailsArea = MDTextArea::create( m_detailsArea = MDTextArea::create(
(info.details() ? info.details().value() : "### No description provided."), (info.details() ? info.details().value() : "### No description provided."),

View file

@ -107,8 +107,7 @@ protected:
); );
m_menu->addChild(m_resetBtn); m_menu->addChild(m_resetBtn);
CCDirector::sharedDirector()->getTouchDispatcher()->incrementForcePrio(2); m_menu->setTouchEnabled(true);
m_menu->registerWithTouchDispatcher();
if (!this->setup(setting, width)) return false; if (!this->setup(setting, width)) return false;

View file

@ -25,9 +25,7 @@ bool ModSettingsPopup::setup(Mod* mod) {
auto layer = ScrollLayer::create(layerSize); auto layer = ScrollLayer::create(layerSize);
layer->setPosition(winSize / 2 - layerSize / 2); layer->setPosition(winSize / 2 - layerSize / 2);
layer->setTouchEnabled(true);
CCDirector::sharedDirector()->getTouchDispatcher()->incrementForcePrio(2);
layer->registerWithTouchDispatcher();
float totalHeight = .0f; float totalHeight = .0f;
std::vector<CCNode*> rendered; std::vector<CCNode*> rendered;

View file

@ -128,8 +128,7 @@ bool MDTextArea::init(std::string const& str, CCSize const& size) {
m_content->setZOrder(2); m_content->setZOrder(2);
m_scrollLayer->m_contentLayer->addChild(m_content); m_scrollLayer->m_contentLayer->addChild(m_content);
CCDirector::sharedDirector()->getTouchDispatcher()->incrementForcePrio(2); m_scrollLayer->setTouchEnabled(true);
m_scrollLayer->registerWithTouchDispatcher();
this->addChild(m_scrollLayer); this->addChild(m_scrollLayer);

View file

@ -177,7 +177,7 @@ bool Scrollbar::init(CCScrollLayerExt* target) {
this->addChild(m_track); this->addChild(m_track);
this->addChild(m_thumb); this->addChild(m_thumb);
this->registerWithTouchDispatcher(); this->setTouchEnabled(true);
return true; return true;
} }