You are viewing a potentially older version of this package.
View all versions.
EZ Text Replacer API
Helps modders with text replacement.
| Date uploaded | a year ago |
| Version | 1.1.0 |
| Download link | LT_Schmiddy-EZ_Text_Replacer_API-1.1.0.zip |
| Downloads | 97 |
| Dependency string | LT_Schmiddy-EZ_Text_Replacer_API-1.1.0 |
README
EZ Text Replacer API
This is an API for modders that enables easily replacing in-game text and dialog.
For example, the following code is used to replace the all dialog related the Razor Sword's breaking after 100 uses.
#include "eztr_api.h"
EZTR_ON_INIT void replace_msgs() {
EZTR_Basic_ReplaceText(
0x0038,
EZTR_STANDARD_TEXT_BOX_I,
1,
EZTR_ICON_RAZOR_SWORD,
EZTR_NO_VALUE,
EZTR_NO_VALUE,
EZTR_NO_VALUE,
true,
"|17Your Kokiri Sword has been|11strengthened and forged into a|11|01Razor Sword|00!|18|11|12This new, sharper blade is a cut|11above the rest!|BF"
);
EZTR_Basic_ReplaceText(
0x0C3B,
EZTR_STANDARD_TEXT_BOX_I,
49,
EZTR_ICON_NO_ICON,
EZTR_NO_VALUE,
100,
EZTR_NO_VALUE,
true,
"All right...To |01reforge |00your sword,|11it will cost you |06100 Rupees|00. It'll|11be ready at |01sunrise.|11|00|12|17You'll have to let us hold onto|11your sword until then.|10So, would you like your sword|11reforged for |06100 Rupees|00?|11|02|C2I'll do it|11No thanks|BF|00|00"
);
EZTR_Basic_ReplaceText(
0x0C51,
EZTR_STANDARD_TEXT_BOX_I,
48,
EZTR_ICON_NO_ICON,
EZTR_NO_VALUE,
EZTR_NO_VALUE,
EZTR_NO_VALUE,
true,
"Now here's a secret...If you bring|11me |01gold dust|00, I'll be able to make|11it the |01strongest sword |00around.|10You got that? |01Gold dust|00!|19|BF|00"
);
EZTR_Basic_ReplaceText(
0x1785,
EZTR_STANDARD_TEXT_BOX_II,
1,
EZTR_ICON_RAZOR_SWORD,
EZTR_NO_VALUE,
EZTR_NO_VALUE,
EZTR_NO_VALUE,
true,
"|04Razor Sword|11|00The Kokiri Sword reforged at the|11smithy. A cut above the rest.|BF"
);
}
To use this API in your own projects, include MM_EZ_Text_Replacer_API:1.1.0 as a dependency in your mod.toml,
and download the API header from GitHub here.
More detailed usage instructions can be found on GitHub here.
The API is fairly simple at the moment, but will be expanded in future updates. Planned features include:
- Dynamic message replacement.
- Support for adding new message entries.
- Callbacks at message load time.
- Message header manipulation.
- and more!
CHANGELOG
Changelog
2.2.0
- Adding printf functionality to all
ReplaceTextAPI functions. - Adding new, custom printf type specifiers
%%M,%%q, and%%w - Message dumping now handles argument bytes correctly.
- Adding the
WArgmacros to the API header.
2.1.0
- All
EZTR_Basic_*calls are required to be made during theEZTR_ON_INITevent. - Added the ability to dump text in the format of an
EZTR_Basic_ReplaceTextfunction call. - Improved the
\x__byte formatting options to be usable without compilation issues. - Non-printable bytes can now be dumped to use the corresponding
EZTR_CC_*macro (when available). - Added the
EZTR_ON_DUMP_BUFFERandEZTR_ON_DUMP_BUFFER_FULLevents. - Adding a
Fulldumping option.
2.0.1
- Fixed a memory leak when replacing a message that already has an entry in the MsgTable.
- Removes version numbers from mod filename.
v2.0.0
- Adds dynamically generates messages using a callback system.
- Adds Support for adding new message entries. Use EZTR to quickly implement additional dialog for your mods.
- Adds Tools and functions for and generating manipulating message strings, including a specialized version of the
printffamily of functions. - (BREAKING) All replacement functions now include a field for callback. Set to NULL if no callback is used.
1.1.0
- Initial Public Release
- Only supports basic replacements.