//
// GJEffectManager::playerButton from 0x4a0030 to 0x4a013a (266 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::handleButton @ 0x492e4c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GJEffectManager::playerButton(GJEffectManager *a1, bool a2, bool a3)
{
_BOOL4 v3; // r11
_BOOL4 v5; // r8
_BOOL4 v6; // r9
unsigned int i; // r6
TouchToggleAction *m_start; // r1
TouchToggleAction *v9; // r10
TouchTriggerControl m_touchTriggerControl; // r2
bool isGroupEnabled; // r0
TouchTriggerType m_touchTriggerType; // r2
int v13; // r2
_BOOL4 v14; // [sp+Ch] [bp-18h]
void *v15[3]; // [sp+10h] [bp-14h] BYREF
v3 = !a2;
v5 = a2;
v6 = a3;
for ( i = 0; ; ++i )
{
m_start = a1->m_unkVector1e0.m_start;
if ( i >= -1171354717 * (((char *)a1->m_unkVector1e0.m_finish - (char *)m_start) >> 2) )
break;
v9 = &m_start[i];
if ( !v9->m_disabled && (!v9->m_dualMode || !v6) )
{
m_touchTriggerControl = v9->m_touchTriggerControl;
if ( m_touchTriggerControl )
{
if ( m_touchTriggerControl == Player1 )
{
if ( !v6 )
continue;
}
else if ( m_touchTriggerControl != Player2 || v6 )
{
continue;
}
}
if ( v5 || v9->m_holdMode )
{
isGroupEnabled = GJEffectManager::isGroupEnabled(a1, v9->m_targetGroupID);
m_touchTriggerType = v9->m_touchTriggerType;
if ( v9->m_holdMode )
{
if ( m_touchTriggerType )
{
if ( m_touchTriggerType == ToggleOn )
v13 = v5;
else
v13 = v3;
goto LABEL_20;
}
LABEL_25:
v13 = !isGroupEnabled;
}
else
{
if ( !m_touchTriggerType )
goto LABEL_25;
v13 = m_touchTriggerType == ToggleOn;
}
LABEL_20:
if ( a1->m_triggerEffectDelegate )
{
v14 = v13;
std::vector::vector((unsigned int *)v15, (int)&v9->m_remapKeys);
a1->m_triggerEffectDelegate->toggleGroupTriggered(
a1->m_triggerEffectDelegate,
v9->m_targetGroupID,
v14,
(const std::vector *)v15,
v9->m_triggerUniqueID,
v9->m_controlID);
std::_Vector_base::~_Vector_base(v15);
}
else
{
GJEffectManager::toggleGroup(a1, v9->m_targetGroupID, v13);
}
continue;
}
}
}
}