-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TextComponent: Completely rewrite + delete Message
The separation between TextComponent and Message was vague at best, and confusing at worst (as observed from questions in the Discord). To solve this, they are merged together into a single TextComponent class, and the API has been altered a bit. Specifically: - It is now very easy to iterate over the different parts (i.e. text + style) of a TextComponent. It implements List<NativeObject>, and the objects that are iterated are in the form "{ text: '...', bold: true, italic: true, ... }". - It is now immutable. To this end, there are helper methods that return modified version of the TextComponent, like withTextAt() that inserts a part at a given index. - The 'isFormatted' flag has been removed, and TextComponents are now always formatted. This flag had limited utility, as formatting codes can be stripped with ChatLib.removeFormatting, and they can also be escaped anywhere where formatted strings are accepted (i.e. "\&afoo"). Closes #93
- Loading branch information
Showing
13 changed files
with
552 additions
and
597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.