51 for (MxCompositePresenterList::iterator it =
m_list.begin(); it !=
m_list.end(); it++) {
52 (*it)->Enable((m_unk0x4c != 3 || m_unk0x4e) &&
IsEnabled() ? m_unk0x4e == i :
FALSE);
84 assert(
map &&
map->IsA(
"MxStillPresenter"));
87 if (
map->VTable0x7c()) {
89 rect +=
map->GetLocation();
93 MxU8* start =
map->GetAlphaMask()
99 for (
MxS16 i = 1; i <= *m_states; i++) {
101 if (m_states[i] == (
MxS16) *start) {
122 if (m_unk0x4c == 2) {
126 if (m_unk0x52 == 2 && m_unk0x54 == 2) {
127 if (p_x < presenter->
GetX() + width / 2) {
128 m_unk0x56 = (p_y >= presenter->
GetY() + height / 2) ? 3 : 1;
131 m_unk0x56 = (p_y >= presenter->
GetY() + height / 2) ? 4 : 2;
152 if (m_unk0x4c == 0 || m_unk0x4c == 2 || m_unk0x4c == 3) {
180 if (p_unk0x4e == -1) {
189 m_unk0x4e = p_unk0x4e;
195 for (MxCompositePresenterList::iterator it =
m_list.begin(); it !=
m_list.end(); it++) {
196 (*it)->Enable(((m_unk0x4c == 3 && m_unk0x4e == 0) || !
IsEnabled()) ?
FALSE : m_unk0x4e == i);
219 memcpy(extraCopy, extraData, extraLength);
220 extraCopy[extraLength] =
'\0';
233 m_unk0x52 = atoi(token);
237 m_unk0x54 = atoi(token);
239 else if (!strcmpi(token,
g_strMAP)) {
244 MxS16 numStates = atoi(token);
245 m_states =
new MxS16[numStates + 1];
247 *m_states = numStates;
249 for (
MxS16 i = 1; i <= numStates; i++) {
252 m_states[i] = atoi(token);
262 if (!strcmpi(output,
"FALSE")) {
276 for (MxCompositePresenterList::iterator it =
m_list.begin(); it !=
m_list.end(); it++) {
277 if (i == m_unk0x4e) {
278 (*it)->Enable((m_unk0x4c != 3 || i != 0) ? p_enable : 0);
294 MxCompositePresenterList::const_iterator it =
m_list.begin();
297 advance(it, m_unk0x4e);
300 _Advance(it, m_unk0x4e, forward_iterator_tag());
303 return (*it)->HasTickleStatePassed(p_tickleState);
[AI] Notification parameter for the LegoControlManager, used to propagate information about control e...
void SetClickedObjectId(MxS32 p_clickedObjectId)
[AI] Sets the object ID of the clicked control/presenter.
void SetUnknown0x28(MxS16 p_unk0x28)
[AI] Sets the value of the unknown field at offset 0x28.
void SetClickedAtom(const char *p_clickedAtom)
[AI] Sets the atom string that identifies the clicked control.
MxS32 GetY() const
Returns Y (vertical) coordinate for the event, usually screen-relative in pixels.
MxS32 GetX() const
Returns X (horizontal) coordinate for the event, usually screen-relative in pixels.
const char * GetInternal() const
[AI] Returns a pointer to the internal string, or nullptr if not set.
void EndAction() override
[AI] Ends the composite action, terminating all child presenters and clearing action lists....
MxCompositePresenterList m_list
[AI] List of owned child presenters that are managed by this MxCompositePresenter....
MxResult StartAction(MxStreamController *p_controller, MxDSAction *p_action) override
[AI] Starts a composite action by creating child presenters for each action in a MxDSMultiAction list...
[AI] Presenter for UI controls, supporting toggles, grids, and "map" style controls with multiple int...
MxResult StartAction(MxStreamController *, MxDSAction *) override
[AI] Starts a new UI control action, configuring sub-presenters as required and enabling/disabling th...
void ReadyTickle() override
[AI] Handles transition into the 'ready' tickle state; disables tickling and advances state.
MxBool FUN_10044270(MxS32 p_x, MxS32 p_y, MxPresenter *p_presenter)
[AI] Tests if an input event at position (x, y) targets the supplied presenter's region as defined by...
void Enable(MxBool p_enable) override
[AI] Enables or disables the control; delegates enable to correct sub-presenter based on current stat...
MxResult AddToManager() override
[AI] Registers this presenter with the tickle manager and prepares for input handling.
~MxControlPresenter() override
[AI] Destructor, cleans up internal state memory.
virtual void VTable0x6c(MxS16 p_unk0x4e)
[AI] Selects a state/sub-control by index, or advances the currently selected state if -1 is provided...
MxBool HasTickleStatePassed(TickleState p_tickleState) override
[AI] Checks if a specific tickle state has passed for the currently active sub-presenter,...
void EndAction() override
[AI] Handles ending of a control's action; may fire notifications and update internal flags.
MxBool FUN_10044480(LegoControlManagerNotificationParam *p_param, MxPresenter *p_presenter)
[AI] Processes a notification param and presenter, reacting to input or click events; sets notificati...
void ParseExtra() override
[AI] Parses any configuration/customization provided in the extra data for the action,...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
MxU32 GetFlags()
[AI] Returns the flag field for this action (bitmask).
void GetExtra(MxU16 &p_extraLength, char *&p_extraData)
[AI] Retrieves the extra data and its length for this action.
virtual void SetUnknown90(MxLong p_unk0x90)
[AI] Set unknown value at offset 0x90, used as baseline in GetElapsedTime.
void SetFlags(MxU32 p_flags)
[AI] Sets the flag bitmask controlling action logic (enabled, looping, etc).
@ c_looping
[AI] Action or media should repeat in a loop [AI]
@ c_world
[AI] Action is described in world-space coordinates [AI]
@ c_bit11
[AI] Unknown - possibly reserved [AI]
[AI] Represents a container for multiple MxDSAction objects, facilitating the grouping and management...
const MxAtomId & GetAtomId()
[AI] Returns a const-reference to the object's atom identifier.
MxU32 GetObjectId()
[AI] Returns the object id numeric value.
NotificationId GetNotification() const
[AI] Retrieves the current notification type of this parameter.
void SetNotification(NotificationId p_type)
[AI] Sets the notification type for this parameter object.
[AI] Abstract base class for all presenter types in the LEGO Island engine, responsible for managing ...
virtual void ParseExtra()
[AI] Parses additional data from the associated action for configuration or world interaction.
void ProgressTickleState(TickleState p_tickleState)
[AI] Helper for advancing the presenter's tickle state and updating transition history.
virtual void Enable(MxBool p_enable)
[AI] Enables or disables this presenter (controls action flags accordingly).
MxBool IsEnabled()
[AI] Returns whether this presenter is logically enabled (based on the associated action's flags).
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
MxS32 GetX() const
[AI] Returns the X coordinate of screen location.
MxS32 GetDisplayZ() const
[AI] Returns the display Z (depth) order.
MxS32 GetY() const
[AI] Returns the Y coordinate of screen location.
TickleState
[AI] Represents the state of the presenter's tickle (update) lifecycle.
@ e_repeating
[AI] Presentation is repeating (e.g., looping media).
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
[AI] Rectangle using 32-bit signed integer coordinates.
T GetTop() const
[AI] Get the top edge.
T GetRight() const
[AI] Get the right edge.
T GetLeft() const
[AI] Get the left edge.
T GetBottom() const
[AI] Get the bottom edge.
[AI] Presenter for single still image/bitmap media sources in the game.
[AI] Controller for streaming and managing multimedia resources and actions during gameplay.
virtual void UnregisterClient(MxCore *p_client)
[AI] Unregisters (marks for destruction) a previously registered client.
virtual void RegisterClient(MxCore *p_client, MxTime p_interval)
[AI] Registers an MxCore object to receive periodic tickles.
virtual MxS32 GetHeight()
Returns the height of the current bitmap or alpha mask in pixels.
virtual MxS32 GetWidth()
Returns the width of the current bitmap or alpha mask in pixels.
#define DECOMP_SIZE_ASSERT(T, S)
const char * g_strMAP
[AI] Script or configuration keyword for defining or referencing a map entity.
const char * g_parseExtraTokens
[AI] Delimiter tokens for parsing extra parameters in scripts or command strings.
const char * g_strGRID
[AI] Used for identifying or interacting with grid-based maps or layouts.
const char * g_strSTYLE
[AI] String to specify styles, possibly for GUI, animation, or entity appearance.
const char * g_strTOGGLE
[AI] Used to toggle boolean states for properties or actions in scripting/config files.
const char * g_strVISIBILITY
[AI] Used when specifying visibility toggles or changes for objects/entities in scripting.
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
MxTimer * Timer()
[AI] Returns the global simulation timer.
MxTickleManager * TickleManager()
[AI] Provides access to the global tickle manager.
@ c_notificationControl
[AI] UI control event [AI]
@ c_notificationButtonUp
[AI] Mouse/gamepad button release [AI]
@ c_notificationButtonDown
[AI] Mouse/gamepad button press [AI]
#define map
[AI] Macro alias for Map<K, T, Pr>, replacing std::map<T>.
MxBool KeyValueStringParse(char *, const char *, const char *)
Searches p_string for a key command and copies its associated value to p_output.
void FUN_100b7220(MxDSAction *p_action, MxU32 p_newFlags, MxBool p_setFlags)
Recursively sets or clears flags for an MxDSAction and all sub-actions if applicable.
MxBool ContainsPresenter(MxCompositePresenterList &p_presenterList, MxPresenter *p_presenter)
Determines if a presenter exists within a composite presenter hierarchy.