//
// ButtonSprite::init from 0x140042960 to 0x140042bda (634 bytes)
//
// 31 xrefs:
// > ButtonSprite::create @ 0x140042921
// > LevelCell::loadCustomLevelCell @ 0x140149f14
// > LevelCell::loadCustomLevelCell @ 0x14014a197
// > LevelCell::loadCustomLevelCell @ 0x14014a42f
// > LevelCell::loadCustomLevelCell @ 0x14014a54b
// > EditorSFXActionConfigLayer::init @ 0x140183ad3
// > EditorUI::getSpriteButton @ 0x1401adf3a
// > EditorUI::menuItemFromObjectString @ 0x1401f1299
// > EditorUI::getCreateBtn @ 0x1401f175a
// > InfoLayer::getSpriteButton @ 0x1403d0050
// > LeaderboardsLayer::setupTabs @ 0x1403dbfcf
// > LevelLeaderboard::getSpriteButton @ 0x140429738
// > MusicBrowser::init @ 0x14047ad1d
// > MusicBrowser::init @ 0x14047ae96
// > MusicBrowser::init @ 0x14047b079
// > MusicBrowser::init @ 0x14047b1e5
// > MusicBrowser::init @ 0x14047b3a0
// > MusicBrowser::init @ 0x14047b5a7
// > SetupAreaMoveTriggerPopup::addAreaDefaultControls @ 0x1405a4d8c
// > SetupSequenceTriggerPopup::init @ 0x1405d8f9a
// > SetupAudioTriggerPopup::addProxVolControls @ 0x1405db6b1
// > SetupSpawnPopup::init @ 0x1405f47e0
// > SetupSpawnPopup::init @ 0x1405f4919
// > SFXBrowser::init @ 0x14061706e
// > SFXBrowser::init @ 0x1406171cb
// > SFXBrowser::init @ 0x140617441
// > SFXBrowser::init @ 0x1406175b6
// > SFXBrowser::init @ 0x140617771
// > ??> @ 0x140884f30
// > ??> @ 0x140884f40
// > ??> @ 0x14090f650
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:25:30 +0000
//
bool __fastcall ButtonSprite::init(
__int64 *a1,
__int64 a2,
int a3,
__int64 a4,
float a5,
int a6,
__int64 a7,
const char *a8,
char a9,
int a10)
{
bool result; // al
__int64 v14; // rax
__int64 v15; // rax
_QWORD *v16; // rax
_QWORD *v17; // rdi
__int64 v18; // rbx
__int64 v19; // rax
struct cocos2d::CCSprite *v20; // rax
__int64 v21; // rcx
float v22; // xmm6_4
float v23; // xmm6_4
__int64 *v24; // rdi
__int64 v25; // rbx
_BYTE v26[16]; // [rsp+30h] [rbp-48h] BYREF
result = cocos2d::CCSprite::init((cocos2d::CCSprite *)a1);
if ( result )
{
*((_DWORD *)a1 + 150) = 0;
*((_DWORD *)a1 + 152) = 0;
v14 = *a1;
*((_BYTE *)a1 + 624) = 1;
*((float *)a1 + 151) = (float)a3;
*((_DWORD *)a1 + 153) = a6;
*((_DWORD *)a1 + 154) = a10;
a1[80] = a2;
(*(void (__fastcall **)(__int64 *, __int64, __int64))(v14 + 456))(a1, a2, 1);
if ( a9 )
{
v20 = cocos2d::CCSprite::create(a8);
v21 = *a1;
a1[81] = (__int64)v20;
(*(void (__fastcall **)(__int64 *, struct cocos2d::CCSprite *, _QWORD))(v21 + 456))(a1, v20, 0);
}
else
{
v15 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)v26, 0.0, 0.0, 40.0, 40.0);
v16 = (_QWORD *)cocos2d::extension::CCScale9Sprite::create(a8, v15);
a1[82] = (__int64)v16;
v17 = v16;
v18 = *v16;
v19 = cocos2d::CCSize::CCSize((cocos2d::CCSize *)v26, 16.0, 16.0);
(*(void (__fastcall **)(_QWORD *, __int64))(v18 + 312))(v17, v19);
(*(void (__fastcall **)(__int64 *, __int64, _QWORD))(*a1 + 456))(a1, a1[82], 0);
}
v22 = *((float *)a1 + 151);
if ( v22 > 0.0 && *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1[80] + 320LL))(a1[80]) > v22 )
{
(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1[80] + 320LL))(a1[80]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1[80] + 160LL))(a1[80]);
}
if ( a5 > 0.0 && *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1[80] + 320LL))(a1[80]) + 4) > a5 )
{
v23 = a5 / *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1[80] + 320LL))(a1[80]) + 4);
if ( (*(float (__fastcall **)(__int64))(*(_QWORD *)a1[80] + 168LL))(a1[80]) > v23 )
{
v24 = (__int64 *)a1[80];
v25 = *v24;
(*(__int64 (__fastcall **)(__int64 *))(*v24 + 320))(v24);
(*(void (__fastcall **)(__int64 *))(v25 + 160))(v24);
}
}
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1[80] + 168LL))(a1[80]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1[80] + 160LL))(a1[80]);
ButtonSprite::updateSpriteBGSize(a1);
return 1;
}
return result;
}