sr2lua/main_menu.lua

  1. MAIN_MENU_FIND_SERVER_CONTROL = 1100 
  2.  
  3. Main_menu_first_menu = "top" 
  4. Main_menu_screen_alpha = .8 
  5. -- load all assets needed to display everything up to and including the top main menu 
  6. -- this includes: loading, press start, and main menu 
  7. -- do nothing else, wait for call to main_menu_load_complete() to let you know when to transition 
  8. Main_menu_loading_friends_dialog_handle = 0 
  9.  
  10. Main_menu = {} 
  11.  
  12. Main_menu_syslink_server_data = {} 
  13.  
  14. FIND_SERVER_WIDTH = 375 
  15. FIND_SERVER_HEIGHT = 393 
  16. FIND_SERVER_MAX_ITEMS = 12 
  17. FIND_SERVER_SELECT_BAR_WIDTH = 350 
  18. Main_menu_press_start_peg = -1 
  19.  
  20. Multi_ranked = 0 
  21. loadFromCoop = false 
  22. search_type = 0 
  23. sort_by = 0 
  24. search_filter = "" 
  25.  
  26. Main_menu_searching_LAN_games = false 
  27. Main_menu_is_coop_game = false 
  28.  
  29. function Main_menu_LAN_find_game_PC() 
  30. 	Main_menu_showing_coop_games = false 
  31. 	Main_menu_syslink_server_data.num_items = 0 
  32. 	Main_menu_searching_LAN_games = true 
  33. 	Main_menu_is_coop_game = false 
  34. 	Multi_ranked = 0 
  35. 	vint_document_load("mp_server_browser") 
  36. 	--start_find_syslink_servers() 
  37. end 
  38.  
  39. function Main_menu_Online_find_game_PC() 
  40. 	Main_menu_showing_coop_games = false 
  41. 	Main_menu_syslink_server_data.num_items = 0 
  42. 	Main_menu_searching_LAN_games = false 
  43. 	Main_menu_is_coop_game = false 
  44. 	Multi_ranked = 0 
  45. 	vint_document_load("mp_server_browser") 
  46. 	--start_find_online_servers(0) 
  47. end 
  48.  
  49. function Main_menu_system_link_find_game_coop_PC() 
  50. 	Main_menu_showing_coop_games = true 
  51. 	Main_menu_syslink_server_data.num_items = 0 
  52. 	Main_menu_searching_LAN_games = true 
  53. 	Main_menu_is_coop_game = true 
  54. 	Multi_ranked = 0 
  55. 	vint_document_load("mp_server_browser") 
  56. 	--start_find_syslink_servers() 
  57. end 
  58.  
  59. function Main_menu_find_coop_online_menu_PC() 
  60. 	Main_menu_syslink_server_data.num_items = 0 
  61. 	Main_menu_showing_coop_games = false	 
  62. 	Main_menu_searching_LAN_games = false 
  63. 	Main_menu_is_coop_game = true 
  64. 	Multi_ranked = 0 
  65. 	vint_document_load("mp_server_browser") 
  66. 	--start_coop_matchmaking() 
  67. end 
  68.  
  69. function Main_menu_online_find_ranked_game_PC() 
  70. 	Main_menu_showing_coop_games = false 
  71. 	Main_menu_syslink_server_data.num_items = 0 
  72. 	Main_menu_searching_LAN_games = false 
  73. 	Main_menu_is_coop_game = false 
  74. 	Multi_ranked = 1 
  75. 	vint_document_load("mp_server_browser") 
  76. 	--start_find_online_servers(1) 
  77. end 
  78.  
  79. function Main_menu_LAN_find_game_setup_PC() 
  80. search_type = 1 
  81. Main_menu_server_filter.parent_menu = Menu_active 
  82. menu_show(Main_menu_server_filter, MENU_TRANSITION_SWAP) 
  83. end 
  84.  
  85. function Main_menu_Online_find_game_setup_PC() 
  86. search_type = 2 
  87. Main_menu_server_filter.parent_menu = Menu_active 
  88. menu_show(Main_menu_server_filter, MENU_TRANSITION_SWAP) 
  89. end 
  90.  
  91. function Main_menu_system_link_find_game_coop_setup_PC() 
  92. search_type = 3 
  93. Main_menu_server_filter.parent_menu = Menu_active 
  94. menu_show(Main_menu_server_filter, MENU_TRANSITION_SWAP) 
  95. end 
  96.  
  97. function Main_menu_find_coop_online_menu_setup_PC() 
  98. search_type = 4 
  99. Main_menu_server_filter_short.parent_menu = Menu_active 
  100. multi_change_game_type_filter(game_mode_values.cur_value) 
  101. menu_show(Main_menu_server_filter_short, MENU_TRANSITION_SWAP) 
  102. end 
  103.  
  104. function Main_menu_online_find_ranked_game_setup_PC() 
  105. search_type = 5 
  106. Main_menu_server_filter_short.parent_menu = Menu_active 
  107. game_mode_values.cur_value = 0 
  108. multi_change_game_type_filter(game_mode_values.cur_value) 
  109. menu_show(Main_menu_server_filter_short, MENU_TRANSITION_SWAP) 
  110. end 
  111.  
  112.  
  113. sort_by_values = { [0] = { label = "MULTI_SORT_BY_NAME", }, [1] = { label = "MULTI_SORT_BY_PING", },  cur_value = 0, num_values = 2 } 
  114.  
  115. function multi_change_sort() 
  116. 	sort_by = sort_by_values.cur_value 
  117. 	multi_change_sort_method(sort_by) 
  118. end 
  119.  
  120. function on_multi_change_name_filter(menu_label, menu_data) 
  121. 	menu_open_search_filter_window() 
  122. 	vint_dataresponder_request( "enter_login_PC_data_responder", "dummy_login_pc_func", 0 ) 
  123. 	if menu_open_enter_name_result() == 1 then 
  124. 		local entered_text = menu_open_enter_name_result_string(6) 
  125. 		if entered_text == nil then 
  126. 			entered_text = "" 
  127. 		end 
  128. 		vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", entered_text ) 
  129. 		search_filter = entered_text 
  130. 	end 
  131. 	menu_resize() 
  132. end 
  133.  
  134. function pc_multi_change_game_type_filter(menu_label, menu_data) 
  135. 	multi_change_game_type_filter(game_mode_values.cur_value) 
  136. end 
  137.  
  138. function main_menu_multi_apply_filter() 
  139. 	if search_type == 1 then 
  140. 		Main_menu_LAN_find_game_PC() 
  141. 	elseif search_type == 2 then 
  142. 		Main_menu_Online_find_game_PC() 
  143. 	elseif search_type == 3 then 
  144. 		Main_menu_system_link_find_game_coop_PC() 
  145. 	elseif search_type == 4 then 
  146. 		Main_menu_find_coop_online_menu_PC() 
  147. 	elseif search_type == 5 then 
  148. 		Main_menu_online_find_ranked_game_PC() 
  149. 	end 
  150. end 
  151.  
  152. function multi_build_search_filter() 
  153. 	sort_by = multi_get_sort_method(); 
  154. 	sort_by_values.cur_value = sort_by; 
  155. 	 
  156. 	local search_filter_text = menu_open_enter_name_result_string(6) 
  157. 	if search_filter_text == nil then 
  158. 			search_filter_text = "" 
  159. 		end 
  160. 	Main_menu_server_filter[0].info_text_str = search_filter_text 
  161.  
  162. end 
  163.  
  164. function main_menu_init() 
  165. 	 
  166. 	local language = get_language() 
  167. 	 
  168. 	peg_load("ui_load_main") 
  169. 	peg_load("ui_mainmenu") 
  170. 	peg_load("ui_multiplayer") 
  171. 	 
  172. 	Main_menu_press_start_peg  = "ui_mm_start_" .. language  
  173. 	peg_load(Main_menu_press_start_peg) 
  174. 	 
  175. 	--localize press start btn 
  176. 	local press_start_bmp = "ui_mainmenu_pres_start_" .. language  
  177. 	vint_set_property(vint_object_find("press_start_bmp"), "image", press_start_bmp) 
  178. 	vint_set_property(vint_object_find("press_start_bmp_highlight"), "image", press_start_bmp) 
  179. 	 
  180. 	--Platform filter for various things 
  181. 	if get_platform() == "PS3" then 
  182. 		--Hide Cellphone Sales for PS3 
  183. 		Main_menu_extras[1] = nil 
  184. 		Main_menu_extras.num_items = 1 
  185. 		 
  186. 		--Change Press Start Bitmap for PS3 to text because Sony Rules! 
  187. 		vint_set_property(vint_object_find("press_start_bmp"), "visible", false) 
  188. 		vint_set_property(vint_object_find("press_start_bmp_highlight"), "visible", false) 
  189. 		vint_set_property(vint_object_find("press_start_txt"), "visible", true) 
  190. 		 
  191. 		Main_menu_friends_tips = Main_menu_friends_tips_ps3 
  192. 	else 
  193. 		vint_set_property(vint_object_find("press_start_txt"), "visible", false) 
  194. 		--setup the show gamercard ability for 360 
  195. 		Main_menu_coop_join_player_menu.on_alt_select = main_menu_get_gamercard 
  196. 		Main_menu_coop_join_player_menu.btn_tips = Main_menu_friends_tips 
  197. 	end 
  198. 	 
  199. 	--Language Filter for wireless screens	 
  200. 	if language ~= "US" and language ~= "DE" and language ~= "FR" and language ~= "ES" and language ~= "UK" then 
  201. 		Main_menu_extras[1] = nil 
  202. 		Main_menu_extras.num_items = 1		 
  203. 	end 
  204. 	 
  205. 	--Initialize state 
  206. 	Main_menu.handles = {} 
  207. 	 
  208. 	Main_menu.handles.loading_grp = vint_object_find("loading_grp") 
  209. 	Main_menu.handles.main_menu_grp = vint_object_find("main_menu_grp") 
  210. 	Main_menu.handles.press_start_grp = vint_object_find("press_start_grp") 
  211. 	Main_menu.handles.ornate = vint_object_find("ornate") 
  212. 	Main_menu.handles.menu_screen = vint_object_find("main_menu_screen") 
  213. 	 
  214. 	--Logos 
  215. 	Main_menu.handles.logo_grp = vint_object_find("logo_sr2") 
  216. 	Main_menu.handles.logo_bling = vint_object_find("logo_bling", Main_menu.handles.logo_grp) 
  217. 	Main_menu.handles.logo_sr2 = vint_object_find("logo", Main_menu.handles.logo_grp) 
  218. 	Main_menu.handles.logo_jp = vint_object_find("logo_jp", Main_menu.handles.logo_grp) 
  219. 	Main_menu.handles.logo_sr2_ornate_left = vint_object_find("ornate_left", Main_menu.handles.logo_grp) 
  220. 	Main_menu.handles.logo_sr2_ornate_right = vint_object_find("ornate_right", Main_menu.handles.logo_grp) 
  221. 	 
  222. 	if get_language() == "JP" then 
  223. 		vint_set_property(Main_menu.handles.logo_jp, "visible", true) 
  224. 	else 
  225. 		vint_set_property(Main_menu.handles.logo_jp, "visible", false) 
  226. 	end 
  227. 	 
  228. 	--Menu Items (Where all the items go into 
  229. 	Main_menu.handles.menu_items = vint_object_find("menu_items") 
  230. 	 
  231. 	--Menu item 
  232. 	Main_menu.handles.menu_item = vint_object_find("menu_item") 
  233. 	vint_set_property(Main_menu.handles.menu_item, "visible", false) 
  234. 	 
  235. 	--Animations 
  236. 	Main_menu.anims = {} 
  237. 	 
  238. 	--Intro Anims 
  239. 	Main_menu.anims.intro_loading = vint_object_find("intro_loading_anim")							--Intro Loading 
  240. 	Main_menu.anims.intro_loading_fadeout = vint_object_find("intro_loading_fadeout_anim")		--Loading Fadeout 
  241. 	 
  242. 	Main_menu.anims.intro_logo = vint_object_find("intro_logo_anim")									--Intro Logo 
  243. 	Main_menu.anims.intro_ornate = vint_object_find("intro_ornate_anim")								--ornate 
  244. 	Main_menu.anims.intro_press_start = vint_object_find("intro_press_start_anim")				--Shows press start btn 
  245. 	Main_menu.anims.intro_menu  = vint_object_find("intro_menu_anim")									--Fades in the menu 
  246. 	Main_menu.anims.menu_screen_fade  = vint_object_find("menu_screen_fade_anim")					--Darkens main menu using black bitmap 
  247.  
  248. 	main_menu_pause_all_anims() 
  249. 	 
  250. 	vint_set_property(Main_menu.anims.intro_press_start, "is_paused", true) 
  251. 	 
  252. 	Main_menu.anims.text_item_deselect = vint_object_find("text_item_deselect") 
  253. 	Main_menu.anims.text_item_select = vint_object_find("text_item_select") 
  254. 	vint_set_property(Main_menu.anims.text_item_deselect, "is_paused", true) 
  255. 	vint_set_property(Main_menu.anims.text_item_select, "is_paused", true) 
  256.  
  257. 	--Main menu fade anim 
  258. 	Main_menu.anims.menu_screen_fade = vint_object_find("menu_screen_fade_anim") 
  259. 	Main_menu.anims.menu_screen_fade_twn = vint_object_find("main_menu_screen_alpha_twn_1", Main_menu.anims.menu_screen_fade) 
  260. 	 
  261. 	--Initialize bling 
  262. 	main_menu_bling_init() 
  263.  
  264. 	main_menu_visual_set("init") 
  265. 	 
  266. 	menu_set_custom_control_callbacks(Main_menu_controls) 
  267. 	 
  268. 	Pause_menu_return_to_main = main_menu_restore 
  269. 	Pause_menu_main_close_ref = main_menu_force_close 
  270. 	 
  271. 	-- prune all objects from pause menu doc to here 
  272. 	local pause_safe_frame_h = vint_object_find("safe_frame", nil, vint_document_find("pause_menu")) 
  273. 	local main_safe_frame_h = vint_object_find("safe_frame") 
  274. 	 
  275. 	local c = vint_object_first_child(pause_safe_frame_h) 
  276. 	 
  277. 	if c ~= nil then 
  278. 		while c ~= nil do 
  279. 			local n = vint_object_next_sibling(c) 
  280. 			vint_object_set_parent(c, main_safe_frame_h) 
  281. 			c = n 
  282. 		end 
  283. 	end 
  284. 	 
  285. 	if Main_menu_gameboot_complete == true then 
  286. 		--Game is already loaded, so we know we are coming from game.(no need to press start) 
  287. 		vint_set_property(Main_menu.handles.press_start_grp, "visible", false) 
  288. 		main_menu_load_complete(1) 
  289. 	else 
  290. 		main_menu_visual_set("start_load") 
  291. 	end 
  292. 	 
  293. 	if Main_menu_controller_selected == true then 
  294. 		main_menu_controller_selected() 
  295. 	end 
  296.  
  297. 	--	Initialize Main Menu button tips 
  298. 	 
  299. 	--Override button tips for main menu 
  300. 	BTN_TIPS_DEFAULT.b_button.label = "CONTROL_BACK" 
  301. 	Pause_save_load_btn_tips.b_button.label = "CONTROL_BACK" 
  302. 	 
  303. 	btn_tips_init() 
  304. 	 
  305. 	-- Set button tips to visible but hide the actual tips. 
  306. 	local menu_tips_h = vint_object_find("menu_tips", nil, MENU_BASE_DOC_HANDLE) 
  307. 	vint_set_property(menu_tips_h, "visible", true) 
  308. 	local menu_btn_tips_h = vint_object_find("menu_btn_tips", nil, MENU_BASE_DOC_HANDLE) 
  309. 	vint_set_property(menu_btn_tips_h, "alpha", 0) 
  310. 	 
  311. 	local tips_clip_h = vint_object_find("tips_clip", nil, MENU_BASE_DOC_HANDLE) 
  312. 	vint_set_property(tips_clip_h, "visible", false) 
  313. end 
  314.  
  315. function main_menu_cleanup() 
  316. 	main_menu_close_extra_screens(false) 
  317. 	peg_unload("ui_load_main") 
  318. 	peg_unload("ui_mainmenu") 
  319. 	peg_unload("ui_multiplayer") 
  320. 	peg_unload(Main_menu_press_start_peg) 
  321. end 
  322.  
  323. function main_menu_pause_all_anims() 
  324. 	vint_set_property(Main_menu.anims.menu_screen_fade, "is_paused", true) 
  325. 	vint_set_property(Main_menu.anims.intro_loading_fadeout, "is_paused", true) 
  326. 	vint_set_property(Main_menu.anims.intro_loading, "is_paused", true) 
  327. 	vint_set_property(Main_menu.anims.intro_logo, "is_paused", true) 
  328. 	vint_set_property(Main_menu.anims.intro_ornate, "is_paused", true) 
  329. 	vint_set_property(Main_menu.anims.intro_menu, "is_paused", true) 
  330. end 
  331.  
  332. -- if percent < 1 then update the loading progress indicator 
  333. -- otherwise transition to "press start..." 
  334. function main_menu_load_complete(percent) 
  335. 	if percent >= 1 then 
  336. 		main_menu_visual_set("load_to_start") 
  337. 	else 
  338. 		--Insert Percent into loading text 
  339. 		local values = {[0] = "GAME_LOADING", [1] = floor(percent*100)} 
  340. 		local str = vint_insert_values_in_string("{0} {1}%%%", values) 
  341. 		 
  342. 		vint_set_property(vint_object_find("mm_percent_complete"), "text_tag", str) 
  343. 	end 
  344. end 
  345.  
  346. -- called by C when a controller has been selected - you will get no input until after this stage 
  347. -- when called, transition to main menu 
  348. function main_menu_controller_selected() 
  349. 	Main_menu_controller_selected = true 
  350. 	menu_input_block(true) 
  351. 	main_menu_grab_input() 
  352. 	menu_init() 
  353. 	thread_new("main_menu_start") 
  354. 	menu_input_block(false) 
  355. end 
  356.  
  357. -- show main menu 
  358. function main_menu_start() 
  359. 	menu_input_block(true) 
  360. 	 
  361. 	pause_save_get_global_info(false)	-- this can block across frames 
  362.  
  363. 	Menu_swap_center = true			--Change menubase to use center swapping style 
  364. 	local active_frame = vint_object_find("main_menu_reg_pnt")		--Find point for centering menus 
  365. 	Menu_active_anchor_end_x, Menu_active_anchor_end_y = vint_get_property(active_frame, "anchor") 
  366. 	 
  367. 	--Build Main menu 
  368. 	main_menu_build(Main_menu_top) 
  369. 	 
  370. 	--Change visual state 
  371. 	main_menu_visual_set("start_to_main_menu") 
  372.  
  373. 	menu_input_block(false) 
  374. end 
  375.  
  376. function main_menu_close_extra_screens(staying_in_main_menu) 
  377. 	stop_mp_tutorial(staying_in_main_menu) 
  378. 	credits_force_close() 
  379. 	pause_menu_force_close_brightness_screen() 
  380. 	vint_document_unload(vint_document_find("mm_wireless")) 
  381. 	vint_document_unload(vint_document_find("mp_player_info_popup")) 
  382. 	vint_document_unload(vint_document_find("mp_leaderboards")) 
  383. 	vint_document_unload(vint_document_find("mp_lobby_players")) 
  384. end 
  385.  
  386. function main_menu_force_to_menu(menu_name) 
  387.  
  388. 	if Main_menu_controller_selected == false then 
  389. 		Main_menu_first_menu = menu_name 
  390. 	else 
  391. 		main_menu_close_extra_screens(true) 
  392. 		if menu_name == "top" then 
  393. 			if Main_menu_controller_selected == true then 
  394. 				menu_hide_active() 
  395. 				vint_set_property(vint_object_find("safe_frame"), "visible", true) 
  396. 				Main_menu_can_has_input = true 
  397. 				menu_input_block(false) 
  398. 				main_menu_screen_fade(0) 
  399. 			end 
  400. 			 
  401. 			main_menu_grab_input() 
  402. 			dialog_box_force_close_all() 
  403. 		elseif menu_name == "coop_load" then 
  404. 			credits_force_close() 
  405. 			Pause_load_is_coop = true 
  406. 			vint_set_property(vint_object_find("safe_frame"), "visible", true) 
  407. 			loadFromCoop = false 
  408. 			main_menu_load_menu_select() 
  409. 		elseif menu_name == "customize" then 
  410. 			vint_set_property(vint_object_find("safe_frame"), "visible", true) 
  411. 			main_menu_customize_menu_select() 
  412. 		end 
  413. 	end 
  414. end 
  415.  
  416. function main_menu_continue_success(s) 
  417. 	if s == "success" then 
  418. 		menu_close(main_menu_close_final) 
  419. 	elseif s == "new_game" then 
  420. 		main_menu_new_game_select() 
  421. 	end 
  422. end 
  423.  
  424. function main_menu_continue_select_deferred() 
  425. 	menu_input_block(true) 
  426. 	main_menu_release_input() 
  427. 	vint_dataresponder_request("save_load", "main_menu_continue_success", 0, "continue") 
  428. 	main_menu_grab_input() 
  429. 	menu_input_block(false) 
  430. end 
  431.  
  432. function main_menu_continue_select() 
  433. 	 
  434. 	if get_platform() == "PC" then 
  435. 		set_single_player(true) 
  436. 		 
  437. 		if is_connected_to_network() == true then 
  438. 			set_name_to_use(1) 
  439. 		else 
  440. 			set_name_to_use(0) 
  441. 		end 
  442. 	end 
  443.  
  444. 	mp_switch_modes(-1) 
  445.  
  446. 	thread_new("main_menu_continue_select_deferred") 
  447. end 
  448.  
  449. function main_menu_new_game_select() 
  450. 	 
  451. 	if get_platform() == "PC" then 
  452. 		set_single_player(true) 
  453. 		if is_connected_to_network() == true then 
  454. 			set_name_to_use(1) 
  455. 		else 
  456. 			set_name_to_use(0) 
  457. 		end 
  458. 		mp_switch_modes(-1) 
  459. 	end 
  460.  
  461. 	vint_dataresponder_request("main_menu_responder", "", 0, "new_game") 
  462. end 
  463.  
  464. function main_menu_close_final() 
  465. 	vint_document_unload(vint_document_find("main_menu")) 
  466. end 
  467.  
  468. function main_menu_show_mp_live() 
  469. 	vint_set_property(vint_object_find("safe_frame"), "visible", false) 
  470. 	vint_dataresponder_request("main_menu_responder", "", 0, "show_temp_mp") 
  471. end 
  472.  
  473. function main_menu_show_mp_syslink() 
  474. 	vint_set_property(vint_object_find("safe_frame"), "visible", false) 
  475. 	vint_dataresponder_request("main_menu_responder", "", 0, "show_temp_syslink") 
  476. end 
  477.  
  478. -- called by C to tell you to close 
  479. function main_menu_force_close() 
  480. 	main_menu_btn_tips_show(false) 
  481. 	menu_close(main_menu_close_final)	 
  482. end 
  483.  
  484. function main_menu_customize_menu_select() 
  485. 	main_menu_release_input() 
  486. 	 
  487. 	--Darken main menu 
  488. 	main_menu_screen_fade(Main_menu_screen_alpha) 
  489. 	 
  490. 	menu_show(Main_menu_cuztomize_mp_player, MENU_TRANSITION_SWAP) 
  491. 	 
  492. 	--setup menu tree, hacky 
  493. 	if get_platform() == "PS3" then 
  494. 		Main_menu_cuztomize_mp_player.parent_menu = Main_menu_ps3_online 
  495. 		Main_menu_ps3_online.parent_menu = Main_menu_multiplayer_ps3 
  496. 	else 
  497. 		Main_menu_cuztomize_mp_player.parent_menu = Main_menu_online_pc 
  498. 		Main_menu_online_pc.parent_menu = Main_menu_multiplayer_pc 
  499. 	end 
  500. end 
  501.  
  502. function main_menu_load_menu_select() 
  503.  
  504. 	if get_platform() == "PC" then 
  505. 		if loadFromCoop == true then 
  506. 			set_single_player(false) 
  507. 		else 
  508. 			set_single_player(true) 
  509. 		end 
  510. 		 
  511. 		if is_connected_to_network() == true then 
  512. 			set_name_to_use(1) 
  513. 		else 
  514. 			set_name_to_use(0) 
  515. 		end 
  516. 		 
  517. 		mp_switch_modes(-1) 
  518. 	end 
  519.  
  520. 	Pause_load_menu.parent_menu = Menu_active 
  521. 	if Main_menu_can_has_input == true or Menu_active == Pause_load_menu then 
  522. 		Pause_load_menu.on_back = main_menu_load_back_restore 
  523. 	else 
  524. 		Pause_load_menu.on_back = main_menu_load_back_parent 
  525. 	end 
  526. 	main_menu_release_input() 
  527.  
  528. 	pause_load_menu_select() 
  529. end 
  530.  
  531. function main_menu_load_coop_online() 
  532. 	Pause_load_from_menu = PAUSE_LOAD_FROM_MENU_COOP_ONLINE 
  533. 	loadFromCoop = true 
  534. 	main_menu_load_menu_select() 
  535. end 
  536.  
  537. function main_menu_load_coop_syslink() 
  538. 	Pause_load_from_menu = PAUSE_LOAD_FROM_MENU_COOP_SYSLINK 
  539. 	loadFromCoop = true 
  540. 	main_menu_load_menu_select() 
  541. end 
  542.  
  543. -- called by system to activate attract mode 
  544. function main_menu_attract_mode(active) 
  545. 	--Hides/shows main menu based on active flag 
  546. 	vint_set_property(vint_object_find("safe_frame"), "visible", active == false) 
  547. 	 
  548. 	--Button Tips 
  549. 	local menu_tips_h = vint_object_find("menu_tips", nil, MENU_BASE_DOC_HANDLE) 
  550. 	vint_set_property(menu_tips_h, "visible", active == false) 
  551. 	menu_input_block(active) 
  552. end 
  553.  
  554. function main_menu_tutorial_mode(active) 
  555. 	--Hides/shows main menu based on active flag 
  556. 	vint_set_property(vint_object_find("safe_frame"), "visible", active == false) 
  557. 	 
  558. 	--Button Tips 
  559. 	local menu_tips_h = vint_object_find("menu_tips", nil, MENU_BASE_DOC_HANDLE) 
  560. 	vint_set_property(menu_tips_h, "visible", active == false) 
  561. end 
  562.  
  563. function main_menu_roll_credits(menu_label, menu_data) 
  564. 	credits_roll_credits() 
  565. end 
  566.  
  567. function Main_menu_online_logout() 
  568. 	mp_online_logout() 
  569. 	main_menu_restore() 
  570. end 
  571.  
  572. function main_menu_wireless(menu_label, menu_data) 
  573. 	menu_input_block(true) 
  574. 	vint_document_load("mm_wireless") 
  575. end 
  576.  
  577. function main_menu_wireless_complete() 
  578. 	menu_input_block(false) 
  579. end 
  580.  
  581. --[[ Main menu building ]]-- 
  582. Main_menu_styles = { 
  583. 	highlight_tint = { r = 0.8980, g = 0.7490, b = 0.054}, 
  584. 	normal_tint = { r = 0.6314, g = 0.6314, b = 0.634}, 
  585. 	highlight_scale = 1, 
  586. 	normal_scale = .8, 
  587. 	glow_highlight_alpha = .35, 
  588. 	glow_normal_alpha = 0, 
  589. } 
  590.  
  591. function main_menu_build(menu) 
  592. 	local menu_grp = vint_object_find("menu_items", Main_menu.handles.main_menu_grp) 
  593. 	local pos_y = -2 
  594. 	 
  595. 	local text_width, text_height, width, height, x, y 
  596. 	local menu_item_h, text_h, glow_h 
  597. 	local glow_left_h, glow_right_h, glow_mid_h 
  598. 	 
  599. 	-- clean the old elements out 
  600. 	local o = vint_object_first_child(menu_grp) 
  601. 	local o2 
  602. 	while o ~= nil do 
  603. 		o2 = vint_object_next_sibling(o) 
  604. 		vint_object_destroy(o) 
  605. 		o = o2 
  606. 	end 
  607. 	 
  608. 	-- populate 
  609. 	local item_num = 0 
  610. 	 
  611. 	--Use continue? 
  612. 	if Pause_save_global_info.continue_avail == true then 
  613. 		Main_menu_top.current_selection = 0 
  614. 	else 
  615. 		Main_menu_top.current_selection = 1 
  616. 	end 
  617.  
  618. 	-- add continue item 
  619. 	menu[item_num] = Main_menu_master[0] 
  620. 	item_num = item_num + 1 
  621. 	 
  622. 	--Populate rest of items 
  623. 	for i = 1, Main_menu_master.num_items - 1 do 
  624. 		menu[item_num] = Main_menu_master[i] 
  625. 		item_num = item_num + 1 
  626. 	end 
  627. 	 
  628. 	menu.num_items = item_num 
  629. 	 
  630. 	--Build Elements 
  631. 	for i = 0, menu.num_items - 1 do 
  632.  
  633. 		--Clone menu items 
  634. 		menu_item_h = vint_object_clone(Main_menu.handles.menu_item) 
  635. 		vint_object_set_parent(menu_item_h, Main_menu.handles.menu_items) 
  636. 		 
  637. 		--Find elements within item to manipulate 
  638. 		text_h = vint_object_find("item_text", menu_item_h) 
  639. 		glow_h = vint_object_find("item_glow", menu_item_h) 
  640. 		 
  641. 		--Set Text 
  642. 		vint_set_property(text_h , "text_tag", menu[i].label) 
  643. 		 
  644. 		--Rescale Glow 
  645. 		glow_left_h = vint_object_find("glow_left", glow_h) 
  646. 		glow_right_h = vint_object_find("glow_right", glow_h)  
  647. 		glow_mid_h = vint_object_find("glow_mid", glow_h) 
  648. 		 
  649. 		text_width, text_height = element_get_actual_size(text_h) 
  650. 		width, height = element_get_actual_size(glow_mid_h) 
  651. 		text_width = text_width - 20 
  652. 		 
  653. 		element_set_actual_size(glow_mid_h, text_width, height) 
  654. 		x, y = vint_get_property(glow_mid_h, "anchor") 
  655. 		vint_set_property(glow_left_h, "anchor", -text_width/2, y) 
  656. 		vint_set_property(glow_right_h, "anchor", text_width/2, y) 
  657. 		 
  658. 		if i == Main_menu_top.current_selection then 
  659. 			--Highlight first item 
  660. 			vint_set_property(Main_menu.anims.text_item_select, "target_handle", menu_item_h) 
  661. 			vint_set_property(menu_item_h, "depth", -50) 
  662. 			lua_play_anim(Main_menu.anims.text_item_select, -2) 
  663. 		else 
  664. 			vint_set_property(text_h, "tint", Main_menu_styles.normal_tint.r, Main_menu_styles.normal_tint.g, Main_menu_styles.normal_tint.b) 
  665. 			vint_set_property(menu_item_h, "scale", Main_menu_styles.normal_scale, Main_menu_styles.normal_scale) 
  666. 			vint_set_property(glow_h, "alpha", Main_menu_styles.glow_normal_alpha) 
  667. 		end 
  668. 		 
  669. 		vint_set_property(menu_item_h, "anchor", 0, pos_y) 
  670. 		 
  671. 		--Set Item to visible 
  672. 		vint_set_property(menu_item_h, "visible", true) 
  673. 		 
  674. 		--Reposition 
  675. 		pos_y = pos_y + 30 
  676. 		menu[i].item_h = menu_item_h 
  677. 		menu[i].text_h = text_h 
  678. 		menu[i].glow_h = glow_h 
  679. 	end 
  680. end 
  681.  
  682. function main_menu_load_back_parent() 
  683. 	vint_dataresponder_request("save_load", "", 0, "load_cancelled") 
  684. 	if Menu_active.parent_menu ~= nil and Menu_active ~= Menu_active.parent_menu then 
  685. 		menu_show(Menu_active.parent_menu, MENU_TRANSITION_SWEEP_RIGHT) 
  686. 	else 
  687. 		main_menu_restore() 
  688. 	end 
  689. end 
  690.  
  691. function main_menu_load_back_restore() 
  692. 	vint_dataresponder_request("save_load", "", 0, "load_cancelled") 
  693. 	main_menu_restore() 
  694. end 
  695.  
  696. function main_menu_restore() 
  697. 	main_menu_grab_input() 
  698. 	 
  699. 	--Undarken main menu 
  700. 	main_menu_screen_fade(0) 
  701. 	menu_hide_active() 
  702. end 
  703.  
  704. function main_menu_grab_input() 
  705. 	Main_menu_can_has_input = true 
  706. end 
  707.  
  708. function main_menu_release_input() 
  709. 	Main_menu_can_has_input = false 
  710. end 
  711.  
  712. function main_menu_update_nav_bar(new_sel) 
  713. 	local cur_item = Main_menu_top[Main_menu_top.current_selection] 
  714. 	local cur_item_h = cur_item.item_h 
  715. 	local anim_h = vint_object_clone(Main_menu.anims.text_item_deselect) 
  716. 	vint_set_property(anim_h , "target_handle", cur_item_h) 
  717. 	vint_set_property(cur_item_h, "depth", 0) 
  718. 	 
  719. 	--Reset tween states for fade out 
  720. 	local val_r, val_g, val_b = vint_get_property(cur_item.text_h, "tint") 
  721. 	local twn_h = vint_object_find("menu_item_select", anim_h) 
  722. 	vint_set_property(twn_h , "start_value", val_r, val_g, val_b) 
  723. 	local val = vint_get_property(cur_item.glow_h, "alpha") 
  724. 	twn_h = vint_object_find("item_glow_alpha_twn_1", anim_h) 
  725. 	vint_set_property(twn_h , "start_value", val ) 
  726. 	vint_set_property(twn_h , "end_event", "main_menu_item_deselect_cleanup") 
  727. 	 
  728. 	local new_item = Main_menu_top[new_sel] 
  729. 	local new_item_h = new_item.item_h 
  730. 	vint_set_property(Main_menu.anims.text_item_select, "target_handle", new_item_h) 
  731. 	vint_set_property(new_item_h, "depth", -50) 
  732. 	 
  733. 	lua_play_anim(anim_h) 
  734. 	lua_play_anim(Main_menu.anims.text_item_select) 
  735.  
  736. 	Main_menu_top.current_selection = new_sel 
  737. end 
  738.  
  739. function main_menu_item_deselect_cleanup(twn_h) 
  740. 	--Cleansup used animations/tweens 
  741. 	vint_object_destroy(vint_object_parent(twn_h)) 
  742. end 
  743.  
  744. function main_menu_nav(target, event) 
  745. 	if menu_input_is_blocked() == true then 
  746. 		return 
  747. 	end 
  748.  
  749. 	if event == "nav_up" then 
  750. 		local cur_selection = Main_menu_top.current_selection - 1 
  751. 		 
  752. 		if cur_selection < 0 then 
  753. 			cur_selection = Main_menu_top.num_items - 1 
  754. 		end 
  755.  
  756. 		main_menu_update_nav_bar(cur_selection) 
  757. 		audio_play(Menu_sound_item_nav) 
  758.  
  759. 	elseif event == "nav_down" then 
  760. 		local cur_selection = Main_menu_top.current_selection + 1 
  761. 		 
  762. 		if cur_selection >= Main_menu_top.num_items then 
  763. 			cur_selection = 0 
  764. 		end 
  765.  
  766. 		main_menu_update_nav_bar(cur_selection) 
  767. 		audio_play(Menu_sound_item_nav) 
  768.  
  769. 	elseif event == "select" then 
  770. 		local item = Main_menu_top[Main_menu_top.current_selection] 
  771. 		if item.on_select ~= nil then 
  772. 			item.on_select() 
  773. 			audio_play(Menu_sound_select) 
  774. 		elseif item.sub_menu ~= nil then 
  775. 			main_menu_release_input() 
  776. 			main_menu_screen_fade(Main_menu_screen_alpha) 
  777. 			item.sub_menu.highlighted_item = 0	--Always select first item in list 
  778. 			menu_show(item.sub_menu, MENU_TRANSITION_SWAP) 
  779. 			audio_play(Menu_sound_select) 
  780. 		end 
  781. 	end 
  782. end 
  783.  
  784. function main_menu_visual_set(state)  
  785. 	if state == "init" then 
  786. 		--Hide everything 
  787. 		vint_set_property(Main_menu.handles.loading_grp, "alpha", 0) 
  788. 		vint_set_property(Main_menu.handles.main_menu_grp, "alpha", 0) 
  789. 		vint_set_property(Main_menu.handles.press_start_grp, "alpha", 0) 
  790. 		vint_set_property(Main_menu.handles.logo_bling, "alpha", 0) 
  791. 		vint_set_property(Main_menu.handles.logo_sr2, "alpha", 0) 
  792. 		vint_set_property(Main_menu.handles.logo_sr2_ornate_left, "alpha", 0) 
  793. 		vint_set_property(Main_menu.handles.logo_sr2_ornate_right, "alpha", 0) 
  794. 		vint_set_property(Main_menu.handles.menu_screen, "alpha", 0) 
  795. 	elseif state == "start_load" then 
  796. 		--Fade into loading 
  797. 		lua_play_anim(Main_menu.anims.intro_loading) 
  798. 	elseif state == "load_to_start" then 
  799. 		--Fade out loading 
  800. 		vint_object_destroy(Main_menu.anims.intro_loading) 
  801. 		lua_play_anim(Main_menu.anims.intro_loading_fadeout) 
  802. 		 
  803. 		--Fade in other elements 
  804. 		lua_play_anim(Main_menu.anims.intro_ornate, 0) 
  805. 		lua_play_anim(Main_menu.anims.intro_logo, .2) 
  806. 		lua_play_anim(Main_menu.anims.intro_press_start, .6) 
  807. 		 
  808. 		--Start bling 
  809. 		main_menu_play_bling()	 
  810. 	elseif state == "start_to_main_menu" then 
  811. 		vint_set_property(Main_menu.handles.loading_grp, "alpha", 0) 
  812. 		 
  813. 		vint_set_property(Main_menu.anims.intro_press_start, "is_paused", true) 
  814. 		lua_play_anim(Main_menu.anims.intro_menu,.5) 
  815. 		audio_play(audio_get_audio_id("SYS_MENU_SELECT")) 
  816. 	end 
  817. end 
  818.  
  819. function main_menu_screen_fade(target_alpha) 
  820. 	--Fades menu to the alpha value 
  821. 	local cur_alpha = vint_get_property(Main_menu.handles.menu_screen, "alpha") 
  822. 	vint_set_property(Main_menu.anims.menu_screen_fade_twn, "start_value", cur_alpha) 
  823. 	vint_set_property(Main_menu.anims.menu_screen_fade_twn, "end_value", target_alpha) 
  824. 	lua_play_anim(Main_menu.anims.menu_screen_fade, 0) 
  825. 	 
  826. 	--if we are faded in show button tips 
  827. 	if target_alpha > 0 then 
  828. 		--Show button tips 
  829. 		main_menu_btn_tips_show(true) 
  830. 	else 
  831. 		--Hide button tips 
  832. 		main_menu_btn_tips_show(false) 
  833. 	end 
  834. end 
  835.  
  836. --coop 
  837. function main_menu_maybe_show_coop_menu() 
  838. 	--see if we're connected to the network 
  839. 	--if is_connected_to_network() == false then 
  840. 	--	main_menu_release_input() 
  841. 	--	main_menu_screen_fade(Main_menu_screen_alpha) 
  842. 	--	menu_show( Main_menu_multiplayer_sign_in_to_gamespy, MENU_TRANSITION_SWAP ) 
  843. 	--	return 
  844. 	--end 
  845. 	--release input 
  846. 	 
  847. 	if get_platform() == "PC" then 
  848. 		set_single_player(false) 
  849. 	end 
  850. 	 
  851. 	main_menu_release_input() 
  852. 	--Darken main menu 
  853. 	main_menu_screen_fade(Main_menu_screen_alpha) 
  854.  
  855. 	main_manu_switch_controls_coop() 
  856.  
  857. 	mp_switch_modes(-1) 
  858.  
  859. 	Main_menu_coop_ps3.highlighted_item = 0 
  860. 	menu_show(Main_menu_coop_pc, MENU_TRANSITION_SWAP) 
  861. end 
  862.  
  863. function main_menu_maybe_show_online_pc() 
  864. 	--see if we're connected to the network 
  865. 	if is_connected_to_network() == false then 
  866. 		main_menu_release_input() 
  867. 		Main_menu_multiplayer_sign_in_to_gamespy.parent_menu = Main_menu_multiplayer_pc 
  868. 		main_menu_screen_fade(Main_menu_screen_alpha) 
  869. 		menu_show( Main_menu_multiplayer_sign_in_to_gamespy, MENU_TRANSITION_SWEEP_LEFT ) 
  870. 		return 
  871. 	end 
  872. 	if get_platform() == "PC" then 
  873. 		set_name_to_use(1); 
  874. 	end 
  875. 	menu_show(Main_menu_online_pc,  MENU_TRANSITION_SWEEP_LEFT) 
  876. end 
  877.  
  878. function main_menu_show_coop_online_menu() 
  879. 	if user_has_online_privlage() == false then 
  880. 		if get_platform() ~= "XBOX360" then 
  881. 			dialog_box_message("MENU_TITLE_WARNING", "MULTI_NO_PRIVILEGE_PS3") 
  882. 		else 
  883. 			dialog_box_message("MENU_TITLE_WARNING", "MULTI_NO_PRIVILEGE") 
  884. 		end 
  885. 		return 
  886. 	end 
  887. 	 
  888. 	if get_platform() ~= "XBOX360" then 
  889. 		if get_platform() == "PC" then 
  890. 			menu_show(Main_menu_coop_online_pc, MENU_TRANSITION_SWAP) 
  891. 		else 
  892. 		menu_show(Main_menu_coop_online_ps3,  MENU_TRANSITION_SWEEP_LEFT) 
  893. 		end 
  894. 	else 
  895. 		menu_show(Main_menu_coop_online_xbox,  MENU_TRANSITION_SWEEP_LEFT) 
  896. 	end 
  897. end 
  898.  
  899. function main_menu_maybe_show_coop_online() 
  900. 	if is_connected_to_service() == false then	 
  901. 		if get_platform() ~= "XBOX360" then 
  902. 			if get_platform() == "PC" then 
  903. 				--see if we're connected to the network 
  904. 				if is_connected_to_network() == false then 
  905. 					main_menu_release_input() 
  906. 					Main_menu_multiplayer_sign_in_to_gamespy.parent_menu = Main_menu_coop_pc 
  907. 					main_menu_screen_fade(Main_menu_screen_alpha) 
  908. 					menu_show( Main_menu_multiplayer_sign_in_to_gamespy, MENU_TRANSITION_SWEEP_LEFT ) 
  909. 					return 
  910. 				end 
  911. 			end 
  912. 			login_to_online_network(true) 
  913. 		elseif user_has_online_privlage() == false then 
  914. 			dialog_box_message("MENU_TITLE_WARNING", "MULTI_NO_PRIVILEGE") 
  915. 		else 
  916. 			dialog_box_message("MENU_TITLE_WARNING", "NOT_LOGGED_IN_XBOX") 
  917. 		end 
  918. 		return 
  919. 	end 
  920. 	 
  921. 	--good, open the menu 
  922. 	 
  923. 	if get_platform() == "PC" then 
  924. 		set_name_to_use(1); 
  925. 	end 
  926. 	 
  927. 	main_menu_show_coop_online_menu() 
  928. end 
  929.  
  930. function main_menu_maybe_show_coop_quickmatch() 
  931. 	--see if we're connected to online netowrk and have privlages 
  932. 	if is_connected_to_service() == false or user_has_online_privlage() == false then 
  933. 		if get_platform() ~= "XBOX360" then 
  934. 			dialog_box_message("MENU_TITLE_WARNING", "MULTI_NO_PRIVILEGE_PS3") 
  935. 		else 
  936. 			dialog_box_message("MENU_TITLE_WARNING", "MULTI_NO_PRIVILEGE") 
  937. 		end 
  938. 		return 
  939. 	end 
  940. 	--good, open the menu 
  941. 	menu_show(Main_menu_empty_menu, MENU_TRANSITION_SWAP) 
  942. end 
  943.  
  944. function main_menu_start_public_coop() 
  945. 	 
  946. 	set_coop_join_type(0) 
  947. 	coop_start_new_live() 
  948. 		 
  949. 	vint_dataresponder_request("main_menu_responder", "", 0, "new_game") 
  950. end 
  951.  
  952. function main_menu_start_friends_coop() 
  953. 	set_coop_join_type(1) 
  954. 	coop_start_new_live() 
  955. 	vint_dataresponder_request("main_menu_responder", "", 0, "new_game") 
  956. end 
  957.  
  958. function main_menu_start_private_coop() 
  959. 	set_coop_join_type(2) 
  960. 	coop_start_new_live() 
  961. 	vint_dataresponder_request("main_menu_responder", "", 0, "new_game") 
  962. end 
  963.  
  964. function main_menu_start_syslink_coop() 
  965. 	set_coop_join_type(0) 
  966. 	coop_start_new_syslink() 
  967. 	vint_dataresponder_request("main_menu_responder", "", 0, "new_game") 
  968. end 
  969.  
  970. function main_menu_start_coop_quickmatch() 
  971.  
  972. end 
  973.  
  974. --coop friends list 
  975. function main_menu_coop_join_friend() 
  976. 	main_menu_join_friend_in_progress(Menu_active.highlighted_item); 
  977. end 
  978.  
  979. function  main_menu_populate_friends(display_name) 
  980. 	local num_items = Main_menu_coop_join_player_menu.num_items 
  981. 	--add item yay 
  982. 	Main_menu_coop_join_player_menu[num_items] = {label = display_name, type = MENU_ITEM_TYPE_SELECTABLE, on_select = main_menu_coop_join_friend 	} 
  983. 	Main_menu_coop_join_player_menu.num_items = num_items + 1 
  984.  
  985. end 
  986.  
  987. function  main_menu_build_join_player_request() 
  988. 	Main_menu_coop_join_player_menu.num_items = 0 
  989. 	vint_dataresponder_request("sr2_main_menu_friends", "main_menu_populate_friends", 0)  
  990. 	if Main_menu_loading_friends_dialog_handle ~= 0 then 
  991. 		dialog_box_force_close(Main_menu_loading_friends_dialog_handle) 
  992. 		Main_menu_loading_friends_dialog_handle = 0 
  993. 	end 
  994. 	if Main_menu_coop_join_player_menu.num_items == 0 then 
  995. 		dialog_box_message("MENU_TITLE_NOTICE", "NO_FRIENDS_ONLINE") 
  996. 	else 
  997. 		menu_show(Main_menu_coop_join_player_menu, MENU_TRANSITION_SWEEP_LEFT) 
  998. 	end 
  999. end 
  1000.  
  1001. function  main_menu_load_friends() 
  1002. 	--open a dialog box 
  1003. 	Main_menu_loading_friends_dialog_handle = dialog_box_message("GAME_LOADING", "MULTI_INVITE_FILTER_FRIENDS") 
  1004. 	--request the friends 
  1005. 	thread_new("main_menu_build_join_player_request") 
  1006. end 
  1007.  
  1008. --multiplayer functions 
  1009. function main_menu_ethernet_disconnected() 
  1010. 	vint_document_unload(vint_document_find("mp_player_info_popup")) 
  1011. 	vint_document_unload(vint_document_find("mp_leaderboards")) 
  1012. 	 
  1013. --	main_menu_grab_input() 
  1014. 	--see if we have a mp menu active 
  1015. 	if Menu_active == nil or Menu_active == 0 then 
  1016. 		return 
  1017. 	end 
  1018. 	 
  1019. 	--we're only in the Pause_info_sub_menu in the main menu if we're online 
  1020. 	if Menu_active.multi_menu == true or Menu_active == Pause_info_sub_menu then 
  1021. 		--we're in a multiplayer menu, RETREAT!! 
  1022. 		main_menu_restore() 
  1023. 		--pop up a dialogue saying why we kicked them out, make this critical so we don't close it 
  1024. 		if is_mp_tutorial_playing() == false then 
  1025. 			if get_platform() ~= "XBOX360" then 
  1026. 				if vint_document_find("mp_server_browser") then --CDPLC close server browser if its opened 
  1027. 					vint_document_unload(vint_document_find("mp_server_browser")) 
  1028. 				end 
  1029. 				if get_disconnected_reason() ~= 6 then 
  1030. 					dialog_box_message_critical("MENU_TITLE_WARNING", "MULTI_LOST_CONNECTION_SYS") 
  1031. 				end 
  1032. 			else 
  1033. 				if vint_document_find("mp_leaderboards") ~= 0 then 
  1034. 					dialog_box_message_critical("MENU_TITLE_WARNING", "MULTI_LOST_CONNECTION") 
  1035. 				else 
  1036. 					dialog_box_message_critical("MENU_TITLE_WARNING", "MULTI_NO_ETHERNET") 
  1037. 				end 
  1038. 			end 
  1039. 		end 
  1040. 	end 
  1041. end 
  1042.  
  1043. function main_menu_internet_disconnected() 
  1044. 	vint_document_unload(vint_document_find("mp_player_info_popup")) 
  1045. 	vint_document_unload(vint_document_find("mp_leaderboards")) 
  1046. 	 
  1047. --	main_menu_grab_input() 
  1048. 	--see if we have a mp menu active 
  1049. 	if Menu_active == nil or Menu_active == 0 then 
  1050. 		return 
  1051. 	end 
  1052. 	 
  1053. 	--we're only in the Pause_info_sub_menu in the main menu if we're online 
  1054. 	if Menu_active.multi_internet_menu == true or Menu_active == Pause_info_sub_menu then 
  1055. 		--kill any low priority dialog boxes 
  1056. 		dialog_box_force_close_all() 
  1057. 		--we're in a multiplayer menu, RETREAT!! 
  1058. 		main_menu_restore() 
  1059. 		--pop up a dialogue saying why we kicked them out, make this critical so we don't close it 
  1060. 		if is_mp_tutorial_playing() == false then 
  1061. 			if get_platform() ~= "XBOX360" then 
  1062. 				dialog_box_message("MENU_TITLE_WARNING", "MULTI_CONNECTION_LOST_PS3") 
  1063. 			else 
  1064. 				dialog_box_message("MENU_TITLE_WARNING", "MULTI_LOST_CONNECTION") 
  1065. 			end 
  1066. 		end 
  1067. 	end 
  1068. end 
  1069.  
  1070. function main_menu_maybe_show_multiplayer_menu() 
  1071. 	--release input 
  1072. 	main_menu_release_input() 
  1073. 	--Darken main menu 
  1074. 	main_menu_screen_fade(Main_menu_screen_alpha) 
  1075.  
  1076. 	Main_menu_multiplayer_ps3.highlighted_item = 0 
  1077.     menu_show(Main_menu_multiplayer_pc, MENU_TRANSITION_SWAP) 
  1078. end 
  1079.  
  1080. function main_menu_show_mp_online_menu() 
  1081. 	if user_has_online_privlage() == false then 
  1082. 		if get_platform() ~= "XBOX360" then 
  1083. 			dialog_box_message("MENU_TITLE_WARNING", "MULTI_NO_PRIVILEGE_PS3") 
  1084. 		else 
  1085. 			dialog_box_message("MENU_TITLE_WARNING", "MULTI_NO_PRIVILEGE") 
  1086. 		end 
  1087. 		return 
  1088. 	end 
  1089. 	 
  1090. 	--maybe prompt them for customization 
  1091. 	if is_mp_storage_blank() then 
  1092. 		dialog_box_message("MENU_TITLE_NOTICE", "MP_CUSTOMIZATION_PROMPT") 
  1093. 	end 
  1094. 	 
  1095. 	if get_platform() ~= "XBOX360" then 
  1096. 		menu_show(Main_menu_online_pc, MENU_TRANSITION_SWEEP_LEFT) 
  1097. 	else 
  1098. 		menu_show(Main_menu_xbox_live, MENU_TRANSITION_SWEEP_LEFT) 
  1099. 	end 
  1100. end 
  1101.  
  1102. function main_menu_maybe_show_online_menu() 
  1103. 	if is_connected_to_service() == false then 
  1104. 		if get_platform() ~= "XBOX360" then 
  1105. 			login_to_online_network(false) 
  1106. 		elseif user_has_online_privlage() == false then 
  1107. 			dialog_box_message("MENU_TITLE_WARNING", "MULTI_NO_PRIVILEGE") 
  1108. 		else 
  1109. 			dialog_box_message("MENU_TITLE_WARNING", "NOT_LOGGED_IN_XBOX") 
  1110. 		end 
  1111. 		return 
  1112. 	end 
  1113. 	 
  1114. 	--good, open the menu 
  1115. 	main_menu_show_mp_online_menu() 
  1116. end 
  1117.  
  1118. function main_menu_build_online_menu() 
  1119. 	debug_print("vint","main_menu: building online servers\n") 
  1120. 	Main_menu_syslink_server_data.num_items = 0 
  1121. 	Main_menu_showing_coop_games = false	 
  1122.  
  1123. 	Multi_ranked = 0 
  1124.  
  1125. 	start_find_online_servers(0); 
  1126. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "update", "main_menu_syslink_menu_update") 
  1127. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "insert", "main_menu_syslink_menu_update") 
  1128. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "remove", "main_menu_syslink_menu_update") 
  1129. 	debug_print("vint","main_menu: building online servers size: ".. Main_menu_system_link_find_game.num_items .."\n") 
  1130.  
  1131. end 
  1132.  
  1133. function main_menu_build_online_ranked_menu() 
  1134. 	debug_print("vint","main_menu: building online servers\n") 
  1135. 	Main_menu_syslink_server_data.num_items = 0 
  1136. 	Main_menu_showing_coop_games = false	 
  1137.  
  1138. 	Multi_ranked = 1 
  1139.  
  1140. 	start_find_online_servers(1); 
  1141. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "update", "main_menu_syslink_menu_update") 
  1142. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "insert", "main_menu_syslink_menu_update") 
  1143. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "remove", "main_menu_syslink_menu_update") 
  1144. 	debug_print("vint","main_menu: building online servers size: ".. Main_menu_system_link_find_game.num_items .."\n") 
  1145.  
  1146. end 
  1147.  
  1148. function main_menu_build_coop_online_menu() 
  1149. 	Main_menu_syslink_server_data.num_items = 0 
  1150. 	Main_menu_showing_coop_games = false	 
  1151.  
  1152. 	start_coop_matchmaking(); 
  1153. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "update", "main_menu_syslink_menu_update") 
  1154. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "insert", "main_menu_syslink_menu_update") 
  1155. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "remove", "main_menu_syslink_menu_update") 
  1156. 	debug_print("vint","main_menu: building online servers size: ".. Main_menu_system_link_find_game.num_items .."\n") 
  1157. end 
  1158.  
  1159. function main_menu_cleanup_online_menu() 
  1160. 	vint_datagroup_remove_subscription("sr2_syslink_servers_group", "update", "main_menu_syslink_menu_update") 
  1161. 	vint_datagroup_remove_subscription("sr2_syslink_servers_group", "insert", "main_menu_syslink_menu_update") 
  1162. 	vint_datagroup_remove_subscription("sr2_syslink_servers_group", "remove", "main_menu_syslink_menu_update") 
  1163. 	stop_find_online_servers() 
  1164. end 
  1165.  
  1166. function main_menu_start_ranked_quickmatch() 
  1167. 	screen_fx_fadeout(0) 
  1168. 	mp_start_quickmatch(true) 
  1169. end 
  1170.  
  1171. function main_menu_start_unranked_quickmatch() 
  1172. 	screen_fx_fadeout(0) 
  1173. 	mp_start_quickmatch(false) 
  1174. end 
  1175.  
  1176. function main_menu_start_lobby(lobby_type) 
  1177. 	mp_start_lobby(lobby_type) 
  1178. end 
  1179.  
  1180. function main_menu_start_public_lobby() 
  1181. 	main_menu_start_lobby(0) 
  1182. end 
  1183.  
  1184. function main_menu_start_friends_lobby() 
  1185. 	main_menu_start_lobby(1) 
  1186. end 
  1187. 	 
  1188. function main_menu_start_private_lobby() 
  1189. 	main_menu_start_lobby(2) 
  1190. end	 
  1191.  
  1192. function main_menu_start_syslink_lobby() 
  1193. 	main_menu_start_lobby(5) 
  1194. end 
  1195.  
  1196. function main_menu_show_mp_stats() 
  1197.  
  1198. end 
  1199.  
  1200. function main_menu_show_mp_leaderboard() 
  1201. 	if is_sake_ready() == 1 then 
  1202. 		vint_document_load("mp_leaderboards") 
  1203. 	end 
  1204. end 
  1205.  
  1206. function main_menu_start_player_create() 
  1207. 	main_menu_start_lobby(3) 
  1208. end 
  1209.  
  1210. function main_menu_start_player_customize() 
  1211. 	main_menu_start_lobby(4) 
  1212. end 
  1213.  
  1214. function main_menu_start_player_wardrobe() 
  1215. 	main_menu_start_lobby(6) 
  1216. end 
  1217.  
  1218. function main_menu_start_mp_help() 
  1219.  
  1220. end 
  1221.  
  1222. function main_menu_get_gamercard() 
  1223. 	debug_print("vint", "Get friend gamercard here!\n") 
  1224. 	show_main_menu_friend_gamercard(Menu_active.highlighted_item) 
  1225. end 
  1226.  
  1227. function main_menu_add_syslink_host(display_name) 
  1228. 	local num_servers = Main_menu_system_link_find_game.num_values 
  1229. 	Main_menu_system_link_find_game.num_values = num_servers + 1 
  1230. 	Main_menu_system_link_find_game[num_servers] = { label = display_name, type = MENU_ITEM_TYPE_SELECTABLE,	on_select = nil} 
  1231. end 
  1232.  
  1233. Main_menu_showing_coop_games = false 
  1234.  
  1235. function main_menu_syslink_menu_update(di_h, event) 
  1236.  
  1237. 	local display_string, is_mp, id = vint_dataitem_get(di_h) 
  1238. 	 
  1239. 	if Main_menu_showing_coop_games == true then 
  1240. 		if is_mp == true then 
  1241. 			mp_player_has_favorite_match_settings() 
  1242. 			return 
  1243. 		end 
  1244. 	elseif is_mp == false then 
  1245. 		mp_load_custom_match_settings_from_favorite() 
  1246. 		return 
  1247. 	end 
  1248.  
  1249. 	if event == "insert" then  
  1250. 		--see if we already have this item  
  1251. 		for index = 0, Main_menu_syslink_server_data.num_items - 1 do 
  1252. 			if Main_menu_syslink_server_data[index].id == id then 
  1253. 				--we already got disnot ar 
  1254. 				return 
  1255. 			end 
  1256. 		end 
  1257. 		--add new item 
  1258. 		Main_menu_syslink_server_data[Main_menu_syslink_server_data.num_items] = {display_string = display_string, id = id} 
  1259. 		Main_menu_syslink_server_data.num_items = Main_menu_syslink_server_data.num_items + 1 
  1260. 	elseif event == "remove" then 
  1261. 		--compress the table.. for loop blah 
  1262. 		local removed = false 
  1263. 		local my_highlight = Menu_option_labels[0].hlight_bar_pos 
  1264. 		if my_highlight == nil then 
  1265. 			my_highlight = 0 
  1266. 		end 
  1267. 		for index = 0, Main_menu_syslink_server_data.num_items - 1 do 
  1268. 			local test_var = true 
  1269. 			if Main_menu_syslink_server_data[index].id == id then 
  1270. 				removed = true 
  1271. 				Main_menu_syslink_server_data[index] = nil 
  1272. 				--do we need to move the bar up? 
  1273. 				if my_highlight >= index and my_highlight ~= 0 then 
  1274. 					Menu_option_labels[0].hlight_bar_pos = my_highlight - 1 
  1275. 				end 
  1276. 				test_var = false 
  1277. 			end 
  1278. 			if removed and test_var then 
  1279. 				Main_menu_syslink_server_data[index - 1] = Main_menu_syslink_server_data[index] 
  1280. 			end 
  1281. 		end 
  1282. 		 
  1283. 		if removed then 
  1284. 			Main_menu_syslink_server_data.num_items = Main_menu_syslink_server_data.num_items -1 
  1285. 		end 
  1286. 	elseif event == "update" then 
  1287. 		if Main_menu_syslink_server_data[di_h] ~= nil then 
  1288. 			-- Update the values 
  1289. 			Main_menu_syslink_server_data[di_h].display_string = display_string 
  1290. 			Main_menu_syslink_server_data[di_h].id = id 
  1291. 		end 
  1292. 	end 
  1293.  
  1294. 	--update the menu 
  1295. 	if Menu_active == Main_menu_system_link_find_game or Menu_active == Main_menu_system_link_find_game_coop or Menu_active == Main_menu_online_find_game or Menu_active == Main_menu_online_find_ranked_game then 
  1296. 		find_server_control_update(Menu_option_labels[0], Menu_active[0]); 
  1297. 	end 
  1298.  
  1299. end 
  1300.  
  1301. function main_menu_build_syslink_menu() 
  1302. 	Main_menu_showing_coop_games = false 
  1303. 	Main_menu_syslink_server_data.num_items = 0 
  1304. 	 
  1305. 	start_find_syslink_servers(); 
  1306. 	 
  1307. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "update", "main_menu_syslink_menu_update") 
  1308. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "insert", "main_menu_syslink_menu_update") 
  1309. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "remove", "main_menu_syslink_menu_update") 
  1310. end 
  1311.  
  1312. function main_menu_build_syslink_menu_coop() 
  1313. 	Main_menu_syslink_server_data.num_items = 0 
  1314. 	Main_menu_showing_coop_games = true 
  1315. 	start_find_syslink_servers(); 
  1316. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "update", "main_menu_syslink_menu_update") 
  1317. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "insert", "main_menu_syslink_menu_update") 
  1318. 	vint_datagroup_add_subscription("sr2_syslink_servers_group", "remove", "main_menu_syslink_menu_update") 
  1319.  
  1320. end 
  1321.  
  1322. function main_menu_cleanup_syslink_menu() 
  1323. 	vint_datagroup_remove_subscription("sr2_syslink_servers_group", "update", "main_menu_syslink_menu_update") 
  1324. 	vint_datagroup_remove_subscription("sr2_syslink_servers_group", "insert", "main_menu_syslink_menu_update") 
  1325. 	vint_datagroup_remove_subscription("sr2_syslink_servers_group", "remove", "main_menu_syslink_menu_update") 
  1326. 	stop_find_syslink_servers() 
  1327. 	 
  1328. end 
  1329.  
  1330. function find_server_control_get_width() 
  1331. 	return FIND_SERVER_WIDTH 
  1332. end 
  1333.  
  1334. function find_server_control_get_height() 
  1335. 	return FIND_SERVER_HEIGHT 
  1336. end 
  1337.  
  1338. function main_menu_join_syslink_server() 
  1339. 	if Find_server_control_no_games == true then 
  1340. 		return 
  1341. 	end 
  1342. 	--find the id of the server we currently have selected 
  1343. 	local selection = Menu_option_labels[0].hlight_bar_pos 
  1344. 	local server_id = Main_menu_syslink_server_data[selection].id 
  1345. 	join_syslink_game(server_id) 
  1346. end 
  1347.  
  1348. function main_menu_join_online_server() 
  1349. 	--find the id of the server we currently have selected 
  1350. 	local selection = Menu_option_labels[0].hlight_bar_pos 
  1351. 	local server_id = Main_menu_syslink_server_data[selection].id 
  1352. 	join_online_game(server_id, Multi_ranked) 
  1353. 	--stop_find_syslink_servers() 
  1354. end 
  1355.  
  1356. function main_menu_join_online_ranked_server() 
  1357. 	--find the id of the server we currently have selected 
  1358. 	local selection = Menu_option_labels[0].hlight_bar_pos 
  1359. 	local server_id = Main_menu_syslink_server_data[selection].id 
  1360. 	join_online_game(server_id, 1) 
  1361. 	--stop_find_syslink_servers() 
  1362. end 
  1363.  
  1364. function main_menu_join_online_coop_server() 
  1365. 	--find the id of the server we currently have selected 
  1366. 	local selection = Menu_option_labels[0].hlight_bar_pos 
  1367. 	local server_id = Main_menu_syslink_server_data[selection].id 
  1368. 	join_online_coop_game(server_id) 
  1369.  
  1370. end 
  1371.  
  1372. function main_menu_start_tutorial_mode() 
  1373. 	start_mp_tutorial() 
  1374. end 
  1375.  
  1376. --mp help stuff 
  1377. function main_menu_populate_help(description_tag) 
  1378. 	local idx = Main_menu_mp_help_info.num_items 
  1379. 	Main_menu_mp_help_info[idx] = { label = description_tag, type = PAUSE_MENU_CONTROL_HELP_TEXT } 
  1380. 	Main_menu_mp_help_info.num_items = 1	--	Should never be more than one 
  1381. end 
  1382.  
  1383. function main_menu_build_help_menu_info(menu_data) 
  1384. 	if Menu_active.do_not_rebuild_previous == true and Menu_active.parent_menu == menu_data then 
  1385. 		Menu_active.do_not_rebuild = nil 
  1386. 		return 
  1387. 	end 
  1388. 	 
  1389. 	local hl_item = Menu_active.highlighted_item 
  1390. 	if hl_item == nil then 
  1391. 		hl_item = 0 
  1392. 	end 
  1393.  
  1394. 	local idx = Menu_active[hl_item].id 
  1395. 	 
  1396. 	-- Set the header 
  1397. 	menu_data.header_label_str = Menu_active[hl_item].label 
  1398. 	 
  1399. 	--prep 
  1400. 	menu_data.get_width = pause_menu_control_help_text_get_width 
  1401. 	menu_data.get_height = pause_menu_control_help_text_get_height 
  1402. 	menu_data.do_not_rebuild_previous = true 
  1403. 		 
  1404. 	--	Prepare to populate 
  1405. 	menu_data.num_items = 0 
  1406. 	menu_data.highlighted_item = 0 
  1407. 	 
  1408. 	--??? 
  1409. 	if Menu_active[hl_item].index ~= nil then 
  1410. 		hl_item = Menu_active[hl_item].index 
  1411. 	end 
  1412. 	 
  1413. 	--	Populate the menu 
  1414. 	vint_dataresponder_request("pause_menu_populate", "main_menu_populate_help", 0, idx, hl_item) 
  1415. 	 
  1416. 	if menu_data.num_items == 0 then 
  1417. 		menu_data.num_items = 1 
  1418. 		menu_data[0] = { label = "STORE_NO_ITEMS_IN_CATEGORY", type=PAUSE_MENU_CONTROL_OBJECTIVE_TEXT_LINE } 
  1419. 	end 
  1420.  
  1421. end 
  1422.  
  1423. function main_menu_populate_help_topics(title_tag) 
  1424. 	local idx = Main_menu_mp_help_topics.num_items 
  1425. 	Main_menu_mp_help_topics[idx] = { label = title_tag, type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Main_menu_mp_help_info, id = 13 } 
  1426. 	Main_menu_mp_help_topics.num_items = Main_menu_mp_help_topics.num_items + 1 
  1427. end 
  1428.  
  1429. function main_menu_build_help_menu_topics(menu_data) 
  1430. 	if Menu_active.do_not_rebuild_previous == true and Menu_active.parent_menu == menu_data then 
  1431. 		Menu_active.do_not_rebuild = nil 
  1432. 		return 
  1433. 	end 
  1434. 	 
  1435. 	local hl_item = Menu_active.highlighted_item 
  1436. 	if hl_item == nil then 
  1437. 		hl_item = 0 
  1438. 	end 
  1439.  
  1440. 	local idx = Menu_active[hl_item].id 
  1441. 	 
  1442. 	-- Set the header 
  1443. 	menu_data.header_label_str = Menu_active[hl_item].label 
  1444. 	 
  1445. 	--prep 
  1446. 	menu_data.do_not_rebuild_previous = true 
  1447.  
  1448. 	--	Prepare to populate 
  1449. 	menu_data.num_items = 0 
  1450. 	menu_data.highlighted_item = 0 
  1451. 	 
  1452. 	--??? 
  1453. 	if Menu_active[hl_item].index ~= nil then 
  1454. 		hl_item = Menu_active[hl_item].index 
  1455. 	end 
  1456. 	 
  1457. 	--	Populate the menu 
  1458. 	vint_dataresponder_request("pause_menu_populate", "main_menu_populate_help_topics", 0, 12, 13) --12 = help topics, 13 = mp help 
  1459. 	 
  1460. 	if menu_data.num_items == 0 then 
  1461. 		menu_data.num_items = 1 
  1462. 		menu_data[0] = { label = "STORE_NO_ITEMS_IN_CATEGORY", type=PAUSE_MENU_CONTROL_OBJECTIVE_TEXT_LINE } 
  1463. 	end 
  1464.  
  1465. end 
  1466.  
  1467. Main_menu_friends_tips = { 
  1468. 	a_button 	= 	{ label = "CONTROL_SELECT", 					enabled = btn_tips_default_a, }, 
  1469. 	x_button 	= 	{ label = "MULTI_MENU_SHOW_GAMERCARD", 			enabled = btn_tips_default_a, }, 
  1470. 	b_button 	= 	{ label = "MENU_BACK", 						enabled = btn_tips_default_a, }, 
  1471. } 
  1472.  
  1473. Main_menu_friends_tips_ps3 = { 
  1474. 	a_button 	= 	{ label = "CONTROL_SELECT", 					enabled = btn_tips_default_a, }, 
  1475. 	b_button 	= 	{ label = "MENU_BACK", 						enabled = btn_tips_default_a, }, 
  1476. } 
  1477. function main_manu_switch_controls_syslink(menu_data) 
  1478. 	menu_set_custom_control_callbacks(Main_menu_controls) 
  1479. end 
  1480.  
  1481. function main_manu_switch_controls_online(menu_data) 
  1482. 	menu_set_custom_control_callbacks(Main_menu_controls_online) 
  1483. 	if get_platform() == "PC" then 
  1484. 		show_password_window_pc(); 
  1485. 	end 
  1486. end 
  1487.  
  1488. function main_manu_switch_controls_coop(menu_data) 
  1489. 	menu_set_custom_control_callbacks(Main_menu_controls) 
  1490. end 
  1491.  
  1492. function maybe_show_login_window() 
  1493. 	if get_platform() == "PC" then 
  1494. 		show_login_window_pc(); 
  1495. 	end 
  1496. end 
  1497.  
  1498. function main_menu_exit_game_cb_pc(result, action) 
  1499. 	if action ~= DIALOG_ACTION_CLOSE then 
  1500. 		return 
  1501. 	end 
  1502. 	if result == 0 then 
  1503. 		pc_invoke_exit_game() 
  1504. 	end 
  1505. end 
  1506.  
  1507. function main_menu_exit_game_pc(menu_data) 
  1508. 	local header = "MAINMENU_EXIT" 
  1509. 	local body = "MAINMENU_EXIT_PROMPT" 	-- Do you really want to quit ? 
  1510. 	local options = { [0] = "CONTROL_YES", [1] = "CONTROL_NO" } 
  1511. 	dialog_box_open(header, body, options, "main_menu_exit_game_cb_pc", 0, DIALOG_PRIORITY_ACTION) 
  1512. end 
  1513.  
  1514. function dummy_login_pc_func() 
  1515. end 
  1516.  
  1517. function on_multi_login_enter_login(menu_label, menu_data) 
  1518. 	menu_open_email_window() 
  1519. 	vint_dataresponder_request( "enter_login_PC_data_responder", "dummy_login_pc_func", 0 ) 
  1520. 	if menu_open_enter_name_result() == 1 then 
  1521. 		local entered_text = menu_open_enter_name_result_string(0) 
  1522. 		if entered_text == nil then 
  1523. 			entered_text = "" 
  1524. 		end 
  1525. 		vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", entered_text ) 
  1526. 	end 
  1527. 	menu_resize() 
  1528. end 
  1529.  
  1530. function on_multi_login_enter_pass(menu_label, menu_data) 
  1531. 	menu_open_password_window() 
  1532. 	vint_dataresponder_request( "enter_login_PC_data_responder", "dummy_login_pc_func", 0 ) 
  1533. 	if menu_open_enter_name_result() == 1 then 
  1534. 		local entered_text = menu_open_enter_name_result_string(1) 
  1535. 		if entered_text == nil then 
  1536. 			vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", "" ) 
  1537. 		else 
  1538. 			vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", "***" ) 
  1539. 		end 
  1540. 	end 
  1541. 	menu_resize() 
  1542. end 
  1543. function on_multi_login_enter_repass(menu_label, menu_data) 
  1544. 	menu_open_repassword_window() 
  1545. 	vint_dataresponder_request( "enter_login_PC_data_responder", "dummy_login_pc_func", 0 ) 
  1546. 	if menu_open_enter_name_result() == 1 then 
  1547. 		local entered_text = menu_open_enter_name_result_string(997) 
  1548. 		if entered_text == nil then 
  1549. 			vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", "" ) 
  1550. 		else 
  1551. 			vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", "***" ) 
  1552. 		end 
  1553. 	end 
  1554. 	menu_resize() 
  1555. end 
  1556.  
  1557. function on_multi_login_enter_player_name(menu_label, menu_data) 
  1558. 	menu_open_player_name_window() 
  1559. 	vint_dataresponder_request( "enter_login_PC_data_responder", "dummy_login_pc_func", 0 ) 
  1560. 	if menu_open_enter_name_result() == 1 then 
  1561. 		local entered_text = menu_open_enter_name_result_string(2) 
  1562. 		if entered_text == nil then 
  1563. 			entered_text = "" 
  1564. 		end 
  1565. 		vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", entered_text ) 
  1566. 	end 
  1567. 	menu_resize() 
  1568. end 
  1569.  
  1570. function on_multi_login_enter_player_syslink_name(menu_label, menu_data) 
  1571. 	menu_open_player_syslink_name_window() 
  1572. 	vint_dataresponder_request( "enter_login_PC_data_responder", "dummy_login_pc_func", 0 ) 
  1573. 	if menu_open_enter_name_result() == 1 then 
  1574. 		local entered_text = menu_open_enter_name_result_string(4) 
  1575. 		if entered_text == nil then 
  1576. 			entered_text = "" 
  1577. 		end 
  1578. 		vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", entered_text ) 
  1579. 	end 
  1580. 	menu_resize() 
  1581. end 
  1582.  
  1583. function on_multi_login_enter_session_pass(menu_label, menu_data) 
  1584. 	menu_open_multi_game_password_window() 
  1585. 	vint_dataresponder_request( "enter_login_PC_data_responder", "dummy_login_pc_func", 0 ) 
  1586. 	if menu_open_enter_name_result() == 1 then 
  1587. 		local entered_text = menu_open_enter_name_result_string(3) 
  1588. 		if entered_text == nil then 
  1589. 			vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", "" ) 
  1590. 		else 
  1591. 			vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", "***" ) 
  1592. 		end 
  1593. 	end 
  1594. 	menu_resize() 
  1595. end 
  1596.  
  1597. function on_coop_login_enter_session_pass(menu_label, menu_data) 
  1598. 	menu_open_coop_game_password_window() 
  1599. 	vint_dataresponder_request( "enter_login_PC_data_responder", "dummy_login_pc_func", 0 ) 
  1600. 	if menu_open_enter_name_result() == 1 then 
  1601. 		local entered_text = menu_open_enter_name_result_string(7) 
  1602. 		if entered_text == nil then 
  1603. 			vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", "" ) 
  1604. 		else 
  1605. 			vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", "***" ) 
  1606. 		end 
  1607. 	end 
  1608. 	menu_resize() 
  1609. end 
  1610.  
  1611. function on_multi_login_enter_session_name(menu_label, menu_data) 
  1612. 	menu_open_game_name_window() 
  1613. 	vint_dataresponder_request( "enter_login_PC_data_responder", "dummy_login_pc_func", 0 ) 
  1614. 	if menu_open_enter_name_result() == 1 then 
  1615. 		local entered_text = menu_open_enter_name_result_string(5) 
  1616. 		if entered_text == nil then 
  1617. 			entered_text = "" 
  1618. 		end 
  1619. 		vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", entered_text ) 
  1620. 	end 
  1621. 	menu_resize() 
  1622. end 
  1623.  
  1624. function on_multi_login_try_login() 
  1625. 	try_and_login_to_gamespy() 
  1626. end 
  1627.  
  1628. function on_multi_login_create() 
  1629. 	local error = try_and_create_profile() 
  1630. 	if error == 0 then 
  1631. 		local options = { [0] = "PAUSE_MENU_ACCEPT" } 
  1632. 		dialog_box_open("MULTI_MENU_CREATE_PROFILE", "MULTI_MENU_CREATE_PROFILE_SUCCESSFUL", options, "multi_menu_log_restore", 0, DIALOG_PRIORITY_ACTION) 
  1633. 	elseif error == 1 then 
  1634. 		-- server error 
  1635. 		local options = { [0] = "PAUSE_MENU_ACCEPT" } 
  1636. 		dialog_box_open("MULTI_MENU_ERROR", "MULTI_MENU_SERVER_ERROR", options, "dummy_login_pc_func", 0, DIALOG_PRIORITY_ACTION) 
  1637. 	elseif error == 2 then  
  1638. 		-- connection error 
  1639. 		local options = { [0] = "PAUSE_MENU_ACCEPT" } 
  1640. 		dialog_box_open("MULTI_MENU_ERROR", "MULTI_MENU_CONNECTION_ERROR", options, "dummy_login_pc_func", 0, DIALOG_PRIORITY_ACTION) 
  1641. 	elseif error == 3 then 
  1642. 		-- bad nick 
  1643. 		local options = { [0] = "PAUSE_MENU_ACCEPT" } 
  1644. 		dialog_box_open("MULTI_MENU_ERROR", "MULTI_MENU_BAD_NICK_ERROR", options, "dummy_login_pc_func", 0, DIALOG_PRIORITY_ACTION) 
  1645. 	elseif error == 4 then 
  1646. 		-- bad password 
  1647. 		local options = { [0] = "PAUSE_MENU_ACCEPT" } 
  1648. 		dialog_box_open("MULTI_MENU_ERROR", "MULTI_MENU_BAD_PASSWORD_ERROR", options, "dummy_login_pc_func", 0, DIALOG_PRIORITY_ACTION) 
  1649. 	elseif error == 5 then 
  1650. 		-- misc error 
  1651. 		local options = { [0] = "PAUSE_MENU_ACCEPT" } 
  1652. 		dialog_box_open("MULTI_MENU_ERROR", "MULTI_MENU_MISC_ERROR", options, "dummy_login_pc_func", 0, DIALOG_PRIORITY_ACTION) 
  1653. 	elseif error == 666 then 
  1654. 		-- server error 
  1655. 		local options = { [0] = "PAUSE_MENU_ACCEPT" } 
  1656. 		dialog_box_open("MULTI_MENU_ERROR", "MULTI_MENU_PASS_REPASS_DIFFERS", options, "dummy_login_pc_func", 0, DIALOG_PRIORITY_ACTION) 
  1657. 	end 
  1658. end 
  1659.  
  1660. function after_gamespy_loggin() 
  1661. 	main_menu_restore() 
  1662. --	main_menu_maybe_show_multiplayer_menu() 
  1663. end 
  1664.  
  1665. function main_menu_multiplayer_create_account_build() 
  1666. 	local t1 = menu_open_enter_name_result_string(0) 
  1667. 	if t1 == nil then 
  1668. 		t1 = "" 
  1669. 	end 
  1670. 	Main_menu_multiplayer_create_account_gamespy[0].info_text_str = t1 
  1671.  
  1672. 	local t2 = menu_open_enter_name_result_string(1) 
  1673. 	if t2 == nil then 
  1674. 		t2 = "" 
  1675. 	else 
  1676. 		t2 = "***" 
  1677. 	end 
  1678. 	Main_menu_multiplayer_create_account_gamespy[1].info_text_str = t2 
  1679. 	Main_menu_multiplayer_create_account_gamespy[2].info_text_str = t2 
  1680.  
  1681. 	menu_reset_repass() 
  1682.  
  1683. 	local t3 = menu_open_enter_name_result_string(2) 
  1684. 	if t3 == nil then 
  1685. 		t3 = "" 
  1686. 	end 
  1687. 	Main_menu_multiplayer_create_account_gamespy[3].info_text_str = t3 
  1688.  
  1689. end 
  1690.  
  1691. function main_menu_multiplayer_sign_in_build() 
  1692. 	local t1 = menu_open_enter_name_result_string(0) 
  1693. 	if t1 == nil then 
  1694. 		t1 = "" 
  1695. 	end 
  1696. 	Main_menu_multiplayer_sign_in_to_gamespy[0].info_text_str = t1 
  1697.  
  1698. 	local t2 = menu_open_enter_name_result_string(1) 
  1699. 	if t2 == nil then 
  1700. 		t2 = "" 
  1701. 	else 
  1702. 		t2 = "***" 
  1703. 	end 
  1704. 	Main_menu_multiplayer_sign_in_to_gamespy[1].info_text_str = t2 
  1705.  
  1706. 	local t3 = menu_open_enter_name_result_string(2) 
  1707. 	if t3 == nil then 
  1708. 		t3 = "" 
  1709. 	end 
  1710. 	Main_menu_multiplayer_sign_in_to_gamespy[2].info_text_str = t3 
  1711.  
  1712. end 
  1713.  
  1714. function main_menu_multiplayer_syslink_sign_in_build() 
  1715. 	local t1 = menu_open_enter_name_result_string(4) 
  1716. 	if t1 == nil then 
  1717. 		t1 = "" 
  1718. 	end 
  1719. 	Main_menu_system_link[0].info_text_str = t1 
  1720. 	 
  1721. 	if get_platform() == "PC" then 
  1722. 		set_name_to_use(0); 
  1723. 	end 
  1724. end 
  1725.  
  1726. function main_menu_coop_syslink_sign_in_build() 
  1727. 	local t1 = menu_open_enter_name_result_string(4) 
  1728. 	if t1 == nil then 
  1729. 		t1 = "" 
  1730. 	end 
  1731. 	Main_menu_coop_syslink[0].info_text_str = t1 
  1732. 	 
  1733. 	if get_platform() == "PC" then 
  1734. 		set_name_to_use(0); 
  1735. 	end 
  1736. end 
  1737.  
  1738. Main_menu_empty_menu = { 
  1739. 	header_label_str = "NOT IMPLEMENTED", 
  1740. 	num_items = 1, 
  1741. 	on_back = main_menu_restore, 
  1742. 	[0] = { label = "DON'T CLICK THIS", type = MENU_ITEM_TYPE_SELECTABLE}, 
  1743. } 
  1744.  
  1745. Main_menu_quickmatch = { 
  1746. 	header_label_str = "MULTI_MENU_QUICK_MATCH", 
  1747. 	num_items = 2, 
  1748. 	on_map = main_menu_restore, 
  1749. 	multi_menu = true, 
  1750. 	multi_internet_menu = true, 
  1751.  
  1752. 	[0] = { label = "MULTI_MENU_RANKED_MATCH", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_ranked_quickmatch}, 
  1753. 	[1] = { label = "MULTI_MENU_PLAYER_MATCH", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_unranked_quickmatch}, 
  1754. } 
  1755.  
  1756. ranked_values = { [0] = { label = "MULTI_MENU_PLAYER_MATCH", }, [1] = { label = "MULTI_MENU_RANKED_MATCH", }, [2] = { label = "MULTI_PARTY_GAME", }, cur_value = 0, num_values = 3 } 
  1757. game_type_values = { [0] = { label = "MULTI_MODE_13", }, [1] = { label = "MULTI_MODE_14", }, [2] = { label = "MULTI_MODE_STRONGARM", }, cur_value = 0, num_values = 3 } 
  1758. game_mode_values = { [0] = { label = "MULTI_MENU_PLAYER_MATCH", }, [1] = { label = "MULTI_PARTY_GAME", }, cur_value = 0, num_values = 2 } 
  1759.  
  1760. function multi_player_switch_match_rank_type_pc() 
  1761. 	--change the ranking type 
  1762. 	local rank_val = ranked_values.cur_value 
  1763. 	--local ranked = false 
  1764. 	--if rank_val == 1 then 
  1765. 	--	ranked = true 
  1766. 	--end 
  1767. 	mp_change_ranked_game_type(rank_val) 
  1768. end 
  1769.  
  1770. function multi_player_switch_match_type_pc() 
  1771. 	--change the game type 
  1772. 	mp_switch_modes(game_type_values.cur_value) 
  1773. end 
  1774.  
  1775. function multi_player_build_ranked_type_pc() 
  1776. 	mp_switch_modes(game_type_values.cur_value) 
  1777. 	 
  1778. 	local is_ranked = get_mp_is_ranked() 
  1779. 	if is_ranked == true then 
  1780. 		ranked_values.cur_value = 1 
  1781. 	else 
  1782. 		ranked_values.cur_value = 0 
  1783. 	end 
  1784. 	mp_change_ranked_game_type(ranked_values.cur_value) 
  1785. 	 
  1786. 	--is_ranked = get_mp_is_ranked() 
  1787. 	--if is_ranked == true then 
  1788. 	--	ranked_values.cur_value = 1 
  1789. 	--else 
  1790. 	--	ranked_values.cur_value = 0 
  1791. 	--end 
  1792. 	 
  1793. 	local selected_mp_mode = get_mp_mode_index() 
  1794. 	game_type_values.cur_value = selected_mp_mode 
  1795. 		 
  1796. 	local gamename = menu_open_enter_name_result_string(5) 
  1797. 	if gamename == nil then 
  1798. 		gamename = "" 
  1799. 	end 
  1800. 	Main_menu_ranked_type_pc[3].info_text_str = gamename 
  1801. 	 
  1802. 	local pass = menu_open_enter_name_result_string(3) 
  1803. 	if pass == nil then 
  1804. 		pass = "" 
  1805. 	else 
  1806. 		pass = "***" 
  1807. 	end 
  1808. 	Main_menu_ranked_type_pc[4].info_text_str = pass 
  1809. end 
  1810.  
  1811. function start_online_game_pc() 
  1812. 	start_online_game() 
  1813. end 
  1814.  
  1815. Main_menu_ranked_type_pc = { 
  1816. 	header_label_str = "MULTI_MENU_GAME_OPTIONS", 
  1817. 	num_items = 5, 
  1818. 	on_map = main_menu_restore, 
  1819. 	on_show = multi_player_build_ranked_type_pc, 
  1820. 	multi_menu = true, 
  1821. 	multi_internet_menu = true, 
  1822. 	 
  1823. 	[0] = { label = "MULTI_LOBBY_START_GAME", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = start_online_game_pc }, 
  1824. 	[1] = { label = "MULTI_MATCH_TYPE", 		type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values = ranked_values, on_value_update = multi_player_switch_match_rank_type_pc }, 
  1825. 	[2] = { label = "MULTI_LOBBY_GAME_MODE", 		type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values = game_type_values, on_value_update = multi_player_switch_match_type_pc }, 
  1826. 	[3] = { label = "MULTI_SESSION_NAME",			type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "", on_select = on_multi_login_enter_session_name }, 
  1827. 	[4] = { label = "MULTI_SESSION_PASS",			type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "", on_select = on_multi_login_enter_session_pass }, 
  1828. } 
  1829.  
  1830. Main_menu_start_lobby = { 
  1831. 	header_label_str = "MULTI_MENU_CREATE_PARTY", 
  1832. 	num_items = 3, 
  1833. 	on_map = main_menu_restore, 
  1834. 	multi_menu = true, 
  1835. 	multi_internet_menu = true, 
  1836.  
  1837. 	[0] = { label = "MULTI_LOBBY_OPEN", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_public_lobby}, 
  1838. 	[1] = { label = "MULTI_LOBBY_FRIENDS_ONLY", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_friends_lobby}, 
  1839. 	[2] = { label = "MULTI_LOBBY_INVITE_ONLY", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_private_lobby}, 
  1840. } 
  1841.  
  1842. Main_menu_start_lobby_ps3 = { 
  1843. 	header_label_str = "MULTI_MENU_CREATE_PARTY", 
  1844. 	num_items = 2, 
  1845. 	on_map = main_menu_restore, 
  1846. 	multi_menu = true, 
  1847. 	multi_internet_menu = true, 
  1848.  
  1849. 	[0] = { label = "MULTI_LOBBY_FRIENDS_ONLY", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_friends_lobby}, 
  1850. 	[1] = { label = "MULTI_LOBBY_INVITE_ONLY", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_private_lobby}, 
  1851. } 
  1852.  
  1853. Main_menu_cuztomize_mp_player = { 
  1854. 	header_label_str = "MULTI_MENU_CUSTOMIZE", 
  1855. 	num_items = 3, 
  1856. 	on_map = main_menu_restore, 
  1857. 	multi_menu = true, 
  1858. 	multi_internet_menu = true, 
  1859. 	 
  1860. 	[0] = { label = "HELP_TEXT_SURGEON_TITLE", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_player_create	}, 
  1861. 	[1] = { label = "MAP_HIDDENNAME_STORE", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_player_customize	}, 
  1862. 	[2] = { label = "MULTI_MENU_CUSTOMIZATION_WARDROBE", type = MENU_ITEM_TYPE_SELECTABLE, on_select = main_menu_start_player_wardrobe }, 
  1863. } 
  1864.  
  1865. Main_menu_ps3_online = { 
  1866. 	header_label_str = "MP_GANGERS_ONLINE", 
  1867. 	num_items = 6, 
  1868. 	on_map = main_menu_restore, 
  1869. 	multi_menu = true, 
  1870. 	multi_internet_menu = true, 
  1871. 	 
  1872. 	[0] = { label = "MULTI_MENU_XBOX_QUICK_MATCH", type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Main_menu_quickmatch }, 
  1873. 	[1] = { label = "MULTI_MENU_CREATE_PARTY_TEXT", type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Main_menu_start_lobby_ps3 }, 
  1874. 	[2] = { label = "MULTI_JOIN_FRIEND",					type = MENU_ITEM_TYPE_SELECTABLE, 	on_select = main_menu_load_friends }, 
  1875. 	[3] = { label = "MULTI_MENU_XBOX_STATS", type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Pause_info_sub_menu, id = 1}, 
  1876. 	[4] = { label = "MULTI_MENU_XBOX_LEADERBOARDS", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_show_mp_leaderboard	}, 
  1877. 	[5] = { label = "MULTI_MENU_CUSTOMIZE", type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Main_menu_cuztomize_mp_player	}, 
  1878. } 
  1879.  
  1880. Main_menu_xbox_live = { 
  1881. 	header_label_str = "MENU_XBOX_LIVE_TITLE", 
  1882. 	num_items = 6, 
  1883. 	on_map = main_menu_restore, 
  1884. 	multi_menu = true, 
  1885. 	multi_internet_menu = true, 
  1886. 	 
  1887. 	[0] = { label = "MULTI_MENU_XBOX_QUICK_MATCH", type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Main_menu_quickmatch }, 
  1888. 	[1] = { label = "MULTI_MENU_CREATE_PARTY_TEXT", type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Main_menu_start_lobby }, 
  1889. 	[2] = { label = "MULTI_JOIN_FRIEND",					type = MENU_ITEM_TYPE_SELECTABLE, 	on_select = main_menu_load_friends }, 
  1890. 	[3] = { label = "MULTI_MENU_XBOX_STATS",  type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Pause_info_sub_menu, id = 1}, 
  1891. 	[4] = { label = "MULTI_MENU_XBOX_LEADERBOARDS", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_show_mp_leaderboard	}, 
  1892. 	[5] = { label = "MULTI_MENU_CUSTOMIZE", type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Main_menu_cuztomize_mp_player	}, 
  1893. } 
  1894.  
  1895. Main_menu_system_link_find_game = { 
  1896. 	header_label_str = "MULTI_SYSLINK_LIST_HEADER", 
  1897. 	num_items = 1, 
  1898. 	on_show = main_menu_build_syslink_menu, 
  1899. 	on_exit = main_menu_cleanup_syslink_menu, 
  1900. 	get_width = find_server_control_get_width, 
  1901. 	get_height = find_server_control_get_height, 
  1902. 	multi_menu = true, 
  1903. 	on_select = main_menu_join_syslink_server, 
  1904. 	on_map = main_menu_restore, 
  1905.  
  1906. 	[0] = { label = "none", type = MAIN_MENU_FIND_SERVER_CONTROL, on_select = main_menu_join_syslink_server}, 
  1907. } 
  1908.  
  1909. Main_menu_online_find_game = { 
  1910. 	header_label_str = "MULTI_SYSLINK_LIST_HEADER", 
  1911. 	num_items = 1, 
  1912. 	on_show = main_menu_build_online_menu, 
  1913. 	on_exit = main_menu_cleanup_online_menu, 
  1914. 	get_width = find_server_control_get_width, 
  1915. 	get_height = find_server_control_get_height, 
  1916. 	multi_menu = true, 
  1917.  
  1918. 	[0] = { label = "none", type = MAIN_MENU_FIND_SERVER_CONTROL, on_select = main_menu_join_online_server}, 
  1919. } 
  1920.  
  1921. Main_menu_online_find_ranked_game = { 
  1922. 	header_label_str = "MULTI_SYSLINK_LIST_HEADER", 
  1923. 	num_items = 1, 
  1924. 	on_show = main_menu_build_online_ranked_menu, 
  1925. 	on_exit = main_menu_cleanup_online_menu, 
  1926. 	get_width = find_server_control_get_width, 
  1927. 	get_height = find_server_control_get_height, 
  1928. 	multi_menu = true, 
  1929.  
  1930. 	[0] = { label = "none", type = MAIN_MENU_FIND_SERVER_CONTROL, on_select = main_menu_join_online_ranked_server}, 
  1931. } 
  1932.  
  1933. Main_menu_system_link = { 
  1934. 	header_label_str = "MULTI_LAN", 
  1935. 	num_items = 3, 
  1936. 	on_map = main_menu_restore, 
  1937. 	multi_menu = true, 
  1938. 	on_show = main_menu_multiplayer_syslink_sign_in_build, 
  1939. 	 
  1940. 	[0] = { label = "MULTI_NAME", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Unknown", on_select = on_multi_login_enter_player_syslink_name }, 
  1941. 	--[1] = { label = "MULTI_FIND_GAMES", type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Main_menu_system_link_find_game }, 
  1942. 	[1] = { label = "MULTI_FIND_GAMES", type = MENU_ITEM_TYPE_SELECTABLE, on_select = Main_menu_LAN_find_game_PC }, 
  1943. 	[2] = { label = "MULTI_LOBBY_START_GAME", type = MENU_ITEM_TYPE_SELECTABLE, on_select = main_menu_start_syslink_lobby }, 
  1944. } 
  1945.  
  1946. Main_menu_online_pc = { 
  1947.     header_label_str = "MP_GANGERS_ONLINE", 
  1948.     num_items = 7, 
  1949.     multi_menu = true, 
  1950.     on_show = main_manu_switch_controls_online, 
  1951.      
  1952.     [0] = { label = "MULTI_FIND_GAMES", type = MENU_ITEM_TYPE_SELECTABLE, on_select = Main_menu_Online_find_game_setup_PC }, 
  1953.     --[1] = { label = "MULTI_FIND_RANKED_GAMES", type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Main_menu_online_find_ranked_game }, 
  1954.     [1] = { label = "MULTI_FIND_RANKED_GAMES", type = MENU_ITEM_TYPE_SELECTABLE, on_select = Main_menu_online_find_ranked_game_setup_PC }, 
  1955.     [2] = { label = "MULTI_LOBBY_START_GAME", type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Main_menu_ranked_type_pc}, 
  1956. 	[3] = { label = "MULTI_MENU_XBOX_STATS",  type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Pause_info_sub_menu, id = 1}, 
  1957. 	[4] = { label = "MULTI_MENU_XBOX_LEADERBOARDS", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_show_mp_leaderboard	}, 
  1958. 	[5] = { label = "MULTI_MENU_CUSTOMIZE", type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Main_menu_cuztomize_mp_player	}, 
  1959. 	[6] = { label = "MULTI_GAMESPY_LOGOUT", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = Main_menu_online_logout	}, 
  1960. } 
  1961.  
  1962. Main_menu_mp_help_topics = { 
  1963. 	num_items = 0, 
  1964. 	on_show = main_menu_build_help_menu_topics, 
  1965. 	multi_menu = true, 
  1966. } 
  1967.  
  1968. Main_menu_mp_help_info = { 
  1969. 	num_items = 0, 
  1970. 	on_show = main_menu_build_help_menu_info, 
  1971. 	multi_menu = true, 
  1972. 	btn_tips = Pause_menu_back_only, 
  1973. } 
  1974.  
  1975. Main_menu_multiplayer_ps3 = { 
  1976. 	header_label_str = "MAINMENU_MULTI", 
  1977. 	num_items = 4, 
  1978. 	on_back = main_menu_restore, 
  1979. 	on_map = main_menu_restore, 
  1980. 	multi_menu = true, 
  1981. 	 
  1982. 	[0] = { label = "MP_GANGERS_ONLINE",			type = MENU_ITEM_TYPE_SELECTABLE, on_select = main_menu_maybe_show_online_menu }, 
  1983. 	[1] = { label = "MULTI_GAMETYPE_1",				type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Main_menu_system_link }, 
  1984. 	[2] = { label = "INFO_HELP", 					type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Main_menu_mp_help_topics}, 
  1985. 	[3] = { label = "MSGLOG_TITLE_TUT",						type = MENU_ITEM_TYPE_SELECTABLE, on_select = main_menu_start_tutorial_mode }, 
  1986. } 
  1987.  
  1988. Main_menu_multiplayer = { 
  1989. 	header_label_str = "MAINMENU_MULTI", 
  1990. 	num_items = 4, 
  1991. 	on_back = main_menu_restore, 
  1992. 	on_map = main_menu_restore, 
  1993. 	multi_menu = true, 
  1994. 	 
  1995. 	[0] = { label = "MAINMENU_XBOX_LIVE",			type = MENU_ITEM_TYPE_SELECTABLE, on_select = main_menu_maybe_show_online_menu }, 
  1996. 	[1] = { label = "MULTI_LAN",					type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Main_menu_system_link }, 
  1997. 	[2] = { label = "INFO_HELP", 					type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Main_menu_mp_help_topics}, 
  1998. 	[3] = { label = "MSGLOG_TITLE_TUT",						type = MENU_ITEM_TYPE_SELECTABLE, on_select = main_menu_start_tutorial_mode }, 
  1999. } 
  2000.  
  2001. Main_menu_multiplayer_pc = { 
  2002. 	header_label_str = "MAINMENU_MULTI", 
  2003. 	num_items = 4, 
  2004. 	on_back = main_menu_restore, 
  2005. 	on_map = main_menu_restore, 
  2006. 	multi_menu = true,	 
  2007.  
  2008. 	[0] = { label = "MP_GANGERS_ONLINE",			type = MENU_ITEM_TYPE_SUB_MENU, on_select = main_menu_maybe_show_online_pc }, 
  2009. 	[1] = { label = "MULTI_LAN",				type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Main_menu_system_link }, 
  2010. 	[2] = { label = "INFO_HELP", 					type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Main_menu_mp_help_topics}, 
  2011. 	[3] = { label = "MSGLOG_TITLE_TUT",				type = MENU_ITEM_TYPE_SELECTABLE, on_select = main_menu_start_tutorial_mode }, 
  2012. } 
  2013.  
  2014. Main_menu_coop_privacy = { 
  2015. 	 
  2016. 	header_label_str = "MAINMENU_NEW", 
  2017. 	num_items = 3, 
  2018. 	on_map = main_menu_restore, 
  2019. 	multi_menu = true, 
  2020. 	multi_internet_menu = true, 
  2021.  
  2022. 	[0] = { label = "MULTI_LOBBY_OPEN", 		type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_public_coop}, 
  2023. 	[1] = { label = "MULTI_LOBBY_FRIENDS_ONLY", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_friends_coop}, 
  2024. 	[2] = { label = "MULTI_LOBBY_INVITE_ONLY", 	type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_private_coop}, 
  2025.  
  2026. } 
  2027.  
  2028.  
  2029. Main_menu_coop_join_player_menu = { 
  2030. 	num_items = 1, 
  2031. 	on_map = main_menu_restore, 
  2032. 	header_label_str = "MULTI_JOIN_FRIEND", 
  2033. 	multi_menu = true, 
  2034. 	multi_internet_menu = true, 
  2035. 	 
  2036. 	[0] =  { label = "MM_LOAD_LOADING", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil }, 
  2037. } 
  2038.  
  2039. Main_menu_system_link_find_game_coop = { 
  2040. 	header_label_str = "MULTI_SYSLINK_LIST_HEADER", 
  2041. 	num_items = 1, 
  2042. 	on_map = main_menu_restore, 
  2043. 	on_show = main_menu_build_syslink_menu_coop, 
  2044. 	on_exit = main_menu_cleanup_syslink_menu, 
  2045. 	get_width = find_server_control_get_width, 
  2046. 	get_height = find_server_control_get_height, 
  2047. 	multi_menu = true, 
  2048. 	on_select = main_menu_join_syslink_server, 
  2049.  
  2050. 	[0] = { label = "none", type = MAIN_MENU_FIND_SERVER_CONTROL, on_select = main_menu_join_syslink_server}, 
  2051. } 
  2052.  
  2053. Main_menu_coop_syslink = { 
  2054. 	header_label_str = "MULTI_LAN", 
  2055. 	num_items = 4, 
  2056. 	on_map = main_menu_restore, 
  2057. 	multi_menu = true, 
  2058. 	on_show = main_menu_coop_syslink_sign_in_build, 
  2059. 	 
  2060. 	[0] = { label = "MULTI_NAME", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Unknown", on_select = on_multi_login_enter_player_syslink_name }, 
  2061. 	--[1] = { label = "MULTI_FIND_GAMES", 		type = MENU_ITEM_TYPE_SUB_MENU, 	sub_menu = Main_menu_system_link_find_game_coop }, 
  2062. 	[1] = { label = "MULTI_FIND_GAMES", 		type = MENU_ITEM_TYPE_SELECTABLE, 	on_select = Main_menu_system_link_find_game_coop_PC }, 
  2063. 	[2] = { label = "MAINMENU_NEW", 			type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_start_syslink_coop }, 
  2064. 	[3] = { label = "SAVELOAD_LOAD_GAME", 		type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_load_coop_syslink}, 
  2065. 	 
  2066. } 
  2067.  
  2068. Main_menu_coop_online_xbox = { 
  2069. 	header_label_str = "MAINMENU_XBOX_LIVE", 
  2070. 	num_items = 4, 
  2071. 	on_map = main_menu_restore, 
  2072. 	multi_menu = true, 
  2073. 	multi_internet_menu = true, 
  2074. 	 
  2075. 	[3] = { label = "MULTI_MENU_XBOX_QUICK_MATCH",	type = MENU_ITEM_TYPE_SELECTABLE, 	on_select =  start_coop_matchmaking }, 
  2076. 	[0] = { label = "MULTI_JOIN_FRIEND",					type = MENU_ITEM_TYPE_SELECTABLE, 	on_select = main_menu_load_friends }, 
  2077. 	[1] = { label = "MAINMENU_NEW",					type = MENU_ITEM_TYPE_SUB_MENU, 	sub_menu = Main_menu_coop_privacy }, 
  2078. 	[2] = { label = "SAVELOAD_LOAD_GAME", 			type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_load_coop_online}, 
  2079. 	 
  2080. } 
  2081.  
  2082. Main_menu_coop_online_ps3 = { 
  2083. 	header_label_str = "MP_GANGERS_ONLINE", 
  2084. 	num_items = 4, 
  2085. 	on_map = main_menu_restore, 
  2086. 	multi_menu = true, 
  2087. 	multi_internet_menu = true, 
  2088.  
  2089. 	[3] = { label = "MULTI_MENU_XBOX_QUICK_MATCH",	type = MENU_ITEM_TYPE_SELECTABLE, 	on_select =  start_coop_matchmaking }, 
  2090. 	[0] = { label = "MULTI_JOIN_FRIEND",					type = MENU_ITEM_TYPE_SELECTABLE, 	on_select = main_menu_load_friends }, 
  2091. 	[1] = { label = "MAINMENU_NEW",					type = MENU_ITEM_TYPE_SUB_MENU, 	sub_menu = Main_menu_coop_privacy }, 
  2092. 	[2] = { label = "SAVELOAD_LOAD_GAME", 			type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_load_coop_online}, 
  2093. 	 
  2094. } 
  2095.  
  2096. Main_menu_find_coop_online_menu = { 
  2097. 	header_label_str = "MULTI_SYSLINK_LIST_HEADER", 
  2098. 	num_items = 1, 
  2099. 	on_map = main_menu_restore, 
  2100. 	on_show = main_menu_build_coop_online_menu, 
  2101. 	on_exit = main_menu_cleanup_syslink_menu, 
  2102. 	get_width = find_server_control_get_width, 
  2103. 	get_height = find_server_control_get_height, 
  2104. 	multi_menu = true, 
  2105. 	on_select = main_menu_join_online_coop_server, 
  2106.  
  2107. 	[0] = { label = "none", type = MAIN_MENU_FIND_SERVER_CONTROL, on_select = main_menu_join_online_coop_server}, 
  2108. } 
  2109.  
  2110. function multi_menu_coop_build_save_new_pc() 
  2111.  
  2112. 	local gamename = menu_open_enter_name_result_string(5) 
  2113. 	if gamename == nil then 
  2114. 		gamename = "" 
  2115. 	end 
  2116. 	Main_menu_coop_online_save_new_pc[2].info_text_str = gamename 
  2117.  
  2118. 	local pass = menu_open_enter_name_result_string(7) 
  2119. 	if pass == nil then 
  2120. 		pass = "" 
  2121. 	else 
  2122. 		pass = "***" 
  2123. 	end 
  2124. 	Main_menu_coop_online_save_new_pc[3].info_text_str = pass 
  2125. end 
  2126.  
  2127. Main_menu_coop_online_save_new_pc = { 
  2128. 	header_label_str = "MP_GANGERS_ONLINE", 
  2129. 	num_items = 4, 
  2130. 	multi_menu = true, 
  2131. 	on_show = multi_menu_coop_build_save_new_pc, 
  2132. 	 
  2133. 	[0] = { label = "MAINMENU_NEW",					type = MENU_ITEM_TYPE_SELECTABLE, 	on_select = main_menu_start_public_coop }, 
  2134. 	[1] = { label = "SAVELOAD_LOAD_GAME", 			type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_load_coop_online}, 
  2135. 	[2] = { label = "MULTI_SESSION_NAME",			type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "", on_select = on_multi_login_enter_session_name }, 
  2136. 	[3] = { label = "MULTI_SESSION_PASS",			type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "", on_select = on_coop_login_enter_session_pass }, 
  2137. } 
  2138.  
  2139. Main_menu_coop_online_pc = { 
  2140. 	header_label_str = "MP_GANGERS_ONLINE", 
  2141. 	num_items = 3, 
  2142. 	multi_menu = true, 
  2143. 	on_show = show_password_window_pc, 
  2144.  
  2145. 	--[0] = { label = "MULTI_FIND_GAMES",				type = MENU_ITEM_TYPE_SELECTABLE, 	on_select =  Main_menu_find_coop_online_menu_setup_PC }, 
  2146. 	--[1] = { label = "MAINMENU_NEW",					type = MENU_ITEM_TYPE_SELECTABLE, 	on_select = main_menu_start_public_coop }, 
  2147. 	--[2] = { label = "SAVELOAD_LOAD_GAME", 			type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_load_coop_online}, 
  2148. 	 
  2149. 	[0] = { label = "MULTI_FIND_GAMES",				type = MENU_ITEM_TYPE_SELECTABLE, 	on_select =  Main_menu_find_coop_online_menu_setup_PC }, 
  2150. 	[1] = { label = "MAINMENU_CREATE",				type = MENU_ITEM_TYPE_SUB_MENU, 	sub_menu = Main_menu_coop_online_save_new_pc }, 
  2151. 	[2] = { label = "MULTI_GAMESPY_LOGOUT", type = MENU_ITEM_TYPE_SELECTABLE,	on_select = Main_menu_online_logout	}, 
  2152. } 
  2153.  
  2154. Main_menu_coop_ps3 = { 
  2155. 	header_label_str = "MAINMENU_COOP", 
  2156. 	num_items = 2, 
  2157. 	on_map = main_menu_restore, 
  2158. 	on_back = main_menu_restore, 
  2159. 	multi_menu = true, 
  2160.  
  2161. 	[0] = { label = "MP_GANGERS_ONLINE", 		type = MENU_ITEM_TYPE_SELECTABLE,		on_select = main_menu_maybe_show_coop_online }, 
  2162. 	[1] = { label = "MULTI_GAMETYPE_1",			type = MENU_ITEM_TYPE_SUB_MENU, 		sub_menu = Main_menu_coop_syslink }, 
  2163. 	 
  2164. } 
  2165.  
  2166. Main_menu_coop_pc = { 
  2167. 	header_label_str = "MAINMENU_COOP", 
  2168. 	num_items = 2, 
  2169. 	on_map = main_menu_restore, 
  2170. 	on_back = main_menu_restore, 
  2171. 	multi_menu = true, 
  2172. 	--on_show = maybe_show_login_window, 
  2173.  
  2174. 	[0] = { label = "MP_GANGERS_ONLINE", 		type = MENU_ITEM_TYPE_SELECTABLE,		on_select = main_menu_maybe_show_coop_online }, 
  2175. 	[1] = { label = "MULTI_LAN",			type = MENU_ITEM_TYPE_SUB_MENU, 		sub_menu = Main_menu_coop_syslink }, 
  2176. 	 
  2177. } 
  2178.  
  2179. Main_menu_coop_xbox = { 
  2180. 	header_label_str = "MAINMENU_COOP", 
  2181. 	num_items = 2, 
  2182. 	on_map = main_menu_restore, 
  2183. 	on_back = main_menu_restore, 
  2184. 	multi_menu = true, 
  2185. 	 
  2186. 	[0] = { label = "MAINMENU_XBOX_LIVE", 		type = MENU_ITEM_TYPE_SELECTABLE,		on_select = main_menu_maybe_show_coop_online }, 
  2187. 	[1] = { label = "MULTI_GAMETYPE_1",			type = MENU_ITEM_TYPE_SUB_MENU, 		sub_menu = Main_menu_coop_syslink }, 
  2188. 	 
  2189. } 
  2190.  
  2191. Main_menu_extras = { 
  2192. 	header_label_str = "MAINMENU_EXTRAS", 
  2193. 	num_items = 2, 
  2194. 	on_map = main_menu_restore, 
  2195. 	on_back = main_menu_restore, 
  2196. 	 
  2197. 	[0] = { label = "MAINMENU_CREDITS",			type = MENU_ITEM_TYPE_SELECTABLE,  on_select = main_menu_roll_credits		}, 
  2198. 	[1] = { label = "MAINMENU_WIRELESS",			type = MENU_ITEM_TYPE_SELECTABLE,  on_select = main_menu_wireless		}, 
  2199. } 
  2200.  
  2201. Main_menu_top = { 
  2202. 	num_items = 0, 
  2203. 	current_selection = 0, 
  2204. } 
  2205.  
  2206. Main_menu_master = { 
  2207. 	num_items = 8, 
  2208.  
  2209. 	[0] = { label = "MAINMENU_CONTINUE", 		type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_continue_select	}, 
  2210. 	[1] = { label = "MAINMENU_NEW",				type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_new_game_select	}, 
  2211. 	[2] = { label = "MAINMENU_LOAD",				type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_load_menu_select	}, 
  2212. 	[3] = { label = "MAINMENU_COOP", 			type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_maybe_show_coop_menu	},	 
  2213. 	[4] = { label = "MAINMENU_MULTI",			type = MENU_ITEM_TYPE_SELECTABLE,	on_select = main_menu_maybe_show_multiplayer_menu	},  
  2214. 	[5] = { label = "MAINMENU_OPTIONS", 		type = MENU_ITEM_TYPE_SUB_MENU,		sub_menu = Pause_options_menu	},  
  2215. 	[6] = { label = "MAINMENU_CREDITS",			type = MENU_ITEM_TYPE_SELECTABLE,  on_select = main_menu_roll_credits		}, 
  2216. 	--[6] = { label = "MAINMENU_EXTRAS",			type = MENU_ITEM_TYPE_SUB_MENU,		sub_menu = Main_menu_extras	},  
  2217. 	-- PC 
  2218. 	[7] = { label = "MAINMENU_EXIT",			type = MENU_ITEM_TYPE_SUB_MENU,		on_select = main_menu_exit_game_pc	},  
  2219. } 
  2220.  
  2221. function multi_menu_log_restore() 
  2222. 	menu_show(Main_menu_multiplayer_sign_in_to_gamespy, MENU_TRANSITION_SWEEP_RIGHT) 
  2223. 	audio_play(Menu_sound_back) 
  2224. end 
  2225.  
  2226.  
  2227. Main_menu_multiplayer_create_account_gamespy = { 
  2228. 	header_label_str = "MULTI_MENU_CREATE_ACCOUNT", 
  2229. 	num_items = 5, 
  2230. 	on_back = multi_menu_log_restore, 
  2231. 	on_map = multi_menu_log_restore, 
  2232. 	on_show = main_menu_multiplayer_create_account_build, 
  2233. 	multi_menu = true, 
  2234. 	 
  2235. 	[0] = { label = "MULTI_GAMESPY_EMAIL",			type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Zupa@ala.pl.aoiuoiquoweuoiuaoswww.eweqiowe", on_select = on_multi_login_enter_login }, 
  2236. 	[1] = { label = "MULTI_GAMESPY_PASS",			type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "*****", on_select = on_multi_login_enter_pass }, 
  2237. 	[2] = { label = "MULTI_GAMESPY_RETYPE_PASS",	type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "*****", on_select = on_multi_login_enter_repass }, 
  2238. 	[3] = { label = "MULTI_GAMESPY_NAME",			type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "nick", on_select = on_multi_login_enter_player_name },   
  2239. 	[4] = { label = "MULTI_CREATE_ACCOUNT",			type = MENU_ITEM_TYPE_SELECTABLE, on_select = on_multi_login_create }, 
  2240. } 
  2241.  
  2242. Main_menu_multiplayer_sign_in_to_gamespy = { 
  2243. 	header_label_str = "MULTI_GAMESPY_ID", 
  2244. 	num_items = 5, 
  2245. 	--on_back = main_menu_restore, 
  2246. 	--on_exit = main_menu_restore, 
  2247. 	on_map = main_menu_restore, 
  2248. 	on_show = main_menu_multiplayer_sign_in_build, 
  2249. 	multi_menu = true, 
  2250. 	 
  2251. 	[0] = { label = "MULTI_GAMESPY_EMAIL",			type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Zupa@ala.pl.aoiuoiquoweuoiuaoswww.eweqiowe", on_select = on_multi_login_enter_login }, 
  2252. 	[1] = { label = "MULTI_GAMESPY_PASS",			type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "*****", on_select = on_multi_login_enter_pass }, 
  2253. 	[2] = { label = "MULTI_GAMESPY_NAME",			type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "ziutek", on_select = on_multi_login_enter_player_name }, 
  2254. 	[3] = { label = "MULTI_LOG_INTO_GAMESPY",		type = MENU_ITEM_TYPE_SELECTABLE, on_select = on_multi_login_try_login }, 
  2255. 	[4] = { label = "MULTI_LOG_CREATE_ACCOUNT",		type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Main_menu_multiplayer_create_account_gamespy }, 
  2256. } 
  2257.  
  2258. Main_menu_server_filter = { 
  2259. 	header_label_str = "MAINNEMU_SERVER_FILTER", 
  2260. 	num_items = 4, 
  2261. 	--on_map = main_menu_restore, 
  2262. 	--on_back = main_menu_restore, 
  2263. 	on_show = multi_build_search_filter, 
  2264. 	multi_menu = true, 
  2265. 	multi_internet_menu = true, 
  2266. 	 
  2267. 	[0] = { label = "MULTI_NAME_FILTER",		type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "", on_select = on_multi_change_name_filter }, 
  2268. 	[1] = { label = "MULTI_SORT_BY",			type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values = sort_by_values, on_value_update = multi_change_sort }, 
  2269. 	[2] = { label = "MULTI_LOBBY_GAME_MODE",	type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values = game_mode_values, on_value_update = pc_multi_change_game_type_filter }, 
  2270. 	[3] = { label = "MULTI_APPLY_FILTER", 		type = MENU_ITEM_TYPE_SELECTABLE,		on_select = main_menu_multi_apply_filter }, 
  2271.  
  2272. } 
  2273.  
  2274. Main_menu_server_filter_short = { 
  2275. 	header_label_str = "MAINNEMU_SERVER_FILTER", 
  2276. 	num_items = 3, 
  2277. 	--on_map = main_menu_restore, 
  2278. 	--on_back = main_menu_restore, 
  2279. 	on_show = multi_build_search_filter, 
  2280. 	multi_menu = true, 
  2281. 	multi_internet_menu = true, 
  2282. 	 
  2283. 	[0] = { label = "MULTI_NAME_FILTER",		type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "", on_select = on_multi_change_name_filter }, 
  2284. 	[1] = { label = "MULTI_SORT_BY",			type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values = sort_by_values, on_value_update = multi_change_sort }, 
  2285. 	[2] = { label = "MULTI_APPLY_FILTER", 		type = MENU_ITEM_TYPE_SELECTABLE,		on_select = main_menu_multi_apply_filter }, 
  2286.  
  2287. } 
  2288.  
  2289. --===================================================== 
  2290. --Button Tips Show 
  2291. --===================================================== 
  2292. function main_menu_btn_tips_show(visible) 
  2293. 	--Fades in/out button tips 
  2294. 	local anim_h = vint_object_find("menu_btn_tips_anim", nil, MENU_BASE_DOC_HANDLE) 
  2295. 	local twn_h = vint_object_find("menu_btn_tips_alpha_twn", anim_h) 
  2296. 	local target_h = vint_object_find("menu_btn_tips", nil, MENU_BASE_DOC_HANDLE) 
  2297. 	local initial_alpha = vint_get_property(target_h, "alpha") 
  2298. 	vint_set_property(twn_h, "start_value", initial_alpha) 
  2299. 	local target_alpha = 0 
  2300. 	local delay = 0 
  2301. 	if visible == true then 
  2302. 		target_alpha = 1 
  2303. 		delay = .1 
  2304. 	end 
  2305. 	vint_set_property(twn_h, "end_value", target_alpha) 
  2306. 	lua_play_anim(anim_h, delay) 
  2307. end 
  2308.  
  2309. --===================================================== 
  2310. --Bling 
  2311. --===================================================== 
  2312. Mm_bling = {} 
  2313. Mm_bling.handles = {} 
  2314.  
  2315. function main_menu_bling_init() 
  2316. 	Mm_bling.handles.bling_bmp = vint_object_find("bling_0") 
  2317. 	Mm_bling.max_bling = 2				--Max number of blings running 
  2318. 	Mm_bling.wait_max = 3				--Maximum wait time for bling to start playing 
  2319. 	Mm_bling.wait_min = 1				--Minimum wait time for bling to start playing 
  2320. 	Mm_bling.active_bling = {}			--Active bling indexes 
  2321. 	Mm_bling.total_blings = 15 		--Total Number of blings (ANIMATIONS MUST EXIST) 
  2322. 	Mm_bling.items = {} 
  2323. 	--Hide initial bling 
  2324. 	vint_set_property(Mm_bling.handles.bling_bmp, "alpha", 0) 
  2325. 	 
  2326. 	local bmp_h, anim_h, twn_h 
  2327. 	for i = 0, Mm_bling.total_blings - 1 do  
  2328. 		--Clone and retarget bling, setup animations and callbacks 
  2329. 		bmp_h = vint_object_clone(Mm_bling.handles.bling_bmp) 
  2330. 		anim_h = vint_object_find("bling_" .. i .. "_anim") 
  2331. 		twn_h = vint_object_find("bling_0_alpha_twn_2", anim_h) 
  2332. 		vint_set_property(anim_h, "target_handle", bmp_h) 
  2333. 		vint_set_property(anim_h, "is_paused", true) 
  2334. 		vint_set_property(twn_h , "end_event", "main_menu_bling_end") 
  2335. 		Mm_bling.items[i] = {bmp_h = bmp_h, anim_h = anim_h, twn_h = twn_h} 
  2336. 	end 
  2337. end 
  2338.  
  2339.  
  2340.  
  2341. function main_menu_play_bling()	 
  2342. 	for i = 0, 1 do  
  2343. 		main_menu_bling_trigger(i) 
  2344. 	end 
  2345. end 
  2346.  
  2347. function main_menu_bling_end(twn_h) 
  2348. 	--callback when a bling is done...  
  2349. 	 
  2350. 	--Clear bling out of active blings 
  2351. 	for idx, val in Mm_bling.items do 
  2352. 		if Mm_bling.items[idx].twn_h == twn_h then 
  2353. 			--Found match now clear it out of active bling 
  2354. 			Mm_bling.active_bling[idx] = nil 
  2355. 		end 
  2356. 	end 
  2357.  
  2358. 	--Just trigger another bling... 
  2359. 	main_menu_bling_trigger() 
  2360. end 
  2361.  
  2362. function main_menu_bling_trigger(offset) 
  2363. 	local offset_time 
  2364. 	if offset == nil then 
  2365. 		offset_time = rand_int(Mm_bling.wait_min, Mm_bling.wait_max) 
  2366. 	else  
  2367. 		offset_time = offset 
  2368. 	end 
  2369. 	 
  2370. 	local random_bling  
  2371. 	local counter = 0  
  2372. 	 
  2373. 	--At least thirty tries before we lose a bling. 
  2374. 	while counter < 30 do 
  2375. 		random_bling = rand_int(0, Mm_bling.total_blings - 1) 
  2376. 		if Mm_bling.active_bling[random_bling] == nil then 
  2377. 			--bling is not active so it is suitible 
  2378. 			--Add to list and play 
  2379. 			Mm_bling.active_bling[random_bling] = true 
  2380. 			lua_play_anim(Mm_bling.items[random_bling].anim_h, offset_time) 
  2381. 			return 
  2382. 		end 
  2383. 		counter = counter + 1 
  2384. 	end	 
  2385. end 
  2386.  
  2387. ------------------ 
  2388. -- Syslink Server control 
  2389. ------------------ 
  2390. Find_server_control_no_games = true 
  2391.  
  2392. function find_server_control_show(menu_label, menu_data) 
  2393. 	local control = menu_label.control 
  2394.  
  2395. 	if control ~= nil then 
  2396. 		if control.type ~= MAIN_MENU_FIND_SERVER_CONTROL then 
  2397. 			-- this isn't my control so release it 
  2398. 			menu_release_control(control) 
  2399. 			control = nil 
  2400. 		end 
  2401. 	end 
  2402.  
  2403. 	vint_set_property(menu_label.label_h, "text_tag", "")	 
  2404. 	 
  2405. 	if control == nil then 
  2406. 		local control_h = vint_object_clone(vint_object_find("syslink_server_grp"), Menu_option_labels.control_parent) 
  2407. 		control = { grp_h = control_h, type = MAIN_MENU_FIND_SERVER_CONTROL, is_highlighted = false } 
  2408. 		menu_label.control = control		 
  2409. 	end 
  2410. 	 
  2411. 	--	Create the labels 
  2412. 	menu_label.real_label_h = vint_object_clone(vint_object_find("menu_option_label00", nil, MENU_BASE_DOC_HANDLE), 	menu_label.control.grp_h) 
  2413. 	vint_set_property(menu_label.real_label_h, "visible", false) 
  2414. 	local x, y = vint_get_property(menu_label.real_label_h, "anchor") 
  2415. 	vint_set_property(menu_label.real_label_h, "anchor", x - 9, y - 87) 
  2416. 	--------- 
  2417. 	 
  2418. 	--------- 
  2419. 	 
  2420. 	--	Show the new control 
  2421. 	vint_set_property(control.grp_h, "visible", true) 
  2422. 	vint_set_property(control.grp_h, "anchor", menu_label.anchor_x, menu_label.anchor_y) 
  2423. 	vint_set_property(control.grp_h, "depth", menu_label.depth) 
  2424. 	 
  2425. 	menu_label.server_list = {num_labels = 0, labels = {}} 
  2426.  
  2427. 	--add 12 invisible labels 
  2428. 	for item_index = 0, FIND_SERVER_MAX_ITEMS - 1 do 
  2429. 		menu_label.server_list.labels[item_index] = vint_object_clone(menu_label.real_label_h) 
  2430. 		vint_set_property(menu_label.server_list.labels[item_index], "visible", false) 
  2431. 		if item_index == 0 then 
  2432. 			local x, y = vint_get_property(menu_label.real_label_h, "anchor") 
  2433. 			vint_set_property(menu_label.server_list.labels[item_index], "anchor", x, y) 
  2434. 		else  
  2435. 			local x, y = vint_get_property(menu_label.server_list.labels[item_index - 1], "anchor") 
  2436. 			local w, h = element_get_actual_size(menu_label.server_list.labels[item_index - 1]) 
  2437. 			vint_set_property(menu_label.server_list.labels[item_index], "anchor", x, y + h) 
  2438. 		end 
  2439. 	end 
  2440. 	 
  2441. 	--put highlight bar in pos 0 
  2442. 	menu_label.hlight_bar_pos = 0 
  2443. 	 
  2444. 	menu_data.has_scroll_bar = false 
  2445. 	find_server_control_update(menu_label, menu_data) 
  2446.  
  2447. end 
  2448.  
  2449. function pc_update_find_server() 
  2450. 	find_server_control_update(Menu_option_labels[0], Menu_active[0] ) 
  2451. end 
  2452.  
  2453.  
  2454. function find_server_control_release(control) 
  2455. 	local menu_label = Menu_option_labels_inactive[0] 
  2456. 	for i = 1, FIND_SERVER_MAX_ITEMS - 1 do 
  2457. 		vint_object_destroy(menu_label.server_list.labels[i]) 
  2458. 		vint_object_destroy(menu_label.server_list.labels[i]) 
  2459. 	end 
  2460.  
  2461. 	vint_object_destroy(menu_label.real_label_h) 
  2462. 	--vint_set_property(Menu_option_labels.hl_bar, "visible", false) 
  2463. 	pause_menu_control_release(menu_label.control) 
  2464. 	local menu_data = Main_menu_system_link_find_game[0] 
  2465. 	if Main_menu_showing_coop_games == true then 
  2466. 		menu_data = Main_menu_system_link_find_game_coop[0] 
  2467. 	end 
  2468. 	if menu_data.has_scroll_bar == true then 
  2469. 		menu_data.has_scroll_bar = false 
  2470. 		vint_object_destroy(menu_data.scroll_bar.bar_grp) 
  2471. 		menu_data.scroll_bar = nil 
  2472. 	end 
  2473. end 
  2474.  
  2475. function find_server_control_resize_select_bar() 
  2476. 	 
  2477. 	local width = FIND_SERVER_SELECT_BAR_WIDTH 
  2478. 	local bg_h 
  2479. 	local frame_h = Menu_option_labels.frame 
  2480. 	local sel_bar_width = width 
  2481. 	 
  2482. 	-- Resize the scroll bar 
  2483. 	if Main_menu_system_link_find_game[0].has_scroll_bar == true then 
  2484. 		sel_bar_width = sel_bar_width - 40 
  2485. 	end 
  2486. 	 
  2487. 	Menu_option_labels.item_width = sel_bar_width 
  2488. 	 
  2489. 	bg_h = vint_object_find("menu_sel_bar_w", frame_h) 
  2490. 	vint_set_property(bg_h, "source_se", sel_bar_width, 36) 
  2491. 	 
  2492. 	bg_h = vint_object_find("menu_sel_bar_w_hl", frame_h) 
  2493. 	vint_set_property(bg_h, "source_se", sel_bar_width, 36) 
  2494. 	 
  2495. 	bg_h = vint_object_find("menu_sel_bar_e", frame_h) 
  2496. 	local menu_bar_e_anchor_x, menu_bar_e_anchor_y = vint_get_property(bg_h, "anchor") 
  2497. 	menu_bar_e_anchor_x = sel_bar_width + 5 
  2498. 	vint_set_property(bg_h, "anchor", menu_bar_e_anchor_x, menu_bar_e_anchor_y) 
  2499. 	 
  2500. 	local bg_h = vint_object_find("menu_sel_bar_e_hl", frame_h) 
  2501. 	vint_set_property(bg_h, "anchor", menu_bar_e_anchor_x - 1, menu_bar_e_anchor_y) 
  2502. 	 
  2503. 	vint_set_property(Menu_option_labels.hl_clip, "offset", 12, -15) 
  2504. 	vint_set_property(Menu_option_labels.hl_clip, "clip_size", width - 17, MENU_ITEM_HEIGHT) 
  2505.  
  2506. end 
  2507.  
  2508. function find_server_control_update_highlight(menu_label, menu_data) 
  2509. 	local highlight_pos = menu_label.hlight_bar_pos - menu_label.first_vis_item 
  2510. 	local hbar_x, hbar_y = vint_get_property(menu_label.server_list.labels[highlight_pos], "anchor") 
  2511. 	hbar_y = hbar_y + 86 
  2512. 	hbar_x = hbar_x + 14 
  2513. 	vint_set_property(Menu_option_labels.hl_bar, "anchor", hbar_x, hbar_y) 
  2514. 	local highlight_bar_label_h = vint_object_find("menu_sel_bar_label", Menu_option_labels.hl_bar) 
  2515. 	vint_set_property(highlight_bar_label_h, "text_tag", Main_menu_syslink_server_data[menu_label.hlight_bar_pos].display_string) 
  2516. 	vint_set_property(Menu_option_labels.hl_bar, "visible", true) 
  2517. end 
  2518.  
  2519. --SCROLL BAR FUNCTIONS 
  2520. --create a scroll bar if needed 
  2521. function find_server_control_create_scroll_bar(menu_label, menu_data) 
  2522. 	if menu_data.has_scroll_bar == true then 
  2523. 		menu_data.has_scroll_bar = false 
  2524. 		vint_object_destroy(menu_data.scroll_bar.bar_grp) 
  2525. 		menu_data.scroll_bar = nil 
  2526. 	end 
  2527. 	 
  2528. 	if menu_label.num_items > FIND_SERVER_MAX_ITEMS then 
  2529. 		local thumb_size = FIND_SERVER_MAX_ITEMS / menu_label.num_items 
  2530. 		menu_data.has_scroll_bar = true; 
  2531.  
  2532. 		local bar_grp = vint_object_clone(vint_object_find("menu_scroll_bar", nil, MENU_BASE_DOC_HANDLE), Menu_option_labels.control_parent) 
  2533. 		 
  2534. 		 
  2535. 		local scroll_data = { 
  2536. 			visible =			false, 
  2537. 			bar_grp =			bar_grp, 
  2538. 			bg_n_h =				vint_object_find("menu_scroll_bg_n", bar_grp), 
  2539. 			bg_c_h =				vint_object_find("menu_scroll_bg_c", bar_grp), 
  2540. 			bg_s_h =				vint_object_find("menu_scroll_bg_s", bar_grp), 
  2541. 			thumb_n_h =			vint_object_find("menu_scroll_thumb_n", bar_grp), 
  2542. 			thumb_s_h =			vint_object_find("menu_scroll_thumb_s", bar_grp), 
  2543. 			thumb_blend_h =	vint_object_find("menu_scroll_thumb_blend", bar_grp), 
  2544. 			thumb_pos =			0, 
  2545. 			bar_height =		332, 
  2546. 			thumb_height =		332, 
  2547. 		} 
  2548.  
  2549. 		menu_data.scroll_bar = scroll_data 
  2550. 		 
  2551. 		find_server_control_show_scroll_bar(menu_data) 
  2552. 		find_server_control_set_bar_height(menu_data, 400) 
  2553. 		find_server_control_set_thumb_size_scroll_bar(menu_data, thumb_size) 
  2554. 		 
  2555. 		--find_server_control_set_pos_scroll_bar(menu_data, menu_label.offset_x + menu_label.select_bar_width - 25, Pause_menu_playlist_editor.header_height + 28) 
  2556. 		vint_set_property(menu_data.scroll_bar.bar_grp, "anchor", 388, 67)--??places the scroll bar, no idea where 
  2557. 	end 
  2558. end 
  2559.  
  2560.  
  2561.  
  2562. function find_server_control_update_scroll_bar(menu_label, menu_data) 
  2563. 	local first_vis_item 		= 0 
  2564. 	local new_idx 					= menu_label.hlight_bar_pos 
  2565. 	local num_items = Main_menu_syslink_server_data.num_items 
  2566. 	 
  2567. 	-- Gotta keep it in the middle 
  2568. 	if num_items > FIND_SERVER_MAX_ITEMS then 
  2569. 		local half_max = floor(FIND_SERVER_MAX_ITEMS / 2) 
  2570. 		first_vis_item = limit(new_idx - half_max, 0, num_items - FIND_SERVER_MAX_ITEMS) 
  2571. 	end 
  2572. 	 
  2573. 	--pause_menu_playlist_update_labels(menu_label, menu_data) 
  2574. 	--pause_menu_control_playlist_update_arrow(menu_label, menu_data) 
  2575. 	find_server_control_set_thumb_pos_scroll_bar(menu_data, first_vis_item/(num_items - FIND_SERVER_MAX_ITEMS))--pause_menu_playlist_set_thumb_pos_scroll_bar(active_pane, first_vis_item / active_pane.num_items) 
  2576.  
  2577. 	return first_vis_item 
  2578. end	 
  2579. 	 
  2580. 	 
  2581. function find_server_control_show_scroll_bar(menu_data) 
  2582. 	local scroll_data = menu_data.scroll_bar 
  2583. 	vint_set_property(scroll_data.bar_grp, "visible", true) 
  2584. end 
  2585.  
  2586. function find_server_control_set_bar_height(menu_data, new_height) 
  2587. 	local scroll_data = menu_data.scroll_bar 
  2588. 	scroll_data.bar_height = new_height - 54 --This magic number will allow you to change the base height of the scrollbar 
  2589.  
  2590. 	vint_set_property(scroll_data.bg_s_h, "anchor", 38, new_height - 10) 
  2591. 	vint_set_property(scroll_data.bg_c_h, "source_se", 10, new_height - 28) 
  2592.  
  2593. 	find_server_control_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  2594. end 
  2595.  
  2596. function find_server_control_set_thumb_size_scroll_bar(menu_data, height) 
  2597. 	local scroll_data = menu_data.scroll_bar 
  2598. 	scroll_data.thumb_height = floor(height * scroll_data.bar_height) 
  2599. 	 
  2600. 	if scroll_data.thumb_height < 60 then 
  2601. 		scroll_data.thumb_height = 60 
  2602. 	end 
  2603. 	 
  2604. 	vint_set_property(scroll_data.thumb_n_h, "source_se", 32, scroll_data.thumb_height - 20) 
  2605. 	find_server_control_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  2606. end 
  2607.  
  2608. function find_server_control_set_thumb_pos_scroll_bar(menu_data, value) 
  2609. 	if menu_data.has_scroll_bar ~= true then 
  2610. 		return 
  2611. 	end 
  2612. 	 
  2613. 	local scroll_data = menu_data.scroll_bar 
  2614. 	if scroll_data.thumb_pos ~= value then 
  2615. 		scroll_data.thumb_pos = value 
  2616. 		find_server_control_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  2617. 	end 
  2618. end 
  2619.  
  2620.  
  2621. function find_server_control_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  2622.  
  2623. 	if menu_data.has_scroll_bar ~= true then 
  2624. 		return 
  2625. 	end 
  2626. 	 
  2627. 	-- update the thumb pos 
  2628. 	local thumb_offset = scroll_data.thumb_pos * (scroll_data.bar_height - scroll_data.thumb_height) + 10  
  2629. 	thumb_offset = floor(thumb_offset) 
  2630. 	 
  2631. 	vint_set_property(scroll_data.thumb_n_h,		"anchor", 3, thumb_offset) 
  2632. 	vint_set_property(scroll_data.thumb_s_h,		"anchor", 3, thumb_offset + scroll_data.thumb_height - 20) --Magic Number represents the offset from the thumb height 
  2633. 	vint_set_property(scroll_data.thumb_blend_h,	"anchor", 3, thumb_offset + scroll_data.thumb_height - 63) --Magic Number represents the offset from the thumb height 
  2634. end 
  2635. 	 
  2636. 	 
  2637. --OTHER server control functions 
  2638. function find_server_control_update(menu_label, menu_data) 
  2639. 	--read data from Main_menu_syslink_server_data[table_index] and set text tags in Menu_option_labels[0] 
  2640. 	--up to max, and just ignore the rest 
  2641. 	if menu_label.server_list == nil then 
  2642. 		-- not active yet, ignore 
  2643. 		return 
  2644. 	end 
  2645.  
  2646. 	--[[----------------------- 
  2647. 	-- For debugging 
  2648. 	Main_menu_syslink_server_data = { } 
  2649. 	Main_menu_syslink_server_data.num_items = FIND_SERVER_MAX_ITEMS + 5 
  2650. 	for i = 0, Main_menu_syslink_server_data.num_items - 1 do 
  2651. 		Main_menu_syslink_server_data[i] = { display_string = "GAME " .. i } 
  2652. 	end 
  2653. 	 
  2654. 	-- Comment out the event logic statements in main_menu_syslink_menu_update() 
  2655. 	]]---------------------- 
  2656.  
  2657. 	local start_index = 0 
  2658. 	local items_size = Main_menu_syslink_server_data.num_items 
  2659. 	 
  2660. 	menu_label.num_items = Main_menu_syslink_server_data.num_items 
  2661. 	 
  2662. 	if items_size == 0 then 
  2663. 		Find_server_control_no_games = true 
  2664. 		menu_label.num_items = 1 
  2665. 		vint_set_property(menu_label.server_list.labels[0], "text_tag", "MP3_PLAYLIST_EMPTY") 
  2666. 		vint_set_property(menu_label.server_list.labels[0], "visible", true) 
  2667. 		return 
  2668. 	else 
  2669. 		Find_server_control_no_games = false 
  2670. 	end 
  2671. 	 
  2672. 	find_server_control_create_scroll_bar(menu_label, menu_data) 
  2673. 	menu_label.first_vis_item = find_server_control_update_scroll_bar(menu_label, menu_data) 
  2674. 	 
  2675. 	if items_size > FIND_SERVER_MAX_ITEMS then 
  2676. 		items_size = 12 
  2677. 	end 
  2678. 	 
  2679. 	menu_label.display_list_size = items_size 
  2680. 	 
  2681. 	for item_index = 0, FIND_SERVER_MAX_ITEMS - 1 do 
  2682. 		if item_index < items_size then 
  2683. 			--setup visible labels 
  2684. 			local real_index = item_index + menu_label.first_vis_item 
  2685. 			vint_set_property(menu_label.server_list.labels[item_index], "text_tag", Main_menu_syslink_server_data[real_index].display_string) 
  2686. 			vint_set_property(menu_label.server_list.labels[item_index], "visible", true) 
  2687. 		else 
  2688. 			--hide the rest 
  2689. 			vint_set_property(menu_label.server_list.labels[item_index], "visible", false) 
  2690. 		end 
  2691. 	end 
  2692. 	 
  2693. 	find_server_control_update_highlight(menu_label, menu_data) 
  2694. 	find_server_control_resize_select_bar() 
  2695. end 
  2696.  
  2697. function find_server_control_nav_up(menu_label, menu_data) 
  2698. 	menu_label.hlight_bar_pos = menu_label.hlight_bar_pos - 1 
  2699. 	if menu_label.hlight_bar_pos < 0 then 
  2700. 		--wrap 
  2701. 		menu_label.hlight_bar_pos = menu_label.num_items - 1 
  2702. 	end 
  2703. 	find_server_control_update(menu_label, menu_data) 
  2704. end 
  2705.  
  2706. function find_server_control_nav_down(menu_label, menu_data) 
  2707. 	menu_label.hlight_bar_pos = menu_label.hlight_bar_pos + 1 
  2708. 	if menu_label.hlight_bar_pos > menu_label.num_items - 1 then 
  2709. 		--wrap 
  2710. 		menu_label.hlight_bar_pos = 0 
  2711. 	end 
  2712. 	find_server_control_update(menu_label, menu_data) 
  2713. end 
  2714.  
  2715.  
  2716. Main_menu_controls = { 
  2717. 	[MAIN_MENU_FIND_SERVER_CONTROL] = { 
  2718. 		on_show 		=	find_server_control_show, 
  2719. 		--on_select 	=	main_menu_join_syslink_server,--find_server_control_join_server, 
  2720. 		on_nav_up	=	find_server_control_nav_up, 
  2721. 		on_nav_down	=	find_server_control_nav_down, 
  2722. 		on_release	=  find_server_control_release,  
  2723. 		uses_scroll_bar = false, 
  2724. 		hide_select_bar = false, 
  2725. 	}, 
  2726. } 
  2727.  
  2728. Main_menu_controls_online = { 
  2729. 	[MAIN_MENU_FIND_SERVER_CONTROL] = { 
  2730. 		on_show 		=	find_server_control_show, 
  2731. 		on_select 	=	main_menu_join_online_server,--find_server_control_join_server, 
  2732. 		on_nav_up	=	find_server_control_nav_up, 
  2733. 		on_nav_down	=	find_server_control_nav_down, 
  2734. 		on_release	=  find_server_control_release,  
  2735. 		uses_scroll_bar = true, 
  2736. 		hide_select_bar = true, 
  2737. 	}, 
  2738. } 
  2739.