Splitting (or getting a part of) OrderedText #3591
Unanswered
efekos
asked this question in
Mod Dev Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Hello. I wanted to make a TextComponentWidget, a widget that is basically a
TextFieldWidget
, but getsText
instead ofString
. I managed to make everything needed to make the widget function properly. Parsing looks good, preview looks good. But there is a tiny problem. I wanted to change the color of input shown at the text box, and I used render text provider for that. Here is the code:As you can see, I parse the entire input, and return it at display mode. But it turns out that I have to only include the part that
string
is. I tried parsingstring
instead of all the output, but it completely breaks the parser.I guess I have to split the
OrderedText
or make a sub text out of it. How do I do that? I never used anOrderedText
before, and I have no idea how can I do it.Beta Was this translation helpful? Give feedback.
All reactions