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"
class InfocenterState;
// VTABLE: LEGO1 0x100d9928
// SIZE 0x2d0
class RegistrationBook : public LegoWorld {
@ -41,19 +43,19 @@ private:
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

View File

@ -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