EZ Text Replacer for Zelda64Recompiled 2.2.0
 
Loading...
Searching...
No Matches
eztr_api.h File Reference

The main header for EZTR. More...

#include "modding.h"
#include "global.h"

Go to the source code of this file.

Data Structures

union  EZTR_MsgBuffer_Raw
 The message buffers type as defined in the Majora's Mask decompilation. More...
 
struct  EZTR_MsgBuffer_Partition
 The message buffer, but with the header and content regions defined as seperate arrays. More...
 
struct  EZTR_MsgBuffer_Data
 The message buffer, with the header represented as its individual members. More...
 
union  EZTR_MsgBuffer
 A union of the three MsgBuffer structs, and the primary type for interacting with message data. More...
 

Macros

#define EZTR_IMPORT(func)
 
#define EZTR_PACK_STRUCT
 
#define EZTR_MOD_ID_STR   "MM_EZ_Text_Replacer_API"
 The mod id string for EZTR.
 
#define EZTR_MSG_HIGHEST_ID   0x354C
 
#define EZTR_MSG_BUFFER_SIZE   1280
 The the full size of message buffer, in bytes.
 
#define EZTR_MSG_BUFFER_WIDE_SIZE   640
 The maximum length of buffer in two-byte characters (wchar).
 
#define EZTR_MSG_HEADER_SIZE   11
 The size of the message buffer's header region, in bytes.
 
#define EZTR_MSG_CONTENT_SIZE   1269
 The size of the message buffer's content region, in bytes.
 
#define EZTR_MSG_ENDING_CHAR   '\xBF'
 
#define EZTR_PIPE_CHAR   '|'
 
#define EZTR_CUSTOM_MSG_HANDLE_NAME(name_suffix)
 Uses to set/get the actual symbol name for custom message handles If you want to add a prefix/suffix to your custom message handles globally, it can be done here.
 
#define EZTR_DEFINE_CUSTOM_MSG_HANDLE_NO_EXPORT(name)
 Creates a non-exported CustomMsgHandle object.
 
#define EZTR_DEFINE_CUSTOM_MSG_HANDLE(name)
 Creates a CustomMsgHandle object.
 
#define EZTR_DECLARE_CUSTOM_MSG_HANDLE(name)
 Creates a declaration for a CustomMsgHandle object.
 
#define EZTR_EXTERN_CUSTOM_MSG_HANDLE(name)
 Creates a declaration for a CustomMsgHandle object. Alternative to EZTR_DECLARE_CUSTOM_MSG_HANDLE.
 
#define EZTR_IMPORT_CUSTOM_MSG_HANDLE(mod_str, name_suffix)
 Declares and imports a CustomMsgHandle object from another mod.
 
#define EZTR_IMPORT_CUSTOM_MSG_HANDLE_NO_PREFIX(mod_str, name)
 Declares and imports a CustomMsgHandle object from another mod.
 
#define EZTR_GET_CUSTOM_MSG_ID(handle)
 Gets the textId from a custom message handle.
 
#define EZTR_HNAME(name_suffix)
 Shorthand for EZTR_CUSTOM_MSG_HANDLE_NAME()
 
#define EZTR_GET_ID(handle)
 Gets the textId from a custom message handle.
 
#define EZTR_GET_ID_H(handle)
 Gets the textId from a custom message handle.
 
#define EZTR_MSG_CALLBACK(fname)
 A macro to easily create message callback functions.
 
#define EZTR_ON_INIT   RECOMP_CALLBACK("MM_EZ_Text_Replacer_API", EZTR_OnInit)
 Used to declare a function that should run after EZTR has finished initializing.
 
#define EZTR_ON_DUMP_BUFFER(func_name)
 Used to declare a callback function for when EZTR dumps a message. Normally, EZTR only prints that message to the game console, but this callback will allow you to do other things with that information. This EZTR_ON_DUMP_BUFFER event is only called when EZTR's text dump setting is set to On.
 
#define EZTR_ON_DUMP_BUFFER_FULL(func_name)
 Used to declare a callback function for when EZTR dumps the entire message buffer. Normally, EZTR only prints that message to the game console, but this callback will allow you to do other things with that information. This EZTR_ON_DUMP_BUFFER event is only called when EZTR's text dump setting is set to Full.
 
#define EZTR_NO_VALUE   0xffff
 Used by certain members of EZTR_MsgData (and the message header generally) to indicate that said member is not in use.
 
#define EZTR_CC_COLOR_DEFAULT   "\x00"
 Following Text Color: Default.
 
#define EZTR_CC_COLOR_RED   "\x01"
 Following Text Color: Red.
 
#define EZTR_CC_COLOR_GREEN   "\x02"
 Following Text Color: Green.
 
#define EZTR_CC_COLOR_BLUE   "\x03"
 Following Text Color: Blue.
 
#define EZTR_CC_COLOR_YELLOW   "\x04"
 Following Text Color: Yellow.
 
#define EZTR_CC_COLOR_LIGHTBLUE   "\x05"
 Following Text Color: Turquoise.
 
#define EZTR_CC_COLOR_PINK   "\x06"
 Following Text Color: Pink.
 
#define EZTR_CC_COLOR_SILVER   "\x07"
 Following Text Color: Silver.
 
#define EZTR_CC_COLOR_ORANGE   "\x08"
 Following Text Color: Orange.
 
#define EZTR_CC_TEXT_SPEED   "\x0a"
 Slows down text (not used)
 
#define EZTR_CC_HS_BOAT_ARCHERY   "\x0b"
 Print: Hits Required to Win Jungle Cruise Reward.
 
#define EZTR_CC_STRAY_FAIRIES   "\x0c"
 Print: Stray Fairies Collected in Current Dungeon.
 
#define EZTR_CC_TOKENS   "\x0d"
 Print: Gold Skulltulas Collected in Current Spider House.
 
#define EZTR_CC_POINTS_TENS   "\x0e"
 Print: 0.
 
#define EZTR_CC_POINTS_THOUSANDS   "\x0f"
 Print: 0.
 
#define EZTR_CC_BOX_BREAK   "\x10"
 Box Break I.
 
#define EZTR_CC_NEWLINE   "\x11"
 Line Break.
 
#define EZTR_CC_BOX_BREAK2   "\x12"
 Box Break II.
 
#define EZTR_CC_CARRIAGE_RETURN   "\x13"
 Reset Cursor Position to Start of Current Line.
 
#define EZTR_CC_SHIFT   "\x14"
 Print: xx Spaces.
 
#define EZTR_CC_SHIFT_ARGC   "\x14%c"
 Print: c Spaces.
 
#define EZTR_CC_CONTINUE   "\x15"
 Disable Text Skip I.
 
#define EZTR_CC_NAME   "\x16"
 Print: Player Name.
 
#define EZTR_CC_QUICKTEXT_ENABLE   "\x17"
 Enable: Instantaneous Text.
 
#define EZTR_CC_QUICKTEXT_DISABLE   "\x18"
 Disable: Instantaneous Text.
 
#define EZTR_CC_EVENT   "\x19"
 Disable Text Skip II.
 
#define EZTR_CC_PERSISTENT   "\x1a"
 Disable Text Box Close.
 
#define EZTR_CC_BOX_BREAK_DELAYED   "\x1b"
 Delay for xxxx Before Printing Remaining Text.
 
#define EZTR_CC_BOX_BREAK_DELAYED_ARGW   "\x1b%w"
 Delay for xxxx Before Printing Remaining Text.
 
#define EZTR_CC_FADE   "\x1c"
 Keep Text on Screen for xxxx Before Closing.
 
#define EZTR_CC_FADE_ARGW   "\x1c%w"
 Keep Text on Screen for xxxx Before Closing.
 
#define EZTR_CC_FADE_SKIPPABLE   "\x1d"
 Delay for xxxx Before Ending Conversation.
 
#define EZTR_CC_FADE_SKIPPABLE_ARGW   "\x1d%w"
 Delay for xxxx Before Ending Conversation.
 
#define EZTR_CC_SFX   "\x1e"
 Play Sound Effect xxxx.
 
#define EZTR_CC_SFX_ARGW   "\x1e%w"
 Play Sound Effect xxxx.
 
#define EZTR_CC_DELAY   "\x1f"
 Delay for xxxx Before Resuming Text Flow.
 
#define EZTR_CC_DELAY_ARGW   "\x1f%w"
 Delay for xxxx Before Resuming Text Flow.
 
#define EZTR_CC_BTN_A   "\xb0"
 Displays the A Button icon.
 
#define EZTR_CC_BTN_B   "\xb1"
 Displays the B button icon.
 
#define EZTR_CC_BTN_C   "\xb2"
 Displays the C buttons icon.
 
#define EZTR_CC_BTN_L   "\xb3"
 Displays the L button icon.
 
#define EZTR_CC_BTN_R   "\xb4"
 Displays the R button icon.
 
#define EZTR_CC_BTN_Z   "\xb5"
 Displays the Z button icon.
 
#define EZTR_CC_BTN_CUP   "\xb6"
 Displays the C-up button icon.
 
#define EZTR_CC_BTN_CDOWN   "\xb7"
 Displays the C-down button icon.
 
#define EZTR_CC_BTN_CLEFT   "\xb8"
 Displays the C-left button icon.
 
#define EZTR_CC_BTN_CRIGHT   "\xb9"
 Displays the C-right button icon.
 
#define EZTR_CC_Z_TARGET   "\xba"
 DDisplays the Z targeting icon.
 
#define EZTR_CC_CONTROL_PAD   "\xbb"
 Displays the Control Pad icon.
 
#define EZTR_CC_END   "\xbf"
 Message End Marker.
 
#define EZTR_CC_BACKGROUND   "\xc1"
 Ocarina Song Failure.
 
#define EZTR_CC_TWO_CHOICE   "\xc2"
 Initialize Selection: Two Choices.
 
#define EZTR_CC_THREE_CHOICE   "\xc3"
 Initialize Selection: Three Choices.
 
#define EZTR_CC_TIMER_POSTMAN   "\xc4"
 Print: Postman's Counting Game Results.
 
#define EZTR_CC_TIMER_MINIGAME_1   "\xc5"
 Timer Value.
 
#define EZTR_CC_TIMER_2   "\xc6"
 Timer Value.
 
#define EZTR_CC_TIMER_MOON_CRASH   "\xc7"
 Print: Remaining Time Till Moon Falls (Clock Tower Roof)
 
#define EZTR_CC_TIMER_MINIGAME_2   "\xc8"
 Print: Deku Scrub Playground Results.
 
#define EZTR_CC_TIMER_ENV_HAZARD   "\xc9"
 Timer Value.
 
#define EZTR_CC_TIME   "\xca"
 Timer Value.
 
#define EZTR_CC_CHEST_FLAGS   "\xcb"
 Print: Shooting Gallery Minigame Results.
 
#define EZTR_CC_INPUT_BANK   "\xcc"
 Display Prompt: Withdraw or Deposit Rupees.
 
#define EZTR_CC_RUPEES_SELECTED   "\xcd"
 Print: Number of Rupees Entered or Bet.
 
#define EZTR_CC_RUPEES_TOTAL   "\xce"
 Print: Total Rupees in Bank or Won by Betting.
 
#define EZTR_CC_TIME_UNTIL_MOON_CRASH   "\xcf"
 Print: Time Remaining in Hours & Minutes.
 
#define EZTR_CC_INPUT_DOGGY_RACETRACK_BET   "\xd0"
 Display Prompt: Rupees to Bet.
 
#define EZTR_CC_INPUT_BOMBER_CODE   "\xd1"
 Display Prompt: Bombers' Code.
 
#define EZTR_CC_PAUSE_MENU   "\xd2"
 Item Prompt.
 
#define EZTR_CC_TIME_SPEED   "\xd3"
 [?]
 
#define EZTR_CC_OWL_WARP   "\xd4"
 Print: Song of Soaring Destination.
 
#define EZTR_CC_INPUT_LOTTERY_CODE   "\xd5"
 Display Prompt: Lottery Number.
 
#define EZTR_CC_SPIDER_HOUSE_MASK_CODE   "\xd6"
 Print: 123456.
 
#define EZTR_CC_STRAY_FAIRIES_LEFT_WOODFALL   "\xd7"
 Print: Remaining Stray Fairies in Woodfall Temple.
 
#define EZTR_CC_STRAY_FAIRIES_LEFT_SNOWHEAD   "\xd8"
 Print: Remaining Stray Fairies in Snowhead Temple.
 
#define EZTR_CC_STRAY_FAIRIES_LEFT_GREAT_BAY   "\xd9"
 Print: Remaining Stray Fairies in Great Bay Temple.
 
#define EZTR_CC_STRAY_FAIRIES_LEFT_STONE_TOWER   "\xda"
 Print: Remaining Stray Fairies in Stone Tower Temple.
 
#define EZTR_CC_POINTS_BOAT_ARCHERY   "\xdb"
 Print: Jungle Cruise Minigame Results.
 
#define EZTR_CC_LOTTERY_CODE   "\xdc"
 Print: Winning Lottery Numbers.
 
#define EZTR_CC_LOTTERY_CODE_GUESS   "\xdd"
 Print: Player's Lottery Numbers.
 
#define EZTR_CC_HELD_ITEM_PRICE   "\xde"
 Print: Item Value in Rupees.
 
#define EZTR_CC_BOMBER_CODE   "\xdf"
 Print: Bombers' Code.
 
#define EZTR_CC_EVENT2   "\xe0"
 End Conversation.
 
#define EZTR_CC_SPIDER_HOUSE_MASK_CODE_1   "\xe1"
 Print: Color of Oceanside Spider House Mask 1.
 
#define EZTR_CC_SPIDER_HOUSE_MASK_CODE_2   "\xe2"
 Print: Color of Oceanside Spider House Mask 2.
 
#define EZTR_CC_SPIDER_HOUSE_MASK_CODE_3   "\xe3"
 Print: Color of Oceanside Spider House Mask 3.
 
#define EZTR_CC_SPIDER_HOUSE_MASK_CODE_4   "\xe4"
 Print: Color of Oceanside Spider House Mask 4.
 
#define EZTR_CC_SPIDER_HOUSE_MASK_CODE_5   "\xe5"
 Print: Color of Oceanside Spider House Mask 5.
 
#define EZTR_CC_SPIDER_HOUSE_MASK_CODE_6   "\xe6"
 Print: Color of Oceanside Spider House Mask 6.
 
#define EZTR_CC_HOURS_UNTIL_MOON_CRASH   "\xe7"
 Print: Remaining Time Till Moon Falls.
 
#define EZTR_CC_TIME_UNTIL_NEW_DAY   "\xe8"
 Print: Remaining Time Till Morning in Hours & Minutes.
 
#define EZTR_CC_HS_POINTS_BANK_RUPEES   "\xf0"
 Print: Total Rupees in Bank.
 
#define EZTR_CC_HS_POINTS_UNK_1   "\xf1"
 Print: 0.
 
#define EZTR_CC_HS_POINTS_FISHING   "\xf2"
 Print: 0.
 
#define EZTR_CC_HS_TIME_BOAT_ARCHERY   "\xf3"
 Print: 0"10'.
 
#define EZTR_CC_HS_TIME_HORSE_BACK_BALLOON   "\xf4"
 Print: :0"00'.
 
#define EZTR_CC_HS_TIME_LOTTERY_GUESS   "\xf5"
 Print: Timer or Highscore in 00"00' Format [?].
 
#define EZTR_CC_HS_TOWN_SHOOTING_GALLERY   "\xf6"
 Print: Town Shooting Gallery Highscore.
 
#define EZTR_CC_HS_UNK_1   "\xf7"
 Print: 00'00"00.
 
#define EZTR_CC_HS_UNK_3_LOWER   "\xf8"
 Print: Magic Bean Price.
 
#define EZTR_CC_HS_HORSE_BACK_BALLOON   "\xf9"
 Print: Epona Balloon Archery Highscore I.
 
#define EZTR_CC_HS_DEKU_PLAYGROUND_DAY_1   "\xfa"
 Print: Deku Scrub Playground Highscore (Day 1)
 
#define EZTR_CC_HS_DEKU_PLAYGROUND_DAY_2   "\xfb"
 Print: Deku Scrub Playground Highscore (Day 2)
 
#define EZTR_CC_HS_DEKU_PLAYGROUND_DAY_3   "\xfc"
 Print: Deku Scrub Playground Highscore (Day 3)
 
#define EZTR_CC_DEKU_PLAYGROUND_NAME_DAY_1   "\xfd"
 Print: Broken Character [?].
 
#define EZTR_CC_DEKU_PLAYGROUND_NAME_DAY_2   "\xfe"
 [?]
 
#define EZTR_CC_DEKU_PLAYGROUND_NAME_DAY_3   "\xff"
 [?]
 

Typedefs

typedef u16(* EZTR_CustomMsgHandle) (_EZTR_CustomMsgHandleSetter *setter)
 The type declaration for custom message handle.
 
typedef void(* EZTR_MsgCallback) (EZTR_MsgBuffer *buf, u16 textId, PlayState *play)
 The function pointer type for message callbacks.
 

Enumerations

enum  EZTR_TextBoxType {
  EZTR_STANDARD_TEXT_BOX_I = 0X00 , EZTR_WOODEN_SIGN_BACKGROUND = 0X01 , EZTR_TRANSLUSCENT_BLUE_TEXT_BOX = 0X02 , EZTR_OCARINA_STAFF = 0X03 ,
  EZTR_INVISIBLE_TEXT_BOX_I = 0X04 , EZTR_INVISIBLE_TEXT_BOX_II = 0X05 , EZTR_STANDARD_TEXT_BOX_II = 0X06 , EZTR_INVISIBLE_TEXT_BOX = 0X07 ,
  EZTR_BLUE_TEXT_BOX = 0X08 , EZTR_RED_TEXT_BOX_I = 0X09 , EZTR_INVISIBLE_TEXT_BOX_III = 0X0A , EZTR_INVISIBLE_TEXT_BOX_IV = 0X0B ,
  EZTR_INVISIBLE_TEXT_BOX_V = 0X0C , EZTR_BOMBERS_NOTEBOOK = 0X0D , EZTR_INVISIBLE_TEXT_BOX_VI = 0X0E , EZTR_RED_TEXT_BOX_II = 0X0F
}
 Used in the message header to indicate the style of textbox used for the message. More...
 
enum  EZTR_TextBoxIcon {
  EZTR_ICON_NOTHING = 0x00 , EZTR_ICON_GREEN_RUPEE = 0x01 , EZTR_ICON_BLUE_RUPEE = 0x02 , EZTR_ICON_WHITE_RUPEE = 0x03 ,
  EZTR_ICON_RED_RUPEE = 0x04 , EZTR_ICON_PURPLE_RUPEE = 0x05 , EZTR_ICON_WHITE_RUPEE_1 = 0x06 , EZTR_ICON_ORANGE_RUPEE = 0x07 ,
  EZTR_ICON_ADULT_WALLET = 0x08 , EZTR_ICON_GIANTS_WALLET = 0x09 , EZTR_ICON_RECOVERY_HEART = 0x0A , EZTR_ICON_RECOVERY_HEART_1 = 0x0B ,
  EZTR_ICON_PIECE_OF_HEART = 0x0C , EZTR_ICON_HEART_CONTAINER = 0x0D , EZTR_ICON_SMALL_MAGIC_JAR = 0x0E , EZTR_ICON_LARGE_MAGIC_JAR = 0x0F ,
  EZTR_ICON_RECOVERY_HEART_2 = 0x10 , EZTR_ICON_STRAY_FAIRY = 0x11 , EZTR_ICON_RECOVERY_HEART_3 = 0x12 , EZTR_ICON_RECOVERY_HEART_4 = 0x13 ,
  EZTR_ICON_BOMB = 0x14 , EZTR_ICON_BOMB_1 = 0x15 , EZTR_ICON_BOMB_2 = 0x16 , EZTR_ICON_BOMB_3 = 0x17 ,
  EZTR_ICON_BOMB_4 = 0x18 , EZTR_ICON_DEKU_STICK = 0x19 , EZTR_ICON_BOMBCHU = 0x1A , EZTR_ICON_BOMB_BAG = 0x1B ,
  EZTR_ICON_BIG_BOMB_BAG = 0x1C , EZTR_ICON_BIGGER_BOMB_BAG = 0x1D , EZTR_ICON_HEROS_BOW = 0x1E , EZTR_ICON_HEROS_BOW_1 = 0x1F ,
  EZTR_ICON_HEROS_BOW_2 = 0x20 , EZTR_ICON_HEROS_BOW_3 = 0x21 , EZTR_ICON_QUIVER = 0x22 , EZTR_ICON_BIG_QUIVER = 0x23 ,
  EZTR_ICON_BIGGEST_QUIVER = 0x24 , EZTR_ICON_FIRE_ARROW = 0x25 , EZTR_ICON_ICE_ARROW = 0x26 , EZTR_ICON_LIGHT_ARROW = 0x27 ,
  EZTR_ICON_DEKU_NUT = 0x28 , EZTR_ICON_DEKU_NUT_1 = 0x29 , EZTR_ICON_DEKU_NUT_2 = 0x2A , EZTR_ICON_NOTHING_1 = 0x2B ,
  EZTR_ICON_NOTHING_2 = 0x2C , EZTR_ICON_NOTHING_3 = 0x2D , EZTR_ICON_NOTHING_4 = 0x2E , EZTR_ICON_NOTHING_5 = 0x2F ,
  EZTR_ICON_NOTHING_6 = 0x30 , EZTR_ICON_NOTHING_7 = 0x31 , EZTR_ICON_HEROS_SHIELD = 0x32 , EZTR_ICON_MIRROR_SHIELD = 0x33 ,
  EZTR_ICON_POWDER_KEG = 0x34 , EZTR_ICON_MAGIC_BEAN = 0x35 , EZTR_ICON_PICTOGRAPH_BOX = 0x36 , EZTR_ICON_KOKIRI_SWORD = 0x37 ,
  EZTR_ICON_RAZOR_SWORD = 0x38 , EZTR_ICON_GILDED_SWORD = 0x39 , EZTR_ICON_FIERCE_DEITYS_SWORD = 0x3A , EZTR_ICON_GREAT_FAIRYS_SWORD = 0x3B ,
  EZTR_ICON_SMALL_KEY = 0x3C , EZTR_ICON_BOSS_KEY = 0x3D , EZTR_ICON_DUNGEON_MAP = 0x3E , EZTR_ICON_COMPASS = 0x3F ,
  EZTR_ICON_POWDER_KEG_1 = 0x40 , EZTR_ICON_HOOKSHOT = 0x41 , EZTR_ICON_LENS_OF_TRUTH = 0x42 , EZTR_ICON_PICTOGRAPH_BOX_1 = 0x43 ,
  EZTR_ICON_FISHING_ROD = 0x44 , EZTR_ICON_NOTHING_8 = 0x45 , EZTR_ICON_NOTHING_9 = 0x46 , EZTR_ICON_NOTHING_10 = 0x47 ,
  EZTR_ICON_NOTHING_11 = 0x48 , EZTR_ICON_NOTHING_12 = 0x49 , EZTR_ICON_NOTHING_13 = 0x4A , EZTR_ICON_NOTHING_14 = 0x4B ,
  EZTR_ICON_OCARINA_OF_TIME = 0x4C , EZTR_ICON_NOTHING_15 = 0x4D , EZTR_ICON_NOTHING_16 = 0x4E , EZTR_ICON_NOTHING_17 = 0x4F ,
  EZTR_ICON_BOMBERS_NOTEBOOK = 0x50 , EZTR_ICON_NOTHING_18 = 0x51 , EZTR_ICON_GOLD_SKULLTULA_TOKEN = 0x52 , EZTR_ICON_NOTHING_19 = 0x53 ,
  EZTR_ICON_NOTHING_20 = 0x54 , EZTR_ICON_ODOLWAS_REMAINS = 0x55 , EZTR_ICON_GOHTS_REMAINS = 0x56 , EZTR_ICON_GYORGS_REMAINS = 0x57 ,
  EZTR_ICON_TWINMOLDS_REMAINS = 0x58 , EZTR_ICON_RED_POTION = 0x59 , EZTR_ICON_EMPTY_BOTTLE = 0x5A , EZTR_ICON_RED_POTION_1 = 0x5B ,
  EZTR_ICON_GREEN_POTION = 0x5C , EZTR_ICON_BLUE_POTION = 0x5D , EZTR_ICON_FAIRYS_SPIRIT = 0x5E , EZTR_ICON_DEKU_PRINCESS = 0x5F ,
  EZTR_ICON_MILK = 0x60 , EZTR_ICON_MILK_HALF = 0x61 , EZTR_ICON_FISH = 0x62 , EZTR_ICON_BUG = 0x63 ,
  EZTR_ICON_BLUE_FIRE = 0x64 , EZTR_ICON_POE = 0x65 , EZTR_ICON_BIG_POE = 0x66 , EZTR_ICON_SPRING_WATER = 0x67 ,
  EZTR_ICON_HOT_SPRING_WATER = 0x68 , EZTR_ICON_ZORA_EGG = 0x69 , EZTR_ICON_GOLD_DUST = 0x6A , EZTR_ICON_MUSHROOM = 0x6B ,
  EZTR_ICON_NOTHING_21 = 0x6C , EZTR_ICON_NOTHING_22 = 0x6D , EZTR_ICON_SEAHORSE = 0x6E , EZTR_ICON_CHATEAU_ROMANI = 0x6F ,
  EZTR_ICON_HYLIAN_LOACH = 0x70 , EZTR_ICON_NOTHING_23 = 0x71 , EZTR_ICON_NOTHING_24 = 0x72 , EZTR_ICON_NOTHING_25 = 0x73 ,
  EZTR_ICON_NOTHING_26 = 0x74 , EZTR_ICON_NOTHING_27 = 0x75 , EZTR_ICON_NOTHING_28 = 0x76 , EZTR_ICON_NOTHING_29 = 0x77 ,
  EZTR_ICON_DEKU_MASK = 0x78 , EZTR_ICON_GORON_MASK = 0x79 , EZTR_ICON_ZORA_MASK = 0x7A , EZTR_ICON_FIERCE_DEITY_MASK = 0x7B ,
  EZTR_ICON_MASK_OF_TRUTH = 0x7C , EZTR_ICON_KAFEIS_MASK = 0x7D , EZTR_ICON_ALL_NIGHT_MASK = 0x7E , EZTR_ICON_BUNNY_HOOD = 0x7F ,
  EZTR_ICON_KEATON_MASK = 0x80 , EZTR_ICON_GARO_MASK = 0x81 , EZTR_ICON_ROMANI_MASK = 0x82 , EZTR_ICON_CIRCUS_LEADERS_MASK = 0x83 ,
  EZTR_ICON_POSTMANS_HAT = 0x84 , EZTR_ICON_COUPLES_MASK = 0x85 , EZTR_ICON_GREAT_FAIRYS_MASK = 0x86 , EZTR_ICON_GIBDO_MASK = 0x87 ,
  EZTR_ICON_DON_GEROS_MASK = 0x88 , EZTR_ICON_KAMAROS_MASK = 0x89 , EZTR_ICON_CAPTAINS_HAT = 0x8A , EZTR_ICON_STONE_MASK = 0x8B ,
  EZTR_ICON_BREMEN_MASK = 0x8C , EZTR_ICON_BLAST_MASK = 0x8D , EZTR_ICON_MASK_OF_SCENTS = 0x8E , EZTR_ICON_GIANTS_MASK = 0x8F ,
  EZTR_ICON_NOTHING_30 = 0x90 , EZTR_ICON_CHATEAU_ROMANI_1 = 0x91 , EZTR_ICON_MILK_1 = 0x92 , EZTR_ICON_GOLD_DUST_1 = 0x93 ,
  EZTR_ICON_HYLIAN_LOACH_1 = 0x94 , EZTR_ICON_SEAHORSE_1 = 0x95 , EZTR_ICON_MOONS_TEAR = 0x96 , EZTR_ICON_TOWN_TITLE_DEED = 0x97 ,
  EZTR_ICON_SWAMP_TITLE_DEED = 0x98 , EZTR_ICON_MOUNTAIN_TITLE_DEED = 0x99 , EZTR_ICON_OCEAN_TITLE_DEED = 0x9A , EZTR_ICON_NOTHING_31 = 0x9B ,
  EZTR_ICON_NOTHING_32 = 0x9C , EZTR_ICON_NOTHING_33 = 0x9D , EZTR_ICON_NOTHING_34 = 0x9E , EZTR_ICON_NOTHING_35 = 0x9F ,
  EZTR_ICON_ROOM_KEY = 0xA0 , EZTR_ICON_SPECIAL_DELIVERY_TO_MAMA = 0xA1 , EZTR_ICON_NOTHING_36 = 0xA2 , EZTR_ICON_NOTHING_37 = 0xA3 ,
  EZTR_ICON_NOTHING_38 = 0xA4 , EZTR_ICON_NOTHING_39 = 0xA5 , EZTR_ICON_NOTHING_40 = 0xA6 , EZTR_ICON_NOTHING_41 = 0xA7 ,
  EZTR_ICON_NOTHING_42 = 0xA8 , EZTR_ICON_NOTHING_43 = 0xA9 , EZTR_ICON_LETTER_TO_KAFEI = 0xAA , EZTR_ICON_PENDANT_OF_MEMORIES = 0xAB ,
  EZTR_ICON_NOTHING_44 = 0xAC , EZTR_ICON_NOTHING_45 = 0xAD , EZTR_ICON_NOTHING_46 = 0xAE , EZTR_ICON_NOTHING_47 = 0xAF ,
  EZTR_ICON_NOTHING_48 = 0xB0 , EZTR_ICON_NOTHING_49 = 0xB1 , EZTR_ICON_NOTHING_50 = 0xB2 , EZTR_ICON_TINGLES_MAP = 0xB3 ,
  EZTR_ICON_TINGLES_MAP_1 = 0xB4 , EZTR_ICON_TINGLES_MAP_2 = 0xB5 , EZTR_ICON_TINGLES_MAP_3 = 0xB6 , EZTR_ICON_TINGLES_MAP_4 = 0xB7 ,
  EZTR_ICON_TINGLES_MAP_5 = 0xB8 , EZTR_ICON_TINGLES_MAP_6 = 0xB9 , EZTR_ICON_NOTHING_51 = 0xBA , EZTR_ICON_NOTHING_52 = 0xBB ,
  EZTR_ICON_NOTHING_53 = 0xBC , EZTR_ICON_NOTHING_54 = 0xBD , EZTR_ICON_NOTHING_55 = 0xBE , EZTR_ICON_NOTHING_56 = 0xBF ,
  EZTR_ICON_NOTHING_57 = 0xC0 , EZTR_ICON_NOTHING_58 = 0xC1 , EZTR_ICON_NOTHING_59 = 0xC2 , EZTR_ICON_NOTHING_60 = 0xC3 ,
  EZTR_ICON_NOTHING_61 = 0xC4 , EZTR_ICON_NOTHING_62 = 0xC5 , EZTR_ICON_NOTHING_63 = 0xC6 , EZTR_ICON_NOTHING_64 = 0xC7 ,
  EZTR_ICON_NOTHING_65 = 0xC8 , EZTR_ICON_NOTHING_66 = 0xC9 , EZTR_ICON_NOTHING_67 = 0xCA , EZTR_ICON_NOTHING_68 = 0xCB ,
  EZTR_ICON_NOTHING_69 = 0xCC , EZTR_ICON_NOTHING_70 = 0xCD , EZTR_ICON_NOTHING_71 = 0xCE , EZTR_ICON_NOTHING_72 = 0xCF ,
  EZTR_ICON_NOTHING_73 = 0xD0 , EZTR_ICON_NOTHING_74 = 0xD1 , EZTR_ICON_NOTHING_75 = 0xD2 , EZTR_ICON_NOTHING_76 = 0xD3 ,
  EZTR_ICON_NOTHING_77 = 0xD4 , EZTR_ICON_NOTHING_78 = 0xD5 , EZTR_ICON_NOTHING_79 = 0xD6 , EZTR_ICON_NOTHING_80 = 0xD7 ,
  EZTR_ICON_SMALL_BLACK_LINE = 0xD8 , EZTR_ICON_SMALL_BLACK_LINE_1 = 0xD9 , EZTR_ICON_SMALL_BLACK_LINE_2 = 0xDA , EZTR_ICON_SMALL_BLACK_LINE_3 = 0xDB ,
  EZTR_ICON_ANJU = 0xDC , EZTR_ICON_KAFEI = 0xDD , EZTR_ICON_CURIOSITY_SHOP_OWNER = 0xDE , EZTR_ICON_BOMB_SHOP_OWNERS_MOTHER = 0xDF ,
  EZTR_ICON_ROMANI = 0xE0 , EZTR_ICON_CREMIA = 0xE1 , EZTR_ICON_MAYOR_DOTOUR = 0xE2 , EZTR_ICON_MADAME_AROMA = 0xE3 ,
  EZTR_ICON_TOTO = 0xE4 , EZTR_ICON_GORMAN = 0xE5 , EZTR_ICON_POSTMAN = 0xE6 , EZTR_ICON_ROSA_SISTERS = 0xE7 ,
  EZTR_ICON_TOILET_HAND = 0xE8 , EZTR_ICON_GRANNY = 0xE9 , EZTR_ICON_KAMARO = 0xEA , EZTR_ICON_GROG = 0xEB ,
  EZTR_ICON_GORMAN_BROTHERS = 0xEC , EZTR_ICON_SHIRO = 0xED , EZTR_ICON_GURU_GURU = 0xEE , EZTR_ICON_BOMBERS = 0xEF ,
  EZTR_ICON_EXCLAMATION_MARK = 0xF0 , EZTR_ICON_NOTHING_81 = 0xF1 , EZTR_ICON_NOTHING_82 = 0xF2 , EZTR_ICON_NOTHING_83 = 0xF3 ,
  EZTR_ICON_NOTHING_84 = 0xF4 , EZTR_ICON_NOTHING_85 = 0xF5 , EZTR_ICON_NOTHING_86 = 0xF6 , EZTR_ICON_NOTHING_87 = 0xF7 ,
  EZTR_ICON_NOTHING_88 = 0xF8 , EZTR_ICON_NOTHING_89 = 0xF9 , EZTR_ICON_NOTHING_90 = 0xFA , EZTR_ICON_NOTHING_91 = 0xFB ,
  EZTR_ICON_NOTHING_92 = 0xFC , EZTR_ICON_NOTHING_93 = 0xFD , EZTR_ICON_NO_ICON = 0xFE , EZTR_ICON_MAX = 0xFE
}
 Used in the message header to indicate a display icon for the message. More...
 

Functions

void EZTR_Basic_ReplaceBuffer (u16 textId, EZTR_MsgBuffer *buf, EZTR_MsgCallback callback)
 Declare a replacement of a vanilla message by copying from a buffer defined by the user.
 
void EZTR_Basic_ReplaceText (u16 textId, 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 vanilla message by defining the header attributes and message content.
 
void EZTR_Basic_ReplaceTextEmpty (u16 textId, EZTR_MsgCallback callback)
 Declare a replacement of a vanilla message, where the replacement message is empty.
 
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.
 
EZTR_MsgBufferEZTR_MsgBuffer_Create ()
 Creates a new message buffer object on the heap.
 
EZTR_MsgBufferEZTR_MsgBuffer_CreateFromStr (char *src)
 Creates a new message buffer object on the heap, and copies src into it.
 
EZTR_MsgBufferEZTR_MsgBuffer_CreateFromStrN (char *src, size_t len)
 Creates a new message buffer object on the heap, and copies src into it for up to len bytes.
 
void EZTR_MsgBuffer_Destroy (EZTR_MsgBuffer *buf)
 Frees/destroys a message buffer.
 
u32 EZTR_MsgBuffer_Copy (EZTR_MsgBuffer *dst, char *src)
 Copies data from src into the message buffer dst.
 
u32 EZTR_MsgBuffer_NCopy (EZTR_MsgBuffer *dst, char *src, size_t len)
 Copies data from src into the message buffer dst, up to len bytes.
 
u32 EZTR_MsgBuffer_Len (EZTR_MsgBuffer *buf)
 Gets the size of the message buffer's stored data, in bytes.
 
u32 EZTR_MsgBuffer_ContentLen (EZTR_MsgBuffer *buf)
 Gets the size of the message buffer's content region, in bytes.
 
void EZTR_MsgBuffer_WriteDefaultHeader (EZTR_MsgBuffer *buf)
 Sets a message buffer's header to default values.
 
void EZTR_MsgBuffer_WriteHeader (EZTR_MsgBuffer *buf, u8 text_box_type, u8 text_box_y_pos, u8 display_icon, u16 next_message_id, u16 first_item_rupees, u16 second_item_rupees)
 
u8 EZTR_MsgBuffer_GetTextBoxType (EZTR_MsgBuffer *buf)
 Retrieves the text_box_type from a message buffer's header.
 
void EZTR_MsgBuffer_SetTextBoxType (EZTR_MsgBuffer *buf, u8 type)
 Sets the text_box_type of the message buffer's header.
 
u8 EZTR_MsgBuffer_GetTextBoxYPos (EZTR_MsgBuffer *buf)
 Retrieves the text_box_y_pos from a message buffer's header.
 
void EZTR_MsgBuffer_SetTextBoxYPos (EZTR_MsgBuffer *buf, u8 pos)
 Sets the text_box_y_pos of the message buffer's header.
 
u8 EZTR_MsgBuffer_GetTextBoxDisplayIcon (EZTR_MsgBuffer *buf)
 Retrieves the display_icon from a message buffer's header.
 
void EZTR_MsgBuffer_SetTextBoxDisplayIcon (EZTR_MsgBuffer *buf, u8 icon)
 Sets the display_icon of the message buffer's header.
 
u16 EZTR_MsgBuffer_GetNextMsg (EZTR_MsgBuffer *buf)
 Retrieves the next_message_id from a message buffer's header.
 
void EZTR_MsgBuffer_SetNextMsg (EZTR_MsgBuffer *buf, u16 textId)
 Sets the next_message_id of the message buffer's header.
 
u16 EZTR_MsgBuffer_GetFirstItemRupees (EZTR_MsgBuffer *buf)
 Retrieves the first_item_rupees from a message buffer's header.
 
void EZTR_MsgBuffer_SetFirstItemRupees (EZTR_MsgBuffer *buf, u16 val)
 Sets the first_item_rupees of the message buffer's header.
 
u16 EZTR_MsgBuffer_GetSecondItemRupees (EZTR_MsgBuffer *buf)
 Retrieves the second_item_rupees from a message buffer's header.
 
void EZTR_MsgBuffer_SetSecondItemRupees (EZTR_MsgBuffer *buf, u16 val)
 Sets the second_item_rupees of the message buffer's header.
 
void EZTR_MsgBuffer_Print (EZTR_MsgBuffer *buf)
 Prints the contents of a message buffer to the console.
 
void EZTR_MsgBuffer_PrintCCode (EZTR_MsgBuffer *buf)
 Prints the contents of a message buffer to the console, formatted as a EZTR_Basic_ReplaceText call.
 
void EZTR_MsgBuffer_PrintFull (EZTR_MsgBuffer *buf)
 Prints the contents of a message buffer to the console.
 
void EZTR_MsgBuffer_PrintFullCCode (EZTR_MsgBuffer *buf)
 Prints the contents of a message buffer to the console, formatted as a EZTR_Basic_ReplaceText call.
 
char * EZTR_MsgBuffer_GetContentPtr (EZTR_MsgBuffer *buf)
 Gets a pointer to the beginning of the content region for a desired message buffer.
 
void EZTR_MsgSContent_SetEmpty (char *cont)
 Sets the message message content as empty.
 
u32 EZTR_MsgSContent_Len (char *cont)
 Gets the length of the a message content string in bytes, not counting the '\xBF' termination character.
 
u32 EZTR_MsgSContent_NCopy (char *dst, char *src, size_t len)
 Copies message content from src into the dst, up to len bytes.
 
u32 EZTR_MsgSContent_Copy (char *dst, char *src)
 Copies message content from src into the dst.
 
char * EZTR_MsgSContent_NCat (char *dst, char *src, size_t len)
 Copies the message content of src onto the end of dst, up to len bytes from src.
 
char * EZTR_MsgSContent_Cat (char *dst, char *src)
 Copies the message content of src onto the end of dst.
 
s32 EZTR_MsgSContent_NCmp (char *str1, char *str2, size_t len)
 Compares up to len bytes of two message content strings.
 
s32 EZTR_MsgSContent_Cmp (char *str1, char *str2)
 Compares two message content strings.
 
int EZTR_MsgSContent_Printf (const char *format,...)
 A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.
 
int EZTR_MsgSContent_PrintfLine (const char *format,...)
 A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.
 
int EZTR_MsgSContent_Sprintf (char *buffer, const char *format,...)
 A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.
 
int EZTR_MsgSContent_Snprintf (char *buffer, size_t count, const char *format,...)
 A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.
 
int EZTR_MsgSContent_Vsnprintf (char *buffer, size_t count, const char *format, va_list va)
 A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.
 
int EZTR_MsgSContent_Vprintf (const char *format, va_list va)
 A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.
 
int EZTR_MsgSContent_Fctprintf (void(*out)(char character, void *arg), void *arg, const char *format,...)
 A modified version of printf, specially designed to handle message content.
 
int EZTR_MsgSContent_NoPipe_Printf (const char *format,...)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 
int EZTR_MsgSContent_NoPipe_PrintfLine (const char *format,...)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 
int EZTR_MsgSContent_NoPipe_Sprintf (char *buffer, const char *format,...)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 
int EZTR_MsgSContent_NoPipe_Snprintf (char *buffer, size_t count, const char *format,...)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 
int EZTR_MsgSContent_NoPipe_Vsnprintf (char *buffer, size_t count, const char *format, va_list va)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 
int EZTR_MsgSContent_NoPipe_Vprintf (const char *format, va_list va)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 
int EZTR_MsgSContent_NoPipe_Fctprintf (void(*out)(char character, void *arg), void *arg, const char *format,...)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 

Detailed Description

The main header for EZTR.

Version
2.1.0

Macro Definition Documentation

◆ EZTR_IMPORT

#define EZTR_IMPORT ( func)
Value:
func

◆ EZTR_MSG_CALLBACK

#define EZTR_MSG_CALLBACK ( fname)
Value:
void fname(EZTR_MsgBuffer* buf, u16 textId, PlayState* play)
A union of the three MsgBuffer structs, and the primary type for interacting with message data.
Definition eztr_api.h:373

A macro to easily create message callback functions.

This macro can be used to create both the function definition and declaration (if one is needed);

my_callback can then be passed to any EZTR_Basic_* function as the callback argument. my_callback will be run immediately after EZTR loads the message from its internal table, allowing you to make changes (or completely regenerate the message from scratch) before the message is displayed.

The function generated by this macro has 3 arguments:

  • EZTR_MsgBuffer* buf - A message buffer, prepopulated with a copy of whatever message you stored. Write to this buffer the change the message.
  • u16 textId - The textId of the message. Useful if you want multiple messages to be controlled by one callback function.
  • PlayState* play - The current PlayState for the game. This makes it easy to generate text based on the game's state.

◆ EZTR_NO_VALUE

#define EZTR_NO_VALUE   0xffff

Used by certain members of EZTR_MsgData (and the message header generally) to indicate that said member is not in use.

The header members in question are:

  • next_message_id
  • first_item_rupees
  • second_item_rupees

◆ EZTR_ON_DUMP_BUFFER

#define EZTR_ON_DUMP_BUFFER ( func_name)
Value:
RECOMP_CALLBACK("MM_EZ_Text_Replacer_API", EZTR_OnDumpBuffer) void func_name(const char* category, u16 textId, s32 len, EZTR_MsgBuffer* buf)

Used to declare a callback function for when EZTR dumps a message. Normally, EZTR only prints that message to the game console, but this callback will allow you to do other things with that information. This EZTR_ON_DUMP_BUFFER event is only called when EZTR's text dump setting is set to On.

This is a feature intended for developers, for the creation of EZTR-related tools. It should not be used for gameplay.

The functions parameters are

  • const char* category, currently only returns 'Game'.
  • u16 textId, the ID of the message being dumped.
  • s32 len, the size of the message in bytes.
  • EZTR_MsgBuffer* buf, the message buffer itself.

◆ EZTR_ON_DUMP_BUFFER_FULL

#define EZTR_ON_DUMP_BUFFER_FULL ( func_name)
Value:
RECOMP_CALLBACK("MM_EZ_Text_Replacer_API", EZTR_OnDumpBufferFull) void func_name(const char* category, u16 textId, s32 len, EZTR_MsgBuffer* buf)

Used to declare a callback function for when EZTR dumps the entire message buffer. Normally, EZTR only prints that message to the game console, but this callback will allow you to do other things with that information. This EZTR_ON_DUMP_BUFFER event is only called when EZTR's text dump setting is set to Full.

This is a feature intended for developers, for the creation of EZTR-related tools. It should not be used for gameplay.

The functions parameters are

  • const char* category, currently only returns 'Game'.
  • u16 textId, the ID of the message being dumped.
  • s32 len, the size of the message in bytes.
  • EZTR_MsgBuffer* buf, the message buffer itself.

◆ EZTR_ON_INIT

#define EZTR_ON_INIT   RECOMP_CALLBACK("MM_EZ_Text_Replacer_API", EZTR_OnInit)

Used to declare a function that should run after EZTR has finished initializing.

This is where you should declare all of your text replacements. You don't want to declare them during a recomp_on_init event, since EZTR may not have initialized itself yet, and attempting to declare text replacements before that will cause a crash. Additionally, declaring messaged here will ensure that mod priority order is respected when declaring replacements.

As of version 2.1.0, EZTR now enforces that message all calls to EZTR_Basic_* functions must be made here.

Example: EZTR_ON_INIT void declare_my_text() {...}