Isle
Loading...
Searching...
No Matches
infocenter.cpp
Go to the documentation of this file.
1#include "infocenter.h"
2
3#include "act3.h"
4#include "credits_actions.h"
5#include "helicopter.h"
6#include "infomain_actions.h"
7#include "jukebox.h"
8#include "jukebox_actions.h"
9#include "legoact2.h"
11#include "legobuildingmanager.h"
13#include "legocontrolmanager.h"
14#include "legogamestate.h"
15#include "legoinputmanager.h"
16#include "legomain.h"
17#include "legoplantmanager.h"
18#include "legoutils.h"
19#include "legovideomanager.h"
22#include "mxcontrolpresenter.h"
23#include "mxdisplaysurface.h"
24#include "mxmisc.h"
26#include "mxstillpresenter.h"
27#include "mxticklemanager.h"
28#include "mxtransitionmanager.h"
29#include "mxutilities.h"
30#include "scripts.h"
31#include "sndanim_actions.h"
33
37
38// GLOBAL: LEGO1 0x100f76a0
39const char* g_object2x4red = "2x4red";
40
41// GLOBAL: LEGO1 0x100f76a4
42const char* g_object2x4grn = "2x4grn";
43
44// GLOBAL: LEGO1 0x100f76a8
60};
61
62// GLOBAL: LEGO1 0x100f76e0
69 // Zero-terminated
70};
71
72// GLOBAL: LEGO1 0x100f76f8
79 // Zero-terminated
80};
81
82// GLOBAL: LEGO1 0x100f7710
87 // Zero-terminated
88};
89
90// GLOBAL: LEGO1 0x100f7720
96};
97
98// GLOBAL: LEGO1 0x100f7730
104};
105
106// GLOBAL: LEGO1 0x100f7740
112};
113
114// GLOBAL: LEGO1 0x100f7750
119 // Zero-terminated
120};
121
122// GLOBAL: LEGO1 0x100f7760
126};
127
128// FUNCTION: LEGO1 0x1006ea20
130{
131 m_selectedCharacter = e_noCharacter;
132 m_dragPresenter = NULL;
133 m_infocenterState = NULL;
134 m_frame = NULL;
135 m_destLocation = LegoGameState::e_undefined;
136 m_currentInfomainScript = InfomainScript::c_noneInfomain;
137 m_currentCutscene = e_noIntro;
138
139 memset(&m_glowInfo, 0, sizeof(m_glowInfo));
140
141 m_unk0x1c8 = -1;
144
145 m_infoManDialogueTimer = 0;
146 m_bookAnimationTimer = 0;
147 m_unk0x1d4 = 0;
148 m_unk0x1d6 = 0;
149}
150
151// FUNCTION: LEGO1 0x1006ec80
153{
154}
155
156// FUNCTION: LEGO1 0x1006ec90
158{
160
161 MxS16 i = 0;
162 do {
163 if (m_infocenterState->GetNameLetter(i) != NULL) {
164 m_infocenterState->GetNameLetter(i)->Enable(FALSE);
165 }
166 i++;
167 } while (i < m_infocenterState->GetMaxNameLength());
168
169 ControlManager()->Unregister(this);
170
171 InputManager()->UnRegister(this);
172 if (InputManager()->GetWorld() == this) {
174 }
175
177
179}
180
181// FUNCTION: LEGO1 0x1006ed90
183{
184 MxResult result = LegoWorld::Create(p_dsAction);
185 if (result == SUCCESS) {
186 InputManager()->SetWorld(this);
187 ControlManager()->Register(this);
188 }
189
190 m_infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState");
191 if (!m_infocenterState) {
192 m_infocenterState = (InfocenterState*) GameState()->CreateState("InfocenterState");
193 m_infocenterState->m_unk0x74 = 3;
194 }
195 else {
196 if (m_infocenterState->m_unk0x74 != 8 && m_infocenterState->m_unk0x74 != 4 &&
197 m_infocenterState->m_unk0x74 != 15) {
198 m_infocenterState->m_unk0x74 = 2;
199 }
200
201 MxS16 count, i;
202 for (count = 0; count < m_infocenterState->GetMaxNameLength(); count++) {
203 if (m_infocenterState->GetNameLetter(count) == NULL) {
204 break;
205 }
206 }
207
208 for (i = 0; i < count; i++) {
209 if (m_infocenterState->GetNameLetter(i)) {
210 m_infocenterState->GetNameLetter(i)->Enable(TRUE);
212 m_infocenterState->GetNameLetter(i)->SetPosition(((7 - count) / 2 + i) * 29 + 223, 45);
213 }
214 }
215 }
216
219
220 if (m_infocenterState->m_unk0x74 == 4) {
221 LegoGameState* state = GameState();
222 state->SetPreviousArea(GameState()->GetUnknown0x42c());
223 }
224
225 InputManager()->Register(this);
227
228 return result;
229}
230
231// FUNCTION: LEGO1 0x1006ef10
232// FUNCTION: BETA10 0x1002eaca
234{
235 MxNotificationParam& param = (MxNotificationParam&) p_param;
236 MxLong result = 0;
237 LegoWorld::Notify(p_param);
238
239 if (m_worldStarted) {
240 switch (param.GetNotification()) {
242 result = HandleNotification0((MxNotificationParam&) p_param);
243 break;
245 result = HandleEndAction((MxEndActionNotificationParam&) p_param);
246 break;
248 result = HandleKeyPress(((LegoEventNotificationParam&) p_param).GetKey());
249 break;
251 result = HandleButtonUp(
252 ((LegoEventNotificationParam&) p_param).GetX(),
253 ((LegoEventNotificationParam&) p_param).GetY()
254 );
255 break;
257 result = HandleMouseMove(
258 ((LegoEventNotificationParam&) p_param).GetX(),
259 ((LegoEventNotificationParam&) p_param).GetY()
260 );
261 break;
263 result = HandleControl((LegoControlManagerNotificationParam&) p_param);
264 break;
266 StopBookAnimation();
267 m_bookAnimationTimer = 0;
268
269 if (m_infocenterState->m_unk0x74 == 0x0c) {
270 StartCredits();
271 m_infocenterState->m_unk0x74 = 0xd;
272 }
273 else if (m_destLocation != 0) {
275 GameState()->SwitchArea(m_destLocation);
276 m_destLocation = LegoGameState::e_undefined;
277 }
278 break;
279 }
280 }
281
282 return result;
283}
284
285// FUNCTION: LEGO1 0x1006f080
286MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
287{
288 MxDSAction* action = p_param.GetAction();
289 if (action->GetAtomId() == *g_creditsScript && action->GetObjectId() == CreditsScript::c_LegoCredits) {
291 return 1;
292 }
293
294 if (action->GetAtomId() == m_atomId && (action->GetObjectId() == InfomainScript::c_Mama_All_Movie ||
299 if (m_unk0x1d4) {
300 m_unk0x1d4--;
301 }
302
303 if (!m_unk0x1d4) {
305 GameState()->SetActor(m_selectedCharacter);
306
307 switch (m_selectedCharacter) {
308 case e_pepper:
310 break;
311 case e_mama:
313 break;
314 case e_papa:
316 break;
317 case e_nick:
319 break;
320 case e_laura:
322 break;
323 default:
324 break;
325 }
326
327 UpdateFrameHot(TRUE);
328 }
329 }
330
331 MxLong result = m_radio.Notify(p_param);
332
333 if (result || (action->GetAtomId() != m_atomId && action->GetAtomId() != *g_introScript)) {
334 return result;
335 }
336
339 m_unk0x1d6 = 0;
340 }
341
342 switch (m_infocenterState->m_unk0x74) {
343 case 0:
344 switch (m_currentCutscene) {
345 case e_legoMovie:
346 PlayCutscene(e_mindscapeMovie, FALSE);
347 return 1;
348 case e_mindscapeMovie:
349 PlayCutscene(e_introMovie, TRUE);
350 return 1;
351 case e_badEndMovie:
352 StopCutscene();
353 m_infocenterState->m_unk0x74 = 11;
355 m_currentCutscene = e_noIntro;
356 return 1;
357 case e_goodEndMovie:
358 StopCutscene();
359 m_infocenterState->m_unk0x74 = 11;
361 m_currentCutscene = e_noIntro;
362 return 1;
363 }
364
365 // default / 2nd case probably?
366 StopCutscene();
367 m_infocenterState->m_unk0x74 = 11;
369 m_currentCutscene = e_noIntro;
370
371 if (!m_infocenterState->HasRegistered()) {
372 m_bookAnimationTimer = 1;
373 return 1;
374 }
375 break;
376 case 1:
377 m_infocenterState->m_unk0x74 = 11;
378
379 switch (m_currentCutscene) {
380 case e_badEndMovie:
382 break;
383 case e_goodEndMovie:
385 break;
386 default:
388 }
389
390 m_currentCutscene = e_noIntro;
391 return 1;
392 case 2:
396 return 1;
397 case 4:
401 m_infocenterState->m_unk0x74 = 14;
402 return 1;
403 }
404 break;
405 case 5:
406 if (action->GetObjectId() == m_currentInfomainScript) {
407 if (GameState()->GetCurrentAct() != LegoGameState::e_act3 && m_selectedCharacter != e_noCharacter) {
408 GameState()->SetActor(m_selectedCharacter);
409 }
411 m_infocenterState->m_unk0x74 = 14;
412 return 1;
413 }
414 break;
415 case 11:
416 if (!m_infocenterState->HasRegistered() && m_currentInfomainScript != InfomainScript::c_Mama_All_Movie &&
417 m_currentInfomainScript != InfomainScript::c_Papa_All_Movie &&
418 m_currentInfomainScript != InfomainScript::c_Pepper_All_Movie &&
419 m_currentInfomainScript != InfomainScript::c_Nick_All_Movie &&
420 m_currentInfomainScript != InfomainScript::c_Laura_All_Movie) {
421 m_infoManDialogueTimer = 1;
423 }
424
425 m_infocenterState->m_unk0x74 = 2;
426 SetROIVisible("infoman", TRUE);
427 return 1;
428 case 12:
429 if (action->GetObjectId() == m_currentInfomainScript) {
431 }
432 }
433
434 result = 1;
435
436 return result;
437}
438
439// FUNCTION: LEGO1 0x1006f4e0
441{
442 m_infoManDialogueTimer = 0;
443 m_bookAnimationTimer = 0;
444 m_unk0x1d4 = 0;
445 m_unk0x1d6 = 0;
446
447 MxStillPresenter* bg = (MxStillPresenter*) Find("MxStillPresenter", "Background_Bitmap");
448 MxStillPresenter* bgRed = (MxStillPresenter*) Find("MxStillPresenter", "BackgroundRed_Bitmap");
449
450 switch (GameState()->GetCurrentAct()) {
452 bg->Enable(TRUE);
453 InitializeBitmaps();
454
455 switch (m_infocenterState->m_unk0x74) {
456 case 3:
457 PlayCutscene(e_legoMovie, TRUE);
458 m_infocenterState->m_unk0x74 = 0;
459 return;
460 case 4:
461 m_infocenterState->m_unk0x74 = 2;
462 if (!m_infocenterState->HasRegistered()) {
463 m_bookAnimationTimer = 1;
464 }
465
469 return;
470 case 5:
471 default: {
473
474 InfomainScript::Script script = m_infocenterState->GetNextReturnDialogue();
475 PlayAction(script);
476
478 m_unk0x1d6 = 1;
479 }
480
482
483 if (!m_infocenterState->HasRegistered()) {
484 m_bookAnimationTimer = 1;
485 }
486
487 break;
488 }
489 case 8:
493 return;
494 case 0xf:
495 m_infocenterState->m_unk0x74 = 2;
496 if (!m_infocenterState->HasRegistered()) {
497 m_bookAnimationTimer = 1;
498 }
499
503 return;
504 }
505 break;
507 if (m_infocenterState->m_unk0x74 == 8) {
509 bgRed->Enable(TRUE);
512 return;
513 }
514
515 LegoAct2State* state = (LegoAct2State*) GameState()->GetState("LegoAct2State");
517
518 if (state && state->GetUnknown0x08() == 0x68) {
519 bg->Enable(TRUE);
520 PlayCutscene(e_badEndMovie, TRUE);
521 m_infocenterState->m_unk0x74 = 0;
522 return;
523 }
524
525 if (m_infocenterState->m_unk0x74 == 4) {
526 bgRed->Enable(TRUE);
527
528 if (GameState()->GetCurrentAct() == GameState()->GetLoadedAct()) {
532 }
533
534 m_infocenterState->m_unk0x74 = 5;
535 m_destLocation = LegoGameState::e_act2main;
536
537 InfomainScript::Script script = m_infocenterState->GetNextReturnDialogue();
538 PlayAction(script);
539
542 return;
543 }
544
546 InfomainScript::Script script = m_infocenterState->GetNextReturnDialogue();
547 PlayAction(script);
548 bgRed->Enable(TRUE);
549 break;
550 }
552 if (m_infocenterState->m_unk0x74 == 8) {
554 bgRed->Enable(TRUE);
557 return;
558 }
559
560 Act3State* state = (Act3State*) GameState()->GetState("Act3State");
562
563 if (state && state->GetUnknown0x08() == 3) {
564 bg->Enable(TRUE);
565 PlayCutscene(e_badEndMovie, TRUE);
566 m_infocenterState->m_unk0x74 = 0;
567 return;
568 }
569
570 if (state && state->GetUnknown0x08() == 2) {
571 bg->Enable(TRUE);
572 PlayCutscene(e_goodEndMovie, TRUE);
573 m_infocenterState->m_unk0x74 = 0;
574 return;
575 }
576
577 if (m_infocenterState->m_unk0x74 == 4) {
578 bgRed->Enable(TRUE);
579
580 if (GameState()->GetCurrentAct() == GameState()->GetLoadedAct()) {
584 }
585
586 m_infocenterState->m_unk0x74 = 5;
587 m_destLocation = LegoGameState::e_act3script;
588
589 InfomainScript::Script script = m_infocenterState->GetNextReturnDialogue();
590 PlayAction(script);
591
594 return;
595 }
596
598 InfomainScript::Script script = m_infocenterState->GetNextReturnDialogue();
599 PlayAction(script);
600 bgRed->Enable(TRUE);
601 break;
602 }
603 }
604
605 m_infocenterState->m_unk0x74 = 11;
607}
608
609// FUNCTION: LEGO1 0x1006f9a0
610// FUNCTION: BETA10 0x1002ef2f
611void Infocenter::InitializeBitmaps()
612{
613 m_radio.Initialize(TRUE);
614
630
631 m_glowInfo[0].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Info_A_Bitmap");
632 assert(m_glowInfo[0].m_destCtl);
633 m_glowInfo[0].m_area = MxRect<MxS32>(391, 182, 427, 230);
634 m_glowInfo[0].m_unk0x04 = 3;
635
636 m_glowInfo[1].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Boat_A_Bitmap");
637 assert(m_glowInfo[1].m_destCtl);
638 m_glowInfo[1].m_area = MxRect<MxS32>(304, 225, 350, 268);
639 m_glowInfo[1].m_unk0x04 = 10;
640
641 m_glowInfo[2].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Race_A_Bitmap");
642 assert(m_glowInfo[1].m_destCtl); // DECOMP: intentional typo
643 m_glowInfo[2].m_area = MxRect<MxS32>(301, 133, 347, 181);
644 m_glowInfo[2].m_unk0x04 = 11;
645
646 m_glowInfo[3].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Pizza_A_Bitmap");
647 assert(m_glowInfo[3].m_destCtl);
648 m_glowInfo[3].m_area = MxRect<MxS32>(289, 182, 335, 225);
649 m_glowInfo[3].m_unk0x04 = 12;
650
651 m_glowInfo[4].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Gas_A_Bitmap");
652 assert(m_glowInfo[4].m_destCtl);
653 m_glowInfo[4].m_area = MxRect<MxS32>(350, 161, 391, 209);
654 m_glowInfo[4].m_unk0x04 = 13;
655
656 m_glowInfo[5].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Med_A_Bitmap");
657 assert(m_glowInfo[5].m_destCtl);
658 m_glowInfo[5].m_area = MxRect<MxS32>(392, 130, 438, 176);
659 m_glowInfo[5].m_unk0x04 = 14;
660
661 m_glowInfo[6].m_destCtl = (MxStillPresenter*) Find("MxStillPresenter", "Cop_A_Bitmap");
662 assert(m_glowInfo[6].m_destCtl);
663 m_glowInfo[6].m_area = MxRect<MxS32>(396, 229, 442, 272);
664 m_glowInfo[6].m_unk0x04 = 15;
665
666 m_frame = (MxStillPresenter*) Find("MxStillPresenter", "FrameHot_Bitmap");
667 assert(m_frame);
668
669 UpdateFrameHot(TRUE);
670}
671
672// FUNCTION: LEGO1 0x1006fd00
673// FUNCTION: BETA10 0x1002f808
674MxU8 Infocenter::HandleMouseMove(MxS32 p_x, MxS32 p_y)
675{
676 if (m_dragPresenter) {
677 if (!m_dragPresenter->IsEnabled()) {
678 MxS32 oldDisplayZ = m_dragPresenter->GetDisplayZ();
679
680 m_dragPresenter->SetDisplayZ(1000);
682 m_dragPresenter->Enable(TRUE);
683 m_dragPresenter->SetPosition(p_x, p_y);
684 m_dragPresenter->SetDisplayZ(oldDisplayZ);
685 }
686 else {
687 m_dragPresenter->SetPosition(p_x, p_y);
688 }
689
690 FUN_10070d10(p_x, p_y);
691 return 1;
692 }
693
694 return 0;
695}
696
697// FUNCTION: LEGO1 0x1006fda0
698// FUNCTION: BETA10 0x1002f907
699MxLong Infocenter::HandleKeyPress(MxS8 p_key)
700{
701 MxLong result = 0;
702
703 if (p_key == VK_SPACE && m_worldStarted) {
704 switch (m_infocenterState->m_unk0x74) {
705 case 0:
706 StopCutscene();
707 m_infocenterState->m_unk0x74 = 1;
708
709 if (!m_infocenterState->HasRegistered()) {
710 m_bookAnimationTimer = 1;
711 return 1;
712 }
713 break;
714 case 1:
715 case 4:
716 break;
717 default: {
718 InfomainScript::Script script = m_currentInfomainScript;
719 StopCurrentAction();
720
721 switch (m_infocenterState->m_unk0x74) {
722 case 5:
723 case 12:
724 m_currentInfomainScript = script;
725 return 1;
726 default:
727 m_infocenterState->m_unk0x74 = 2;
728 return 1;
729 case 8:
730 case 11:
731 break;
732 }
733 }
734 case 13:
735 StopCredits();
736 break;
737 }
738
739 result = 1;
740 }
741
742 return result;
743}
744
745// FUNCTION: LEGO1 0x1006feb0
746// FUNCTION: BETA10 0x1002fa12
747MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
748{
749 if (m_dragPresenter) {
750 MxControlPresenter* control = InputManager()->GetControlManager()->FUN_100294e0(p_x - 1, p_y - 1);
751
752 switch (m_dragPresenter->GetAction()->GetObjectId()) {
754 m_selectedCharacter = e_pepper;
755 break;
757 m_selectedCharacter = e_mama;
758 break;
760 m_selectedCharacter = e_papa;
761 break;
763 m_selectedCharacter = e_nick;
764 break;
766 m_selectedCharacter = e_laura;
767 break;
768 }
769
770 if (control != NULL) {
771 m_infoManDialogueTimer = 0;
772
773 switch (control->GetAction()->GetObjectId()) {
775 if (m_selectedCharacter == e_pepper) {
776 m_radio.Stop();
779 m_unk0x1d4++;
780 }
781 break;
783 if (m_selectedCharacter == e_mama) {
784 m_radio.Stop();
787 m_unk0x1d4++;
788 }
789 break;
791 if (m_selectedCharacter == e_papa) {
792 m_radio.Stop();
795 m_unk0x1d4++;
796 }
797 break;
799 if (m_selectedCharacter == e_nick) {
800 m_radio.Stop();
803 m_unk0x1d4++;
804 }
805 break;
807 if (m_selectedCharacter == e_laura) {
808 m_radio.Stop();
811 m_unk0x1d4++;
812 }
813 break;
814 }
815 }
816 else {
817 if (m_unk0x1c8 != -1) {
818 m_infoManDialogueTimer = 0;
819
820 switch (m_glowInfo[m_unk0x1c8].m_unk0x04) {
821 case 3:
822 GameState()->SetActor(m_selectedCharacter);
823
824 switch (m_selectedCharacter) {
825 case e_pepper:
827 break;
828 case e_mama:
830 break;
831 case e_papa:
833 break;
834 case e_nick:
836 break;
837 case e_laura:
839 break;
840 }
841 break;
842 case 10:
843 if (m_selectedCharacter) {
844 m_destLocation = LegoGameState::e_jetraceExterior;
845 m_infocenterState->m_unk0x74 = 5;
846 }
847 break;
848 case 11:
849 if (m_selectedCharacter) {
850 m_destLocation = LegoGameState::e_carraceExterior;
851 m_infocenterState->m_unk0x74 = 5;
852 }
853 break;
854 case 12:
855 if (m_selectedCharacter) {
856 m_destLocation = LegoGameState::e_pizzeriaExterior;
857 m_infocenterState->m_unk0x74 = 5;
858 }
859 break;
860 case 13:
861 if (m_selectedCharacter) {
862 m_destLocation = LegoGameState::e_garageExterior;
863 m_infocenterState->m_unk0x74 = 5;
864 }
865 break;
866 case 14:
867 if (m_selectedCharacter) {
868 m_destLocation = LegoGameState::e_hospitalExterior;
869 m_infocenterState->m_unk0x74 = 5;
870 }
871 break;
872 case 15:
873 if (m_selectedCharacter) {
874 m_destLocation = LegoGameState::e_policeExterior;
875 m_infocenterState->m_unk0x74 = 5;
876 }
877 break;
878 }
879 }
880 }
881
882 m_dragPresenter->Enable(FALSE);
883 m_dragPresenter = NULL;
884
885 if (m_infocenterState->m_unk0x74 == 5) {
886 InfomainScript::Script dialogueToPlay;
887
888 if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
889 if (!m_infocenterState->HasRegistered()) {
890 dialogueToPlay = InfomainScript::c_iic007in_PlayWav;
891 m_infocenterState->m_unk0x74 = 2;
892 m_destLocation = LegoGameState::e_undefined;
893 }
894 else {
895 switch (m_selectedCharacter) {
896 case e_pepper:
897 dialogueToPlay = InfomainScript::c_avo901in_RunAnim;
898 GameState()->SetActorId(m_selectedCharacter);
899 break;
900 case e_mama:
901 dialogueToPlay = InfomainScript::c_avo902in_RunAnim;
902 GameState()->SetActorId(m_selectedCharacter);
903 break;
904 case e_papa:
905 dialogueToPlay = InfomainScript::c_avo903in_RunAnim;
906 GameState()->SetActorId(m_selectedCharacter);
907 break;
908 case e_nick:
909 dialogueToPlay = InfomainScript::c_avo904in_RunAnim;
910 GameState()->SetActorId(m_selectedCharacter);
911 break;
912 case e_laura:
913 dialogueToPlay = InfomainScript::c_avo905in_RunAnim;
914 GameState()->SetActorId(m_selectedCharacter);
915 break;
916 default:
917 assert(0);
918 dialogueToPlay = m_infocenterState->GetNextLeaveDialogue();
919 break;
920 }
921
924 }
925 }
926 else {
927 dialogueToPlay = m_infocenterState->GetNextLeaveDialogue();
928 }
929
930 PlayAction(dialogueToPlay);
931 }
932
933 UpdateFrameHot(TRUE);
934 FUN_10070d10(0, 0);
935 }
936
937 return FALSE;
938}
939
940// FUNCTION: LEGO1 0x10070370
941// FUNCTION: BETA10 0x1002ffd4
942MxU8 Infocenter::HandleControl(LegoControlManagerNotificationParam& p_param)
943{
944 if (p_param.m_unk0x28 == 1) {
945 m_infoManDialogueTimer = 0;
946
948 StopCurrentAction();
950
951 LegoGameState* state = GameState();
952
953 switch (p_param.m_clickedObjectId) {
955 m_infocenterState->m_unk0x74 = 14;
956 StopCurrentAction();
957
958 if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
959 m_radio.Stop();
961 m_destLocation = LegoGameState::e_elevbott;
962 }
963 else {
964 MxU32 objectId = m_infocenterState->GetBricksterDialogue().Next();
965 PlayAction((InfomainScript::Script) objectId);
966 }
967
968 break;
970 m_infocenterState->m_unk0x74 = 14;
971 StopCurrentAction();
972
973 if (GameState()->GetCurrentAct() == LegoGameState::e_act1) {
974 m_radio.Stop();
976 m_destLocation = LegoGameState::e_infoscor;
977 }
978 else {
979 MxU32 objectId = m_infocenterState->GetBricksterDialogue().Next();
980 PlayAction((InfomainScript::Script) objectId);
981 }
982
983 break;
986 m_radio.Stop();
987 break;
989 if (m_infocenterState->m_unk0x74 != 8) {
991 m_radio.Stop();
992 m_infocenterState->m_unk0x74 = 8;
993 }
994
995 break;
998 m_radio.Stop();
999 break;
1002 m_radio.Stop();
1003 break;
1006 m_radio.Stop();
1007 break;
1010 m_radio.Stop();
1011 break;
1014 m_radio.Stop();
1015 break;
1018 m_radio.Stop();
1019 break;
1021 switch (state->GetCurrentAct()) {
1023 if (state->GetPreviousArea()) {
1024 switch (state->GetPreviousArea()) {
1028 m_infocenterState->m_unk0x74 = 5;
1029 m_destLocation = state->GetPreviousArea();
1030 actionToPlay = (InfomainScript::Script) m_infocenterState->GetNextLeaveDialogue();
1031 m_radio.Stop();
1034 break;
1042 break;
1043 default:
1044 if (state->GetActorId() != LegoActor::c_none) {
1045 if (!m_infocenterState->HasRegistered()) {
1047 m_infocenterState->m_unk0x74 = 2;
1048 }
1049 else {
1050 m_infocenterState->m_unk0x74 = 5;
1051 m_destLocation = state->m_previousArea;
1052 actionToPlay = (InfomainScript::Script) m_infocenterState->GetNextLeaveDialogue();
1053 m_radio.Stop();
1056 }
1057 }
1058 break;
1059 }
1060 }
1061 break;
1063 m_infocenterState->m_unk0x74 = 5;
1064 m_destLocation = LegoGameState::e_act2main;
1065 actionToPlay = (InfomainScript::Script) m_infocenterState->GetNextLeaveDialogue();
1068 break;
1070 m_infocenterState->m_unk0x74 = 5;
1071 m_destLocation = LegoGameState::e_act3script;
1072 actionToPlay = (InfomainScript::Script) m_infocenterState->GetNextLeaveDialogue();
1075 break;
1076 }
1077 break;
1079 m_destLocation = LegoGameState::e_regbook;
1080 m_infocenterState->m_unk0x74 = 4;
1083 m_radio.Stop();
1086 break;
1088 characterBitmap = InfomainScript::c_MamaHot_Bitmap;
1089 UpdateFrameHot(FALSE);
1090 break;
1092 characterBitmap = InfomainScript::c_PapaHot_Bitmap;
1093 UpdateFrameHot(FALSE);
1094 break;
1096 characterBitmap = InfomainScript::c_PepperHot_Bitmap;
1097 UpdateFrameHot(FALSE);
1098 break;
1100 characterBitmap = InfomainScript::c_NickHot_Bitmap;
1101 UpdateFrameHot(FALSE);
1102 break;
1104 characterBitmap = InfomainScript::c_LauraHot_Bitmap;
1105 UpdateFrameHot(FALSE);
1106 break;
1107 }
1108
1109 if (actionToPlay != InfomainScript::c_noneInfomain) {
1110 PlayAction(actionToPlay);
1111 }
1112
1113 if (characterBitmap != InfomainScript::c_noneInfomain) {
1114 m_dragPresenter = (MxStillPresenter*) Find(m_atomId, characterBitmap);
1115 assert(m_dragPresenter);
1116 }
1117 }
1118
1119 return 1;
1120}
1121
1122// FUNCTION: LEGO1 0x10070870
1123// FUNCTION: BETA10 0x1003039e
1124MxLong Infocenter::HandleNotification0(MxNotificationParam& p_param)
1125{
1126 // This function has changed significantly since BETA10
1127
1128 MxCore* sender = p_param.GetSender();
1129
1130 if (sender == NULL) {
1131 if (m_infocenterState->m_unk0x74 == 8) {
1132 m_infoManDialogueTimer = 0;
1133 StopCutscene();
1135 }
1136 }
1137 else if (sender->IsA("MxEntity") && m_infocenterState->m_unk0x74 != 5 && m_infocenterState->m_unk0x74 != 12) {
1138 switch (((MxEntity*) sender)->GetEntityId()) {
1139 case 5: {
1140 m_infoManDialogueTimer = 0;
1141
1142 InfomainScript::Script objectId;
1143 if (GameState()->GetCurrentAct() != LegoGameState::e_act1) {
1144 objectId = (InfomainScript::Script) m_infocenterState->GetExitDialogueAct23().Next();
1145 }
1146 else {
1147 objectId = (InfomainScript::Script) m_infocenterState->GetExitDialogueAct1().Next();
1148 }
1149
1150 PlayAction(objectId);
1153 return 1;
1154 }
1155 case 6:
1156 if (m_infocenterState->m_unk0x74 == 8) {
1157 StopCurrentAction();
1160 m_infocenterState->m_unk0x74 = 2;
1162 return 1;
1163 }
1164 case 7:
1165 if (m_infocenterState->m_unk0x74 == 8) {
1166 if (m_infocenterState->HasRegistered()) {
1167 GameState()->Save(0);
1168 }
1169
1170 m_infocenterState->m_unk0x74 = 12;
1174 return 1;
1175 }
1176 }
1177 }
1178 else {
1179 if (sender->IsA("Radio") && m_radio.GetState()->IsActive()) {
1180 if (m_currentInfomainScript == InfomainScript::c_Mama_All_Movie ||
1181 m_currentInfomainScript == InfomainScript::c_Papa_All_Movie ||
1182 m_currentInfomainScript == InfomainScript::c_Pepper_All_Movie ||
1183 m_currentInfomainScript == InfomainScript::c_Nick_All_Movie ||
1184 m_currentInfomainScript == InfomainScript::c_Laura_All_Movie ||
1185 m_currentInfomainScript == InfomainScript::c_iic007ra_PlayWav ||
1186 m_currentInfomainScript == InfomainScript::c_ijs002ra_PlayWav ||
1187 m_currentInfomainScript == InfomainScript::c_irt001ra_PlayWav ||
1188 m_currentInfomainScript == InfomainScript::c_ipz006ra_PlayWav ||
1189 m_currentInfomainScript == InfomainScript::c_igs004ra_PlayWav ||
1190 m_currentInfomainScript == InfomainScript::c_iho003ra_PlayWav ||
1191 m_currentInfomainScript == InfomainScript::c_ips005ra_PlayWav) {
1192 StopCurrentAction();
1193 }
1194 }
1195 }
1196
1197 return 1;
1198}
1199
1200// FUNCTION: LEGO1 0x10070aa0
1201// FUNCTION: BETA10 0x10030508
1203{
1204 LegoWorld::Enable(p_enable);
1205
1206 if (p_enable) {
1207 InputManager()->SetWorld(this);
1209 }
1210 else {
1211 if (InputManager()->GetWorld() == this) {
1213 }
1214 }
1215}
1216
1217// FUNCTION: LEGO1 0x10070af0
1219{
1220 if (m_worldStarted == FALSE) {
1222 return SUCCESS;
1223 }
1224
1225 if (m_infoManDialogueTimer != 0 && (m_infoManDialogueTimer += 100) > 25000) {
1227 m_infoManDialogueTimer = 0;
1228 }
1229
1230 if (m_bookAnimationTimer != 0 && (m_bookAnimationTimer += 100) > 3000) {
1231 PlayBookAnimation();
1232 m_bookAnimationTimer = 1;
1233 }
1234
1235 if (m_unk0x1d6 != 0) {
1236 m_unk0x1d6 += 100;
1237
1238 if (m_unk0x1d6 > 3400 && m_unk0x1d6 < 3650) {
1240 }
1241 else if (m_unk0x1d6 > 3650 && m_unk0x1d6 < 3900) {
1243 }
1244 else if (m_unk0x1d6 > 3900 && m_unk0x1d6 < 4150) {
1246 }
1247 else if (m_unk0x1d6 > 4400) {
1249 m_unk0x1d6 = 0;
1250 }
1251 }
1252
1253 return SUCCESS;
1254}
1255
1256// FUNCTION: LEGO1 0x10070c20
1257void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale)
1258{
1259 m_currentCutscene = p_entityId;
1260
1266
1267 if (m_currentCutscene != e_noIntro) {
1268 // check if the cutscene is an ending
1269 if (m_currentCutscene >= e_badEndMovie && m_currentCutscene <= e_goodEndMovie) {
1270 Reset();
1271 }
1272
1274 }
1275}
1276
1277// FUNCTION: LEGO1 0x10070cb0
1278void Infocenter::StopCutscene()
1279{
1280 if (m_currentCutscene != e_noIntro) {
1282 }
1283
1288}
1289
1290// FUNCTION: LEGO1 0x10070d00
1292{
1293 return TRUE;
1294}
1295
1296// FUNCTION: LEGO1 0x10070d10
1297// FUNCTION: BETA10 0x100307d4
1298void Infocenter::FUN_10070d10(MxS32 p_x, MxS32 p_y)
1299{
1300 MxS16 i;
1301 for (i = 0; i < (MxS32) (sizeof(m_glowInfo) / sizeof(m_glowInfo[0])); i++) {
1302 MxS32 right = m_glowInfo[i].m_area.GetRight();
1303 MxS32 bottom = m_glowInfo[i].m_area.GetBottom();
1304 MxS32 left = m_glowInfo[i].m_area.GetLeft();
1305 MxS32 top = m_glowInfo[i].m_area.GetTop();
1306
1307 if (left <= p_x && p_x <= right && top <= p_y && p_y <= bottom) {
1308 break;
1309 }
1310 }
1311
1312 if (i == 7) {
1313 i = -1;
1314 }
1315
1316 if (i != m_unk0x1c8) {
1317 if (m_unk0x1c8 != -1) {
1318 m_glowInfo[m_unk0x1c8].m_destCtl->Enable(FALSE);
1319 }
1320
1321 m_unk0x1c8 = i;
1322 if (i != -1) {
1323 m_glowInfo[i].m_destCtl->Enable(TRUE);
1324 }
1325 }
1326}
1327
1328// FUNCTION: LEGO1 0x10070dc0
1329// FUNCTION: BETA10 0x10030911
1330void Infocenter::UpdateFrameHot(MxBool p_display)
1331{
1332 if (p_display) {
1333 MxS32 x, y;
1334
1335 switch (GameState()->GetActorId()) {
1337 x = 302;
1338 y = 81;
1339 break;
1340 case LegoActor::c_mama:
1341 x = 204;
1342 y = 81;
1343 break;
1344 case LegoActor::c_papa:
1345 x = 253;
1346 y = 81;
1347 break;
1348 case LegoActor::c_nick:
1349 x = 353;
1350 y = 81;
1351 break;
1352 case LegoActor::c_laura:
1353 x = 399;
1354 y = 81;
1355 break;
1356 default:
1357 return;
1358 }
1359
1360 MxS32 originalDisplayZ = m_frame->GetDisplayZ();
1361
1362 m_frame->SetDisplayZ(1000);
1364
1365 m_frame->Enable(TRUE);
1366 m_frame->SetPosition(x, y);
1367 m_frame->SetDisplayZ(originalDisplayZ);
1368 }
1369 else {
1370 if (m_frame) {
1371 m_frame->Enable(FALSE);
1372 }
1373 }
1374}
1375
1376// FUNCTION: LEGO1 0x10070e90
1377void Infocenter::Reset()
1378{
1379 switch (GameState()->GetCurrentAct()) {
1382 break;
1385 break;
1386 }
1387
1395
1396 InitializeBitmaps();
1397 m_selectedCharacter = e_pepper;
1398
1400
1401 HelicopterState* state = (HelicopterState*) GameState()->GetState("HelicopterState");
1402
1403 if (state) {
1404 state->Reset();
1405 }
1406}
1407
1408// FUNCTION: LEGO1 0x10070f60
1410{
1411 if (m_infocenterState != NULL) {
1412 MxU32 val = m_infocenterState->m_unk0x74;
1413
1414 if (val == 0) {
1415 StopCutscene();
1416 m_infocenterState->m_unk0x74 = 1;
1417 }
1418 else if (val == 13) {
1419 StopCredits();
1420 }
1421 else if (val != 8) {
1422 m_infocenterState->m_unk0x74 = 8;
1423
1424#ifdef COMPAT_MODE
1425 {
1427 Notify(param);
1428 }
1429#else
1431#endif
1432 }
1433 }
1434
1435 return FALSE;
1436}
1437
1438// FUNCTION: LEGO1 0x10071030
1439void Infocenter::StartCredits()
1440{
1441 MxPresenter* presenter;
1442
1443 while (!m_set0xa8.empty()) {
1444 MxCoreSet::iterator it = m_set0xa8.begin();
1445 MxCore* object = *it;
1446 m_set0xa8.erase(it);
1447
1448 if (object->IsA("MxPresenter")) {
1449 presenter = (MxPresenter*) object;
1450 MxDSAction* action = presenter->GetAction();
1451
1452 if (action) {
1454 presenter->EndAction();
1455 }
1456 }
1457 else {
1458 delete object;
1459 }
1460 }
1461
1463
1464 while (cursor.First(presenter)) {
1465 cursor.Detach();
1466
1467 MxDSAction* action = presenter->GetAction();
1468 if (action) {
1470 presenter->EndAction();
1471 }
1472 }
1473
1475
1476 MxS16 i = 0;
1477 do {
1478 if (m_infocenterState->GetNameLetter(i) != NULL) {
1479 m_infocenterState->GetNameLetter(i)->Enable(FALSE);
1480 }
1481 i++;
1482 } while (i < m_infocenterState->GetMaxNameLength());
1483
1486
1489}
1490
1491// FUNCTION: LEGO1 0x10071250
1492void Infocenter::StopCredits()
1493{
1494 MxDSAction action;
1496 action.SetAtomId(*g_creditsScript);
1497 action.SetUnknown24(-2);
1498 DeleteObject(action);
1499}
1500
1501// FUNCTION: LEGO1 0x10071300
1502// FUNCTION: BETA10 0x1002ee8c
1503void Infocenter::PlayAction(InfomainScript::Script p_script)
1504{
1505 MxDSAction action;
1506 action.SetObjectId(p_script);
1507 action.SetAtomId(*g_infomainScript);
1508 StopCurrentAction();
1509
1510 m_currentInfomainScript = p_script;
1512 Start(&action);
1513}
1514
1515// FUNCTION: LEGO1 0x100713d0
1516void Infocenter::StopCurrentAction()
1517{
1518 if (m_currentInfomainScript != InfomainScript::c_noneInfomain) {
1519 MxDSAction action;
1520 action.SetObjectId(m_currentInfomainScript);
1521 action.SetAtomId(*g_infomainScript);
1522 action.SetUnknown24(-2);
1523 DeleteObject(action);
1524 m_currentInfomainScript = InfomainScript::c_noneInfomain;
1525 }
1526}
1527
1528// FUNCTION: LEGO1 0x100714a0
1529void Infocenter::PlayBookAnimation()
1530{
1531 MxDSAction action;
1533 action.SetAtomId(*g_sndAnimScript);
1534 Start(&action);
1535}
1536
1537// FUNCTION: LEGO1 0x10071550
1538void Infocenter::StopBookAnimation()
1539{
1540 MxDSAction action;
1542 action.SetAtomId(*g_sndAnimScript);
1543 action.SetUnknown24(-2);
1544 DeleteObject(action);
1545}
1546
1547// FUNCTION: LEGO1 0x10071600
1549{
1553
1556
1559
1562
1565
1568
1571
1573
1574 memset(m_letters, 0, sizeof(m_letters));
1575}
1576
1577// FUNCTION: LEGO1 0x10071920
1579{
1580 MxS16 i = 0;
1581 do {
1582 if (GetNameLetter(i) != NULL) {
1583 delete GetNameLetter(i)->GetAction();
1584 delete GetNameLetter(i);
1585 }
1586 i++;
1587 } while (i < GetMaxNameLength());
1588}
[AI] Holds persistent state and status variables for Act 3 mission, saved between world reloads and p...
Definition: act3.h:126
undefined4 GetUnknown0x08()
[AI] Getter for the (unknown) main status variable.
Definition: act3.h:165
[AI] Game state entity specialized for tracking Helicopter-related state during gameplay.
Definition: helicopter.h:14
MxBool Reset() override
[AI] Resets helicopter-specific state/progress tracking variable.
Definition: helicopter.h:26
[AI] Represents the state of the Infocenter area, storing scripts, dialogue playlists and UI letter p...
Definition: infocenter.h:23
Playlist m_leaveDialogue[3]
[AI] Playlists for leave dialogue, one per act (indices: 0=act1, 1=act2, 2=act3).
Definition: infocenter.h:139
MxS16 GetMaxNameLength()
[AI] Returns the maximum number of letters in the UI registration name (always 7).
Definition: infocenter.h:64
Playlist & GetExitDialogueAct23()
[AI] Returns the exit dialogue playlist for act 2 and 3.
Definition: infocenter.h:111
Playlist m_exitDialogueAct1
[AI] Playlist of exit dialogue scripts for Act 1.
Definition: infocenter.h:124
MxStillPresenter * m_letters[7]
[AI] UI presenters for each slot in the 7-letter name entry field (could be player's registered name)...
Definition: infocenter.h:154
Playlist m_bricksterDialogue
[AI] Playlist for Brickster special dialogue events ("heckling").
Definition: infocenter.h:144
Playlist & GetBricksterDialogue()
[AI] Returns the Brickster random interjection dialogue playlist.
Definition: infocenter.h:116
Playlist m_returnDialogue[3]
[AI] Playlists for return dialogue, one per act (indices: 0=act1, 1=act2, 2=act3).
Definition: infocenter.h:134
Playlist & GetExitDialogueAct1()
[AI] Returns the exit dialogue playlist for act 1.
Definition: infocenter.h:106
InfomainScript::Script GetNextReturnDialogue()
[AI] Gets the next "return" dialogue script for the current act, looping within the act's playlist.
Definition: infocenter.h:98
Playlist m_exitDialogueAct23
[AI] Playlist of exit dialogue scripts for Act 2/3.
Definition: infocenter.h:129
InfomainScript::Script GetNextLeaveDialogue()
[AI] Gets the next "leave" dialogue script for the current act, looping within the act's playlist.
Definition: infocenter.h:89
MxBool HasRegistered()
[AI] True if any letter slot is filled (indicating the player has registered).
Definition: infocenter.h:83
~InfocenterState() override
[AI] Destroys the InfocenterState, cleaning up letter presenters and their associated actions.
MxStillPresenter * GetNameLetter(MxS32 p_index)
[AI] Returns the pointer to the UI presenter for a specific letter in the name field.
Definition: infocenter.h:70
MxU32 m_unk0x74
[AI] State machine variable tracking the Infocenter flow (e.g., 0=intro, 3=NA, 4=goto book,...
Definition: infocenter.h:149
InfocenterState()
[AI] Constructs the InfocenterState, initializing all dialogue playlists and clearing letter pointers...
[AI] Manages Infocenter world logic, UI, cutscenes, dialogue, and area transitions.
Definition: infocenter.h:192
MxResult Tickle() override
[AI] Advances the Infocenter tick/update logic (timers, dialogue triggers, animation triggers,...
Infocenter()
[AI] Constructs Infocenter world, initializes state and registers for notifications.
Definition: infocenter.cpp:129
MxResult Create(MxDSAction &p_dsAction) override
[AI] Creates the Infocenter world and performs all Infocenter-specific setup logic.
Definition: infocenter.cpp:182
MxBool Escape() override
[AI] Handles Escape key (or similar) logic—exits cutscenes, cancels credits, or advances dialog state...
MxLong Notify(MxParam &p_param) override
[AI] Handles all notifications/events for Infocenter, routing them to specialized handlers.
Definition: infocenter.cpp:233
MxBool VTable0x5c() override
[AI] Returns TRUE unconditionally.
void ReadyWorld() override
[AI] Loads initial Infocenter state and presents the background, name registration,...
Definition: infocenter.cpp:440
@ e_legoMovie
[AI] The LEGO logo intro movie.
Definition: infocenter.h:200
@ e_noIntro
[AI] Sentinel for no movie/cutscene running.
Definition: infocenter.h:199
@ e_badEndMovie
[AI] Bad ending cutscene.
Definition: infocenter.h:204
@ e_introMovie
[AI] Main introduction movie.
Definition: infocenter.h:202
@ e_mindscapeMovie
[AI] The Mindscape logo intro movie.
Definition: infocenter.h:201
@ e_goodEndMovie
[AI] Good ending cutscene.
Definition: infocenter.h:205
@ e_pepper
[AI] Pepper Roni.
Definition: infocenter.h:213
@ e_mama
[AI] Mama Brickolini.
Definition: infocenter.h:214
@ e_nick
[AI] Nick Brick.
Definition: infocenter.h:216
@ e_noCharacter
[AI] No selection.
Definition: infocenter.h:212
@ e_laura
[AI] Laura Brick.
Definition: infocenter.h:217
@ e_papa
[AI] Papa Brickolini.
Definition: infocenter.h:215
~Infocenter() override
[AI] Destroys Infocenter world, unregisters and cleans up all state and UI/presenters.
Definition: infocenter.cpp:157
void Enable(MxBool p_enable) override
[AI] Enables or disables the Infocenter world, managing input and activity appropriately.
Represents the state object for Act 2 of the game.
Definition: legoact2.h:25
undefined4 GetUnknown0x08()
Gets the value of the unknown member variable.
Definition: legoact2.h:78
@ c_nick
Nick ([AI])
Definition: legoactor.h:20
@ c_laura
Laura ([AI])
Definition: legoactor.h:21
@ c_mama
Mama ([AI])
Definition: legoactor.h:18
@ c_none
No actor ([AI])
Definition: legoactor.h:16
@ c_pepper
Pepper Roni ([AI])
Definition: legoactor.h:17
@ c_papa
Papa ([AI])
Definition: legoactor.h:19
void Reset(MxBool p_und)
[AI] Resets all internal state; optionally resets animation state too.
void FUN_10030590()
[AI] Resets all buildings' construction/demolition status to "unbuilt" (-1), updates heights/visibili...
void ReleaseAllActors()
[AI] Releases all actors associated with this manager, unregistering/releasing references until destr...
[AI] Notification parameter for the LegoControlManager, used to propagate information about control e...
MxS32 m_clickedObjectId
[AI] Object ID of the clicked control/presenter (or -1 if not set). [AI]
MxS16 m_unk0x28
[AI] Undetermined; settable via SetUnknown0x28. [AI]
void Register(MxCore *p_listener)
[AI] Adds a listener to be notified of control events.
MxControlPresenter * FUN_100294e0(MxS32 p_x, MxS32 p_y)
[AI] Finds the topmost control presenter at the given screen coordinates.
void Unregister(MxCore *p_listener)
[AI] Removes a listener so it no longer receives control events.
void FUN_100293c0(MxU32 p_objectId, const char *p_atom, MxS16 p_unk0x4e)
[AI] Dispatches a presenter event for the given object and atom parameters.
Notification parameter class for LEGO event notifications such as mouse events and modifier keys.
Comprehensive persistent game state manager: handles save/load, player selection, area switching,...
Definition: legogamestate.h:78
Act GetCurrentAct()
Returns the active act that is currently in play. [AI].
void SwitchArea(Area p_area)
Switches the whole game state into a new area/world; manages transitions/scene loads.
void SetPreviousArea(Area p_previousArea)
Sets the previous area for reload/stop logic.
void SetCurrentAct(Act p_currentAct)
Sets the current game act.
Area m_currentArea
Area/world the player is presently in. [AI].
Area m_unk0x42c
Used for act area storage on save/load. [AI].
void SetActorId(MxU8 p_actorId)
Directly sets the current actor ID (preferred: use SetActor).
LegoState * CreateState(const char *p_stateName)
Creates an instance of given state, registers it, and returns pointer.
@ e_act3
Act 3: final main story segment. [AI].
Definition: legogamestate.h:86
@ e_act1
Act 1: the first main segment of the game. [AI].
Definition: legogamestate.h:84
@ e_act2
Act 2: main story segment two. [AI].
Definition: legogamestate.h:85
void StopArea(Area p_area)
Calls cleanup logic for the specified area (removes actors, VMs, closes handles, etc....
MxU8 GetActorId()
Returns the current selected actor ID. [AI].
Area m_previousArea
Where player was before last area switch. [AI].
MxResult Save(MxULong p_slot)
Saves persistent game state (world variables, actor, etc.) to a file slot.
void FindLoadedAct()
Analyses the loaded Lego worlds to determine which act is present. [AI].
LegoState * GetState(const char *p_stateName)
Find an existing state (LegoState-derived) object by its registered script/class name.
@ e_infomain
Information Center, main screen. [AI].
Definition: legogamestate.h:96
@ e_previousArea
Alias: go to previous area. [AI].
Definition: legogamestate.h:94
@ e_elevdown
Elevator moving down (animated). [AI].
@ e_hospitalExterior
Hospital, seen from outside. [AI].
@ e_act3script
Act 3 world/script main. [AI].
@ e_act2main
Act 2 world main screen. [AI].
@ e_jetraceExterior
Jetski race transition? [AI].
@ e_elevride2
Elevator ride/cab down (animated). [AI].
@ e_garageExterior
Garage (vehicle construction) exterior. [AI].
@ e_regbook
Registration book "new game" area. [AI].
@ e_pizzeriaExterior
Pizzeria, seen from outside. [AI].
@ e_infoscor
Info Center hi-score area. [AI].
@ e_undefined
Undefined or unset area. [AI].
Definition: legogamestate.h:93
@ e_elevride
Elevator ride/cab up (animated). [AI].
@ e_elevbott
Elevator bottom. [AI].
Definition: legogamestate.h:99
@ e_observe
Observatory interior. [AI].
@ e_policeExterior
Police Station, from outside. [AI].
@ e_carraceExterior
Car race exterior/transition. [AI].
@ e_infodoor
Info Center door/title view. [AI].
Definition: legogamestate.h:97
@ e_seaview
Ocean-side view at observatory. [AI].
@ e_elevopen
Elevator doors open. [AI].
Area GetPreviousArea()
Gets the last area before the current one. [AI].
void SetActor(MxU8 p_actorId)
Change the player character in the world to the given actor ID.
void SetUnknown335(MxBool p_unk0x335)
[AI] Typically used to allow button-down event processing during partial-blocked states.
void UnRegister(MxCore *)
[AI] Unregister a previously registered recipient so it will no longer receive input notifications.
void ClearWorld()
[AI] Remove any world assignment (used to clear targeting/scene changes). [AI]
LegoControlManager * GetControlManager()
[AI] Retrieve the active control manager, responsible for UI and main action mapping.
void SetUnknown336(MxBool p_unk0x336)
[AI] Enables accepting input only for space-bar events (used in special UI states).
void SetWorld(LegoWorld *p_world)
[AI] Assigns the current world to receive mouse/click/pick notifications.
void Register(MxCore *)
[AI] Register a core object as a recipient for keyboard events; safe for concurrent multi-threading.
void DisableInputProcessing()
[AI] Block most input processing, allowing only button-down and space events (UI modal input blocking...
void CloseMainWindow()
[AI] Posts a close (exit) message to the main window handle, triggering shutdown.
Definition: legomain.h:479
void RemoveWorld(const MxAtomId &p_atom, MxLong p_objectId)
[AI] Removes worlds by Atom and/or id, deleting matching entries from the world list and freeing reso...
Definition: legomain.cpp:335
@ c_clearScreen
[AI] When set, clears the display surface. [AI]
Definition: legomain.h:49
@ c_disable3d
[AI] When set, disables 3D rendering. [AI]
Definition: legomain.h:48
@ c_disableInput
[AI] When set, disables input processing. [AI]
Definition: legomain.h:47
void FUN_10027120()
[AI] Resets all growth/activity/animation state for all plants in the manager.
void EnableFullScreenMovie(MxBool p_enable)
[AI] Convenience method to enable or disable fullscreen movie playback with default scaling.
void FUN_1007c520()
[AI] Sets rendering state to allow PutData for all overlay presenters, disables 3D main rendering.
virtual void Enable(MxBool p_enable)
Enables or disables (pauses) the world and its main components.
Definition: legoworld.cpp:684
MxResult Tickle() override
Main world tick/update, especially manages startup countdown.
Definition: legoworld.cpp:810
MxCoreSet m_set0xa8
Set of 'auxiliary' objects, including presenters, that aren't core entity or animation,...
Definition: legoworld.h:352
MxBool m_worldStarted
Indicates if the world has successfully started and is considered active.
Definition: legoworld.h:388
MxCore * Find(const char *p_class, const char *p_name)
Finds an object of a given class and name in the world.
Definition: legoworld.cpp:573
MxLong Notify(MxParam &p_param) override
Notification callback responding to registered events such as EndAction and NewPresenter.
Definition: legoworld.cpp:212
MxResult Create(MxDSAction &p_dsAction) override
Initializes the world using an action, creating entity and sound lists, and camera controller.
Definition: legoworld.cpp:58
MxPresenterList m_controlPresenters
List of control presenters (UI, input, cutscene control, etc.).
Definition: legoworld.h:357
MxDSAction * GetAction()
[AI] Direct access to the underlying action.
const char * GetInternal() const
[AI] Returns a pointer to the internal string, or nullptr if not set.
Definition: mxatom.h:194
void RaiseVolume()
[AI] Requests that the background music volume is raised (decrements suppression counter); triggers f...
void LowerVolume()
[AI] Requests a reduction in current background music volume, queuing for fade out (increments suppre...
void Stop()
[AI] Immediately stops all background music, clears all actions and presenters, and resets tickle sta...
[AI] Presenter for UI controls, supporting toggles, grids, and "map" style controls with multiple int...
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
virtual MxBool IsA(const char *p_name) const
[AI] Checks whether this object's class type or parents match the given name.
Definition: mxcore.h:46
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
@ c_world
[AI] Action is described in world-space coordinates [AI]
Definition: mxdsaction.h:27
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
Definition: mxdsobject.h:133
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
Definition: mxdsobject.h:118
void SetUnknown24(MxS16 p_unk0x24)
[AI] Sets the unknown field at 0x24 (possibly version/state).
Definition: mxdsobject.h:151
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
Definition: mxdsobject.h:147
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
Definition: mxdsobject.h:130
void ClearScreen()
[AI] Fills the current back buffer with black (clears the display area). [AI]
[AI] Notification parameter marking the end of an action, specialization of MxActionNotificationParam...
MxEntity is a base class for game entities which are uniquely identified by an integer ID and an Atom...
Definition: mxentity.h:22
MxS32 GetEntityId()
Returns the current entity ID.
Definition: mxentity.h:93
MxAtomId m_atomId
The AtomId associated with this entity, used for resource and script identification.
Definition: mxentity.h:124
MxBool IsA(const char *p_name) const override
Checks if the object is of the given class name or a parent type.
Definition: mxentity.h:56
void Unregister(MxCore *p_listener)
[AI] Removes a previously registered listener and flushes any pending notifications for it.
void Register(MxCore *p_listener)
[AI] Registers a listener object to receive notifications.
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
NotificationId GetNotification() const
[AI] Retrieves the current notification type of this parameter.
MxCore * GetSender() const
[AI] Retrieves the sender pointer associated with this notification.
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
Definition: mxparam.h:7
[AI] Cursor/iterator for traversing an MxPresenterList.
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
Definition: mxpresenter.h:20
virtual void SetTickleState(TickleState p_tickleState)
[AI] Forces the tickle state, advancing to the requested lifecycle stage.
Definition: mxpresenter.h:100
virtual void EndAction()
[AI] Terminates the current action, notifies listeners and resets state.
Definition: mxpresenter.cpp:59
MxBool IsEnabled()
[AI] Returns whether this presenter is logically enabled (based on the associated action's flags).
void SetDisplayZ(MxS32 p_displayZ)
[AI] Sets the display Z (depth) order for the presenter.
Definition: mxpresenter.h:190
MxS32 GetDisplayZ() const
[AI] Returns the display Z (depth) order.
Definition: mxpresenter.h:172
@ e_repeating
[AI] Presentation is repeating (e.g., looping media).
Definition: mxpresenter.h:28
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
Definition: mxpresenter.h:175
[AI] 2D rectangle class templated on its value type.
Definition: mxgeometry.h:165
T GetTop() const
[AI] Get the top edge.
Definition: mxgeometry.h:231
T GetRight() const
[AI] Get the right edge.
Definition: mxgeometry.h:241
T GetLeft() const
[AI] Get the left edge.
Definition: mxgeometry.h:221
T GetBottom() const
[AI] Get the bottom edge.
Definition: mxgeometry.h:251
[AI] Presenter for single still image/bitmap media sources in the game.
virtual void SetPosition(MxS32 p_x, MxS32 p_y)
[AI] Sets the pixel-based position of the presented image.
void Enable(MxBool p_enable) override
[AI] Sets the enabled/disabled state of the presenter, updating the video manager's rendering as need...
virtual void UnregisterClient(MxCore *p_client)
[AI] Unregisters (marks for destruction) a previously registered client.
MxResult StartTransition(TransitionType p_animationType, MxS32 p_speed, MxBool p_doCopy, MxBool p_playMusicInAnim)
[AI] Begins a new transition animation of type p_animationType at the specified speed,...
@ e_mosaic
[AI] Complex mosaic block-out effect.
void SortPresenterList()
[AI] Sorts presenters in descending Z order for proper overdraw order during tickle (bubble-sort).
MxDisplaySurface * GetDisplaySurface()
[AI] Returns the display surface used for video output; for direct drawing and palette operations.
MxBool IsActive()
[AI] Indicates whether the radio is currently playing.
Definition: radio.h:46
void Stop()
[AI] Stops radio playback if currently active and updates audio state.
Definition: radio.cpp:126
MxLong Notify(MxParam &p_param) override
[AI] Handles system notifications (end actions, control events) relevant to the radio.
Definition: radio.cpp:85
void Initialize(MxBool p_und)
[AI] Sets radio system as enabled/disabled and resets state if changed.
Definition: radio.cpp:192
RadioState * GetState()
[AI] Returns the current RadioState for this radio.
Definition: radio.h:118
void RemoveAll(ViewROI *p_roi)
[AI] Recursively removes all ViewROI objects.
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define sizeOfArray(arr)
Definition: decomp.h:23
const char * g_object2x4red
Definition: infocenter.cpp:39
InfomainScript::Script g_exitDialogueAct23[6]
Definition: infocenter.cpp:63
InfomainScript::Script g_returnDialogueAct3[4]
Definition: infocenter.cpp:91
InfomainScript::Script g_returnDialogueAct2[4]
Definition: infocenter.cpp:83
InfomainScript::Script g_leaveDialogueAct1[4]
Definition: infocenter.cpp:99
InfomainScript::Script g_returnDialogueAct1[6]
Definition: infocenter.cpp:73
InfomainScript::Script g_bricksterDialogue[2]
Definition: infocenter.cpp:123
InfomainScript::Script g_leaveDialogueAct2[4]
Definition: infocenter.cpp:107
InfomainScript::Script g_leaveDialogueAct3[4]
Definition: infocenter.cpp:115
const char * g_object2x4grn
Definition: infocenter.cpp:42
InfomainScript::Script g_exitDialogueAct1[14]
Definition: infocenter.cpp:45
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
void InvokeAction(Extra::ActionType p_actionId, const MxAtomId &p_pAtom, MxS32 p_streamId, LegoEntity *p_sender)
[AI] Dispatches and triggers a game action on the given script or object.
Definition: legoutils.cpp:271
void SetAppCursor(Cursor p_cursor)
[AI] Sets the in-game cursor to a specified type.
Definition: legoutils.cpp:566
@ e_cursorBusy
[AI] Busy or loading cursor (e.g., hourglass). [AI]
Definition: legoutils.h:24
@ e_cursorNone
[AI] No cursor (invisible or hidden). [AI]
Definition: legoutils.h:34
@ e_cursorArrow
[AI] Standard arrow cursor. [AI]
Definition: legoutils.h:23
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
Definition: misc.cpp:61
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
Definition: misc.cpp:29
LegoCharacterManager * CharacterManager()
[AI] Accessor for the character manager, which manages in-game characters/NPCs. [AI]
Definition: misc.cpp:101
LegoAnimationManager * AnimationManager()
[AI] Accessor for the animation manager, which controls Lego character/world animation state....
Definition: misc.cpp:69
LegoBuildingManager * BuildingManager()
[AI] Accessor for the building manager, handles constructible buildings and structures....
Definition: misc.cpp:123
MxTransitionManager * TransitionManager()
[AI] Accessor for the MxTransitionManager, handling level transitions, fades, and world changes....
Definition: misc.cpp:208
MxBackgroundAudioManager * BackgroundAudioManager()
[AI] Accessor for the background audio manager. Used for background music and ambient sounds....
Definition: misc.cpp:37
ViewManager * GetViewManager()
[AI] Accessor for the current ViewManager, managing rendering views/cameras. [AI]
Definition: misc.cpp:108
LegoPlantManager * PlantManager()
[AI] Accessor for the plant manager, handling in-game foliage and plants. [AI]
Definition: misc.cpp:115
LegoControlManager * ControlManager()
[AI] Accessor for the control manager through the input manager; manages higher-level user/game contr...
Definition: misc.cpp:53
void FUN_10015820(MxBool p_disable, MxU16 p_flags)
[AI] Utility for enabling or disabling functionality in LegoOmni based on certain flags.
Definition: misc.cpp:143
void SetROIVisible(const char *p_name, MxBool p_visible)
[AI] Utility for setting the visibility flag of a named ROI object.
Definition: misc.cpp:158
void PlayMusic(JukeboxScript::Script p_objectId)
[AI] Starts music playback by scripting the background audio manager to play the music piece referenc...
Definition: misc.cpp:216
LegoOmni * Lego()
[AI] Retrieves the global LegoOmni singleton instance, providing access to core subsystems.
Definition: misc.cpp:16
void SetIsWorldActive(MxBool p_isWorldActive)
[AI] Toggles whether the world should be considered active (enables/disables camera/user control etc)...
Definition: misc.cpp:228
LegoInputManager * InputManager()
[AI] Accessor for the input manager, which handles keyboard, mouse, and controller input....
Definition: misc.cpp:45
MxResult Start(MxDSAction *p_dsAction)
[AI] Schedules and initiates execution of a script action.
Definition: mxmisc.cpp:97
void DeleteObject(MxDSAction &p_dsAction)
[AI] Deletes the specified action object, removing it from the global action list.
Definition: mxmisc.cpp:105
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
Definition: mxmisc.cpp:17
MxTickleManager * TickleManager()
[AI] Provides access to the global tickle manager.
Definition: mxmisc.cpp:25
@ c_notificationControl
[AI] UI control event [AI]
@ c_notificationButtonUp
[AI] Mouse/gamepad button release [AI]
@ c_notificationMouseMove
[AI] Mouse movement event [AI]
@ c_notificationKeyPress
[AI] Keyboard key press detected [AI]
@ c_notificationTransitioned
[AI] Object has transitioned states or locations [AI]
@ c_notificationType0
[AI] Undefined/Generic notification type [AI]
@ c_notificationEndAction
[AI] Indicates the end of an action [AI]
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
signed short MxS16
[AI]
Definition: mxtypes.h:26
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
signed char MxS8
[AI]
Definition: mxtypes.h:14
void FUN_100b7220(MxDSAction *p_action, MxU32 p_newFlags, MxBool p_setFlags)
Recursively sets or clears flags for an MxDSAction and all sub-actions if applicable.
@ c_LegoCredits
[AI] Identifier for the main script or starting action for LEGO credits sequence.
@ c_Cop_Ctl
[AI] UI/button logic for "Police" (Cop) menu/scene elements. [AI]
@ c_Laura_Ctl
[AI] Script/control logic for "Laura". [AI]
@ c_Book_Ctl
[AI] Script/control for the book icon/button in InfoMain. [AI]
@ c_Info_Ctl
[AI] Script/control for the main Info ("I") button logic. [AI]
@ c_BigInfo_Ctl
[AI] UI/button logic for the large Info button ("Big I") in InfoMain. [AI]
@ c_Pepper_All_Movie
[AI] Full-sequence animation/movie for Pepper character. [AI]
@ c_Mama_All_Movie
[AI] Full-sequence animation/movie for Mama character. [AI]
@ c_GoTo_RegBook_Red
[AI] Script/action to transition to red registration book scene. [AI]
@ c_Radio_Ctl
[AI] Script/control for radio UI/button or logic. [AI]
@ c_LauraHot_Bitmap
[AI] Hot/clickable bitmap for "Laura" character. [AI]
@ c_RightArrow_Ctl
[AI] Script/control for the right arrow UI element, handles navigation within InfoMain....
@ c_Med_Ctl
[AI] UI/button logic for "Medical" (hospital) menu/scene elements. [AI]
@ c_Papa_All_Movie
[AI] Full-sequence animation/movie for Papa character. [AI]
@ c_Gas_Ctl
[AI] UI/button logic for "Gas" menu/scene elements. [AI]
@ c_PapaHot_Bitmap
[AI] Hot/clickable bitmap for "Papa" character. [AI]
@ c_Nick_Ctl
[AI] Script/control logic for "Nick". [AI]
@ c_Nick_All_Movie
[AI] Full-sequence animation/movie for Nick character. [AI]
@ c_Papa_Ctl
[AI] Script/control logic for "Papa" Brick character. [AI]
@ c_PepperHot_Bitmap
[AI] Hot/clickable bitmap for "Pepper" character. [AI]
@ c_NickHot_Bitmap
[AI] Hot/clickable bitmap for "Nick" character. [AI]
@ c_noneInfomain
[AI] Indicates that no specific script/action/resource is assigned or selected. Used as an invalid/no...
@ c_Mama_Ctl
[AI] Script/control logic for "Mama" Brick character. [AI]
@ c_LeftArrow_Ctl
[AI] Script/control for the left arrow UI element, handles navigation within InfoMain....
@ c_Pizza_Ctl
[AI] UI/button logic for "Pizza" menu/scene elements. [AI]
@ c_GoTo_RegBook
[AI] Script/action to transition to green registration book scene. [AI]
@ c_iic001in_RunAnim
[AI] Begin running animation for IIC001IN sequence. [AI]
@ c_Laura_All_Movie
[AI] Full-sequence animation/movie for Laura character. [AI]
@ c_Door_Ctl
[AI] Control script for door UI element, likely used for exiting InfoMain or other scene changes....
@ c_Race_Ctl
[AI] UI/button logic for "Race" menu/scene elements. [AI]
@ c_MamaHot_Bitmap
[AI] Hot/clickable bitmap for "Mama" character. Used for mouseover or click visuals....
@ c_Pepper_Ctl
[AI] Script/control logic for "Pepper" character. [AI]
@ c_Boat_Ctl
[AI] UI/button logic for "Boat" menu/scene elements. [AI]
@ c_InformationCenter_Music
[AI] Background music for the information center.
@ c_BookWig_Flic
[AI] BookWig special FLIC animation trigger. [AI]
[AI] Contains global script AtomId pointers and utility functions for managing script AtomIds in LEGO...
MxAtomId * g_creditsScript
[AI] Script AtomId for the credits roll logic.
Definition: scripts.cpp:88
MxAtomId * g_act3Script
[AI] Script AtomId for Act 3 (endgame/helicopter chase) scripting.
Definition: scripts.cpp:66
MxAtomId * g_introScript
[AI] Script AtomId for the game introduction script.
Definition: scripts.cpp:76
MxAtomId * g_infomainScript
[AI] Script AtomId for the main Info Center world/event script.
Definition: scripts.cpp:42
MxAtomId * g_sndAnimScript
[AI] Script AtomId for sound animation or related cutscenes.
Definition: scripts.cpp:85
MxAtomId * g_act2mainScript
[AI] Script AtomId for main script of Act 2 (island event progression).
Definition: scripts.cpp:63
@ e_opendisk
[AI] Open resource from disk [AI]
Definition: extra.h:27
@ e_close
[AI] Close the resource or action [AI]
Definition: extra.h:29
[AI] Maps a UI region in the Infocenter to a destination presenter for glow effects.
Definition: infocenter.h:163
undefined4 m_unk0x04
[AI] Action/group/area identifier; used for routing (e.g., 3=main, 10=boat, ...).
Definition: infocenter.h:177
InfocenterMapEntry()
[AI] Default constructor, does not initialize members.
Definition: infocenter.cpp:152
MxStillPresenter * m_destCtl
[AI] The bitmap/still presenter to enable/disable when the region is active.
Definition: infocenter.h:172
MxRect< MxS32 > m_area
[AI] The rectangular screen area for this map entry.
Definition: infocenter.h:182
[AI] Playlist structure representing an indexed list of object IDs with next-item selection strategie...
Definition: legostate.h:36
MxU32 Next()
[AI] Retrieves the object ID at the current position, advances next index according to playlist mode.
Definition: legostate.cpp:10