2022-09-18 17:07:08 -04:00
|
|
|
USE_GEODE_NAMESPACE();
|
|
|
|
|
2022-10-13 07:00:41 -04:00
|
|
|
#include <Geode/modify/CCTouchDispatcher.hpp>
|
2022-11-09 13:03:53 -05:00
|
|
|
|
|
|
|
struct ForcePrioRevert : Modify<ForcePrioRevert, CCTouchDispatcher> {
|
|
|
|
void addTargetedDelegate(CCTouchDelegate* delegate, int priority, bool swallowsTouches) {
|
2022-09-18 17:07:08 -04:00
|
|
|
m_bForcePrio = false;
|
|
|
|
if (m_pTargetedHandlers->count() > 0) {
|
|
|
|
auto handler = static_cast<CCTouchHandler*>(m_pTargetedHandlers->objectAtIndex(0));
|
|
|
|
priority = handler->getPriority() - 2;
|
|
|
|
}
|
2022-11-09 13:03:53 -05:00
|
|
|
|
2022-09-18 17:07:08 -04:00
|
|
|
CCTouchDispatcher::addTargetedDelegate(delegate, priority, swallowsTouches);
|
|
|
|
}
|
|
|
|
|
|
|
|
void incrementForcePrio(int num) {
|
|
|
|
m_bForcePrio = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void decrementForcePrio(int num) {
|
|
|
|
m_bForcePrio = false;
|
|
|
|
}
|
|
|
|
};
|