// // RateLevelLayer::init from 0x1403c9780 to 0x1403c9c8f (1295 bytes) // // 2 xrefs: // > LevelInfoLayer::onRate @ 0x1402fe1af // > @ 0x1406d7a30 // // 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 bool RateLevelLayer::init(RateLevelLayer *a1, int a2) { bool result; // al __int64 v5; // rcx cocos2d::CCDirector *v6; // rax struct cocos2d::CCRect *v7; // rax struct cocos2d::extension::CCScale9Sprite *v8; // rdi cocos2d::extension::CCScale9Sprite_vtbl *v9; // rbx const cocos2d::CCSize *v10; // rax float v11; // xmm0_4 cocos2d::extension::CCScale9Sprite_vtbl *v12; // rbx double v13; // xmm0_8 const cocos2d::CCPoint *v14; // rax struct cocos2d::CCLabelBMFont *v15; // rdi cocos2d::CCLabelBMFont_vtbl *v16; // rbx double v17; // xmm0_8 const cocos2d::CCPoint *v18; // rax __int64 v19; // rcx cocos2d::CCArray *v20; // rax __int64 v21; // rcx cocos2d::CCArray *v22; // rbp __int64 v23; // rcx cocos2d::CCMenu *v24; // rax int i; // edi cocos2d::CCString *v26; // rax const char *CString; // rax const char *v28; // rcx struct cocos2d::CCSprite *v29; // r14 CCMenuItemSpriteExtra *v30; // rax cocos2d::CCNode *v31; // rbx double v32; // xmm0_8 struct cocos2d::CCPoint v33; // rax ButtonSprite *v34; // rdi CCMenuItemSpriteExtra *v35; // rbx ButtonSprite *v36; // rdi CCMenuItemSpriteExtra *v37; // rbx struct cocos2d::CCPoint v38; // rax cocos2d::CCRect v39; // [rsp+40h] [rbp-68h] BYREF float v40; // [rsp+C0h] [rbp+18h] CCMenuItemSpriteExtra *v41; // [rsp+C8h] [rbp+20h] BYREF result = FLAlertLayer::init_1(a1, 75); if ( !result ) return result; a1->m_levelID = a2; v6 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v5); cocos2d::CCDirector::getWinSize(v6); cocos2d::CCRect::CCRect(&v39, 0.0, 0.0, 80.0, 80.0); v8 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v7); v9 = v8->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v41, 360.0, 180.0); v9->setContentSize(v8, v10); v11 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v8, 0xFFFFFFFFLL); v12 = v8->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; v13 = cocos2d::CCPoint::CCPoint(v11, v40 * 0.5); v12->setPosition_0(v8, v14); v15 = cocos2d::CCLabelBMFont::create("Rate Difficulty", (const char *)&qword_14052A4D8); v16 = v15->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; v17 = cocos2d::CCPoint::CCPoint(*(float *)&v13, v40 * 0.5); v16->setPosition_0(v15, v18); a1->m_mainLayer->addChild_1(a1->m_mainLayer, v15); v20 = (cocos2d::CCArray *)cocos2d::CCArray::create(v19); a1->m_difficulties = v20; cocos2d::CCObject::retain(v20); v22 = (cocos2d::CCArray *)cocos2d::CCArray::create(v21); v24 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(v23); a1->m_buttonMenu = v24; a1->m_mainLayer->addChild_0(a1->m_mainLayer, v24, 10); for ( i = 0; i <= 6; ++i ) { v26 = cocos2d::CCString::createWithFormat("difficulty_%02d_btn_001.png", i); CString = cocos2d::CCString::getCString(v26); v28 = "difficulty_auto_btn_001.png"; if ( i ) v28 = CString; v29 = cocos2d::CCSprite::createWithSpriteFrameName(v28); cocos2d::CCArray::addObject(a1->m_difficulties, v29); ((void (__fastcall *)(struct cocos2d::CCSprite *))v29->setScale_0)(v29); v41 = (CCMenuItemSpriteExtra *)operator new(0x208u); v30 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v41); v31 = v30; if ( v30 ) { if ( CCMenuItemSpriteExtra::init(v30, v29, nullptr, a1, (cocos2d::SEL_MenuHandler *)RateLevelLayer::selectRating) ) { cocos2d::CCObject::autorelease(v31); goto LABEL_10; } ((void (__fastcall *)(cocos2d::CCNode *, __int64))v31->~CCNode)(v31, 1); } v31 = nullptr; LABEL_10: v31->setTag(v31, i); a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v31); cocos2d::CCArray::addObject(v22, v31); } v32 = cocos2d::CCPoint::CCPoint(*(float *)&v17, v40 * 0.5); v33 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v39.origin); GameToolbox::alignItemsHorisontally(v22, 16.0, v33, 0); cocos2d::CCArray::removeAllObjects(v22); v34 = ButtonSprite::create_1("Cancel", 0, 0, 1.0, 0, "goldFont.fnt", "GJ_button_01.png", 0.0); v41 = (CCMenuItemSpriteExtra *)operator new(0x208u); v35 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v41); if ( v35 ) { if ( CCMenuItemSpriteExtra::init(v35, v34, nullptr, a1, (cocos2d::SEL_MenuHandler *)RateLevelLayer::onClose) ) { cocos2d::CCObject::autorelease(v35); goto LABEL_16; } ((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v35->~CCMenuItemSpriteExtra)(v35, 1); } v35 = nullptr; LABEL_16: a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v35); cocos2d::CCArray::addObject(v22, v35); v36 = ButtonSprite::create_1("Submit", 0, 0, 1.0, 0, "goldFont.fnt", "GJ_button_01.png", 0.0); v41 = (CCMenuItemSpriteExtra *)operator new(0x208u); v37 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v41); if ( v37 ) { if ( CCMenuItemSpriteExtra::init(v37, v36, nullptr, a1, (cocos2d::SEL_MenuHandler *)RateLevelLayer::onRate) ) { cocos2d::CCObject::autorelease(v37); goto LABEL_21; } ((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v37->~CCMenuItemSpriteExtra)(v37, 1); } v37 = nullptr; LABEL_21: a1->m_submitButton = v37; a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v37); cocos2d::CCArray::addObject(v22, a1->m_submitButton); cocos2d::CCPoint::CCPoint(*(float *)&v32, v40 * 0.5); v38 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v39.origin); GameToolbox::alignItemsHorisontally(v22, 15.0, v38, 0); RateLevelLayer::selectRating(a1, nullptr); return 1; }
GD Web Decomp Icon

GD Web Decomp

Raw Source