//
// CustomizeObjectLayer::onNextColorChannel from 0x140142ff0 to 0x140143102 (274 bytes)
//
// 2 xrefs:
// > CustomizeObjectLayer::init @ 0x14014184b
// > ??> @ 0x1409173b4
//
// 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:27:10 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall CustomizeObjectLayer::onNextColorChannel(__int64 a1)
{
__int64 v2; // rcx
unsigned int NextColorChannel; // eax
int v4; // ebx
unsigned int v5; // esi
__int64 ButtonByTag; // rax
__int64 v7; // rdx
const char *CString; // rdx
cocos2d::CCString *v9; // rax
void *v11; // [rsp+30h] [rbp+8h]
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v11 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v11);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
NextColorChannel = LevelEditorLayer::getNextColorChannel(*(_QWORD *)(v2 + 568));
v4 = NextColorChannel;
v5 = NextColorChannel;
if ( NextColorChannel - 10 <= 0x3DD )
{
*(_DWORD *)(a1 + 748) = NextColorChannel;
v5 = 1008;
*(_BYTE *)(a1 + 922) = 1;
CustomizeObjectLayer::updateCustomColorLabels(a1);
*(_BYTE *)(a1 + 922) = 0;
}
CustomizeObjectLayer::updateSelected(a1);
ButtonByTag = CustomizeObjectLayer::getButtonByTag(a1, v5);
CustomizeObjectLayer::highlightSelected(a1, ButtonByTag);
CustomizeObjectLayer::updateColorSprite(a1, v7);
if ( v4 < 1000 )
{
if ( v4 <= 0 )
{
CString = " ";
}
else
{
v9 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)v4);
CString = cocos2d::CCString::getCString(v9);
}
}
else
{
CString = (const char *)GJSpecialColorSelect::textForColorIdx((unsigned int)v4);
}
return (**(__int64 (__fastcall ***)(__int64, const char *))(*(_QWORD *)(a1 + 808) + 360LL))(
*(_QWORD *)(a1 + 808) + 360LL,
CString);
}