menus_multiplayer.cfg 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. // Decides whether to open the admin or normal in-game menu.
  2. const ingamemenu [ if (player1 role) [ showmenu [In-game admin] ] [ showmenu In-game ] ]
  3. const ifauthsetup [
  4. if (authsetup) [
  5. $arg1
  6. ] [
  7. checkaccount
  8. ]
  9. ]
  10. // "Join server" menu.
  11. personalserverlist = []
  12. const joinservermenu [
  13. searchlan 1
  14. showallservers 1
  15. showonlyfavourites 0
  16. updatefrommaster
  17. personalserverlist
  18. showmenu server
  19. ]
  20. const joinlanservermenu [
  21. searchlan 2
  22. showallservers 0
  23. showonlyfavourites 0
  24. showmenu server
  25. ]
  26. const customconnectmenu [ showmenu [Custom connect] ]
  27. const adminconnectmenu [ showmenu [Admin connect] ]
  28. // Common parts of in-game menus
  29. tempalias __ingamemenu_1 [
  30. push t (player1 team)
  31. menuitemtextinput "Nickname: " "result $curname" [ name $arg1 ]
  32. menuitem "Change weapon\i\3" [ showmenu Weapons ] [ __ingamemenu_showmodel 0 ]
  33. menuitem "Change player skin\i\3" [showmenu @(at [CLA RVSF CLA RVSF ANY ANY ANY] (&b $t 1))] [ __ingamemenu_showmodel 1 ]
  34. menuitem "Change to the enemy team" changeteam [ __ingamemenu_showmodel 0 ]
  35. menuitem [Change to @(at "spectate active" (> $t 1)) mode] spectate
  36. pop t
  37. ]
  38. tempalias __ingamemenu_2 [
  39. menuitem "Get additional server information" [ showmenu serverinfo ]
  40. menuitem "Download a demo\i\3" [ listdemos; showmenu [Download demo] ]
  41. menuitem "" -1
  42. menuitem "\f4Main menu\i\3" [ closecurmenu; showmenu main ]
  43. menuitem "\f4Browse servers\i\3" [ closecurmenu; ifauthsetup joinservermenu ]
  44. menuitem "\f3Disconnect from server" disconnect
  45. menuitem "\f3Quit AssaultCube" quit
  46. ]
  47. const __ingamemenu_showmodel [
  48. if (&& (< (player1 team) 4) $arg1) [
  49. menumdl (curmenu) [playermodels/@(at [CLA RVSF CLA RVSF] (player1 team))/0@(+ 1 (player1 skin))] idle 15 3
  50. ] [
  51. menumdl (curmenu)
  52. ]
  53. ]
  54. //// In-Game //// (Normal in-game menu that opens when pressing escape and connected to a game.)
  55. newmenu [In-game]
  56. menuinit [
  57. resetcurmenu
  58. __ingamemenu_1
  59. menuitem "" -1
  60. menuitem "Set mode/map\i\3" [ showmenu Gamemode ]
  61. // menuitem "Kick/ban player\i\3" [ showmenu kick/ban ] // only noobish vote abusers use this, if you really want it, just uncomment
  62. menuitem "Ignore/Unignore all\i\3" [ if $ingall [ unignoreall ] [ ignoreall ] ]
  63. menuitem "Adjust teams\i\3" [ showmenu [Team adjustment] ]
  64. __ingamemenu_2
  65. ]
  66. menuinitselection 13
  67. //// In-Game admin //// (In-game menu that opens if when you press escape if you're admin state and connected to a game.)
  68. newmenu [In-game admin]
  69. menuinit [
  70. resetcurmenu
  71. menuitem "Set mode/map\i\3" [ showmenu Gamemode ]
  72. menuitem "Kick/ban player\i\3" [ showmenu kick/ban ]
  73. menuitem "Adjust teams\i\3" [ showmenu [Team adjustment] ]
  74. menuitem "Change mastermode\i\3" [ showmenu Mastermode ]
  75. menuitem "Change the server description\i\3" [ saycommand "/serverdesc " ]
  76. menuitem "Find a players IP address\i\3" [ saycommand "/whois " ]
  77. menuitem "Give admin\i\3" [ showmenu [give admin] ]
  78. menuitem "" -1
  79. __ingamemenu_1
  80. __ingamemenu_2
  81. ]
  82. menuinitselection 17
  83. //// In-Game > Gamemode ////
  84. newmenu Gamemode
  85. menuitem [Team Deathmatch] [ mode 0; showmenu maps_most ]
  86. menuitem [Deathmatch] [ mode 2; showmenu maps ]
  87. menuitem [Team Survivor] [ mode 4; showmenu maps_most ]
  88. menuitem [Survivor] [ mode 3; showmenu maps ]
  89. menuitem [Capture the Flag] [ mode 5; showmenu maps_flags ]
  90. menuitem [Hunt the Flag] [ mode 13; showmenu maps_most ]
  91. menuitem [Keep the Flag] [ mode 15; showmenu maps_flags ]
  92. menuitem [Team Keep the Flag] [ mode 14; showmenu maps_tktf ]
  93. menuitem [Team Pistol Frenzy] [ mode 16; showmenu maps_most ]
  94. menuitem [Pistol Frenzy] [ mode 6; showmenu maps ]
  95. menuitem [Team Last Swiss Standing] [ mode 17; showmenu maps_most ]
  96. menuitem [Last Swiss Standing] [ mode 9; showmenu maps ]
  97. menuitem [One Shot, One Kill] [ mode 10; showmenu maps ]
  98. menuitem [Team One Shot, One Kill] [ mode 11; showmenu maps_most ]
  99. menuitem [Cooperative Editing] [ mode 1; showmenu all_custom_maps ]
  100. //// In-Game > kick/ban ////
  101. newmenu kick/ban
  102. menuitem "Kick a player\i\3" [ _kickbanaction = kick; showmenu reason ]
  103. menuitem "Ban a player\i\3" [ _kickbanaction = ban; showmenu reason ]
  104. //menuitem "Kick a player" [ showmenu "kick player" ]
  105. //menuitem "Ban a player" [ showmenu "ban player" ]
  106. menuitem "Remove all bans" removebans
  107. //// In-Game > kick/ban > reason ////
  108. newmenu reason
  109. tempalias _kickbanaction kick
  110. menuinit [ _kickbanreason = None; if (! (strcmp $_kickbanaction kick)) [ if (! (strcmp $_kickbanaction ban)) [ _kickbanaction = ban ] ] ]
  111. menuitem [intentional TK] [ _kickbanreason = [intentional TK]; showmenu (concat $_kickbanaction player) ]
  112. menuitem [abusive behaviour] [ _kickbanreason = [abusive behaviour]; showmenu (concat $_kickbanaction player) ]
  113. menuitem [bad language] [ _kickbanreason = [bad language]; showmenu (concat $_kickbanaction player) ]
  114. menuitemtextinput [Reason: ] [] [ _kickbanreason = $arg1 ] [] 255
  115. menuitem $_kickbanaction [ showmenu (concat $_kickbanaction player) ]
  116. menuinitselection 2
  117. //// In-Game > kick/ban > reason > kick player ////
  118. //// In-Game > kick/ban > reason > ban player ////
  119. // hardcoded
  120. //// In-Game > Team adjustment ////
  121. newmenu [Team adjustment]
  122. menuitem [Initiate shuffleteams] shuffleteams
  123. menuitem [Force a team change] [ showmenu [force team] ]
  124. menuitem [Force yourself to enemy team] forceme
  125. menuitem [Initiate autoteam] [ showmenu Auto-team ]
  126. //// In-Game > Team adjustment > force team ////
  127. // hardcoded
  128. //// In-Game > Team adjustment > Auto-team ////
  129. newmenu Auto-team
  130. menuitem [Turn auto-team on] [ autoteam 1 ]
  131. menuitem [Turn auto-team off] [ autoteam 0 ]
  132. //// In-Game admin > Mastermode ////
  133. newmenu Mastermode
  134. menuitem [Unlock the server (open)] [ mastermode 0 ]
  135. menuitem [Lock the server (private)] [ mastermode 1 ]
  136. menuitem [Lock the server (match mode)] [ mastermode 2 ]
  137. //// In-Game admin > give admin ////
  138. // hardcoded
  139. //// Main > Multiplayer //// (Multiplayer menu only opens through the main menu (when disconnected).)
  140. newmenu multiplayer
  141. menuitem [Join a server] [ ifauthsetup joinservermenu ]
  142. menuitem [Join a LAN server] [ ifauthsetup joinlanservermenu ]
  143. menuitem [Custom connect] [ ifauthsetup customconnectmenu ]
  144. menuitem [Connect as Admin] [ ifauthsetup adminconnectmenu ]
  145. menuitem [] -1
  146. menuitem [Auth settings] [ showmenu [auth] ]
  147. menuitem [Force serverlist update] [ updatefrommaster 1; ifauthsetup joinservermenu ]
  148. //// Main > Multiplayer > Custom connect ////
  149. newmenu [Custom connect]
  150. menuinit [ tempalias cc1 []; tempalias cc2 []; tempalias cc3 [] ] // Resets the aliases
  151. menuitemtextinput "Server IP/DNS: \t\t" [] [ cc1 = $arg1 ] [] 255
  152. menuitemtextinput "Server port (optional): \t" [] [ cc2 = $arg1 ] [] 6
  153. menuitemtextinput "Server password (optional): \t" [] [ cc3 = $arg1 ] [] 128 1
  154. menuitem "" -1
  155. menuitem "\f2\t\t [ Connect ]\t\t\t" [ connect $cc1 $cc2 $cc3 ]
  156. //// Main > Multiplayer > Admin connect ////
  157. newmenu [Admin connect]
  158. menuinit [ tempalias acc1 []; tempalias acc2 []; tempalias acc3 []; echo "\f3To use this menu to connect as administrator, you will need to know the admin password for the server." ] // Resets the aliases
  159. menuitemtextinput "Server IP/DNS: \t\t" [] [ acc1 = $arg1 ] [] 255
  160. menuitemtextinput "Server port (optional):\t" [] [ acc2 = $arg1 ] [] 6
  161. menuitemtextinput "Server admin password: \t" [] [ acc3 = $arg1 ] [] 128 1
  162. menuitem "" -1
  163. menuitem "\f2\t\t [ Admin connect ]\t\t" [ connectadmin $acc1 $acc2 $acc3 ]
  164. //// Main > Multiplayer > server ////
  165. // hardcoded
  166. //// Main > Multiplayer > server > serverbrowser help ////
  167. newmenu [serverbrowser help]
  168. menuinitselection 1
  169. menuinit [
  170. resetcurmenu
  171. menuitem "F1: Display this help menu" -1
  172. menuitem "F3: Search for players by nickname\i\3" [ showmenu [search player] ]
  173. menuitem "Search for servers\i\3" [ showmenu [search server] ]
  174. menuitem "F4: Edit favourites\i\3" [ showmenu [edit favourites] ]
  175. menuitem "F5: Update the serverlist from the masterserver" [ updatefrommaster 1; closecurmenu ]
  176. menuitem "F9: Get additional server information\i\3" [ showmenu serverinfo ]
  177. menuitem "Edit alternative views in serverbrowser\i\3" [ showmenu [serverbrowser alternative views] ]
  178. menuitem "" -1
  179. menuitem "Options:" -1
  180. menuitemcheckbox "F6: Reverse the sort order:" "$serversortdir" [ serversortdir $arg1 ]
  181. menuitemcheckbox "F7: Only show good servers:" "$showonlygoodservers" [ showonlygoodservers $arg1 ]
  182. menuitemcheckbox "F8: Show minutes remaining:" "$showminremain" [ showminremain $arg1 ]
  183. menuitemcheckbox "Sort official maps ontop:" "$serversortpreferofficial" [ serversortpreferofficial $arg1 ]
  184. menuitemcheckbox "Use gamemode acronyms:" "$modeacronyms" [ modeacronyms $arg1 ]
  185. menuitemcheckbox "Show number of all players on the servers:" "$showallplayersnumber" [ showallplayersnumber $arg1 ]
  186. menuitemslider "Favourites tag column:\t" 0 2 "$serverbrowserhidefavtag" ["Show always" "Show when used" "Hide always"] [ serverbrowserhidefavtag $arg1 ] 1
  187. menuitemslider "Server IP & port:\t\t" 0 2 "$serverbrowserhideip" [Show "Show in grey" Hide] [ serverbrowserhideip $arg1 ] 1
  188. menuitemslider "Sort servers by:\t\t" 0 7 "$serversort" [Ping "Number of players" "Max players" "Minutes remaining" "Map name" Gamemode "IP address" "Server description"] [ serversort $arg1 ] 1
  189. if (strlen (listfavcats)) [
  190. menuitem "" -1
  191. menuitem "Keys to add/remove servers from categories:" -1
  192. looplisti (listfavcats) fav [
  193. if (< $i 10) [
  194. menuitem [@(+ $i 1): Toggle category @[sbfavourite_@[fav]_desc] @"<\fs"@[sbfavourite_@[fav]_tag]@"\fr>"] -1
  195. ]
  196. ]
  197. ]
  198. ]
  199. //// Main > Multiplayer > server > serverbrowser help > search player ////
  200. newmenu [search player]
  201. alias __lastsearchname ""
  202. menuitemtextinput "Search servers for a player: " "result $__lastsearchname" [ __lastsearchname = $arg1 ]
  203. menuitem "\f2\t\t [ Search ]" [ closecurmenu; searchnickname $__lastsearchname]
  204. menuinitselection 1
  205. //// Main > Multiplayer > server > serverbrowser help > search server ////
  206. newmenu [search server]
  207. menuitemtextinput " Search for server: " "result $sbfavourite_SEARCH_keys" [ sbfavourite_SEARCH_keys = $arg1 ]
  208. menuitem "\f2\t\t[ Search ]" [ showonlyfavourites (addfavcategory SEARCH); showmenu server ] [ showonlyfavourites 0 ]
  209. menuinitselection 1
  210. //// Main > Multiplayer > server > serverbrowser help > edit favourites ////
  211. tempalias __curfav 1
  212. newmenu [edit favourites]
  213. menuinit [
  214. resetcurmenu
  215. looplisti (listfavcats) fav [
  216. if (< $i 10) [
  217. menuitem [@(+ 1 (mod $i 10)): @[sbfavourite_@[fav]_desc] @"<\fs"@[sbfavourite_@[fav]_tag]@"\fr>"] [__curfav = @i; showmenu [edit favourites category]]
  218. ] [
  219. menuitem [@[sbfavourite_@[fav]_desc] @"<\fs"@[sbfavourite_@[fav]_tag]@"\fr>"] [__curfav = @i; showmenu [edit favourites category]]
  220. ]
  221. ]
  222. ]
  223. //// Main > Multiplayer > server > serverbrowser help > edit favourites > edit favourites category ////
  224. newmenu [edit favourites category]
  225. menuinit [
  226. resetcurmenu
  227. push fav (at (listfavcats) $__curfav)
  228. push n (+ 1 $__curfav)
  229. menuitem [Category #@n@", name: \f2"@fav] -1
  230. menuitem "" -1
  231. menuitemtextinput "Tag: " [escapenoquotes $sbfavourite_@[fav]_tag] [sbfavourite_@[fav]_tag = (at (addpunct $arg1) 0)] [] 15
  232. menuitemtextinput "Description: " [escapenoquotes $sbfavourite_@[fav]_desc] [sbfavourite_@[fav]_desc = (at (addpunct $arg1) 0)] [] 45
  233. menuitem "" -1
  234. menuitemslider "Background red: \t" 0 100 $[sbfavourite_@[fav]_red] 10 [sbfavourite_@[fav]_red = $arg1] 1
  235. menuitemslider "Background green:\t" 0 100 $[sbfavourite_@[fav]_green] 10 [sbfavourite_@[fav]_green = $arg1] 1
  236. menuitemslider "Background blue: \t" 0 100 $[sbfavourite_@[fav]_blue] 10 [sbfavourite_@[fav]_blue = $arg1] 1
  237. menuitemslider "Background alpha:\t" 0 100 $[sbfavourite_@[fav]_alpha] 10 [sbfavourite_@[fav]_alpha = $arg1] 1
  238. menuitem "" -1
  239. menuitemtextinput "Keyword list:" [result $sbfavourite_@[fav]_keys] [sbfavourite_@[fav]_keys = $arg1] [] 255
  240. menuitem "" -1
  241. menuitemtextinput "Weight:" [result $sbfavourite_@[fav]_weight] [sbfavourite_@[fav]_weight = $arg1] [] 10
  242. menuitem "" -1
  243. menuitemradio "" 0 1 $[sbfavourite_@[fav]_ignore] ["Enable this category " "Ignore this category"] [sbfavourite_@[fav]_ignore = $arg1]
  244. menuitem "" -1
  245. menuitem "Show servers of this category\i\3" [showonlyfavourites @n ; showmenu server] [ showonlyfavourites 0 ]
  246. pop fav n
  247. ]
  248. //// Main > Multiplayer > server > serverbrowser help > serverinfo ////
  249. // hardcoded
  250. //// Main > Multiplayer > server > serverbrowser help > serverbrowser alternative views ////
  251. newmenu [serverbrowser alternative views]
  252. menuitem "Alt + Mouse wheel (Alt + Up/Down) toggles views in serverbrowser." -1
  253. menuitem "" -1
  254. menuitemtextinput "Categories of favourites in alternative views: " [getalias serverbrowseraltviews] [alias serverbrowseraltviews $arg1] [] 255
  255. menuitem "(type just names of categories, and not tags)." -1
  256. menuinitselection 2
  257. // connecting from the serverbrowser to a password-protected server
  258. // called by sbconnect
  259. newmenu [password required]
  260. menuinit [
  261. resetcurmenu
  262. sbpwd = ""
  263. menuitem $sbmsg -1
  264. menuitem "You need a password to join it." -1
  265. menuitem "" -1
  266. menuitemtextinput "Password: \t" [] [ sbpwd = $arg1 ] [] 128 1
  267. menuitem "" -1
  268. menuitem "\f2\t\t [ Connect ]\t\t" [ echo connecting to $sbdesc ; connect $sbdns $sbport $sbpwd ]
  269. menuitem "\f2\t\t [ Connect without password ]\t\t" [ echo connecting to $sbdesc ; connect $sbdns $sbport ]
  270. menuinitselection 3
  271. ]
  272. newmenu getmap
  273. menuinit [
  274. resetcurmenu
  275. menuitem " This server is using a different version of this map..." -1
  276. menuitem "" -1
  277. menuitem $__getmaprevisions
  278. menuitem "" -1
  279. menuitem "\f2 [ Download the servers map version and join the game ]" [ getmap ]
  280. menuitem "\f3 [ Keep the local map version and disconnect from the server ]" [ showmenu ""; disconnect ]
  281. menuinitselection 4
  282. ]