//
// EditorUI::toggleSpecialEditButtons from 0x7c7e6c to 0x7c8080 (532 bytes)
//
// 4 xrefs:
// > EditorUI::updateButtons @ 0x7c80b0
// > EditorUI::toggleEnableRotate @ 0x7c8ab0
// > EditorUI::activateTransformControl @ 0xc02a30
// > ??> @ 0xc3490
//
// This function is hookable on this platform (idp: arm, 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 12:54:09 +0000
//
__int64 __fastcall EditorUI::toggleSpecialEditButtons(cocos2d::CCArray **this, unsigned __int8 a2)
{
int v2; // w27
unsigned int i; // w19
GameObject *v5; // x0
unsigned int v6; // w22
GameObject *v7; // x0
__int64 v8; // x25
const char *j; // x1
__int64 v10; // x21
cocos2d::CCString *v11; // x0
const char *CString; // x0
size_t v13; // x0
__int64 v14; // x21
GameManager *v15; // x0
_QWORD *v16; // x0
__int64 *v17; // x1
GameManager *v19; // x0
char *v20; // [xsp+68h] [xbp+68h]
__int64 v21[2]; // [xsp+70h] [xbp+70h] BYREF
void *v22; // [xsp+80h] [xbp+80h]
v2 = a2;
if ( (unsigned int)cocos2d::CCArray::count(*(this + 112)) )
{
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(*(this + 112)); ++i )
{
v5 = (GameObject *)cocos2d::CCArray::objectAtIndex(*(this + 112), i);
if ( !(unsigned __int8)GameObject::canRotateFree(v5) )
goto LABEL_9;
}
}
else
{
v7 = *(this + 187);
if ( !v7 || !(unsigned __int8)GameObject::canRotateFree(v7) )
{
LABEL_9:
v6 = 0;
goto LABEL_10;
}
}
v6 = 1;
LABEL_10:
v8 = 0;
for ( j = (char *)&qword_28 + 3; ; j = (const char *)*((unsigned int *)&unk_1142280 + v8++) )
{
v10 = (__int64)*(this + 102);
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", j);
CString = (const char *)cocos2d::CCString::getCString(v11);
v21[0] = 0;
v21[1] = 0;
v22 = nullptr;
v20 = (char *)CString;
v13 = strlen(CString);
std::string::__init(v21, v20, v13);
v14 = cocos2d::CCDictionary::objectForKey(v10, v21);
v15 = (GameManager *)LOBYTE(v21[0]);
if ( (v21[0] & 1) != 0 )
operator delete(v22);
if ( v14 )
{
v16 = (_QWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v14 + 1072LL))(v14);
v17 = &qword_1142200;
if ( !v6 )
v17 = &qword_1142270;
ButtonSprite::setColor(v16, *v17);
v15 = (GameManager *)(*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v14 + 1056LL))(v14, v6);
}
if ( v8 == 3 )
break;
}
if ( v6 )
{
v19 = (GameManager *)GameManager::sharedState(v15);
if ( (unsigned __int8)GameManager::getGameVariable(v19, "0007")
&& (v2 || !(*(unsigned __int8 (__fastcall **)(_QWORD))(*(_QWORD *)*(this + 99) + 352LL))(*(this + 99))) )
{
EditorUI::activateRotationControl((EditorUI *)this, nullptr);
}
}
else
{
EditorUI::deactivateRotationControl((EditorUI *)this);
}
EditorUI::updateGridNodeSize(this);
return _stack_chk_guard;
}