mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 00:44:21 +00:00
refactor script enum structure (#649)
* add autogenerated action headers * refactor police * refactor infocenter * refactor jukebox * refactor regbook * format * scope headers in namespaces instead * attempt to dynamically build headers ignore list in ncc * correct whitespace in naming.yml * fix wrong folder * fix accidental extra newline in cmakelists
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "infocenter.h"
|
||||
|
||||
#include "act3state.h"
|
||||
#include "credits_actions.h"
|
||||
#include "helicopterstate.h"
|
||||
#include "infocenterstate.h"
|
||||
#include "jukebox.h"
|
||||
@@ -24,6 +25,7 @@
|
||||
#include "mxstillpresenter.h"
|
||||
#include "mxticklemanager.h"
|
||||
#include "mxtransitionmanager.h"
|
||||
#include "sndanim_actions.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(Infocenter, 0x1d8)
|
||||
DECOMP_SIZE_ASSERT(InfocenterMapEntry, 0x18)
|
||||
@@ -42,7 +44,7 @@ Infocenter::Infocenter()
|
||||
m_infocenterState = NULL;
|
||||
m_frameHotBitmap = NULL;
|
||||
m_transitionDestination = LegoGameState::e_noArea;
|
||||
m_currentInfomainScript = c_noInfomain;
|
||||
m_currentInfomainScript = InfomainScript::c_noneInfomain;
|
||||
m_currentCutscene = e_noIntro;
|
||||
|
||||
memset(&m_mapAreas, 0, sizeof(m_mapAreas));
|
||||
@@ -188,38 +190,39 @@ MxLong Infocenter::Notify(MxParam& p_param)
|
||||
MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
{
|
||||
MxDSAction* action = p_param.GetAction();
|
||||
if (action->GetAtomId() == *g_creditsScript && action->GetObjectId() == c_unk499) {
|
||||
if (action->GetAtomId() == *g_creditsScript && action->GetObjectId() == CreditsScript::c_LegoCredits) {
|
||||
Lego()->CloseMainWindow();
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (action->GetAtomId() == m_atom &&
|
||||
(action->GetObjectId() == c_mamaMovie || action->GetObjectId() == c_papaMovie ||
|
||||
action->GetObjectId() == c_pepperMovie || action->GetObjectId() == c_nickMovie ||
|
||||
action->GetObjectId() == c_lauraMovie)) {
|
||||
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)) {
|
||||
if (m_unk0x1d4) {
|
||||
m_unk0x1d4--;
|
||||
}
|
||||
|
||||
if (!m_unk0x1d4) {
|
||||
PlayMusic(JukeBox::e_informationCenter);
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
GameState()->SetActor(m_selectedCharacter);
|
||||
|
||||
switch (m_selectedCharacter) {
|
||||
case e_pepper:
|
||||
PlayAction(c_pepperCharacterSelect);
|
||||
PlayAction(InfomainScript::c_avo901in_RunAnim);
|
||||
break;
|
||||
case e_mama:
|
||||
PlayAction(c_mamaCharacterSelect);
|
||||
PlayAction(InfomainScript::c_avo902in_RunAnim);
|
||||
break;
|
||||
case e_papa:
|
||||
PlayAction(c_papaCharacterSelect);
|
||||
PlayAction(InfomainScript::c_avo903in_RunAnim);
|
||||
break;
|
||||
case e_nick:
|
||||
PlayAction(c_nickCharacterSelect);
|
||||
PlayAction(InfomainScript::c_avo904in_RunAnim);
|
||||
break;
|
||||
case e_laura:
|
||||
PlayAction(c_lauraCharacterSelect);
|
||||
PlayAction(InfomainScript::c_avo905in_RunAnim);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -235,7 +238,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
return result;
|
||||
}
|
||||
|
||||
if (action->GetObjectId() == c_returnBackGuidanceDialogue2) {
|
||||
if (action->GetObjectId() == InfomainScript::c_iicx26in_RunAnim) {
|
||||
ControlManager()->FUN_100293c0(0x10, action->GetAtomId().GetInternal(), 0);
|
||||
m_unk0x1d6 = 0;
|
||||
}
|
||||
@@ -252,13 +255,13 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
case e_badEndMovie:
|
||||
StopCutscene();
|
||||
m_infocenterState->SetUnknown0x74(11);
|
||||
PlayAction(c_badEndingDialogue);
|
||||
PlayAction(InfomainScript::c_tic092in_RunAnim);
|
||||
m_currentCutscene = e_noIntro;
|
||||
return 1;
|
||||
case e_goodEndMovie:
|
||||
StopCutscene();
|
||||
m_infocenterState->SetUnknown0x74(11);
|
||||
PlayAction(c_goodEndingDialogue);
|
||||
PlayAction(InfomainScript::c_tic089in_RunAnim);
|
||||
m_currentCutscene = e_noIntro;
|
||||
return 1;
|
||||
}
|
||||
@@ -266,7 +269,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
// default / 2nd case probably?
|
||||
StopCutscene();
|
||||
m_infocenterState->SetUnknown0x74(11);
|
||||
PlayAction(c_welcomeDialogue);
|
||||
PlayAction(InfomainScript::c_iic001in_RunAnim);
|
||||
m_currentCutscene = e_noIntro;
|
||||
|
||||
if (!m_infocenterState->HasRegistered()) {
|
||||
@@ -279,13 +282,13 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
|
||||
switch (m_currentCutscene) {
|
||||
case e_badEndMovie:
|
||||
PlayAction(c_badEndingDialogue);
|
||||
PlayAction(InfomainScript::c_tic092in_RunAnim);
|
||||
break;
|
||||
case e_goodEndMovie:
|
||||
PlayAction(c_goodEndingDialogue);
|
||||
PlayAction(InfomainScript::c_tic089in_RunAnim);
|
||||
break;
|
||||
default:
|
||||
PlayAction(c_welcomeDialogue);
|
||||
PlayAction(InfomainScript::c_iic001in_RunAnim);
|
||||
}
|
||||
|
||||
m_currentCutscene = e_noIntro;
|
||||
@@ -296,7 +299,8 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
BackgroundAudioManager()->RaiseVolume();
|
||||
return 1;
|
||||
case 4:
|
||||
if (action->GetObjectId() == c_goToRegBook || action->GetObjectId() == c_goToRegBookRed) {
|
||||
if (action->GetObjectId() == InfomainScript::c_GoTo_RegBook ||
|
||||
action->GetObjectId() == InfomainScript::c_GoTo_RegBook_Red) {
|
||||
TransitionManager()->StartTransition(MxTransitionManager::e_pixelation, 50, FALSE, FALSE);
|
||||
m_infocenterState->SetUnknown0x74(14);
|
||||
return 1;
|
||||
@@ -313,11 +317,13 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
if (!m_infocenterState->HasRegistered() && m_currentInfomainScript != c_mamaMovie &&
|
||||
m_currentInfomainScript != c_papaMovie && m_currentInfomainScript != c_pepperMovie &&
|
||||
m_currentInfomainScript != c_nickMovie && m_currentInfomainScript != c_lauraMovie) {
|
||||
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) {
|
||||
m_infoManDialogueTimer = 1;
|
||||
PlayMusic(JukeBox::e_informationCenter);
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
}
|
||||
|
||||
m_infocenterState->SetUnknown0x74(2);
|
||||
@@ -361,19 +367,19 @@ void Infocenter::ReadyWorld()
|
||||
m_bookAnimationTimer = 1;
|
||||
}
|
||||
|
||||
PlayAction(c_letsGetStartedDialogue);
|
||||
PlayMusic(JukeBox::e_informationCenter);
|
||||
PlayAction(InfomainScript::c_iicx18in_RunAnim);
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
||||
break;
|
||||
case 5:
|
||||
default: {
|
||||
PlayMusic(JukeBox::e_informationCenter);
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
|
||||
InfomainScript script =
|
||||
(InfomainScript) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
||||
InfomainScript::Script script =
|
||||
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
||||
PlayAction(script);
|
||||
|
||||
if (script == c_returnBackGuidanceDialogue2) {
|
||||
if (script == InfomainScript::c_iicx26in_RunAnim) {
|
||||
m_unk0x1d6 = 1;
|
||||
}
|
||||
|
||||
@@ -388,8 +394,8 @@ void Infocenter::ReadyWorld()
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
PlayMusic(JukeBox::e_informationCenter);
|
||||
PlayAction(c_exitConfirmationDialogue);
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
PlayAction(InfomainScript::c_iic043in_RunAnim);
|
||||
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
||||
break;
|
||||
case 0xf:
|
||||
@@ -398,17 +404,17 @@ void Infocenter::ReadyWorld()
|
||||
m_bookAnimationTimer = 1;
|
||||
}
|
||||
|
||||
PlayAction(c_clickOnInfomanDialogue);
|
||||
PlayMusic(JukeBox::e_informationCenter);
|
||||
PlayAction(InfomainScript::c_iicx17in_RunAnim);
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
case LegoGameState::e_act2: {
|
||||
if (m_infocenterState->GetUnknown0x74() == 8) {
|
||||
PlayMusic(JukeBox::e_informationCenter);
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
bgRed->Enable(TRUE);
|
||||
PlayAction(c_exitConfirmationDialogue);
|
||||
PlayAction(InfomainScript::c_iic043in_RunAnim);
|
||||
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
||||
return;
|
||||
}
|
||||
@@ -435,8 +441,8 @@ void Infocenter::ReadyWorld()
|
||||
m_infocenterState->SetUnknown0x74(5);
|
||||
m_transitionDestination = LegoGameState::e_act2main;
|
||||
|
||||
InfomainScript script =
|
||||
(InfomainScript) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
||||
InfomainScript::Script script =
|
||||
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
||||
PlayAction(script);
|
||||
|
||||
InputManager()->DisableInputProcessing();
|
||||
@@ -444,18 +450,18 @@ void Infocenter::ReadyWorld()
|
||||
return;
|
||||
}
|
||||
|
||||
PlayMusic(JukeBox::e_informationCenter);
|
||||
InfomainScript script =
|
||||
(InfomainScript) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
InfomainScript::Script script =
|
||||
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
||||
PlayAction(script);
|
||||
bgRed->Enable(TRUE);
|
||||
break;
|
||||
}
|
||||
case LegoGameState::e_act3: {
|
||||
if (m_infocenterState->GetUnknown0x74() == 8) {
|
||||
PlayMusic(JukeBox::e_informationCenter);
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
bgRed->Enable(TRUE);
|
||||
PlayAction(c_exitConfirmationDialogue);
|
||||
PlayAction(InfomainScript::c_iic043in_RunAnim);
|
||||
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
|
||||
return;
|
||||
}
|
||||
@@ -491,8 +497,8 @@ void Infocenter::ReadyWorld()
|
||||
m_infocenterState->SetUnknown0x74(5);
|
||||
m_transitionDestination = LegoGameState::e_act3script;
|
||||
|
||||
InfomainScript script =
|
||||
(InfomainScript) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
||||
InfomainScript::Script script =
|
||||
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
||||
PlayAction(script);
|
||||
|
||||
InputManager()->DisableInputProcessing();
|
||||
@@ -500,9 +506,9 @@ void Infocenter::ReadyWorld()
|
||||
return;
|
||||
}
|
||||
|
||||
PlayMusic(JukeBox::e_informationCenter);
|
||||
InfomainScript script =
|
||||
(InfomainScript) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||
InfomainScript::Script script =
|
||||
(InfomainScript::Script) m_infocenterState->GetReturnDialogue(GameState()->GetCurrentAct()).Next();
|
||||
PlayAction(script);
|
||||
bgRed->Enable(TRUE);
|
||||
break;
|
||||
@@ -518,21 +524,21 @@ void Infocenter::InitializeBitmaps()
|
||||
{
|
||||
m_radio.Initialize(TRUE);
|
||||
|
||||
((MxPresenter*) Find(m_atom, c_leftArrowCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_rightArrowCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_infoCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_boatCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_raceCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_pizzaCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_gasCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_medCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_copCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_mamaCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_papaCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_pepperCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_nickCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_lauraCtl))->Enable(TRUE);
|
||||
((MxPresenter*) Find(m_atom, c_radioCtl))->Enable(TRUE);
|
||||
((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);
|
||||
|
||||
m_mapAreas[0].m_presenter = (MxStillPresenter*) Find("MxStillPresenter", "Info_A_Bitmap");
|
||||
m_mapAreas[0].m_area.SetLeft(391);
|
||||
@@ -633,7 +639,7 @@ MxLong Infocenter::HandleKeyPress(MxS8 p_key)
|
||||
case 4:
|
||||
break;
|
||||
default: {
|
||||
InfomainScript script = m_currentInfomainScript;
|
||||
InfomainScript::Script script = m_currentInfomainScript;
|
||||
StopCurrentAction();
|
||||
|
||||
switch (m_infocenterState->GetUnknown0x74()) {
|
||||
@@ -667,19 +673,19 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
|
||||
MxControlPresenter* control = InputManager()->GetControlManager()->FUN_100294e0(p_x - 1, p_y - 1);
|
||||
|
||||
switch (m_unk0x11c->GetAction()->GetObjectId()) {
|
||||
case c_pepperSelected:
|
||||
case InfomainScript::c_PepperHot_Bitmap:
|
||||
m_selectedCharacter = e_pepper;
|
||||
break;
|
||||
case c_mamaSelected:
|
||||
case InfomainScript::c_MamaHot_Bitmap:
|
||||
m_selectedCharacter = e_mama;
|
||||
break;
|
||||
case c_papaSelected:
|
||||
case InfomainScript::c_PapaHot_Bitmap:
|
||||
m_selectedCharacter = e_papa;
|
||||
break;
|
||||
case c_nickSelected:
|
||||
case InfomainScript::c_NickHot_Bitmap:
|
||||
m_selectedCharacter = e_nick;
|
||||
break;
|
||||
case c_lauraSelected:
|
||||
case InfomainScript::c_LauraHot_Bitmap:
|
||||
m_selectedCharacter = e_laura;
|
||||
break;
|
||||
}
|
||||
@@ -688,43 +694,43 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
|
||||
m_infoManDialogueTimer = 0;
|
||||
|
||||
switch (control->GetAction()->GetObjectId()) {
|
||||
case c_pepperCtl:
|
||||
case InfomainScript::c_Pepper_Ctl:
|
||||
if (m_selectedCharacter == e_pepper) {
|
||||
m_radio.Stop();
|
||||
BackgroundAudioManager()->Stop();
|
||||
PlayAction(c_pepperMovie);
|
||||
PlayAction(InfomainScript::c_Pepper_All_Movie);
|
||||
m_unk0x1d4++;
|
||||
}
|
||||
break;
|
||||
case c_mamaCtl:
|
||||
case InfomainScript::c_Mama_Ctl:
|
||||
if (m_selectedCharacter == e_mama) {
|
||||
m_radio.Stop();
|
||||
BackgroundAudioManager()->Stop();
|
||||
PlayAction(c_mamaMovie);
|
||||
PlayAction(InfomainScript::c_Mama_All_Movie);
|
||||
m_unk0x1d4++;
|
||||
}
|
||||
break;
|
||||
case c_papaCtl:
|
||||
case InfomainScript::c_Papa_Ctl:
|
||||
if (m_selectedCharacter == e_papa) {
|
||||
m_radio.Stop();
|
||||
BackgroundAudioManager()->Stop();
|
||||
PlayAction(c_papaMovie);
|
||||
PlayAction(InfomainScript::c_Papa_All_Movie);
|
||||
m_unk0x1d4++;
|
||||
}
|
||||
break;
|
||||
case c_nickCtl:
|
||||
case InfomainScript::c_Nick_Ctl:
|
||||
if (m_selectedCharacter == e_nick) {
|
||||
m_radio.Stop();
|
||||
BackgroundAudioManager()->Stop();
|
||||
PlayAction(c_nickMovie);
|
||||
PlayAction(InfomainScript::c_Nick_All_Movie);
|
||||
m_unk0x1d4++;
|
||||
}
|
||||
break;
|
||||
case c_lauraCtl:
|
||||
case InfomainScript::c_Laura_Ctl:
|
||||
if (m_selectedCharacter == e_laura) {
|
||||
m_radio.Stop();
|
||||
BackgroundAudioManager()->Stop();
|
||||
PlayAction(c_lauraMovie);
|
||||
PlayAction(InfomainScript::c_Laura_All_Movie);
|
||||
m_unk0x1d4++;
|
||||
}
|
||||
break;
|
||||
@@ -740,19 +746,19 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
|
||||
|
||||
switch (m_selectedCharacter) {
|
||||
case e_pepper:
|
||||
PlayAction(c_pepperCharacterSelect);
|
||||
PlayAction(InfomainScript::c_avo901in_RunAnim);
|
||||
break;
|
||||
case e_mama:
|
||||
PlayAction(c_mamaCharacterSelect);
|
||||
PlayAction(InfomainScript::c_avo902in_RunAnim);
|
||||
break;
|
||||
case e_papa:
|
||||
PlayAction(c_papaCharacterSelect);
|
||||
PlayAction(InfomainScript::c_avo903in_RunAnim);
|
||||
break;
|
||||
case e_nick:
|
||||
PlayAction(c_nickCharacterSelect);
|
||||
PlayAction(InfomainScript::c_avo904in_RunAnim);
|
||||
break;
|
||||
case e_laura:
|
||||
PlayAction(c_lauraCharacterSelect);
|
||||
PlayAction(InfomainScript::c_avo905in_RunAnim);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -800,39 +806,40 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
|
||||
m_unk0x11c = NULL;
|
||||
|
||||
if (m_infocenterState->GetUnknown0x74() == 5) {
|
||||
InfomainScript dialogueToPlay;
|
||||
InfomainScript::Script dialogueToPlay;
|
||||
|
||||
if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
|
||||
if (!m_infocenterState->HasRegistered()) {
|
||||
m_infocenterState->SetUnknown0x74(2);
|
||||
m_transitionDestination = LegoGameState::e_noArea;
|
||||
dialogueToPlay = c_registerToContinueDialogue;
|
||||
dialogueToPlay = InfomainScript::c_iic007in_PlayWav;
|
||||
}
|
||||
else {
|
||||
switch (m_selectedCharacter) {
|
||||
case e_pepper:
|
||||
dialogueToPlay = c_pepperCharacterSelect;
|
||||
dialogueToPlay = InfomainScript::c_avo901in_RunAnim;
|
||||
GameState()->SetActorId(m_selectedCharacter);
|
||||
break;
|
||||
case e_mama:
|
||||
dialogueToPlay = c_mamaCharacterSelect;
|
||||
dialogueToPlay = InfomainScript::c_avo902in_RunAnim;
|
||||
GameState()->SetActorId(m_selectedCharacter);
|
||||
break;
|
||||
case e_papa:
|
||||
dialogueToPlay = c_papaCharacterSelect;
|
||||
dialogueToPlay = InfomainScript::c_avo903in_RunAnim;
|
||||
GameState()->SetActorId(m_selectedCharacter);
|
||||
break;
|
||||
case e_nick:
|
||||
dialogueToPlay = c_nickCharacterSelect;
|
||||
dialogueToPlay = InfomainScript::c_avo904in_RunAnim;
|
||||
GameState()->SetActorId(m_selectedCharacter);
|
||||
break;
|
||||
case e_laura:
|
||||
dialogueToPlay = c_lauraCharacterSelect;
|
||||
dialogueToPlay = InfomainScript::c_avo905in_RunAnim;
|
||||
GameState()->SetActorId(m_selectedCharacter);
|
||||
break;
|
||||
default:
|
||||
dialogueToPlay =
|
||||
(InfomainScript) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct()).Next();
|
||||
(InfomainScript::Script) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct())
|
||||
.Next();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -842,7 +849,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
|
||||
}
|
||||
else {
|
||||
dialogueToPlay =
|
||||
(InfomainScript) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct()).Next();
|
||||
(InfomainScript::Script) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct()).Next();
|
||||
}
|
||||
|
||||
PlayAction(dialogueToPlay);
|
||||
@@ -861,14 +868,14 @@ MxU8 Infocenter::HandleClick(LegoControlManagerEvent& p_param)
|
||||
if (p_param.GetUnknown0x28() == 1) {
|
||||
m_infoManDialogueTimer = 0;
|
||||
|
||||
InfomainScript actionToPlay = c_noInfomain;
|
||||
InfomainScript::Script actionToPlay = InfomainScript::c_noneInfomain;
|
||||
StopCurrentAction();
|
||||
InfomainScript characterBitmap = c_noInfomain;
|
||||
InfomainScript::Script characterBitmap = InfomainScript::c_noneInfomain;
|
||||
|
||||
LegoGameState* state = GameState();
|
||||
|
||||
switch (p_param.GetClickedObjectId()) {
|
||||
case c_leftArrowCtl:
|
||||
case InfomainScript::c_LeftArrow_Ctl:
|
||||
m_infocenterState->SetUnknown0x74(14);
|
||||
StopCurrentAction();
|
||||
|
||||
@@ -879,11 +886,11 @@ MxU8 Infocenter::HandleClick(LegoControlManagerEvent& p_param)
|
||||
}
|
||||
else {
|
||||
MxU32 objectId = m_infocenterState->GetBricksterDialogue().Next();
|
||||
PlayAction((InfomainScript) objectId);
|
||||
PlayAction((InfomainScript::Script) objectId);
|
||||
}
|
||||
|
||||
break;
|
||||
case c_rightArrowCtl:
|
||||
case InfomainScript::c_RightArrow_Ctl:
|
||||
m_infocenterState->SetUnknown0x74(14);
|
||||
StopCurrentAction();
|
||||
|
||||
@@ -894,47 +901,47 @@ MxU8 Infocenter::HandleClick(LegoControlManagerEvent& p_param)
|
||||
}
|
||||
else {
|
||||
MxU32 objectId = m_infocenterState->GetBricksterDialogue().Next();
|
||||
PlayAction((InfomainScript) objectId);
|
||||
PlayAction((InfomainScript::Script) objectId);
|
||||
}
|
||||
|
||||
break;
|
||||
case c_infoCtl:
|
||||
actionToPlay = c_infoCtlDescription;
|
||||
case InfomainScript::c_Info_Ctl:
|
||||
actionToPlay = InfomainScript::c_iic007ra_PlayWav;
|
||||
m_radio.Stop();
|
||||
break;
|
||||
case c_doorCtl:
|
||||
case InfomainScript::c_Door_Ctl:
|
||||
if (m_infocenterState->GetUnknown0x74() != 8) {
|
||||
actionToPlay = c_exitConfirmationDialogue;
|
||||
actionToPlay = InfomainScript::c_iic043in_RunAnim;
|
||||
m_radio.Stop();
|
||||
m_infocenterState->SetUnknown0x74(8);
|
||||
}
|
||||
|
||||
break;
|
||||
case c_boatCtl:
|
||||
actionToPlay = c_boatCtlDescription;
|
||||
case InfomainScript::c_Boat_Ctl:
|
||||
actionToPlay = InfomainScript::c_ijs002ra_PlayWav;
|
||||
m_radio.Stop();
|
||||
break;
|
||||
case c_raceCtl:
|
||||
actionToPlay = c_raceCtlDescription;
|
||||
case InfomainScript::c_Race_Ctl:
|
||||
actionToPlay = InfomainScript::c_irt001ra_PlayWav;
|
||||
m_radio.Stop();
|
||||
break;
|
||||
case c_pizzaCtl:
|
||||
actionToPlay = c_pizzaCtlDescription;
|
||||
case InfomainScript::c_Pizza_Ctl:
|
||||
actionToPlay = InfomainScript::c_ipz006ra_PlayWav;
|
||||
m_radio.Stop();
|
||||
break;
|
||||
case c_gasCtl:
|
||||
actionToPlay = c_gasCtlDescription;
|
||||
case InfomainScript::c_Gas_Ctl:
|
||||
actionToPlay = InfomainScript::c_igs004ra_PlayWav;
|
||||
m_radio.Stop();
|
||||
break;
|
||||
case c_medCtl:
|
||||
actionToPlay = c_medCtlDescription;
|
||||
case InfomainScript::c_Med_Ctl:
|
||||
actionToPlay = InfomainScript::c_iho003ra_PlayWav;
|
||||
m_radio.Stop();
|
||||
break;
|
||||
case c_copCtl:
|
||||
actionToPlay = c_copCtlDescription;
|
||||
case InfomainScript::c_Cop_Ctl:
|
||||
actionToPlay = InfomainScript::c_ips005ra_PlayWav;
|
||||
m_radio.Stop();
|
||||
break;
|
||||
case c_bigInfoCtl:
|
||||
case InfomainScript::c_BigInfo_Ctl:
|
||||
switch (state->GetCurrentAct()) {
|
||||
case LegoGameState::e_act1:
|
||||
switch (state->GetPreviousArea()) {
|
||||
@@ -944,7 +951,8 @@ MxU8 Infocenter::HandleClick(LegoControlManagerEvent& p_param)
|
||||
m_infocenterState->SetUnknown0x74(5);
|
||||
m_transitionDestination = state->GetPreviousArea();
|
||||
actionToPlay =
|
||||
(InfomainScript) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct()).Next();
|
||||
(InfomainScript::Script) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct())
|
||||
.Next();
|
||||
m_radio.Stop();
|
||||
InputManager()->DisableInputProcessing();
|
||||
InputManager()->SetUnknown336(TRUE);
|
||||
@@ -954,15 +962,15 @@ MxU8 Infocenter::HandleClick(LegoControlManagerEvent& p_param)
|
||||
if (m_infocenterState->HasRegistered()) {
|
||||
m_infocenterState->SetUnknown0x74(5);
|
||||
m_transitionDestination = state->GetPreviousArea();
|
||||
actionToPlay =
|
||||
(InfomainScript) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct())
|
||||
.Next();
|
||||
actionToPlay = (InfomainScript::Script) m_infocenterState
|
||||
->GetLeaveDialogue(GameState()->GetCurrentAct())
|
||||
.Next();
|
||||
m_radio.Stop();
|
||||
InputManager()->DisableInputProcessing();
|
||||
InputManager()->SetUnknown336(TRUE);
|
||||
}
|
||||
else {
|
||||
PlayAction(c_registerToContinueDialogue);
|
||||
PlayAction(InfomainScript::c_iic007in_PlayWav);
|
||||
m_infocenterState->SetUnknown0x74(2);
|
||||
}
|
||||
}
|
||||
@@ -973,7 +981,7 @@ MxU8 Infocenter::HandleClick(LegoControlManagerEvent& p_param)
|
||||
m_infocenterState->SetUnknown0x74(5);
|
||||
m_transitionDestination = LegoGameState::e_act2main;
|
||||
actionToPlay =
|
||||
(InfomainScript) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct()).Next();
|
||||
(InfomainScript::Script) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct()).Next();
|
||||
InputManager()->DisableInputProcessing();
|
||||
InputManager()->SetUnknown336(TRUE);
|
||||
break;
|
||||
@@ -981,47 +989,48 @@ MxU8 Infocenter::HandleClick(LegoControlManagerEvent& p_param)
|
||||
m_infocenterState->SetUnknown0x74(5);
|
||||
m_transitionDestination = LegoGameState::e_act3script;
|
||||
actionToPlay =
|
||||
(InfomainScript) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct()).Next();
|
||||
(InfomainScript::Script) m_infocenterState->GetLeaveDialogue(GameState()->GetCurrentAct()).Next();
|
||||
InputManager()->DisableInputProcessing();
|
||||
InputManager()->SetUnknown336(TRUE);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case c_bookCtl:
|
||||
case InfomainScript::c_Book_Ctl:
|
||||
m_transitionDestination = LegoGameState::e_regbook;
|
||||
m_infocenterState->SetUnknown0x74(4);
|
||||
actionToPlay = GameState()->GetCurrentAct() != LegoGameState::e_act1 ? c_goToRegBookRed : c_goToRegBook;
|
||||
actionToPlay = GameState()->GetCurrentAct() != LegoGameState::e_act1 ? InfomainScript::c_GoTo_RegBook_Red
|
||||
: InfomainScript::c_GoTo_RegBook;
|
||||
m_radio.Stop();
|
||||
GameState()->SetUnknown0x42c(GameState()->GetPreviousArea());
|
||||
InputManager()->DisableInputProcessing();
|
||||
break;
|
||||
case c_mamaCtl:
|
||||
characterBitmap = c_mamaSelected;
|
||||
case InfomainScript::c_Mama_Ctl:
|
||||
characterBitmap = InfomainScript::c_MamaHot_Bitmap;
|
||||
UpdateFrameHot(FALSE);
|
||||
break;
|
||||
case c_papaCtl:
|
||||
characterBitmap = c_papaSelected;
|
||||
case InfomainScript::c_Papa_Ctl:
|
||||
characterBitmap = InfomainScript::c_PapaHot_Bitmap;
|
||||
UpdateFrameHot(FALSE);
|
||||
break;
|
||||
case c_pepperCtl:
|
||||
characterBitmap = c_pepperSelected;
|
||||
case InfomainScript::c_Pepper_Ctl:
|
||||
characterBitmap = InfomainScript::c_PepperHot_Bitmap;
|
||||
UpdateFrameHot(FALSE);
|
||||
break;
|
||||
case c_nickCtl:
|
||||
characterBitmap = c_nickSelected;
|
||||
case InfomainScript::c_Nick_Ctl:
|
||||
characterBitmap = InfomainScript::c_NickHot_Bitmap;
|
||||
UpdateFrameHot(FALSE);
|
||||
break;
|
||||
case c_lauraCtl:
|
||||
characterBitmap = c_lauraSelected;
|
||||
case InfomainScript::c_Laura_Ctl:
|
||||
characterBitmap = InfomainScript::c_LauraHot_Bitmap;
|
||||
UpdateFrameHot(FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
if (actionToPlay != c_noInfomain) {
|
||||
if (actionToPlay != InfomainScript::c_noneInfomain) {
|
||||
PlayAction(actionToPlay);
|
||||
}
|
||||
|
||||
if (characterBitmap != c_noInfomain) {
|
||||
if (characterBitmap != InfomainScript::c_noneInfomain) {
|
||||
m_unk0x11c = (MxStillPresenter*) Find(m_atom, characterBitmap);
|
||||
}
|
||||
}
|
||||
@@ -1039,7 +1048,7 @@ MxLong Infocenter::HandleNotification0(MxNotificationParam& p_param)
|
||||
if (m_infocenterState->GetUnknown0x74() == 8) {
|
||||
m_infoManDialogueTimer = 0;
|
||||
StopCutscene();
|
||||
PlayAction(c_exitConfirmationDialogue);
|
||||
PlayAction(InfomainScript::c_iic043in_RunAnim);
|
||||
}
|
||||
}
|
||||
else if (sender->IsA("MxEntity") && m_infocenterState->GetUnknown0x74() != 5 && m_infocenterState->GetUnknown0x74() != 12) {
|
||||
@@ -1047,12 +1056,12 @@ MxLong Infocenter::HandleNotification0(MxNotificationParam& p_param)
|
||||
case 5: {
|
||||
m_infoManDialogueTimer = 0;
|
||||
|
||||
InfomainScript objectId;
|
||||
InfomainScript::Script objectId;
|
||||
if (GameState()->GetCurrentAct() != LegoGameState::e_act1) {
|
||||
objectId = (InfomainScript) m_infocenterState->GetExitDialogueAct23().Next();
|
||||
objectId = (InfomainScript::Script) m_infocenterState->GetExitDialogueAct23().Next();
|
||||
}
|
||||
else {
|
||||
objectId = (InfomainScript) m_infocenterState->GetExitDialogueAct1().Next();
|
||||
objectId = (InfomainScript::Script) m_infocenterState->GetExitDialogueAct1().Next();
|
||||
}
|
||||
|
||||
PlayAction(objectId);
|
||||
@@ -1066,7 +1075,7 @@ MxLong Infocenter::HandleNotification0(MxNotificationParam& p_param)
|
||||
SetROIUnknown0x0c(g_object2x4red, 0);
|
||||
SetROIUnknown0x0c(g_object2x4grn, 0);
|
||||
m_infocenterState->SetUnknown0x74(2);
|
||||
PlayAction(c_infomanSneeze);
|
||||
PlayAction(InfomainScript::c_iicb28in_RunAnim);
|
||||
return 1;
|
||||
}
|
||||
case 7:
|
||||
@@ -1076,7 +1085,7 @@ MxLong Infocenter::HandleNotification0(MxNotificationParam& p_param)
|
||||
}
|
||||
|
||||
m_infocenterState->SetUnknown0x74(12);
|
||||
PlayAction(c_exitGameDialogue);
|
||||
PlayAction(InfomainScript::c_iic046in_RunAnim);
|
||||
InputManager()->DisableInputProcessing();
|
||||
InputManager()->SetUnknown336(TRUE);
|
||||
return 1;
|
||||
@@ -1085,12 +1094,18 @@ MxLong Infocenter::HandleNotification0(MxNotificationParam& p_param)
|
||||
}
|
||||
else {
|
||||
if (sender->IsA("Radio") && m_radio.GetState()->IsActive()) {
|
||||
if (m_currentInfomainScript == c_mamaMovie || m_currentInfomainScript == c_papaMovie ||
|
||||
m_currentInfomainScript == c_pepperMovie || m_currentInfomainScript == c_nickMovie ||
|
||||
m_currentInfomainScript == c_lauraMovie || m_currentInfomainScript == c_infoCtlDescription ||
|
||||
m_currentInfomainScript == c_boatCtlDescription || m_currentInfomainScript == c_raceCtlDescription ||
|
||||
m_currentInfomainScript == c_pizzaCtlDescription || m_currentInfomainScript == c_gasCtlDescription ||
|
||||
m_currentInfomainScript == c_medCtlDescription || m_currentInfomainScript == c_copCtlDescription) {
|
||||
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) {
|
||||
StopCurrentAction();
|
||||
}
|
||||
}
|
||||
@@ -1124,7 +1139,7 @@ MxResult Infocenter::Tickle()
|
||||
}
|
||||
|
||||
if (m_infoManDialogueTimer != 0 && (m_infoManDialogueTimer += 100) > 25000) {
|
||||
PlayAction(c_clickOnInfomanDialogue);
|
||||
PlayAction(InfomainScript::c_iicx17in_RunAnim);
|
||||
m_infoManDialogueTimer = 0;
|
||||
}
|
||||
|
||||
@@ -1382,7 +1397,7 @@ void Infocenter::StartCredits()
|
||||
VideoManager()->FUN_1007c520();
|
||||
GetViewManager()->RemoveAll(NULL);
|
||||
|
||||
InvokeAction(Extra::e_opendisk, *g_creditsScript, c_unk499, NULL);
|
||||
InvokeAction(Extra::e_opendisk, *g_creditsScript, CreditsScript::c_LegoCredits, NULL);
|
||||
SetAppCursor(0);
|
||||
}
|
||||
|
||||
@@ -1390,14 +1405,14 @@ void Infocenter::StartCredits()
|
||||
void Infocenter::StopCredits()
|
||||
{
|
||||
MxDSAction action;
|
||||
action.SetObjectId(499);
|
||||
action.SetObjectId(CreditsScript::c_LegoCredits);
|
||||
action.SetAtomId(*g_creditsScript);
|
||||
action.SetUnknown24(-2);
|
||||
DeleteObject(action);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10071300
|
||||
void Infocenter::PlayAction(InfomainScript p_objectId)
|
||||
void Infocenter::PlayAction(InfomainScript::Script p_objectId)
|
||||
{
|
||||
MxDSAction action;
|
||||
action.SetObjectId(p_objectId);
|
||||
@@ -1412,13 +1427,13 @@ void Infocenter::PlayAction(InfomainScript p_objectId)
|
||||
// FUNCTION: LEGO1 0x100713d0
|
||||
void Infocenter::StopCurrentAction()
|
||||
{
|
||||
if (m_currentInfomainScript != c_noInfomain) {
|
||||
if (m_currentInfomainScript != InfomainScript::c_noneInfomain) {
|
||||
MxDSAction action;
|
||||
action.SetObjectId(m_currentInfomainScript);
|
||||
action.SetAtomId(*g_infomainScript);
|
||||
action.SetUnknown24(-2);
|
||||
DeleteObject(action);
|
||||
m_currentInfomainScript = c_noInfomain;
|
||||
m_currentInfomainScript = InfomainScript::c_noneInfomain;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1426,7 +1441,7 @@ void Infocenter::StopCurrentAction()
|
||||
void Infocenter::PlayBookAnimation()
|
||||
{
|
||||
MxDSAction action;
|
||||
action.SetObjectId(c_bookWig);
|
||||
action.SetObjectId(SndanimScript::c_BookWig_Flic);
|
||||
action.SetAtomId(*g_sndAnimScript);
|
||||
Start(&action);
|
||||
}
|
||||
@@ -1435,7 +1450,7 @@ void Infocenter::PlayBookAnimation()
|
||||
void Infocenter::StopBookAnimation()
|
||||
{
|
||||
MxDSAction action;
|
||||
action.SetObjectId(c_bookWig);
|
||||
action.SetObjectId(SndanimScript::c_BookWig_Flic);
|
||||
action.SetAtomId(*g_sndAnimScript);
|
||||
action.SetUnknown24(-2);
|
||||
DeleteObject(action);
|
||||
|
||||
Reference in New Issue
Block a user