EZ Text Replacer for Zelda64Recompiled 2.2.0
 
Loading...
Searching...
No Matches
Basic_CustomMessages

Functions for creating and replacing new messages. More...

Functions

void EZTR_Basic_AddCustomBuffer (EZTR_CustomMsgHandle handle, EZTR_MsgBuffer *buf, EZTR_MsgCallback callback)
 Declare a brand new (i.e: custom) message by copying from a buffer defined by the user.
 
void EZTR_Basic_AddCustomText (EZTR_CustomMsgHandle handle, u8 text_box_type, u8 text_box_y_pos, u8 display_icon, u16 next_message_id, u16 first_item_rupees, u16 second_item_rupees, bool pipe_escape_bytes, char *content, EZTR_MsgCallback callback,...)
 Declare a brand new (i.e: custom) message by defining the header attributes and message content.
 
void EZTR_Basic_AddCustomTextEmpty (EZTR_CustomMsgHandle handle, EZTR_MsgCallback callback)
 Declare a brand new (i.e: custom) message, where the replacement message is empty.
 
void EZTR_Basic_ReplaceCustomBuffer (EZTR_CustomMsgHandle handle, EZTR_MsgBuffer *buf, EZTR_MsgCallback callback)
 Declare a replacement for a custom message by copying from a buffer defined by the user.
 
void EZTR_Basic_ReplaceCustomText (EZTR_CustomMsgHandle handle, u8 text_box_type, u8 text_box_y_pos, u8 display_icon, u16 next_message_id, u16 first_item_rupees, u16 second_item_rupees, bool pipe_escape_bytes, char *content, EZTR_MsgCallback callback,...)
 Declare a replacement of a custom message by defining the header attributes and message content.
 
void EZTR_Basic_ReplaceCustomTextEmpty (EZTR_CustomMsgHandle handle, EZTR_MsgCallback callback)
 Declare a replacement of a custom message, where the replacement message is empty.
 

Detailed Description

Functions for creating and replacing new messages.

Function Documentation

◆ EZTR_Basic_AddCustomBuffer()

void EZTR_Basic_AddCustomBuffer ( EZTR_CustomMsgHandle handle,
EZTR_MsgBuffer * buf,
EZTR_MsgCallback callback )

Declare a brand new (i.e: custom) message by copying from a buffer defined by the user.

If you've defined a message using the MsgBuffer/MsgSContent functions, you can use this to set it (or, rather, a copy of it) as the new message.

To avoid potential ID conflicts between mods, the u16 textId for this message will be assigned by EZTR and will be accessable via the handle. See EZTR_CustomMsgHandle for more information on how custom message handles work.

Parameters
handleThe handle for the new message.
bufThe message buffer to copy from.
callbackA function pointer to call right before this text is displayed. Useful for dynamic text. Set as NULL if you don't want to use a callback. See EZTR_MsgCallback for more information.

◆ EZTR_Basic_AddCustomText()

void EZTR_Basic_AddCustomText ( EZTR_CustomMsgHandle handle,
u8 text_box_type,
u8 text_box_y_pos,
u8 display_icon,
u16 next_message_id,
u16 first_item_rupees,
u16 second_item_rupees,
bool pipe_escape_bytes,
char * content,
EZTR_MsgCallback callback,
... )

Declare a brand new (i.e: custom) message by defining the header attributes and message content.

This is probably the easiest method to declare new messages.

The content argument uses EZTR's printf formatting arguments, specified after callback. See EZTR Printf Functions for more information on EZTR's custom printf behavior.

To avoid potential ID conflicts between mods, the u16 textId for this message will be assigned by EZTR and will be accessable via the handle. See EZTR_CustomMsgHandle for more information on how custom message handles work.

Parameters
handleThe handle for the new message.
text_box_typeThe style of textbox to display. Use the EZTR_TextBoxType enum for more readable values.
text_box_y_posThe vertical position of the textbox on-screen.
display_iconDisplays an icon in the textbox. Use the EZTR_TextBoxIcon enum for more readable values. Use EZTR_ICON_NO_ICON for no icon.
next_message_idThe next message to display. If there is no next message, or the next message is determined by code, use 0xFFFF or EZTR_NO_VALUE.
first_item_rupeesThe price of the first item being offered for sale, if one exists. If there is no item, use 0xFFFF or EZTR_NO_VALUE.
second_item_rupeesThe price of the second item being offered for sale, if one exists. If there is no item, use 0xFFFF or EZTR_NO_VALUE.
pipe_escape_bytesIf true, content is passed through EZTR_MsgBuffer_Sprintf("%m", content). If false, then content is copied directly into storage.
contentThe new text content to display. If you want empty content (for use with dynamic messages), use "\xBF".
callbackA function pointer to call right before this text is displayed. Useful for dynamic messages. Set as NULL if you don't want to use a callback. See EZTR_MsgCallback for more information.
...variable arguments, using EZTR's printf implementation.

◆ EZTR_Basic_AddCustomTextEmpty()

void EZTR_Basic_AddCustomTextEmpty ( EZTR_CustomMsgHandle handle,
EZTR_MsgCallback callback )

Declare a brand new (i.e: custom) message, where the replacement message is empty.

This is primarily used if you want the message to be completely dynamically generated.

To avoid potential ID conflicts between mods, the u16 textId for this message will be assigned by EZTR and will be accessable via the handle. See EZTR_CustomMsgHandle for more information on how custom message handles work.

Parameters
handleThe handle for the new message.
callbackA function pointer to call right before this text is displayed, in which you will construct the complete message buffer dynamically. See EZTR_MsgCallback for more information.

◆ EZTR_Basic_ReplaceCustomBuffer()

void EZTR_Basic_ReplaceCustomBuffer ( EZTR_CustomMsgHandle handle,
EZTR_MsgBuffer * buf,
EZTR_MsgCallback callback )

Declare a replacement for a custom message by copying from a buffer defined by the user.

If you've defined a message using the MsgBuffer/MsgSContent functions, you can use this to set it (or, rather, a copy of it) as the new message.

Parameters
handleThe handle for the message being replaced.
bufThe message buffer to copy from.
callbackA function pointer to call right before this text is displayed. Useful for dynamic text. Set as NULL if you don't want to use a callback. See EZTR_MsgCallback for more information.

◆ EZTR_Basic_ReplaceCustomText()

void EZTR_Basic_ReplaceCustomText ( EZTR_CustomMsgHandle handle,
u8 text_box_type,
u8 text_box_y_pos,
u8 display_icon,
u16 next_message_id,
u16 first_item_rupees,
u16 second_item_rupees,
bool pipe_escape_bytes,
char * content,
EZTR_MsgCallback callback,
... )

Declare a replacement of a custom message by defining the header attributes and message content.

This is probably the easiest method to replace custom messages, even those defined by other mods.

The content argument uses EZTR's printf formatting arguments, specified after callback. See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
handleThe handle for the message being replaced.
text_box_typeThe style of textbox to display. Use the EZTR_TextBoxType enum for more readable values.
text_box_y_posThe vertical position of the textbox on-screen.
display_iconDisplays an icon in the textbox. Use the EZTR_TextBoxIcon enum for more readable values. Use EZTR_ICON_NO_ICON for no icon.
next_message_idThe next message to display. If there is no next message, or the next message is determined by code, use 0xFFFF or EZTR_NO_VALUE.
first_item_rupeesThe price of the first item being offered for sale, if one exists. If there is no item, use 0xFFFF or EZTR_NO_VALUE.
second_item_rupeesThe price of the second item being offered for sale, if one exists. If there is no item, use 0xFFFF or EZTR_NO_VALUE.
pipe_escape_bytesIf true, content is passed through EZTR_MsgBuffer_Sprintf("%m", content). If false, then content is copied directly into storage.
contentThe new text content to display. If you want empty content (for use with dynamic messages), use "\xBF".
callbackA function pointer to call right before this text is displayed. Useful for dynamic messages. Set as NULL if you don't want to use a callback. See EZTR_MsgCallback for more information.
...variable arguments, using EZTR's printf implementation.

◆ EZTR_Basic_ReplaceCustomTextEmpty()

void EZTR_Basic_ReplaceCustomTextEmpty ( EZTR_CustomMsgHandle handle,
EZTR_MsgCallback callback )

Declare a replacement of a custom message, where the replacement message is empty.

This is primarily used if you want the message to be completely dynamically generated.

Parameters
handleThe handle for the message being replaced.
callbackA function pointer to call right before this text is displayed, in which you will construct the complete message buffer dynamically. See EZTR_MsgCallback for more information.