Implement/match Pizza::HandleClick (#1119)

This commit is contained in:
Christian Semmler 2024-10-26 10:34:16 -07:00 committed by GitHub
parent 2b9d8f1fba
commit b3ce98a2ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 56 additions and 6 deletions

View file

@ -7,6 +7,7 @@
#include "legostate.h"
class Act1State;
class PizzeriaState;
class SkateBoard;
// VTABLE: LEGO1 0x100d7408
@ -69,11 +70,12 @@ class PizzaMissionState : public LegoState {
// PizzaMissionState::`scalar deleting destructor'
Mission* GetState(MxU8 p_id);
MxS16 FUN_10039540();
undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c
Mission m_state[5]; // 0x10
undefined4 m_unk0xb0; // 0xb0
PizzeriaState* m_pizzeriaState; // 0x08
undefined4 m_unk0x0c; // 0x0c
Mission m_state[5]; // 0x10
undefined4 m_unk0xb0; // 0xb0
};
// VTABLE: LEGO1 0x100d7380

View file

@ -40,6 +40,7 @@ class PizzeriaState : public LegoState {
// SYNTHETIC: LEGO1 0x10017ce0
// PizzeriaState::`scalar deleting destructor'
MxS16 FUN_10017d50();
MxU32 FUN_10017d70();
// TODO: Most likely getters/setters are not used according to BETA.

View file

@ -2,6 +2,7 @@
#include "isle.h"
#include "isle_actions.h"
#include "jukebox_actions.h"
#include "legoanimationmanager.h"
#include "legogamestate.h"
#include "legoutils.h"
@ -10,6 +11,8 @@
#include "mxbackgroundaudiomanager.h"
#include "mxmisc.h"
#include "mxticklemanager.h"
#include "mxtimer.h"
#include "pizzeria.h"
#include "skateboard.h"
DECOMP_SIZE_ASSERT(Pizza, 0x9c)
@ -121,10 +124,42 @@ void Pizza::StopActions()
}
}
// STUB: LEGO1 0x100383f0
// FUNCTION: LEGO1 0x100383f0
MxLong Pizza::HandleClick()
{
// TODO
if (m_state->m_unk0x0c == 1) {
m_state->m_unk0x0c = 2;
m_mission->m_startTime = Timer()->GetTime();
TickleManager()->RegisterClient(this, 200);
AnimationManager()->FUN_10061010(FALSE);
}
if (m_state->m_unk0x0c == 2) {
m_act1state->m_unk0x018 = 3;
if (m_skateBoard == NULL) {
m_skateBoard = (SkateBoard*) m_world->Find(m_atomId, IsleScript::c_SkateBoard_Actor);
}
IsleScript::Script action;
switch (m_state->FUN_10039540()) {
case 0:
action = m_mission->m_actions[m_mission->m_numActions + 3];
break;
case 1:
action = m_mission->m_actions[m_mission->m_numActions + 4];
break;
default:
action = m_mission->m_actions[m_mission->m_numActions + 5];
}
FUN_10038fe0(action, TRUE);
m_state->m_unk0x0c = 3;
PlayMusic(JukeboxScript::c_PizzaMission_Music);
return 1;
}
return 0;
}
@ -191,3 +226,9 @@ PizzaMissionState::Mission* PizzaMissionState::GetState(MxU8 p_id)
return NULL;
}
// FUNCTION: LEGO1 0x10039540
MxS16 PizzaMissionState::FUN_10039540()
{
return m_pizzeriaState->FUN_10017d50();
}

View file

@ -70,6 +70,12 @@ PizzeriaState::PizzeriaState()
// TODO
}
// STUB: LEGO1 0x10017d50
MxS16 PizzeriaState::FUN_10017d50()
{
return 0;
}
// STUB: LEGO1 0x10017d70
MxU32 PizzeriaState::FUN_10017d70()
{