// generates the FAQ menu available from the first run menu or the help menu
persistidents 0

faqQuestions = [
  "What is the fastest way to get help/support for AssaultCube?"
  "How do I determine what version of AssaultCube I have installed?"
  "How do I check for updates for AssaultCube?"
  "How do I load my map in coop-edit mode?"
  "How do I enter edit mode?"
  "How do I switch to a different primary weapon?"
  "How do I report an abusive or cheating player?"
  "Where is the licensing information?"
]

faqAnswer_1 = [
  "Make an account on the AssaultCube forum and post a new thread in the Help section."
  "Alternatively, you can try getting help on the AssaultCube IRC channel."
  "Whatever method you decide to use, please be patient for assistance."
  ""
  "Links:"
  "http://forum.cubers.net - AssaultCube Forum"
  "http://assault.cubers.net/irc.html - AssaultCube IRC"
]

faqAnswer_2 = [
  "Your AssaultCube version can be determined by launching the game and executing"
  "the /version command. It should output a 4 digit number such as 1104 -"
  "this would indicate that you have AssaultCube version 1.1.0.4 installed."
]

faqAnswer_3 = [
  "Using the information that you received from executing the /version command"
  "(see FAQ #2) - you can visit the AssaultCube download page and verify that"
  "you have the current version."
  ""
  "Links:"
  "http://assault.cubers.net/download.html - Download AssaultCube"
]

faqAnswer_4 = [
  "The Cube engine makes it easy for multiple people to make a map at the same"
  "time. This is called coop-edit mode. If you want to make a map in coop-edit"
  "mode use the following steps:"
  ""
  "#1: Use the /newmap command to create a new map."
  "#2: Use the /savemap command to save the map, be sure to give it a unique name."
  "#3: Connect to a server that allows map uploads and coop-edit."
  "#4: Upload the new map to the server by using the /sendmap command."
  "#5: Use the /coop command to load your map in coop-edit mode."
  "#6 Enter edit mode and start mapping. Use the autosavemap feature or use /savemap often."
  ""
  "If you just want to load a existing map on the server in coop-edit mode, see step #5."
]

faqAnswer_5 = [
  "By default, if you are in a singleplayer mode or coop-edit mode, the E key will"
  "toggle you in and out of edit mode. Edit mode allows you to execute map editing"
  "functions and manipulate map geometry. If all else fails, you can always execute"
  "the /edittoggle command to toggle in and out of edit mode."
]

faqAnswer_6 = [
  "By default, the B key will show the primary weapon change menu. If all else fails,"
  "you can always execute /showmenu Weapons - as a command. Note that the W on weapons"
  "is capitalized."
]

faqAnswer_7 = [
  "Make an account on the AssaultCube forum and make a new post in the blacklist thread."
  "Please take the time to read and understand how you should format your blacklist report."
  "Proper format and evidence (screenshots/demos/logs) are required."
  ""
  "Links:"
  "http://forum.cubers.net/thread-1.html - AssaultCube Blacklist Report Thread"
]

faqAnswer_8 = [
  "AssaultCube and its resources are pieced together and developed by various people"
  "throughout the world. While the source code is open source and released under a zlib"
  "license, the majority of the media found in the AssaultCube package are released under"
  "different licenses. Please read and understand the various licenses before"
  "modifying or redistributing media within AssaultCube or the AssaultCube package"
  "as a whole."
  ""
  "Links:"
  "http://assault.cubers.net/docs/license.html - AssaultCube Licensing Information"
]

genFaq = [
  loop i (listlen $faqQuestions) [    
    if (= (mod $i 2) 0) [
      menuitem (concatword (yellow) (format [#%1: ] (+ $i 1)) (at $faqQuestions $i)) -1
    ] [
      menuitem (concatword (c D) (format [#%1: ] (+ $i 1)) (at $faqQuestions $i)) -1
    ]
    
    tmpMenuAlias = (getalias (format faqAnswer_%1 (+ $i 1)))
    loop o (listlen $tmpMenuAlias) [
      if (strstr (at $tmpMenuAlias $o) "http://") [
        menuitem (concatword [   ] (blue) (at $tmpMenuAlias $o)) -1
      ] [
        menuitem (concatword [   ] (white) (at $tmpMenuAlias $o)) -1
      ]
    ]
    menuitem "" -1
  ]
]

newmenu faq
genFaq
menuitem [] -1
menuitem [     Close] [ closemenu faq ]

persistidents 1
