mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-26 17:51:16 +00:00
Cleanup/fixes
This commit is contained in:
parent
a9d67e4dd7
commit
2d469417a9
@ -605,6 +605,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
|
|||||||
break;
|
break;
|
||||||
case VK_ESCAPE: {
|
case VK_ESCAPE: {
|
||||||
LegoWorld* currentWorld = CurrentWorld();
|
LegoWorld* currentWorld = CurrentWorld();
|
||||||
|
|
||||||
if (currentWorld) {
|
if (currentWorld) {
|
||||||
InfocenterState* infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState");
|
InfocenterState* infocenterState = (InfocenterState*) GameState()->GetState("InfocenterState");
|
||||||
if (infocenterState && infocenterState->GetUnknown0x74() != 8 && currentWorld->VTable0x64()) {
|
if (infocenterState && infocenterState->GetUnknown0x74() != 8 && currentWorld->VTable0x64()) {
|
||||||
|
|||||||
@ -39,6 +39,7 @@ Score::~Score()
|
|||||||
if (InputManager()->GetWorld() == this) {
|
if (InputManager()->GetWorld() == this) {
|
||||||
InputManager()->ClearWorld();
|
InputManager()->ClearWorld();
|
||||||
}
|
}
|
||||||
|
|
||||||
InputManager()->UnRegister(this);
|
InputManager()->UnRegister(this);
|
||||||
ControlManager()->Unregister(this);
|
ControlManager()->Unregister(this);
|
||||||
NotificationManager()->Unregister(this);
|
NotificationManager()->Unregister(this);
|
||||||
@ -54,9 +55,9 @@ MxResult Score::Create(MxDSAction& p_dsAction)
|
|||||||
ControlManager()->Register(this);
|
ControlManager()->Register(this);
|
||||||
InputManager()->Register(this);
|
InputManager()->Register(this);
|
||||||
SetIsWorldActive(FALSE);
|
SetIsWorldActive(FALSE);
|
||||||
LegoGameState* gs = GameState();
|
LegoGameState* gameState = GameState();
|
||||||
ScoreState* state = (ScoreState*) gs->GetState("ScoreState");
|
ScoreState* state = (ScoreState*) gameState->GetState("ScoreState");
|
||||||
m_state = state ? state : (ScoreState*) gs->CreateState("ScoreState");
|
m_state = state ? state : (ScoreState*) gameState->CreateState("ScoreState");
|
||||||
GameState()->SetCurrentArea(LegoGameState::e_infoscor);
|
GameState()->SetCurrentArea(LegoGameState::e_infoscor);
|
||||||
GameState()->StopArea(LegoGameState::e_previousArea);
|
GameState()->StopArea(LegoGameState::e_previousArea);
|
||||||
}
|
}
|
||||||
@ -69,7 +70,7 @@ void Score::DeleteScript()
|
|||||||
{
|
{
|
||||||
if (m_state->GetTutorialFlag()) {
|
if (m_state->GetTutorialFlag()) {
|
||||||
MxDSAction action;
|
MxDSAction action;
|
||||||
action.SetObjectId(0x1f5);
|
action.SetObjectId(InfoscorScript::c_iicc31in_PlayWav);
|
||||||
action.SetAtomId(*g_infoscorScript);
|
action.SetAtomId(*g_infoscorScript);
|
||||||
action.SetUnknown24(-2);
|
action.SetUnknown24(-2);
|
||||||
DeleteObject(action);
|
DeleteObject(action);
|
||||||
@ -82,18 +83,19 @@ MxLong Score::Notify(MxParam& p_param)
|
|||||||
{
|
{
|
||||||
MxLong ret = 0;
|
MxLong ret = 0;
|
||||||
LegoWorld::Notify(p_param);
|
LegoWorld::Notify(p_param);
|
||||||
|
|
||||||
if (m_worldStarted) {
|
if (m_worldStarted) {
|
||||||
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
||||||
case c_notificationStartAction:
|
case c_notificationStartAction:
|
||||||
ret = 1;
|
|
||||||
Paint();
|
Paint();
|
||||||
|
ret = 1;
|
||||||
break;
|
break;
|
||||||
case c_notificationEndAction:
|
case c_notificationEndAction:
|
||||||
ret = FUN_10001510((MxEndActionNotificationParam&) p_param);
|
ret = FUN_10001510((MxEndActionNotificationParam&) p_param);
|
||||||
break;
|
break;
|
||||||
case c_notificationKeyPress:
|
case c_notificationKeyPress:
|
||||||
if (((LegoEventNotificationParam&) p_param).GetKey() == 0x20) {
|
if (((LegoEventNotificationParam&) p_param).GetKey() == VK_SPACE) {
|
||||||
DeleteScript(); // Shutting down
|
DeleteScript();
|
||||||
}
|
}
|
||||||
ret = 1;
|
ret = 1;
|
||||||
break;
|
break;
|
||||||
@ -101,16 +103,15 @@ MxLong Score::Notify(MxParam& p_param)
|
|||||||
ret = FUN_100016d0((LegoControlManagerEvent&) p_param);
|
ret = FUN_100016d0((LegoControlManagerEvent&) p_param);
|
||||||
break;
|
break;
|
||||||
case c_notificationTransitioned:
|
case c_notificationTransitioned:
|
||||||
DeleteObjects(g_infoscorScript, 7, 9);
|
DeleteObjects(g_infoscorScript, InfoscorScript::c_LegoBox1_Flc, InfoscorScript::c_LegoBox3_Flc);
|
||||||
if (m_destLocation) {
|
if (m_destLocation) {
|
||||||
GameState()->SwitchArea(m_destLocation);
|
GameState()->SwitchArea(m_destLocation);
|
||||||
}
|
}
|
||||||
ret = 1;
|
ret = 1;
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,15 +121,15 @@ MxLong Score::FUN_10001510(MxEndActionNotificationParam& p_param)
|
|||||||
MxDSAction* action = p_param.GetAction();
|
MxDSAction* action = p_param.GetAction();
|
||||||
|
|
||||||
if (m_atom == action->GetAtomId()) {
|
if (m_atom == action->GetAtomId()) {
|
||||||
MxU32 id = action->GetObjectId();
|
|
||||||
switch (action->GetObjectId()) {
|
switch (action->GetObjectId()) {
|
||||||
case 10:
|
case InfoscorScript::c_GoTo_HistBook:
|
||||||
m_destLocation = LegoGameState::e_histbook;
|
m_destLocation = LegoGameState::e_histbook;
|
||||||
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 0x32, 0, 0);
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
||||||
break;
|
break;
|
||||||
case 0x1f5:
|
case InfoscorScript::c_iicc31in_PlayWav:
|
||||||
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
PlayMusic(JukeboxScript::c_InformationCenter_Music);
|
||||||
m_state->SetTutorialFlag(FALSE);
|
m_state->SetTutorialFlag(FALSE);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,14 +142,14 @@ void Score::ReadyWorld()
|
|||||||
LegoWorld::ReadyWorld();
|
LegoWorld::ReadyWorld();
|
||||||
|
|
||||||
MxDSAction action;
|
MxDSAction action;
|
||||||
action.SetObjectId(0x1f4);
|
action.SetObjectId(InfoscorScript::c_nin001pr_RunAnim);
|
||||||
action.SetAtomId(m_atom);
|
action.SetAtomId(m_atom);
|
||||||
action.SetUnknown84(this);
|
action.SetUnknown84(this);
|
||||||
Start(&action);
|
Start(&action);
|
||||||
|
|
||||||
if (m_state->GetTutorialFlag()) {
|
if (m_state->GetTutorialFlag()) {
|
||||||
MxDSAction action2;
|
MxDSAction action;
|
||||||
action.SetObjectId(0x1f5);
|
action.SetObjectId(InfoscorScript::c_iicc31in_PlayWav);
|
||||||
action.SetAtomId(*g_infoscorScript);
|
action.SetAtomId(*g_infoscorScript);
|
||||||
Start(&action);
|
Start(&action);
|
||||||
}
|
}
|
||||||
@ -162,51 +163,49 @@ void Score::ReadyWorld()
|
|||||||
// FUNCTION: LEGO1 0x100016d0
|
// FUNCTION: LEGO1 0x100016d0
|
||||||
MxLong Score::FUN_100016d0(LegoControlManagerEvent& p_param)
|
MxLong Score::FUN_100016d0(LegoControlManagerEvent& p_param)
|
||||||
{
|
{
|
||||||
MxS16 l = p_param.GetUnknown0x28();
|
MxS16 unk0x28 = p_param.GetUnknown0x28();
|
||||||
|
|
||||||
if (l == 1 || p_param.GetClickedObjectId() == 4) {
|
if (unk0x28 == 1 || p_param.GetClickedObjectId() == InfoscorScript::c_LegoBox_Ctl) {
|
||||||
switch (p_param.GetClickedObjectId()) {
|
switch (p_param.GetClickedObjectId()) {
|
||||||
case InfoscorScript::c_LeftArrow_Ctl:
|
case InfoscorScript::c_LeftArrow_Ctl:
|
||||||
m_destLocation = LegoGameState::e_infomain;
|
m_destLocation = LegoGameState::e_infomain;
|
||||||
DeleteScript();
|
DeleteScript();
|
||||||
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 0x32, 0, 0);
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
||||||
break;
|
break;
|
||||||
case InfoscorScript::c_RightArrow_Ctl:
|
case InfoscorScript::c_RightArrow_Ctl:
|
||||||
m_destLocation = LegoGameState::e_infodoor;
|
m_destLocation = LegoGameState::e_infodoor;
|
||||||
DeleteScript();
|
DeleteScript();
|
||||||
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 0x32, 0, 0);
|
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
|
||||||
break;
|
break;
|
||||||
case InfoscorScript::c_Book_Ctl: {
|
case InfoscorScript::c_Book_Ctl: {
|
||||||
LegoInputManager* im = InputManager();
|
InputManager()->DisableInputProcessing();
|
||||||
im->SetUnknown88(TRUE);
|
|
||||||
im->SetUnknown336(FALSE);
|
|
||||||
DeleteScript();
|
DeleteScript();
|
||||||
|
|
||||||
MxDSAction action;
|
MxDSAction action;
|
||||||
action.SetObjectId(10);
|
action.SetObjectId(InfoscorScript::c_GoTo_HistBook);
|
||||||
action.SetAtomId(*g_infoscorScript);
|
action.SetAtomId(*g_infoscorScript);
|
||||||
Start(&action);
|
Start(&action);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case InfoscorScript::c_LegoBox_Ctl: {
|
case InfoscorScript::c_LegoBox_Ctl: {
|
||||||
switch (l) {
|
switch (unk0x28) {
|
||||||
case 1: {
|
case 1: {
|
||||||
MxDSAction action;
|
MxDSAction action;
|
||||||
action.SetObjectId(7);
|
action.SetObjectId(InfoscorScript::c_LegoBox1_Flc);
|
||||||
action.SetAtomId(*g_infoscorScript);
|
action.SetAtomId(*g_infoscorScript);
|
||||||
Start(&action);
|
Start(&action);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
MxDSAction action;
|
MxDSAction action;
|
||||||
action.SetObjectId(8);
|
action.SetObjectId(InfoscorScript::c_LegoBox2_Flc);
|
||||||
action.SetAtomId(*g_infoscorScript);
|
action.SetAtomId(*g_infoscorScript);
|
||||||
Start(&action);
|
Start(&action);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: {
|
case 3: {
|
||||||
MxDSAction action;
|
MxDSAction action;
|
||||||
action.SetObjectId(9);
|
action.SetObjectId(InfoscorScript::c_LegoBox3_Flc);
|
||||||
action.SetAtomId(*g_infoscorScript);
|
action.SetAtomId(*g_infoscorScript);
|
||||||
Start(&action);
|
Start(&action);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user