// // UIOptionsLayer::init from 0x4b1c50 to 0x4b2c36 (4070 bytes) // // 1 xrefs: // > UIOptionsLayer::create @ 0x4b2cf0 // // 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 UIOptionsLayer::init(UIOptionsLayer *a1, bool a2) { void (__fastcall *setColor)(cocos2d::CCLayerColor *__hidden, const cocos2d::ccColor3B *); // r3 cocos2d::CCDirector *v5; // r0 cocos2d::CCMenu *v6; // r0 ButtonSprite *v7; // r0 CCMenuItemSpriteExtra *v8; // r5 cocos2d::CCMenu *m_buttonMenu; // r9 void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7 ButtonSprite *v11; // r0 CCMenuItemSpriteExtra *v12; // r11 int v13; // r9 cocos2d::CCSprite *v14; // r8 CCMenuItemSpriteExtra *v15; // r11 GameManager *v16; // r0 GJUINode *v17; // r0 UIOptionsLayer_vtbl *v18; // r3 GJUINode *v19; // r0 GJUINode_vtbl *v20; // r3 cocos2d::CCLabelBMFont *v21; // r0 cocos2d::CCLabelBMFont_vtbl *v22; // r3 void (__fastcall *v23)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10 GameManager *v24; // r0 GJUINode *v25; // r0 UIOptionsLayer_vtbl *v26; // r3 GJUINode *m_uiNode1; // r0 GJUINode_vtbl *v28; // r3 GameManager *v29; // r0 GJUINode *v30; // r0 UIOptionsLayer_vtbl *v31; // r3 GJUINode *m_uiNode2; // r0 float width; // s17 void (__fastcall *v34)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9 float *v35; // r0 GJUINode *v36; // r8 float v37; // s15 int v38; // r0 GJUINode *v39; // r0 GJUINode_vtbl *v40; // r3 GameManager *v41; // r0 GJUINode *v42; // r0 UIOptionsLayer_vtbl *v43; // r3 GJUINode *m_uiNode3; // r0 GJUINode_vtbl *v45; // r3 GameManager *v46; // r0 GJUINode *v47; // r0 UIOptionsLayer_vtbl *v48; // r3 GJUINode *m_uiNode4; // r0 float v50; // s17 void (__fastcall *v51)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9 float *v52; // r0 GJUINode *v53; // r8 float v54; // s15 int v55; // r0 float v57; // [sp+10h] [bp-7Ch] float v58; // [sp+10h] [bp-7Ch] _BOOL4 v59; // [sp+30h] [bp-5Ch] void (__fastcall *v60)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+34h] [bp-58h] void (__fastcall *v61)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+34h] [bp-58h] cocos2d::CCLabelBMFont *m_nameLabel; // [sp+34h] [bp-58h] cocos2d::CCMenu *v63; // [sp+3Ch] [bp-50h] char v64[4]; // [sp+48h] [bp-44h] BYREF cocos2d::CCSize v65; // [sp+4Ch] [bp-40h] BYREF cocos2d::CCPoint v66; // [sp+54h] [bp-38h] BYREF cocos2d::CCPoint v67; // [sp+5Ch] [bp-30h] BYREF cocos2d::CCPoint v68; // [sp+64h] [bp-28h] BYREF int v69; // [sp+6Ch] [bp-20h] int v70; // [sp+70h] [bp-1Ch] cocos2d::CCPoint v71; // [sp+74h] [bp-18h] BYREF cocos2d::CCPoint v72; // [sp+7Ch] [bp-10h] BYREF v59 = SetupTriggerPopup::init(a1, nullptr, nullptr, 400.0, 280.0, 1); if ( v59 ) { a1->m_dual = a2; SetupTriggerPopup::preSetup(a1); setColor = a1->setColor; LOWORD(v72.x) = 17459; BYTE2(v72.x) = -103; setColor(a1, (const cocos2d::ccColor3B *)&v72); a1->setOpacity(a1, 255); a1->m_noElasticity = 1; v5 = cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize(&v65, v5); v6 = cocos2d::CCMenu::create(); a1->m_buttonMenu = v6; a1->m_mainLayer->addChild_0(a1->m_mainLayer, v6, 10); v7 = ButtonSprite::create( (ButtonSprite *)"OK", (const char *)&word_28, 0, 0.8, 1, "goldFont.fnt", "GJ_button_01.png", COERCE_CONST_CHAR_(30.0), v57); v69 = 660; v70 = 1; v8 = CCMenuItemSpriteExtra::create(v7, nullptr, (cocos2d::SEL_MenuHandler)((unsigned int)a1 | 0x29400000000LL)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v8); m_buttonMenu = a1->m_buttonMenu; setPosition = v8->setPosition; cocos2d::CCPoint::CCPoint(&v71, (float)(v65.width * 0.5) - 40.0, v65.height - 30.0); cocos2d::CCNode::convertToNodeSpace(&v72, m_buttonMenu, &v71); setPosition(v8, &v72); v11 = ButtonSprite::create( (ButtonSprite *)"Reset", (const char *)&word_28, 0, 0.8, 1, "goldFont.fnt", "GJ_button_05.png", COERCE_CONST_CHAR_(30.0), v58); LODWORD(v71.x) = UIOptionsLayer::onReset; v71.y = 0.0; v12 = CCMenuItemSpriteExtra::create( v11, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(UIOptionsLayer::onReset, (unsigned int)a1)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v12); v60 = v12->setPosition; v13 = (int)v8->getPosition(v8); cocos2d::CCPoint::CCPoint(&v68, 80.0, 0.0); cocos2d::CCPoint::operator+(&v72, v13, &v68); v60(v12, &v72); v14 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_optionsBtn_001.png"); ((void (__fastcall *)(cocos2d::CCSprite *, int))v14->setScale)(v14, 1058642330); LODWORD(v72.x) = UIOptionsLayer::onSaveLoad; v72.y = 0.0; v15 = CCMenuItemSpriteExtra::create( v14, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(UIOptionsLayer::onSaveLoad, (unsigned int)a1)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v15); v61 = v15->setPosition; v63 = a1->m_buttonMenu; cocos2d::CCPoint::CCPoint(&v66, 0.0, 0.0); cocos2d::CCPoint::CCPoint(&v67, v66.x + 30.0, v65.height - 30.0); cocos2d::CCNode::convertToNodeSpace(&v68, v63, &v67); v61(v15, &v68); SetupTriggerPopup::toggleBG(a1, 0); cocos2d::CCPoint::CCPoint(&v66, v65.width * 0.5, v65.height - 70.0); if ( a1->m_dual ) { v21 = cocos2d::CCLabelBMFont::create(); v22 = v21->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; a1->m_nameLabel = v21; ((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v22->setScale)(v21, 1058642330); a1->addChild(a1, a1->m_nameLabel); m_nameLabel = a1->m_nameLabel; v23 = m_nameLabel->setPosition; cocos2d::CCPoint::CCPoint(&v67, 0.0, 5.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); v23(m_nameLabel, &v68); v66.y = v66.y - 25.0; v24 = GameManager::sharedState(); v25 = GJUINode::create(&v24->m_dpad2); v26 = a1->SetupTriggerPopup::FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; a1->m_uiNode1 = v25; v26->addChild_0(a1, v25, 100); m_uiNode1 = a1->m_uiNode1; v28 = m_uiNode1->__vftable; m_uiNode1->m_drawLines = 1; v28->setTag(m_uiNode1, 1); v29 = GameManager::sharedState(); v30 = GJUINode::create(&v29->m_dpad3); v31 = a1->SetupTriggerPopup::FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; a1->m_uiNode2 = v30; v31->addChild_0(a1, v30, 100); m_uiNode2 = a1->m_uiNode2; width = v65.width; v34 = m_uiNode2->setPosition; v35 = (float *)m_uiNode2->getPosition(m_uiNode2); v36 = a1->m_uiNode2; v37 = *v35; v38 = (int)v36->getPosition(v36); cocos2d::CCPoint::CCPoint(&v68, width - v37, *(float *)(v38 + 4)); v34(v36, &v68); v39 = a1->m_uiNode2; v40 = v39->__vftable; v39->m_drawLines = 1; v40->setTag(v39, 2); v41 = GameManager::sharedState(); v42 = GJUINode::create(&v41->m_dpad4); v43 = a1->SetupTriggerPopup::FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; a1->m_uiNode3 = v42; v43->addChild_0(a1, v42, 100); m_uiNode3 = a1->m_uiNode3; v45 = m_uiNode3->__vftable; m_uiNode3->m_drawLines = 1; v45->setTag(m_uiNode3, 3); v46 = GameManager::sharedState(); v47 = GJUINode::create(&v46->m_dpad5); v48 = a1->SetupTriggerPopup::FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; a1->m_uiNode4 = v47; v48->addChild_0(a1, v47, 100); m_uiNode4 = a1->m_uiNode4; v50 = v65.width; v51 = m_uiNode4->setPosition; v52 = (float *)m_uiNode4->getPosition(m_uiNode4); v53 = a1->m_uiNode4; v54 = *v52; v55 = (int)v53->getPosition(v53); cocos2d::CCPoint::CCPoint(&v68, v50 - v54, *(float *)(v55 + 4)); v51(v53, &v68); v19 = a1->m_uiNode4; } else { v16 = GameManager::sharedState(); v17 = GJUINode::create(&v16->m_dpad1); v18 = a1->SetupTriggerPopup::FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; a1->m_uiNode1 = v17; v18->addChild_0(a1, v17, 100); v19 = a1->m_uiNode1; } v20 = v19->__vftable; v19->m_drawLines = 1; ((void (__fastcall *)(GJUINode *))v20->setTag)(v19); sub_776584((int)&v67, "Dual"); cocos2d::CCPoint::CCPoint(&v68, v65.width - 40.0, v65.height - 35.0); SetupTriggerPopup::createToggleValueControl((int)a1, -23, (int)&v67, (int)&v68, 1, 0, 0, 1.0); sub_774008(&v67); sub_776584((int)v64, "Width:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, 0.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -1, (int)v64, (int)&v68, 0.6, 0, 2, 4, 0, (cocos2d::CCFloat *)0x42480000, 400.0, 0, 1, 1, 0, 0); sub_774008(v64); sub_776584((int)v64, "Height:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -25.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -5, (int)v64, (int)&v68, 0.6, 0, 2, 4, 0, (cocos2d::CCFloat *)0x42480000, 400.0, 0, 1, 1, 0, 0); sub_774008(v64); sub_776584((int)v64, "Scale:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -50.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -9, (int)v64, (int)&v68, 0.6, 0, 1, 4, 0, (cocos2d::CCFloat *)0x3E4CCCCD, 2.0, 0, 1, 1, 2, 0); sub_774008(v64); sub_776584((int)v64, "Opacity:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -75.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -13, (int)v64, (int)&v68, 0.6, 0, 1, 4, 0, nullptr, 1.0, 0, 1, 1, 2, 0); sub_774008(v64); sub_776584((int)v64, "Deadzone:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -100.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -21, (int)v64, (int)&v68, 0.6, 0, 1, 4, 0, nullptr, 10.0, 0, 1, 1, 1, 0); sub_774008(v64); sub_776584((int)v64, "Radius:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -125.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -19, (int)v64, (int)&v68, 0.6, 0, 1, 4, 0, nullptr, 50.0, 0, 1, 1, 1, 0); sub_774008(v64); sub_776584((int)&v67, "ModeB"); cocos2d::CCPoint::CCPoint(&v68, (float)(v65.width * 0.5) - 160.0, v65.height - 35.0); SetupTriggerPopup::createToggleValueControl((int)a1, -17, (int)&v67, (int)&v68, 1, 0, 1, 1.0); sub_774008(&v67); sub_776584((int)&v67, "Snap"); cocos2d::CCPoint::CCPoint(&v68, (float)(v65.width * 0.5) - 110.0, v65.height - 35.0); SetupTriggerPopup::createToggleValueControl((int)a1, -24, (int)&v67, (int)&v68, 1, 0, 1, 1.0); sub_774008(&v67); sub_776584((int)&v67, "Split"); cocos2d::CCPoint::CCPoint(&v68, (float)(v65.width * 0.5) + 155.0, v65.height - 35.0); SetupTriggerPopup::createToggleValueControl((int)a1, -27, (int)&v67, (int)&v68, 1, 0, 1, 1.0); sub_774008(&v67); if ( !a1->m_dual ) { sub_776584((int)&v67, "JumpL"); cocos2d::CCPoint::CCPoint(&v68, (float)(v65.width * 0.5) + 110.0, v65.height - 35.0); SetupTriggerPopup::createToggleValueControl((int)a1, -26, (int)&v67, (int)&v68, 1, 0, 0, 1.0); sub_774008(&v67); } if ( a1->m_dual ) { sub_776584((int)v64, "Width:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, 0.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -3, (int)v64, (int)&v68, 0.6, 0, 2, 4, 0, (cocos2d::CCFloat *)0x42480000, 400.0, 0, 3, 1, 0, 0); sub_774008(v64); sub_776584((int)v64, "Height:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -25.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -7, (int)v64, (int)&v68, 0.6, 0, 2, 4, 0, (cocos2d::CCFloat *)0x42480000, 400.0, 0, 3, 1, 0, 0); sub_774008(v64); sub_776584((int)v64, "Scale:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -50.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -11, (int)v64, (int)&v68, 0.6, 0, 1, 4, 0, (cocos2d::CCFloat *)0x3E4CCCCD, 2.0, 0, 3, 1, 2, 0); sub_774008(v64); sub_776584((int)v64, "Opacity:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -75.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -15, (int)v64, (int)&v68, 0.6, 0, 1, 4, 0, nullptr, 1.0, 0, 3, 1, 2, 0); sub_774008(v64); sub_776584((int)v64, "Width:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -0.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -4, (int)v64, (int)&v68, 0.6, 0, 2, 4, 0, (cocos2d::CCFloat *)0x42480000, 400.0, 0, 4, 1, 0, 0); sub_774008(v64); sub_776584((int)v64, "Height:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -25.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -8, (int)v64, (int)&v68, 0.6, 0, 2, 4, 0, (cocos2d::CCFloat *)0x42480000, 400.0, 0, 4, 1, 0, 0); sub_774008(v64); sub_776584((int)v64, "Scale:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -50.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -12, (int)v64, (int)&v68, 0.6, 0, 1, 4, 0, (cocos2d::CCFloat *)0x3E4CCCCD, 2.0, 0, 4, 1, 2, 0); sub_774008(v64); sub_776584((int)v64, "Opacity:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -75.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -16, (int)v64, (int)&v68, 0.6, 0, 1, 4, 0, nullptr, 1.0, 0, 4, 1, 2, 0); sub_774008(v64); sub_776584((int)v64, "Width:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, 0.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -2, (int)v64, (int)&v68, 0.6, 0, 2, 4, 0, (cocos2d::CCFloat *)0x42480000, 400.0, 0, 2, 1, 0, 0); sub_774008(v64); sub_776584((int)v64, "Height:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -25.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -6, (int)v64, (int)&v68, 0.6, 0, 2, 4, 0, (cocos2d::CCFloat *)0x42480000, 400.0, 0, 2, 1, 0, 0); sub_774008(v64); sub_776584((int)v64, "Scale:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -50.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -10, (int)v64, (int)&v68, 0.6, 0, 1, 4, 0, (cocos2d::CCFloat *)0x3E4CCCCD, 2.0, 0, 2, 1, 2, 0); sub_774008(v64); sub_776584((int)v64, "Opacity:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -75.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -14, (int)v64, (int)&v68, 0.6, 0, 1, 4, 0, nullptr, 1.0, 0, 2, 1, 2, 0); sub_774008(v64); sub_776584((int)v64, "Deadzone:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -100.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -22, (int)v64, (int)&v68, 0.6, 0, 1, 4, 0, nullptr, 10.0, 0, 2, 1, 1, 0); sub_774008(v64); sub_776584((int)v64, "Radius:"); cocos2d::CCPoint::CCPoint(&v67, 0.0, -125.0); cocos2d::CCPoint::operator+(&v68, &v66, &v67); SetupTriggerPopup::createValueControlAdvanced( (int)a1, -20, (int)v64, (int)&v68, 0.6, 0, 1, 4, 0, nullptr, 50.0, 0, 2, 1, 1, 0); sub_774008(v64); sub_776584((int)&v67, "ModeB"); cocos2d::CCPoint::CCPoint(&v68, (float)(v65.width * 0.5) - 160.0, v65.height - 35.0); SetupTriggerPopup::createToggleValueControl((int)a1, -18, (int)&v67, (int)&v68, 1, 0, 2, 1.0); sub_774008(&v67); sub_776584((int)&v67, "Snap"); cocos2d::CCPoint::CCPoint(&v68, (float)(v65.width * 0.5) - 110.0, v65.height - 35.0); SetupTriggerPopup::createToggleValueControl((int)a1, -25, (int)&v67, (int)&v68, 1, 0, 2, 1.0); sub_774008(&v67); sub_776584((int)&v67, "Split"); cocos2d::CCPoint::CCPoint(&v68, (float)(v65.width * 0.5) + 155.0, v65.height - 35.0); SetupTriggerPopup::createToggleValueControl((int)a1, -28, (int)&v67, (int)&v68, 1, 0, 2, 1.0); sub_774008(&v67); } if ( a1->m_dual ) UIOptionsLayer::toggleUIGroup(a1, 1); SetupTriggerPopup::postSetup(a1); } return v59; }
GD Web Decomp Icon

GD Web Decomp

Raw Source