// // SetupRandAdvTriggerPopup::init from 0x5285ec to 0x528c0e (1570 bytes) // // 1 xrefs: // > SetupRandAdvTriggerPopup::create @ 0x528dd6 // // 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 SetupRandAdvTriggerPopup::init(SetupRandAdvTriggerPopup *a1, RandTriggerGameObject *a2, cocos2d::CCArray *a3) { _BOOL4 v4; // r0 bool v5; // r9 cocos2d::CCArray *v6; // r0 cocos2d::CCDirector *v7; // r0 cocos2d::CCLabelBMFont *v8; // r6 void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10 ButtonSprite *v10; // r0 CCMenuItemSpriteExtra *v11; // r0 CCMenuItemSpriteExtra *v12; // r7 cocos2d::CCMenu *m_buttonMenu; // r10 void (__fastcall *v14)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8 _BOOL4 v15; // r8 const char *v16; // r10 float v17; // s15 cocos2d::CCLabelBMFont *v18; // r6 cocos2d::CCNode *v19; // r7 CCTextInputNode *v20; // r6 void (__fastcall *v21)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11 int v22; // r0 cocos2d::CCString *v23; // r0 char *CString; // r0 char *v25; // r2 CCTextInputNode_vtbl *v26; // r3 ButtonSprite *v27; // r0 CCMenuItemSpriteExtra *v28; // r10 const cocos2d::CCPoint *v29; // r11 cocos2d::CCNode *v30; // r10 void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r11 void (__fastcall *v32)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11 cocos2d::CCPoint v33; // r1 cocos2d::CCPoint v35; // [sp+4h] [bp-88h] char *v36; // [sp+10h] [bp-7Ch] char *v37; // [sp+10h] [bp-7Ch] cocos2d::CCMenu *v38; // [sp+18h] [bp-74h] void (__fastcall *v39)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+2Ch] [bp-60h] void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // [sp+2Ch] [bp-60h] cocos2d::ccColor3B v41; // [sp+30h] [bp-5Ch] cocos2d::CCSize v42; // [sp+34h] [bp-58h] BYREF cocos2d::CCPoint v43; // [sp+3Ch] [bp-50h] BYREF cocos2d::CCPoint v44; // [sp+44h] [bp-48h] BYREF cocos2d::CCPoint v45; // [sp+4Ch] [bp-40h] BYREF cocos2d::CCPoint v46; // [sp+54h] [bp-38h] BYREF int v47; // [sp+5Ch] [bp-30h] int v48; // [sp+60h] [bp-2Ch] cocos2d::CCRect v49; // [sp+64h] [bp-28h] BYREF cocos2d::CCRect v50; // [sp+74h] [bp-18h] BYREF cocos2d::CCPoint v51; // 0:r3.4,4:^0.4 cocos2d::CCRect v52; // 0:r2.8,8:^0.8 cocos2d::CCRect v53; // 0:r2.8,8:^0.8 v4 = SetupTriggerPopup::init(a1, a2, a3, 380.0, 300.0, 1); v5 = v4; if ( v4 ) { v6 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)v4); a1->m_groupButtons = v6; cocos2d::CCObject::retain(v6); a1->determineStartValues(a1); v7 = cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize(&v42, v7); v8 = cocos2d::CCLabelBMFont::create(); a1->addChild(a1, v8); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v8->setScale)(v8, 1060320051); setPosition = v8->setPosition; cocos2d::CCPoint::CCPoint( &v50.origin, v42.width * 0.5, (float)((float)(a1->m_height * 0.5) + (float)(v42.height * 0.5)) - 18.0); setPosition(v8, &v50.origin); v10 = ButtonSprite::create( (ButtonSprite *)"OK", (const char *)&word_28, 0, 0.8, 1, "goldFont.fnt", "GJ_button_01.png", COERCE_CONST_CHAR_(30.0), *(float *)&v36); v47 = 660; v48 = 1; v11 = CCMenuItemSpriteExtra::create(v10, nullptr, (cocos2d::SEL_MenuHandler)((unsigned int)a1 | 0x29400000000LL)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v11); sub_776584((int)&v49, "Help"); sub_776584( (int)&v50, "Triggers one of several groups randomly. Chance is how likely it is that the group is triggered. T" "his value is then divided by the sum of the chances to calculate the chance in percentage for each group."); v12 = InfoAlertButton::create((int)&v49, (int)&v50, 1065353216); sub_774008(&v50); sub_774008(&v49); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v12); m_buttonMenu = a1->m_buttonMenu; v14 = v12->setPosition; cocos2d::CCPoint::CCPoint( &v49.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(&v50.origin, m_buttonMenu, &v49.origin); v14(v12, &v50.origin); v15 = 0; v16 = nullptr; while ( 1 ) { v17 = -50.0; if ( v15 ) v17 = 50.0; cocos2d::CCPoint::CCPoint(&v46, (float)(v17 + (float)(v42.width * 0.5)) - 50.0, (float)(v42.height * 0.5) + 65.0); v18 = cocos2d::CCLabelBMFont::create(); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v18->setScale)(v18, 1056964608); v39 = v18->setPosition; cocos2d::CCPoint::CCPoint(&v49.origin, 0.0, 30.0); cocos2d::CCPoint::operator+(&v50, &v46, &v49); v39(v18, &v50.origin); setAnchorPoint = v18->setAnchorPoint; cocos2d::CCPoint::CCPoint(&v50.origin, 0.5, 0.5); setAnchorPoint(v18, &v50.origin); a1->m_mainLayer->addChild(a1->m_mainLayer, v18); cocos2d::CCRect::CCRect(&v49, 0.0, 0.0, 40.0, 40.0); cocos2d::CCRect::CCRect(&v50, &v49); v19 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create( (cocos2d::extension::CCScale9Sprite *)"square02_small.png", (const char *)&v50, v52); ((void (__fastcall *)(cocos2d::CCNode *, int))v19->__vftable[1].~CCNode_0)(v19, 100); cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v50, 70.0, 30.0); v19->setContentSize(v19, (const cocos2d::CCSize *)&v50); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v19, -1); v19->setPosition(v19, &v46); v20 = CCTextInputNode::create(60.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, v20, 20, a1->m_mainLayer->addChild_0, &dword_18, "bigFont.fnt"); v21 = v20->setPosition; v22 = (int)v19->getPosition(v19); v21(v20, (const cocos2d::CCPoint *)v22); CCTextInputNode::setMaxLabelScale(v20, 0.6); CCTextInputNode::setMaxLabelWidth(v20, 200.0); v20->m_textField->setVisible(v20->m_textField, 0); v20->m_maxLabelLength = 5; sub_776584((int)&v45, "0123456789"); CCTextInputNode::setAllowedChars((int)v20, (int)&v45); sub_774008(&v45); *(_WORD *)&v41.r = -21896; v41.b = -16; CCTextInputNode::setLabelPlaceholderColor(v20, v41); CCTextInputNode::setLabelPlaceholderScale(v20, 0.5); v20->m_delegate = &a1->TextInputDelegate; v20->m_numberInput = 1; v23 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v16); CString = (char *)cocos2d::CCString::getCString(v23); sub_776584((int)&v45, CString); CCTextInputNode::setString((int)v20, (char *)&v45, v25); sub_774008(&v45); v26 = v20->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; if ( v15 ) { a1->m_chanceInput = v20; v26->setTag(v20, 2); } else { a1->m_groupIDInput = v20; v26->setTag(v20, 1); } v16 = byte_9 + 1; if ( v15 ) break; v15 = 1; } v27 = ButtonSprite::create( (ButtonSprite *)"Add", (const char *)&word_32, 0, 0.7, v15, "goldFont.fnt", "GJ_button_04.png", (const char *)0x41C80000, COERCE_FLOAT("bigFont.fnt")); LODWORD(v49.origin.x) = SetupRandAdvTriggerPopup::onAddChance; v49.origin.y = 0.0; v28 = CCMenuItemSpriteExtra::create( v27, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(SetupRandAdvTriggerPopup::onAddChance, (unsigned int)a1)); a1->m_buttonMenu->addChild(a1->m_buttonMenu, v28); v37 = (char *)v28->setPosition; v38 = a1->m_buttonMenu; v29 = a1->m_chanceInput->getPosition(a1->m_chanceInput); cocos2d::CCPoint::CCPoint(&v45, 100.0, 0.0); cocos2d::CCPoint::operator+(&v46, v29, &v45); cocos2d::CCNode::convertToNodeSpace(&v50.origin, v38, &v46); ((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCRect *))v37)(v28, &v50); cocos2d::CCRect::CCRect(&v50, 0.0, 0.0, 80.0, 80.0); v30 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create( (cocos2d::extension::CCScale9Sprite *)"square02_001.png", (const char *)&v50, v53); ((void (__fastcall *)(cocos2d::CCNode *, int))v30->__vftable[1].~CCNode_0)(v30, 50); setContentSize = v30->setContentSize; cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v50, 350.0, 90.0); setContentSize(v30, (const cocos2d::CCSize *)&v50); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v30, -1); v32 = v30->setPosition; cocos2d::CCPoint::CCPoint(&v50.origin, v42.width * 0.5, (float)(v42.height * 0.5) - 10.0); v32(v30, &v50.origin); cocos2d::CCPoint::CCPoint( &v43, (float)((float)(v42.width * 0.5) - (float)(a1->m_width * 0.5)) + 20.0, (float)((float)(v42.height * 0.5) - (float)(a1->m_height * 0.5)) + 20.0); cocos2d::CCPoint::CCPoint(&v44, 0.0, 30.0); cocos2d::CCPoint::operator+(&v45, &v43, &v44); cocos2d::CCPoint::CCPoint(&v50.origin, &v43); cocos2d::CCPoint::CCPoint(&v46, (float)((float)(a1->m_width * 0.5) + (float)(v42.width * 0.5)) - 76.0, v43.y + 30.0); LODWORD(v33.x) = &v45; LODWORD(v33.y) = &v50; LODWORD(v51.x) = &v46; SetupTriggerPopup::createMultiTriggerItems(a1, v33, v51, v35); SetupRandAdvTriggerPopup::updateGroupIDButtons(a1); a1->m_disableTextDelegate = 0; } return v5; }
GD Web Decomp Icon

GD Web Decomp

Raw Source