//
// DailyLevelPage::createDailyNode from 0x1400d0270 to 0x1400d0553 (739 bytes)
//
// 6 xrefs:
// > CreatorLayer::sceneWillResume @ 0x14009f98c
// > DailyLevelPage::init @ 0x1400cf78d
// > DailyLevelPage::levelDownloadFinished @ 0x1400d000f
// > DailyLevelPage::createNodeIfLoaded @ 0x1400d0245
// > DailyLevelPage::claimLevelReward @ 0x1400d1d89
// > ??> @ 0x1406c8574
//
// 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=3
void DailyLevelPage::createDailyNode(DailyLevelPage *a1, GJGameLevel *a2, bool a3, float a4, bool a5)
{
cocos2d::CCDirector *v8; // rax
DailyLevelNode *v9; // rsi
int v10; // edi
DailyLevelNode_vtbl *v11; // rbx
const cocos2d::CCPoint *v12; // rax
_DWORD *v13; // rdx
GJTimedLevelType m_type; // ecx
__int32 v15; // ecx
CCMenuItemSpriteExtra *m_skipButton; // rcx
GJGameLevel *m_level; // rdx
__int64 v18; // rdx
const struct cocos2d::CCPoint *v19; // rax
DailyLevelNode_vtbl *v20; // rbx
__int64 v21; // rcx
cocos2d::CCDirector *v22; // rax
float v23; // xmm0_4
const cocos2d::CCPoint *v24; // rax
struct cocos2d::CCDelayTime *v25; // rdi
__int64 v26; // rbx
struct cocos2d::CCMoveTo *v27; // rax
struct cocos2d::CCEaseElasticOut *v28; // rax
struct cocos2d::CCSequence *v29; // rax
cocos2d::ccColor3B *v30; // r8
DailyLevelNode *v31; // [rsp+20h] [rbp-38h] BYREF
cocos2d::CCPoint v32; // [rsp+28h] [rbp-30h] BYREF
float v33; // [rsp+60h] [rbp+8h]
float v34; // [rsp+64h] [rbp+Ch]
if ( !a1->m_dailyNode )
{
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v8);
v9 = (DailyLevelNode *)operator new(0x178u);
v31 = v9;
cocos2d::CCNode::CCNode(v9);
v9->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (DailyLevelNode_vtbl *)&DailyLevelNode::`vftable';
v9->FLAlertLayerProtocol::__vftable = (FLAlertLayerProtocol_vtbl *)&DailyLevelNode::`vftable';
v10 = 0;
v9->m_level = nullptr;
v9->m_page = nullptr;
v9->m_timeLabel = nullptr;
cocos2d::CCPoint::CCPoint(&v9->m_unkPoint);
*(_WORD *)&v9->m_unkBool = 0;
if ( DailyLevelNode::init(v9, a2, a1, a5) )
{
cocos2d::CCObject::autorelease(v9);
}
else
{
((void (__fastcall *)(DailyLevelNode *, __int64))v9->~DailyLevelNode)(v9, 1);
v9 = nullptr;
}
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v9);
v11 = v9->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, v33 * 0.5, (float)(v34 * 0.5) - 8.0);
v11->setPosition_0(v9, v12);
if ( a2 )
{
v13 = (_DWORD *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v32 = (cocos2d::CCPoint)operator new(0x3D0u);
qword_1406C2EC0 = ((__int64 (__fastcall *)(_QWORD))sub_140141280)(v32);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v13 = (_DWORD *)qword_1406C2EC0;
}
m_type = a1->m_type;
if ( m_type )
{
v15 = m_type - 1;
if ( v15 )
{
if ( v15 == 1 )
v10 = v13[119];
}
else
{
v10 = v13[116];
}
}
else
{
v10 = v13[113];
}
if ( v10 > a2->m_dailyID.random - a2->m_dailyID.seed )
{
m_skipButton = v9->m_skipButton;
if ( m_skipButton )
{
m_level = v9->m_level;
if ( !m_level || m_level->m_orbCompletion.random - m_level->m_orbCompletion.seed < 100 )
{
LOBYTE(m_level) = 1;
m_skipButton->setVisible(m_skipButton, (bool)m_level);
LOBYTE(v18) = 1;
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v9->m_skipButton->__vftable[1].update)(
v9->m_skipButton,
v18);
}
}
}
}
if ( !a3 )
{
v9->setVisible(v9, 0);
v19 = v9->getPosition_0(v9);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, v19);
v20 = v9->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v22 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v21);
v23 = cocos2d::CCDirector::getScreenRight(v22) + 180.0;
cocos2d::CCPoint::CCPoint(&v32, v23, *((float *)&v31 + 1));
v20->setPosition_0(v9, v24);
v25 = cocos2d::CCDelayTime::create(a4);
v26 = cocos2d::CCShow::create();
v27 = cocos2d::CCMoveTo::create(0.5, (const struct cocos2d::CCPoint *)&v31);
v28 = cocos2d::CCEaseElasticOut::create(v27, 0.60000002);
v29 = cocos2d::CCSequence::create(v25, v26, v28, 0);
cocos2d::CCNode::runAction((CCLightFlash *)v9, (cocos2d::CCPoint)v29, v30, a4, *(float *)&v31);
}
a1->m_dailyNode = v9;
}
}