//
// SetTextPopup::addPathLabel from 0x5d5d4c to 0x5d5e8c (320 bytes)
//
// 1 xrefs:
// > SFXBrowser::cellPerformedAction @ 0x6c9304
//
// 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:54:08 +0000
//
int __fastcall SetTextPopup::addPathLabel(int a1, unsigned __int8 *a2)
{
int v4; // r3
cocos2d::CCLabelBMFont *v5; // r0
cocos2d::CCLabelBMFont *v6; // r4
int i; // r5
void (__fastcall *v8)(cocos2d::CCLabelBMFont *, _BYTE *); // r7
void (__fastcall *v10)(cocos2d::CCLabelBMFont *, char *); // r10
char *v11; // r1
float v12[2]; // [sp+0h] [bp-24h] BYREF
_BYTE v13[8]; // [sp+8h] [bp-1Ch] BYREF
int v14[3]; // [sp+10h] [bp-14h] BYREF
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)a1);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v12);
v4 = *a2;
if ( (v4 & 1) != 0 )
v5 = *((cocos2d::CCLabelBMFont **)a2 + 2);
else
v5 = (cocos2d::CCLabelBMFont *)(a2 + 1);
v6 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v5, "chatFont.fnt", (const char *)(v4 << 31));
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, int))(*(_DWORD *)v6 + 512))(v6, 200);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, void *))(*(_DWORD *)v6 + 536))(v6, &unk_BEE20E);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, int))(*(_DWORD *)v6 + 80))(v6, 1058642330);
for ( i = GameToolbox::pathSegmentCount(a2, " / ") - 1;
i > 0
&& (float)(*(float *)(*(int (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_DWORD *)v6 + 164))(v6) * 0.6) > 280.0;
--i )
{
v10 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, char *))(*(_DWORD *)v6 + 464);
GameToolbox::keepLastPathSegments(v14, a2, " / ", i);
if ( (v14[0] & 1) != 0 )
v11 = (char *)v14[2];
else
v11 = (char *)v14 + 1;
v10(v6, v11);
std::string::~string((int)v14);
}
cocos2d::CCLabelBMFont::limitLabelWidth(v6, 280.0, 0.6, 0.3);
v8 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, _BYTE *))(*(_DWORD *)v6 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v13,
v12[0] * 0.5,
(float)((float)(v12[1] * 0.5) - 22.0) + *(float *)(a1 + 532));
v8(v6, v13);
return (*(int (__fastcall **)(_DWORD, cocos2d::CCLabelBMFont *))(**(_DWORD **)(a1 + 460) + 228))(
*(_DWORD *)(a1 + 460),
v6);
}