//
// LevelCell::loadFromLevel from 0x612638 to 0x61280c (468 bytes)
//
// 3 xrefs:
// > CustomListView::loadCell @ 0x62071c
// > DailyLevelNode::init @ 0x913a80
// > ??> @ 0x3dae8
//
// 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
//
void LevelCell::loadFromLevel(LevelCell *a1, GJGameLevel *a2)
{
cocos2d::CCMenuItem *v4; // x1
cocos2d::CCMenu *v5; // x0
GJLevelType m_levelType; // w0
cocos2d::CCSprite *v7; // x26
cocos2d::CCSprite *v8; // x25
CCMenuItemToggler *v9; // x0
CCMenuItemToggler *m_toggler; // x25
cocos2d::CCMenu *m_mainMenu; // x26
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
cocos2d::CCPoint v13; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCPoint v14; // [xsp+78h] [xbp+78h] BYREF
_BYTE v15[8]; // [xsp+80h] [xbp+80h] BYREF
cocos2d::CCPoint v16; // 0:kr00_8.8
cocos2d::SEL_MenuHandler v17; // 0:x3.16
a1->m_mainLayer->removeAllChildrenWithCleanup(a1->m_mainLayer, 1);
v5 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(nullptr, v4);
a1->m_mainMenu = v5;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v5, 3);
m_levelType = a2->m_levelType;
a1->m_level = a2;
if ( m_levelType == Editor )
LevelCell::loadLocalLevelCell(a1);
else
LevelCell::loadCustomLevelCell(a1);
if ( a1->m_level->m_localOrSaved && !a1->m_compactView )
{
v7 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v8 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
v7->setScale(v7, 0.6);
v8->setScale(v8, 0.6);
v17.adj = 0;
v17.ptr = (void (__cdecl *)(cocos2d::CCObject *))LevelCell::onToggle;
v9 = CCMenuItemToggler::create(v8, v7, a1, v17);
a1->m_toggler = v9;
CCMenuItemToggler::toggle(v9, a2->m_selected);
CCMenuItemToggler::setSizeMult(a1->m_toggler, 1.2);
a1->m_mainMenu->addChild(a1->m_mainMenu, a1->m_toggler);
m_toggler = a1->m_toggler;
m_mainMenu = a1->m_mainMenu;
setPosition = m_toggler->setPosition;
cocos2d::CCPoint::CCPoint(&v13, -50.0, 0.0);
cocos2d::CCPoint::operator+(&v14, &a1->m_point, &v13);
v16 = cocos2d::CCNode::convertToNodeSpace(m_mainMenu, &v14);
((void (__fastcall *)(CCMenuItemToggler *, _BYTE *, float, float))setPosition)(m_toggler, v15, v16.x, v16.y);
}
}