diff --git a/LEGO1/lego/legoomni/include/registrationbook.h b/LEGO1/lego/legoomni/include/registrationbook.h index aeede1d0..cc4f8fd4 100644 --- a/LEGO1/lego/legoomni/include/registrationbook.h +++ b/LEGO1/lego/legoomni/include/registrationbook.h @@ -3,6 +3,8 @@ #include "legoworld.h" +class InfocenterState; + // VTABLE: LEGO1 0x100d9928 // SIZE 0x2d0 class RegistrationBook : public LegoWorld { @@ -41,19 +43,19 @@ class RegistrationBook : public LegoWorld { undefined m_unk0x100[0x68]; // 0x100 undefined m_unk0x168[0x118]; // 0x168 struct { - undefined4 m_unk0x00[3]; // 0x00 - undefined2 m_unk0x0c; // 0x0c - undefined2 m_unk0x0e; // 0x0e - } m_unk0x280; // 0x280 - undefined m_unk0x290[0x28]; // 0x290 - undefined2 m_unk0x2b8; // 0x2b8 - undefined4 m_unk0x2bc; // 0x2bc - undefined m_unk0x2c0; // 0x2c0 - undefined m_unk0x2c1; // 0x2c1 - undefined m_unk0x2c2[0x02]; // 0x2c2 - undefined4 m_unk0x2c4; // 0x2c4 - undefined4 m_unk0x2c8; // 0x2c8 - undefined4 m_unk0x2cc; // 0x2cc + undefined4 m_unk0x00[3]; // 0x00 + undefined2 m_unk0x0c; // 0x0c + undefined2 m_unk0x0e; // 0x0e + } m_unk0x280; // 0x280 + undefined m_unk0x290[0x28]; // 0x290 + undefined2 m_unk0x2b8; // 0x2b8 + InfocenterState* m_infocenterState; // 0x2bc + undefined m_unk0x2c0; // 0x2c0 + undefined m_unk0x2c1; // 0x2c1 + undefined m_unk0x2c2[0x02]; // 0x2c2 + undefined4 m_unk0x2c4; // 0x2c4 + undefined4 m_unk0x2c8; // 0x2c8 + undefined4 m_unk0x2cc; // 0x2cc }; #endif // REGISTRATIONBOOK_H diff --git a/LEGO1/lego/legoomni/src/infocenter/registrationbook.cpp b/LEGO1/lego/legoomni/src/infocenter/registrationbook.cpp index f4b17194..cea5e520 100644 --- a/LEGO1/lego/legoomni/src/infocenter/registrationbook.cpp +++ b/LEGO1/lego/legoomni/src/infocenter/registrationbook.cpp @@ -1,5 +1,9 @@ #include "registrationbook.h" +#include "infocenterstate.h" +#include "legocontrolmanager.h" +#include "legogamestate.h" +#include "legoinputmanager.h" #include "legoomni.h" #include "mxnotificationmanager.h" @@ -18,7 +22,7 @@ RegistrationBook::RegistrationBook() : m_unk0xf8(0x80000000), m_unk0xfc(1) memset(&m_unk0x280, -1, sizeof(m_unk0x280) - 2); m_unk0x2b8 = 0; - m_unk0x2bc = 0; + m_infocenterState = NULL; NotificationManager()->Register(this); @@ -34,10 +38,22 @@ RegistrationBook::~RegistrationBook() // TODO } -// STUB: LEGO1 0x10077060 +// FUNCTION: LEGO1 0x10077060 MxResult RegistrationBook::Create(MxDSAction& p_dsAction) { - return SUCCESS; + MxResult result = LegoWorld::Create(p_dsAction); + if (result == SUCCESS) { + InputManager()->SetWorld(this); + ControlManager()->Register(this); + SetIsWorldActive(FALSE); + InputManager()->Register(this); + + GameState()->SetCurrentArea(12); + GameState()->StopArea(0); + + m_infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState"); + } + return result; } // STUB: LEGO1 0x100770e0 @@ -61,10 +77,20 @@ MxResult RegistrationBook::Tickle() return SUCCESS; } -// STUB: LEGO1 0x10078180 +// FUNCTION: LEGO1 0x10078180 void RegistrationBook::Enable(MxBool p_enable) { - // TODO + LegoWorld::Enable(p_enable); + + if (p_enable) { + InputManager()->SetWorld(this); + SetIsWorldActive(FALSE); + } + else { + if (InputManager()->GetWorld() == this) { + InputManager()->ClearWorld(); + } + } } // FUNCTION: LEGO1 0x100783e0