Getting Angular with it
As I am a frontend developer in my day job and angular is the weapon of choice in my team I started a little project using that language.
My goal was it to create a tool which automatically cuts and formats the exported data from Multipaint into a tileset dataset I can use in my games code.
So to start easy I just created a simple webform with two text areas, one for inputting the file and one for outputting the data. Going from here I wrote a simple parsing algorithm. Not very pretty but it gets the job done.
I attached the starting script to the input event of the text area in which the user is supposed to paste the data from the exported file.
I read the value from the event and split it at the ‘;’ character. Next I use that array to split the text into an array of lines. One for the bitmap data and two for the different colors for each cell.
Finally I arrange the bytes in a way that resembles the matrix of a strip.
For the colors I use a similar method. First I split the string at the blank so I get an array with just the byte word and one with just the data. I filter the byte part so I just get the data and join them with a comma and split the data again so I get an array of just the numbers.
To output the data I use an observable, so that any changes to the input data immediately updates the result.
I build the output string by iterating through the data arrays and inserting comments at appropriate positions. First the bitmap data followed by the appropriate two colors.