// simple GUI + variables for colored maptitles and other strings in Sauerbraten // by Papriko // variables strcolnames = [green blue yellow red gray purple orange white] maptitletemp = (concatword "^f" (rnd 8) "Foo") // a new command. replaces the old ugly variables strcol = [result (concatword "^f" $arg1)] // the GUI self newgui maptitlecolor [ guistayopen [ // the input field guitext "Enter your new maptitle!" guifield maptitletemp -90 // the color buttons guilist [ loop i (listlen $strcolnames) [ guibutton (concatword "^f" $i (at $strcolnames $i) " ") [maptitletemp = (concatword $maptitletemp "^f" @i)] ] ] // button to set the title actually guibutton "Apply to map" [maptitle $maptitletemp] // reads the current maptitle and brings it back to the input field. during some tests of the previous version did this feature turn out to be damn useful guibutton "Read in the current maptitle" [maptitletemp = $maptitle] // clears the input field entirely guibutton "Clear input field" [maptitletemp = ""] // a small gag guibutton "^f0M^f1A^f2D^f3N^f4E^f5S^f6S" [maptitletemp = (concatword "^f" (rnd 8) "M" "^f" (rnd 8) "A" "^f" (rnd 8) "D" "^f" (rnd 8) "N" "^f" (rnd 8) "E" "^f" (rnd 8) "S" "^f" (rnd 8) "S")] //previews guibar guitext "Current Maptitle: " guitext $maptitle guitext "New Maptitle: " guitext $maptitletemp // lots of blabla guitab about guititle (concatword (strcol 3) "Color" (strcol 4) "-" (strcol 1) "GUI " (strcol 4) "by " (strcol 0) "Papriko") guititle (concat (strcol 4) Version 1.1) guitext "A simple GUI to give the maptitle different colors." guitext "It is pretty easy to use. First press the button of the color you want, then type text." guitext "Repeat this with as many colors as you want." guitext "The MADNESS button is just fun, feel free to play around with it." guibar guitext "An alternative you can use now for coloring strings is the command strcol:" guitext "Simply use concat or concatword and add strcol with the ID of your color" guitext "Example: string = (concat (strcol 1) Oooohhh, so pretty!)" guitext (concat "You get:" (strcol 1) "Oooohhh, so pretty!") guitext "The color IDs are from 0 to 7. They have the same order as the buttons on the other page of this window." ] ] // bind it to F8 bind F8 [showgui maptitlecolor] editbind F8 [showgui maptitlecolor] echo "The color-GUI for maptitles has been bound to F8 and the color variables are initialized"