//
// ThreadSearchPopup::init from 0x74e1d4 to 0x74e844 (1648 bytes)
//
// 1 xrefs:
// > ThreadSearchPopup::create @ 0x74e8fc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:58:49 +0000
//
int __fastcall ThreadSearchPopup::init(ThreadSearchPopup *this, ThreadViewPopup *a2)
{
float v3; // s16
GameManager *v4; // r0
float v5; // s17
float v6; // s16
float v7; // s18
const char *v8; // r1
int v9; // r5
int v10; // r7
const cocos2d::CCPoint *v11; // r9
void (__fastcall *v12)(int, _DWORD *); // r8
float v13; // s17
float v14; // s19
float v15; // s16
float v16; // s22
int v17; // r5
void (__fastcall *v18)(int, _DWORD *); // r8
void (__fastcall *v19)(int, _DWORD *); // r3
void (__fastcall *v20)(int, _DWORD *); // r8
_DWORD *InputNode; // r0
_DWORD *v22; // r8
int v23; // r3
int v24; // r0
void (__fastcall *v25)(_DWORD *, int); // r9
int v26; // r3
int v27; // r5
int v28; // r0
ButtonSprite *v29; // r0
int v30; // r8
struct tm *v31; // r0
float v32; // s17
int v33; // r3
float v34; // s18
int v35; // r8
void (__fastcall *v36)(int, _DWORD *); // r6
void (__fastcall *v37)(int, _DWORD *); // r3
void (__fastcall *v38)(int, _DWORD *); // r6
char *v39; // r9
int *v40; // r6
int v41; // r3
int v42; // r0
cocos2d::CCString *v43; // r0
const char *CString; // r0
size_t v45; // r0
const char *v46; // r2
int v47; // r8
void (__fastcall *v48)(int, _DWORD *); // r6
int v49; // s15
CCTextInputNode *v50; // r0
CCTextInputNode *v51; // r3
int v52; // r1
char *v53; // r2
int v54; // r3
ButtonSprite *v55; // r0
int v56; // r6
const cocos2d::CCPoint *v57; // r8
void (__fastcall *v58)(int, _BYTE *); // r7
char *v60; // [sp+0h] [bp-B4h]
char *v61; // [sp+8h] [bp-ACh]
int v62; // [sp+10h] [bp-A4h]
float v63; // [sp+10h] [bp-A4h]
float v64; // [sp+10h] [bp-A4h]
void (__fastcall *v65)(int, _DWORD *); // [sp+18h] [bp-9Ch]
cocos2d::CCPoint *v66; // [sp+24h] [bp-90h]
void (__fastcall *v67)(int *, int); // [sp+2Ch] [bp-88h]
const char *v68; // [sp+2Ch] [bp-88h]
int v69; // [sp+30h] [bp-84h]
time_t v70; // [sp+34h] [bp-80h] BYREF
float v71[2]; // [sp+38h] [bp-7Ch] BYREF
_BYTE v72[8]; // [sp+40h] [bp-74h] BYREF
_BYTE v73[8]; // [sp+48h] [bp-6Ch] BYREF
int v74; // [sp+50h] [bp-64h]
int v75; // [sp+54h] [bp-60h]
_DWORD v76[2]; // [sp+58h] [bp-5Ch] BYREF
_DWORD v77[3]; // [sp+60h] [bp-54h]
_DWORD v78[3]; // [sp+6Ch] [bp-48h]
float v79[3]; // [sp+78h] [bp-3Ch]
CCTextInputNode *v80[3]; // [sp+84h] [bp-30h]
int v81; // [sp+90h] [bp-24h] BYREF
int v82; // [sp+94h] [bp-20h]
int v83; // [sp+98h] [bp-1Ch]
_DWORD v84[4]; // [sp+9Ch] [bp-18h] BYREF
if ( !a2 )
return 0;
*((_DWORD *)this + 178) = a2;
v3 = FLAlertLayer::keyboardRaise((FLAlertLayer *)0x43200000, 65.0, COERCE_FLOAT(&_stack_chk_guard));
v4 = SetupTriggerPopup::init(this, nullptr, nullptr, 320.0, 160.0, (_BYTE *)&dword_0 + 1, v3);
v63 = *(float *)&v4;
if ( !v4 )
return 0;
cocos2d::CCDirector::sharedDirector(v4);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v71);
v5 = v71[0];
v81 = 0;
v82 = 0;
v6 = v3 + (float)(v71[1] * 0.5);
v83 = 0;
std::string::__init(&v81, "Search Conversation", 0x13u);
v7 = v5 * 0.5;
SetupTriggerPopup::addTitle((int)this, (unsigned __int8 *)&v81);
std::string::~string((int)&v81);
v9 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v8);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v9 + 80))(v9, 1061997773);
v74 = 684;
v75 = 1;
v10 = CCMenuItemSpriteExtra::create(v9, 0, (int)this, 684, 1);
CCMenuItemSpriteExtra::setSizeMult(v10, 1.5);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v10);
v11 = *((const cocos2d::CCPoint **)this + 111);
v12 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v10 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v76,
(float)((float)(v5 * 0.5) - 160.0) + 8.0,
(float)(v6 + 80.0) - 12.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v84, v11);
v12(v10, v84);
v13 = (float)(v5 * 0.5) - 38.0;
v14 = v6 + 16.0;
v15 = v6 - 30.0;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v84, 0.0, 0.0, 40.0, 40.0);
v16 = (float)(v7 + 160.0) - 52.0;
v17 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v84);
v18 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v17 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v84, 180.0, 26.0);
v18(v17, v84);
v19 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v17 + 480);
LOWORD(v84[0]) = 13405;
BYTE2(v84[0]) = 31;
v19(v17, v84);
v20 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v17 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v84, v13, v14);
v20(v17, v84);
(*(void (__fastcall **)(_DWORD, int, _DWORD))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v17, 0);
InputNode = (_DWORD *)GameToolbox::createInputNode(
(GameToolbox *)0x43280000,
26.0,
COERCE_FLOAT("Search term"),
(const char *)&dword_40,
(int)v60);
*((_DWORD *)this + 179) = InputNode;
v22 = InputNode;
v23 = *InputNode;
v24 = v17;
v25 = *(void (__fastcall **)(_DWORD *, int))(v23 + 92);
v26 = *(_DWORD *)v17;
v27 = 0;
v28 = (*(int (__fastcall **)(int))(v26 + 96))(v24);
v25(v22, v28);
CCTextInputNode::setUnicodeText(*((int **)this + 179), 1);
*(_DWORD *)(*((_DWORD *)this + 179) + 420) = (char *)this + 440;
(*(void (__fastcall **)(_DWORD, _DWORD, int))(**((_DWORD **)this + 115) + 232))(
*((_DWORD *)this + 115),
*((_DWORD *)this + 179),
5);
v29 = ButtonSprite::create(
(ButtonSprite *)"Search",
(const char *)&dword_44 + 2,
0,
0.55,
1,
"bigFont.fnt",
"GJ_button_01.png",
(const char *)0x41E00000,
v63);
v76[0] = ThreadSearchPopup::onSearch;
v76[1] = 0;
v30 = CCMenuItemSpriteExtra::create((int)v29, 0, (int)this, (int)ThreadSearchPopup::onSearch, 0);
CCMenuItemSpriteExtra::setSizeMult(v30, 1.1);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v30);
v65 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v30 + 92);
v66 = *((cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v73, v16, v14);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v84, v66);
v65(v30, v84);
v70 = time(nullptr);
v31 = localtime(&v70);
v32 = v13 - 90.0;
v33 = v31->tm_year + 1900;
*((_DWORD *)this + 183) = v33;
v77[0] = v33;
v77[1] = v31->tm_mon + 1;
v77[2] = v31->tm_mday;
v78[0] = off_D1E2B4[0];
v78[1] = off_D1E2B8[0];
v78[2] = off_D1E2BC;
v79[0] = 54.0;
v79[1] = 40.0;
v79[2] = 40.0;
do
{
v34 = v79[v27];
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v84, 0.0, 0.0, 40.0, 40.0);
v35 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v84);
v36 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v35 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v84, v34, 26.0);
v36(v35, v84);
v37 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v35 + 480);
LOWORD(v84[0]) = 13405;
BYTE2(v84[0]) = 31;
v37(v35, v84);
v38 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v35 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v84, v32 + (float)(v34 * 0.5), v15);
v38(v35, v84);
(*(void (__fastcall **)(_DWORD, int, _DWORD))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v35, 0);
v39 = (char *)v78[v27];
v40 = CCTextInputNode::create(
COERCE_CCTEXTINPUTNODE_(v34 - 10.0),
26.0,
v39,
"Thonburi",
(const char *)&dword_18,
"bigFont.fnt",
v61);
CCTextInputNode::setMaxLabelScale((unsigned int)v40, 0.5);
CCTextInputNode::setMaxLabelWidth((unsigned int)v40, v34 - 14.0);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v40[104] + 172))(v40[104], 0);
if ( v27 )
v41 = 2;
else
v41 = 4;
v40[106] = v41;
LOWORD(v69) = 27843;
BYTE2(v69) = 65;
CCTextInputNode::setLabelPlaceholderColor((unsigned int)v40, v69);
CCTextInputNode::setLabelPlaceholderScale((unsigned int)v40, 0.5);
v67 = *(void (__fastcall **)(int *, int))(*v40 + 92);
v42 = (*(int (__fastcall **)(int))(*(_DWORD *)v35 + 96))(v35);
v67(v40, v42);
v81 = 0;
v82 = 0;
v83 = 0;
std::string::__init(&v81, "0123456789", 0xAu);
CCTextInputNode::setAllowedChars((int)v40, (unsigned __int8 *)&v81);
std::string::~string((int)&v81);
v40[126] = 3;
v43 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)v77[v27]);
CString = (const char *)cocos2d::CCString::getCString(v43);
v81 = 0;
v82 = 0;
v83 = 0;
v68 = CString;
v45 = strlen(CString);
std::string::__init(&v81, v68, v45);
CCTextInputNode::setString((int)v40, (int)&v81);
std::string::~string((int)&v81);
v40[105] = (int)this + 440;
(*(void (__fastcall **)(_DWORD, int *, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v40, 5);
v80[v27++] = (CCTextInputNode *)v40;
v47 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)v39, "chatFont.fnt", v46);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v47 + 80))(v47, 1056964608);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v47 + 512))(v47, 160);
v48 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v47 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v84, v32 + (float)(v34 * 0.5), v15 + 20.0);
v48(v47, v84);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v47, 1);
v32 = v32 + (float)(v34 + 6.0);
}
while ( v27 != 3 );
v49 = *((_DWORD *)this + 183);
v50 = v80[0];
*((CCTextInputNode **)this + 181) = v80[1];
v51 = v80[2];
*((_DWORD *)this + 180) = v50;
*((_DWORD *)this + 182) = v51;
CCTextInputNode::setWheelRange((int)v50, 2000.0, (float)v49);
CCTextInputNode::setWheelRange(*((_DWORD *)this + 181), 1.0, 12.0);
ThreadSearchPopup::clampDayField((int)this, v52, v53, v54);
v55 = ButtonSprite::create(
(ButtonSprite *)"Go",
(const char *)&dword_44 + 2,
0,
0.55,
1,
"bigFont.fnt",
"GJ_button_01.png",
(const char *)0x41E00000,
v64);
v84[0] = ThreadSearchPopup::onGoToDate;
v84[1] = 0;
v56 = CCMenuItemSpriteExtra::create((int)v55, 0, (int)this, (int)ThreadSearchPopup::onGoToDate, 0);
CCMenuItemSpriteExtra::setSizeMult(v56, 1.1);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v56);
v57 = *((const cocos2d::CCPoint **)this + 111);
v58 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v56 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, v16, v15);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v73, v57);
v58(v56, v73);
return v62;
}