47 memset(m_alphabet, 0,
sizeof(m_alphabet));
48 memset(m_name, 0,
sizeof(m_name));
49 m_unk0x280.m_cursorPos = 0;
51 memset(m_checkmark, 0,
sizeof(m_checkmark));
52 memset(&m_unk0x280, -1,
sizeof(m_unk0x280) - 2);
55 m_infocenterState =
NULL;
60 m_checkboxHilite =
NULL;
61 m_checkboxSurface =
NULL;
62 m_checkboxNormal =
NULL;
68 for (
MxS16 i = 0; i < 10; i++) {
69 for (
MxS16 j = 0; j < 7; j++) {
70 if (m_name[i][j] !=
NULL) {
86 if (m_checkboxNormal) {
87 m_checkboxNormal->Release();
157 if (m_unk0x2b8 == 0) {
173MxLong RegistrationBook::HandleKeyPress(
MxU8 p_key)
176 if (p_key >=
'a' && p_key <=
'z') {
183 if ((key < 'A' || key >
'Z') && key != VK_BACK) {
184 if (key == VK_SPACE) {
189 else if (key != VK_BACK && m_unk0x280.m_cursorPos < 7) {
190 m_name[0][m_unk0x280.m_cursorPos] = m_alphabet[key -
'A']->
Clone();
192 if (m_name[0][m_unk0x280.m_cursorPos] !=
NULL) {
193 m_alphabet[key -
'A']->
GetAction()->
SetUnknown24(m_alphabet[key -
'A']->GetAction()->GetUnknown24() + 1);
194 m_name[0][m_unk0x280.m_cursorPos]->
Enable(
TRUE);
196 m_name[0][m_unk0x280.m_cursorPos]->
SetPosition(m_unk0x280.m_cursorPos * 23 + 343, 121);
198 if (m_unk0x280.m_cursorPos == 0) {
202 m_unk0x280.m_letters[m_unk0x280.m_cursorPos] = key -
'A';
203 m_unk0x280.m_cursorPos++;
207 if (key == VK_BACK && m_unk0x280.m_cursorPos > 0) {
208 m_unk0x280.m_cursorPos--;
212 delete m_name[0][m_unk0x280.m_cursorPos];
213 m_name[0][m_unk0x280.m_cursorPos] =
NULL;
215 if (m_unk0x280.m_cursorPos == 0) {
219 m_unk0x280.m_letters[m_unk0x280.m_cursorPos] = -1;
231 if (unk0x28 >= 1 && unk0x28 <= 28) {
250 HandleKeyPress(unk0x28 < 27 ? unk0x28 + 64 : 8);
258 for (i = 0; i < 10; i++) {
273void RegistrationBook::FUN_100775c0(
MxS16 p_playerIndex)
287 WriteInfocenterLetters(1);
302 WriteInfocenterLetters(0);
315 WriteInfocenterLetters(player + 1);
322 if (m_unk0x2b8 == 0 && !m_unk0x2c1) {
329void RegistrationBook::WriteInfocenterLetters(
MxS16 p_user)
331 for (
MxS16 i = 0; i < 7; i++) {
334 m_name[p_user][i] =
NULL;
339void RegistrationBook::FUN_100778c0()
384 if (m_unk0x2b8 != 0) {
407 char letterBuffer[] =
"A_Bitmap";
410 for (i = 0; i < 26; i++) {
415 assert(m_alphabet[i]);
424 char checkmarkBuffer[] =
"Check0_Ctl";
425 for (i = 0; i < 10; i++) {
427 assert(m_checkmark[i]);
432 checkmarkBuffer[5]++;
438 for (
MxS16 j = 0; j < 7; j++) {
447 assert(m_name[i][j]);
452 m_name[i][j]->
SetPosition(23 * j + 343, 27 * i + 121);
459 assert(infocenterState);
469 if (infoman !=
NULL) {
497 if (m_registerDialogueTimer != 0x80000000 && m_registerDialogueTimer + 30000 <= time) {
498 m_registerDialogueTimer = 0x80000000;
505 if (m_checkboxHilite) {
594 if (m_unk0x2b8 == 0 && !m_unk0x2c1) {
603MxBool RegistrationBook::CreateSurface()
609 if (presenters->begin() != presenters->end()) {
613 presenter = uninitialized;
625 if (m_checkboxSurface && m_checkboxHilite) {
[AI] Holds state and transient gameplay data for the first act on Lego Island.
DuneBuggy * m_dunebuggy
[AI] Serializable pointer to current dune buggy object (NULL when not held in state)....
Helicopter * m_helicopter
[AI] Serializable pointer to current helicopter object (NULL when not held in state)....
RaceCar * m_racecar
[AI] Serializable pointer to current racecar object (NULL when not held in state)....
LegoNamedPlane m_helicopterPlane
[AI] Serialized/deserialized world placement state for helicopter.
LegoNamedPlane m_jetskiPlane
[AI] Placement state for jetski in world (serializable). [AI]
LegoNamedPlane m_dunebuggyPlane
[AI] Placement state for dune buggy in world (serializable). [AI]
LegoNamedPlane m_racecarPlane
[AI] Placement state for racecar in world (serializable). [AI]
Jetski * m_jetski
[AI] Serializable pointer to current jetski object (NULL when not held in state). [AI]
[AI] Represents the player-controllable dune buggy vehicle in LEGO Island, inheriting movement and in...
[AI] Represents the flyable helicopter vehicle/path actor in the game, handling all in-game behaviors...
[AI] Represents the state of the Infocenter area, storing scripts, dialogue playlists and UI letter p...
void SetNameLetter(MxS32 p_index, MxStillPresenter *p_letter)
[AI] Sets the UI presenter for a specific name letter slot.
MxBool HasRegistered()
[AI] True if any letter slot is filled (indicating the player has registered).
MxStillPresenter * GetNameLetter(MxS32 p_index)
[AI] Returns the pointer to the UI presenter for a specific letter in the name field.
MxU32 m_unk0x74
[AI] State machine variable tracking the Infocenter flow (e.g., 0=intro, 3=NA, 4=goto book,...
[AI] Represents the jetski vehicle placed in the 3D world of LEGO Island.
[AI] Notification parameter for the LegoControlManager, used to propagate information about control e...
MxS32 m_clickedObjectId
[AI] Object ID of the clicked control/presenter (or -1 if not set). [AI]
MxS16 m_unk0x28
[AI] Undetermined; settable via SetUnknown0x28. [AI]
void Register(MxCore *p_listener)
[AI] Adds a listener to be notified of control events.
void Unregister(MxCore *p_listener)
[AI] Removes a listener so it no longer receives control events.
Notification parameter class for LEGO event notifications such as mouse events and modifier keys.
Comprehensive persistent game state manager: handles save/load, player selection, area switching,...
MxS16 m_playerCount
Number of player usernames registered. [AI].
void SwitchPlayer(MxS16 p_playerId)
Make the specified player (by ID/index) the current player.
void SwitchArea(Area p_area)
Switches the whole game state into a new area/world; manages transitions/scene loads.
History m_history
High score table/history for current game. [AI].
void Init()
Re-initializes all world/variable state to the current act's defaults. [AI].
Area m_currentArea
Area/world the player is presently in. [AI].
@ e_act1
Act 1: the first main segment of the game. [AI].
void StopArea(Area p_area)
Calls cleanup logic for the specified area (removes actors, VMs, closes handles, etc....
void SerializePlayersInfo(MxS16 p_flags)
Serializes all player info (usernames, player count) to the appropriate storage.
Username m_players[9]
Array of all known player usernames (max 9, ranked). [AI].
MxResult Save(MxULong p_slot)
Saves persistent game state (world variables, actor, etc.) to a file slot.
LegoState * GetState(const char *p_stateName)
Find an existing state (LegoState-derived) object by its registered script/class name.
MxS16 FindPlayer(Username &p_player)
Finds the player index for a username; returns -1 if not found.
@ e_infomain
Information Center, main screen. [AI].
@ e_previousArea
Alias: go to previous area. [AI].
@ e_regbook
Registration book "new game" area. [AI].
MxResult AddPlayer(Username &p_player)
Adds a new player (username), moves others down, manages slot files.
[AI] An actor that moves along a predefined path, supporting boundary transitions,...
[AI] Specialized notification parameter used for path structure related events in LEGO Island.
MxS16 GetData()
[AI] Retrieves the supplemental data associated with the notification.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
void Remove(MxCore *p_object)
Removes an object from all relevant world-managed lists or sets, and also detaches if needed.
virtual void Enable(MxBool p_enable)
Enables or disables (pauses) the world and its main components.
MxResult Tickle() override
Main world tick/update, especially manages startup countdown.
MxBool m_worldStarted
Indicates if the world has successfully started and is considered active.
MxCore * Find(const char *p_class, const char *p_name)
Finds an object of a given class and name in the world.
MxLong Notify(MxParam &p_param) override
Notification callback responding to registered events such as EndAction and NewPresenter.
void RemoveActor(LegoPathActor *p_actor)
Removes an actor from all known path controllers.
MxResult Create(MxDSAction &p_dsAction) override
Initializes the world using an action, creating entity and sound lists, and camera controller.
MxDSAction * GetAction()
[AI] Direct access to the underlying action.
void RaiseVolume()
[AI] Requests that the background music volume is raised (decrements suppression counter); triggers f...
void LowerVolume()
[AI] Requests a reduction in current background music volume, queuing for fade out (increments suppre...
[AI] STL list of MxPresenter pointers, used to manage multiple child presenters under composite contr...
MxCompositePresenterList * GetList()
[AI] Returns reference to the internal list of child presenters managed by this composite.
[AI] Presenter for UI controls, supporting toggles, grids, and "map" style controls with multiple int...
void Enable(MxBool p_enable) override
[AI] Enables or disables the control; delegates enable to correct sub-presenter based on current stat...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
void SetUnknown24(MxS16 p_unk0x24)
[AI] Sets the unknown field at 0x24 (possibly version/state).
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
static LPDIRECTDRAWSURFACE CopySurface(LPDIRECTDRAWSURFACE p_src)
[AI] Creates a deep copy of the provided surface (new DirectDraw surface with same content).
[AI] Notification parameter marking the end of an action, specialization of MxActionNotificationParam...
MxAtomId m_atomId
The AtomId associated with this entity, used for resource and script identification.
void SetEntityId(MxS32 p_entityId)
Sets the entity ID to the given value.
void SetAtomId(const MxAtomId &p_atomId)
Sets the AtomId to the given value.
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.
MxResult Send(MxCore *p_listener, const MxNotificationParam &p_param)
[AI] Queues a notification to be sent to a specific registered listener.
[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...
virtual void SetTickleState(TickleState p_tickleState)
[AI] Forces the tickle state, advancing to the requested lifecycle stage.
@ e_repeating
[AI] Presentation is repeating (e.g., looping media).
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
[AI] Presenter for single still image/bitmap media sources in the game.
virtual MxStillPresenter * Clone()
[AI] Clones the presenter, attempting to fully duplicate internal state and associated memory resourc...
virtual void SetPosition(MxS32 p_x, MxS32 p_y)
[AI] Sets the pixel-based position of the presented image.
void Enable(MxBool p_enable) override
[AI] Sets the enabled/disabled state of the presenter, updating the video manager's rendering as need...
MxLong GetTime()
Returns the current timer value in ms, depending on running state.
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.
virtual LPDIRECTDRAWSURFACE VTable0x78()
Retrieves the DirectDraw surface used for hardware-accelerated rendering.
void SetVisibility(unsigned char p_visible)
[AI] Sets the visibility flag to the provided value.
[AI] Represents the drivable race car entity in the LEGO Island world.
Derived world for handling the user registration book/infocenter name entry interface.
MxResult Create(MxDSAction &p_dsAction) override
Handles creation/initialization logic when launched, registering to input/control and setting up stat...
void Enable(MxBool p_enable) override
Enables/disables world; updates input and UI state accordingly.
MxS16 m_letters[7]
[AI] Letter indices ('A'=0...'Z'=25 or -1 for empty) for currently-entered name.
static void PlayAction(MxU32 p_objectId)
Helper to play script action within the regbook.
~RegistrationBook() override
Destructor, cleans up UI elements, surfaces, and unregisters input/control/notification....
MxLong Notify(MxParam &p_param) override
Called for notification events including actions, keypresses, controls and transitions.
MxResult Tickle() override
Per-frame tick/update handler, manages dialogue timer and checkbox blink logic. [AI].
void ReadyWorld() override
Called to fully initialize the infocenter registration UI and player names. [AI].
MxBool Escape() override
Handles player pressing Escape, cancels animation and returns to main infocenter. [AI].
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
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.
void SetAppCursor(Cursor p_cursor)
[AI] Sets the in-game cursor to a specified type.
@ e_cursorBusy
[AI] Busy or loading cursor (e.g., hourglass). [AI]
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
void DeleteObjects(MxAtomId *p_id, MxS32 p_first, MxS32 p_last)
[AI] Batch deletes objects, given by atom id, and within the entity id range [p_first,...
MxTransitionManager * TransitionManager()
[AI] Accessor for the MxTransitionManager, handling level transitions, fades, and world changes....
MxBackgroundAudioManager * BackgroundAudioManager()
[AI] Accessor for the background audio manager. Used for background music and ambient sounds....
LegoControlManager * ControlManager()
[AI] Accessor for the control manager through the input manager; manages higher-level user/game contr...
void PlayMusic(JukeboxScript::Script p_objectId)
[AI] Starts music playback by scripting the background audio manager to play the music piece referenc...
void SetIsWorldActive(MxBool p_isWorldActive)
[AI] Toggles whether the world should be considered active (enables/disables camera/user control etc)...
LegoInputManager * InputManager()
[AI] Accessor for the input manager, which handles keyboard, mouse, and controller input....
LegoROI * FindROI(const char *p_name)
[AI] Looks up a LegoROI (Real-time Object Instance) by name in the current world or global registry.
MxTimer * Timer()
[AI] Returns the global simulation timer.
MxResult Start(MxDSAction *p_dsAction)
[AI] Schedules and initiates execution of a script action.
MxNotificationManager * NotificationManager()
[AI] Returns the notification manager for system-wide state/update notifications.
@ c_notificationControl
[AI] UI control event [AI]
@ c_notificationButtonDown
[AI] Mouse/gamepad button press [AI]
@ c_notificationKeyPress
[AI] Keyboard key press detected [AI]
@ c_notificationTransitioned
[AI] Object has transitioned states or locations [AI]
@ c_notificationEndAction
[AI] Indicates the end of an action [AI]
@ c_notificationPathStruct
[AI] Data related to a path structure [AI]
@ c_Helicopter_Actor
[AI] Main helicopter actor logic entry/action.
@ c_DuneBugy_Actor
[AI] ID for the main Dune Buggy actor instance.
@ c_Jetski_Actor
[AI] Main jetski actor entity script. [AI]
@ c_InformationCenter_Music
[AI] Background music for the information center.
@ c_RaceCar_Actor
[AI] Script action corresponding to the main interactive racecar actor.
@ c_iic006in_RunAnim
[AI] "Run" animation for iic006in. [AI]
@ c_iic007in_PlayWav
[AI] WAV audio playback action or trigger for iic007in resource. [AI]
@ c_Alphabet_Ctl
[AI] UI control for the full alphabet selection in Regbook, likely for character entry....
@ c_Textures
[AI] General reference to textures used in Regbook, likely a container or lookup resource....
@ c_iic008in_PlayWav
[AI] WAV audio playback action or trigger for iic008in resource. [AI]
MxLong g_checkboxBlinkTimer
[AI] Contains global script AtomId pointers and utility functions for managing script AtomIds in LEGO...
MxAtomId * g_regbookScript
[AI] Script AtomId for the registration book script (name entry).
MxAtomId * g_racecarScript
[AI] Script AtomId for the build/race car SI file.
MxAtomId * g_copterScript
[AI] Script AtomId for the helicopter ("copter") build or activity.
MxAtomId * g_jetskiScript
[AI] Script AtomId for the jet ski-related script.
MxAtomId * g_dunecarScript
[AI] Script AtomId for the dune car building or mission script.
void WriteScoreHistory()
Rebuilds the high score table from current state objects, sorts it descending. [AI].
Player "username", stored as 7 short integers (character codes).
MxS16 m_letters[7]
Array of 7 wide characters: player name (filled by registration). [AI].
MxBool IsPresent()
[AI] Determines whether the plane instance is valid (present) based on its name.