//
// UIOptionsLayer::onClose from 0x1402a2de0 to 0x1402a30ca (746 bytes)
//
// 2 xrefs:
// > ??> @ 0x140578598
// > ??> @ 0x1406d1fd0
//
// 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
//
// Hidden C++ exception states: #wind=7
void UIOptionsLayer::onClose(UIOptionsLayer *a1, cocos2d::CCObject *a2)
{
float v2; // xmm0_4
cocos2d::CCDirector *v5; // rax
__int64 v6; // rdx
__int64 v7; // rdx
float v8; // xmm6_4
__int64 v9; // rdi
__int64 v10; // rax
double v11; // xmm0_8
__int64 v12; // rdx
__int64 v13; // rdx
float v14; // xmm6_4
__int64 v15; // rdi
__int64 v16; // rax
float v17; // [rsp+50h] [rbp+8h]
void *v18; // [rsp+60h] [rbp+18h]
void *v19; // [rsp+60h] [rbp+18h]
void *v20; // [rsp+60h] [rbp+18h]
void *v21; // [rsp+60h] [rbp+18h]
void *v22; // [rsp+60h] [rbp+18h]
void *v23; // [rsp+60h] [rbp+18h]
void *v24; // [rsp+60h] [rbp+18h]
v5 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v5);
v6 = qword_1406C2ED8;
if ( a1->m_dual )
{
if ( !qword_1406C2ED8 )
{
v19 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v19);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v6 = qword_1406C2ED8;
}
GJUINode::saveToConfig(a1->m_uiNode1, (UIButtonConfig *)(v6 + 1252));
v7 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v20 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v20);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v7 = qword_1406C2ED8;
}
GJUINode::saveToConfig(a1->m_uiNode2, (UIButtonConfig *)(v7 + 1292));
v8 = fabs(a1->m_uiNode2->getPosition_0(a1->m_uiNode2)->x - v17);
v9 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v21 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v21);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v9 = qword_1406C2ED8;
}
a1->m_uiNode2->getPosition_0(a1->m_uiNode2);
cocos2d::CCPoint::CCPoint(v2, v8);
v11 = cocos2d::CCPoint::operator=(v9 + 1320, v10);
v12 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v22 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v22);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v12 = qword_1406C2ED8;
}
GJUINode::saveToConfig(a1->m_uiNode3, (UIButtonConfig *)(v12 + 1332));
v13 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v23 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v23);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v13 = qword_1406C2ED8;
}
GJUINode::saveToConfig(a1->m_uiNode4, (UIButtonConfig *)(v13 + 1372));
v14 = fabs(a1->m_uiNode4->getPosition_0(a1->m_uiNode4)->x - v17);
v15 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v24 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v24);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v15 = qword_1406C2ED8;
}
a1->m_uiNode4->getPosition_0(a1->m_uiNode4);
cocos2d::CCPoint::CCPoint(*(float *)&v11, v14);
cocos2d::CCPoint::operator=(v15 + 1400, v16);
}
else
{
if ( !qword_1406C2ED8 )
{
v18 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v18);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v6 = qword_1406C2ED8;
}
GJUINode::saveToConfig(a1->m_uiNode1, (UIButtonConfig *)(v6 + 1212));
}
SetupTriggerPopup::onClose(a1, a2);
}