Well good news for you! Because today we
dealing with line breaks. A sort of intermezzo if you will. Line breaks are a pain in the butt cheeks, because there seems to be no rhyme or reason to their existence. You can change the words before the line break and it will disappear. Okay, seems logical enough. You can add words after the line break and it will disappear. Okay, what? And until one of Ame's patreons looked into things, you could do nothing and they would randomly appear and disappear. RMXP are you drunk? When doing our optimization run (ha! still talking about optimization) I noticed something which I would've bet was the cause.
Dear reader, always bet against me, for I was wrong.
And then I found a line break while playing. And another. And yet one more. Time to actually look into things. After putting print statements down like no tomorrow, the following conversation between me and essentials happened:
See, the function in question is getFormattedText. And this function is over-engineered like no tomorrow. Want to left-align stuff? seems logical. Want to right or center align, this function got your back. Want to use the weirdest font you can find? No problem for this badboy. Want to add Icons? Make only one line right align? Okay please slow down. Color certain words? Add your own line breaks? A second way to add Icons?
Want to try splitting the text? No, stop!
And that one is the problem. getFormattedText decides to rerun itself when a condition is met. What that condition exactly entails, I still don't know. But to spice things up, getFormattedText quickly adds a \n in the middle of the string. Which in ruby is syntax for: start a new line. And when it is rerun, it starts another new line right before the word after which the \n is placed.
That part of the function has officially been yeeted. We now are free
all this time of suffering.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.