//
// EditorUI::toggleMode from 0x10002a880 to 0x10002a902 (130 bytes)
//
// 3 xrefs:
// > EditorUI::keyDown @ 0x100050b0e
// > EditorUI::init @ 0x100009686
// > EditorUI::getModeBtn @ 0x10000bc44
//
// 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 __fastcall EditorUI::toggleMode(EditorUI *a1, cocos2d::CCObject *a2)
{
int v2; // eax
unsigned int v3; // eax
const char *v4; // r14
__int64 v5; // rdi
__int64 v6; // rbx
cocos2d::CCSpriteFrameCache *v7; // rax
cocos2d::CCSpriteFrame *v8; // rax
v2 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);
if ( a1->m_selectedMode != v2 )
{
a1->m_selectedMode = v2;
EditorUI::resetUI(a1);
v3 = a1->m_selectedMode - 1;
if ( v3 <= 2 )
{
v4 = off_1008B1FA8[v3];
v5 = *((_QWORD *)&a1->m_deleteModeBtn + v3);
v6 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 1056LL))(v5);
v7 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v8 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v7, v4);
(*(void (__fastcall **)(__int64, cocos2d::CCSpriteFrame *))(*(_QWORD *)v6 + 1144LL))(v6, v8);
}
}
}