implement Enable and Create in RegistrationBook (#535)

This commit is contained in:
Misha 2024-02-06 19:06:32 -05:00 committed by GitHub
parent 00e32673d1
commit 917485247b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 46 additions and 18 deletions

View file

@ -3,6 +3,8 @@
#include "legoworld.h" #include "legoworld.h"
class InfocenterState;
// VTABLE: LEGO1 0x100d9928 // VTABLE: LEGO1 0x100d9928
// SIZE 0x2d0 // SIZE 0x2d0
class RegistrationBook : public LegoWorld { class RegistrationBook : public LegoWorld {
@ -41,19 +43,19 @@ class RegistrationBook : public LegoWorld {
undefined m_unk0x100[0x68]; // 0x100 undefined m_unk0x100[0x68]; // 0x100
undefined m_unk0x168[0x118]; // 0x168 undefined m_unk0x168[0x118]; // 0x168
struct { struct {
undefined4 m_unk0x00[3]; // 0x00 undefined4 m_unk0x00[3]; // 0x00
undefined2 m_unk0x0c; // 0x0c undefined2 m_unk0x0c; // 0x0c
undefined2 m_unk0x0e; // 0x0e undefined2 m_unk0x0e; // 0x0e
} m_unk0x280; // 0x280 } m_unk0x280; // 0x280
undefined m_unk0x290[0x28]; // 0x290 undefined m_unk0x290[0x28]; // 0x290
undefined2 m_unk0x2b8; // 0x2b8 undefined2 m_unk0x2b8; // 0x2b8
undefined4 m_unk0x2bc; // 0x2bc InfocenterState* m_infocenterState; // 0x2bc
undefined m_unk0x2c0; // 0x2c0 undefined m_unk0x2c0; // 0x2c0
undefined m_unk0x2c1; // 0x2c1 undefined m_unk0x2c1; // 0x2c1
undefined m_unk0x2c2[0x02]; // 0x2c2 undefined m_unk0x2c2[0x02]; // 0x2c2
undefined4 m_unk0x2c4; // 0x2c4 undefined4 m_unk0x2c4; // 0x2c4
undefined4 m_unk0x2c8; // 0x2c8 undefined4 m_unk0x2c8; // 0x2c8
undefined4 m_unk0x2cc; // 0x2cc undefined4 m_unk0x2cc; // 0x2cc
}; };
#endif // REGISTRATIONBOOK_H #endif // REGISTRATIONBOOK_H

View file

@ -1,5 +1,9 @@
#include "registrationbook.h" #include "registrationbook.h"
#include "infocenterstate.h"
#include "legocontrolmanager.h"
#include "legogamestate.h"
#include "legoinputmanager.h"
#include "legoomni.h" #include "legoomni.h"
#include "mxnotificationmanager.h" #include "mxnotificationmanager.h"
@ -18,7 +22,7 @@ RegistrationBook::RegistrationBook() : m_unk0xf8(0x80000000), m_unk0xfc(1)
memset(&m_unk0x280, -1, sizeof(m_unk0x280) - 2); memset(&m_unk0x280, -1, sizeof(m_unk0x280) - 2);
m_unk0x2b8 = 0; m_unk0x2b8 = 0;
m_unk0x2bc = 0; m_infocenterState = NULL;
NotificationManager()->Register(this); NotificationManager()->Register(this);
@ -34,10 +38,22 @@ RegistrationBook::~RegistrationBook()
// TODO // TODO
} }
// STUB: LEGO1 0x10077060 // FUNCTION: LEGO1 0x10077060
MxResult RegistrationBook::Create(MxDSAction& p_dsAction) 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 // STUB: LEGO1 0x100770e0
@ -61,10 +77,20 @@ MxResult RegistrationBook::Tickle()
return SUCCESS; return SUCCESS;
} }
// STUB: LEGO1 0x10078180 // FUNCTION: LEGO1 0x10078180
void RegistrationBook::Enable(MxBool p_enable) 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 // FUNCTION: LEGO1 0x100783e0