//
// AccountRegisterLayer::updateLabel from 0x468aa0 to 0x468c18 (376 bytes)
//
// 5 xrefs:
// > AccountRegisterLayer::registerAccountFailed @ 0x468eda
// > AccountRegisterLayer::onSubmit @ 0x468f9e
// > AccountRegisterLayer::textInputClosed @ 0x469238
// > AccountRegisterLayer::textInputClosed @ 0x46931e
// > AccountRegisterLayer::textInputClosed @ 0x46935e
//
// 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 AccountRegisterLayer::updateLabel(AccountRegisterLayer *a1, AccountError a2)
{
void (*setColor)(void); // r3
__int32 v4; // r2
if ( a2 == InvalidEmail )
{
a1->m_emailLabel->setString(a1->m_emailLabel, "Email is invalid");
setColor = (void (*)(void))a1->m_emailLabel->setColor;
goto LABEL_21;
}
if ( a2 > InvalidEmail )
{
v4 = a2 + 4;
if ( a2 == InvalidUsername )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *, __int32))a1->m_usernameLabel->setString)(
a1->m_usernameLabel,
"Username is invalid",
v4);
setColor = (void (*)(void))a1->m_usernameLabel->setColor;
goto LABEL_21;
}
if ( a2 < InvalidUsername )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *, __int32))a1->m_passwordLabel->setString)(
a1->m_passwordLabel,
"Password is invalid",
v4);
setColor = (void (*)(void))a1->m_passwordLabel->setColor;
goto LABEL_21;
}
if ( a2 == AlreadyUsedEmail )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *, __int32))a1->m_emailLabel->setString)(
a1->m_emailLabel,
"Email is already in use",
v4);
setColor = (void (*)(void))a1->m_emailLabel->setColor;
goto LABEL_21;
}
if ( a2 == AlreadyUsedUsername )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *, __int32))a1->m_usernameLabel->setString)(
a1->m_usernameLabel,
"Username is already in use",
v4);
setColor = (void (*)(void))a1->m_usernameLabel->setColor;
goto LABEL_21;
}
goto LABEL_20;
}
if ( a2 == TooShortLessThan3 )
{
a1->m_usernameLabel->setString(a1->m_usernameLabel, "Too short. Minimum 3 characters");
setColor = (void (*)(void))a1->m_usernameLabel->setColor;
goto LABEL_21;
}
if ( a2 <= TooShortLessThan3 )
{
if ( a2 == EmailsDoNotMatch )
{
a1->m_verifyEmailLabel->setString(a1->m_verifyEmailLabel, "Emails do not match");
setColor = (void (*)(void))a1->m_verifyEmailLabel->setColor;
goto LABEL_21;
}
LABEL_20:
a1->m_usernameLabel->setString(a1->m_usernameLabel, "Something went wrong.");
setColor = (void (*)(void))a1->m_usernameLabel->setColor;
goto LABEL_21;
}
if ( a2 == TooShortLessThan6 )
{
a1->m_passwordLabel->setString(a1->m_passwordLabel, "Too short. Minimum 6 characters");
setColor = (void (*)(void))a1->m_passwordLabel->setColor;
}
else
{
a1->m_confirmPasswordLabel->setString(a1->m_confirmPasswordLabel, "Passwords do not match");
setColor = (void (*)(void))a1->m_confirmPasswordLabel->setColor;
}
LABEL_21:
setColor();
}