The algorithm for GUI is to get the lowest non-zero number of spaces in the beginning of the lines and considering that to be one tab. On each line, you would loop through all the tabs and if the current tab happens to be the last one before the actual text, you would create a
Sometimes, you have to use a
if the line has the keywords Events, If, Then, etc...
And you'd have to register a click event. When it's clicked, you would change it to
Note: If there's nothing within that block, you would just use a
Whenever you encounter a keyword in the beginning of the line, you would place an image corresponding to that key.
Set corresponds to
, Unit corresponds to
, etc...
Eventually, you'd have to loop vertically to see if any
need to be placed. If you ever have a
or a
, you would have to place one
while making sure that the tab index for each of the images is the same. (But since you're iterating vertically, you wouldn't have to do that.)
There are other things of course, but I'm not giving you a full algorithm because that would be taking the fun out of it
As for Jass, you would just need to search for keywords and color or bold-face them after creating a white background.
I came up with the GUI algorithm myself ^^