{"type": "func", "start": 4297031952, "end": 4297032249, "name": "CustomizeObjectLayer::onNextColorChannel", "pseudocode": "// \n// CustomizeObjectLayer::onNextColorChannel from 0x1001f8110 to 0x1001f8239 (297 bytes)\n// \n// 1 xrefs:\n// > CustomizeObjectLayer::init @ 0x1001f6ec5\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 CustomizeObjectLayer::onNextColorChannel(CustomizeObjectLayer *a1, cocos2d::CCObject *a2)\n{\n  char v2; // al\n  GameManager *v3; // rax\n  int NextColorChannel; // r14d\n  int v5; // r15d\n  ButtonSprite *v6; // rsi\n  unsigned int v7; // r12d\n  __int64 v8; // r13\n  const char *CString; // rax\n  cocos2d::CCString *v10; // rax\n  const std::string::value_type *v11; // rsi\n  char v12; // [rsp-8h] [rbp-30h]\n\n  v12 = v2;\n  v3 = GameManager::sharedState();\n  NextColorChannel = LevelEditorLayer::getNextColorChannel(v3->m_levelEditorLayer);\n  v5 = NextColorChannel;\n  if ( (unsigned int)(NextColorChannel - 10) <= 0x3DD )\n  {\n    a1->m_customColorChannel = NextColorChannel;\n    a1->m_disableTextDelegate = 1;\n    CustomizeObjectLayer::updateCustomColorLabels(a1);\n    a1->m_disableTextDelegate = 0;\n    v5 = 1008;\n  }\n  CustomizeObjectLayer::updateSelected(a1, NextColorChannel);\n  v6 = nullptr;\n  if ( (unsigned int)sub_100720070(a1->m_colorButtons) )\n  {\n    v7 = 0;\n    while ( 1 )\n    {\n      v8 = sub_1007200C0(a1->m_colorButtons, v7);\n      if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v8 + 64LL))(v8) == v5 )\n        break;\n      if ( ++v7 >= (unsigned int)sub_100720070(a1->m_colorButtons) )\n      {\n        v6 = nullptr;\n        goto LABEL_9;\n      }\n    }\n    v6 = (ButtonSprite *)v8;\n  }\nLABEL_9:\n  CustomizeObjectLayer::highlightSelected(a1, v6);\n  CustomizeObjectLayer::updateColorSprite(a1);\n  if ( NextColorChannel < 1000 )\n  {\n    if ( NextColorChannel <= 0 )\n    {\n      v11 = \" \";\n      goto LABEL_14;\n    }\n    v10 = (cocos2d::CCString *)sub_1007AB580(\"%i\", v12);\n    CString = cocos2d::CCString::getCString(v10);\n  }\n  else\n  {\n    CString = GJSpecialColorSelect::textForColorIdx(NextColorChannel);\n  }\n  v11 = CString;\nLABEL_14:\n  ((void (__fastcall *)(cocos2d::CCLabelBMFont *, const std::string::value_type *))a1->m_selectedColorLabel->setString)(\n    a1->m_selectedColorLabel,\n    v11);\n}", "assembly": "; \n; CustomizeObjectLayer::onNextColorChannel from 0x1001f8110 to 0x1001f8239 (297 bytes)\n; \n; 1 xrefs:\n; > CustomizeObjectLayer::init @ 0x1001f6ec5\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\npush    rbp                                                            ; +0x0, 0x1001f8110\nmov     rbp, rsp                                                       ; +0x1, 0x1001f8111\npush    r15                                                            ; +0x4, 0x1001f8114\npush    r14                                                            ; +0x6, 0x1001f8116\npush    r13                                                            ; +0x8, 0x1001f8118\npush    r12                                                            ; +0xa, 0x1001f811a\npush    rbx                                                            ; +0xc, 0x1001f811c\npush    rax; char                                                      ; +0xd, 0x1001f811d\nmov     rbx, rdi                                                       ; +0xe, 0x1001f811e\ncall    GameManager__sharedState                                       ; +0x11, 0x1001f8121\nmov     rdi, [rax+200h]                                                ; +0x16, 0x1001f8126\ncall    LevelEditorLayer__getNextColorChannel                          ; +0x1d, 0x1001f812d\nmov     r14d, eax                                                      ; +0x22, 0x1001f8132\nlea     eax, [r14-0Ah]                                                 ; +0x25, 0x1001f8135\nmov     r15d, r14d                                                     ; +0x29, 0x1001f8139\ncmp     eax, 3DDh                                                      ; +0x2c, 0x1001f813c\nja      short loc_1001F8166                                            ; +0x31, 0x1001f8141\nmov     [rbx+2D4h], r14d                                               ; +0x33, 0x1001f8143\nmov     byte ptr [rbx+382h], 1                                         ; +0x3a, 0x1001f814a\nmov     rdi, rbx                                                       ; +0x41, 0x1001f8151\ncall    CustomizeObjectLayer__updateCustomColorLabels                  ; +0x44, 0x1001f8154\nmov     byte ptr [rbx+382h], 0                                         ; +0x49, 0x1001f8159\nmov     r15d, 3F0h                                                     ; +0x50, 0x1001f8160\nmov     rdi, rbx                                                       ; +0x56, 0x1001f8166\nmov     esi, r14d                                                      ; +0x59, 0x1001f8169\ncall    CustomizeObjectLayer__updateSelected                           ; +0x5c, 0x1001f816c\nmov     rdi, [rbx+2A8h]                                                ; +0x61, 0x1001f8171\ncall    sub_100720070                                                  ; +0x68, 0x1001f8178\nxor     esi, esi                                                       ; +0x6d, 0x1001f817d\ntest    eax, eax                                                       ; +0x6f, 0x1001f817f\njz      short loc_1001F81CB                                            ; +0x71, 0x1001f8181\nxor     r12d, r12d                                                     ; +0x73, 0x1001f8183\nnop     word ptr [rax+rax+00000000h]                                   ; +0x76, 0x1001f8186\nmov     rdi, [rbx+2A8h]                                                ; +0x80, 0x1001f8190\nmov     esi, r12d                                                      ; +0x87, 0x1001f8197\ncall    sub_1007200C0                                                  ; +0x8a, 0x1001f819a\nmov     r13, rax                                                       ; +0x8f, 0x1001f819f\nmov     rax, [rax]                                                     ; +0x92, 0x1001f81a2\nmov     rdi, r13                                                       ; +0x95, 0x1001f81a5\ncall    qword ptr [rax+40h]                                            ; +0x98, 0x1001f81a8\ncmp     eax, r15d                                                      ; +0x9b, 0x1001f81ab\njz      short loc_1001F81C8                                            ; +0x9e, 0x1001f81ae\ninc     r12d                                                           ; +0xa0, 0x1001f81b0\nmov     rdi, [rbx+2A8h]                                                ; +0xa3, 0x1001f81b3\ncall    sub_100720070                                                  ; +0xaa, 0x1001f81ba\ncmp     r12d, eax                                                      ; +0xaf, 0x1001f81bf\njb      short loc_1001F8190                                            ; +0xb2, 0x1001f81c2\nxor     esi, esi                                                       ; +0xb4, 0x1001f81c4\njmp     short loc_1001F81CB                                            ; +0xb6, 0x1001f81c6\nmov     rsi, r13                                                       ; +0xb8, 0x1001f81c8\nmov     rdi, rbx                                                       ; +0xbb, 0x1001f81cb\ncall    CustomizeObjectLayer__highlightSelected                        ; +0xbe, 0x1001f81ce\nmov     rdi, rbx                                                       ; +0xc3, 0x1001f81d3\ncall    CustomizeObjectLayer__updateColorSprite                        ; +0xc6, 0x1001f81d6\ncmp     r14d, 3E8h                                                     ; +0xcb, 0x1001f81db\njl      short loc_1001F81EE                                            ; +0xd2, 0x1001f81e2\nmov     edi, r14d                                                      ; +0xd4, 0x1001f81e4\ncall    GJSpecialColorSelect__textForColorIdx                          ; +0xd7, 0x1001f81e7\njmp     short loc_1001F820C                                            ; +0xdc, 0x1001f81ec\ntest    r14d, r14d                                                     ; +0xde, 0x1001f81ee\njle     short loc_1001F8230                                            ; +0xe1, 0x1001f81f1\nlea     rdi, aI; \"%i\"                                                  ; +0xe3, 0x1001f81f3\nmov     esi, r14d                                                      ; +0xea, 0x1001f81fa\nxor     eax, eax                                                       ; +0xed, 0x1001f81fd\ncall    sub_1007AB580                                                  ; +0xef, 0x1001f81ff\nmov     rdi, rax                                                       ; +0xf4, 0x1001f8204\ncall    cocos2d__CCString__getCString                                  ; +0xf7, 0x1001f8207\nmov     rsi, rax                                                       ; +0xfc, 0x1001f820c\nmov     rdi, [rbx+310h]                                                ; +0xff, 0x1001f820f\nmov     rax, [rdi]                                                     ; +0x106, 0x1001f8216\nmov     rax, [rax+390h]                                                ; +0x109, 0x1001f8219\nadd     rsp, 8                                                         ; +0x110, 0x1001f8220\npop     rbx                                                            ; +0x114, 0x1001f8224\npop     r12                                                            ; +0x115, 0x1001f8225\npop     r13                                                            ; +0x117, 0x1001f8227\npop     r14                                                            ; +0x119, 0x1001f8229\npop     r15                                                            ; +0x11b, 0x1001f822b\npop     rbp                                                            ; +0x11d, 0x1001f822d\njmp     rax                                                            ; +0x11e, 0x1001f822e\nlea     rsi, asc_100823F54; \" \"                                        ; +0x120, 0x1001f8230\njmp     short loc_1001F820F                                            ; +0x127, 0x1001f8237", "xrefs": ["CustomizeObjectLayer::init @ 0x1001f6ec5"], "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"}