//
// GJGarageLayer::showUnlockPopup from 0x140277c00 to 0x140278309 (1801 bytes)
//
// 2 xrefs:
// > ??> @ 0x14056adf8
// > ??> @ 0x1406d0fe0
//
// 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=13
void GJGarageLayer::showUnlockPopup(GJGarageLayer *a1, int a2, UnlockType a3)
{
cocos2d::CCArray *v4; // rbx
char *v5; // rax
char *v6; // rax
char *v7; // rax
char *v8; // rax
char *v9; // rax
char *v10; // rax
DialogLayer *DialogLayer; // rdi
bool *p_m_videoPlaying; // rcx
cocos2d::CCDirector *v13; // rax
cocos2d::CCLayer_vtbl *v14; // rbx
const cocos2d::CCPoint *v15; // rax
_BOOL8 v16; // rdx
float v17; // xmm1_4
double v18; // xmm0_8
cocos2d::CCLayer_vtbl *v19; // rbx
const cocos2d::CCPoint *v20; // rax
struct cocos2d::CCMoveTo *v21; // rax
struct cocos2d::CCEaseElasticOut *v22; // rax
cocos2d::ccColor3B *v23; // r8
float v24; // xmm6_4
struct cocos2d::CCFadeTo *v25; // rax
cocos2d::ccColor3B *v26; // r8
ItemInfoPopup *v27; // rax
float v28; // [rsp+20h] [rbp-49h]
float v29; // [rsp+20h] [rbp-49h]
__int16 v30; // [rsp+30h] [rbp-39h] BYREF
char v31; // [rsp+32h] [rbp-37h]
__int128 *v32; // [rsp+40h] [rbp-29h] BYREF
char v33[8]; // [rsp+48h] [rbp-21h] BYREF
__int64 v34; // [rsp+50h] [rbp-19h]
__int64 v35; // [rsp+58h] [rbp-11h]
__int64 v36; // [rsp+60h] [rbp-9h]
__int128 v37; // [rsp+68h] [rbp-1h] BYREF
__int64 v38; // [rsp+78h] [rbp+Fh]
__int64 v39; // [rsp+80h] [rbp+17h]
if ( a3 == 1 && a2 == 13 )
{
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v32 = &v37;
v30 = -1;
v31 = -1;
v37 = 0;
v38 = 0;
v39 = 15;
*(_QWORD *)&v37 = sub_14003AA10(0x20u);
v38 = 17;
v39 = 31;
strcpy((char *)v37, "Hey, over here...");
v34 = 0;
v35 = 7;
v36 = 15;
strcpy(v33, "Scratch");
v5 = DialogObject::create((__int64)v33, (__int64)&v37, 10, 0.80000001, 0, (__int64)&v30);
cocos2d::CCArray::addObject(v4, (struct cocos2d::CCObject *)v5);
v32 = &v37;
v30 = -1;
v31 = -1;
v37 = 0;
v38 = 0;
v39 = 15;
*(_QWORD *)&v37 = sub_14003AA10(0x40u);
v38 = 48;
v39 = 63;
strcpy((char *)v37, "I've been watching you, and you got some skills.");
v34 = 0;
v35 = 7;
v36 = 15;
strcpy(v33, "Scratch");
v6 = DialogObject::create((__int64)v33, (__int64)&v37, 13, 1.0, 0, (__int64)&v30);
cocos2d::CCArray::addObject(v4, (struct cocos2d::CCObject *)v6);
v32 = &v37;
v30 = -1;
v31 = -1;
v37 = 0;
v38 = 0;
v39 = 15;
*(_QWORD *)&v37 = sub_14003AA10(0x30u);
v38 = 44;
v39 = 47;
strcpy((char *)v37, "Whatever you need, Scratch's got it.");
v34 = 0;
v35 = 7;
v36 = 15;
strcpy(v33, "Scratch");
v7 = DialogObject::create((__int64)v33, (__int64)&v37, 10, 1.0, 0, (__int64)&v30);
cocos2d::CCArray::addObject(v4, (struct cocos2d::CCObject *)v7);
v32 = &v37;
v30 = -1;
v31 = -1;
v37 = 0;
v38 = 0;
v39 = 15;
*(_QWORD *)&v37 = sub_14003AA10(0x40u);
v38 = 48;
v39 = 63;
strcpy((char *)v37, "Here's a free sample. Come find me when you can.");
v34 = 0;
v35 = 7;
v36 = 15;
strcpy(v33, "Scratch");
v8 = DialogObject::create((__int64)v33, (__int64)&v37, 8, 1.0, 0, (__int64)&v30);
cocos2d::CCArray::addObject(v4, (struct cocos2d::CCObject *)v8);
v32 = &v37;
v30 = -1;
v31 = -1;
v37 = 0;
v38 = 0;
v39 = 15;
*(_QWORD *)&v37 = sub_14003AA10(0x20u);
v38 = 23;
v39 = 31;
strcpy((char *)v37, "Did you hear something?");
v34 = 0;
v35 = 7;
v36 = 15;
strcpy(v33, "Scratch");
v9 = DialogObject::create((__int64)v33, (__int64)&v37, 9, 1.0, 0, (__int64)&v30);
cocos2d::CCArray::addObject(v4, (struct cocos2d::CCObject *)v9);
v32 = &v37;
v30 = -1;
v31 = -1;
v37 = 0;
v38 = 0;
v39 = 15;
*(_QWORD *)&v37 = sub_14003AA10(0x20u);
v38 = 21;
v39 = 31;
strcpy((char *)v37, "...");
v34 = 0;
v35 = 7;
v36 = 15;
strcpy(v33, "Scratch");
v10 = DialogObject::create((__int64)v33, (__int64)&v37, 8, 1.0, 0, (__int64)&v30);
cocos2d::CCArray::addObject(v4, (struct cocos2d::CCObject *)v10);
DialogLayer = DialogLayer::createDialogLayer(nullptr, v4, 2);
(*(void (__fastcall **)(float *, DialogLayer *, __int64))(*(_QWORD *)&a1[-1].m_sTransform.ty + 440LL))(
&a1[-1].m_sTransform.ty,
DialogLayer,
100);
p_m_videoPlaying = &a1[-1].m_videoPlaying;
if ( a1 == (GJGarageLayer *)448 )
p_m_videoPlaying = nullptr;
DialogLayer->m_delegate = (DialogDelegate *)p_m_videoPlaying;
v13 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(p_m_videoPlaying);
cocos2d::CCDirector::getWinSize(v13);
v14 = DialogLayer->m_mainLayer->__vftable;
cocos2d::CCPoint::CCPoint(0.0000000025668347, *(float *)&v32 * 0.5);
v14->setPosition_0(DialogLayer->m_mainLayer, v15);
LOBYTE(v16) = 1;
DialogLayer->setVisible(DialogLayer, v16);
v17 = sub_14003CF30();
DialogLayer->m_animateTime = v17;
DialogLayer->m_mainLayer->getPosition_0(DialogLayer->m_mainLayer);
v18 = cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32);
v19 = DialogLayer->m_mainLayer->__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v18, -191.0);
v19->setPosition_0(DialogLayer->m_mainLayer, v20);
v21 = cocos2d::CCMoveTo::create(0.5, (const struct cocos2d::CCPoint *)&v32);
v22 = cocos2d::CCEaseElasticOut::create(v21, 0.60000002);
cocos2d::CCNode::runAction((CCLightFlash *)DialogLayer->m_mainLayer, (cocos2d::CCPoint)v22, v23, 1.0, v28);
v24 = (float)DialogLayer->getOpacity(&DialogLayer->cocos2d::CCRGBAProtocol);
if ( v24 > 0.0 )
{
DialogLayer->setOpacity(&DialogLayer->cocos2d::CCRGBAProtocol, 0);
v25 = cocos2d::CCFadeTo::create(0.14, (int)v24);
cocos2d::CCNode::runAction((CCLightFlash *)DialogLayer, (cocos2d::CCPoint)v25, v26, 1.0, v29);
}
}
else
{
v27 = ItemInfoPopup::create(a2, a3);
v27->show(v27);
}
}