Name state field, getter and setter in Act1State (#1621)

This commit is contained in:
Fabian Neundorf
2025-07-13 21:01:06 +02:00
committed by GitHub
parent 40c1a40d2b
commit 356c64ce0e
17 changed files with 122 additions and 106 deletions

View File

@@ -142,11 +142,11 @@ MxLong Isle::Notify(MxParam& p_param)
break;
case c_notificationButtonUp:
case c_notificationButtonDown:
switch (m_act1state->m_unk0x018) {
case 3:
switch (m_act1state->m_state) {
case Act1State::e_pizza:
result = m_pizza->Notify(p_param);
break;
case 10:
case Act1State::e_ambulance:
result = m_ambulance->Notify(p_param);
break;
}
@@ -155,14 +155,14 @@ MxLong Isle::Notify(MxParam& p_param)
result = HandleControl((LegoControlManagerNotificationParam&) p_param);
break;
case c_notificationEndAnim:
switch (m_act1state->m_unk0x018) {
case 4:
switch (m_act1state->m_state) {
case Act1State::e_helicopter:
result = UserActor()->Notify(p_param);
break;
case 8:
case Act1State::e_towtrack:
result = m_towtrack->Notify(p_param);
break;
case 10:
case Act1State::e_ambulance:
result = m_ambulance->Notify(p_param);
break;
}
@@ -187,18 +187,18 @@ MxLong Isle::HandleEndAction(MxEndActionNotificationParam& p_param)
{
MxLong result;
switch (m_act1state->m_unk0x018) {
case 2:
switch (m_act1state->m_state) {
case Act1State::e_elevator:
HandleElevatorEndAction();
result = 1;
break;
case 3:
case Act1State::e_pizza:
result = m_pizza->Notify(p_param);
break;
case 8:
case Act1State::e_towtrack:
result = m_towtrack->Notify(p_param);
break;
case 10:
case Act1State::e_ambulance:
result = m_ambulance->Notify(p_param);
break;
default:
@@ -241,12 +241,12 @@ void Isle::HandleElevatorEndAction()
case Act1State::c_floor1:
m_destLocation = LegoGameState::e_infomain;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
m_act1state->m_unk0x018 = 0;
m_act1state->m_state = Act1State::e_none;
break;
case Act1State::c_floor2:
if (m_act1state->m_unk0x01e) {
m_act1state->m_unk0x01e = FALSE;
m_act1state->m_unk0x018 = 0;
m_act1state->m_state = Act1State::e_none;
InputManager()->EnableInputProcessing();
}
else {
@@ -258,7 +258,7 @@ void Isle::HandleElevatorEndAction()
case Act1State::c_floor3:
m_destLocation = LegoGameState::e_elevopen;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
m_act1state->m_unk0x018 = 0;
m_act1state->m_state = Act1State::e_none;
break;
}
}
@@ -270,7 +270,7 @@ void Isle::ReadyWorld()
if (m_act1state->GetUnknown21()) {
GameState()->SwitchArea(LegoGameState::e_infomain);
m_act1state->SetUnknown18(0);
m_act1state->SetState(Act1State::e_none);
m_act1state->SetUnknown21(0);
}
else if (GameState()->GetLoadedAct() != LegoGameState::e_act1) {
@@ -289,7 +289,7 @@ MxLong Isle::HandleControl(LegoControlManagerNotificationParam& p_param)
switch (p_param.m_clickedObjectId) {
case IsleScript::c_ElevRide_Info_Ctl:
m_act1state->m_unk0x018 = 2;
m_act1state->m_state = Act1State::e_elevator;
switch (m_act1state->m_elevFloor) {
case Act1State::c_floor1:
@@ -309,7 +309,7 @@ MxLong Isle::HandleControl(LegoControlManagerNotificationParam& p_param)
m_act1state->m_elevFloor = Act1State::c_floor1;
break;
case IsleScript::c_ElevRide_Two_Ctl:
m_act1state->m_unk0x018 = 2;
m_act1state->m_state = Act1State::e_elevator;
switch (m_act1state->m_elevFloor) {
case Act1State::c_floor1:
@@ -329,7 +329,7 @@ MxLong Isle::HandleControl(LegoControlManagerNotificationParam& p_param)
m_act1state->m_elevFloor = Act1State::c_floor2;
break;
case IsleScript::c_ElevRide_Three_Ctl:
m_act1state->m_unk0x018 = 2;
m_act1state->m_state = Act1State::e_elevator;
switch (m_act1state->m_elevFloor) {
case Act1State::c_floor1:
@@ -478,14 +478,14 @@ MxLong Isle::HandlePathStruct(LegoPathStructNotificationParam& p_param)
}
}
switch (m_act1state->m_unk0x018) {
case 3:
switch (m_act1state->m_state) {
case Act1State::e_pizza:
result = m_pizza->Notify(p_param);
break;
case 8:
case Act1State::e_towtrack:
result = m_towtrack->Notify(p_param);
break;
case 10:
case Act1State::e_ambulance:
result = m_ambulance->Notify(p_param);
break;
}
@@ -502,7 +502,7 @@ MxLong Isle::HandlePathStruct(LegoPathStructNotificationParam& p_param)
result = 1;
break;
case 0x131:
if (m_act1state->m_unk0x018 != 10) {
if (m_act1state->m_state != Act1State::e_ambulance) {
AnimationManager()->FUN_10064740(NULL);
}
result = 1;
@@ -558,7 +558,7 @@ void Isle::Enable(MxBool p_enable)
EnableAnimations(TRUE);
if (m_act1state->m_unk0x018 == 0) {
if (m_act1state->m_state == Act1State::e_none) {
MxS32 locations[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
for (MxU32 i = 0; i < 5; i++) {
@@ -595,7 +595,7 @@ void Isle::Enable(MxBool p_enable)
break;
case LegoGameState::e_jetrace2:
if (((JetskiRaceState*) GameState()->GetState("JetskiRaceState"))->m_unk0x28 == 2) {
m_act1state->m_unk0x018 = 5;
m_act1state->m_state = Act1State::e_transitionToJetski;
}
PlaceActor(UserActor());
@@ -704,10 +704,10 @@ void Isle::Enable(MxBool p_enable)
break;
}
switch (m_act1state->m_unk0x018) {
case 0:
case 1:
m_act1state->m_unk0x018 = 0;
switch (m_act1state->m_state) {
case Act1State::e_none:
case Act1State::e_initial:
m_act1state->m_state = Act1State::e_none;
if (GameState()->m_currentArea == LegoGameState::e_pizzeriaExterior) {
AnimationManager()->FUN_10064740(NULL);
@@ -728,7 +728,7 @@ void Isle::Enable(MxBool p_enable)
}
}
break;
case 5: {
case Act1State::e_transitionToJetski: {
((IslePathActor*) UserActor())
->SpawnPlayer(
LegoGameState::e_jetrace2,
@@ -756,12 +756,12 @@ void Isle::Enable(MxBool p_enable)
->FUN_10060dc0(script, NULL, TRUE, LegoAnimationManager::e_unk1, NULL, FALSE, FALSE, TRUE, FALSE);
}
m_act1state->m_unk0x018 = 0;
m_act1state->m_state = Act1State::e_none;
EnableAnimations(FALSE);
AnimationManager()->FUN_10064670(NULL);
break;
}
case 6: {
case Act1State::e_transitionToRacecar: {
GameState()->m_currentArea = LegoGameState::e_carraceExterior;
((IslePathActor*) UserActor())
->SpawnPlayer(
@@ -790,12 +790,12 @@ void Isle::Enable(MxBool p_enable)
->FUN_10060dc0(script, NULL, TRUE, LegoAnimationManager::e_unk1, NULL, FALSE, FALSE, TRUE, FALSE);
}
m_act1state->m_unk0x018 = 0;
m_act1state->m_state = Act1State::e_none;
EnableAnimations(TRUE);
break;
}
case 7:
m_act1state->m_unk0x018 = 8;
case Act1State::e_transitionToTowtrack:
m_act1state->m_state = Act1State::e_towtrack;
AnimationManager()->FUN_1005f6d0(FALSE);
AnimationManager()->EnableCamAnims(FALSE);
@@ -803,8 +803,8 @@ void Isle::Enable(MxBool p_enable)
g_isleFlags &= ~c_playMusic;
m_towtrack->FUN_1004dab0();
break;
case 9:
m_act1state->m_unk0x018 = 10;
case Act1State::e_transitionToAmbulance:
m_act1state->m_state = Act1State::e_ambulance;
AnimationManager()->FUN_1005f6d0(FALSE);
AnimationManager()->EnableCamAnims(FALSE);
@@ -813,7 +813,7 @@ void Isle::Enable(MxBool p_enable)
m_ambulance->Init();
break;
case 11:
m_act1state->m_unk0x018 = 0;
m_act1state->m_state = Act1State::e_none;
((IslePathActor*) UserActor())
->SpawnPlayer(
LegoGameState::e_jukeboxExterior,
@@ -828,17 +828,17 @@ void Isle::Enable(MxBool p_enable)
SetAppCursor(e_cursorArrow);
if (m_act1state->m_unk0x018 != 8 &&
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_elevride) &&
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_polidoor) &&
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_garadoor) &&
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_bike) &&
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_dunecar) &&
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_motocycle) &&
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_copter) &&
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_jetski) &&
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_skateboard) &&
(m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_jetrace2)) {
if (m_act1state->m_state != Act1State::e_towtrack &&
(m_act1state->m_state != Act1State::e_none || GameState()->m_currentArea != LegoGameState::e_elevride) &&
(m_act1state->m_state != Act1State::e_none || GameState()->m_currentArea != LegoGameState::e_polidoor) &&
(m_act1state->m_state != Act1State::e_none || GameState()->m_currentArea != LegoGameState::e_garadoor) &&
(m_act1state->m_state != Act1State::e_none || GameState()->m_currentArea != LegoGameState::e_bike) &&
(m_act1state->m_state != Act1State::e_none || GameState()->m_currentArea != LegoGameState::e_dunecar) &&
(m_act1state->m_state != Act1State::e_none || GameState()->m_currentArea != LegoGameState::e_motocycle) &&
(m_act1state->m_state != Act1State::e_none || GameState()->m_currentArea != LegoGameState::e_copter) &&
(m_act1state->m_state != Act1State::e_none || GameState()->m_currentArea != LegoGameState::e_jetski) &&
(m_act1state->m_state != Act1State::e_none || GameState()->m_currentArea != LegoGameState::e_skateboard) &&
(m_act1state->m_state != Act1State::e_none || GameState()->m_currentArea != LegoGameState::e_jetrace2)) {
Disable(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
}
@@ -897,7 +897,7 @@ MxLong Isle::HandleTransitionEnd()
DeleteObjects(&m_atomId, IsleScript::c_Avo900Ps_PlayWav, IsleScript::c_Avo907Ps_PlayWav);
if (m_destLocation != LegoGameState::e_skateboard) {
m_act1state->m_unk0x018 = 0;
m_act1state->m_state = Act1State::e_none;
}
switch (m_destLocation) {
@@ -1023,7 +1023,7 @@ MxLong Isle::HandleTransitionEnd()
break;
case LegoGameState::e_ambulance:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_unk0x018 = 10;
m_act1state->m_state = Act1State::e_ambulance;
FUN_10032d30(IsleScript::c_AmbulanceFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) {
@@ -1032,7 +1032,7 @@ MxLong Isle::HandleTransitionEnd()
break;
case LegoGameState::e_towtrack:
m_act1state->m_unk0x01f = TRUE;
m_act1state->m_unk0x018 = 8;
m_act1state->m_state = Act1State::e_towtrack;
FUN_10032d30(IsleScript::c_TowFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) {
@@ -1167,7 +1167,7 @@ void Isle::CreateState()
m_act1state = (Act1State*) GameState()->GetState("Act1State");
if (!m_act1state) {
m_act1state = (Act1State*) GameState()->CreateState("Act1State");
m_act1state->m_unk0x018 = 0;
m_act1state->m_state = Act1State::e_none;
}
m_radio.CreateState();
@@ -1193,20 +1193,20 @@ MxBool Isle::Escape()
m_radio.Stop();
BackgroundAudioManager()->Stop();
switch (m_act1state->m_unk0x018) {
case 3:
switch (m_act1state->m_state) {
case Act1State::e_pizza:
if (UserActor() != NULL) {
m_pizza->StopActions();
m_pizza->FUN_100382b0();
}
break;
case 8:
case Act1State::e_towtrack:
if (UserActor() != NULL && !UserActor()->IsA("TowTrack")) {
m_towtrack->StopActions();
m_towtrack->FUN_1004dbe0();
}
break;
case 10:
case Act1State::e_ambulance:
if (UserActor() != NULL && !UserActor()->IsA("Ambulance")) {
m_ambulance->StopActions();
m_ambulance->Reset();
@@ -1239,7 +1239,7 @@ MxBool Isle::Escape()
VariableTable()->SetVariable("VISIBILITY", "Show Gas");
}
m_act1state->m_unk0x018 = 0;
m_act1state->m_state = Act1State::e_none;
m_destLocation = LegoGameState::e_infomain;
return TRUE;
}
@@ -1247,21 +1247,21 @@ MxBool Isle::Escape()
// FUNCTION: LEGO1 0x10033350
void Isle::FUN_10033350()
{
if (m_act1state->m_unk0x018 == 10) {
if (m_act1state->m_state == Act1State::e_ambulance) {
if (UserActor() != NULL && !UserActor()->IsA("Ambulance")) {
m_ambulance->StopActions();
m_ambulance->Reset();
}
}
if (m_act1state->m_unk0x018 == 8) {
if (m_act1state->m_state == Act1State::e_towtrack) {
if (UserActor() != NULL && !UserActor()->IsA("TowTrack")) {
m_towtrack->StopActions();
m_towtrack->FUN_1004dbe0();
}
}
if (m_act1state->m_unk0x018 == 3) {
if (m_act1state->m_state == Act1State::e_pizza) {
if (UserActor() != NULL) {
m_pizza->StopActions();
m_pizza->FUN_100382b0();
@@ -1293,7 +1293,7 @@ void Isle::FUN_10033350()
Act1State::Act1State()
{
m_elevFloor = Act1State::c_floor1;
m_unk0x018 = 1;
m_state = Act1State::e_initial;
m_unk0x01e = FALSE;
m_cptClickDialogue = Playlist((MxU32*) g_cptClickDialogue, sizeOfArray(g_cptClickDialogue), Playlist::e_loop);
m_unk0x01f = FALSE;