From 8b5b77c8f83836b4307e8198621f0e6c619ec191 Mon Sep 17 00:00:00 2001 From: Joshua Peisach Date: Sat, 24 Feb 2024 17:20:06 -0500 Subject: [PATCH] JukeBox::notify --- LEGO1/lego/legoomni/include/jukebox.h | 3 +++ LEGO1/lego/legoomni/src/isle/jukebox.cpp | 26 +++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/LEGO1/lego/legoomni/include/jukebox.h b/LEGO1/lego/legoomni/include/jukebox.h index 505ef646..326d28fb 100644 --- a/LEGO1/lego/legoomni/include/jukebox.h +++ b/LEGO1/lego/legoomni/include/jukebox.h @@ -3,6 +3,7 @@ #include "decomp.h" #include "jukeboxstate.h" +#include "legocontrolmanager.h" #include "legogamestate.h" #include "legoworld.h" @@ -111,6 +112,8 @@ class JukeBox : public LegoWorld { }; private: + MxBool HandleClick(LegoControlManagerEvent&); + LegoGameState::Area m_transitionDestination; // 0xf8 JukeBoxState* m_jukeBoxState; // 0xfc undefined2 m_unk0x100; // 0x100 diff --git a/LEGO1/lego/legoomni/src/isle/jukebox.cpp b/LEGO1/lego/legoomni/src/isle/jukebox.cpp index fa12f01c..1f0aac15 100644 --- a/LEGO1/lego/legoomni/src/isle/jukebox.cpp +++ b/LEGO1/lego/legoomni/src/isle/jukebox.cpp @@ -52,11 +52,24 @@ MxResult JukeBox::Create(MxDSAction& p_dsAction) return ret; } -// STUB: LEGO1 0x1005d980 +// FUNCTION: LEGO1 0x1005d980 MxLong JukeBox::Notify(MxParam& p_param) { - // TODO - return 0; + MxLong result = 0; + LegoWorld::Notify(p_param); + + if (m_worldStarted) { + switch (((MxNotificationParam&) p_param).GetNotification()) { + case c_notificationClick: + result = HandleClick((LegoControlManagerEvent&) p_param); + break; + case c_notificationTransitioned: + GameState()->SwitchArea(m_transitionDestination); + break; + } + } + + return result; } // FUNCTION: LEGO1 0x1005d9f0 @@ -92,6 +105,13 @@ void JukeBox::ReadyWorld() m_unk0x100 = 1; } +// FUNCTION: LEGO1 0x1005da70 +MxBool JukeBox::HandleClick(LegoControlManagerEvent& p_param) +{ + // TODO + return true; +} + // FUNCTION: LEGO1 0x1005dde0 void JukeBox::Enable(MxBool p_enable) {