2023-06-29 04:10:08 -04:00
|
|
|
#include "infocenter.h"
|
|
|
|
|
2024-02-07 15:23:35 -05:00
|
|
|
#include "act3state.h"
|
2024-03-10 12:08:21 -04:00
|
|
|
#include "credits_actions.h"
|
2024-02-05 12:35:26 -05:00
|
|
|
#include "helicopterstate.h"
|
2024-01-17 11:53:53 -05:00
|
|
|
#include "infocenterstate.h"
|
2024-03-17 13:01:47 -04:00
|
|
|
#include "infomain_actions.h"
|
2024-01-20 12:41:22 -05:00
|
|
|
#include "jukebox.h"
|
2024-03-17 13:01:47 -04:00
|
|
|
#include "jukebox_actions.h"
|
2024-02-07 15:23:35 -05:00
|
|
|
#include "legoact2state.h"
|
2024-02-05 12:35:26 -05:00
|
|
|
#include "legoanimationmanager.h"
|
|
|
|
#include "legobuildingmanager.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "legocharactermanager.h"
|
2024-01-17 11:53:53 -05:00
|
|
|
#include "legocontrolmanager.h"
|
|
|
|
#include "legogamestate.h"
|
|
|
|
#include "legoinputmanager.h"
|
|
|
|
#include "legoomni.h"
|
2024-02-05 12:35:26 -05:00
|
|
|
#include "legoplantmanager.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "legoutils.h"
|
2024-01-17 11:53:53 -05:00
|
|
|
#include "legovideomanager.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "misc.h"
|
2024-01-17 11:53:53 -05:00
|
|
|
#include "mxactionnotificationparam.h"
|
|
|
|
#include "mxbackgroundaudiomanager.h"
|
2024-02-02 16:32:50 -05:00
|
|
|
#include "mxcontrolpresenter.h"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "mxmisc.h"
|
2024-01-17 11:53:53 -05:00
|
|
|
#include "mxnotificationmanager.h"
|
|
|
|
#include "mxstillpresenter.h"
|
2024-01-18 21:00:55 -05:00
|
|
|
#include "mxticklemanager.h"
|
2024-01-17 11:53:53 -05:00
|
|
|
#include "mxtransitionmanager.h"
|
2024-03-10 12:08:21 -04:00
|
|
|
#include "sndanim_actions.h"
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
DECOMP_SIZE_ASSERT(Infocenter, 0x1d8)
|
2024-01-21 12:38:22 -05:00
|
|
|
DECOMP_SIZE_ASSERT(InfocenterMapEntry, 0x18)
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f76a0
|
|
|
|
const char* g_object2x4red = "2x4red";
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f76a4
|
|
|
|
const char* g_object2x4grn = "2x4grn";
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1006ea20
|
2023-06-29 04:10:08 -04:00
|
|
|
Infocenter::Infocenter()
|
|
|
|
{
|
2024-02-05 12:35:26 -05:00
|
|
|
m_selectedCharacter = e_noCharacter;
|
2024-02-02 16:58:33 -05:00
|
|
|
m_unk0x11c = NULL;
|
2024-01-17 11:53:53 -05:00
|
|
|
m_infocenterState = NULL;
|
2024-02-02 16:58:33 -05:00
|
|
|
m_frameHotBitmap = NULL;
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_undefined;
|
2024-03-10 12:08:21 -04:00
|
|
|
m_currentInfomainScript = InfomainScript::c_noneInfomain;
|
2024-01-17 11:56:41 -05:00
|
|
|
m_currentCutscene = e_noIntro;
|
2024-01-17 11:53:53 -05:00
|
|
|
|
2024-01-21 12:38:22 -05:00
|
|
|
memset(&m_mapAreas, 0, sizeof(m_mapAreas));
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
m_unk0x1c8 = -1;
|
|
|
|
SetAppCursor(1);
|
|
|
|
NotificationManager()->Register(this);
|
|
|
|
|
2024-01-20 09:24:54 -05:00
|
|
|
m_infoManDialogueTimer = 0;
|
|
|
|
m_bookAnimationTimer = 0;
|
2024-01-17 11:53:53 -05:00
|
|
|
m_unk0x1d4 = 0;
|
|
|
|
m_unk0x1d6 = 0;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2024-01-18 21:00:55 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006ec90
|
2023-06-29 04:10:08 -04:00
|
|
|
Infocenter::~Infocenter()
|
|
|
|
{
|
2024-01-18 21:00:55 -05:00
|
|
|
BackgroundAudioManager()->Stop();
|
|
|
|
|
|
|
|
MxS16 i = 0;
|
|
|
|
do {
|
2024-02-11 10:44:55 -05:00
|
|
|
if (m_infocenterState->GetNameLetter(i) != NULL) {
|
|
|
|
m_infocenterState->GetNameLetter(i)->Enable(FALSE);
|
2024-01-18 21:00:55 -05:00
|
|
|
}
|
|
|
|
i++;
|
2024-02-11 10:44:55 -05:00
|
|
|
} while (i < m_infocenterState->GetMaxNameLength());
|
2024-01-18 21:00:55 -05:00
|
|
|
|
|
|
|
ControlManager()->Unregister(this);
|
|
|
|
|
|
|
|
InputManager()->UnRegister(this);
|
|
|
|
if (InputManager()->GetWorld() == this) {
|
|
|
|
InputManager()->ClearWorld();
|
|
|
|
}
|
|
|
|
|
|
|
|
NotificationManager()->Unregister(this);
|
|
|
|
|
|
|
|
TickleManager()->UnregisterClient(this);
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2024-02-02 16:32:50 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006ed90
|
2024-01-13 15:00:11 -05:00
|
|
|
MxResult Infocenter::Create(MxDSAction& p_dsAction)
|
2023-12-29 13:04:18 -05:00
|
|
|
{
|
2024-02-02 16:32:50 -05:00
|
|
|
MxResult result = LegoWorld::Create(p_dsAction);
|
|
|
|
if (result == SUCCESS) {
|
2024-01-17 11:53:53 -05:00
|
|
|
InputManager()->SetWorld(this);
|
|
|
|
ControlManager()->Register(this);
|
|
|
|
}
|
|
|
|
|
2024-02-02 16:32:50 -05:00
|
|
|
m_infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState");
|
2024-01-17 11:53:53 -05:00
|
|
|
if (!m_infocenterState) {
|
2024-02-02 16:32:50 -05:00
|
|
|
m_infocenterState = (InfocenterState*) GameState()->CreateState("InfocenterState");
|
2024-01-17 11:53:53 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(3);
|
|
|
|
}
|
|
|
|
else {
|
2024-02-02 16:32:50 -05:00
|
|
|
if (m_infocenterState->GetUnknown0x74() != 8 && m_infocenterState->GetUnknown0x74() != 4 &&
|
|
|
|
m_infocenterState->GetUnknown0x74() != 15) {
|
|
|
|
m_infocenterState->SetUnknown0x74(2);
|
|
|
|
}
|
|
|
|
|
|
|
|
MxS16 count, i;
|
2024-02-11 10:44:55 -05:00
|
|
|
for (count = 0; count < m_infocenterState->GetMaxNameLength(); count++) {
|
|
|
|
if (m_infocenterState->GetNameLetter(count) == NULL) {
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < count; i++) {
|
2024-02-11 10:44:55 -05:00
|
|
|
if (m_infocenterState->GetNameLetter(i)) {
|
|
|
|
m_infocenterState->GetNameLetter(i)->Enable(TRUE);
|
|
|
|
m_infocenterState->GetNameLetter(i)->SetTickleState(MxPresenter::e_repeating);
|
2024-02-19 09:24:30 -05:00
|
|
|
m_infocenterState->GetNameLetter(i)->SetPosition(((7 - count) / 2 + i) * 29 + 223, 45);
|
2024-02-02 16:32:50 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-10 13:17:07 -05:00
|
|
|
GameState()->SetCurrentArea(LegoGameState::e_infomain);
|
|
|
|
GameState()->StopArea(LegoGameState::e_previousArea);
|
2024-02-02 16:32:50 -05:00
|
|
|
|
|
|
|
if (m_infocenterState->GetUnknown0x74() == 4) {
|
|
|
|
LegoGameState* state = GameState();
|
|
|
|
state->SetPreviousArea(GameState()->GetUnknown0x42c());
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
InputManager()->Register(this);
|
|
|
|
SetIsWorldActive(FALSE);
|
2024-02-02 16:32:50 -05:00
|
|
|
|
|
|
|
return result;
|
2023-12-29 13:04:18 -05:00
|
|
|
}
|
|
|
|
|
2024-01-17 11:53:53 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006ef10
|
2023-12-13 05:48:14 -05:00
|
|
|
MxLong Infocenter::Notify(MxParam& p_param)
|
2023-06-29 04:10:08 -04:00
|
|
|
{
|
2024-01-17 11:53:53 -05:00
|
|
|
MxLong result = 0;
|
|
|
|
LegoWorld::Notify(p_param);
|
|
|
|
|
|
|
|
if (m_worldStarted) {
|
|
|
|
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
|
|
|
case c_notificationType0:
|
2024-02-01 15:56:27 -05:00
|
|
|
result = HandleNotification0((MxNotificationParam&) p_param);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
case c_notificationEndAction:
|
2024-02-01 15:56:27 -05:00
|
|
|
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
case c_notificationKeyPress:
|
|
|
|
result = HandleKeyPress(((LegoEventNotificationParam&) p_param).GetKey());
|
|
|
|
break;
|
|
|
|
case c_notificationButtonUp:
|
|
|
|
result = HandleButtonUp(
|
|
|
|
((LegoEventNotificationParam&) p_param).GetX(),
|
|
|
|
((LegoEventNotificationParam&) p_param).GetY()
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
case c_notificationMouseMove:
|
|
|
|
result = HandleMouseMove(
|
|
|
|
((LegoEventNotificationParam&) p_param).GetX(),
|
|
|
|
((LegoEventNotificationParam&) p_param).GetY()
|
|
|
|
);
|
|
|
|
break;
|
2024-01-31 09:47:15 -05:00
|
|
|
case c_notificationClick:
|
|
|
|
result = HandleClick((LegoControlManagerEvent&) p_param);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
case c_notificationTransitioned:
|
|
|
|
StopBookAnimation();
|
2024-01-20 09:24:54 -05:00
|
|
|
m_bookAnimationTimer = 0;
|
2024-01-17 11:53:53 -05:00
|
|
|
|
2024-01-29 16:17:17 -05:00
|
|
|
if (m_infocenterState->GetUnknown0x74() == 0x0c) {
|
2024-01-17 11:53:53 -05:00
|
|
|
StartCredits();
|
|
|
|
m_infocenterState->SetUnknown0x74(0xd);
|
|
|
|
}
|
2024-03-13 13:17:20 -04:00
|
|
|
else if (m_destLocation != 0) {
|
2024-01-17 11:53:53 -05:00
|
|
|
BackgroundAudioManager()->RaiseVolume();
|
2024-03-13 13:17:20 -04:00
|
|
|
GameState()->SwitchArea(m_destLocation);
|
|
|
|
m_destLocation = LegoGameState::e_undefined;
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1006f080
|
2024-02-01 15:56:27 -05:00
|
|
|
MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
|
2024-01-17 11:53:53 -05:00
|
|
|
{
|
2024-02-01 15:56:27 -05:00
|
|
|
MxDSAction* action = p_param.GetAction();
|
2024-03-10 12:08:21 -04:00
|
|
|
if (action->GetAtomId() == *g_creditsScript && action->GetObjectId() == CreditsScript::c_LegoCredits) {
|
2024-01-17 11:53:53 -05:00
|
|
|
Lego()->CloseMainWindow();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
if (action->GetAtomId() == m_atom && (action->GetObjectId() == InfomainScript::c_Mama_All_Movie ||
|
|
|
|
action->GetObjectId() == InfomainScript::c_Papa_All_Movie ||
|
|
|
|
action->GetObjectId() == InfomainScript::c_Pepper_All_Movie ||
|
|
|
|
action->GetObjectId() == InfomainScript::c_Nick_All_Movie ||
|
|
|
|
action->GetObjectId() == InfomainScript::c_Laura_All_Movie)) {
|
2024-01-17 11:53:53 -05:00
|
|
|
if (m_unk0x1d4) {
|
|
|
|
m_unk0x1d4--;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!m_unk0x1d4) {
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
2024-02-26 11:19:16 -05:00
|
|
|
GameState()->SetActor(m_selectedCharacter);
|
2024-01-17 11:53:53 -05:00
|
|
|
|
2024-02-05 12:35:26 -05:00
|
|
|
switch (m_selectedCharacter) {
|
|
|
|
case e_pepper:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_avo901in_RunAnim);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
2024-02-05 12:35:26 -05:00
|
|
|
case e_mama:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_avo902in_RunAnim);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
2024-02-05 12:35:26 -05:00
|
|
|
case e_papa:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_avo903in_RunAnim);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
2024-02-05 12:35:26 -05:00
|
|
|
case e_nick:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_avo904in_RunAnim);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
2024-02-05 12:35:26 -05:00
|
|
|
case e_laura:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_avo905in_RunAnim);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2024-01-31 09:47:15 -05:00
|
|
|
UpdateFrameHot(TRUE);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MxLong result = m_radio.Notify(p_param);
|
|
|
|
|
2024-02-01 15:42:10 -05:00
|
|
|
if (result || (action->GetAtomId() != m_atom && action->GetAtomId() != *g_introScript)) {
|
2024-01-17 11:53:53 -05:00
|
|
|
return result;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2024-01-17 11:53:53 -05:00
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
if (action->GetObjectId() == InfomainScript::c_iicx26in_RunAnim) {
|
2024-01-20 09:24:54 -05:00
|
|
|
ControlManager()->FUN_100293c0(0x10, action->GetAtomId().GetInternal(), 0);
|
2024-01-17 11:53:53 -05:00
|
|
|
m_unk0x1d6 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (m_infocenterState->GetUnknown0x74()) {
|
|
|
|
case 0:
|
2024-01-17 11:56:41 -05:00
|
|
|
switch (m_currentCutscene) {
|
2024-01-17 11:53:53 -05:00
|
|
|
case e_legoMovie:
|
|
|
|
PlayCutscene(e_mindscapeMovie, FALSE);
|
|
|
|
return 1;
|
|
|
|
case e_mindscapeMovie:
|
|
|
|
PlayCutscene(e_introMovie, TRUE);
|
|
|
|
return 1;
|
|
|
|
case e_badEndMovie:
|
|
|
|
StopCutscene();
|
|
|
|
m_infocenterState->SetUnknown0x74(11);
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_tic092in_RunAnim);
|
2024-01-17 11:56:41 -05:00
|
|
|
m_currentCutscene = e_noIntro;
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
case e_goodEndMovie:
|
|
|
|
StopCutscene();
|
|
|
|
m_infocenterState->SetUnknown0x74(11);
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_tic089in_RunAnim);
|
2024-01-17 11:56:41 -05:00
|
|
|
m_currentCutscene = e_noIntro;
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// default / 2nd case probably?
|
|
|
|
StopCutscene();
|
|
|
|
m_infocenterState->SetUnknown0x74(11);
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_iic001in_RunAnim);
|
2024-01-17 11:56:41 -05:00
|
|
|
m_currentCutscene = e_noIntro;
|
2024-01-17 11:53:53 -05:00
|
|
|
|
2024-02-11 10:44:55 -05:00
|
|
|
if (!m_infocenterState->HasRegistered()) {
|
2024-01-20 09:24:54 -05:00
|
|
|
m_bookAnimationTimer = 1;
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
m_infocenterState->SetUnknown0x74(11);
|
|
|
|
|
2024-01-17 11:56:41 -05:00
|
|
|
switch (m_currentCutscene) {
|
2024-01-17 11:53:53 -05:00
|
|
|
case e_badEndMovie:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_tic092in_RunAnim);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
case e_goodEndMovie:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_tic089in_RunAnim);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
default:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_iic001in_RunAnim);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
2024-01-17 11:56:41 -05:00
|
|
|
m_currentCutscene = e_noIntro;
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
case 2:
|
2024-03-19 14:44:42 -04:00
|
|
|
SetROIVisible(g_object2x4red, FALSE);
|
|
|
|
SetROIVisible(g_object2x4grn, FALSE);
|
2024-01-17 11:53:53 -05:00
|
|
|
BackgroundAudioManager()->RaiseVolume();
|
|
|
|
return 1;
|
|
|
|
case 4:
|
2024-03-10 12:08:21 -04:00
|
|
|
if (action->GetObjectId() == InfomainScript::c_GoTo_RegBook ||
|
|
|
|
action->GetObjectId() == InfomainScript::c_GoTo_RegBook_Red) {
|
2024-03-11 04:57:58 -04:00
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
2024-01-17 11:53:53 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(14);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
if (action->GetObjectId() == m_currentInfomainScript) {
|
2024-02-10 11:37:22 -05:00
|
|
|
if (GameState()->GetCurrentAct() != LegoGameState::e_act3 && m_selectedCharacter != e_noCharacter) {
|
2024-02-26 11:19:16 -05:00
|
|
|
GameState()->SetActor(m_selectedCharacter);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
2024-03-11 04:57:58 -04:00
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
2024-01-17 11:53:53 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(14);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 11:
|
2024-03-10 12:08:21 -04:00
|
|
|
if (!m_infocenterState->HasRegistered() && m_currentInfomainScript != InfomainScript::c_Mama_All_Movie &&
|
|
|
|
m_currentInfomainScript != InfomainScript::c_Papa_All_Movie &&
|
|
|
|
m_currentInfomainScript != InfomainScript::c_Pepper_All_Movie &&
|
|
|
|
m_currentInfomainScript != InfomainScript::c_Nick_All_Movie &&
|
|
|
|
m_currentInfomainScript != InfomainScript::c_Laura_All_Movie) {
|
2024-01-20 09:24:54 -05:00
|
|
|
m_infoManDialogueTimer = 1;
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
m_infocenterState->SetUnknown0x74(2);
|
2024-03-19 14:44:42 -04:00
|
|
|
SetROIVisible("infoman", TRUE);
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
case 12:
|
|
|
|
if (action->GetObjectId() == m_currentInfomainScript) {
|
2024-03-11 04:57:58 -04:00
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
result = 1;
|
|
|
|
|
|
|
|
return result;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2024-02-07 15:23:35 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006f4e0
|
2024-01-27 15:18:35 -05:00
|
|
|
void Infocenter::ReadyWorld()
|
2023-12-29 13:04:18 -05:00
|
|
|
{
|
2024-01-20 09:24:54 -05:00
|
|
|
m_infoManDialogueTimer = 0;
|
|
|
|
m_bookAnimationTimer = 0;
|
2024-01-17 11:53:53 -05:00
|
|
|
m_unk0x1d4 = 0;
|
|
|
|
m_unk0x1d6 = 0;
|
|
|
|
|
2024-01-26 16:00:02 -05:00
|
|
|
MxStillPresenter* bg = (MxStillPresenter*) Find("MxStillPresenter", "Background_Bitmap");
|
|
|
|
MxStillPresenter* bgRed = (MxStillPresenter*) Find("MxStillPresenter", "BackgroundRed_Bitmap");
|
2024-01-17 11:53:53 -05:00
|
|
|
|
2024-02-10 11:37:22 -05:00
|
|
|
switch (GameState()->GetCurrentAct()) {
|
|
|
|
case LegoGameState::e_act1:
|
2024-02-07 15:23:35 -05:00
|
|
|
bg->Enable(TRUE);
|
2024-01-17 11:53:53 -05:00
|
|
|
InitializeBitmaps();
|
2024-02-07 15:23:35 -05:00
|
|
|
|
2024-01-17 11:53:53 -05:00
|
|
|
switch (m_infocenterState->GetUnknown0x74()) {
|
|
|
|
case 3:
|
|
|
|
PlayCutscene(e_legoMovie, TRUE);
|
|
|
|
m_infocenterState->SetUnknown0x74(0);
|
2024-02-07 15:23:35 -05:00
|
|
|
break;
|
2024-01-17 11:53:53 -05:00
|
|
|
case 4:
|
|
|
|
m_infocenterState->SetUnknown0x74(2);
|
2024-02-11 10:44:55 -05:00
|
|
|
if (!m_infocenterState->HasRegistered()) {
|
2024-01-20 09:24:54 -05:00
|
|
|
m_bookAnimationTimer = 1;
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_iicx18in_RunAnim);
|
|
|
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
2024-01-17 15:48:48 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2024-02-07 15:23:35 -05:00
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
default: {
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
2024-02-07 15:23:35 -05:00
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
InfomainScript::Script script =
|
|
|
|
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
2024-02-07 15:23:35 -05:00
|
|
|
PlayAction(script);
|
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
if (script == InfomainScript::c_iicx26in_RunAnim) {
|
2024-02-07 15:23:35 -05:00
|
|
|
m_unk0x1d6 = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
|
|
|
|
2024-02-11 10:44:55 -05:00
|
|
|
if (!m_infocenterState->HasRegistered()) {
|
2024-02-07 15:23:35 -05:00
|
|
|
m_bookAnimationTimer = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_infocenterState->SetUnknown0x74(11);
|
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
2024-02-07 15:23:35 -05:00
|
|
|
}
|
2024-01-17 11:53:53 -05:00
|
|
|
case 8:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
|
|
|
PlayAction(InfomainScript::c_iic043in_RunAnim);
|
2024-01-17 15:48:48 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2024-02-07 15:23:35 -05:00
|
|
|
break;
|
2024-01-17 11:53:53 -05:00
|
|
|
case 0xf:
|
2024-02-07 15:23:35 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(2);
|
2024-02-11 10:44:55 -05:00
|
|
|
if (!m_infocenterState->HasRegistered()) {
|
2024-01-20 09:24:54 -05:00
|
|
|
m_bookAnimationTimer = 1;
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_iicx17in_RunAnim);
|
|
|
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
2024-01-17 15:48:48 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2024-02-07 15:23:35 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return;
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_act2: {
|
2024-02-07 15:23:35 -05:00
|
|
|
if (m_infocenterState->GetUnknown0x74() == 8) {
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
2024-02-07 15:23:35 -05:00
|
|
|
bgRed->Enable(TRUE);
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_iic043in_RunAnim);
|
2024-02-07 15:23:35 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2024-01-17 11:53:53 -05:00
|
|
|
return;
|
|
|
|
}
|
2024-02-07 15:23:35 -05:00
|
|
|
|
|
|
|
LegoAct2State* state = (LegoAct2State*) GameState()->GetState("LegoAct2State");
|
2024-02-10 11:37:22 -05:00
|
|
|
GameState()->FindLoadedAct();
|
2024-02-07 15:23:35 -05:00
|
|
|
|
|
|
|
if (state && state->GetUnknown0x08() == 0x68) {
|
|
|
|
bg->Enable(TRUE);
|
|
|
|
PlayCutscene(e_badEndMovie, TRUE);
|
|
|
|
m_infocenterState->SetUnknown0x74(0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_infocenterState->GetUnknown0x74() == 4) {
|
|
|
|
bgRed->Enable(TRUE);
|
|
|
|
|
2024-02-10 11:37:22 -05:00
|
|
|
if (GameState()->GetCurrentAct() == GameState()->GetLoadedAct()) {
|
2024-02-10 13:17:07 -05:00
|
|
|
GameState()->SetCurrentArea(LegoGameState::e_act2main);
|
|
|
|
GameState()->StopArea(LegoGameState::e_act2main);
|
|
|
|
GameState()->SetCurrentArea(LegoGameState::e_infomain);
|
2024-02-07 15:23:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
m_infocenterState->SetUnknown0x74(5);
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_act2main;
|
2024-02-07 15:23:35 -05:00
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
InfomainScript::Script script =
|
|
|
|
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
2024-02-07 15:23:35 -05:00
|
|
|
PlayAction(script);
|
|
|
|
|
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
|
|
|
InfomainScript::Script script =
|
|
|
|
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
2024-02-07 15:23:35 -05:00
|
|
|
PlayAction(script);
|
|
|
|
bgRed->Enable(TRUE);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
2024-02-07 15:23:35 -05:00
|
|
|
}
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_act3: {
|
2024-02-07 15:23:35 -05:00
|
|
|
if (m_infocenterState->GetUnknown0x74() == 8) {
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
2024-02-07 15:23:35 -05:00
|
|
|
bgRed->Enable(TRUE);
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_iic043in_RunAnim);
|
2024-02-07 15:23:35 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Act3State* state = (Act3State*) GameState()->GetState("Act3State");
|
2024-02-10 11:37:22 -05:00
|
|
|
GameState()->FindLoadedAct();
|
2024-02-07 15:23:35 -05:00
|
|
|
|
|
|
|
if (state) {
|
|
|
|
if (state->GetUnknown0x08() == 3) {
|
|
|
|
bg->Enable(TRUE);
|
|
|
|
PlayCutscene(e_badEndMovie, TRUE);
|
|
|
|
m_infocenterState->SetUnknown0x74(0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (state && state->GetUnknown0x08() == 2) {
|
|
|
|
bg->Enable(TRUE);
|
|
|
|
PlayCutscene(e_goodEndMovie, TRUE);
|
|
|
|
m_infocenterState->SetUnknown0x74(0);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_infocenterState->GetUnknown0x74() == 4) {
|
|
|
|
bgRed->Enable(TRUE);
|
|
|
|
|
2024-02-10 11:37:22 -05:00
|
|
|
if (GameState()->GetCurrentAct() == GameState()->GetLoadedAct()) {
|
2024-02-10 13:17:07 -05:00
|
|
|
GameState()->SetCurrentArea(LegoGameState::e_act3script);
|
|
|
|
GameState()->StopArea(LegoGameState::e_act3script);
|
|
|
|
GameState()->SetCurrentArea(LegoGameState::e_infomain);
|
2024-02-07 15:23:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
m_infocenterState->SetUnknown0x74(5);
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_act3script;
|
2024-02-07 15:23:35 -05:00
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
InfomainScript::Script script =
|
|
|
|
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
2024-02-07 15:23:35 -05:00
|
|
|
PlayAction(script);
|
|
|
|
|
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
|
|
|
InfomainScript::Script script =
|
|
|
|
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
2024-02-07 15:23:35 -05:00
|
|
|
PlayAction(script);
|
|
|
|
bgRed->Enable(TRUE);
|
2024-01-17 11:53:53 -05:00
|
|
|
break;
|
|
|
|
}
|
2024-02-07 15:23:35 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
m_infocenterState->SetUnknown0x74(11);
|
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
2024-01-21 12:38:22 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006f9a0
|
2024-01-17 11:53:53 -05:00
|
|
|
void Infocenter::InitializeBitmaps()
|
|
|
|
{
|
2024-01-21 12:38:22 -05:00
|
|
|
m_radio.Initialize(TRUE);
|
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_LeftArrow_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_RightArrow_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Info_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Boat_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Race_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Pizza_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Gas_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Med_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Cop_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Mama_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Papa_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Pepper_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Nick_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Laura_Ctl))->Enable(TRUE);
|
|
|
|
((MxPresenter*) Find(m_atom, InfomainScript::c_Radio_Ctl))->Enable(TRUE);
|
2024-01-26 16:00:02 -05:00
|
|
|
|
|
|
|
m_mapAreas[0].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Info_A_Bitmap");
|
2024-01-31 09:47:15 -05:00
|
|
|
m_mapAreas[0].m_area.SetLeft(391);
|
|
|
|
m_mapAreas[0].m_area.SetTop(182);
|
|
|
|
m_mapAreas[0].m_area.SetRight(427);
|
|
|
|
m_mapAreas[0].m_area.SetBottom(230);
|
2024-01-21 12:38:22 -05:00
|
|
|
m_mapAreas[0].m_unk0x04 = 3;
|
|
|
|
|
2024-01-26 16:00:02 -05:00
|
|
|
m_mapAreas[1].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Boat_A_Bitmap");
|
2024-01-31 09:47:15 -05:00
|
|
|
m_mapAreas[1].m_area.SetLeft(304);
|
|
|
|
m_mapAreas[1].m_area.SetTop(225);
|
|
|
|
m_mapAreas[1].m_area.SetRight(350);
|
|
|
|
m_mapAreas[1].m_area.SetBottom(268);
|
2024-01-21 12:38:22 -05:00
|
|
|
m_mapAreas[1].m_unk0x04 = 10;
|
|
|
|
|
2024-01-26 16:00:02 -05:00
|
|
|
m_mapAreas[2].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Race_A_Bitmap");
|
2024-01-31 09:47:15 -05:00
|
|
|
m_mapAreas[2].m_area.SetLeft(301);
|
|
|
|
m_mapAreas[2].m_area.SetTop(133);
|
|
|
|
m_mapAreas[2].m_area.SetRight(347);
|
|
|
|
m_mapAreas[2].m_area.SetBottom(181);
|
2024-01-21 12:38:22 -05:00
|
|
|
m_mapAreas[2].m_unk0x04 = 11;
|
|
|
|
|
2024-01-26 16:00:02 -05:00
|
|
|
m_mapAreas[3].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Pizza_A_Bitmap");
|
2024-01-31 09:47:15 -05:00
|
|
|
m_mapAreas[3].m_area.SetLeft(289);
|
|
|
|
m_mapAreas[3].m_area.SetTop(182);
|
|
|
|
m_mapAreas[3].m_area.SetRight(335);
|
|
|
|
m_mapAreas[3].m_area.SetBottom(225);
|
2024-01-21 12:38:22 -05:00
|
|
|
m_mapAreas[3].m_unk0x04 = 12;
|
|
|
|
|
2024-01-26 16:00:02 -05:00
|
|
|
m_mapAreas[4].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Gas_A_Bitmap");
|
2024-01-31 09:47:15 -05:00
|
|
|
m_mapAreas[4].m_area.SetLeft(350);
|
|
|
|
m_mapAreas[4].m_area.SetTop(161);
|
|
|
|
m_mapAreas[4].m_area.SetRight(391);
|
|
|
|
m_mapAreas[4].m_area.SetBottom(209);
|
2024-01-21 12:38:22 -05:00
|
|
|
m_mapAreas[4].m_unk0x04 = 13;
|
|
|
|
|
2024-01-26 16:00:02 -05:00
|
|
|
m_mapAreas[5].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Med_A_Bitmap");
|
2024-01-31 09:47:15 -05:00
|
|
|
m_mapAreas[5].m_area.SetLeft(392);
|
|
|
|
m_mapAreas[5].m_area.SetTop(130);
|
|
|
|
m_mapAreas[5].m_area.SetRight(438);
|
|
|
|
m_mapAreas[5].m_area.SetBottom(176);
|
2024-01-21 12:38:22 -05:00
|
|
|
m_mapAreas[5].m_unk0x04 = 14;
|
|
|
|
|
2024-01-26 16:00:02 -05:00
|
|
|
m_mapAreas[6].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Cop_A_Bitmap");
|
2024-01-31 09:47:15 -05:00
|
|
|
m_mapAreas[6].m_area.SetLeft(396);
|
|
|
|
m_mapAreas[6].m_area.SetTop(229);
|
|
|
|
m_mapAreas[6].m_area.SetRight(442);
|
|
|
|
m_mapAreas[6].m_area.SetBottom(272);
|
2024-01-21 12:38:22 -05:00
|
|
|
m_mapAreas[6].m_unk0x04 = 15;
|
|
|
|
|
2024-01-26 16:00:02 -05:00
|
|
|
m_frameHotBitmap = (MxStillPresenter*) Find("MxStillPresenter", "FrameHot_Bitmap");
|
2024-01-21 12:38:22 -05:00
|
|
|
|
2024-01-31 09:47:15 -05:00
|
|
|
UpdateFrameHot(TRUE);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
2024-01-31 09:47:15 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006fd00
|
2024-01-17 11:53:53 -05:00
|
|
|
MxU8 Infocenter::HandleMouseMove(MxS32 p_x, MxS32 p_y)
|
|
|
|
{
|
2024-01-31 09:47:15 -05:00
|
|
|
if (m_unk0x11c) {
|
|
|
|
if (!m_unk0x11c->IsEnabled()) {
|
|
|
|
MxS32 oldDisplayZ = m_unk0x11c->GetDisplayZ();
|
|
|
|
|
|
|
|
m_unk0x11c->SetDisplayZ(1000);
|
|
|
|
VideoManager()->SortPresenterList();
|
|
|
|
m_unk0x11c->Enable(TRUE);
|
2024-02-19 09:24:30 -05:00
|
|
|
m_unk0x11c->SetPosition(p_x, p_y);
|
2024-01-31 09:47:15 -05:00
|
|
|
|
|
|
|
m_unk0x11c->SetDisplayZ(oldDisplayZ);
|
|
|
|
}
|
|
|
|
else {
|
2024-02-19 09:24:30 -05:00
|
|
|
m_unk0x11c->SetPosition(p_x, p_y);
|
2024-01-31 09:47:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
FUN_10070d10(p_x, p_y);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1006fda0
|
|
|
|
MxLong Infocenter::HandleKeyPress(MxS8 p_key)
|
|
|
|
{
|
|
|
|
MxLong result = 0;
|
|
|
|
|
|
|
|
if (p_key == ' ' && m_worldStarted) {
|
|
|
|
switch (m_infocenterState->GetUnknown0x74()) {
|
|
|
|
case 0:
|
|
|
|
StopCutscene();
|
|
|
|
m_infocenterState->SetUnknown0x74(1);
|
|
|
|
|
2024-02-11 10:44:55 -05:00
|
|
|
if (!m_infocenterState->HasRegistered()) {
|
2024-01-20 09:24:54 -05:00
|
|
|
m_bookAnimationTimer = 1;
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
case 4:
|
|
|
|
break;
|
|
|
|
default: {
|
2024-03-10 12:08:21 -04:00
|
|
|
InfomainScript::Script script = m_currentInfomainScript;
|
2024-01-18 14:04:50 -05:00
|
|
|
StopCurrentAction();
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
switch (m_infocenterState->GetUnknown0x74()) {
|
|
|
|
case 5:
|
|
|
|
case 12:
|
|
|
|
m_currentInfomainScript = script;
|
|
|
|
return 1;
|
|
|
|
default:
|
|
|
|
m_infocenterState->SetUnknown0x74(2);
|
|
|
|
return 1;
|
|
|
|
case 8:
|
|
|
|
case 11:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 13:
|
|
|
|
StopCredits();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
result = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
2023-12-29 13:04:18 -05:00
|
|
|
}
|
|
|
|
|
2024-02-02 16:32:50 -05:00
|
|
|
// FUNCTION: LEGO1 0x1006feb0
|
2024-01-17 11:53:53 -05:00
|
|
|
MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
|
|
|
|
{
|
2024-02-02 16:32:50 -05:00
|
|
|
if (m_unk0x11c) {
|
|
|
|
MxControlPresenter* control = InputManager()->GetControlManager()->FUN_100294e0(p_x - 1, p_y - 1);
|
|
|
|
|
|
|
|
switch (m_unk0x11c->GetAction()->GetObjectId()) {
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_PepperHot_Bitmap:
|
2024-02-05 12:35:26 -05:00
|
|
|
m_selectedCharacter = e_pepper;
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_MamaHot_Bitmap:
|
2024-02-05 12:35:26 -05:00
|
|
|
m_selectedCharacter = e_mama;
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_PapaHot_Bitmap:
|
2024-02-05 12:35:26 -05:00
|
|
|
m_selectedCharacter = e_papa;
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_NickHot_Bitmap:
|
2024-02-05 12:35:26 -05:00
|
|
|
m_selectedCharacter = e_nick;
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_LauraHot_Bitmap:
|
2024-02-05 12:35:26 -05:00
|
|
|
m_selectedCharacter = e_laura;
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (control != NULL) {
|
|
|
|
m_infoManDialogueTimer = 0;
|
|
|
|
|
|
|
|
switch (control->GetAction()->GetObjectId()) {
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Pepper_Ctl:
|
2024-02-05 12:35:26 -05:00
|
|
|
if (m_selectedCharacter == e_pepper) {
|
2024-02-02 16:32:50 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
BackgroundAudioManager()->Stop();
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_Pepper_All_Movie);
|
2024-02-02 16:32:50 -05:00
|
|
|
m_unk0x1d4++;
|
|
|
|
}
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Mama_Ctl:
|
2024-02-05 12:35:26 -05:00
|
|
|
if (m_selectedCharacter == e_mama) {
|
2024-02-02 16:32:50 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
BackgroundAudioManager()->Stop();
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_Mama_All_Movie);
|
2024-02-02 16:32:50 -05:00
|
|
|
m_unk0x1d4++;
|
|
|
|
}
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Papa_Ctl:
|
2024-02-05 12:35:26 -05:00
|
|
|
if (m_selectedCharacter == e_papa) {
|
2024-02-02 16:32:50 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
BackgroundAudioManager()->Stop();
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_Papa_All_Movie);
|
2024-02-02 16:32:50 -05:00
|
|
|
m_unk0x1d4++;
|
|
|
|
}
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Nick_Ctl:
|
2024-02-05 12:35:26 -05:00
|
|
|
if (m_selectedCharacter == e_nick) {
|
2024-02-02 16:32:50 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
BackgroundAudioManager()->Stop();
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_Nick_All_Movie);
|
2024-02-02 16:32:50 -05:00
|
|
|
m_unk0x1d4++;
|
|
|
|
}
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Laura_Ctl:
|
2024-02-05 12:35:26 -05:00
|
|
|
if (m_selectedCharacter == e_laura) {
|
2024-02-02 16:32:50 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
BackgroundAudioManager()->Stop();
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_Laura_All_Movie);
|
2024-02-02 16:32:50 -05:00
|
|
|
m_unk0x1d4++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (m_unk0x1c8 != -1) {
|
|
|
|
m_infoManDialogueTimer = 0;
|
|
|
|
|
|
|
|
switch (m_mapAreas[m_unk0x1c8].m_unk0x04) {
|
|
|
|
case 3:
|
2024-02-26 11:19:16 -05:00
|
|
|
GameState()->SetActor(m_selectedCharacter);
|
2024-02-02 16:32:50 -05:00
|
|
|
|
2024-02-05 12:35:26 -05:00
|
|
|
switch (m_selectedCharacter) {
|
|
|
|
case e_pepper:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_avo901in_RunAnim);
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
2024-02-05 12:35:26 -05:00
|
|
|
case e_mama:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_avo902in_RunAnim);
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
2024-02-05 12:35:26 -05:00
|
|
|
case e_papa:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_avo903in_RunAnim);
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
2024-02-05 12:35:26 -05:00
|
|
|
case e_nick:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_avo904in_RunAnim);
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
2024-02-05 12:35:26 -05:00
|
|
|
case e_laura:
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_avo905in_RunAnim);
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 10:
|
2024-02-05 12:35:26 -05:00
|
|
|
if (m_selectedCharacter) {
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_jetraceExterior;
|
2024-02-02 16:32:50 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(5);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 11:
|
2024-02-05 12:35:26 -05:00
|
|
|
if (m_selectedCharacter) {
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_carraceExterior;
|
2024-02-02 16:32:50 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(5);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 12:
|
2024-02-05 12:35:26 -05:00
|
|
|
if (m_selectedCharacter) {
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_pizzeriaExterior;
|
2024-02-02 16:32:50 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(5);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 13:
|
2024-02-05 12:35:26 -05:00
|
|
|
if (m_selectedCharacter) {
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_garageExterior;
|
2024-02-02 16:32:50 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(5);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 14:
|
2024-02-05 12:35:26 -05:00
|
|
|
if (m_selectedCharacter) {
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_hospitalExterior;
|
2024-02-02 16:32:50 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(5);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 15:
|
2024-02-05 12:35:26 -05:00
|
|
|
if (m_selectedCharacter) {
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_policeExterior;
|
2024-02-02 16:32:50 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(5);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
m_unk0x11c->Enable(FALSE);
|
|
|
|
m_unk0x11c = NULL;
|
|
|
|
|
|
|
|
if (m_infocenterState->GetUnknown0x74() == 5) {
|
2024-03-10 12:08:21 -04:00
|
|
|
InfomainScript::Script dialogueToPlay;
|
2024-02-02 16:32:50 -05:00
|
|
|
|
2024-02-10 11:37:22 -05:00
|
|
|
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
2024-02-11 10:44:55 -05:00
|
|
|
if (!m_infocenterState->HasRegistered()) {
|
2024-02-02 16:32:50 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(2);
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_undefined;
|
2024-03-10 12:08:21 -04:00
|
|
|
dialogueToPlay = InfomainScript::c_iic007in_PlayWav;
|
2024-02-02 16:32:50 -05:00
|
|
|
}
|
|
|
|
else {
|
2024-02-05 12:35:26 -05:00
|
|
|
switch (m_selectedCharacter) {
|
|
|
|
case e_pepper:
|
2024-03-10 12:08:21 -04:00
|
|
|
dialogueToPlay = InfomainScript::c_avo901in_RunAnim;
|
2024-02-26 11:19:16 -05:00
|
|
|
GameState()->SetActorId(m_selectedCharacter);
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
2024-02-05 12:35:26 -05:00
|
|
|
case e_mama:
|
2024-03-10 12:08:21 -04:00
|
|
|
dialogueToPlay = InfomainScript::c_avo902in_RunAnim;
|
2024-02-26 11:19:16 -05:00
|
|
|
GameState()->SetActorId(m_selectedCharacter);
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
2024-02-05 12:35:26 -05:00
|
|
|
case e_papa:
|
2024-03-10 12:08:21 -04:00
|
|
|
dialogueToPlay = InfomainScript::c_avo903in_RunAnim;
|
2024-02-26 11:19:16 -05:00
|
|
|
GameState()->SetActorId(m_selectedCharacter);
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
2024-02-05 12:35:26 -05:00
|
|
|
case e_nick:
|
2024-03-10 12:08:21 -04:00
|
|
|
dialogueToPlay = InfomainScript::c_avo904in_RunAnim;
|
2024-02-26 11:19:16 -05:00
|
|
|
GameState()->SetActorId(m_selectedCharacter);
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
2024-02-05 12:35:26 -05:00
|
|
|
case e_laura:
|
2024-03-10 12:08:21 -04:00
|
|
|
dialogueToPlay = InfomainScript::c_avo905in_RunAnim;
|
2024-02-26 11:19:16 -05:00
|
|
|
GameState()->SetActorId(m_selectedCharacter);
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
dialogueToPlay =
|
2024-03-10 12:08:21 -04:00
|
|
|
(InfomainScript::Script) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct())
|
|
|
|
.Next();
|
2024-02-02 16:32:50 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
InputManager()->SetUnknown336(TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dialogueToPlay =
|
2024-03-10 12:08:21 -04:00
|
|
|
(InfomainScript::Script) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct()).Next();
|
2024-02-02 16:32:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
PlayAction(dialogueToPlay);
|
|
|
|
}
|
|
|
|
|
|
|
|
UpdateFrameHot(TRUE);
|
|
|
|
FUN_10070d10(0, 0);
|
|
|
|
}
|
|
|
|
|
2024-01-31 09:47:15 -05:00
|
|
|
return FALSE;
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
2024-01-31 09:47:15 -05:00
|
|
|
// FUNCTION: LEGO1 0x10070370
|
|
|
|
MxU8 Infocenter::HandleClick(LegoControlManagerEvent& p_param)
|
2024-01-17 11:53:53 -05:00
|
|
|
{
|
2024-01-31 09:47:15 -05:00
|
|
|
if (p_param.GetUnknown0x28() == 1) {
|
|
|
|
m_infoManDialogueTimer = 0;
|
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
InfomainScript::Script actionToPlay = InfomainScript::c_noneInfomain;
|
2024-01-31 09:47:15 -05:00
|
|
|
StopCurrentAction();
|
2024-03-10 12:08:21 -04:00
|
|
|
InfomainScript::Script characterBitmap = InfomainScript::c_noneInfomain;
|
2024-01-31 09:47:15 -05:00
|
|
|
|
2024-02-08 19:30:55 -05:00
|
|
|
LegoGameState* state = GameState();
|
2024-01-31 09:47:15 -05:00
|
|
|
|
|
|
|
switch (p_param.GetClickedObjectId()) {
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_LeftArrow_Ctl:
|
2024-01-31 09:47:15 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(14);
|
|
|
|
StopCurrentAction();
|
|
|
|
|
2024-02-10 11:37:22 -05:00
|
|
|
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
2024-01-31 09:47:15 -05:00
|
|
|
m_radio.Stop();
|
2024-03-11 04:57:58 -04:00
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_elevbott;
|
2024-01-31 09:47:15 -05:00
|
|
|
}
|
|
|
|
else {
|
2024-02-10 11:51:56 -05:00
|
|
|
MxU32 objectId = m_infocenterState->GetBricksterDialogue().Next();
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction((InfomainScript::Script) objectId);
|
2024-01-31 09:47:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_RightArrow_Ctl:
|
2024-01-31 09:47:15 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(14);
|
|
|
|
StopCurrentAction();
|
|
|
|
|
2024-02-10 11:37:22 -05:00
|
|
|
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
2024-01-31 09:47:15 -05:00
|
|
|
m_radio.Stop();
|
2024-03-11 04:57:58 -04:00
|
|
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_infoscor;
|
2024-01-31 09:47:15 -05:00
|
|
|
}
|
|
|
|
else {
|
2024-02-10 11:51:56 -05:00
|
|
|
MxU32 objectId = m_infocenterState->GetBricksterDialogue().Next();
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction((InfomainScript::Script) objectId);
|
2024-01-31 09:47:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Info_Ctl:
|
|
|
|
actionToPlay = InfomainScript::c_iic007ra_PlayWav;
|
2024-01-31 09:47:15 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Door_Ctl:
|
2024-01-31 09:47:15 -05:00
|
|
|
if (m_infocenterState->GetUnknown0x74() != 8) {
|
2024-03-10 12:08:21 -04:00
|
|
|
actionToPlay = InfomainScript::c_iic043in_RunAnim;
|
2024-01-31 09:47:15 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
m_infocenterState->SetUnknown0x74(8);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Boat_Ctl:
|
|
|
|
actionToPlay = InfomainScript::c_ijs002ra_PlayWav;
|
2024-01-31 09:47:15 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Race_Ctl:
|
|
|
|
actionToPlay = InfomainScript::c_irt001ra_PlayWav;
|
2024-01-31 09:47:15 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Pizza_Ctl:
|
|
|
|
actionToPlay = InfomainScript::c_ipz006ra_PlayWav;
|
2024-01-31 09:47:15 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Gas_Ctl:
|
|
|
|
actionToPlay = InfomainScript::c_igs004ra_PlayWav;
|
2024-01-31 09:47:15 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Med_Ctl:
|
|
|
|
actionToPlay = InfomainScript::c_iho003ra_PlayWav;
|
2024-01-31 09:47:15 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Cop_Ctl:
|
|
|
|
actionToPlay = InfomainScript::c_ips005ra_PlayWav;
|
2024-01-31 09:47:15 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_BigInfo_Ctl:
|
2024-02-10 11:37:22 -05:00
|
|
|
switch (state->GetCurrentAct()) {
|
|
|
|
case LegoGameState::e_act1:
|
2024-02-08 19:30:55 -05:00
|
|
|
switch (state->GetPreviousArea()) {
|
2024-02-10 13:17:07 -05:00
|
|
|
case LegoGameState::e_infodoor:
|
|
|
|
case LegoGameState::e_regbook:
|
|
|
|
case LegoGameState::e_infoscor:
|
2024-02-08 19:30:55 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(5);
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = state->GetPreviousArea();
|
2024-02-08 19:30:55 -05:00
|
|
|
actionToPlay =
|
2024-03-10 12:08:21 -04:00
|
|
|
(InfomainScript::Script) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct())
|
|
|
|
.Next();
|
2024-02-08 19:30:55 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
InputManager()->SetUnknown336(TRUE);
|
|
|
|
break;
|
2024-02-10 13:17:07 -05:00
|
|
|
case LegoGameState::e_unk4:
|
2024-02-26 11:19:16 -05:00
|
|
|
if (state->GetActorId()) {
|
2024-02-11 10:44:55 -05:00
|
|
|
if (m_infocenterState->HasRegistered()) {
|
2024-02-08 19:30:55 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(5);
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = state->GetPreviousArea();
|
2024-03-10 12:08:21 -04:00
|
|
|
actionToPlay = (InfomainScript::Script) m_infocenterState
|
|
|
|
->GetLeaveDialogue(GameState()->GetCurrentAct())
|
|
|
|
.Next();
|
2024-02-08 19:30:55 -05:00
|
|
|
m_radio.Stop();
|
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
InputManager()->SetUnknown336(TRUE);
|
|
|
|
}
|
|
|
|
else {
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_iic007in_PlayWav);
|
2024-02-08 19:30:55 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_act2:
|
2024-02-08 19:30:55 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(5);
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_act2main;
|
2024-02-10 11:37:22 -05:00
|
|
|
actionToPlay =
|
2024-03-10 12:08:21 -04:00
|
|
|
(InfomainScript::Script) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct()).Next();
|
2024-02-08 19:30:55 -05:00
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
InputManager()->SetUnknown336(TRUE);
|
|
|
|
break;
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_act3:
|
2024-02-08 19:30:55 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(5);
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_act3script;
|
2024-02-10 11:37:22 -05:00
|
|
|
actionToPlay =
|
2024-03-10 12:08:21 -04:00
|
|
|
(InfomainScript::Script) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct()).Next();
|
2024-02-08 19:30:55 -05:00
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
InputManager()->SetUnknown336(TRUE);
|
|
|
|
break;
|
|
|
|
}
|
2024-01-31 09:47:15 -05:00
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Book_Ctl:
|
2024-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_regbook;
|
2024-01-31 09:47:15 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(4);
|
2024-03-10 12:08:21 -04:00
|
|
|
actionToPlay = GameState()->GetCurrentAct() != LegoGameState::e_act1 ? InfomainScript::c_GoTo_RegBook_Red
|
|
|
|
: InfomainScript::c_GoTo_RegBook;
|
2024-01-31 09:47:15 -05:00
|
|
|
m_radio.Stop();
|
2024-02-08 19:30:55 -05:00
|
|
|
GameState()->SetUnknown0x42c(GameState()->GetPreviousArea());
|
2024-01-31 09:47:15 -05:00
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Mama_Ctl:
|
|
|
|
characterBitmap = InfomainScript::c_MamaHot_Bitmap;
|
2024-01-31 09:47:15 -05:00
|
|
|
UpdateFrameHot(FALSE);
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Papa_Ctl:
|
|
|
|
characterBitmap = InfomainScript::c_PapaHot_Bitmap;
|
2024-01-31 09:47:15 -05:00
|
|
|
UpdateFrameHot(FALSE);
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Pepper_Ctl:
|
|
|
|
characterBitmap = InfomainScript::c_PepperHot_Bitmap;
|
2024-01-31 09:47:15 -05:00
|
|
|
UpdateFrameHot(FALSE);
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Nick_Ctl:
|
|
|
|
characterBitmap = InfomainScript::c_NickHot_Bitmap;
|
2024-01-31 09:47:15 -05:00
|
|
|
UpdateFrameHot(FALSE);
|
|
|
|
break;
|
2024-03-10 12:08:21 -04:00
|
|
|
case InfomainScript::c_Laura_Ctl:
|
|
|
|
characterBitmap = InfomainScript::c_LauraHot_Bitmap;
|
2024-01-31 09:47:15 -05:00
|
|
|
UpdateFrameHot(FALSE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
if (actionToPlay != InfomainScript::c_noneInfomain) {
|
2024-01-31 09:47:15 -05:00
|
|
|
PlayAction(actionToPlay);
|
|
|
|
}
|
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
if (characterBitmap != InfomainScript::c_noneInfomain) {
|
2024-01-31 09:47:15 -05:00
|
|
|
m_unk0x11c = (MxStillPresenter*) Find(m_atom, characterBitmap);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2024-02-01 15:56:27 -05:00
|
|
|
// FUNCTION: LEGO1 0x10070870
|
|
|
|
MxLong Infocenter::HandleNotification0(MxNotificationParam& p_param)
|
2024-01-17 11:53:53 -05:00
|
|
|
{
|
2024-02-01 15:56:27 -05:00
|
|
|
// MxLong result
|
|
|
|
MxCore* sender = p_param.GetSender();
|
|
|
|
|
|
|
|
if (sender == NULL) {
|
|
|
|
if (m_infocenterState->GetUnknown0x74() == 8) {
|
|
|
|
m_infoManDialogueTimer = 0;
|
|
|
|
StopCutscene();
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_iic043in_RunAnim);
|
2024-02-01 15:56:27 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (sender->IsA("MxEntity") && m_infocenterState->GetUnknown0x74() != 5 && m_infocenterState->GetUnknown0x74() != 12) {
|
|
|
|
switch (((MxEntity*) sender)->GetEntityId()) {
|
|
|
|
case 5: {
|
|
|
|
m_infoManDialogueTimer = 0;
|
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
InfomainScript::Script objectId;
|
2024-02-10 11:37:22 -05:00
|
|
|
if (GameState()->GetCurrentAct() != LegoGameState::e_act1) {
|
2024-03-10 12:08:21 -04:00
|
|
|
objectId = (InfomainScript::Script) m_infocenterState->GetExitDialogueAct23().Next();
|
2024-02-01 15:56:27 -05:00
|
|
|
}
|
|
|
|
else {
|
2024-03-10 12:08:21 -04:00
|
|
|
objectId = (InfomainScript::Script) m_infocenterState->GetExitDialogueAct1().Next();
|
2024-02-01 15:56:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
PlayAction(objectId);
|
2024-03-19 14:44:42 -04:00
|
|
|
SetROIVisible(g_object2x4red, FALSE);
|
|
|
|
SetROIVisible(g_object2x4grn, FALSE);
|
2024-02-01 15:56:27 -05:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
case 6:
|
|
|
|
if (m_infocenterState->GetUnknown0x74() == 8) {
|
|
|
|
StopCurrentAction();
|
2024-03-19 14:44:42 -04:00
|
|
|
SetROIVisible(g_object2x4red, FALSE);
|
|
|
|
SetROIVisible(g_object2x4grn, FALSE);
|
2024-02-01 15:56:27 -05:00
|
|
|
m_infocenterState->SetUnknown0x74(2);
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_iicb28in_RunAnim);
|
2024-02-01 15:56:27 -05:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
case 7:
|
|
|
|
if (m_infocenterState->GetUnknown0x74() == 8) {
|
2024-02-11 10:44:55 -05:00
|
|
|
if (m_infocenterState->HasRegistered()) {
|
2024-02-01 15:56:27 -05:00
|
|
|
GameState()->Save(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
m_infocenterState->SetUnknown0x74(12);
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_iic046in_RunAnim);
|
2024-02-01 15:56:27 -05:00
|
|
|
InputManager()->DisableInputProcessing();
|
|
|
|
InputManager()->SetUnknown336(TRUE);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (sender->IsA("Radio") && m_radio.GetState()->IsActive()) {
|
2024-03-10 12:08:21 -04:00
|
|
|
if (m_currentInfomainScript == InfomainScript::c_Mama_All_Movie ||
|
|
|
|
m_currentInfomainScript == InfomainScript::c_Papa_All_Movie ||
|
|
|
|
m_currentInfomainScript == InfomainScript::c_Pepper_All_Movie ||
|
|
|
|
m_currentInfomainScript == InfomainScript::c_Nick_All_Movie ||
|
|
|
|
m_currentInfomainScript == InfomainScript::c_Laura_All_Movie ||
|
|
|
|
m_currentInfomainScript == InfomainScript::c_iic007ra_PlayWav ||
|
|
|
|
m_currentInfomainScript == InfomainScript::c_ijs002ra_PlayWav ||
|
|
|
|
m_currentInfomainScript == InfomainScript::c_irt001ra_PlayWav ||
|
|
|
|
m_currentInfomainScript == InfomainScript::c_ipz006ra_PlayWav ||
|
|
|
|
m_currentInfomainScript == InfomainScript::c_igs004ra_PlayWav ||
|
|
|
|
m_currentInfomainScript == InfomainScript::c_iho003ra_PlayWav ||
|
|
|
|
m_currentInfomainScript == InfomainScript::c_ips005ra_PlayWav) {
|
2024-02-01 15:56:27 -05:00
|
|
|
StopCurrentAction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-17 11:53:53 -05:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10070aa0
|
2024-02-02 12:18:46 -05:00
|
|
|
void Infocenter::Enable(MxBool p_enable)
|
2023-12-29 13:04:18 -05:00
|
|
|
{
|
2024-02-02 12:18:46 -05:00
|
|
|
LegoWorld::Enable(p_enable);
|
2024-01-17 11:53:53 -05:00
|
|
|
|
2024-02-02 12:18:46 -05:00
|
|
|
if (p_enable) {
|
2024-01-17 11:53:53 -05:00
|
|
|
InputManager()->SetWorld(this);
|
|
|
|
SetIsWorldActive(FALSE);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (InputManager()->GetWorld() == this) {
|
|
|
|
InputManager()->ClearWorld();
|
|
|
|
}
|
|
|
|
}
|
2023-12-29 13:04:18 -05:00
|
|
|
}
|
|
|
|
|
2024-01-20 09:24:54 -05:00
|
|
|
// FUNCTION: LEGO1 0x10070af0
|
2023-09-21 14:51:24 -04:00
|
|
|
MxResult Infocenter::Tickle()
|
2023-06-29 04:10:08 -04:00
|
|
|
{
|
2024-01-20 09:24:54 -05:00
|
|
|
if (m_worldStarted == FALSE) {
|
|
|
|
LegoWorld::Tickle();
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_infoManDialogueTimer != 0 && (m_infoManDialogueTimer += 100) > 25000) {
|
2024-03-10 12:08:21 -04:00
|
|
|
PlayAction(InfomainScript::c_iicx17in_RunAnim);
|
2024-01-20 09:24:54 -05:00
|
|
|
m_infoManDialogueTimer = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_bookAnimationTimer != 0 && (m_bookAnimationTimer += 100) > 3000) {
|
|
|
|
PlayBookAnimation();
|
|
|
|
m_bookAnimationTimer = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_unk0x1d6 != 0) {
|
|
|
|
m_unk0x1d6 += 100;
|
|
|
|
|
|
|
|
if (m_unk0x1d6 > 3400 && m_unk0x1d6 < 3650) {
|
|
|
|
ControlManager()->FUN_100293c0(0x10, m_atom.GetInternal(), 1);
|
|
|
|
}
|
|
|
|
else if (m_unk0x1d6 > 3650 && m_unk0x1d6 < 3900) {
|
|
|
|
ControlManager()->FUN_100293c0(0x10, m_atom.GetInternal(), 0);
|
|
|
|
}
|
|
|
|
else if (m_unk0x1d6 > 3900 && m_unk0x1d6 < 4150) {
|
|
|
|
ControlManager()->FUN_100293c0(0x10, m_atom.GetInternal(), 1);
|
|
|
|
}
|
|
|
|
else if (m_unk0x1d6 > 4400) {
|
|
|
|
ControlManager()->FUN_100293c0(0x10, m_atom.GetInternal(), 0);
|
|
|
|
m_unk0x1d6 = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return SUCCESS;
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10070c20
|
2024-01-17 11:56:41 -05:00
|
|
|
void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale)
|
2024-01-17 11:53:53 -05:00
|
|
|
{
|
2024-01-17 11:56:41 -05:00
|
|
|
m_currentCutscene = p_entityId;
|
2024-01-17 11:53:53 -05:00
|
|
|
|
|
|
|
VideoManager()->EnableFullScreenMovie(TRUE, p_scale);
|
|
|
|
InputManager()->SetUnknown336(TRUE);
|
|
|
|
InputManager()->SetUnknown335(TRUE);
|
|
|
|
SetAppCursor(0xb); // Hide cursor
|
|
|
|
VideoManager()->GetDisplaySurface()->ClearScreen();
|
|
|
|
|
2024-01-17 11:56:41 -05:00
|
|
|
if (m_currentCutscene != e_noIntro) {
|
2024-02-05 12:35:26 -05:00
|
|
|
// check if the cutscene is an ending
|
2024-01-17 11:56:41 -05:00
|
|
|
if (m_currentCutscene >= e_badEndMovie && m_currentCutscene <= e_goodEndMovie) {
|
2024-02-05 12:35:26 -05:00
|
|
|
Reset();
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
2024-01-17 11:56:41 -05:00
|
|
|
InvokeAction(Extra::ActionType::e_opendisk, *g_introScript, m_currentCutscene, NULL);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10070cb0
|
|
|
|
void Infocenter::StopCutscene()
|
|
|
|
{
|
2024-01-17 11:56:41 -05:00
|
|
|
if (m_currentCutscene != e_noIntro) {
|
|
|
|
InvokeAction(Extra::ActionType::e_close, *g_introScript, m_currentCutscene, NULL);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
VideoManager()->EnableFullScreenMovie(FALSE);
|
|
|
|
InputManager()->SetUnknown335(FALSE);
|
|
|
|
SetAppCursor(0); // Restore cursor to arrow
|
2024-01-17 15:48:48 -05:00
|
|
|
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
2023-12-29 13:04:18 -05:00
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10070d00
|
|
|
|
MxBool Infocenter::VTable0x5c()
|
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2024-01-31 09:47:15 -05:00
|
|
|
// FUNCTION: LEGO1 0x10070d10
|
|
|
|
void Infocenter::FUN_10070d10(MxS32 p_x, MxS32 p_y)
|
|
|
|
{
|
|
|
|
MxS16 i;
|
|
|
|
for (i = 0; i < (MxS32) (sizeof(m_mapAreas) / sizeof(m_mapAreas[0])); i++) {
|
|
|
|
MxS32 right = m_mapAreas[i].m_area.GetRight();
|
|
|
|
MxS32 bottom = m_mapAreas[i].m_area.GetBottom();
|
|
|
|
MxS32 left = m_mapAreas[i].m_area.GetLeft();
|
|
|
|
MxS32 top = m_mapAreas[i].m_area.GetTop();
|
|
|
|
|
2024-02-01 15:42:10 -05:00
|
|
|
if (left <= p_x && p_x <= right && top <= p_y && p_y <= bottom) {
|
2024-01-31 09:47:15 -05:00
|
|
|
break;
|
2024-02-01 15:42:10 -05:00
|
|
|
}
|
2024-01-31 09:47:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
if (i == 7) {
|
|
|
|
i = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i != m_unk0x1c8) {
|
|
|
|
if (m_unk0x1c8 != -1) {
|
2024-02-02 16:32:50 -05:00
|
|
|
m_mapAreas[m_unk0x1c8].m_presenter->Enable(FALSE);
|
2024-01-31 09:47:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
m_unk0x1c8 = i;
|
|
|
|
if (i != -1) {
|
|
|
|
m_mapAreas[i].m_presenter->Enable(TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10070dc0
|
|
|
|
void Infocenter::UpdateFrameHot(MxBool p_display)
|
2024-01-17 11:53:53 -05:00
|
|
|
{
|
2024-01-31 09:47:15 -05:00
|
|
|
if (p_display) {
|
|
|
|
MxS32 x, y;
|
|
|
|
|
2024-02-26 11:19:16 -05:00
|
|
|
switch (GameState()->GetActorId()) {
|
2024-01-31 09:47:15 -05:00
|
|
|
case 1:
|
|
|
|
x = 302;
|
|
|
|
y = 81;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
x = 204;
|
|
|
|
y = 81;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
x = 253;
|
|
|
|
y = 81;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
x = 353;
|
|
|
|
y = 81;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
x = 399;
|
|
|
|
y = 81;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
MxS32 originalDisplayZ = m_frameHotBitmap->GetDisplayZ();
|
|
|
|
|
|
|
|
m_frameHotBitmap->SetDisplayZ(1000);
|
|
|
|
VideoManager()->SortPresenterList();
|
|
|
|
|
|
|
|
m_frameHotBitmap->Enable(TRUE);
|
2024-02-19 09:24:30 -05:00
|
|
|
m_frameHotBitmap->SetPosition(x, y);
|
2024-01-31 09:47:15 -05:00
|
|
|
m_frameHotBitmap->SetDisplayZ(originalDisplayZ);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (m_frameHotBitmap) {
|
|
|
|
m_frameHotBitmap->Enable(FALSE);
|
|
|
|
}
|
|
|
|
}
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
2024-02-05 12:35:26 -05:00
|
|
|
// FUNCTION: LEGO1 0x10070e90
|
|
|
|
void Infocenter::Reset()
|
2024-01-17 11:53:53 -05:00
|
|
|
{
|
2024-02-10 11:37:22 -05:00
|
|
|
switch (GameState()->GetCurrentAct()) {
|
|
|
|
case LegoGameState::e_act2:
|
2024-02-05 12:35:26 -05:00
|
|
|
Lego()->RemoveWorld(*g_act2mainScript, 0);
|
|
|
|
break;
|
2024-02-10 11:37:22 -05:00
|
|
|
case LegoGameState::e_act3:
|
2024-02-05 12:35:26 -05:00
|
|
|
Lego()->RemoveWorld(*g_act3Script, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
PlantManager()->FUN_10027120();
|
|
|
|
BuildingManager()->FUN_10030590();
|
|
|
|
AnimationManager()->FUN_1005ee80(FALSE);
|
2024-03-09 15:07:52 -05:00
|
|
|
CharacterManager()->FUN_100832a0();
|
2024-02-10 11:37:22 -05:00
|
|
|
GameState()->SetCurrentAct(LegoGameState::e_act1);
|
2024-03-13 13:17:20 -04:00
|
|
|
GameState()->SetPreviousArea(LegoGameState::e_undefined);
|
|
|
|
GameState()->SetUnknown0x42c(LegoGameState::e_undefined);
|
2024-02-05 12:35:26 -05:00
|
|
|
|
|
|
|
InitializeBitmaps();
|
|
|
|
m_selectedCharacter = e_pepper;
|
|
|
|
|
2024-02-26 11:19:16 -05:00
|
|
|
GameState()->SetActor(e_pepper);
|
2024-02-05 12:35:26 -05:00
|
|
|
|
|
|
|
HelicopterState* state = (HelicopterState*) GameState()->GetState("HelicopterState");
|
|
|
|
|
|
|
|
if (state) {
|
|
|
|
state->SetFlag();
|
|
|
|
}
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
2024-01-31 09:47:15 -05:00
|
|
|
// FUNCTION: LEGO1 0x10070f60
|
2023-12-29 13:04:18 -05:00
|
|
|
MxBool Infocenter::VTable0x64()
|
|
|
|
{
|
2024-01-31 09:47:15 -05:00
|
|
|
if (m_infocenterState != NULL) {
|
|
|
|
MxU32 val = m_infocenterState->GetUnknown0x74();
|
|
|
|
|
|
|
|
if (val == 0) {
|
|
|
|
StopCutscene();
|
|
|
|
m_infocenterState->SetUnknown0x74(1);
|
|
|
|
}
|
|
|
|
else if (val == 13) {
|
|
|
|
StopCredits();
|
|
|
|
}
|
|
|
|
else if (val != 8) {
|
|
|
|
m_infocenterState->SetUnknown0x74(8);
|
|
|
|
|
|
|
|
#ifdef COMPAT_MODE
|
|
|
|
{
|
|
|
|
MxNotificationParam param(c_notificationType0, NULL);
|
|
|
|
Notify(param);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
Notify(MxNotificationParam(c_notificationType0, NULL));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-29 13:04:18 -05:00
|
|
|
return FALSE;
|
|
|
|
}
|
2024-01-17 11:53:53 -05:00
|
|
|
|
2024-02-07 12:19:46 -05:00
|
|
|
// FUNCTION: LEGO1 0x10071030
|
2024-01-17 11:53:53 -05:00
|
|
|
void Infocenter::StartCredits()
|
|
|
|
{
|
2024-02-07 12:19:46 -05:00
|
|
|
MxPresenter* presenter;
|
|
|
|
|
|
|
|
while (!m_set0xa8.empty()) {
|
|
|
|
MxCoreSet::iterator it = m_set0xa8.begin();
|
|
|
|
MxCore* object = *it;
|
|
|
|
m_set0xa8.erase(it);
|
|
|
|
|
|
|
|
if (object->IsA("MxPresenter")) {
|
|
|
|
presenter = (MxPresenter*) object;
|
|
|
|
MxDSAction* action = presenter->GetAction();
|
|
|
|
|
|
|
|
if (action) {
|
|
|
|
FUN_100b7220(action, MxDSAction::c_world, FALSE);
|
|
|
|
presenter->EndAction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
delete object;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MxPresenterListCursor cursor(&m_controlPresenters);
|
|
|
|
|
|
|
|
while (cursor.First(presenter)) {
|
|
|
|
cursor.Detach();
|
|
|
|
|
|
|
|
MxDSAction* action = presenter->GetAction();
|
|
|
|
if (action) {
|
|
|
|
FUN_100b7220(action, MxDSAction::c_world, FALSE);
|
|
|
|
presenter->EndAction();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BackgroundAudioManager()->Stop();
|
|
|
|
|
|
|
|
MxS16 i = 0;
|
|
|
|
do {
|
2024-02-11 10:44:55 -05:00
|
|
|
if (m_infocenterState->GetNameLetter(i) != NULL) {
|
|
|
|
m_infocenterState->GetNameLetter(i)->Enable(FALSE);
|
2024-02-07 12:19:46 -05:00
|
|
|
}
|
|
|
|
i++;
|
2024-02-11 10:44:55 -05:00
|
|
|
} while (i < m_infocenterState->GetMaxNameLength());
|
2024-02-07 12:19:46 -05:00
|
|
|
|
|
|
|
VideoManager()->FUN_1007c520();
|
|
|
|
GetViewManager()->RemoveAll(NULL);
|
|
|
|
|
2024-03-10 12:08:21 -04:00
|
|
|
InvokeAction(Extra::e_opendisk, *g_creditsScript, CreditsScript::c_LegoCredits, NULL);
|
2024-02-07 12:19:46 -05:00
|
|
|
SetAppCursor(0);
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10071250
|
|
|
|
void Infocenter::StopCredits()
|
|
|
|
{
|
|
|
|
MxDSAction action;
|
2024-03-10 12:08:21 -04:00
|
|
|
action.SetObjectId(CreditsScript::c_LegoCredits);
|
2024-01-17 11:53:53 -05:00
|
|
|
action.SetAtomId(*g_creditsScript);
|
|
|
|
action.SetUnknown24(-2);
|
|
|
|
DeleteObject(action);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10071300
|
2024-03-17 13:01:47 -04:00
|
|
|
void Infocenter::PlayAction(InfomainScript::Script p_script)
|
2024-01-17 11:53:53 -05:00
|
|
|
{
|
|
|
|
MxDSAction action;
|
2024-03-17 13:01:47 -04:00
|
|
|
action.SetObjectId(p_script);
|
2024-01-17 11:53:53 -05:00
|
|
|
action.SetAtomId(*g_infomainScript);
|
2024-01-18 14:04:50 -05:00
|
|
|
StopCurrentAction();
|
2024-01-17 11:53:53 -05:00
|
|
|
|
2024-03-17 13:01:47 -04:00
|
|
|
m_currentInfomainScript = p_script;
|
2024-01-17 11:53:53 -05:00
|
|
|
BackgroundAudioManager()->LowerVolume();
|
|
|
|
Start(&action);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x100713d0
|
2024-01-18 14:04:50 -05:00
|
|
|
void Infocenter::StopCurrentAction()
|
2024-01-17 11:53:53 -05:00
|
|
|
{
|
2024-03-10 12:08:21 -04:00
|
|
|
if (m_currentInfomainScript != InfomainScript::c_noneInfomain) {
|
2024-01-17 11:53:53 -05:00
|
|
|
MxDSAction action;
|
|
|
|
action.SetObjectId(m_currentInfomainScript);
|
|
|
|
action.SetAtomId(*g_infomainScript);
|
|
|
|
action.SetUnknown24(-2);
|
|
|
|
DeleteObject(action);
|
2024-03-10 12:08:21 -04:00
|
|
|
m_currentInfomainScript = InfomainScript::c_noneInfomain;
|
2024-01-17 11:53:53 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x100714a0
|
|
|
|
void Infocenter::PlayBookAnimation()
|
|
|
|
{
|
|
|
|
MxDSAction action;
|
2024-03-10 12:08:21 -04:00
|
|
|
action.SetObjectId(SndanimScript::c_BookWig_Flic);
|
2024-01-17 11:53:53 -05:00
|
|
|
action.SetAtomId(*g_sndAnimScript);
|
|
|
|
Start(&action);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x10071550
|
|
|
|
void Infocenter::StopBookAnimation()
|
|
|
|
{
|
|
|
|
MxDSAction action;
|
2024-03-10 12:08:21 -04:00
|
|
|
action.SetObjectId(SndanimScript::c_BookWig_Flic);
|
2024-01-17 11:53:53 -05:00
|
|
|
action.SetAtomId(*g_sndAnimScript);
|
|
|
|
action.SetUnknown24(-2);
|
|
|
|
DeleteObject(action);
|
|
|
|
}
|