//
// LikeItemLayer::init from 0x14032de60 to 0x14032e223 (963 bytes)
//
// 4 xrefs:
// > LikeItemLayer::create @ 0x14032de21
// > ??> @ 0x140693be0
// > ??> @ 0x140693bf0
// > ??> @ 0x1406d4f58
//
// 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
//
bool LikeItemLayer::init(LikeItemLayer *a1, LikeItemType a2, int a3, int a4)
{
bool result; // al
__int64 v9; // rcx
cocos2d::CCDirector *v10; // rax
struct cocos2d::CCRect *v11; // rax
struct cocos2d::extension::CCScale9Sprite *v12; // rdi
cocos2d::extension::CCScale9Sprite_vtbl *v13; // rbx
const cocos2d::CCSize *v14; // rax
float v15; // xmm0_4
cocos2d::extension::CCScale9Sprite_vtbl *v16; // rbx
const cocos2d::CCPoint *v17; // rax
__int64 v18; // rcx
cocos2d::CCMenu *v19; // rax
cocos2d::CCLayer *m_mainLayer; // rcx
struct cocos2d::CCSprite *v21; // rbx
CCMenuItemSpriteExtra *v22; // rdi
float v23; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v24; // rbx
struct cocos2d::CCPoint v25; // rax
struct cocos2d::CCSprite *v26; // rbx
CCMenuItemSpriteExtra *v27; // rdi
struct cocos2d::CCSprite *v28; // rbx
CCMenuItemSpriteExtra *v29; // rsi
float v30; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v31; // rbx
struct cocos2d::CCPoint v32; // rax
float v33; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v34; // rbx
double v35; // xmm0_8
struct cocos2d::CCPoint v36; // rax
struct cocos2d::CCLabelBMFont *v37; // rdi
cocos2d::CCLabelBMFont_vtbl *v38; // rbx
const cocos2d::CCPoint *v39; // rax
float v40; // [rsp+30h] [rbp-38h]
cocos2d::CCSize v41; // [rsp+38h] [rbp-30h] BYREF
cocos2d::CCRect v42; // [rsp+40h] [rbp-28h] BYREF
result = FLAlertLayer::init_1(a1, 75);
if ( result )
{
a1->m_itemType = a2;
a1->m_itemID = a3;
a1->m_commentSourceID = a4;
v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v9);
cocos2d::CCDirector::getWinSize(v10);
cocos2d::CCRect::CCRect(&v42, 0.0, 0.0, 80.0, 80.0);
v12 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v11);
v13 = v12->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize(&v41, 200.0, 115.0);
v13->setContentSize(v12, v14);
v15 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v12,
0xFFFFFFFFLL);
v16 = v12->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v15, v40 * 0.5);
v16->setPosition_0(v12, v17);
v19 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(v18);
m_mainLayer = a1->m_mainLayer;
a1->m_buttonMenu = v19;
m_mainLayer->addChild_0(m_mainLayer, v19, 10);
v21 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v21->setScale_0)(v21);
v22 = CCMenuItemSpriteExtra::create(v21, nullptr, a1, (cocos2d::SEL_MenuHandler *)AudioAssetsBrowser::onClose);
HIDWORD(v22->m_pfnSelector.adj) = 1069547520;
v23 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v22);
v24 = v22->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v23, (float)((float)(v40 * 0.5) - 100.0) + 5.0);
v25 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v42.origin);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v24->setPosition_0)(v22, v25);
v26 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_likeBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v26->setScale_0)(v26);
v27 = CCMenuItemSpriteExtra::create(v26, nullptr, a1, (cocos2d::SEL_MenuHandler *)LikeItemLayer::onLike);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v27);
v28 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_dislikeBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v28->setScale_0)(v28);
v29 = CCMenuItemSpriteExtra::create(v28, nullptr, a1, (cocos2d::SEL_MenuHandler *)LikeItemLayer::onDislike);
v30 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v29);
v31 = v27->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v30, (float)(v40 * 0.5) - 43.0);
v32 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v41);
v33 = ((float (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v31->setPosition_0)(v27, v32);
v34 = v29->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v35 = cocos2d::CCPoint::CCPoint(v33, (float)(v40 * 0.5) + 43.0);
v36 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v41);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v34->setPosition_0)(v29, v36);
v37 = cocos2d::CCLabelBMFont::create("Vote", (const char *)&qword_14052A4D8);
v38 = v37->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v35, v40 * 0.5);
v38->setPosition_0(v37, v39);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v37);
return 1;
}
return result;
}