Skip to content

Commit

Permalink
Match Infocenter::ReadyWorld (#1389)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: jonschz <jonschz@users.noreply.github.com>
  • Loading branch information
jonschz and jonschz authored Feb 21, 2025
1 parent 777dfa8 commit 78e924e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 31 deletions.
7 changes: 6 additions & 1 deletion LEGO1/lego/legoomni/include/infocenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ class InfocenterState : public LegoState {
return (InfomainScript::Script) m_leaveDialogue[GameState()->GetCurrentAct()].Next();
}

// FUNCTION: BETA10 0x10031ac0
InfomainScript::Script GetNextReturnDialogue()
{
return (InfomainScript::Script) m_returnDialogue[GameState()->GetCurrentAct()].Next();
}

// TODO: These probably don't exist according to BETA
Playlist& GetExitDialogueAct1() { return m_exitDialogueAct1; }
Playlist& GetExitDialogueAct23() { return m_exitDialogueAct23; }
Playlist& GetReturnDialogue(LegoGameState::Act p_act) { return m_returnDialogue[p_act]; }
Playlist& GetBricksterDialogue() { return m_bricksterDialogue; }

// SYNTHETIC: LEGO1 0x10071900
Expand Down
1 change: 1 addition & 0 deletions LEGO1/lego/legoomni/src/common/legostate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DECOMP_SIZE_ASSERT(LegoState, 0x08)
DECOMP_SIZE_ASSERT(LegoState::Playlist, 0x0c)

// FUNCTION: LEGO1 0x10014d00
// FUNCTION: BETA10 0x10022580
MxU32 LegoState::Playlist::Next()
{
MxU32 objectId;
Expand Down
52 changes: 22 additions & 30 deletions LEGO1/lego/legoomni/src/worlds/infocenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ void Infocenter::ReadyWorld()
case 3:
PlayCutscene(e_legoMovie, TRUE);
m_infocenterState->m_unk0x74 = 0;
break;
return;
case 4:
m_infocenterState->m_unk0x74 = 2;
if (!m_infocenterState->HasRegistered()) {
Expand All @@ -466,13 +466,12 @@ void Infocenter::ReadyWorld()
PlayAction(InfomainScript::c_iicx18in_RunAnim);
PlayMusic(JukeboxScript::c_InformationCenter_Music);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
break;
return;
case 5:
default: {
PlayMusic(JukeboxScript::c_InformationCenter_Music);

InfomainScript::Script script =
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
InfomainScript::Script script = m_infocenterState->GetNextReturnDialogue();
PlayAction(script);

if (script == InfomainScript::c_iicx26in_RunAnim) {
Expand All @@ -485,15 +484,13 @@ void Infocenter::ReadyWorld()
m_bookAnimationTimer = 1;
}

m_infocenterState->m_unk0x74 = 11;
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
break;
}
case 8:
PlayMusic(JukeboxScript::c_InformationCenter_Music);
PlayAction(InfomainScript::c_iic043in_RunAnim);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
break;
return;
case 0xf:
m_infocenterState->m_unk0x74 = 2;
if (!m_infocenterState->HasRegistered()) {
Expand All @@ -503,9 +500,9 @@ void Infocenter::ReadyWorld()
PlayAction(InfomainScript::c_iicx17in_RunAnim);
PlayMusic(JukeboxScript::c_InformationCenter_Music);
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
break;
return;
}
return;
break;
case LegoGameState::e_act2: {
if (m_infocenterState->m_unk0x74 == 8) {
PlayMusic(JukeboxScript::c_InformationCenter_Music);
Expand Down Expand Up @@ -537,8 +534,7 @@ void Infocenter::ReadyWorld()
m_infocenterState->m_unk0x74 = 5;
m_destLocation = LegoGameState::e_act2main;

InfomainScript::Script script =
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
InfomainScript::Script script = m_infocenterState->GetNextReturnDialogue();
PlayAction(script);

InputManager()->DisableInputProcessing();
Expand All @@ -547,8 +543,7 @@ void Infocenter::ReadyWorld()
}

PlayMusic(JukeboxScript::c_InformationCenter_Music);
InfomainScript::Script script =
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
InfomainScript::Script script = m_infocenterState->GetNextReturnDialogue();
PlayAction(script);
bgRed->Enable(TRUE);
break;
Expand All @@ -565,20 +560,18 @@ void Infocenter::ReadyWorld()
Act3State* state = (Act3State*) GameState()->GetState("Act3State");
GameState()->FindLoadedAct();

if (state) {
if (state->GetUnknown0x08() == 3) {
bg->Enable(TRUE);
PlayCutscene(e_badEndMovie, TRUE);
m_infocenterState->m_unk0x74 = 0;
return;
}
if (state && state->GetUnknown0x08() == 3) {
bg->Enable(TRUE);
PlayCutscene(e_badEndMovie, TRUE);
m_infocenterState->m_unk0x74 = 0;
return;
}

if (state && state->GetUnknown0x08() == 2) {
bg->Enable(TRUE);
PlayCutscene(e_goodEndMovie, TRUE);
m_infocenterState->m_unk0x74 = 0;
return;
}
if (state && state->GetUnknown0x08() == 2) {
bg->Enable(TRUE);
PlayCutscene(e_goodEndMovie, TRUE);
m_infocenterState->m_unk0x74 = 0;
return;
}

if (m_infocenterState->m_unk0x74 == 4) {
Expand All @@ -593,8 +586,7 @@ void Infocenter::ReadyWorld()
m_infocenterState->m_unk0x74 = 5;
m_destLocation = LegoGameState::e_act3script;

InfomainScript::Script script =
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
InfomainScript::Script script = m_infocenterState->GetNextReturnDialogue();
PlayAction(script);

InputManager()->DisableInputProcessing();
Expand All @@ -603,8 +595,7 @@ void Infocenter::ReadyWorld()
}

PlayMusic(JukeboxScript::c_InformationCenter_Music);
InfomainScript::Script script =
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
InfomainScript::Script script = m_infocenterState->GetNextReturnDialogue();
PlayAction(script);
bgRed->Enable(TRUE);
break;
Expand Down Expand Up @@ -1228,6 +1219,7 @@ MxLong Infocenter::HandleNotification0(MxNotificationParam& p_param)
}

// FUNCTION: LEGO1 0x10070aa0
// FUNCTION: BETA10 0x10030508
void Infocenter::Enable(MxBool p_enable)
{
LegoWorld::Enable(p_enable);
Expand Down

0 comments on commit 78e924e

Please sign in to comment.