If it finds the k rule, it will also apply the obfuscate function. This function creates a span element for each string it is given. Also in the second loop, the strings are sent to the appl圜ode function, which applies the codes given to it (through an array), with the help of the styleMap.It splits the string into parts, in accordance to the start of one code and the start of another, so that each part can be styled individually, with its own rules.It pushes the indexes of where those codes are in the string into an array, and replaces each code with a double \x00 (null char), in order to handle repetition of codes in later parts of the string (see the first for loop).It looks for all codes in the string with a regex that matches them (see the very first line in the parseStyle function).My code so far: (First one's fine, second one's messed up.) Since my code is too big, I have it posted on JSFiddle. So the question is, how would I do this? Finding where the color codes end and so on.Ĭolor Codes for Minecraft is available here: This did not work however, because when you have a color code straight before a formatting code, it becomes. I did manage halfway, by replacing all color codes with and replacing all formatting codes with Now, because the Minecraft Color Codes do not state where the color codes end, I don't know exactly how I could translate this into HTML. So basically, there are color codes, which change the color of the text onwards, and formatting codes, which change the formatting of the text onwards. ![]() A Minecraft MOTD is basic text, with Minecraft Color Codes to represent color changes.Įxample: "§d§lThe Nexus§8: §6§oO_O §a§l" Recently, I was trying to convert Minecraft MOTD into Plain HTML.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |