// // SetupCollisionTriggerPopup::init from 0x4f482c to 0x4f5042 (2070 bytes) // // 1 xrefs: // > SetupCollisionTriggerPopup::create @ 0x4f5114 // // 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 SetupCollisionTriggerPopup::init(SetupCollisionTriggerPopup *a1, EffectGameObject *a2, cocos2d::CCArray *a3) { cocos2d::CCDirector *v4; // r0 cocos2d::CCLabelBMFont *v5; // r6 void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9 ButtonSprite *v7; // r0 CCMenuItemSpriteExtra *v8; // r0 CCMenuItemSpriteExtra *v9; // r6 cocos2d::CCMenu *m_buttonMenu; // r8 void (__fastcall *v11)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7 int v12; // r2 bool v13; // r3 float *v14; // r3 int v15; // r2 bool v16; // r3 int v17; // r2 bool v18; // r3 cocos2d::CCLabelBMFont *v19; // r6 void (__fastcall *v20)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8 cocos2d::CCNode *v21; // r6 int (__fastcall *getTag)(const cocos2d::CCObject *__hidden); // r2 CCTextInputNode *v23; // r6 cocos2d::CCSprite *v24; // r7 CCMenuItemSpriteExtra *v25; // r7 void (__fastcall *v26)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9 cocos2d::CCSprite *v27; // r7 CCMenuItemSpriteExtra *v28; // r9 _BOOL4 v29; // r1 _BOOL4 m_activateGroup; // r6 _BOOL4 m_triggerOnExit; // r6 _BOOL4 m_targetP1; // r10 _BOOL4 m_targetPP; // r5 float v35; // [sp+10h] [bp-9Ch] int i; // [sp+10h] [bp-9Ch] _BOOL4 m_targetP2; // [sp+10h] [bp-9Ch] _BOOL4 v38; // [sp+1Ch] [bp-90h] void (__fastcall *v39)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+20h] [bp-8Ch] cocos2d::ccColor3B v40; // [sp+44h] [bp-68h] cocos2d::CCLabelBMFont *v41; // [sp+48h] [bp-64h] BYREF cocos2d::CCSize v42; // [sp+4Ch] [bp-60h] BYREF cocos2d::CCPoint v43; // [sp+54h] [bp-58h] BYREF cocos2d::CCPoint v44; // [sp+5Ch] [bp-50h] BYREF int v45; // [sp+64h] [bp-48h] int v46; // [sp+68h] [bp-44h] cocos2d::CCSize v47; // [sp+6Ch] [bp-40h] BYREF cocos2d::CCPoint v48; // [sp+74h] [bp-38h] BYREF cocos2d::CCPoint v49; // [sp+7Ch] [bp-30h] BYREF cocos2d::CCRect v50; // [sp+84h] [bp-28h] BYREF cocos2d::CCRect v51; // [sp+94h] [bp-18h] BYREF cocos2d::CCRect v52; // 0:r2.8,8:^0.8 v38 = SetupTriggerPopup::init(a1, a2, a3, 300.0, 280.0, 1); if ( v38 ) { a1->determineStartValues(a1); v4 = cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize(&v42, v4); v5 = cocos2d::CCLabelBMFont::create(); a1->m_mainLayer->addChild(a1->m_mainLayer, v5); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v5->setScale)(v5, 1060320051); setPosition = v5->setPosition; cocos2d::CCPoint::CCPoint( &v51.origin, v42.width * 0.5, (float)((float)(a1->m_height * 0.5) + (float)(v42.height * 0.5)) - 18.0); setPosition(v5, &v51.origin); v7 = ButtonSprite::create( (ButtonSprite *)"OK", (const char *)&word_28, 0, 0.8, 1, "goldFont.fnt", "GJ_button_01.png", COERCE_CONST_CHAR_(30.0), v35); v45 = 660; v46 = 1; v8 = CCMenuItemSpriteExtra::create(v7, nullptr, (cocos2d::SEL_MenuHandler)((unsigned int)a1 | 0x29400000000LL)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v8); sub_776584((int)&v50, "Help"); sub_776584( (int)&v51, "Disables Target ID when Collision Blocks using BlockA ID and BlockB ID collide. This condition is " "checked constantly. Make sure that one of the blocks have Dynamic Block enabled.\n" "Use Activate Group to activate and spawn instead.\n" "P1 and P2 makes collision trigger upon the respective player touching BlockB ID.\n" "PP triggers when both players collide.\n" "Trigger On Exit makes it activate after collision between the blocks ends and not when it starts. "); v9 = InfoAlertButton::create((int)&v50, (int)&v51, 1065353216); sub_774008(&v51); sub_774008(&v50); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v9); m_buttonMenu = a1->m_buttonMenu; v11 = v9->setPosition; cocos2d::CCPoint::CCPoint( &v50.origin, (float)((float)(v42.width * 0.5) - (float)(a1->m_width * 0.5)) + 18.0, (float)((float)(a1->m_height * 0.5) + (float)(v42.height * 0.5)) - 18.0); cocos2d::CCNode::convertToNodeSpace(&v51.origin, m_buttonMenu, &v50.origin); v11(v9, &v51.origin); a1->m_joystickConnected = -1; for ( i = 0; i != 3; ++i ) { sub_776584((int)&v41, (char *)&unk_939830); cocos2d::CCPoint::CCPoint(&v43); if ( i ) { if ( i == 1 ) { sub_7753D4((int)&v41, "BlockB ID"); cocos2d::CCPoint::CCPoint(&v51.origin, (float)(v42.width * 0.5) + 70.0, (float)(v42.height * 0.5) + 30.0); cocos2d::CCPoint::operator=((PlayerObject *)&v43, COERCE_FLOAT(&v51), v15, v16); v14 = (float *)&SetupCollisionTriggerPopup::onItemID2Arrow; } else { sub_7753D4((int)&v41, "Target ID"); cocos2d::CCPoint::CCPoint(&v51.origin, (float)(v42.width * 0.5) - 70.0, (float)(v42.height * 0.5) - 35.0); cocos2d::CCPoint::operator=((PlayerObject *)&v43, COERCE_FLOAT(&v51), v17, v18); v14 = (float *)&SetupCollisionTriggerPopup::onTargetIDArrow; } } else { sub_7753D4((int)&v41, "BlockA ID"); cocos2d::CCPoint::CCPoint(&v51.origin, (float)(v42.width * 0.5) - 70.0, (float)(v42.height * 0.5) + 30.0); cocos2d::CCPoint::operator=((PlayerObject *)&v43, COERCE_FLOAT(&v51), v12, v13); v14 = (float *)&SetupCollisionTriggerPopup::onItemIDArrow; } v44.x = *v14; v44.y = 0.0; v19 = cocos2d::CCLabelBMFont::create(); a1->m_mainLayer->addChild(a1->m_mainLayer, v19); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v19->setScale)(v19, 1059481190); v20 = v19->setPosition; cocos2d::CCPoint::CCPoint(&v50.origin, 0.0, 30.0); cocos2d::CCPoint::operator+(&v51, &v43, &v50); v20(v19, &v51.origin); cocos2d::CCRect::CCRect(&v50, 0.0, 0.0, 40.0, 40.0); cocos2d::CCRect::CCRect(&v51, &v50); v21 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create( (cocos2d::extension::CCScale9Sprite *)"square02b_small.png", (const char *)&v51, v52); ((void (__fastcall *)(cocos2d::CCNode *, int))v21->__vftable[1].~CCNode_0)(v21, 100); getTag = v21->__vftable[1].getTag; LOWORD(v51.origin.x) = 0; BYTE2(v51.origin.x) = 0; ((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCRect *))getTag)(v21, &v51); cocos2d::CCSize::CCSize(&v47, 50.0, 30.0); v21->setContentSize(v21, &v47); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v21, -1); v21->setPosition(v21, &v43); v23 = CCTextInputNode::create(50.0, 40.0, "Num", "Thonburi"); ((void (__fastcall *)(cocos2d::CCLayer *, CCTextInputNode *, int, void (__fastcall *)(cocos2d::CCNode *__hidden, cocos2d::CCNode *, int), int *, const char *))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v23, 20, a1->m_mainLayer->addChild_0, &dword_18, "bigFont.fnt"); v23->setPosition(v23, &v43); CCTextInputNode::setMaxLabelScale(v23, 0.6); CCTextInputNode::setMaxLabelWidth(v23, 200.0); v23->m_textField->setVisible(v23->m_textField, 0); v23->m_maxLabelLength = 6; sub_776584((int)&v51, "0123456789"); CCTextInputNode::setAllowedChars((int)v23, (int)&v51); sub_774008(&v51); *(_WORD *)&v40.r = -21896; v40.b = -16; CCTextInputNode::setLabelPlaceholderColor(v23, v40); CCTextInputNode::setLabelPlaceholderScale(v23, 0.5); v23->m_delegate = &a1->TextInputDelegate; v23->m_numberInput = 1; v23->setTag(v23, i); cocos2d::CCNode::convertToNodeSpace(&v48, a1->m_buttonMenu, &v43); v24 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn_001.png"); ((void (__fastcall *)(cocos2d::CCSprite *, int))v24->setScale)(v24, 1066192077); v25 = CCMenuItemSpriteExtra::create( v24, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(LODWORD(v44.x), (unsigned int)a1)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v25); v25->setTag(v25, 1); v26 = v25->setPosition; cocos2d::CCPoint::CCPoint(&v49, -50.0, 0.0); cocos2d::CCPoint::operator+(&v51, &v48, &v49); v26(v25, &v51.origin); CCMenuItemSpriteExtra::setSizeMult(v25, 2.0); v27 = cocos2d::CCSprite::createWithSpriteFrameName("edit_rightBtn_001.png"); ((void (__fastcall *)(cocos2d::CCSprite *, int))v27->setScale)(v27, 1066192077); v28 = CCMenuItemSpriteExtra::create( v27, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(LODWORD(v44.x), (unsigned int)a1)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v28); v28->setTag(v28, 2); v39 = v28->setPosition; cocos2d::CCPoint::CCPoint(&v49, 50.0, 0.0); cocos2d::CCPoint::operator+(&v51, &v48, &v49); v39(v28, &v51.origin); CCMenuItemSpriteExtra::setSizeMult(v28, 2.0); if ( i ) { if ( i == 1 ) a1->m_blockBInput = v23; else a1->m_targetIDInput = v23; } else { a1->m_blockAInput = v23; } sub_774008(&v41); } v29 = !a1->m_targetP1 && !a1->m_targetP2; a1->m_blockAInput->setTouchEnabled(a1->m_blockAInput, v29); SetupCollisionTriggerPopup::updateItemIDInputLabel(a1); SetupCollisionTriggerPopup::updateItemID2InputLabel(a1); SetupCollisionTriggerPopup::updateTargetIDInputLabel(a1); SetupTriggerPopup::createMultiTriggerItemsDefault(a1); sub_776584((int)&v50, "Activate\nGroup"); m_activateGroup = a1->m_activateGroup; LODWORD(v47.width) = SetupCollisionTriggerPopup::onEnableGroup; v47.height = 0.0; cocos2d::CCPoint::CCPoint(&v51.origin, (float)(v42.width * 0.5) + 50.0, (float)(v42.height * 0.5) - 20.0); SetupTriggerPopup::createToggleButton(a1, &v50, LODWORD(v47.width), LODWORD(v47.height), m_activateGroup, &v51); sub_774008(&v50); sub_776584((int)&v50, "Trigger\nOn Exit"); m_triggerOnExit = a1->m_triggerOnExit; LODWORD(v48.x) = SetupCollisionTriggerPopup::onActivateOnExit; v48.y = 0.0; cocos2d::CCPoint::CCPoint(&v51.origin, (float)(v42.width * 0.5) + 50.0, (float)(v42.height * 0.5) - 50.0); SetupTriggerPopup::createToggleButton(a1, &v50, LODWORD(v48.x), LODWORD(v48.y), m_triggerOnExit, &v51); sub_774008(&v50); sub_776584((int)&v50, "P1"); m_targetP1 = a1->m_targetP1; LODWORD(v49.x) = SetupCollisionTriggerPopup::onTargetP1; v49.y = 0.0; cocos2d::CCPoint::CCPoint( &v51.origin, (float)(v42.width * 0.5) - 70.0, (float)((float)(v42.height * 0.5) + 40.0) + 50.0); SetupTriggerPopup::createToggleButton(a1, &v50, LODWORD(v49.x), LODWORD(v49.y), m_targetP1, &v51); sub_774008(&v50); sub_776584((int)&v44, "P2"); LODWORD(v50.origin.x) = SetupCollisionTriggerPopup::onTargetP2; v50.origin.y = 0.0; m_targetP2 = a1->m_targetP2; cocos2d::CCPoint::CCPoint(&v51.origin, v42.width * 0.5, (float)((float)(v42.height * 0.5) + 40.0) + 50.0); SetupTriggerPopup::createToggleButton(a1, &v44, LODWORD(v50.origin.x), LODWORD(v50.origin.y), m_targetP2, &v51); sub_774008(&v44); sub_776584((int)&v43, "PP"); m_targetPP = a1->m_targetPP; LODWORD(v51.origin.x) = SetupCollisionTriggerPopup::onTargetPP; v51.origin.y = 0.0; cocos2d::CCPoint::CCPoint(&v44, (float)(v42.width * 0.5) + 70.0, (float)((float)(v42.height * 0.5) + 40.0) + 50.0); SetupTriggerPopup::createToggleButton(a1, &v43, LODWORD(v51.origin.x), LODWORD(v51.origin.y), m_targetPP, &v44); sub_774008(&v43); a1->m_disableTextDelegate = 0; } return v38; }
GD Web Decomp Icon

GD Web Decomp

Raw Source