From b3d54747bfd7684b15c1e0c3bec1174e1776e089 Mon Sep 17 00:00:00 2001 From: SMJS <38814077+SMJSGaming@users.noreply.github.com> Date: Fri, 13 Sep 2024 20:47:08 +0200 Subject: [PATCH] Fixed the touch priority of the settings buttons (#1079) * Fixed the touch priority of the settings buttons * Added a touch priority overwrite for the apply button --- loader/src/ui/mods/settings/ModSettingsPopup.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/loader/src/ui/mods/settings/ModSettingsPopup.cpp b/loader/src/ui/mods/settings/ModSettingsPopup.cpp index ff2d9bda..f10aa85f 100644 --- a/loader/src/ui/mods/settings/ModSettingsPopup.cpp +++ b/loader/src/ui/mods/settings/ModSettingsPopup.cpp @@ -83,11 +83,6 @@ bool ModSettingsPopup::setup(Mod* mod) { else { node = UnresolvedCustomSettingNodeV3::create(key, mod, layerSize.width); } - - // auto separator = CCLayerColor::create({ 0, 0, 0, 50 }, layerSize.width, 1.f); - // separator->setOpacity(bg ? 100 : 50); - // separator->ignoreAnchorPointForPosition(false); - // bg->addChildAtPosition(separator, Anchor::Bottom, ccp(0, 0), ccp(.5f, .5f)); m_settings.push_back(node); m_list->m_contentLayer->addChild(node); @@ -102,6 +97,11 @@ bool ModSettingsPopup::setup(Mod* mod) { ); m_list->moveToTop(); + const int buttonPriority = m_list->getTouchPriority() - 1; + + m_buttonMenu->setTouchPriority(buttonPriority); + searchContainer->setTouchPriority(buttonPriority); + layerBG->addChildAtPosition(m_list, Anchor::BottomLeft); // layer borders @@ -119,6 +119,7 @@ bool ModSettingsPopup::setup(Mod* mod) { m_applyMenu->setContentWidth(150); m_applyMenu->setLayout(RowLayout::create()); m_applyMenu->getLayout()->ignoreInvisibleChildren(true); + m_applyMenu->setTouchPriority(buttonPriority); auto restartBtnSpr = createGeodeButton("Restart Now", true); restartBtnSpr->setScale(.6f);