//
// SetupPulsePopup::onSelectTargetMode from 0x1003adad0 to 0x1003add44 (628 bytes)
//
// 2 xrefs:
// > SetupPulsePopup::init @ 0x1003ad2df
// > SetupPulsePopup::init @ 0x1003ab1c3
//
// 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 __fastcall SetupPulsePopup::onSelectTargetMode(SetupPulsePopup *a1, cocos2d::CCObject *a2)
{
int v3; // r14d
ButtonSprite *v4; // rax
const char *v5; // rsi
const char *v6; // r15
const char *v7; // rdi
const char *v8; // rcx
ButtonSprite *v9; // rax
cocos2d::CCLabelBMFont *m_mainOnlyLabel; // rdi
cocos2d::CCLabelBMFont *m_secondaryOnlyLabel; // rdi
EffectGameObject *m_gameObject; // rdi
EffectGameObject *v13; // rax
cocos2d::CCArray *m_gameObjects; // rdi
unsigned int v15; // r14d
EffectGameObject *v16; // rax
cocos2d::CCArray *v17; // rdi
unsigned int v18; // r14d
const char *v19; // [rsp+0h] [rbp-30h]
if ( a2 )
v3 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);
else
v3 = -1;
v4 = (ButtonSprite *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_channelButton->getNormalImage)(a1->m_channelButton);
v5 = "GJ_button_04.png";
v6 = "GJ_button_04.png";
if ( v3 == 1 )
v6 = "GJ_button_02.png";
v7 = "ID";
if ( v3 == 1 )
v7 = "Group ID";
if ( !v3 )
v5 = "GJ_button_02.png";
v8 = "Channel ID";
if ( v3 )
v8 = v7;
v19 = v8;
ButtonSprite::updateBGImage(v4, v5);
v9 = (ButtonSprite *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_groupButton->getNormalImage)(a1->m_groupButton);
ButtonSprite::updateBGImage(v9, v6);
((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_specialColorButton->setVisible)(
a1->m_specialColorButton,
v3 == 0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_specialColorButton->setEnabled)(
a1->m_specialColorButton,
v3 == 0);
((void (__fastcall *)(CCMenuItemToggler *, bool))a1->m_mainOnlyToggler->setVisible)(a1->m_mainOnlyToggler, v3 == 1);
((void (__fastcall *)(CCMenuItemToggler *, bool))a1->m_mainOnlyToggler->setEnabled)(a1->m_mainOnlyToggler, v3 == 1);
m_mainOnlyLabel = a1->m_mainOnlyLabel;
if ( m_mainOnlyLabel )
((void (__fastcall *)(cocos2d::CCLabelBMFont *, bool))m_mainOnlyLabel->setVisible)(m_mainOnlyLabel, v3 == 1);
((void (__fastcall *)(CCMenuItemToggler *, bool))a1->m_secondaryOnlyToggler->setVisible)(
a1->m_secondaryOnlyToggler,
v3 == 1);
((void (__fastcall *)(CCMenuItemToggler *, bool))a1->m_secondaryOnlyToggler->setEnabled)(
a1->m_secondaryOnlyToggler,
v3 == 1);
m_secondaryOnlyLabel = a1->m_secondaryOnlyLabel;
if ( m_secondaryOnlyLabel )
((void (__fastcall *)(cocos2d::CCLabelBMFont *, bool))m_secondaryOnlyLabel->setVisible)(
m_secondaryOnlyLabel,
v3 == 1);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_idLabel->setString)(a1->m_idLabel, v19);
a1->m_pulseTargetType = v3;
if ( !a1->m_modesInitializing )
{
a1->m_targetGroupID = 0;
m_gameObject = a1->m_gameObject;
if ( m_gameObject )
{
EffectGameObject::setTargetID(m_gameObject, 0);
}
else
{
m_gameObjects = a1->m_gameObjects;
if ( m_gameObjects && (unsigned int)sub_100720070(m_gameObjects) )
{
v15 = 0;
do
{
v16 = (EffectGameObject *)sub_1007200C0(a1->m_gameObjects, v15);
EffectGameObject::setTargetID(v16, a1->m_targetGroupID);
++v15;
}
while ( v15 < (unsigned int)sub_100720070(a1->m_gameObjects) );
}
}
SetupPulsePopup::updateTextInputLabel(a1);
v13 = a1->m_gameObject;
if ( v13 )
{
v13->m_pulseTargetType = a1->m_pulseTargetType;
}
else
{
v17 = a1->m_gameObjects;
if ( v17 && (unsigned int)sub_100720070(v17) )
{
v18 = 0;
do
*(_DWORD *)(sub_1007200C0(a1->m_gameObjects, v18++) + 1608) = a1->m_pulseTargetType;
while ( v18 < (unsigned int)sub_100720070(a1->m_gameObjects) );
}
}
}
}