im crying with more prio

This commit is contained in:
altalk23 2024-01-24 00:34:30 +03:00
parent bedd6d3f59
commit 9b8a1a470f

View file

@ -8,10 +8,18 @@ struct ForcePrioRevert : Modify<ForcePrioRevert, CCTouchDispatcher> {
void addTargetedDelegate(CCTouchDelegate* delegate, int priority, bool swallowsTouches) {
m_targetPrio = 0xb00b5; // fuck you windows i hate you for inlining isUsingForcePrio
if (auto handler = this->findHandler(delegate)) {
log::debug("already have handler with prio {}", handler->m_nPriority);
}
m_forcePrio = -1;
if (m_pHandlersToAdd->count() > 0) {
auto handler = static_cast<CCTouchHandler*>(m_pHandlersToAdd->objectAtIndex(0));
m_forcePrio = std::min(m_forcePrio, handler->getPriority() - 1);
}
if (m_pTargetedHandlers->count() > 0) {
auto handler = static_cast<CCTouchHandler*>(m_pTargetedHandlers->objectAtIndex(0));
m_forcePrio = handler->getPriority() - 1;
m_forcePrio = std::min(m_forcePrio, handler->getPriority() - 1);
}
// bugfix for editor: since EditorUI doesn't call registerWithTouchDispatcher