{"type": "func", "start": 4299056260, "end": 4299056704, "name": "EditorUI::toggleSpecialEditButtons", "pseudocode": "// \n// EditorUI::toggleSpecialEditButtons from 0x1003e6484 to 0x1003e6640 (444 bytes)\n// \n// 2 xrefs:\n// > EditorUI::toggleEnableRotate @ 0x1003c7460\n// > EditorUI::updateButtons @ 0x1003e5ad4\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid __fastcall EditorUI::toggleSpecialEditButtons(EditorUI *a1)\n{\n  unsigned __int64 v1; // x22\n  unsigned int v3; // w20\n  GameObject *v4; // x0\n  cocos2d::CCDictionary **p_m_editButtonDict; // x24\n  bool canRotateFree; // w20\n  GameObject *m_selectedObject; // x0\n  __int64 v8; // x25\n  unsigned int i; // w26\n  int v10; // w8\n  cocos2d::CCDictionary *v11; // x23\n  cocos2d::CCString *v12; // x0\n  char *CString; // x0\n  __int64 v14; // x0\n  __int64 v15; // x23\n  ButtonSprite *v16; // x0\n  GameManager *v17; // x0\n  cocos2d::CCObject *v18; // x1\n  void *__p[2]; // [xsp+8h] [xbp-68h] BYREF\n  char v20; // [xsp+1Fh] [xbp-51h]\n\n  if ( (unsigned int)sub_10024A36C((__int64)a1->m_selectedObjects) )\n  {\n    if ( (unsigned int)sub_10024A36C((__int64)a1->m_selectedObjects) )\n    {\n      v3 = 0;\n      do\n      {\n        v4 = (GameObject *)sub_10024A388((__int64)a1->m_selectedObjects, v3);\n        if ( !GameObject::canRotateFree(v4) )\n          goto LABEL_10;\n      }\n      while ( ++v3 < (unsigned int)sub_10024A36C((__int64)a1->m_selectedObjects) );\n    }\n    p_m_editButtonDict = &a1->m_editButtonDict;\n    canRotateFree = 1;\n  }\n  else\n  {\n    m_selectedObject = a1->m_selectedObject;\n    if ( !m_selectedObject )\n    {\nLABEL_10:\n      canRotateFree = 0;\n      v8 = 10921638;\n      p_m_editButtonDict = &a1->m_editButtonDict;\n      goto LABEL_12;\n    }\n    canRotateFree = GameObject::canRotateFree(m_selectedObject);\n    p_m_editButtonDict = &a1->m_editButtonDict;\n    if ( !canRotateFree )\n    {\n      v8 = 10921638;\n      goto LABEL_12;\n    }\n  }\n  v8 = 0xFFFFFF;\nLABEL_12:\n  for ( i = -1; i != 3; ++i )\n  {\n    if ( i > 2 )\n      v10 = 27;\n    else\n      v10 = dword_100647444[i];\n    v11 = *p_m_editButtonDict;\n    v12 = (cocos2d::CCString *)sub_100268F4C(\"%i\", v10);\n    CString = (char *)cocos2d::CCString::getCString(v12);\n    sub_100009900(__p, CString);\n    v14 = cocos2d::CCDictionary::objectForKey_1(v11, __p);\n    v15 = v14;\n    if ( (v20 & 0x80000000) == 0 )\n    {\n      if ( !v14 )\n        continue;\nLABEL_18:\n      v16 = (ButtonSprite *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v15 + 1056LL))(v15);\n      v1 = v1 & 0xFFFFFFFFFF000000LL | v8;\n      ButtonSprite::setColor(v16, (cocos2d::ccColor3B)v1);\n      (*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v15 + 1040LL))(v15, canRotateFree);\n      continue;\n    }\n    operator delete(__p[0]);\n    if ( v15 )\n      goto LABEL_18;\n  }\n  if ( canRotateFree )\n  {\n    v17 = GameManager::sharedState();\n    if ( GameManager::getGameVariable(v17, \"0007\") )\n      EditorUI::activateRotationControl(a1, v18);\n  }\n  else\n  {\n    EditorUI::deactivateRotationControl(a1);\n  }\n  EditorUI::updateGridNodeSize(a1);\n}", "assembly": "; \n; EditorUI::toggleSpecialEditButtons from 0x1003e6484 to 0x1003e6640 (444 bytes)\n; \n; 2 xrefs:\n; > EditorUI::toggleEnableRotate @ 0x1003c7460\n; > EditorUI::updateButtons @ 0x1003e5ad4\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSUB             SP, SP, #0x80                                          ; +0x0, 0x1003e6484\nSTP             X28, X27, [SP,#0x70+var_50]                            ; +0x4, 0x1003e6488\nSTP             X26, X25, [SP,#0x70+var_40]                            ; +0x8, 0x1003e648c\nSTP             X24, X23, [SP,#0x70+var_30]                            ; +0xc, 0x1003e6490\nSTP             X22, X21, [SP,#0x70+var_20]                            ; +0x10, 0x1003e6494\nSTP             X20, X19, [SP,#0x70+var_10]                            ; +0x14, 0x1003e6498\nSTP             X29, X30, [SP,#0x70+var_s0]                            ; +0x18, 0x1003e649c\nADD             X29, SP, #0x70                                         ; +0x1c, 0x1003e64a0\nMOV             X19, X0                                                ; +0x20, 0x1003e64a4\nLDR             X0, [X0,#0x328]                                        ; +0x24, 0x1003e64a8\nBL              sub_10024A36C                                          ; +0x28, 0x1003e64ac\nCBZ             W0, loc_1003E64F8                                      ; +0x2c, 0x1003e64b0\nLDR             X0, [X19,#0x328]                                       ; +0x30, 0x1003e64b4\nBL              sub_10024A36C                                          ; +0x34, 0x1003e64b8\nCBZ             W0, loc_1003E64EC                                      ; +0x38, 0x1003e64bc\nMOV             W20, #0                                                ; +0x3c, 0x1003e64c0\nLDR             X0, [X19,#0x328]                                       ; +0x40, 0x1003e64c4\nMOV             X1, X20                                                ; +0x44, 0x1003e64c8\nBL              sub_10024A388                                          ; +0x48, 0x1003e64cc\nBL              GameObject__canRotateFree                              ; +0x4c, 0x1003e64d0\nTBZ             W0, #0, loc_1003E6518                                  ; +0x50, 0x1003e64d4\nADD             W20, W20, #1                                           ; +0x54, 0x1003e64d8\nLDR             X0, [X19,#0x328]                                       ; +0x58, 0x1003e64dc\nBL              sub_10024A36C                                          ; +0x5c, 0x1003e64e0\nCMP             W20, W0                                                ; +0x60, 0x1003e64e4\nB.CC            loc_1003E64C4                                          ; +0x64, 0x1003e64e8\nADD             X24, X19, #0x2D8                                       ; +0x68, 0x1003e64ec\nMOV             W20, #1                                                ; +0x6c, 0x1003e64f0\nB               loc_1003E6510                                          ; +0x70, 0x1003e64f4\nLDR             X0, [X19,#0x520]                                       ; +0x74, 0x1003e64f8\nCBZ             X0, loc_1003E6518                                      ; +0x78, 0x1003e64fc\nBL              GameObject__canRotateFree                              ; +0x7c, 0x1003e6500\nMOV             X20, X0                                                ; +0x80, 0x1003e6504\nADD             X24, X19, #0x2D8                                       ; +0x84, 0x1003e6508\nTBZ             W0, #0, loc_1003E652C                                  ; +0x88, 0x1003e650c\nMOV             W25, #0xFFFFFF                                         ; +0x8c, 0x1003e6510\nB               loc_1003E6534                                          ; +0x90, 0x1003e6514\nMOV             W20, #0                                                ; +0x94, 0x1003e6518\nMOV             W25, #0xA6A6A6                                         ; +0x98, 0x1003e651c\nADD             X24, X19, #0x2D8                                       ; +0xa0, 0x1003e6524\nB               loc_1003E6534                                          ; +0xa4, 0x1003e6528\nMOV             W25, #0xA6A6A6                                         ; +0xa8, 0x1003e652c\nMOV             W26, #0xFFFFFFFF                                       ; +0xb0, 0x1003e6534\nADRL            X27, dword_100647444                                   ; +0xb4, 0x1003e6538\nADRL            X21, aI; \"%i\"                                          ; +0xbc, 0x1003e6540\nCMP             W26, #2                                                ; +0xc4, 0x1003e6548\nB.HI            loc_1003E6558                                          ; +0xc8, 0x1003e654c\nLDR             W8, [X27,W26,UXTW#2]                                   ; +0xcc, 0x1003e6550\nB               loc_1003E655C                                          ; +0xd0, 0x1003e6554\nMOV             W8, #0x1B                                              ; +0xd4, 0x1003e6558\nLDR             X23, [X24]                                             ; +0xd8, 0x1003e655c\nSTR             X8, [SP,#0x70+var_70]                                  ; +0xdc, 0x1003e6560\nMOV             X0, X21                                                ; +0xe0, 0x1003e6564\nBL              sub_100268F4C                                          ; +0xe4, 0x1003e6568\nBL              cocos2d__CCString__getCString                          ; +0xe8, 0x1003e656c\nMOV             X1, X0; __s                                            ; +0xec, 0x1003e6570\nADD             X0, SP, #0x70+__p; int                                 ; +0xf0, 0x1003e6574\nBL              sub_100009900                                          ; +0xf4, 0x1003e6578\nADD             X1, SP, #0x70+__p                                      ; +0xf8, 0x1003e657c\nMOV             X0, X23                                                ; +0xfc, 0x1003e6580\nBL              cocos2d__CCDictionary__objectForKey_1                  ; +0x100, 0x1003e6584\nMOV             X23, X0                                                ; +0x104, 0x1003e6588\nLDRSB           W8, [SP,#0x70+var_51]                                  ; +0x108, 0x1003e658c\nTBNZ            W8, #0x1F, loc_1003E65DC                               ; +0x10c, 0x1003e6590\nCBZ             X23, loc_1003E65CC                                     ; +0x110, 0x1003e6594\nLDR             X8, [X23]                                              ; +0x114, 0x1003e6598\nLDR             X8, [X8,#0x420]                                        ; +0x118, 0x1003e659c\nMOV             X0, X23                                                ; +0x11c, 0x1003e65a0\nBLR             X8                                                     ; +0x120, 0x1003e65a4\nAND             X8, X22, #0xFFFFFFFFFF000000                           ; +0x124, 0x1003e65a8\nORR             X22, X8, X25                                           ; +0x128, 0x1003e65ac\nMOV             X1, X22                                                ; +0x12c, 0x1003e65b0\nBL              ButtonSprite__setColor                                 ; +0x130, 0x1003e65b4\nLDR             X8, [X23]                                              ; +0x134, 0x1003e65b8\nLDR             X8, [X8,#0x410]                                        ; +0x138, 0x1003e65bc\nAND             W1, W20, #1                                            ; +0x13c, 0x1003e65c0\nMOV             X0, X23                                                ; +0x140, 0x1003e65c4\nBLR             X8                                                     ; +0x144, 0x1003e65c8\nADD             W26, W26, #1                                           ; +0x148, 0x1003e65cc\nCMP             W26, #3                                                ; +0x14c, 0x1003e65d0\nB.NE            loc_1003E6548                                          ; +0x150, 0x1003e65d4\nB               loc_1003E65EC                                          ; +0x154, 0x1003e65d8\nLDR             X0, [SP,#0x70+__p]; __p                                ; +0x158, 0x1003e65dc\nBL              __ZdlPv; operator delete(void *)                       ; +0x15c, 0x1003e65e0\nCBNZ            X23, loc_1003E6598                                     ; +0x160, 0x1003e65e4\nB               loc_1003E65CC                                          ; +0x164, 0x1003e65e8\nTBZ             W20, #0, loc_1003E6610                                 ; +0x168, 0x1003e65ec\nBL              GameManager__sharedState                               ; +0x16c, 0x1003e65f0\nADRL            X1, a0007; \"0007\"                                      ; +0x170, 0x1003e65f4\nBL              GameManager__getGameVariable                           ; +0x178, 0x1003e65fc\nCBZ             W0, loc_1003E6618                                      ; +0x17c, 0x1003e6600\nMOV             X0, X19                                                ; +0x180, 0x1003e6604\nBL              EditorUI__activateRotationControl                      ; +0x184, 0x1003e6608\nB               loc_1003E6618                                          ; +0x188, 0x1003e660c\nMOV             X0, X19                                                ; +0x18c, 0x1003e6610\nBL              EditorUI__deactivateRotationControl                    ; +0x190, 0x1003e6614\nMOV             X0, X19                                                ; +0x194, 0x1003e6618\nBL              EditorUI__updateGridNodeSize                           ; +0x198, 0x1003e661c\nLDP             X29, X30, [SP,#0x70+var_s0]                            ; +0x19c, 0x1003e6620\nLDP             X20, X19, [SP,#0x70+var_10]                            ; +0x1a0, 0x1003e6624\nLDP             X22, X21, [SP,#0x70+var_20]                            ; +0x1a4, 0x1003e6628\nLDP             X24, X23, [SP,#0x70+var_30]                            ; +0x1a8, 0x1003e662c\nLDP             X26, X25, [SP,#0x70+var_40]                            ; +0x1ac, 0x1003e6630\nLDP             X28, X27, [SP,#0x70+var_50]                            ; +0x1b0, 0x1003e6634\nADD             SP, SP, #0x80                                          ; +0x1b4, 0x1003e6638\nRET                                                                    ; +0x1b8, 0x1003e663c", "xrefs": ["EditorUI::toggleEnableRotate @ 0x1003c7460", "EditorUI::updateButtons @ 0x1003e5ad4"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}