//
// SetupPulsePopup::onSelectPulseMode from 0x8ee030 to 0x8ee268 (568 bytes)
//
// 5 xrefs:
// > SetupPulsePopup::init @ 0x8f1434
// > ??> @ 0x81630
// > SetupPulsePopup::init @ 0x8efea0
// > SetupPulsePopup::init @ 0x8eff14
// > ??> @ 0x122c5c8
//
// 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 SetupPulsePopup::onSelectPulseMode(SetupPulsePopup *a1, cocos2d::CCObject *a2)
{
int v3; // w23
ButtonSprite *v4; // x0
_BOOL4 v5; // w22
_BOOL4 v6; // w21
ButtonSprite *v7; // x0
const char *v8; // x1
unsigned int v9; // w20
__int64 v10; // x0
bool v11; // cf
unsigned int v12; // w1
unsigned int v13; // w20
__int64 v14; // x0
unsigned int v15; // w1
ButtonSprite *v16; // x0
if ( a2 )
{
v3 = a2->getTag(a2);
v4 = (ButtonSprite *)a1->m_colorButton->getNormalImage(a1->m_colorButton);
if ( v3 )
{
ButtonSprite::updateBGImage(v4, "GJ_button_04.png");
v7 = (ButtonSprite *)a1->m_hsvButton->getNormalImage(a1->m_hsvButton);
if ( v3 == 1 )
{
v5 = 1;
v6 = 0;
v8 = "GJ_button_02.png";
}
else
{
v5 = 0;
v6 = 0;
v8 = "GJ_button_04.png";
}
}
else
{
v5 = 0;
v6 = 1;
ButtonSprite::updateBGImage(v4, "GJ_button_02.png");
v7 = (ButtonSprite *)a1->m_hsvButton->getNormalImage(a1->m_hsvButton);
v8 = "GJ_button_04.png";
}
}
else
{
v5 = 0;
v6 = 0;
v3 = -1;
v16 = (ButtonSprite *)a1->m_colorButton->getNormalImage(a1->m_colorButton);
ButtonSprite::updateBGImage(v16, "GJ_button_04.png");
v7 = (ButtonSprite *)a1->m_hsvButton->getNormalImage(a1->m_hsvButton);
v8 = "GJ_button_04.png";
}
v9 = 0;
ButtonSprite::updateBGImage(v7, v8);
while ( 1 )
{
v11 = v9 >= (unsigned int)cocos2d::CCArray::count(a1->m_colorObjects);
v12 = v9++;
if ( v11 )
break;
v10 = cocos2d::CCArray::objectAtIndex(a1->m_colorObjects, v12);
(*(void (__fastcall **)(__int64, _BOOL4))(*(_QWORD *)v10 + 328LL))(v10, v6);
}
v13 = 0;
while ( 1 )
{
v11 = v13 >= (unsigned int)cocos2d::CCArray::count(a1->m_hsvObjects);
v15 = v13++;
if ( v11 )
break;
v14 = cocos2d::CCArray::objectAtIndex(a1->m_hsvObjects, v15);
(*(void (__fastcall **)(__int64, _BOOL4))(*(_QWORD *)v14 + 328LL))(v14, v5);
}
a1->m_colorIDInput->setTouchEnabled(a1->m_colorIDInput, v5);
a1->m_rInput->setTouchEnabled(a1->m_rInput, v6);
a1->m_gInput->setTouchEnabled(a1->m_gInput, v6);
a1->m_bInput->setTouchEnabled(a1->m_bInput, v6);
a1->m_hexInput->setTouchEnabled(a1->m_hexInput, v6);
a1->m_pulseMode = v3;
if ( !a1->m_modesInitializing )
SetupPulsePopup::updatePulseMode(a1);
}