//
// CreateParticlePopup::onSelectParticleTexture from 0x9c3078 to 0x9c3208 (400 bytes)
//
// 3 xrefs:
// > ??> @ 0x50d90
// > CreateParticlePopup::init @ 0x9c8754
// > ??> @ 0x122a998
//
// 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 CreateParticlePopup::onSelectParticleTexture(CreateParticlePopup *a1, cocos2d::CCObject *a2)
{
int v4; // w0
cocos2d::CCParticleSystemQuad *m_particle; // x24
cocos2d::CCSpriteFrameCache *v6; // x25
cocos2d::CCString *v7; // x0
const char *CString; // x0
cocos2d::CCSpriteFrame *v9; // x0
cocos2d::CCSprite *m_selectSprite; // x20
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x24
cocos2d::CCNode *v12; // x25
cocos2d::CCNode *v13; // x26
const cocos2d::CCPoint *v14; // x0
cocos2d::CCPoint v15; // [xsp+58h] [xbp+58h] BYREF
_BYTE v16[8]; // [xsp+60h] [xbp+60h] BYREF
cocos2d::CCPoint v17; // 0:kr08_8.8
if ( a2->getTag(a2) > 0 && a2->getTag(a2) > 212 )
{
v4 = 212;
}
else if ( a2->getTag(a2) <= 0 )
{
v4 = 0;
}
else
{
v4 = a2->getTag(a2);
}
a1->m_particleIndex = v4;
m_particle = a1->m_particle;
v6 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"particle_%02d_001.png",
(const char *)(unsigned int)a1->m_particleIndex);
CString = cocos2d::CCString::getCString(v7);
v9 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v6, CString);
cocos2d::CCParticleSystemQuad::setDisplayFrame(m_particle, v9);
CreateParticlePopup::updateParticleValueForType(a1, (float)a1->m_particleIndex, ParticleIdx, nullptr);
m_selectSprite = a1->m_selectSprite;
setPosition = m_selectSprite->setPosition;
v12 = m_selectSprite->getParent(m_selectSprite);
v13 = (cocos2d::CCNode *)((__int64 (__fastcall *)(cocos2d::CCObject *))a2->__vftable[6].~CCObject_0)(a2);
v14 = (const cocos2d::CCPoint *)((__int64 (__fastcall *)(cocos2d::CCObject *))a2->__vftable[2].acceptVisitor)(a2);
cocos2d::CCNode::convertToWorldSpace(v13, v14);
v17 = cocos2d::CCNode::convertToNodeSpace(v12, &v15);
((void (__fastcall *)(cocos2d::CCSprite *, _BYTE *, float, float))setPosition)(m_selectSprite, v16, v17.x, v17.y);
}