// simple GUI + variables for colored maptitles and other strings in Sauerbraten // by Papriko // variables strgreen = "^f0" strblue = "^f1" strorange = "^f2" strred = "^f3" strgray = "^f4" strpurple = "^f5" strdkorange = "^f6" strwhite = "^f7" maptitletemp = (concatword "^f" (rnd 8) "Foo") // the GUI self newgui maptitlecolor [ guistayopen [ // clear button guibutton "Clear the input field" [maptitletemp = ""] // the input field guitext "Enter your new maptitle!" guifield maptitletemp 90 [$maptitletemp =] // the color buttons guilist [ guibutton "^f0green " [maptitletemp = (concatword $maptitletemp $strgreen)] guibutton "^f1blue " [maptitletemp = (concatword $maptitletemp $strblue)] guibutton "^f2orange " [maptitletemp = (concatword $maptitletemp $strorange)] guibutton "^f3red " [maptitletemp = (concatword $maptitletemp $strred)] guibutton "^f4gray " [maptitletemp = (concatword $maptitletemp $strgray)] guibutton "^f5purple " [maptitletemp = (concatword $maptitletemp $strpurple)] guibutton "^f6dark orange " [maptitletemp = (concatword $maptitletemp $strdkorange)] guibutton "^f7white " [maptitletemp = (concatword $maptitletemp $strwhite)] ] // 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")] // button to set the title actually guibutton "Apply to map" [maptitle $maptitletemp] //previews guibar guitext "Current Maptitle: " guitext $maptitle guitext "New Maptitle: " guitext $maptitletemp // lots of blabla guitab about guititle (concatword $strred "Color" $strgray "-" $strblue "GUI " $strgray "by " $strgreen "Papriko") 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. Just remember that the input field is limited to" guitext "90 digits and every color, even when you don't see it, costs you 2." 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 are 8 new variables:" guitext "strgreen, strblue, strorange, strred, strgray, strpurple, strdkorange and strwhite." guitext "Simply add them via concat or concatword." guitext "Example: string = (concat $strblue Oooohhh, so pretty!)" guitext (concat "You get:" $strblue Oooohhh, so pretty!) guitext "This also avoids the 90-digit-limit mentioned before when you use it in combination with /maptitle." ] ] // 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"