diff --git a/LEGO1/lego/legoomni/include/infocenter.h b/LEGO1/lego/legoomni/include/infocenter.h index 56f01e09..2adb5c80 100644 --- a/LEGO1/lego/legoomni/include/infocenter.h +++ b/LEGO1/lego/legoomni/include/infocenter.h @@ -61,6 +61,12 @@ class Infocenter : public LegoWorld { c_nickSelected = 33, c_lauraSelected = 34, + c_unk40 = 40, + c_unk41 = 41, + c_unk42 = 42, + c_unk43 = 43, + c_unk44 = 44, + c_goToRegBook = 70, c_goToRegBookRed = 71, @@ -127,6 +133,7 @@ class Infocenter : public LegoWorld { c_gasCtlDescription = 555, c_medCtlDescription = 556, + c_unk557 = 557, c_boatCtlDescription = 558, c_copCtlDescription = 559, c_pizzaCtlDescription = 560, @@ -182,8 +189,8 @@ class Infocenter : public LegoWorld { MxU8 HandleMouseMove(MxS32 p_x, MxS32 p_y); MxU8 HandleButtonUp(MxS32 p_x, MxS32 p_y); MxU8 HandleClick(LegoControlManagerEvent& p_param); - MxLong HandleEndAction(MxParam& p_param); - MxLong HandleNotification0(MxParam&); + MxLong HandleEndAction(MxEndActionNotificationParam& p_param); + MxLong HandleNotification0(MxNotificationParam& p_param); void UpdateFrameHot(MxBool p_display); void FUN_10070e90(); diff --git a/LEGO1/lego/legoomni/include/infocenterstate.h b/LEGO1/lego/legoomni/include/infocenterstate.h index ed23acef..ebe737b6 100644 --- a/LEGO1/lego/legoomni/include/infocenterstate.h +++ b/LEGO1/lego/legoomni/include/infocenterstate.h @@ -30,6 +30,8 @@ class InfocenterState : public LegoState { inline MxS16 GetInfocenterBufferSize() { return sizeof(m_buffer) / sizeof(m_buffer[0]); } inline MxStillPresenter* GetInfocenterBufferElement(MxS32 p_index) { return m_buffer[p_index]; } + inline StateStruct& GetUnknown0x08() { return m_unk0x08; } + inline StateStruct& GetUnknown0x14() { return m_unk0x14; } inline StateStruct& GetUnknown0x68() { return m_unk0x68; } inline MxU32 GetUnknown0x74() { return m_unk0x74; } @@ -39,7 +41,8 @@ class InfocenterState : public LegoState { // InfocenterState::`scalar deleting destructor' private: - undefined m_unk0x08[0x18]; // 0x08 + StateStruct m_unk0x08; // 0x08 + StateStruct m_unk0x14; // 0x14 StateStruct m_unk0x20[3]; // 0x20 StateStruct m_unk0x44[3]; // 0x44 StateStruct m_unk0x68; // 0x68 diff --git a/LEGO1/lego/legoomni/include/radio.h b/LEGO1/lego/legoomni/include/radio.h index dd37ba44..bfcd6a16 100644 --- a/LEGO1/lego/legoomni/include/radio.h +++ b/LEGO1/lego/legoomni/include/radio.h @@ -32,6 +32,8 @@ class Radio : public MxCore { void Play(); void Stop(); + inline RadioState* GetState() { return m_state; } + // SYNTHETIC: LEGO1 0x1002c970 // Radio::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/src/infocenter/infocenter.cpp b/LEGO1/lego/legoomni/src/infocenter/infocenter.cpp index 2a98f5af..43e39a13 100644 --- a/LEGO1/lego/legoomni/src/infocenter/infocenter.cpp +++ b/LEGO1/lego/legoomni/src/infocenter/infocenter.cpp @@ -106,10 +106,10 @@ MxLong Infocenter::Notify(MxParam& p_param) if (m_worldStarted) { switch (((MxNotificationParam&) p_param).GetNotification()) { case c_notificationType0: - result = HandleNotification0(p_param); + result = HandleNotification0((MxNotificationParam&) p_param); break; case c_notificationEndAction: - result = HandleEndAction(p_param); + result = HandleEndAction((MxEndActionNotificationParam&) p_param); break; case c_notificationKeyPress: result = HandleKeyPress(((LegoEventNotificationParam&) p_param).GetKey()); @@ -150,9 +150,9 @@ MxLong Infocenter::Notify(MxParam& p_param) } // FUNCTION: LEGO1 0x1006f080 -MxLong Infocenter::HandleEndAction(MxParam& p_param) +MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param) { - MxDSAction* action = ((MxEndActionNotificationParam&) p_param).GetAction(); + MxDSAction* action = p_param.GetAction(); if (action->GetAtomId() == *g_creditsScript && action->GetObjectId() == 499) { Lego()->CloseMainWindow(); return 1; @@ -637,9 +637,71 @@ MxU8 Infocenter::HandleClick(LegoControlManagerEvent& p_param) return 1; } -// STUB: LEGO1 0x10070870 -MxLong Infocenter::HandleNotification0(MxParam&) +// FUNCTION: LEGO1 0x10070870 +MxLong Infocenter::HandleNotification0(MxNotificationParam& p_param) { + if (p_param.GetSender() == NULL) { + if (m_infocenterState->GetUnknown0x74() == 8) { + m_infoManDialogueTimer = 0; + StopCutscene(); + PlayAction(c_exitConfirmationDialogue); + } + + return 1; + } + + if (p_param.GetSender()->IsA("MxEntity") && m_infocenterState->GetUnknown0x74() != 5 && + m_infocenterState->GetUnknown0x74() != 12) { + switch (((MxEntity*) p_param.GetSender())->GetEntityId()) { + case 5: { + m_infoManDialogueTimer = 0; + + LegoState::StateStruct& state = + GameState()->GetUnknown10() ? m_infocenterState->GetUnknown0x14() : m_infocenterState->GetUnknown0x08(); + + InfomainScript objectId = (InfomainScript) state.FUN_10014d00(); + PlayAction(objectId); + FUN_10015860(g_object2x4red, 0); + FUN_10015860(g_object2x4grn, 0); + return 1; + } + case 6: + if (m_infocenterState->GetUnknown0x74() == 8) { + StopCurrentAction(); + FUN_10015860(g_object2x4red, 0); + FUN_10015860(g_object2x4grn, 0); + m_infocenterState->SetUnknown0x74(2); + PlayAction(c_infomanSneeze); + return 1; + } + case 7: + if (m_infocenterState->GetUnknown0x74() == 8) { + if (m_infocenterState->GetInfocenterBufferElement(0)) { + GameState()->Save(0); + } + + m_infocenterState->SetUnknown0x74(12); + PlayAction(c_exitGameDialogue); + InputManager()->DisableInputProcessing(); + InputManager()->SetUnknown336(TRUE); + return 1; + } + } + } + else { + if (p_param.GetSender()->IsA("Radio") && m_radio.GetState()->IsActive()) { + if (m_currentInfomainScript == c_unk40 || m_currentInfomainScript == c_unk41 || + m_currentInfomainScript == c_unk42 || m_currentInfomainScript == c_unk43 || + m_currentInfomainScript == c_unk44 || m_currentInfomainScript == c_unk557 || + m_currentInfomainScript == c_boatCtlDescription || m_currentInfomainScript == c_raceCtlDescription || + m_currentInfomainScript == c_pizzaCtlDescription || m_currentInfomainScript == c_gasCtlDescription || + m_currentInfomainScript == c_medCtlDescription || m_currentInfomainScript == c_copCtlDescription) { + StopCurrentAction(); + return 1; + } + } + } + return 1; }