//
// InvitesPopup::init from 0x1400f6b60 to 0x1400f71f6 (1686 bytes)
//
// 5 xrefs:
// > MessageThreadsPage::onShowInvites @ 0x1400d66e5
// > MessageThreadsPage::onShowInvites @ 0x1400d66d6
// > ??> @ 0x14072d5f0
// > ??> @ 0x1409152d8
// > ??> @ 0x1409152e4
//
// This function is hookable on this platform (idp: pc, 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 11:26:38 +0000
//
// Hidden C++ exception states: #wind=5
char __fastcall InvitesPopup::init(__int64 a1)
{
bool inited; // bl
void *v3; // r8
__int64 v5; // rbx
__int64 v6; // rcx
__int64 *v7; // rcx
__int64 v8; // rbx
cocos2d::CCObject *v9; // rbx
cocos2d::CCObject *v10; // rdi
__int64 v11; // rbx
__int64 v12; // rax
__int64 v13; // rax
float v14; // xmm10_4
struct cocos2d::CCSprite *v15; // rsi
__int64 v16; // rbx
float v17; // xmm6_4
double v18; // xmm0_8
float v19; // xmm9_4
float v20; // xmm8_4
__int64 v21; // rax
__int64 v22; // rdi
__int64 v23; // rbx
__int64 v24; // rax
__int64 v25; // rbx
__int64 v26; // rax
__int64 v27; // rdx
__int64 v28; // rcx
char *InputNode; // rdi
__int64 v30; // rbx
__int64 v31; // rax
__int64 v32; // rcx
cocos2d::CCObject *v33; // rdi
__int64 v34; // rbx
__int64 v35; // rax
__int64 v36; // rax
__int16 v37; // [rsp+58h] [rbp-B0h] BYREF
char v38; // [rsp+5Ah] [rbp-AEh]
_BYTE v39[40]; // [rsp+60h] [rbp-A8h] BYREF
void *Block[2]; // [rsp+88h] [rbp-80h] BYREF
__int64 v41; // [rsp+98h] [rbp-70h]
unsigned __int64 v42; // [rsp+A0h] [rbp-68h]
*(_OWORD *)Block = 0;
v41 = 0;
v42 = 15;
LOBYTE(Block[0]) = 0;
inited = PagedListPopup::initPaged(a1, "Pending", (const char *)Block, 340.0, 260.0);
if ( v42 > 0xF )
{
v3 = Block[0];
if ( v42 + 1 >= 0x1000 )
{
v3 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v3 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v3);
}
if ( !inited )
return 0;
PagedListPopup::createScrollArea(a1, 64.0, 16.0);
v5 = *(_QWORD *)(a1 + 688);
if ( *(float *)(v5 + 520) <= 0.0 )
{
v6 = *(_QWORD *)(v5 + 416);
if ( v6 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 488LL))(v6);
ScrollableContentLayer::ensureOwnedContentNode((_QWORD *)v5);
}
*(_DWORD *)(v5 + 520) = 1113063424;
v7 = *(__int64 **)(a1 + 744);
if ( v7 )
{
v8 = *v7;
(*(void (__fastcall **)(__int64 *))(*v7 + 232))(v7);
(*(void (__fastcall **)(_QWORD))(v8 + 224))(*(_QWORD *)(a1 + 744));
}
*(_QWORD *)v39 = operator new(0x2C8u);
v9 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite(*(__int64 *)v39);
if ( v9 )
{
if ( ButtonSprite::init_1(
(__int64)v9,
(__int64)"Ignored",
56,
0,
1053609165,
1,
&qword_140704F78,
(__int64)"GJ_button_04.png",
1102053376) )
{
cocos2d::CCObject::autorelease(v9);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v9 + 8LL))(v9, 1);
v9 = nullptr;
}
}
*(_QWORD *)(a1 + 816) = v9;
(*(void (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v9 + 160LL))(v9);
v10 = CCMenuItemSpriteExtra::create(*(_QWORD *)(a1 + 816), 0, a1, (__int64)InvitesPopup::onToggleIgnored);
*((_DWORD *)v10 + 93) = 1067030938;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v10);
v11 = *(_QWORD *)v10;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v39,
(float)((float)(*(float *)(a1 + 672) * 0.5) + *(float *)(a1 + 664)) - 36.0,
(float)((float)(*(float *)(a1 + 676) * 0.5) + *(float *)(a1 + 668)) - 17.0);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v11 + 184))(v10, v12);
*(_QWORD *)v39 = &v39[8];
memset(&v39[8], 0, 32);
sub_14003D230(
&v39[8],
"Message requests and group invites wait here.\n"
"Accepting a request opens the conversation, while accepting an invite joins the group chat.\n"
"Ignore moves it to the Ignored view. The sender is not told.\n"
"Ignored requests and invites can still be accepted later.\n"
"Requests and invites expire 14 days after they are sent and are then removed from both views.",
0x16Eu);
HIWORD(Block[1]) = 0;
v41 = 7;
v42 = 15;
qmemcpy(Block, "Invite", 6);
*(void **)((char *)Block + 6) = (void *)(unsigned __int8)aInvites[6];
v13 = InfoAlertButton::create(Block, &v39[8]);
*(_QWORD *)(a1 + 824) = v13;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v13);
InvitesPopup::layoutTitleInfo(a1);
v14 = (float)((float)(*(float *)(a1 + 676) * 0.5) + *(float *)(a1 + 668)) - 45.0;
v15 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_longBtn07_001.png");
v16 = *(_QWORD *)v15;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v15 + 320LL))(v15);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(v16 + 160))(v15);
v17 = *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v15 + 320LL))(v15);
v18 = (*(double (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v15 + 168LL))(v15);
v19 = *(float *)&v18 * v17;
v20 = *(float *)(a1 + 664) - (float)((float)((float)(*(float *)&v18 * v17) + 4.0) * 0.5);
v21 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)Block, 0.0, 0.0, 40.0, 40.0);
v22 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v21);
v23 = *(_QWORD *)v22;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v39, 200.0, 24.0);
(*(void (__fastcall **)(__int64, __int64))(v23 + 312))(v22, v24);
v37 = 13405;
v38 = 31;
(**(void (__fastcall ***)(__int64, __int16 *))(v22 + 320))(v22 + 320, &v37);
v25 = *(_QWORD *)v22;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, v20, v14);
(*(void (__fastcall **)(__int64, __int64))(v25 + 184))(v22, v26);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v22, 9);
InputNode = GameToolbox::createInputNode(v28, v27, (__int64)"Search", 20);
*(_QWORD *)(a1 + 832) = InputNode;
v30 = *(_QWORD *)InputNode;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, v20, v14);
(*(void (__fastcall **)(char *, __int64))(v30 + 184))(InputNode, v31);
v32 = *(_QWORD *)(a1 + 832);
*(_DWORD *)(v32 + 568) = 1058642330;
CCTextInputNode::refreshLabel(v32);
*(_QWORD *)(*(_QWORD *)(a1 + 832) + 600LL) = a1 + 544;
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 832),
10);
v33 = CCMenuItemSpriteExtra::create((int)v15, 0, a1, (__int64)InvitesPopup::onClearSearch);
*((_DWORD *)v33 + 93) = 1067030938;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v33);
v34 = *(_QWORD *)v33;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v39,
(float)((float)(v20 + 100.0) + 4.0) + (float)(v19 * 0.5),
v14 - 1.0);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v34 + 184))(v33, v35);
if ( !*(_QWORD *)&qword_14090BFB0 )
{
Block[0] = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(Block[0]);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
}
GameLevelManager::getThreadInvites();
v36 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
Block[0] = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(Block[0]);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v36 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v36 + 1392) = a1 + 776;
PagedListPopup::showLoading(a1);
return 1;
}