Isle
Loading...
Searching...
No Matches
jukeboxentity.cpp
Go to the documentation of this file.
1#include "jukeboxentity.h"
2
3#include "isle.h"
4#include "isle_actions.h"
5#include "islepathactor.h"
6#include "jukebox.h"
7#include "jukebox_actions.h"
8#include "legogamestate.h"
9#include "legoutils.h"
10#include "misc.h"
12#include "mxmisc.h"
14#include "mxnotificationparam.h"
15#include "mxtransitionmanager.h"
16#include "scripts.h"
17
19
20// FUNCTION: LEGO1 0x10085bc0
22{
24}
25
26// FUNCTION: LEGO1 0x10085dd0
28{
30}
31
32// FUNCTION: LEGO1 0x10085e40
33// FUNCTION: BETA10 0x10038c37
35{
36 MxNotificationParam& param = (MxNotificationParam&) p_param;
37
38 if (param.GetNotification() == c_notificationClick) {
39 if (!FUN_1003ef60()) {
40 return 1;
41 }
42
43 if (UserActor()->GetActorId() != GameState()->GetActorId()) {
44 ((IslePathActor*) UserActor())->Exit();
45 }
46
49 return 1;
50 }
51
52 return 0;
53}
54
55// FUNCTION: LEGO1 0x10085ed0
57{
58 MxDSAction action;
60 JukeBoxState* state = (JukeBoxState*) GameState()->GetState("JukeBoxState");
61 state->m_active = TRUE;
62
63 switch (state->m_music) {
67 break;
71 break;
75 break;
79 break;
83 break;
87 break;
88 }
89
91 action.SetObjectId(GameState()->m_jukeboxMusic);
92
94 if (!m_audioEnabled) {
96 }
97
99}
100
101// FUNCTION: LEGO1 0x100860f0
103{
104 JukeBoxState* state = (JukeBoxState*) GameState()->GetState("JukeBoxState");
105
106 if (state && state->m_active) {
107 switch (p_script) {
109 state->m_active = FALSE;
111 break;
113 state->m_active = FALSE;
115 break;
117 state->m_active = FALSE;
119 break;
121 state->m_active = FALSE;
123 break;
125 state->m_active = FALSE;
127 break;
129 state->m_active = FALSE;
131 break;
132 }
133
135 }
136}
Derived path actor type for handling player transitions and activities on LEGO Island.
Definition: islepathactor.h:23
[AI] Represents the main overworld (LEGO Island) in the game, acting as the central hub and state mac...
Definition: isle.h:179
[AI] Represents the jukebox interactive entity in LEGO Island, handling click events,...
Definition: jukeboxentity.h:15
~JukeBoxEntity() override
[AI] Destructor unregisters from the notification manager.
MxLong Notify(MxParam &p_param) override
[AI] Handles notification events relevant to the jukebox, e.g., click events to activate jukebox beha...
MxBool IsBackgroundAudioEnabled()
[AI] Returns whether background audio was enabled before the current jukebox action.
Definition: jukeboxentity.h:71
void StartAction()
[AI] Starts the jukebox action: plays the selected music track, sets proper animation,...
void StopAction(JukeboxScript::Script p_script)
[AI] Stops the given jukebox music and resets related animation/states.
MxBool m_audioEnabled
[AI] Whether background audio was enabled before this entity started its action.
Definition: jukeboxentity.h:80
[AI] Represents the music selection state for the Jukebox in the game.
Definition: jukebox.h:14
Music m_music
[AI] Currently selected music track in the Jukebox. [AI]
Definition: jukebox.h:46
@ e_torpedos
[AI] "Torpedos" music track. [AI]
Definition: jukebox.h:23
@ e_nelson
[AI] "Nelson" music track. [AI]
Definition: jukebox.h:22
@ e_decal
[AI] "Decal" music track. [AI]
Definition: jukebox.h:20
@ e_right
[AI] "Right" music track. [AI]
Definition: jukebox.h:19
@ e_pasquell
[AI] "Pasquell" music track (default selection). [AI]
Definition: jukebox.h:18
@ e_wallis
[AI] "Wallis" music track. [AI]
Definition: jukebox.h:21
MxU32 m_active
[AI] Flag indicating whether the Jukebox is currently active (1=active, 0=inactive)....
Definition: jukebox.h:47
virtual MxU8 GetActorId()
[AI] Gets this actor's numeric ID, corresponding to a known enumeration/actor.
Definition: legoactor.h:77
JukeboxScript::Script m_jukeboxMusic
Which jukebox music is currently set to play. [AI].
MxU8 GetActorId()
Returns the current selected actor ID. [AI].
LegoState * GetState(const char *p_stateName)
Find an existing state (LegoState-derived) object by its registered script/class name.
@ e_jukeboxw
Western Jukebox (special minigame). [AI].
void Enable(MxBool p_enable)
[AI] Enables or disables the background audio manager.
MxBool GetEnabled()
[AI] Returns whether background audio management is currently enabled.
MxResult PlayMusic(MxDSAction &p_action, undefined4 p_speed, MxPresenter::TickleState p_tickleState)
[AI] Initiates playback of a new background music action with specified speed and target tickle state...
void Stop()
[AI] Immediately stops all background music, clears all actions and presenters, and resets tickle sta...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
Definition: mxdsobject.h:118
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
Definition: mxdsobject.h:147
void Unregister(MxCore *p_listener)
[AI] Removes a previously registered listener and flushes any pending notifications for it.
void Register(MxCore *p_listener)
[AI] Registers a listener object to receive notifications.
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
NotificationId GetNotification() const
[AI] Retrieves the current notification type of this parameter.
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
Definition: mxparam.h:7
@ e_repeating
[AI] Presentation is repeating (e.g., looping media).
Definition: mxpresenter.h:28
MxResult StartTransition(TransitionType p_animationType, MxS32 p_speed, MxBool p_doCopy, MxBool p_playMusicInAnim)
[AI] Begins a new transition animation of type p_animationType at the specified speed,...
@ e_mosaic
[AI] Complex mosaic block-out effect.
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
void InvokeAction(Extra::ActionType p_actionId, const MxAtomId &p_pAtom, MxS32 p_streamId, LegoEntity *p_sender)
[AI] Dispatches and triggers a game action on the given script or object.
Definition: legoutils.cpp:271
MxBool FUN_1003ef60()
[AI] Determines if the current actor can exit their area, based on state/zone/vehicle.
Definition: legoutils.cpp:572
MxAtomId * g_isleScript
[AI] Node used in hierarchical scene graphs and animation trees. [AI]
Definition: scripts.cpp:32
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
Definition: misc.cpp:61
MxTransitionManager * TransitionManager()
[AI] Accessor for the MxTransitionManager, handling level transitions, fades, and world changes....
Definition: misc.cpp:208
MxBackgroundAudioManager * BackgroundAudioManager()
[AI] Accessor for the background audio manager. Used for background music and ambient sounds....
Definition: misc.cpp:37
LegoWorld * FindWorld(const MxAtomId &p_atom, MxS32 p_entityid)
[AI] Searches for or retrieves a LegoWorld instance based on an atom id and entity id.
Definition: misc.cpp:188
LegoPathActor * UserActor()
[AI] Accessor for the user (player-controllable) LegoPathActor. [AI]
Definition: misc.cpp:85
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
Definition: mxmisc.cpp:17
@ c_notificationClick
[AI] Mouse click event [AI]
int MxLong
[AI]
Definition: mxtypes.h:83
@ c_npz007bd_RunAnim
Definition: isle_actions.h:818
@ c_npz006bd_RunAnim
Definition: isle_actions.h:817
@ c_npz003bd_RunAnim
Definition: isle_actions.h:814
@ c_npz004bd_RunAnim
Definition: isle_actions.h:815
@ c_npz002bd_RunAnim
Definition: isle_actions.h:813
@ c_npz001bd_RunAnim
Definition: isle_actions.h:812
@ c_JBMusic3
[AI] Jukebox miscellaneous music 3.
@ c_JBMusic4
[AI] Jukebox miscellaneous music 4.
@ c_JBMusic1
[AI] Jukebox miscellaneous music 1.
@ c_JBMusic6
[AI] Jukebox miscellaneous music 6.
@ c_JBMusic5
[AI] Jukebox miscellaneous music 5.
@ c_JBMusic2
[AI] Jukebox miscellaneous music 2.
[AI] Contains global script AtomId pointers and utility functions for managing script AtomIds in LEGO...
MxAtomId * g_jukeboxScript
[AI] Script AtomId for the Jukebox entity/event script.
Definition: scripts.cpp:70
@ e_stop
[AI] Stop an activity or playback [AI]
Definition: extra.h:31
@ e_start
[AI] Start an activity or playback [AI]
Definition: extra.h:30