//
// FLAlertLayer::init from 0x699e8c to 0x69a948 (2748 bytes)
//
// 2 xrefs:
// > FLAlertLayer::create @ 0x69aae0
// > ??> @ 0xc00d0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:50:39 +0000
//
__int64 __fastcall FLAlertLayer::init(
__int64 a1,
__int64 a2,
cocos2d::CCLabelBMFont *a3,
char *a4,
ButtonSprite *a5,
ButtonSprite *a6,
char a7,
float a8,
float a9,
float a10)
{
GameManager *v20; // x0
unsigned int v21; // w22
GameManager *v23; // x0
cocos2d::CCDirector *v24; // x0
cocos2d::CCDirector *v25; // x0
cocos2d::CCLayer *WinSize; // x0
__int64 v27; // x0
__int64 v28; // x2
EmoteSprite *v29; // x0
unsigned int v30; // w27
char v31; // w0
__int64 v32; // x0
__int64 v33; // x1
float *v34; // x27
float v35; // s9
__int64 v36; // x26
__int64 v37; // x28
__int64 v38; // x0
__int64 v39; // x28
const char *v40; // x2
cocos2d::CCLabelBMFont *v41; // x25
void (__fastcall *v42)(cocos2d::CCLabelBMFont *, __int64 *); // x28
void (__fastcall *v43)(cocos2d::CCLabelBMFont *, __int64 *); // x28
__int64 v44; // x0
cocos2d::CCMenu *v45; // x0
__int64 v46; // x0
bool v47; // w4
__int64 v48; // x5
const char *v49; // x6
__int64 v50; // x0
__int64 v51; // x24
float v52; // s9
bool v53; // w4
__int64 v54; // x5
const char *v55; // x6
__int64 v56; // x0
__int64 v57; // x23
cocos2d::CCArray *v58; // x0
float v59; // s0
__int64 v60; // x25
__int64 v61; // x0
__int64 (__fastcall *v62)(__int64); // x1
__int64 (__fastcall *v63)(__int64, __int64 *); // x26
__int64 v64; // x0
PlatformToolbox *v65; // x0
float v66; // s9
char v67; // w0
__int64 v68; // x0
__int64 v69; // x1
float *v70; // x26
void (__fastcall *v71)(float *, __int64 *); // x27
float v72; // s10
double v73; // d1
long double v74; // q0
__int64 v75; // x0
__int64 v76; // x26
cocos2d::CCNode *v77; // x25
const char *v78; // x1
__int64 v79; // x25
cocos2d::CCNode *v80; // x26
__int64 v81; // x1
__int64 v82; // x0
cocos2d::CCNode *v83; // x24
const cocos2d::CCPoint *v84; // x0
void (__fastcall *v85)(__int64, __int64 *); // x24
const char *v86; // x1
__int64 v87; // x23
void (__fastcall *v88)(__int64, __int64 *); // x24
void (__fastcall *v89)(float *, __int64 *); // x25
__int64 (__fastcall *v90)(float *, __int64 *); // x25
__int64 v91; // x0
long double v92; // [xsp+80h] [xbp+80h]
cocos2d::CCSize *v93; // [xsp+98h] [xbp+98h]
void (__fastcall *v94)(__int64, __int64 *); // [xsp+A0h] [xbp+A0h]
void (__fastcall *v95)(__int64, __int64 *); // [xsp+A0h] [xbp+A0h]
void (__fastcall *v96)(__int64, __int64 *); // [xsp+A0h] [xbp+A0h]
float v97; // [xsp+A0h] [xbp+A0h]
float v98; // [xsp+A0h] [xbp+A0h]
__int64 v99; // [xsp+B0h] [xbp+B0h] BYREF
float v100; // [xsp+B8h] [xbp+B8h] BYREF
float v101; // [xsp+BCh] [xbp+BCh]
__int64 v102; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v103; // [xsp+C8h] [xbp+C8h] BYREF
__int64 v104[2]; // [xsp+D0h] [xbp+D0h] BYREF
__int64 v105; // [xsp+E0h] [xbp+E0h] BYREF
__int64 v106; // [xsp+E8h] [xbp+E8h]
void *v107; // [xsp+F0h] [xbp+F0h]
LODWORD(v104[0]) = -1778384896;
v20 = (GameManager *)(unsigned __int8)cocos2d::CCLayerColor::initWithColor(a1, v104);
v21 = (unsigned __int8)v20;
if ( (_BYTE)v20 )
{
v23 = (GameManager *)GameManager::sharedState(v20);
if ( (unsigned __int8)GameManager::getGameVariable(v23, "0168") )
*(_BYTE *)(a1 + 596) = 1;
*(_QWORD *)(a1 + 560) = a2;
*(_BYTE *)(a1 + 636) = a7;
*(_BYTE *)(a1 + 576) = 0;
*(float *)(a1 + 648) = a8;
*(float *)(a1 + 652) = a9;
FLAlertLayer::incrementForcePrio((cocos2d::CCObject *)a1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1000LL))(a1, 1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1072LL))(a1, 1);
v24 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1088LL))(a1, 1);
v25 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v24);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize(&v99, v25);
v27 = cocos2d::CCLayer::create(WinSize);
v28 = *(_QWORD *)a1;
*(_QWORD *)(a1 + 584) = v27;
v29 = (EmoteSprite *)(*(__int64 (__fastcall **)(__int64))(v28 + 456))(a1);
v30 = EmoteSprite::maxEmotesComment(v29);
if ( *(_BYTE *)(a1 + 636) )
{
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v100, 370.0, 180.0);
v66 = (float)((float)(v100 - 60.0) * 1.1) / 0.8;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v102, *(float *)&v99 * 0.5, *((float *)&v99 + 1) * 0.5);
v105 = 0;
v67 = *a4;
v106 = 0;
v107 = nullptr;
if ( (v67 & 1) != 0 )
{
std::string::__init(&v105, *((void **)a4 + 2), *((_QWORD *)a4 + 1));
}
else
{
v68 = *(_QWORD *)a4;
v69 = *((_QWORD *)a4 + 1);
v107 = *((void **)a4 + 2);
v105 = v68;
v106 = v69;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, 0.5, 1.0);
v70 = (float *)TextArea::create(&v105, "chatFont.fnt", v104, 0, v30, a10, v66, 20.0);
if ( (v105 & 1) != 0 )
operator delete(v107);
v71 = *(void (__fastcall **)(float *, __int64 *))(*(_QWORD *)v70 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, 0.5, 0.5);
v71(v70, v104);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v70 + 160LL))(v70, 0.8);
(*(void (__fastcall **)(float *, __int64 *))(*(_QWORD *)v70 + 184LL))(v70, &v102);
*(double *)&v74 = v101;
v72 = (float)((float)(a10 * v70[109]) * 0.5) + 10.0;
v73 = v101 * 0.5 + -20.0;
*(float *)&v74 = v72 * 1.2;
if ( v73 >= (float)(v72 * 1.2) )
*(float *)&v74 = v73;
v92 = v74;
v34 = nullptr;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v103, (const cocos2d::CCSize *)&v100);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, (const cocos2d::CCPoint *)&v102);
v75 = ScrollingLayer::create(&v103, v104, v92);
*(_QWORD *)(a1 + 624) = v75;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v75,
10);
*(_QWORD *)(*(_QWORD *)(a1 + 624) + 600LL) = *(_QWORD *)(a1 + 584);
(*(void (__fastcall **)(_QWORD, float *))(**(_QWORD **)(*(_QWORD *)(a1 + 624) + 592LL) + 456LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 624) + 592LL),
v70);
v76 = *(_QWORD *)(a1 + 624);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, 0.0, v72 * -0.5);
ScrollingLayer::setStartOffset(v76, v104);
v35 = 280.0;
}
else
{
v31 = *a4;
v105 = 0;
v106 = 0;
v107 = nullptr;
if ( (v31 & 1) != 0 )
{
std::string::__init(&v105, *((void **)a4 + 2), *((_QWORD *)a4 + 1));
}
else
{
v32 = *(_QWORD *)a4;
v33 = *((_QWORD *)a4 + 1);
v107 = *((void **)a4 + 2);
v105 = v32;
v106 = v33;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, 0.5, 0.5);
v34 = (float *)TextArea::create(
&v105,
"chatFont.fnt",
v104,
0,
v30,
1.0,
(float)((float)(a8 - 60.0) * 1.1) / a10,
20.0);
if ( (v105 & 1) != 0 )
operator delete(v107);
(*(void (__fastcall **)(_QWORD, float *, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v34,
3);
v35 = (float)(v34[109] * a10) + 120.0;
if ( v35 <= 140.0 )
v35 = 140.0;
if ( a10 != 1.0 )
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v34 + 160LL))(v34, a10);
}
*(float *)(a1 + 652) = v35;
LODWORD(v104[0]) = -16777216;
v36 = cocos2d::CCLayerColor::create(v104, a8, v35);
v94 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v36 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v104,
(float)(*(float *)&v99 - a8) * 0.5,
(float)(*((float *)&v99 + 1) - v35) * 0.5);
v94(v36, v104);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v36 + 344LL))(v36, 0);
LODWORD(v104[0]) = -6908266;
v37 = cocos2d::CCLayerColor::create(v104, a8 + 16.0, v35 + 16.0);
v93 = *(cocos2d::CCSize **)(*(_QWORD *)v37 + 184LL);
*(float *)&v94 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v36 + 192LL))(v36) - 8.0;
v38 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v36 + 192LL))(v36);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, *(float *)&v94, *(float *)(v38 + 4) - 8.0);
((void (__fastcall *)(__int64, __int64 *))v93)(v37, v104);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v37 + 344LL))(v37, 0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v104, 0.0, 0.0, 94.0, 94.0);
v39 = cocos2d::extension::CCScale9Sprite::create("square01_001.png", v104);
v95 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v39 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v104, a8, v35);
v95(v39, v104);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v39, 1);
v96 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v39 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, *(float *)&v99 * 0.5, *((float *)&v99 + 1) * 0.5);
v96(v39, v104);
v41 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(a3, "goldFont.fnt", v40);
v42 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64 *))(*(_QWORD *)v41 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, 0.5, 1.0);
v42(v41, v104);
v43 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64 *))(*(_QWORD *)v41 + 184LL);
*(float *)&v96 = *(float *)&v99 * 0.5;
v44 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v36 + 192LL))(v36);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, *(float *)&v96, (float)(v35 + *(float *)(v44 + 4)) - 15.0);
v43(v41, v104);
(*(void (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v41,
3);
cocos2d::CCLabelBMFont::limitLabelWidth(v41, a8 - 30.0, 0.9, 0.4);
v45 = (cocos2d::CCMenu *)*(unsigned __int8 *)(a1 + 636);
if ( !*(_BYTE *)(a1 + 636) )
{
v89 = *(void (__fastcall **)(float *, __int64 *))(*(_QWORD *)v34 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, 0.5, 0.5);
v89(v34, v104);
v90 = *(__int64 (__fastcall **)(float *, __int64 *))(*(_QWORD *)v34 + 184LL);
v98 = *(float *)&v99 * 0.5;
v91 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v36 + 192LL))(v36);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, v98, (float)(*(float *)(v91 + 4) + (float)(v35 * 0.5)) + 5.0);
v45 = (cocos2d::CCMenu *)v90(v34, v104);
}
v46 = cocos2d::CCMenu::create(v45);
*(_QWORD *)(a1 + 552) = v46;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v46, 2);
v50 = ButtonSprite::create(a5, (const char *)&qword_58 + 2, 0, 0, 1.0, v47, v48, v49);
*(_QWORD *)(a1 + 608) = v50;
v51 = CCMenuItemSpriteExtra::create(v50, 0, a1, (__int64)FLAlertLayer::onButton, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v51 + 72LL))(v51, 0);
v52 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 608) + 328LL))(*(_QWORD *)(a1 + 608)) + 0.0;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v51);
if ( a6 )
{
v56 = ButtonSprite::create(a6, (const char *)&qword_58 + 2, 0, 0, 1.0, v53, v54, v55);
*(_QWORD *)(a1 + 616) = v56;
v57 = CCMenuItemSpriteExtra::create(v56, 0, a1, (__int64)FLAlertLayer::onButton, 0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v57 + 72LL))(v57, 1);
v52 = v52 + *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 616) + 328LL))(*(_QWORD *)(a1 + 616));
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v57);
}
else
{
v57 = 0;
*(_BYTE *)(a1 + 637) = 1;
}
if ( (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 552) + 488LL))(*(_QWORD *)(a1 + 552)) )
{
v58 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 552) + 488LL))(*(_QWORD *)(a1 + 552));
if ( (unsigned int)cocos2d::CCArray::count(v58) > 1 )
{
v59 = (float)(a8 - v52) * 0.5;
if ( v59 >= 15.0 )
v59 = 15.0;
cocos2d::CCMenu::alignItemsHorizontallyWithPadding(*(cocos2d::CCMenu **)(a1 + 552), v59);
}
}
v60 = *(_QWORD *)(a1 + 552);
v61 = v36;
v62 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v36 + 192LL);
v63 = *(__int64 (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v60 + 184LL);
v97 = *(float *)&v99 * 0.5;
v64 = v62(v61);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, v97, *(float *)(v64 + 4) + 30.0);
v65 = (PlatformToolbox *)v63(v60, v104);
if ( (unsigned __int8)PlatformToolbox::isControllerConnected(v65) )
{
v77 = *(cocos2d::CCNode **)(a1 + 584);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, *(float *)&v99 * 0.5, *((float *)&v99 + 1) * 0.5);
cocos2d::CCNode::convertToNodeSpace(&v102, v77, (const cocos2d::CCPoint *)v104);
v79 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"controllerBtn_B_001.png", v78);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v79,
10);
v80 = *(cocos2d::CCNode **)(a1 + 552);
v81 = *(_QWORD *)v51;
v82 = v51;
v83 = *(cocos2d::CCNode **)(a1 + 584);
v84 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(v81 + 192))(v82);
cocos2d::CCNode::convertToWorldSpace(v104, v80, v84);
cocos2d::CCNode::convertToNodeSpace(&v103, v83, (const cocos2d::CCPoint *)v104);
v85 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v79 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, *(float *)&v102 - 116.0, *((float *)&v103 + 1));
v85(v79, v104);
if ( v57 )
{
v87 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"controllerBtn_X_001.png", v86);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v87,
10);
v88 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v87 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v104, *(float *)&v102 + 116.0, *((float *)&v103 + 1));
v88(v87, v104);
}
}
*(_DWORD *)(a1 + 640) = -1;
}
return v21;
}