Document buttonId in RegistrationBook (#1510)

This commit is contained in:
Anonymous Maarten 2025-05-20 03:05:35 +02:00 committed by GitHub
parent 0b9c1756c7
commit 40a21867e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -226,11 +226,15 @@ MxLong RegistrationBook::HandleKeyPress(MxU8 p_key)
// FUNCTION: LEGO1 0x100774a0 // FUNCTION: LEGO1 0x100774a0
MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_param) MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_param)
{ {
MxS16 unk0x28 = p_param.m_unk0x28; MxS16 buttonId = p_param.m_unk0x28;
if (unk0x28 >= 1 && unk0x28 <= 28) { if (buttonId >= 1 && buttonId <= 28) {
if (p_param.m_clickedObjectId == RegbookScript::c_Alphabet_Ctl) { if (p_param.m_clickedObjectId == RegbookScript::c_Alphabet_Ctl) {
if (unk0x28 == 28) { // buttonId:
// - [1, 26]: alphabet
// - 27: backspace
// - 28: go back to information center
if (buttonId == 28) {
DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav);
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
@ -243,14 +247,15 @@ MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_pa
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
} }
else { else {
if (unk0x28 > 28) { if (buttonId > 28) {
return 1; return 1;
} }
HandleKeyPress(unk0x28 < 27 ? unk0x28 + 64 : 8); HandleKeyPress(buttonId < 27 ? buttonId + 'A' - 1 : '\b');
} }
} }
else { else {
// Select another profile (buttonId is always 1)
InputManager()->DisableInputProcessing(); InputManager()->DisableInputProcessing();
DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav);