//
// UIOptionsLayer::toggleUIGroup from 0x8d6100 to 0x8d62f4 (500 bytes)
//
// 3 xrefs:
// > UIOptionsLayer::init @ 0x8d7740
// > UIOptionsLayer::ccTouchBegan @ 0x8d8e7c
// > ??> @ 0x2e050
//
// 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 UIOptionsLayer::toggleUIGroup(UIOptionsLayer *a1, int a2)
{
cocos2d::CCLabelBMFont *m_nameLabel; // x0
UIOptionsLayer_vtbl *v5; // x3
unsigned __int8 *v6; // x0
unsigned int *v7; // x2
int v8; // w1
const unsigned __int8 *v9; // [xsp+50h] [xbp+50h] BYREF
if ( a1->m_activeUIGroup != a2 )
{
sub_D153B8((int)&v9, "P1 Move");
switch ( a2 )
{
case 2:
sub_D1798C(&v9, "P2 Move", 7);
break;
case 3:
sub_D1798C(&v9, "P1 Jump", 7);
break;
case 4:
sub_D1798C(&v9, "P2 Jump", 7);
break;
}
m_nameLabel = a1->m_nameLabel;
if ( m_nameLabel )
m_nameLabel->setString(m_nameLabel, v9);
v5 = a1->SetupTriggerPopup::FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_activeUIGroup = a2;
v5->toggleGroup(a1, 1, a2 == 1);
a1->toggleGroup(a1, 2, a2 == 2);
a1->toggleGroup(a1, 3, a2 == 3);
a1->toggleGroup(a1, 4, a2 == 4);
v6 = (unsigned __int8 *)(v9 - 24);
if ( v9 - 24 != (const unsigned __int8 *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *((_DWORD *)v9 - 2);
*((_DWORD *)v9 - 2) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v6);
}
}
}