//
// CustomizeObjectLayer::onSelectMode from 0x1400a8ff0 to 0x1400a91f6 (518 bytes)
//
// 4 xrefs:
// > CustomizeObjectLayer::init @ 0x1400a7ca3
// > CustomizeObjectLayer::init @ 0x1400a5a06
// > CustomizeObjectLayer::init @ 0x1400a6e3f
// > ??> @ 0x1406c7800
//
// 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 CustomizeObjectLayer::onSelectMode(CustomizeObjectLayer *a1, cocos2d::CCObject *a2)
{
int v3; // eax
cocos2d::CCLabelBMFont *m_titleLabel; // rcx
const char *v5; // rdx
const char *v6; // rsi
const char *v7; // rbx
ButtonSprite *v8; // rax
const char *v9; // rbx
ButtonSprite *v10; // rax
CCMenuItemSpriteExtra *m_textButton; // rcx
ButtonSprite *v12; // rax
_BOOL8 v13; // rdx
_BOOL8 v14; // rdx
_BOOL8 v15; // rdx
_BOOL8 v16; // rdx
_BOOL8 v17; // rdx
_BOOL8 v18; // rdx
int ActiveMode; // eax
const char *CString; // rdx
cocos2d::CCString *v21; // rax
v3 = a2->getTag(a2);
m_titleLabel = a1->m_titleLabel;
a1->m_selectedMode = v3;
if ( v3 == 1 )
{
v5 = "Base Color";
}
else
{
v5 = "Detail Color";
if ( v3 != 2 )
v5 = "Insert Text";
}
m_titleLabel->setString(&m_titleLabel->cocos2d::CCLabelProtocol, v5);
v6 = "GJ_button_04.png";
v7 = "GJ_button_04.png";
if ( a1->m_selectedMode == 1 )
v7 = "GJ_button_03.png";
v8 = (ButtonSprite *)a1->m_baseButton->getNormalImage(a1->m_baseButton);
ButtonSprite::updateBGImage(v8, v7);
v9 = "GJ_button_04.png";
if ( a1->m_selectedMode == 2 )
v9 = "GJ_button_03.png";
v10 = (ButtonSprite *)a1->m_detailButton->getNormalImage(a1->m_detailButton);
ButtonSprite::updateBGImage(v10, v9);
m_textButton = a1->m_textButton;
if ( m_textButton )
{
if ( a1->m_selectedMode == 3 )
v6 = "GJ_button_03.png";
v12 = (ButtonSprite *)m_textButton->getNormalImage(m_textButton);
ButtonSprite::updateBGImage(v12, v6);
}
CustomizeObjectLayer::toggleVisible(a1);
LOBYTE(v13) = a1->m_selectedMode == 1;
a1->m_baseColorHSV->setVisible(a1->m_baseColorHSV, v13);
LOBYTE(v14) = a1->m_selectedMode == 1;
a1->m_baseColorHSV->setEnabled(a1->m_baseColorHSV, v14);
LOBYTE(v15) = a1->m_selectedMode == 2;
a1->m_detailColorHSV->setVisible(a1->m_detailColorHSV, v15);
LOBYTE(v16) = a1->m_selectedMode == 2;
a1->m_detailColorHSV->setEnabled(a1->m_detailColorHSV, v16);
LOBYTE(v17) = a1->m_selectedMode != 3;
a1->m_liveSelectButton->setVisible(a1->m_liveSelectButton, v17);
LOBYTE(v18) = a1->m_selectedMode != 3;
a1->m_liveSelectButton->setEnabled(a1->m_liveSelectButton, v18);
CustomizeObjectLayer::updateHSVButtons(a1);
CustomizeObjectLayer::updateColorSprite(a1);
ActiveMode = CustomizeObjectLayer::getActiveMode(a1, 1);
if ( ActiveMode < 1000 )
{
if ( ActiveMode <= 0 )
{
CString = " ";
}
else
{
v21 = cocos2d::CCString::createWithFormat("%i", ActiveMode);
CString = cocos2d::CCString::getCString(v21);
}
}
else
{
CString = GJSpecialColorSelect::textForColorIdx(ActiveMode);
}
a1->m_selectedColorLabel->setString(&a1->m_selectedColorLabel->cocos2d::CCLabelProtocol, CString);
}