From 40a21867e8a00b8fc734aaf0d75325dc44d96382 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Tue, 20 May 2025 03:05:35 +0200 Subject: [PATCH 1/2] Document buttonId in RegistrationBook (#1510) --- .../lego/legoomni/src/worlds/registrationbook.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp index adc7c856..6b177308 100644 --- a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp +++ b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp @@ -226,11 +226,15 @@ MxLong RegistrationBook::HandleKeyPress(MxU8 p_key) // FUNCTION: LEGO1 0x100774a0 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 (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); if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { @@ -243,14 +247,15 @@ MxLong RegistrationBook::HandleControl(LegoControlManagerNotificationParam& p_pa TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } else { - if (unk0x28 > 28) { + if (buttonId > 28) { return 1; } - HandleKeyPress(unk0x28 < 27 ? unk0x28 + 64 : 8); + HandleKeyPress(buttonId < 27 ? buttonId + 'A' - 1 : '\b'); } } else { + // Select another profile (buttonId is always 1) InputManager()->DisableInputProcessing(); DeleteObjects(&m_atomId, RegbookScript::c_iic006in_RunAnim, RegbookScript::c_iic008in_PlayWav); From 5c67c26c3f83aec5376c74d1f36f7afe08a86985 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 20 May 2025 20:42:42 +0200 Subject: [PATCH 2/2] Fix MxHashTableNode constructor (#1511) --- LEGO1/omni/include/mxhashtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LEGO1/omni/include/mxhashtable.h b/LEGO1/omni/include/mxhashtable.h index e15128e9..65ce11a0 100644 --- a/LEGO1/omni/include/mxhashtable.h +++ b/LEGO1/omni/include/mxhashtable.h @@ -13,7 +13,7 @@ class MxHashTableCursor; template class MxHashTableNode { public: - MxHashTableNode(T p_obj, MxU32 p_hash, MxHashTableNode* p_prev, MxHashTableNode* p_next) + MxHashTableNode(T p_obj, MxU32 p_hash, MxHashTableNode* p_prev, MxHashTableNode* p_next) { m_obj = p_obj; m_hash = p_hash;