sr2lua/pause_menu.lua

  1. -------[include]-------------- 
  2. if get_game_play_mode() == "Pre-game lobby" then 
  3. 	include("multi_pause_menu.lua") 
  4. end 
  5.  
  6. --------[ PAUSE MENU ]--------  
  7. --	Flag that says we're in the pause menu 
  8. Pause_menu = true 
  9.  
  10. -- Global handles 
  11. PAUSE_MENU_DOC_HANDLE = vint_document_find("pause_menu") 
  12.  
  13. --	Custom controls 
  14. PAUSE_MENU_CONTROL_OBJECTIVE_TEXT_LINE	=	1000 
  15. PAUSE_MENU_CONTROL_STAT_TEXT_LINE		=	1001 
  16. PAUSE_MENU_CONTROL_DIVERSION_TEXT_LINE =	1002 
  17. PAUSE_MENU_CONTROL_CHECKBOX_IMAGE		=	1003 
  18. PAUSE_MENU_CONTROL_SAVE_LOAD				=	1004 
  19. PAUSE_MENU_CONTROL_HELP_TEXT				=	1005 
  20. PAUSE_MENU_CONTROL_CENTERED_LABEL		=	1006 
  21. PAUSE_MENU_CONTROL_PLAYLIST_EDITOR		=	1007 
  22. PAUSE_MENU_CONTROL_SCOREBOARD				= 	1008 
  23. PAUSE_MENU_CONTROL_LOBBY_PLAYERS			= 	1009 
  24. PAUSE_MENU_CONTROL_OBJECTIVE_WRAP_LINE = 	1010 
  25. PAUSE_MENU_CONTROL_PAGE_TEXT				=	1005 
  26.  
  27. -- Bitmaps 
  28. PAUSE_MENU_CHECK_BOX_TRUE = "ui_menu_checkbox_true"  
  29. PAUSE_MENU_CHECK_BOX_FALSE = "ui_menu_checkbox_false" 
  30.  
  31. -- Color 
  32. PAUSE_MENU_RED_CHECK_COLOR   = {["R"] = 0.56, ["G"] = 0, ["B"] = 0}  
  33. PAUSE_MENU_GREEN_CHECK_COLOR = {["R"] = 0.27, ["G"] = 0.47, ["B"] = 0.09} 			 
  34.  
  35. --	Page control stuff 
  36. Pause_menu_page = { } 
  37. Pause_menu_help_text_tween = { } 
  38. PAGE_PADDING							= 	30 
  39.  
  40. Pause_menu_help_page = { } 
  41.  
  42. --	Control parameters 
  43. PAUSE_MENU_STAT_SPACE						=	50 
  44. PAUSE_MENU_CHECKBOX_IMAGE_HEIGHT			=	375 
  45. PAUSE_MENU_CHECK_BOX_IMAGE_PADDING		=  30 
  46. PAUSE_MENU_HITMAN_IMAGE_WIDTH				=	550 
  47. PAUSE_MENU_CHOPSHOP_IMAGE_WIDTH			=	580 
  48. PAUSE_MENU_CHOPSHOP_IMAGE_HEIGHT			=	375 
  49. PAUSE_MENU_HELP_TEXT_WIDTH					=	600 
  50. PAUSE_MENU_HELP_TEXT_HEIGHT				= 	375 
  51. PAUSE_MENU_HELP_TEXT_CLIP_WIDTH			=  610 
  52. PAUSE_MENU_HELP_TEXT_CLIP_HEIGHT			=  362 
  53.  
  54. -- PAUSE_MENU_HELP_LINE_HEIGHT					=  28 -- height of a line of text including spacer. 
  55. PAUSE_MENU_HELP_SLIDER_WIDTH				=  25 
  56.  
  57. OBJECTIVES_MAX_ITEMS							= 18 
  58. OBJECTIVE_MAX_VISIBLE_ITEMS				= 1 
  59. OBJECTIVE_MAX_VISIBLE_PIXELS				= 400 
  60.  
  61. PLAYLIST_MAX_ITEMS 							= 	9 
  62. PLAYLIST_WIDTH									= 708 
  63. PLAYLIST_HEIGHT								= 317 
  64. PLAYLIST_LEFT_SELECTBAR_WIDTH 			= 355 
  65. PLAYLIST_RIGHT_SELECTBAR_WIDTH			= 330 
  66.  
  67. SCOREBOARD_WIDTH								= 782 
  68. SCOREBOARD_HEIGHT								= 377 
  69.  
  70. LOBBY_PLAYERS_WIDTH								= 400 
  71. LOBBY_PLAYERS_HEIGHT								= 377 
  72.  
  73. --brightness/gamma menu 
  74. Pause_menu_calibrate_image_peg			= 0 
  75.  
  76. --	Hitman/Chopshop stuff 
  77. Pause_menu_checkbox_image_peg 			= 0 
  78. Pause_menu_checkbox_image_width			= 0 
  79. Pause_menu_check_box_image					= { image_h	= 0, bitmap_h = 0, text_h = 0 } 
  80. Pause_menu_hitman_offset					= {  
  81. 	x = 50, y = -14,  
  82. 	text = {  
  83. 		x = 20, y = 60,  
  84. 		rot = -0.06,  
  85. 		wrap = 292  
  86. 	}, 
  87. 	specific_text = {	x = 330, y = 280, rot = -0.05 } 
  88. } 
  89.  
  90. Pause_menu_chop_shop_offset				= {  
  91. 	x = 50, y = -100,  
  92. 	text = {  
  93. 		x = 18, y = 120,  
  94. 		rot = -0.045,  
  95. 		wrap = 285 
  96. 	}, 
  97. 	specific_text = {	x = 35, y = 370, rot = -0.038 } 
  98. } 
  99.  
  100. -- Diversion Statistics stuff 
  101. DIV_DATA_NUMBER 	= 0 
  102. DIV_DATA_HHMMSS 	= 1 
  103. DIV_DATA_MMSS 		= 2 
  104. DIV_DATA_CASH		= 3 
  105. DIV_DATA_STAR		= 4 
  106. DIV_DATA_X_OF_Y	= 5 
  107.  
  108. DIV_STAR_BRONZE 	= "ui_hud_diversion_star_bronze" 
  109. DIV_STAR_SILVER 	= "ui_hud_diversion_star_silver" 
  110. DIV_STAR_GOLD	 	= "ui_hud_diversion_star_gold" 
  111.  
  112. Pause_menu_building = 0 
  113. Pause_menu_controller_image_peg = 0 
  114.  
  115. -- Options menu stuff 
  116. PAUSE_MENU_CONTROL_SCHEME_ID		= 14 
  117. PAUSE_MENU_OPTIONS_POPULATE_ID 	= 15 
  118. PAUSE_MENU_PAD_AXES_POPULATE_ID = 20 
  119. Pause_menu_controller = { } 
  120. Pause_menu_control_scheme_data = { } 
  121. control_scheme_values = { [0] = { label = "CONTROL_SCHEME_A", }, [1] = { label = "CONTROL_SCHEME_B", }, [2] = { label = "CONTROL_SCHEME_C", }, cur_value = 0, num_values = 3 } 
  122. PAUSE_MENU_DIFFICULTY_ID = 0 
  123. PAUSE_MENU_CONTROL_ID = 1 
  124. PAUSE_MENU_DISPLAY_ID = 2 
  125. PAUSE_MENU_AUDIO_ID   = 3 
  126. PAUSE_MENU_PAD_CONTROL_ID = 5 
  127. Pause_menu_brightness = { 	input = { }		} 
  128. Pause_menu_current_option_menu = -1 
  129. Pause_menu_option_horz_swap_menu = -1 
  130. Pause_menu_exit_after = false 
  131. Quit_game = false 
  132.  
  133. Pause_menu_current_difficulty = 0  -- needed to find out if difficulty menu is dirty 
  134.  
  135. DIFFICULTY_CASUAL = 0 
  136. DIFFICULTY_NORMAL = 1 
  137. DIFFICULTY_HARDCORE = 2 
  138.  
  139. Pause_menu_no_swap = false 
  140. Pause_menu_swap_to_map = false 
  141.  
  142. -- only used if in the main menu 
  143. Pause_menu_return_to_main = 0 
  144. Pause_menu_main_close_ref = 0 
  145.  
  146. ---------------------------------- 
  147. function format_time(data) 
  148. 	local total_seconds = data 
  149. 	local hours = floor(total_seconds / 3600) 
  150. 	local minutes = floor(mod(total_seconds, 3600) / 60) 
  151. 	local seconds = mod(total_seconds, 60) 
  152.  
  153. 	local new_value 
  154. 	if hours > 0 then 
  155. 		new_value = hours .. ":" .. minutes .. ":" .. seconds 
  156. 	elseif minutes > 9 then 
  157. 		new_value = "0:" .. minutes .. ":" .. seconds 
  158. 	elseif minutes > 0 then 
  159. 		new_value = "0:0" .. minutes .. ":" .. seconds 
  160. 	elseif seconds > 9 then 
  161. 		new_value = "0:0:" .. seconds 
  162. 	else 
  163. 		new_value = "0:0:0" .. seconds 
  164. 	end 
  165. 			 
  166. 	return new_value 
  167. end 
  168.  
  169. ---------------------------------- 
  170. --------[ MENU INIT/EXIT ]--------  
  171. ---------------------------------- 
  172. function pause_menu_init() 
  173. 	menu_set_custom_control_callbacks(Pause_menu_controls) 
  174. 	Pause_menu_no_swap = false 
  175. 	if get_platform() == "PS3" then 
  176. 		Pause_info_menu[5] = Pause_info_menu[6]	--	Swap the last two to remove achievements from PS3 
  177. 		Pause_info_menu.num_items = 6 
  178. 		Pause_save_load_btn_tips.x_button 	= 	{ label = "PS3_SAVE_SELECTION_MANAGE_MEMORY", 		enabled = btn_tips_default_a, } 
  179. 		Pause_save_menu.on_alt_select = pause_save_delete_data 
  180. 		Pause_load_menu.on_alt_select = pause_save_delete_data 
  181. 		Pause_menu_friends_tips = Pause_menu_friends_tips_ps3 
  182. 		Pause_menu_quit_to_main_tips = Pause_menu_quit_to_main_tips_ps3 
  183. 	else 
  184. 		if get_platform() == "PC" then 
  185. 			Pause_info_menu[5] = Pause_info_menu[6] 
  186. 			Pause_info_menu.num_items = 6 
  187. 		end 
  188. 	end 
  189. 	 
  190. 	local event_tracking_string = "Pause Menu" 
  191. 	 
  192. 	if Pause_menu_save_for_server_drop == true then 
  193. 		-- save only for server drop 
  194. 		menu_init() 
  195. 		 
  196. 		--Force button tips 
  197. 		BTN_TIPS_DEFAULT.b_button.label = "CONTROL_BACK" 
  198. 		Pause_save_load_btn_tips.b_button.label = "CONTROL_BACK" 
  199. 		 
  200. 		btn_tips_init() 
  201. 		-- Set button tips to visible but hide the actual tips. 
  202. 		local menu_tips_h = vint_object_find("menu_tips", nil, MENU_BASE_DOC_HANDLE) 
  203. 		vint_set_property(menu_tips_h, "visible", true) 
  204. 		local menu_btn_tips_h = vint_object_find("menu_btn_tips", nil, MENU_BASE_DOC_HANDLE) 
  205. 		vint_set_property(menu_btn_tips_h, "alpha", 1) 
  206. 		 
  207. 		--Force background up 
  208. 		local tips_clip_h = vint_object_find("tips_clip", nil, MENU_BASE_DOC_HANDLE) 
  209. 		local x, y = vint_get_property(tips_clip_h, "offset") 
  210. 		vint_set_property(tips_clip_h, "offset", 0, y) 
  211. 		 
  212. 		pause_save_menu_select() 
  213. 		 
  214. 		event_tracking_string = "Pause Menu: (Server Drop)" 
  215. 	elseif Menu_mode_current == "pause" then 
  216. 		-- for standard pause menu 
  217. 		Pause_load_menu.on_pause = pause_menu_exit 
  218. 		Pause_save_load_btn_tips.b_button.label = "CONTROL_BACK" 
  219. 		menu_init() 
  220. --		interface_effect_begin("pause") 
  221. 		if is_coop_start_screen() then 
  222. 			Pause_horz_menu = Coop_invite_friends_horz_menu 
  223. 			event_tracking_string = "Pause Menu: (Invite Friends)" 
  224. 		elseif get_game_play_mode() == "Pre-game lobby" then  
  225. 			multi_lobby_menu_setup() 
  226. 			event_tracking_string = "Pause Menu: (Pre-Game Lobby)" 
  227. 		elseif get_is_tutorial() == true then 
  228. 			pause_menu_setup_lobby_menu() 
  229. 			event_tracking_string = "Pause Menu: (Tutorial)" 
  230. 		elseif mp_is_enabled() == true then 
  231. 			Pause_horz_menu = MP_Pause_horz_menu 
  232. 			event_tracking_string = "Pause Menu: (Multiplayer)" 
  233. 		elseif is_connected_to_network() and is_signed_in() then 
  234. 			local num_items = Pause_horz_menu.num_items 
  235. 			Pause_horz_menu[num_items] = { label = "MAINMENU_COOP", 	sub_menu = Pause_coop_menu 		} 
  236. 			Pause_horz_menu.num_items = num_items + 1 
  237. 		elseif is_signed_in() and get_platform() == "PC" then 
  238. 			local num_items = Pause_horz_menu.num_items 
  239. 			Pause_horz_menu[num_items] = { label = "MAINMENU_COOP", 	sub_menu = Pause_coop_menu 		} 
  240. 			Pause_horz_menu.num_items = num_items + 1 
  241. 		end 
  242. 		 
  243. 		--Event Tracking (Register Interface) 
  244. 		event_tracking_interface_enter(event_tracking_string) 
  245. 		 
  246. 		if pause_menu_get_state() == 1 or pause_menu_get_state() == 2 then	--	Hitman or chopshop 
  247. 			pause_menu_create_special() 
  248. 		else 
  249. 			menu_horz_init(Pause_horz_menu) 
  250. 		end 
  251. 		 
  252. 		--We are in pause menu, Indicate it only if we are not in mp 
  253. 		if mp_is_enabled() == false then 
  254. 			local pause_menu_indicator_h = vint_object_find("pause_menu_indicator", nil, MENU_BASE_DOC_HANDLE) 
  255. 			vint_set_property(pause_menu_indicator_h, "visible", true) 
  256. 			 
  257. 			if get_is_host() == false then 
  258. 				pause_menu_option_menu_init(2) 
  259. 			end 
  260. 		elseif Pause_options_menu ~= Pause_options_menu_no_difficulty then 
  261. 			pause_menu_option_menu_init(2) 
  262. 		end 
  263. 	else 
  264. 		--Event Tracking (Register Interface) 
  265. 		event_tracking_interface_enter("Main Menu") 
  266. 	 
  267. 		-- for main menu 
  268. 		pause_menu_option_menu_init(1) 
  269. 	end 
  270. end 
  271. 	 
  272. function pause_menu_setup_lobby_menu() 
  273. 	--rebuild options menu to not have the difficulty setting 
  274. 	Pause_options_menu = Pause_options_menu_no_difficulty 
  275. 	Pause_horz_menu = Multi_pause_horz_menu_options_only 
  276. 	 
  277. 	--kill the map setting 
  278. 	Pause_menu_no_swap = true 
  279. end 
  280. 	 
  281. function pause_menu_option_menu_init(menu_format) 
  282. 	--Certain menu modes require different option sets 
  283. 	--Circularly swap the menu items 
  284. 	Pause_options_menu[0] = Pause_options_menu[1] 
  285. 	Pause_options_menu[1] = Pause_options_menu[2] 
  286. 	Pause_options_menu[2] = Pause_options_menu[3] 
  287. 	Pause_options_menu[3] = Pause_options_menu[4] 
  288. 	Pause_options_menu[4] = Pause_options_menu[0]   
  289. 	 
  290. 	if menu_format == 0 then 
  291. 		--Standard Pause Menu 
  292. 		Pause_options_menu.num_items = 5 
  293. 	elseif menu_format == 1 then 
  294. 		--Main menu (No difficulty options 
  295. 		Pause_options_menu.num_items = 3 
  296. 		Pause_options_menu.on_pause = nil 
  297. 	elseif menu_format == 2 then 
  298. 		--Multiplayer pause menu 
  299. 		Pause_options_menu.num_items = 4 
  300. 	end 
  301. end 
  302.  
  303. function pause_menu_init_check_box() 
  304.  
  305. 	if Pause_menu_check_box_image.image_h ~= nil and Pause_menu_check_box_image ~= 0 then 
  306. 		vint_object_destroy(Pause_menu_check_box_image.image_h) 
  307. 	end 
  308. 	 
  309. 	Pause_menu_check_box_image.image_h				= vint_object_clone(vint_object_find("pm_image"), Menu_option_labels.control_parent) 
  310. 	Pause_menu_check_box_image.bitmap_h   			= vint_object_find("pm_bitmap", Pause_menu_check_box_image.image_h) 
  311. 	Pause_menu_check_box_image.text_h   			= vint_object_find("pm_text", Pause_menu_check_box_image.image_h) 
  312. 	Pause_menu_check_box_image.sp_text_h 			= vint_object_find("specific_text", Pause_menu_check_box_image.image_h) 
  313. 	Pause_menu_check_box_image.sp_text_top_h 		= vint_object_find("specific_text_top", Pause_menu_check_box_image.sp_text_h) 
  314. 	Pause_menu_check_box_image.sp_label_top_h 	= vint_object_find("specific_label_top", Pause_menu_check_box_image.sp_text_h) 
  315. 	Pause_menu_check_box_image.sp_text_bottom_h  = vint_object_find("specific_text_bottom", Pause_menu_check_box_image.sp_text_h) 
  316. 	Pause_menu_check_box_image.sp_label_bottom_h = vint_object_find("specific_label_bottom", Pause_menu_check_box_image.sp_text_h) 
  317. end 
  318.  
  319. function pause_menu_cleanup() 
  320. 	if Pause_menu_checkbox_image_peg ~= 0 then 
  321. 		peg_unload(Pause_menu_checkbox_image_peg) 
  322. 	end 
  323. 	 
  324. 	if Pause_menu_controller_image_peg ~= 0 then 
  325. 		peg_unload(Pause_menu_controller_image_peg) 
  326. 	end 
  327. 	 
  328. 	if Pause_menu_calibrate_image_peg ~= 0 then 
  329. 		peg_unload(Pause_menu_calibrate_image_peg) 
  330. 	end 
  331. 	 
  332. 	if SCOREBOARD_DOC_H ~= 0 then 
  333. 		vint_document_unload(SCOREBOARD_DOC_H) 
  334. 	end 
  335. 	 
  336. 	if LOBBY_PLAYERS_DOC_H ~= 0 then 
  337. 		vint_document_unload(LOBBY_PLAYERS_DOC_H) 
  338. 	end 
  339. 	 
  340. 	if Quit_game == true then 
  341. 		pause_menu_quit_game_internal() 
  342. 	end 
  343.  
  344. 	if Pause_menu_swap_to_map == false then 
  345. 		--	Release the camera and close the menu 
  346. 		pause_menu_release_camera() 
  347. 	end 
  348.  
  349. 	-- Make sure the radio station stuff is done with 
  350. 	peg_unload("ui_radio_logos") 
  351. 	radio_station_preview(true) 
  352. 	 
  353. 	peg_unload("ui_crib_photos") 
  354. 	 
  355. --	interface_effect_end() 
  356. end 
  357.  
  358. function pause_menu_exit_final() 
  359. 	if Pause_menu_control_scheme_data.thread_h ~= nil then 
  360. 		thread_kill(Pause_menu_control_scheme_data.thread_h) 
  361. 	end 
  362. 	pause_menu_control_scheme_init(false) 
  363. 	 
  364. 	if Pause_menu_swap_to_map == true then 
  365. 		hud_hide(true) 
  366. 		pause_menu_swap_with_map(1) 
  367. 	end 
  368. 	 
  369. 	vint_document_unload(PAUSE_MENU_DOC_HANDLE)	 
  370. end 
  371.  
  372. function pause_menu_exit() 
  373. 	if Menu_mode_current == "pause" then 
  374. 		--	Revert things just in case 
  375. 		for i = 0, 3 do  
  376. 			pause_menu_revert_options(i) 
  377. 		end 
  378. 		playlist_play_track(0, 0, true)	--	Stop any song playing 
  379. 		-- Close the cellphone 
  380. 		if(vint_document_find("cellphone") ~= 0) then 
  381. 			vint_document_unload(vint_document_find("cellphone")) 
  382. 		end 
  383. 		 
  384. 		if Pause_menu_swap_to_map == false then 
  385. 			pause_menu_release_camera()  
  386. 		end 
  387. 		 
  388. 		menu_close(pause_menu_exit_final) 
  389. 	else 
  390. 	 
  391. 		if Pause_menu_return_to_main ~= 0 then 
  392. 			Pause_menu_return_to_main() 
  393. 		end 
  394. 	end 
  395. end 
  396.  
  397. function pause_menu_swap() 
  398. 	if pause_menu_get_state() ~= 0 then	--	Hitman or chopshop 
  399. 		return 
  400. 	end 
  401. 	 
  402. 	if Pause_menu_no_swap == true then 
  403. 		return 
  404. 	end 
  405. 	 
  406. 	if pause_menu_can_swap() == false then 
  407. 		return 
  408. 	end 
  409. 	 
  410. 	Pause_menu_swap_to_map = true 
  411. 	pause_menu_exit() 
  412. end 
  413.  
  414. function pause_menu_save_cancel_confirm(result, action) 
  415. 	if action ~= DIALOG_ACTION_CLOSE then 
  416. 		return 
  417. 	end 
  418. 	 
  419. 	if result == DIALOG_RESULT_YES then 
  420. 		pause_menu_exit() 
  421. 	end 
  422. end 
  423.  
  424. function pause_menu_save_load_exit() 
  425. 	-- this can get called from C so make it a bit defensive 
  426.  
  427. 	if Menu_active ~= 0 then 
  428. 		if Menu_active.is_load_menu ~= true and Menu_active.is_save_menu ~= true then 
  429. 			return 
  430. 		end 
  431. 	else 
  432. 		return 
  433. 	end 
  434. 	 
  435. 	if Pause_menu_save_for_server_drop == true then 
  436. 		dialog_box_confirmation("PAUSE_MENU_QUIT_TITLE", "PAUSE_MENU_QUIT_NO_SAVE_CONFIRM_TEXT", "pause_menu_save_cancel_confirm") 
  437. 	elseif Menu_mode_current == "pause" then 
  438. 		menu_show(Pause_save_load_menu, MENU_TRANSITION_SWEEP_RIGHT) 
  439. 	end 
  440. end 
  441.  
  442. ----------------------------- 
  443. --------[ INFO MENU ]--------  
  444. ----------------------------- 
  445. function pause_menu_info_on_show(menu_data) 
  446. 	event_tracking_interface_tab_change_string(menu_data.header_label_str) 
  447. end 
  448.  
  449. function pause_menu_info_select(menu_label, menu_data) 
  450. 	event_tracking_interface_tab_change_string(menu_data.label) 
  451. end 
  452.  
  453. function pause_menu_build_info_menu(menu_data) 
  454. 	if Menu_active.do_not_rebuild_previous == true and Menu_active.parent_menu == menu_data then 
  455. 		Menu_active.do_not_rebuild = nil 
  456. 		return 
  457. 	end 
  458. 		 
  459. 	local hl_item = Menu_active.highlighted_item 
  460. 	if hl_item == nil then 
  461. 		hl_item = 0 
  462. 	end 
  463.  
  464. 	local idx = Menu_active[hl_item].id 
  465. 	 
  466. 	----------------------------------------- 
  467. 	if idx == 100 then	 
  468. 		menu_data.header_label_str = "NOT IMPLEMENTED" 
  469. 		menu_data.num_items = 1 
  470. 		menu_data[0] = { label = "Not implemented yet", type = PAUSE_MENU_CONTROL_OBJECTIVE_TEXT_LINE } 
  471. 		return 
  472. 	end 
  473. 	----------------------------------------- 
  474. 	 
  475. 	-- Set the header 
  476. 	if Pause_info_menu_population_data[idx].header ~= nil then 
  477. 		menu_data.header_label_str = Pause_info_menu_population_data[idx].header 
  478. --	elseif Menu_active[hl_item].sub_header ~= nil then 
  479. 	--	menu_data.header_label_str = Menu_active[hl_item].sub_header 
  480. 	else 
  481. 		menu_data.header_label_str = Menu_active[hl_item].label 
  482. 	end 
  483. 	 
  484. 	if Pause_info_menu_population_data[idx].prep_function ~= nil then 
  485. 		Pause_info_menu_population_data[idx].prep_function(menu_data) 
  486. 	else 
  487. 		pause_menu_clear_funcs(menu_data) 
  488. 		menu_data.on_show = pause_menu_build_info_menu 
  489. 		menu_data.on_pause = pause_menu_exit 
  490. 		menu_data.on_map = pause_menu_swap 
  491. 	end 
  492.  
  493. 	--	Prepare to populate 
  494. 	menu_data.num_items = 0 
  495. 	menu_data.highlighted_item = 0 
  496. 	 
  497. 	if Menu_active[hl_item].index ~= nil then 
  498. 		hl_item = Menu_active[hl_item].index 
  499. 	end 
  500. 	 
  501. 	--	Populate the menu 
  502. 	vint_dataresponder_request("pause_menu_populate", Pause_info_menu_population_data[idx].callback, 0, idx, hl_item) 
  503.  
  504. 	if menu_data.num_items == 0 then 
  505. 		menu_data.num_items = 1 
  506. 		if Pause_info_menu_population_data[idx].empty ~= nil then 
  507. 			menu_data[0] = { label = Pause_info_menu_population_data[idx].empty, type=PAUSE_MENU_CONTROL_OBJECTIVE_TEXT_LINE } 
  508. 		else  
  509. 			menu_data[0] = { label = "STORE_NO_ITEMS_IN_CATEGORY", type=PAUSE_MENU_CONTROL_OBJECTIVE_TEXT_LINE } 
  510. 		end 
  511. 		 
  512. 		menu_data.btn_tips = Pause_menu_back_only 
  513. 	end 
  514.  
  515. end 
  516.  
  517. function pause_menu_populate_objectives(objective_text, is_complete) 
  518. 	local idx = Pause_info_objective_lines.num_lines 
  519. 	local complete = nil 
  520. 	 
  521. 	--	Set complete to true or false 
  522. 	if is_complete == 0 then 
  523. 		complete = false 
  524. 	elseif is_complete == 1 then 
  525. 		complete = true 
  526. 	end 
  527. 	 
  528. 	--script_assert(idx < OBJECTIVES_MAX_ITEMS, "Too many objetive messages, might have to bump the number.") 
  529. 	 
  530. 	-- Setup the menu item 
  531. 	Pause_info_objective_lines[idx] = { text_string = objective_text, checked = complete, check_color = PAUSE_MENU_GREEN_CHECK_COLOR} 
  532. 	Pause_info_objective_lines.num_lines = Pause_info_objective_lines.num_lines + 1 
  533. 	Pause_info_objective_lines.current_line = 0 
  534. 	 
  535. end 
  536.  
  537.  
  538.  
  539. ----------------------[ Stats ]---------------------- 
  540. function pause_menu_prep_stats(menu_data) 
  541. 	-- Destroy the old page group if it still exists 
  542. 	if Pause_menu_page.grp_h ~= 0 and Pause_menu_page.grp_h ~= nil then 
  543. 		--Do not destroy the old page group but reset the target 
  544. 		--vint_object_destroy(Pause_menu_page.grp_h) 
  545. 		Pause_menu_page.grp_h = 0 
  546. 	end 
  547. 	 
  548. 	--Build a custom header  
  549. 	local header_h = vint_object_clone(vint_object_find("pm_header_nav"), Menu_option_labels.control_parent) 
  550. 	local header_label_h = vint_object_find("title", header_h) 
  551. 	vint_set_property(header_label_h, "text_tag", menu_data.header_label_str) 
  552. 	vint_set_property(header_h, "anchor", 0, 0) 
  553. 	vint_set_property(header_h, "visible", true) 
  554. 	 
  555. 	local header_nav_size = 105	--Size of header element 
  556. 	Menu_option_labels.header_h = header_h 
  557. 	 
  558. 	--reset our standard label string 
  559. 	menu_data.header_label_str = nil 
  560. 	 
  561. 	local header_label_width, header_label_height = element_get_actual_size(header_label_h) 
  562. 	 
  563. 	--Calculate Header width to include the new header nav object 
  564. 	menu_data.header_width = header_nav_size + header_label_width + 20 
  565. 		 
  566. 	--	Initialize the new pages 
  567. 	Pause_menu_page.max = 1 
  568. 	Pause_menu_page.current = 1 
  569. 	 
  570. 	--	Display the new page indicator 
  571. 	Pause_menu_page.label_h = vint_object_find("nav_id", header_h) 
  572. 	Pause_menu_page.arrow_e = vint_object_find("pm_arrow_e", header_h) 
  573. 	Pause_menu_page.arrow_w = vint_object_find("pm_arrow_w", header_h) 
  574. 	vint_set_property(Pause_menu_page.label_h, "text_tag", Pause_menu_page.current .. "/" .. Pause_menu_page.max) 
  575.  
  576. 	menu_data.on_release = pause_menu_release_page 
  577. end 
  578.  
  579. function pause_menu_update_page() 
  580. 	local w_x, w_y = vint_get_property(Pause_menu_page.arrow_w, "anchor") 
  581. 	local label_x, label_y = vint_get_property(Pause_menu_page.label_h, "anchor") 
  582. 	 
  583. 	--	Update the current pages 
  584. 	vint_set_property(Pause_menu_page.label_h, "text_tag", Pause_menu_page.current .. "/" .. Pause_menu_page.max) 
  585. 	 
  586. 	local label_width, label_height = element_get_actual_size(Pause_menu_page.label_h) 
  587. 	vint_set_property(Pause_menu_page.arrow_w, "anchor", label_x - label_width - 8, w_y) 
  588. 	 
  589. end 
  590.  
  591. function pause_menu_release_page(menu_data) 
  592. 	--destroy custom header 
  593. 	vint_object_destroy(Menu_option_labels_inactive.header_h) 
  594. 	Menu_option_labels_inactive.header_h = nil 
  595. 	Pause_menu_page = { } 
  596. 	 
  597. 	--Pause_info_sub_menu = table_clone(Pause_info_sub_menu_template) 
  598. 	 
  599. 	if Menu_mode_current == "pause" then 
  600. 		Pause_info_menu[3].sub_menu = Pause_info_sub_menu 
  601. 	else 
  602. 		if get_platform() == "PS3" then	 
  603. 			Main_menu_ps3_online[3].sub_menu = Pause_info_sub_menu 
  604. 		else 
  605. 			Main_menu_xbox_live[3].sub_menu = Pause_info_sub_menu 
  606. 		end 
  607. 	end 
  608. end 
  609.  
  610. function pause_menu_anchor_stats(menu_data) 
  611. 	 
  612. 	local text_width = menu_data.menu_width - 20 
  613. 	if Menu_option_labels.scroll_bar_visible == true and Menu_control_callbacks[menu_data[0].type].uses_scroll_bar ~= false then 
  614. 		text_width = text_width - 37 
  615. 	end 
  616. 	 
  617. 	-- Anchor the value on the right 
  618. 	for i = 0, Menu_option_labels.max_rows - 1 do 
  619. 		if Menu_option_labels[i].value_h ~= nil then 
  620. 			vint_set_property(Menu_option_labels[i].value_h, "anchor", text_width, 0) 
  621. 		end 
  622.  
  623. 		if Menu_option_labels[i].stars ~= nil then 
  624. 			vint_set_property(Menu_option_labels[i].stars.star_grp, "anchor", text_width + 7, 0) 
  625. 		end 
  626. 	end 
  627. end 
  628.  
  629. function pause_menu_finalize_stats(menu_data) 
  630. 	pause_menu_anchor_stats(menu_data)	 
  631. 		 
  632. 	--Adjust the page indicator(arrows) in header 
  633. 	local header_nav_h = vint_object_find("header_nav", Menu_option_labels.header_h) 
  634. 	local ax, ay = vint_get_property(header_nav_h, "anchor") 
  635. 	vint_set_property(header_nav_h, "anchor", menu_data.menu_width, ay) 
  636. 		 
  637. 	--Set Header line width 
  638. 	vint_set_property(vint_object_find("header_horz", Menu_option_labels.header_h), "source_se", menu_data.menu_width - 10, 10) 
  639. 		 
  640. 	--Hide Scrollbar 
  641. 	menu_scroll_bar_hide() 
  642. 	 
  643. 	--	Set the max for the pages and update the numbers 
  644. 	Pause_menu_page.max = ceil(menu_data.num_items / Menu_option_labels.max_rows) 
  645. 	pause_menu_update_page() 
  646.  
  647. end 
  648.  
  649. function pause_menu_stat_get_width(menu_data) 
  650. 	local grp_h = vint_object_find("pm_stat_text_line") 
  651. 	local label_h = vint_object_find("stat_label", grp_h) 
  652. 	local value_h = vint_object_find("stat_value", grp_h) 
  653. 	local star_h = vint_object_find("stat_stars", grp_h) 
  654. 	local width 
  655. 	 
  656. 	--	Set the text tags to get the size 
  657. 	vint_set_property(label_h, "text_tag", menu_data.label) 
  658. 	width = element_get_actual_size(label_h) 
  659.  
  660. 	if menu_data.data_type == DIV_DATA_STAR then 
  661. 		local value_width = element_get_actual_size(star_h) 
  662. 		 
  663. 		width = width + value_width + PAUSE_MENU_STAT_SPACE 
  664. 	elseif menu_data.show_value == true then 
  665. 		vint_set_property(value_h, "text_tag", menu_data.value) 
  666. 		local value_width = element_get_actual_size(value_h) 
  667. 		 
  668. 		--	Add some space together to properly size the window 
  669. 		width = width + value_width + PAUSE_MENU_STAT_SPACE 
  670. 	end 
  671. 	 
  672. 	if Menu_option_labels.scroll_bar_visible == true then 
  673. 		width = width + 25 
  674. 	end 
  675. 	 
  676. 	return width 
  677. end 
  678.  
  679. function pause_menu_populate_stats(stat_text, show_value, value) 
  680.  
  681. 	Pause_info_sub_menu.on_release	= pause_menu_release_page 
  682. 	Pause_info_sub_menu.on_post_show = pause_menu_finalize_stats 
  683. 	local idx = Pause_info_sub_menu.num_items 
  684. 	if show_value == 1 then 
  685. 		show_value = true 
  686. 	else 
  687. 		show_value = false 
  688. 	end 
  689.  
  690. 	Pause_info_sub_menu[idx] = { label = stat_text, show_value = show_value, value = value, type = PAUSE_MENU_CONTROL_STAT_TEXT_LINE, get_width = pause_menu_stat_get_width } 
  691. 	Pause_info_sub_menu.num_items = Pause_info_sub_menu.num_items + 1 
  692. 	 
  693. 	Pause_info_sub_menu.btn_tips = Pause_menu_back_only 
  694. end 
  695.  
  696.  
  697. ----------------------[ Diversions ]---------------------- 
  698. function pause_menu_hitman_target_select(menu_label, menu_data) 
  699. 	local hl_item = Pause_info_diversions_sub_menu.highlighted_item 
  700. 	if Pause_info_diversions_sub_menu[hl_item].dead == true then 
  701. 		return 
  702. 	end	 
  703. 	 
  704. 	pause_menu_select_target(1, hl_item) 
  705. 	if pause_menu_update_checkmark(Pause_info_diversions_sub_menu, hl_item) == true then 
  706. 		pause_menu_exit() 
  707. 	end 
  708. end 
  709.  
  710. function pause_menu_chop_shop_vehicle_select(menu_label, menu_data) 
  711. 	local hl_item = Pause_info_diversions_sub_menu.highlighted_item 
  712. 	if Pause_info_diversions_sub_menu[hl_item].retrieved == true then 
  713. 		return 
  714. 	end 
  715. 	pause_menu_select_target(2, hl_item) 
  716. 	 
  717. 	if pause_menu_update_checkmark(Pause_info_diversions_sub_menu, hl_item) == true then 
  718. 		pause_menu_exit() 
  719. 	end 
  720. end 
  721.  
  722. function pause_menu_update_checkmark(menu_data, index) 
  723. 	for i = 0, menu_data.num_items - 1 do 
  724. 		if menu_data[i].check_color == PAUSE_MENU_GREEN_CHECK_COLOR then 
  725. 			vint_set_property(Menu_option_labels[i].check_h, "visible", false) 
  726. 			menu_data[i].checked = false 
  727. 			menu_data[i].check_color = PAUSE_MENU_RED_CHECK_COLOR 
  728. 			if i == index then 
  729. 				return false 
  730. 			end 
  731. 		end 
  732. 	end 
  733. 	 
  734. 	menu_data[index].checked = true 
  735. 	menu_data[index].check_color = PAUSE_MENU_GREEN_CHECK_COLOR 
  736. 	vint_set_property(Menu_option_labels[index].check_h, "visible", true) 
  737. 	vint_set_property(Menu_option_labels[index].check_h, "tint", menu_data[index].check_color.R, menu_data[index].check_color.G, menu_data[index].check_color.B) 
  738. 	return true 
  739. end 
  740.  
  741. function pause_menu_diversions_update_stars(menu_label, menu_data) 
  742. 	if menu_data.data_type ~= DIV_DATA_STAR then 
  743. 		return 
  744. 	end 
  745. 	 
  746. 	local value = tonumber(menu_data.value) 
  747. 	menu_data.value = value 
  748. 	 
  749. 	if menu_data.value == 0 then 
  750. 		vint_set_property(menu_label.stars.star_grp, "visible", false) 
  751. 	else 
  752. 		local val = mod(menu_data.value - 1, 3) 
  753. 		for i = 0, val do 
  754. 			vint_set_property(menu_label.stars.star_h[i], "visible", true) 
  755. 			 
  756. 			if menu_data.value < 4 then 
  757. 				vint_set_property(menu_label.stars.star_h[i], "image", DIV_STAR_BRONZE) 
  758. 			elseif menu_data.value < 7 then 
  759. 				vint_set_property(menu_label.stars.star_h[i], "image", DIV_STAR_SILVER) 
  760. 			else 
  761. 				vint_set_property(menu_label.stars.star_h[i], "image", DIV_STAR_GOLD) 
  762. 			end 
  763. 		end 
  764. 		 
  765. 		for i = (val + 1), 2 do  
  766. 			vint_set_property(menu_label.stars.star_h[i], "visible", false) 
  767. 		end 
  768. 		 
  769. 	end 
  770. 	 
  771. end 
  772.  
  773. function pause_menu_diversions_post_show(menu_data) 
  774. 	pause_menu_anchor_stats(menu_data) 
  775. 	 
  776. 	if menu_data[Menu_active.highlighted_item].type == PAUSE_MENU_CONTROL_DIVERSION_TEXT_LINE then 
  777. 		pause_menu_control_diversion_text_line_enter(Menu_option_labels[Menu_active.highlighted_item - Menu_active.first_vis_item], menu_data[Menu_active.highlighted_item]) 
  778. 	end 
  779. end 
  780.  
  781. function pause_menu_diversions_get_width(menu_data) 
  782. 	local grp_h = vint_object_find("pm_stat_text_line") 
  783. 	local label_h = vint_object_find("stat_label", grp_h) 
  784. 	local value_h = vint_object_find("stat_value", grp_h) 
  785. 	local star_h = vint_object_find("stat_stars", grp_h) 
  786. 		 
  787. 	local left_width = 0 
  788. 	local right_width = 0 
  789. 	local max_left = 0 
  790. 	local max_right = 0 
  791. 	 
  792. 	-- set the labels and hide unused 
  793. 	for i = 0, menu_data.num_items - 1 do 
  794. 		local item = menu_data[i] 
  795. 		--	Set the text tags to get the size 
  796. 		vint_set_property(label_h, "text_tag", item.label) 
  797. 		left_width = element_get_actual_size(label_h) 
  798. 		 
  799. 		if item.data_type == DIV_DATA_STAR then 
  800. 			right_width = (element_get_actual_size(star_h) * 3) + 20 -- since there are 3 stars. .1 for good measure 
  801. 		elseif item.show_value == true then 
  802. 			vint_set_property(value_h, "text_tag", item.value) 
  803. 			right_width = element_get_actual_size(value_h) 
  804. 		end 
  805. 		 
  806. 		if left_width > max_left then 
  807. 			max_left = left_width 
  808. 		end 
  809. 		 
  810. 		if right_width > max_right then 
  811. 			max_right = right_width 
  812. 		end 
  813. 	end 
  814. 	 
  815. 	local width = max_left + max_right + PAUSE_MENU_STAT_SPACE 
  816. 	if Menu_option_labels.scroll_bar_visible == true then 
  817. 		width = width + 25 
  818. 	end 
  819. 	 
  820. 	return width 
  821. end 
  822.  
  823. function pause_menu_clear_funcs(menu_data) 
  824. 	menu_data.get_width = nil 
  825. 	menu_data.get_height = nil 
  826. 	menu_data.image_offset = nil 
  827. 	menu_data.check_color = nil 
  828. 	menu_data.on_nav = nil 
  829. 	menu_data.on_release = nil 
  830. 	menu_data.on_post_show = nil 
  831. 	menu_data.do_not_rebuild_previous = nil 
  832. end 
  833.  
  834. function pause_menu_prep_diversions(menu_data) 
  835. 	pause_menu_clear_funcs(menu_data) 
  836. 	menu_data.on_post_show = pause_menu_diversions_post_show 
  837. 	menu_data.get_width = pause_menu_diversions_get_width	 
  838. end 
  839.  
  840. function pause_menu_prep_diversions_stats(menu_data) 
  841. 	pause_menu_prep_diversions(menu_data) 
  842.  
  843. 	menu_data.do_not_rebuild_previous = true 
  844. 	menu_data.get_width = pause_menu_diversions_get_width 
  845. end 
  846.  
  847. function pause_menu_prep_diversions_stats_sub(menu_data) 
  848. 	pause_menu_clear_funcs(menu_data) 
  849.  
  850. 	menu_data.on_post_show = pause_menu_diversions_post_show 
  851. 	menu_data.do_not_rebuild_previous = true 
  852. 	menu_data.get_width = pause_menu_diversions_get_width 
  853. 	if menu_data.previous_idx == nil then 
  854. 		menu_data.previous_idx = Menu_active[Menu_active.highlighted_item].id 
  855. 		menu_data.previous_hl_item = Menu_active.highlighted_item 
  856. 	end 
  857. end 
  858.  
  859. function pause_menu_populate_diversions_menu(diversion_name, stars) 
  860. 	local idx = Pause_info_diversions_sub_menu.num_items  
  861.  
  862. 	Pause_info_diversions_sub_menu[idx] = {  
  863. 		label = diversion_name, type = PAUSE_MENU_CONTROL_DIVERSION_TEXT_LINE, show_value = true, value = stars, data_type = DIV_DATA_STAR, sub_menu = Pause_info_diversions_stat_menu, id = 7,  
  864. 	}	 
  865. 	 
  866. 	Pause_info_diversions_sub_menu.num_items = Pause_info_diversions_sub_menu.num_items + 1 
  867. end 
  868.  
  869. function pause_menu_populate_diversions_stat(stat_name, type_of_data, data, more) 
  870. 	local idx = Pause_info_diversions_stat_menu.num_items 
  871.  
  872. 	Pause_info_diversions_stat_menu[idx] = { label = stat_name, data_type = type_of_data, show_value = true } 
  873. --[[if type_of_data == DIV_DATA_CASH then 
  874. 		Pause_info_diversions_stat_menu[idx].value = "$" .. format_cash(data) 
  875. 	elseif type_of_data == DIV_DATA_X_OF_Y then 
  876. 		Pause_info_diversions_stat_menu[idx].value = data .. " of " .. y_value 
  877. 	elseif type_of_data == DIV_DATA_HHMMSS or type_of_data == DIV_DATA_MMSS then 
  878. 		Pause_info_diversions_stat_menu[idx].value = format_time(data) 
  879. 	else 
  880. 	 
  881. 	end 
  882. ]]-- 
  883. 	 
  884. 	Pause_info_diversions_stat_menu[idx].value = data	 
  885. 	 
  886. 	if more == true then 
  887. 		Pause_info_diversions_stat_menu[idx].type = PAUSE_MENU_CONTROL_DIVERSION_TEXT_LINE 
  888. 		Pause_info_diversions_stat_menu[idx].sub_menu = Pause_info_diversions_stat_sub_menu 
  889. 		Pause_info_diversions_stat_menu[idx].id = 8 
  890. 		Pause_info_diversions_stat_menu.btn_tips = Pause_menu_accept_back_btn_tips 
  891. 	else 
  892. 		Pause_info_diversions_stat_menu[idx].type = PAUSE_MENU_CONTROL_STAT_TEXT_LINE 
  893. 		Pause_info_diversions_stat_menu.btn_tips = Pause_menu_back_only 
  894. 	end 
  895. 	 
  896. 	Pause_info_diversions_stat_menu.num_items = Pause_info_diversions_stat_menu.num_items + 1 
  897. end 
  898.  
  899. function pause_menu_populate_diversions_stat_sub(stat_name, type_of_data, data, y_value) 
  900. 	local idx = Pause_info_diversions_stat_sub_menu.num_items 
  901. 	 
  902. 	Pause_info_diversions_stat_sub_menu[idx] = { label = stat_name, data_type = type_of_data, type = PAUSE_MENU_CONTROL_STAT_TEXT_LINE, show_value = true } 
  903. --[[if type_of_data == DIV_DATA_CASH then 
  904. 		Pause_info_diversions_stat_sub_menu[idx].value = "$" .. format_cash(data) 
  905. 	elseif type_of_data == DIV_DATA_X_OF_Y then 
  906. 		Pause_info_diversions_stat_sub_menu[idx].value = data .. " of " .. y_value 
  907. 	elseif type_of_data == DIV_DATA_HHMMSS or type_of_data == DIV_DATA_MMSS then 
  908. 		Pause_info_diversions_stat_sub_menu[idx].value = format_time(data) 
  909. 	else 
  910. 		 
  911. 	end 
  912. ]]--	 
  913. 	Pause_info_diversions_stat_sub_menu[idx].value = data 
  914. 	 
  915. 	Pause_info_diversions_stat_sub_menu.num_items = Pause_info_diversions_stat_sub_menu.num_items + 1 
  916. end 
  917.  
  918. function pause_menu_populate_hitman_list(location, target_index) 
  919. 	local idx = Pause_info_collection_sub_menu.num_items 
  920. 	 
  921. 	Pause_info_collection_sub_menu[idx] = { label = location, type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_diversions_sub_menu, id = 3, index = target_index } 
  922. 	Pause_info_collection_sub_menu.num_items = Pause_info_collection_sub_menu.num_items + 1 
  923. end 
  924.  
  925. function pause_menu_hitman_targets_width(menu_data) 
  926. 	return pause_menu_control_checkbox_image_compute_width(menu_data) + PAUSE_MENU_HITMAN_IMAGE_WIDTH + menu_data.image_offset.x 
  927. end 
  928.  
  929. function pause_menu_hitman_targets_height(menu_data) 
  930. 	return PAUSE_MENU_CHECKBOX_IMAGE_HEIGHT 
  931. end 
  932.  
  933. function pause_menu_create_special() 
  934. 	local idx, callback 
  935. 	--	Override the on_back and on_show 
  936. 	Pause_info_diversions_sub_menu.on_back = pause_menu_exit 
  937. 	Pause_info_diversions_sub_menu.on_pause = nil 
  938. 	Pause_info_diversions_sub_menu.on_show = nil 
  939. 	 
  940. 	--	Hitman 
  941. 	if pause_menu_get_state() == 1 then 
  942. 		Pause_info_diversions_sub_menu.header_label_str = "INFO_COLLECTIONS_HITMAN" 
  943. 		pause_menu_prep_hitman_targets(Pause_info_diversions_sub_menu) 
  944. 		 
  945. 		--Attach footer only if we are in special mode 
  946. 		btn_tips_footer_attach(Pause_info_diversions_sub_menu) 
  947. 		 
  948. 		callback = "pause_menu_populate_hitman_target" 
  949. 		idx = 3 
  950. 	-- Chopshop 
  951. 	elseif pause_menu_get_state() == 2 then 
  952. 		Pause_info_diversions_sub_menu.header_label_str = "INFO_COLLECTIONS_CHOPSHOP" 
  953. 		pause_menu_prep_chop_shop_vehicle(Pause_info_diversions_sub_menu) 
  954. 		callback = "pause_menu_populate_chop_shop_vehicle" 
  955. 		 
  956. 		--Attach footer only if we are in special mode 
  957. 		btn_tips_footer_attach(Pause_info_diversions_sub_menu) 
  958. 	 
  959. 		idx = 5 
  960. 	end 
  961. 	 
  962. 	Pause_info_diversions_sub_menu.num_items = 0 
  963. 	vint_dataresponder_request("pause_menu_populate", callback, 0, idx) 
  964. 	menu_show(Pause_info_diversions_sub_menu, MENU_TRANSITION_SWEEP_RIGHT) 
  965. end 
  966.  
  967. function pause_menu_hitman_chop_shop_post_show(menu_data) 
  968. 	-- Untint it 
  969. 	pause_menu_checkbox_image_post_show(menu_data) 
  970. end 
  971.  
  972. function pause_menu_prep_hitman_targets(menu_data) 
  973. 	pause_menu_init_check_box() 
  974. 	menu_data.get_width = pause_menu_hitman_targets_width 
  975. 	menu_data.get_height = pause_menu_hitman_targets_height 
  976. 	menu_data.image_offset = Pause_menu_hitman_offset 
  977. 	menu_data.on_post_show = pause_menu_hitman_chop_shop_post_show 
  978. 	menu_data.on_nav = pause_menu_checkbox_image_nav 
  979. 	menu_data.on_release = pause_menu_checkbox_image_release 
  980. 	menu_data.do_not_rebuild_previous = true 
  981. 	 
  982. 	vint_set_property(Pause_menu_check_box_image.text_h, "anchor", menu_data.image_offset.text.x, menu_data.image_offset.text.y) 
  983. 	vint_set_property(Pause_menu_check_box_image.text_h, "rotation", menu_data.image_offset.text.rot) 
  984. 	vint_set_property(Pause_menu_check_box_image.text_h, "wrap_width", menu_data.image_offset.text.wrap) 
  985. end 
  986.  
  987. function pause_menu_populate_hitman_target(name, dead, dossier, peg, image, location, current) 
  988. 	local idx = Pause_info_diversions_sub_menu.num_items  
  989. 	 
  990. 	local check_it = dead 
  991. 	local check_color 
  992. 	if current == true then 
  993. 		Pause_info_diversions_sub_menu.highlighted_item = idx 
  994. 		check_color = PAUSE_MENU_GREEN_CHECK_COLOR 
  995. 		check_it = true 
  996. 	else 
  997. 		check_color = PAUSE_MENU_RED_CHECK_COLOR 
  998. 	end 
  999. 	 
  1000. 	Pause_info_diversions_sub_menu[idx] = {  
  1001. 		type = PAUSE_MENU_CONTROL_CHECKBOX_IMAGE, label = name, 
  1002. 		on_select = pause_menu_hitman_target_select, 
  1003. 		checked = check_it, text = dossier, check_color = check_color, 
  1004. 		peg = peg, image = image,  
  1005. 		specific_label_top = "HITMAN_NAME", specific_text_top = name, 
  1006. 		specific_label_bottom = "HITMAN_LOCATION",  specific_text_bottom = location, 
  1007. 		dead = dead, 
  1008. 	}	 
  1009. 	 
  1010. 	Pause_info_diversions_sub_menu.num_items = Pause_info_diversions_sub_menu.num_items + 1 
  1011. end 
  1012.  
  1013. function pause_menu_populate_chop_shop_list(location, location_idx) 
  1014. 	local idx = Pause_info_collection_sub_menu.num_items 
  1015. 	 
  1016. 	Pause_info_collection_sub_menu[idx] = { label = location, type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_diversions_sub_menu, index = location_idx, id = 5 } 
  1017. 	Pause_info_collection_sub_menu.num_items = Pause_info_collection_sub_menu.num_items + 1 
  1018. end 
  1019.  
  1020. function pause_menu_chop_shop_vehicle_width(menu_data) 
  1021. 	return pause_menu_control_checkbox_image_compute_width(menu_data) + PAUSE_MENU_CHOPSHOP_IMAGE_WIDTH + menu_data.image_offset.x 
  1022. end 
  1023.  
  1024. function pause_menu_chop_shop_vehicle_height(menu_data) 
  1025. 	return PAUSE_MENU_CHOPSHOP_IMAGE_HEIGHT 
  1026. end 
  1027.  
  1028. function pause_menu_prep_chop_shop_vehicle(menu_data) 
  1029. 	pause_menu_init_check_box() 
  1030. 	menu_data.get_width = pause_menu_chop_shop_vehicle_width 
  1031. 	menu_data.get_height = pause_menu_chop_shop_vehicle_height 
  1032. 	menu_data.image_offset = Pause_menu_chop_shop_offset 
  1033. 	menu_data.on_post_show = pause_menu_hitman_chop_shop_post_show 
  1034. 	menu_data.on_nav = pause_menu_checkbox_image_nav 
  1035. 	menu_data.on_release = pause_menu_checkbox_image_release 
  1036. 	menu_data.do_not_rebuild_previous = true 
  1037. 	 
  1038. 	vint_set_property(Pause_menu_check_box_image.text_h, "anchor", menu_data.image_offset.text.x, menu_data.image_offset.text.y) 
  1039. 	vint_set_property(Pause_menu_check_box_image.text_h, "rotation", menu_data.image_offset.text.rot) 
  1040. 	vint_set_property(Pause_menu_check_box_image.text_h, "wrap_width", menu_data.image_offset.text.wrap) 
  1041. end 
  1042.  
  1043. function pause_menu_populate_chop_shop_vehicle(name, retrieved, dossier, peg, image, cash, respect, current) 
  1044. 	local idx = Pause_info_diversions_sub_menu.num_items  
  1045. 	local check_color 
  1046. 	local check_it = false 
  1047. 	if current == true then 
  1048. 		Pause_info_diversions_sub_menu.highlighted_item = idx 
  1049. 		if retrieved == false then 
  1050. 			check_color = PAUSE_MENU_GREEN_CHECK_COLOR 
  1051. 		else 
  1052. 			check_color = PAUSE_MENU_RED_CHECK_COLOR 
  1053. 		end 
  1054. 		 
  1055. 		check_it = true 
  1056. 	else 
  1057. 		check_color = PAUSE_MENU_RED_CHECK_COLOR 
  1058. 		if retrieved == true then 
  1059. 			check_it = true 
  1060. 		end 
  1061. 	end 
  1062. 	 
  1063. 	Pause_info_diversions_sub_menu[idx] = {  
  1064. 		type = PAUSE_MENU_CONTROL_CHECKBOX_IMAGE, label = name, 
  1065. 		on_select = pause_menu_chop_shop_vehicle_select, 
  1066. 		checked = check_it, text = dossier, check_color = check_color, 
  1067. 		peg = peg, image = image .. ".tga",  
  1068. 		specific_label_top = "CHOP_SHOP_CASH", specific_text_top = format_cash(cash), 
  1069. 		specific_label_bottom = "CHOP_SHOP_RESPECT",  specific_text_bottom = "+" .. respect, 
  1070. 		retrieved = retrieved, 
  1071. 	}	 
  1072. 	 
  1073. 	Pause_info_diversions_sub_menu.num_items = Pause_info_diversions_sub_menu.num_items + 1 
  1074. end 
  1075.  
  1076. function pause_menu_checkbox_image_nav(menu_data) 
  1077. 	------------------------------------------ 
  1078. 	--	This causes a flicker with the peg 
  1079. 	------------------------------------------ 
  1080. 	if Pause_menu_checkbox_image_peg ~= 0 then 
  1081. 		vint_set_property(Pause_menu_check_box_image.image_h, "visible", false) 
  1082. 		peg_unload(Pause_menu_checkbox_image_peg) 
  1083. 	end 
  1084. 	 
  1085. 	Pause_menu_checkbox_image_peg = menu_data[menu_data.highlighted_item].peg 
  1086.  
  1087. 	peg_load(Pause_menu_checkbox_image_peg) 
  1088.  
  1089. 	vint_set_property(Pause_menu_check_box_image.image_h, "anchor", Pause_menu_checkbox_image_width, menu_data.header_height + menu_data.image_offset.y) 
  1090. 	vint_set_property(Pause_menu_check_box_image.bitmap_h, "image", menu_data[menu_data.highlighted_item].image) 
  1091. 	vint_set_property(Pause_menu_check_box_image.text_h, "text_tag", menu_data[menu_data.highlighted_item].text) 
  1092. 	 
  1093. 	if menu_data[menu_data.highlighted_item].specific_text_top ~= nil then 
  1094. 		vint_set_property(Pause_menu_check_box_image.sp_text_h, "visible", true) 
  1095. 		vint_set_property(Pause_menu_check_box_image.sp_text_h, "anchor", menu_data.image_offset.specific_text.x, menu_data.image_offset.specific_text.y) 
  1096. 		vint_set_property(Pause_menu_check_box_image.sp_text_h, "rotation", menu_data.image_offset.specific_text.rot)		 
  1097. 		 
  1098. 		vint_set_property(Pause_menu_check_box_image.sp_label_top_h, "text_tag", menu_data[menu_data.highlighted_item].specific_label_top) 
  1099. 		vint_set_property(Pause_menu_check_box_image.sp_text_top_h, "text_tag", menu_data[menu_data.highlighted_item].specific_text_top) 
  1100. 		 
  1101. 		vint_set_property(Pause_menu_check_box_image.sp_label_top_h, "visible", true) 
  1102. 		vint_set_property(Pause_menu_check_box_image.sp_text_top_h, "visible", true) 
  1103.  
  1104. 		if menu_data[menu_data.highlighted_item].specific_text_bottom ~= nil then 
  1105. 			vint_set_property(Pause_menu_check_box_image.sp_label_bottom_h, "visible", true) 
  1106. 			vint_set_property(Pause_menu_check_box_image.sp_label_bottom_h, "text_tag", menu_data[menu_data.highlighted_item].specific_label_bottom) 
  1107. 			 
  1108. 			vint_set_property(Pause_menu_check_box_image.sp_text_bottom_h, "visible", true) 
  1109. 			vint_set_property(Pause_menu_check_box_image.sp_text_bottom_h, "text_tag", menu_data[menu_data.highlighted_item].specific_text_bottom) 
  1110. 		else 
  1111. 			vint_set_property(Pause_menu_check_box_image.sp_label_bottom_h, "visible", false) 
  1112. 			vint_set_property(Pause_menu_check_box_image.sp_text_bottom_h, "visible", false) 
  1113. 		end 
  1114. 		 
  1115. 	else 
  1116. 		vint_set_property(Pause_menu_check_box_image.specific_text_h, "visible", false) 
  1117. 	end 
  1118. 	 
  1119. 	vint_set_property(Pause_menu_check_box_image.text_h, "visible", true) 
  1120. 	vint_set_property(Pause_menu_check_box_image.image_h, "visible", true) 
  1121. 	vint_set_property(Pause_menu_check_box_image.image_h, "depth", -20) 
  1122. end 
  1123.  
  1124. function pause_menu_checkbox_image_post_show(menu_data) 
  1125. 	pause_menu_control_checkbox_image_resize_select_bar(menu_data) 
  1126. --	vint_set_property(Pause_menu_check_box_image.text_h, "anchor", menu_data.image_offset.text.x, menu_data.image_offset.text.y) 
  1127. 	vint_set_property(Pause_menu_check_box_image.image_h, "anchor", Pause_menu_checkbox_image_width + 900, menu_data.image_offset.text.y) 
  1128. --	vint_set_property(Pause_menu_check_box_image.text_h, "anchor", Pause_menu_checkbox_image_width, menu_data.image_offset.text.y) 
  1129. 	pause_menu_checkbox_image_nav(menu_data) 
  1130. end 
  1131.  
  1132. function pause_menu_checkbox_image_release(menu_data) 
  1133. 	if Pause_menu_checkbox_image_peg ~= 0 then 
  1134. 		peg_unload(Pause_menu_checkbox_image_peg) 
  1135. 		Pause_menu_checkbox_image_peg = 0; 
  1136. 	end 
  1137. 	 
  1138. 	vint_set_property(Pause_menu_check_box_image.image_h, "visible", false) 
  1139. end 
  1140.  
  1141.  
  1142. ----------------------[ Collection ]---------------------- 
  1143.  
  1144. function pause_menu_build_collection_menu(menu_data) 
  1145. 	Pause_info_collection_menu.num_items = 0 
  1146. 	 
  1147. 	vint_dataresponder_request("pause_menu_populate", Pause_info_menu_population_data[9].callback, 0, 9) 
  1148. end 
  1149.  
  1150. function pause_menu_populate_collection(value) 
  1151. 	local idx = Pause_info_collection_menu.num_items 
  1152. 	 
  1153. 	Pause_info_collection_menu[idx].value = value  
  1154. 		 
  1155. 	Pause_info_collection_menu.num_items = Pause_info_collection_menu.num_items + 1 
  1156. end 
  1157.  
  1158. ----------------------[ Unlockables ]---------------------- 
  1159. function pause_menu_populate_player_unlockables(display_name, event_text) 
  1160. 	local idx = Pause_info_unlockables_sub_menu.num_items 
  1161. 	 
  1162. 	Pause_info_unlockables_sub_menu[idx] = { label = display_name, show_value = true, value = event_text, type = PAUSE_MENU_CONTROL_STAT_TEXT_LINE, get_width = pause_menu_stat_get_width } 
  1163. 	 
  1164. 	Pause_info_unlockables_sub_menu.num_items = Pause_info_unlockables_sub_menu.num_items + 1 
  1165. end 
  1166.  
  1167. ----------------------[ Achievements ]---------------------- 
  1168. function pause_menu_do_achievements() 
  1169. 	pause_menu_open_achievements() 
  1170. end 
  1171.  
  1172. ----------------------[ Help ]---------------------- 
  1173. function pause_menu_populate_help_categories(title_tag) 
  1174. 	local idx = Pause_info_help_menu.num_items 
  1175. 	 
  1176. 	Pause_info_help_menu[idx] = { label = title_tag, type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_help_topics_menu, id = 12 } 
  1177. 	Pause_info_help_menu.num_items = Pause_info_help_menu.num_items + 1 
  1178. end 
  1179.  
  1180. function pause_menu_populate_help_topics(title_tag) 
  1181. 	local idx = Pause_info_help_topics_menu.num_items 
  1182. 	 
  1183. 	Pause_info_help_topics_menu[idx] = { label = title_tag, type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_help_sub_menu, id = 13 } 
  1184. 	Pause_info_help_topics_menu.num_items = Pause_info_help_topics_menu.num_items + 1 
  1185. end 
  1186.  
  1187. function pause_menu_prep_help_menu(menu_data) 
  1188. 	menu_data.get_width = pause_menu_control_help_text_get_width 
  1189. 	menu_data.get_height = pause_menu_control_help_text_get_height 
  1190. 	menu_data.on_post_show = pause_menu_finalize_help 
  1191. 	menu_data.do_not_rebuild_previous = true 
  1192. 	 
  1193. 	-- Destroy the old page group if it still exists 
  1194. --	if Pause_menu_page.grp_h ~= 0 and Pause_menu_page.grp_h ~= nil then 
  1195. 		--Do not destroy the old page group but reset the target 
  1196. 		--vint_object_destroy(Pause_menu_page.grp_h) 
  1197. --		Pause_menu_page.grp_h = 0 
  1198. --	end 
  1199. 	 
  1200. 	--Build a custom header  
  1201. --  local header_h = vint_object_clone(vint_object_find("pm_header_nav"), Menu_option_labels.control_parent) 
  1202. --	local header_label_h = vint_object_find("title", header_h) 
  1203. --	vint_set_property(header_label_h, "text_tag", menu_data.header_label_str) 
  1204. --	vint_set_property(header_h, "anchor", 0, 0) 
  1205. --	vint_set_property(header_h, "visible", true) 
  1206. 	 
  1207. --	local header_nav_size = 105	--Size of header element 
  1208. --	Menu_option_labels.header_h = header_h 
  1209. 	 
  1210. 	--reset our standard label string 
  1211. --	menu_data.header_label_str = nil 
  1212. 	 
  1213. --	local header_label_width, header_label_height = element_get_actual_size(header_label_h) 
  1214. 	 
  1215. 	--Calculate Header width to include the new header nav object 
  1216. --	menu_data.header_width = header_nav_size + header_label_width + 20 
  1217. 		 
  1218. 	--	Initialize the new pages 
  1219. --	Pause_menu_page.max = 1 
  1220. --	Pause_menu_page.current = 1 
  1221. 	 
  1222. 	--	Display the new page indicator 
  1223. --	Pause_menu_page.label_h = vint_object_find("nav_id", header_h) 
  1224. --	vint_set_property(Pause_menu_page.label_h, "visible", false) 
  1225. --	Pause_menu_page.arrow_e = vint_object_find("pm_arrow_e", header_h) 
  1226. --	vint_set_property(Pause_menu_page.arrow_e, "visible", false) 
  1227. --	Pause_menu_page.arrow_w = vint_object_find("pm_arrow_w", header_h) 
  1228. --	vint_set_property(Pause_menu_page.arrow_w, "visible", false) 
  1229. --	vint_set_property(Pause_menu_page.label_h, "text_tag", Pause_menu_page.current .. "/" .. Pause_menu_page.max) 
  1230. 	 
  1231. --	menu_data.on_release = pause_menu_release_page 
  1232. end 
  1233.  
  1234. function pause_menu_prep_help_topics(menu_data) 
  1235. 	menu_data.do_not_rebuild_previous = true 
  1236. end 
  1237.  
  1238. function pause_menu_finalize_help(menu_data) 
  1239. 		 
  1240. 	--Adjust the page indicator(arrows) in header 
  1241. 	local header_nav_h = vint_object_find("header_nav", Menu_option_labels.header_h) 
  1242. 	local ax, ay = vint_get_property(header_nav_h, "anchor") 
  1243. 	vint_set_property(header_nav_h, "anchor", menu_data.menu_width, ay) 
  1244. 		 
  1245. 	--Set Header line width 
  1246. 	vint_set_property(vint_object_find("header_horz", Menu_option_labels.header_h), "source_se", menu_data.menu_width - 10, 10) 
  1247. 	 
  1248. 	--Hide scroll bar 
  1249. 	menu_scroll_bar_hide() 
  1250. 	 
  1251. 	--	Set the max for the pages and update the numbers 
  1252. 	local w, h = element_get_actual_size(Menu_option_labels[0].real_label_h) 
  1253. 	 
  1254. 	Pause_menu_page.max = ceil(h / PAUSE_MENU_HELP_TEXT_CLIP_HEIGHT)	--	Get the amount of pages we've got. 
  1255. 	-- pause_menu_update_page() 
  1256. end 
  1257.  
  1258. function pause_menu_populate_help(description_tag) 
  1259. 	local idx = Pause_info_help_sub_menu.num_items 
  1260. 	Pause_info_help_sub_menu[idx] = { label = description_tag, type = PAUSE_MENU_CONTROL_HELP_TEXT } 
  1261. 	Pause_info_help_sub_menu.num_items = 1	--	Should never be more than one 
  1262. 	Pause_info_help_sub_menu.btn_tips = Pause_menu_back_only 
  1263. end 
  1264.  
  1265.  
  1266. -------------------------------- 
  1267. --------[ OPTIONS MENU ]--------  
  1268. -------------------------------- 
  1269. function pause_menu_quit_game_confirm(result, action) 
  1270. 	if action ~= DIALOG_ACTION_CLOSE then 
  1271. 		return 
  1272. 	end 
  1273. 	 
  1274. 	if result == 0 then 
  1275. 		Quit_game = true 
  1276. 		Menu_fade_to_black = true 
  1277. 		pause_menu_exit() 
  1278. 	end 
  1279. end 
  1280.  
  1281. function pause_menu_quit_game() 
  1282. 	if mp_is_enabled() == true then 
  1283. 		dialog_box_confirmation("PAUSE_MENU_QUIT_TITLE","QUIT_GAME_TEXT_SHORT","pause_menu_quit_game_confirm") 
  1284. 	else 
  1285. 		dialog_box_confirmation("PAUSE_MENU_QUIT_TITLE","QUIT_GAME_TEXT_FULL","pause_menu_quit_game_confirm") 
  1286. 	end 
  1287. end 
  1288.  
  1289. function pause_menu_options_exit_confirm() 
  1290. 	Pause_menu_swap_to_map = false 
  1291. 	if pause_menu_options_is_dirty() == false then 
  1292. 		pause_menu_exit() 
  1293. 		return 
  1294. 	end	 
  1295. 	Pause_menu_exit_after = true 
  1296. 	local options = { [0] = "PAUSE_MENU_ACCEPT", [1] = "PAUSE_MENU_REVERT", [2] = "CONTROL_CANCEL" } 
  1297. 	dialog_box_open("MENU_TITLE_NOTICE", "PLAYER_CREATION_SAVE_CHANGES", options, "pause_menu_option_accept_changes", 0, DIALOG_PRIORITY_ACTION) 
  1298. end 
  1299.  
  1300. function pause_menu_options_submenu_exit_confirm(menu_label, menu_data) 
  1301. 	pause_menu_option_revert(menu_label, menu_data);   
  1302. end 
  1303.  
  1304. function pause_menu_options_swap_confirm() 
  1305. 	if Pause_menu_no_swap == true then 
  1306. 		return 
  1307. 	end 
  1308. 	 
  1309. 	if pause_menu_can_swap() == false then 
  1310. 		return 
  1311. 	end 
  1312. 	 
  1313. 	Pause_menu_swap_to_map = true 
  1314. 	if pause_menu_options_is_dirty() == false then 
  1315. 		pause_menu_exit() 
  1316. 		return 
  1317. 	end 
  1318. 	Pause_menu_exit_after = true 
  1319. 	local options = { [0] = "PAUSE_MENU_ACCEPT", [1] = "PAUSE_MENU_REVERT", [2] = "CONTROL_CANCEL" } 
  1320. 	dialog_box_open("MENU_TITLE_NOTICE", "PLAYER_CREATION_SAVE_CHANGES", options, "pause_menu_option_accept_changes", 0, DIALOG_PRIORITY_ACTION) 
  1321. end	 
  1322.  
  1323. function pause_menu_option_accept() 
  1324. 	pause_menu_option_accept_changes(0, DIALOG_ACTION_CLOSE) 
  1325. end 
  1326.  
  1327. function pause_menu_option_revert(menu_label, menu_data) 
  1328. 	if pause_menu_options_is_dirty() == true then 
  1329. 		local options = { [0] = "PAUSE_MENU_ACCEPT", [1] = "PAUSE_MENU_REVERT", [2] = "CONTROL_CANCEL" } 
  1330. 		dialog_box_open("MENU_TITLE_NOTICE", "PLAYER_CREATION_SAVE_CHANGES", options, "pause_menu_option_accept_changes", 0, DIALOG_PRIORITY_ACTION) 
  1331. 	else 
  1332. 		if Pause_menu_current_option_menu == PAUSE_MENU_DISPLAY_ID then 
  1333. 			Menu_active[2].initialized = nil 
  1334. 			Menu_active[3].initialized = nil 
  1335. 		end 
  1336. 		 
  1337. 		if Pause_menu_option_horz_swap_menu ~= -1 then 
  1338. 			menu_horz_do_nav(Pause_menu_option_horz_swap_menu) 
  1339. 			menu_show(Menu_horz_active[Pause_menu_option_horz_swap_menu].sub_menu, MENU_TRANSITION_SWAP) 
  1340. 			Pause_menu_option_horz_swap_menu = -1 
  1341. 		else 
  1342. 			menu_show(Pause_options_menu, MENU_TRANSITION_SWEEP_RIGHT) 
  1343. 		end 
  1344. 		audio_play(Menu_sound_back) 
  1345. 	end 
  1346. end 
  1347.  
  1348. function pause_menu_option_revert_adv(menu_label, menu_data) 
  1349. 	if pause_menu_options_is_dirty() == true then 
  1350. 		local options = { [0] = "PAUSE_MENU_ACCEPT", [1] = "PAUSE_MENU_REVERT", [2] = "CONTROL_CANCEL" } 
  1351. 		dialog_box_open("MENU_TITLE_NOTICE", "PLAYER_CREATION_SAVE_CHANGES", options, "pause_menu_option_accept_changes_adv", 0, DIALOG_PRIORITY_ACTION) 
  1352. 	else 
  1353. 		if Pause_menu_option_horz_swap_menu ~= -1 then 
  1354. 			menu_horz_do_nav(Pause_menu_option_horz_swap_menu) 
  1355. 			menu_show(Menu_horz_active[Pause_menu_option_horz_swap_menu].sub_menu, MENU_TRANSITION_SWAP) 
  1356. 			Pause_menu_option_horz_swap_menu = -1 
  1357. 		else 
  1358. 			menu_show(Pause_display_menu_PC, MENU_TRANSITION_SWEEP_RIGHT) 
  1359. 		end 
  1360. 		audio_play(Menu_sound_back) 
  1361. 	end 
  1362. end 
  1363.  
  1364. function pause_menu_option_accept_horz(horz_selection) 
  1365. 	Pause_menu_option_horz_swap_menu = horz_selection 
  1366. 	pause_menu_option_revert() 
  1367. end 
  1368.  
  1369. function pause_menu_option_accept_changes(result, action) 
  1370. 	if action ~= DIALOG_ACTION_CLOSE then 
  1371. 		return 
  1372. 	end 
  1373. 	 
  1374. 	if result == 0 then	-- Accept 
  1375. 		pause_menu_accept_options(Pause_menu_current_option_menu) 
  1376. 		if Pause_menu_current_option_menu == PAUSE_MENU_DISPLAY_ID then 
  1377. 			Menu_active[2].initialized = nil 
  1378. 			Menu_active[3].initialized = nil 
  1379. 		end 
  1380. 		 
  1381. 		if Pause_menu_option_horz_swap_menu ~= -1 then 
  1382. 			menu_horz_do_nav(Pause_menu_option_horz_swap_menu) 
  1383. 			menu_show(Menu_horz_active[Pause_menu_option_horz_swap_menu].sub_menu, MENU_TRANSITION_SWAP) 
  1384. 			Pause_menu_option_horz_swap_menu = -1 
  1385. 		else 
  1386. 			if Pause_menu_exit_after == true then 
  1387. 				pause_menu_exit() 
  1388. 				return 
  1389. 			end 
  1390. 			 
  1391. 			menu_show(Pause_options_menu, MENU_TRANSITION_SWEEP_RIGHT) 
  1392. 		end 
  1393. 		audio_play(Menu_sound_back) 
  1394. 	elseif result == 1 then -- Revert 
  1395. 		pause_menu_revert_options(Pause_menu_current_option_menu) 
  1396. 		if Pause_menu_exit_after == true then 
  1397. 			pause_menu_exit() 
  1398. 			return 
  1399. 		end 
  1400. 		 
  1401. 		if Pause_menu_current_option_menu == PAUSE_MENU_DIFFICULTY_ID then 
  1402. 			vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_control_options", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_DIFFICULTY_ID, false) 
  1403. 			Menu_active.highlighted_item = Pause_menu_current_difficulty 
  1404. 	 
  1405. 		elseif Pause_menu_current_option_menu == PAUSE_MENU_CONTROL_ID then 
  1406. 			vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_control_options", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_CONTROL_ID, false) 
  1407. 		elseif Pause_menu_current_option_menu == PAUSE_MENU_DISPLAY_ID then 
  1408. 			Menu_active[2].initialized = nil 
  1409. 			Menu_active[3].initialized = nil 
  1410. 			vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_display", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_DISPLAY_ID, false) 
  1411. 		elseif Pause_menu_current_option_menu == PAUSE_MENU_AUDIO_ID then 
  1412. 			vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_audio", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_AUDIO_ID, false) 
  1413. 		end 
  1414. 		menu_update_labels() 
  1415. 		menu_update_nav_bar(Menu_active.highlighted_item) 
  1416.  
  1417. --		audio_play(Menu_sound_back) 
  1418. 	end 
  1419. 	 
  1420. 	Pause_menu_exit_after = false 
  1421. 	Pause_menu_swap_to_map = false 
  1422. end 
  1423.  
  1424. function pause_menu_control_scheme_width(menu_data) 
  1425. 	local w,h = vint_get_property(Pause_menu_control_scheme_data.grp_h, "screen_size") 
  1426. 	 
  1427. 	return w * Menu_scaler 
  1428. end 
  1429.  
  1430. function pause_menu_control_scheme_height(menu_data) 
  1431. 	return PAUSE_MENU_CHECKBOX_IMAGE_HEIGHT 
  1432. end 
  1433.  
  1434. function pause_menu_exit_control_scheme(menu_data) 
  1435. 	if Pause_menu_control_scheme_data.grp_h ~= 0 then 
  1436. 		vint_object_destroy(Pause_menu_control_scheme_data.grp_h) 
  1437. 		Pause_menu_control_scheme_data.grp_h = 0 
  1438. 	end 
  1439. 	 
  1440. 	if Pause_menu_controller_image_peg ~= 0 then 
  1441. 		peg_unload(Pause_menu_controller_image_peg) 
  1442. 		Pause_menu_controller_image_peg = 0 
  1443. 	end 
  1444. 	 
  1445. 	if Pause_menu_control_scheme_data.thread_h ~= nil then 
  1446. 		thread_kill(Pause_menu_control_scheme_data.thread_h) 
  1447. 		Pause_menu_control_scheme_data.thread_h = nil 
  1448. 	end 
  1449. 	 
  1450. 	pause_menu_control_scheme_init(false) 
  1451. end 
  1452.  
  1453. function pause_menu_control_scheme_adjust_tags() 
  1454. 	local click_handles = { 
  1455. 		left = { 
  1456. 			[0] = vint_object_find("3_lbl", Pause_menu_control_scheme_data.grp_h), 
  1457. 			[1] = vint_object_find("4_lbl", Pause_menu_control_scheme_data.grp_h), 
  1458. 		}, 
  1459.  
  1460. 		right = { 
  1461. 			[0] = vint_object_find("16_lbl", Pause_menu_control_scheme_data.grp_h),	-- STATIC 
  1462. 			[1] = vint_object_find("17_lbl", Pause_menu_control_scheme_data.grp_h), 
  1463. 		} 
  1464. 	} 
  1465. 	 
  1466. 	local text_handles = { 
  1467. 		left = { 
  1468. 			[0] = vint_object_find("3_txt", Pause_menu_control_scheme_data.grp_h), 
  1469. 			[1] = vint_object_find("4_txt", Pause_menu_control_scheme_data.grp_h), 
  1470. 		}, 
  1471.  
  1472. 		right = { 
  1473. 			[0] = vint_object_find("16_txt", Pause_menu_control_scheme_data.grp_h),	-- STATIC 
  1474. 			[1] = vint_object_find("17_txt", Pause_menu_control_scheme_data.grp_h), 
  1475. 		} 
  1476. 	} 
  1477. 	 
  1478. 	local x,y 
  1479. 	local w,h 
  1480. 	local max_w = 0 
  1481. 	 
  1482. 	-- Find max width on the left 
  1483. 	for i = 0, 1 do  
  1484. 		if i ~= 0 then 
  1485. 			if get_platform() == "PS3" then 
  1486. 				vint_set_property(click_handles.left[i], "text_tag", "L3") 
  1487. 			else 
  1488. 				vint_set_property(click_handles.left[i], "text_tag", "PAUSE_MENU_CONTROL_CLICK") 
  1489. 			end 
  1490. 		end 
  1491. 		 
  1492. 		w,h = element_get_actual_size(click_handles.left[i]) 
  1493. 		 
  1494. 		if w > max_w then 
  1495. 			max_w = w 
  1496. 		end 
  1497. 	end 
  1498.  
  1499. 	-- Adjust tags 
  1500. 	max_w = max_w + 5 
  1501. 	for i = 0, 1 do 
  1502. 		x,y = vint_get_property(text_handles.left[i], "anchor") 
  1503. 		vint_set_property(text_handles.left[i], "anchor", max_w, y) 
  1504. 	end 
  1505.  
  1506. 	-- Find max width on the right 
  1507. 	max_w = 0 
  1508. 	for i = 0, 1 do  
  1509. 		if i ~= 0 then 
  1510. 			if get_platform() == "PS3" then 
  1511. 				vint_set_property(click_handles.right[i], "text_tag", "R3") 
  1512. 			else 
  1513. 				vint_set_property(click_handles.right[i], "text_tag", "PAUSE_MENU_CONTROL_CLICK") 
  1514. 			end 
  1515. 		end 
  1516. 		 
  1517. 		w,h = element_get_actual_size(click_handles.right[i]) 
  1518. 		 
  1519. 		if w > max_w then 
  1520. 			max_w = w 
  1521. 		end 
  1522. 	end 
  1523. 	 
  1524. 	-- Adjust tags 
  1525. 	max_w = max_w + 5 
  1526. 	for i = 0, 1 do 
  1527. 		x,y = vint_get_property(text_handles.right[i], "anchor") 
  1528. 		x = vint_get_property(click_handles.right[i], "anchor") 
  1529. 		x = x - max_w 
  1530. 		vint_set_property(text_handles.right[i], "anchor", x, y) 
  1531. 	end 
  1532. 	 
  1533. 	 
  1534. end 
  1535.  
  1536. function pause_menu_build_control_scheme_menu(menu_data) 
  1537. 	local idx = Menu_active.highlighted_item 
  1538. 	menu_data.header_label_str = Menu_active[idx].label 
  1539. 	 
  1540. 	local which_controller, which_scheme, num_buttons = pause_menu_control_scheme_init(true, idx) 
  1541. 	local grp_h = 0 
  1542. 	 
  1543. 	if which_controller == 0 then 
  1544. 		Pause_menu_controller_image_peg = "ui_controls_360" 
  1545. 		peg_load(Pause_menu_controller_image_peg) 
  1546. 		grp_h = vint_object_clone(vint_object_find("ctrls_360"), Menu_option_labels.control_parent) 
  1547. 	else  
  1548. 		Pause_menu_controller_image_peg = "ui_controls_ps3" 
  1549. 		peg_load(Pause_menu_controller_image_peg) 
  1550. 		grp_h = vint_object_clone(vint_object_find("ctrls_PS3"), Menu_option_labels.control_parent) 
  1551. 	end 
  1552. 	 
  1553. 	-- Anchor it 
  1554. 	local x, y = vint_get_property(Menu_option_labels[0].label_h, "anchor") 
  1555. 	local w, h = element_get_actual_size(Menu_option_labels[0].label_h) 
  1556. 	 
  1557. 	vint_set_property(grp_h, "anchor", x, y + h) 
  1558. 	vint_set_property(grp_h, "visible", true) 
  1559.  
  1560. 	Pause_menu_controller = {  
  1561. 		["L1"] 						= { labels = { }, num_buttons = 0, cur_button = 0,  
  1562. 										  handles = { button_h = vint_object_find("1_txt", grp_h), label_h = vint_object_find("1_lbl", grp_h) } }, 
  1563. 		["L2"] 						= { labels = { }, num_buttons = 0, cur_button = 0,  
  1564. 										  handles = { button_h = vint_object_find("0_txt", grp_h), label_h = vint_object_find("0_lbl", grp_h) } }, 
  1565. 		["analog left"] 			= { labels = { }, num_buttons = 0, cur_button = 0,  
  1566. 										  handles = { button_h = vint_object_find("3_txt", grp_h), label_h = vint_object_find("3_lbl", grp_h) } }, 
  1567. 		["analog left click 1"]	= { labels = { }, num_buttons = 0, cur_button = 0,  
  1568. 										  handles = { button_h = vint_object_find("4_txt", grp_h), label_h = vint_object_find("4_lbl", grp_h) } }, 
  1569. 		["analog left click 2"]	= { labels = { }, num_buttons = 0, cur_button = 0,  
  1570. 										  handles = { button_h = 0, label_h = 0 } }, 
  1571. 		["dpad up"]					= { labels = { }, num_buttons = 0, cur_button = 0,  
  1572. 										  handles = { button_h = vint_object_find("6_txt", grp_h), label_h = vint_object_find("6_lbl", grp_h) } }, 
  1573. 		["dpad left"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  1574. 										  handles = { button_h = vint_object_find("7_txt", grp_h), label_h = vint_object_find("7_lbl", grp_h) } }, 
  1575. 		["dpad down"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  1576. 										  handles = { button_h = vint_object_find("8_txt", grp_h), label_h = vint_object_find("8_lbl", grp_h) } }, 
  1577. 		["dpad right"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  1578. 										  handles = { button_h = vint_object_find("9_txt", grp_h), label_h = vint_object_find("9_lbl", grp_h) } }, 
  1579. 		["R2"]						= { labels = { }, num_buttons = 0, cur_button = 0,  
  1580. 										  handles = { button_h = vint_object_find("10_txt", grp_h), label_h = vint_object_find("10_lbl", grp_h) } }, 
  1581. 		["R1"]						= { labels = { }, num_buttons = 0, cur_button = 0,  
  1582. 										  handles = { button_h = vint_object_find("11_txt", grp_h), label_h = vint_object_find("11_lbl", grp_h) } }, 
  1583. 		["button y"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  1584. 										  handles = { button_h = vint_object_find("12_txt", grp_h), label_h = vint_object_find("12_lbl", grp_h) } }, 
  1585. 		["button b"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  1586. 										  handles = { button_h = vint_object_find("13_txt", grp_h), label_h = vint_object_find("13_lbl", grp_h) } }, 
  1587. 		["button a"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  1588. 										  handles = { button_h = vint_object_find("14_txt", grp_h), label_h = vint_object_find("14_lbl", grp_h) } }, 
  1589. 		["button x"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  1590. 										  handles = { button_h = vint_object_find("15_txt", grp_h), label_h = vint_object_find("15_lbl", grp_h) } }, 
  1591. 		["analog right"]			= { labels = { }, num_buttons = 0, cur_button = 0,  
  1592. 										  handles = { button_h = vint_object_find("16_txt", grp_h), label_h = vint_object_find("16_lbl", grp_h) } }, 
  1593. 		["analog right click"]	= { labels = { }, num_buttons = 0, cur_button = 0,  
  1594. 										  handles = { button_h = vint_object_find("17_txt", grp_h), label_h = vint_object_find("17_lbl", grp_h) } }, 
  1595. 		["back"]						= { labels = { }, num_buttons = 0, cur_button = 0,  
  1596. 										  handles = { button_h = vint_object_find("19_txt", grp_h), label_h = 0 } }, 
  1597. 		["start"]					= { labels = { }, num_buttons = 0, cur_button = 0,  
  1598. 										  handles = { button_h = vint_object_find("18_txt", grp_h), label_h = 0 } },  
  1599. 	} 
  1600. 	 
  1601. 	for idx, val in Pause_menu_controller do 
  1602. 		vint_set_property(val.handles.button_h, "visible", false) 
  1603. 		vint_set_property(val.handles.label_h, "visible", false) 
  1604. 	end 
  1605.  
  1606. 	Pause_menu_control_scheme_data.grp_h = grp_h 
  1607. 	menu_data.get_width = pause_menu_control_scheme_width 
  1608. 	menu_data.get_height = pause_menu_control_scheme_height 
  1609. 	control_scheme_values.cur_value = which_scheme 
  1610. 	 
  1611. 	if Pause_menu_control_scheme_data.thread_h ~= nil then 
  1612. 		thread_kill(Pause_menu_control_scheme_data.thread_h) 
  1613. 	end 
  1614. 		 
  1615. 	 
  1616. 	Pause_menu_control_scheme_data.thread_h = thread_new("pause_menu_control_cycle") 
  1617. --	Pause_menu_control_scheme_data.tween_h = tween_h 
  1618. 	 
  1619. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_control_scheme", 0, PAUSE_MENU_CONTROL_SCHEME_ID, which_scheme) 
  1620. 	 
  1621. 	pause_menu_control_scheme_adjust_tags() 
  1622. end 
  1623.  
  1624. function pause_menu_control_cycle() 
  1625. 	while true do 
  1626. 		delay(2) 
  1627. 		for i, val in Pause_menu_controller do 
  1628. 			local num_buttons = val.num_buttons 
  1629. 			local cur_button = val.cur_button 
  1630. 			 
  1631. 			cur_button = cur_button + 1 
  1632. 			if cur_button >= num_buttons then 
  1633. 				cur_button = 0 
  1634. 			end 
  1635. 			 
  1636. 			if cur_button ~= val.cur_button then 
  1637. 				val.cur_button = cur_button 
  1638. 				vint_set_property(val.handles.button_h, "text_tag", val.labels[cur_button])	 
  1639. 			end 
  1640. 		end 
  1641. 	end 
  1642. end 
  1643.  
  1644. function pause_menu_rebuild_control_scheme(menu_label, menu_data) 
  1645. 	for idx, val in Pause_menu_controller do 
  1646. 		vint_set_property(val.handles.button_h, "visible", false) 
  1647. 		vint_set_property(val.handles.label_h, "visible", false) 
  1648. 		val.num_buttons = 0 
  1649. 		val.cur_button = 0 
  1650. 	end 
  1651.  
  1652. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_control_scheme", 0, PAUSE_MENU_CONTROL_SCHEME_ID, control_scheme_values.cur_value) 
  1653. end 
  1654.  
  1655. Pause_menu_control_scheme_last = false 
  1656. function pause_menu_populate_control_scheme(button_name, button) 
  1657. 	local num_buttons = Pause_menu_controller[button_name].num_buttons 
  1658. 	Pause_menu_controller[button_name].labels[num_buttons] = button 
  1659. 	 
  1660. 	if num_buttons == 0 then 
  1661. 		vint_set_property(Pause_menu_controller[button_name].handles.button_h, "visible", true) 
  1662. 		vint_set_property(Pause_menu_controller[button_name].handles.button_h, "text_tag", button) 
  1663. 		 
  1664. 		if Pause_menu_controller[button_name].handles.label_h ~= 0 then  
  1665. 			vint_set_property(Pause_menu_controller[button_name].handles.label_h, "visible", true) 
  1666. 		end	 
  1667. 	end 
  1668. 	 
  1669. 	Pause_menu_controller[button_name].num_buttons = num_buttons + 1 
  1670. end 
  1671.  
  1672. function pause_menu_control_scheme_on_back(menu_label, menu_data) 
  1673. 	pause_menu_change_control_scheme(control_scheme_values.cur_value) 
  1674. 	Pause_menu_control_scheme_last = true 
  1675. 	audio_play(Menu_sound_back) 
  1676. 	menu_show(Menu_active.parent_menu, MENU_TRANSITION_SWEEP_RIGHT) 
  1677. end 
  1678.  
  1679. function pause_menu_control_update_scheme(menu_label, menu_data) 
  1680. 	pause_menu_change_control_scheme(control_scheme_values.cur_value) 
  1681. 	Pause_menu_control_scheme_last = true 
  1682. 	menu_show(Menu_active.parent_menu, MENU_TRANSITION_SWEEP_RIGHT) 
  1683. 	audio_play(Menu_sound_back) 
  1684. end 
  1685.  
  1686. function pause_menu_build_control_options_menu(menu_data) 
  1687. 	Pause_menu_current_option_menu = PAUSE_MENU_CONTROL_ID 
  1688. 	menu_data.parent_menu = nil 
  1689.  
  1690. 	-- set the label for the six axis sensor.  
  1691. 	if get_platform() == "PS3" then 
  1692. 		Pause_control_menu[7].label = "SIXAXIS_SENSOR" 
  1693. 	end 
  1694.  
  1695. 	local store_options = true 
  1696. 	if Pause_menu_control_scheme_last == true then 
  1697. 		store_options = false 
  1698. 		Pause_menu_control_scheme_last = false 
  1699. 	end 
  1700. 	 
  1701. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_control_options", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_CONTROL_ID, store_options) 
  1702. end 
  1703.  
  1704. function pause_menu_build_difficulty_options_menu (menu_data) 
  1705. 	Pause_menu_current_option_menu = PAUSE_MENU_DIFFICULTY_ID  
  1706. 	menu_data.parent_menu = nil 
  1707. 	menu_data.highlighted_item = get_current_difficulty() 
  1708. 	Pause_menu_current_difficulty = menu_data.highlighted_item 
  1709. 	if get_is_host() == false then 
  1710. 		for i = 0, menu_data.num_items - 1 do 
  1711. 			if i ~= menu_data.highlighted_item then 
  1712. 				menu_data[i].disabled = true 
  1713. 			end 
  1714. 		end 
  1715. 	end 
  1716. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_control_options", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_DIFFICULTY_ID, true) 
  1717.  
  1718. end 
  1719.  
  1720. function pause_menu_difficulty_nav(menu_label, menu_data) 
  1721. 	game_difficulty_select(Pause_difficulty_menu[Pause_difficulty_menu.highlighted_item].difficulty_level )	 
  1722. end 
  1723.  
  1724.  
  1725. function pause_menu_populate_control_options(invert_y, invert_rot, left_stick, v_sense, h_sense, vibration, crouch_toggle, v_msens, h_msens ) 
  1726. 	invert_y_slider_values.cur_value = invert_y 
  1727. 	invert_rot_slider_values.cur_value  = invert_rot 
  1728. 	left_stick_slider_values.cur_value  = left_stick 
  1729. 	Pause_control_menu_PC[6].cur_value = v_sense 
  1730. 	Pause_control_menu_PC[7].cur_value = h_sense 
  1731. 	Pause_control_menu_PC[4].cur_value = v_msens 
  1732. 	Pause_control_menu_PC[5].cur_value = h_msens 
  1733.  
  1734. 	if vibration == true then 
  1735. 		vibration = 1 
  1736. 	else 
  1737. 		vibration = 0 
  1738. 	end 
  1739. 	 
  1740. 	vibration_slider_values.cur_value  = vibration 
  1741. 	crouch_slider_values.cur_value  = crouch_toggle 
  1742. 	 
  1743. 	if Pause_control_menu_PC.highlighted_item == nil then 
  1744. 		Pause_control_menu_PC.highlighted_item = 0 
  1745. 	end 
  1746. 	 
  1747. 	pause_menu_control_options_nav() 
  1748. end 
  1749.  
  1750. function  pause_menu_control_options_nav(menu_label, menu_data) 
  1751. 	if Pause_control_menu.highlighted_item == 0 or Pause_control_menu.highlighted_item == 1 then 
  1752. 		Pause_options_btn_tips.a_button.label = "CONTROL_SELECT" 
  1753. 	else  
  1754. 		Pause_options_btn_tips.a_button.label = "PAUSE_MENU_ACCEPT" 
  1755. 	end 
  1756. 	 
  1757. 	btn_tips_update() 
  1758. end 
  1759.  
  1760. function pause_menu_control_options_update_value(menu_label, menu_data) 
  1761. 	local idx = menu_data.id 
  1762. 	if menu_data.type == MENU_ITEM_TYPE_NUM_SLIDER then 
  1763. 		pause_menu_update_option(PAUSE_MENU_CONTROL_ID, idx, false, menu_data.cur_value) 
  1764. 		local h = vint_object_find("value_text", menu_label.control.grp_h) 
  1765. 		vint_set_property(h, "text_tag", floor(menu_data.cur_value * 100) .. "%%") 
  1766. 	else 
  1767. 		local boolean = false 
  1768. 		if menu_data.text_slider_values.cur_value == 1 then 
  1769. 			boolean = true 
  1770. 		end 
  1771. 		pause_menu_update_option(PAUSE_MENU_CONTROL_ID, idx, boolean) 
  1772. 	end 
  1773. end 
  1774.  
  1775. function pause_menu_options_on_show() 
  1776. 	pause_menu_init_options() 
  1777. end 
  1778.  
  1779. function pause_menu_options_restore_defaults(menu_data) 
  1780. 	local options = { [0] = "PAUSE_MENU_ACCEPT", [1] = "CONTROL_CANCEL" } 
  1781. 	dialog_box_open("OPTIONS_MENU_DEFAULTS_TITLE", "OPTIONS_MENU_DEFAULTS_DESC", options, "pm_option_restore_defaults", 0, DIALOG_PRIORITY_ACTION) 
  1782. end 
  1783.  
  1784. function pm_option_restore_defaults(result, action) 
  1785. 	if action ~= DIALOG_ACTION_CLOSE then 
  1786. 		return 
  1787. 	end 
  1788. 	 
  1789. 	if result == 0 then 
  1790. 		pause_menu_restore_defaults(Pause_menu_current_option_menu) 
  1791. 		if Pause_menu_current_option_menu == PAUSE_MENU_DIFFICULTY_ID then 
  1792. 			vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_control_options", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_DIFFICULTY_ID, false) 
  1793. 		elseif Pause_menu_current_option_menu == PAUSE_MENU_CONTROL_ID then 
  1794. 			vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_control_options", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_CONTROL_ID, false) 
  1795. 		elseif Pause_menu_current_option_menu == PAUSE_MENU_DISPLAY_ID then 
  1796. 			Menu_active[2].initialized = nil 
  1797. 			Menu_active[3].initialized = nil 
  1798. 			vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_display", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_DISPLAY_ID, false) 
  1799. 		elseif Pause_menu_current_option_menu == PAUSE_MENU_AUDIO_ID then 
  1800. 			vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_audio", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_AUDIO_ID, false) 
  1801. 		end 
  1802. 		menu_update_labels() 
  1803. 		menu_update_nav_bar(Menu_active.highlighted_item) 
  1804. 	end	 
  1805. end 
  1806.  
  1807. function pause_menu_build_display_options_menu(menu_data) 
  1808. 	Pause_menu_current_option_menu = PAUSE_MENU_DISPLAY_ID 
  1809. 	menu_data.parent_menu = nil 
  1810. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_display", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_DISPLAY_ID, true) 
  1811. end 
  1812.  
  1813. function pause_menu_brightness_input_override(override) 
  1814. 	if override == true then 
  1815. 		Pause_menu_brightness.input = {  
  1816. 			vint_subscribe_to_input_event(nil, "nav_left",			"pause_menu_brightness_input", 50), 
  1817. 			vint_subscribe_to_input_event(nil, "nav_right",			"pause_menu_brightness_input", 50), 
  1818. 			vint_subscribe_to_input_event(nil, "select",				"pause_menu_brightness_input", 50), 
  1819. 			vint_subscribe_to_input_event(nil, "back",				"pause_menu_brightness_input", 50), 
  1820. 			vint_subscribe_to_input_event(nil, "all_unassigned",	"pause_menu_brightness_input", 50), 
  1821. 		} 
  1822.  
  1823. 		vint_set_input_params(Pause_menu_brightness.input[1], MENU_NUM_SLIDER_ACCEL_REPEAT, MENU_NUM_SLIDER_ACCEL_FACTOR, MENU_NUM_SLIDER_ACCEL_LIMIT, true) 
  1824. 		vint_set_input_params(Pause_menu_brightness.input[2], MENU_NUM_SLIDER_ACCEL_REPEAT, MENU_NUM_SLIDER_ACCEL_FACTOR, MENU_NUM_SLIDER_ACCEL_LIMIT, true) 
  1825.  
  1826. 	else 
  1827. 	 
  1828. 		if Pause_menu_brightness.input ~= nil then 
  1829. 			for idx, key in Pause_menu_brightness.input  do 
  1830. 				vint_unsubscribe_to_input_event(key) 
  1831. 			end 
  1832. 		end 
  1833. 		 
  1834. 		Pause_menu_brightness.input = nil 
  1835. 	end 
  1836. end 
  1837.  
  1838. function pause_menu_brightness_input(target, event, accelleration) 
  1839. 	if menu_input_is_blocked() == true then 
  1840. 		return 
  1841. 	end 
  1842. 	 
  1843. 	if event == "nav_left" then 
  1844. 		local cur_value = Pause_display_menu_PC[0].cur_value 
  1845. 		if cur_value > 0 then 
  1846. 			cur_value = cur_value - (0.01 * accelleration) 
  1847. 		 
  1848. 			if cur_value < 0 then 
  1849. 				cur_value = 0 
  1850. 			end 
  1851. 		 
  1852. 			Pause_display_menu_PC[0].cur_value = cur_value 
  1853. 			audio_play(Menu_sound_value_nav) 
  1854. 			pause_menu_brightness_update_value() 
  1855. 		end 
  1856. 	elseif event == "nav_right" then 
  1857. 		local cur_value = Pause_display_menu_PC[0].cur_value 
  1858. 		 
  1859. 		if cur_value < 1 then 
  1860. 			cur_value = cur_value + (0.01 * accelleration) 
  1861. 		 
  1862. 			if cur_value > 1 then 
  1863. 				cur_value = 1 
  1864. 			end 
  1865. 		 
  1866. 			Pause_display_menu_PC[0].cur_value = cur_value	 
  1867. 			audio_play(Menu_sound_value_nav) 
  1868. 			pause_menu_brightness_update_value() 
  1869. 		end 
  1870. 	elseif event == "back" then 
  1871. 		pause_menu_update_option(PAUSE_MENU_DISPLAY_ID, 0, false, Pause_menu_brightness.old_val) 
  1872. 		Pause_display_menu_PC[0].cur_value = Pause_menu_brightness.old_val 
  1873. 		pause_menu_exit_brightness_screen() 
  1874. 	elseif event == "select" then 
  1875. 		pause_menu_exit_brightness_screen() 
  1876. 	end 
  1877. 	 
  1878. end 
  1879.  
  1880. function pause_difficulty_casual_select (menu_label, menu_data) 
  1881. 	game_difficulty_select(DIFFICULTY_CASUAL) 
  1882. 	pause_menu_option_accept() 
  1883. end 
  1884.  
  1885. function pause_difficulty_normal_select (menu_label, menu_data) 
  1886. 	game_difficulty_select(DIFFICULTY_NORMAL) 
  1887. 	pause_menu_option_accept() 
  1888. end 
  1889.  
  1890. function pause_difficulty_hardcore_select (menu_label, menu_data) 
  1891. 	game_difficulty_select(DIFFICULTY_HARDCORE) 
  1892. 	pause_menu_option_accept() 
  1893. end 
  1894.  
  1895. function pause_menu_force_close_brightness_screen() 
  1896. 	vint_set_property(Pause_menu_brightness.screen_h, "visible", false) 
  1897. 	pause_menu_brightness_input_override(false) 
  1898. end 
  1899.  
  1900. function pause_menu_display_brightness_screen(menu_label, menu_data) 
  1901.  
  1902. 	Pause_menu_brightness.screen_h = vint_object_find("brightness") 
  1903. 	Pause_menu_brightness.slider_h = vint_object_find("slider", Pause_menu_brightness.screen_h) 
  1904. 	Pause_menu_brightness.thumb_h = vint_object_find("brightness_value", Pause_menu_brightness.slider_h) 
  1905. 	Pause_menu_brightness.value_h = vint_object_find("brightness_value", Pause_menu_brightness.thumb_h) 
  1906. 	Pause_menu_brightness.line_h = vint_object_find("line_bg", Pause_menu_brightness.slider_h) 
  1907. 	 
  1908. 	local image_h = vint_object_find("calibrate_image") 
  1909. 	local text_h = vint_object_find("brightness_text") 
  1910. 	 
  1911. 	local accept_grp_h = vint_object_find("accept") 
  1912. 	local accept_tip_h = vint_object_find("accept_text") 
  1913. 	local accept_button_h = vint_object_find("btn_accept") 
  1914. 	vint_set_property(accept_button_h, "image", get_a_button()) 
  1915. 	local cancel_grp_h = vint_object_find("cancel") 
  1916. 	local cancel_tip_h = vint_object_find("cancel_text") 
  1917. 	local cancel_button_h = vint_object_find("btn_cancel") 
  1918. 	vint_set_property(cancel_button_h, "image", get_b_button()) 
  1919. 	 
  1920. 	--cancel text anchor and dimensions 
  1921. 	local ctw, cth = element_get_actual_size(cancel_tip_h) 
  1922. 	local btn_size = 34 
  1923. 	local gap = 20 
  1924.  
  1925. 	-- move the cancel btn graphic 
  1926. 	vint_set_property(cancel_button_h, "anchor", -(ctw), 0) 	  
  1927. 	 
  1928. 	local cbx, cby = vint_get_property(cancel_button_h, "anchor") 	 -- cancel button x, y position 
  1929. 	 
  1930. 	-- move the accept group	 
  1931. 	vint_set_property(accept_grp_h, "anchor", cbx - btn_size - gap, 0) 		  
  1932. 	 
  1933. 	local atw, ath = element_get_actual_size(accept_tip_h) 			 -- accept text dimensions 
  1934. 	 
  1935. 	-- move the accept btn graphic 
  1936. 	vint_set_property(accept_button_h, "anchor", -(atw), 0)  	  
  1937. 	 
  1938. 	-- Turn the screen on 
  1939. 	vint_set_property(Pause_menu_brightness.screen_h, "visible", true) 
  1940. 	vint_set_property(Pause_menu_brightness.screen_h, "alpha", 0.0) 
  1941. 	 
  1942. 	--	Load the image 
  1943. 	Pause_menu_calibrate_image_peg = "ui_test_calibrate" 
  1944. 	peg_load(Pause_menu_calibrate_image_peg)	 
  1945. 	vint_set_property(image_h, "image", "ui_test_calibrate.tga") 
  1946. 	 
  1947. 	--	Adjust the text tags and get the min/max for the slider bar 
  1948. 	local w, h = element_get_actual_size(text_h) 
  1949. 	local x, y = vint_get_property(Pause_menu_brightness.slider_h, "anchor") 
  1950. 	vint_set_property(Pause_menu_brightness.slider_h, "anchor", w + 5, y) 
  1951. 	x, y = vint_get_property(Pause_menu_brightness.line_h, "anchor") 
  1952. 	w, h = element_get_actual_size(Pause_menu_brightness.line_h) 
  1953. 	Pause_menu_brightness.max = w - 40 
  1954. 	Pause_menu_brightness.min = x + 20 
  1955. 	 
  1956. 	Pause_menu_brightness.old_val = Pause_display_menu_PC[0].cur_value 
  1957. 	Pause_menu_brightness.value = Pause_display_menu_PC[0].cur_value 
  1958. 	pause_menu_brightness_update_value() 
  1959. 	 
  1960. 	menu_input_block(true) 
  1961. 	-- Grab the input 
  1962. 	pause_menu_brightness_input_override(true) 
  1963. 	 
  1964. 	-- Tween the old one 
  1965. 	local tween_h = menu_create_tween("pause_menu_brightness", Pause_menu_brightness.screen_h, "alpha", 0.2) 
  1966. 	vint_set_property(tween_h, "start_value", 0)	 
  1967. 	vint_set_property(tween_h, "end_value", 1)	 
  1968. 	vint_set_property(tween_h, "end_event", "pm_end_brightness_tween") 
  1969. 	Pause_menu_brightness.tween_h = tween_h 
  1970. 	 
  1971. 	--Hide the button tips if we are in the main menu 
  1972. 	if vint_document_find("main_menu") ~= 0 then 
  1973. 		main_menu_btn_tips_show(false) 
  1974. 	end 
  1975. end 
  1976.  
  1977. function pm_end_brightness_tween() 
  1978. 	menu_input_block(false) 
  1979. 	vint_object_destroy(Pause_menu_brightness.tween_h) 
  1980. end 
  1981.  
  1982. function pause_menu_brightness_update_value() 
  1983. 	local x, y = vint_get_property(Pause_menu_brightness.thumb_h, "anchor") 
  1984. 	vint_set_property(Pause_menu_brightness.thumb_h, "anchor", (Pause_menu_brightness.max * Pause_display_menu_PC[0].cur_value) + Pause_menu_brightness.min, y) 
  1985. 	vint_set_property(Pause_menu_brightness.value_h, "text_tag", floor(Pause_display_menu_PC[0].cur_value * 100))	--	Set the proper tag 
  1986. 	local w, h = element_get_actual_size(Pause_menu_brightness.value_h) 
  1987. 	local old_w, old_h = element_get_actual_size(Pause_menu_brightness.thumb_h) 
  1988. 	vint_set_property(Pause_menu_brightness.thumb_h, "screen_size", w, old_h) 
  1989. 	pause_menu_update_option(PAUSE_MENU_DISPLAY_ID, 0, false, Pause_display_menu_PC[0].cur_value) 
  1990. end 
  1991.  
  1992. function pause_menu_exit_brightness_screen(menu_label, menu_data) 
  1993. 	menu_input_block(true) 
  1994. 	-- Restore input 
  1995. 	pause_menu_brightness_input_override(false) 
  1996. 	 
  1997. 	 
  1998.  
  1999. 	-- Tween the old one 
  2000. 	local tween_h = menu_create_tween("pause_menu_brightness", Pause_menu_brightness.screen_h, "alpha", 0.2) 
  2001. 	vint_set_property(tween_h, "start_value", 1)	 
  2002. 	vint_set_property(tween_h, "end_value", 0)	 
  2003. 	vint_set_property(tween_h, "end_event", "pm_end_brightness_tween_exit") 
  2004. 	Pause_menu_brightness.tween_h = tween_h 
  2005.  
  2006. 	--Restore button tips if on main menu 
  2007. 	if vint_document_find("main_menu") ~= 0 then 
  2008. 		main_menu_btn_tips_show(true) 
  2009. 	end 
  2010. end 
  2011.  
  2012. function pm_end_brightness_tween_exit() 
  2013. 	pm_end_brightness_tween() 
  2014. 		 
  2015. 	-- Unload the image 
  2016. 	peg_unload("ui_test_calibrate") 
  2017. 	Pause_menu_calibrate_image_peg = 0 
  2018. 	 
  2019. 	-- Hide the brightness screen 
  2020. 	vint_set_property(Pause_menu_brightness.screen_h, "visible", false) 
  2021.  
  2022. end 
  2023.  
  2024. function vsync_gameplay_confirm(result, action) 
  2025. 	if action ~= DIALOG_ACTION_CLOSE then 
  2026. 		return 
  2027. 	end 
  2028. 	 
  2029. 	if result == 0 then 
  2030. 		pause_menu_update_option(PAUSE_MENU_DISPLAY_ID, 2, true) 
  2031. 	else 
  2032. 		vsync_gameplay_slider_values.cur_value = 0 
  2033. 		menu_text_slider_update_value(Menu_option_labels[2], Pause_display_menu[2]) 
  2034. 	end 
  2035. end 
  2036.  
  2037. function vsync_cutscene_confirm(result, action) 
  2038. 	if action ~= DIALOG_ACTION_CLOSE then 
  2039. 		return 
  2040. 	end 
  2041. 	 
  2042. 	if result == 0 then 
  2043. 		pause_menu_update_option(PAUSE_MENU_DISPLAY_ID, 3, true) 
  2044. 	else 
  2045. 		vsync_cutscene_slider_values.cur_value = 0 
  2046. 		menu_text_slider_update_value(Menu_option_labels[3], Pause_display_menu[3]) 
  2047. 	end 
  2048. end 
  2049.  
  2050. function pause_menu_display_options_update_value(menu_label, menu_data) 
  2051. 	local idx = menu_data.id 
  2052. 	if menu_data.type == MENU_ITEM_TYPE_NUM_SLIDER then 
  2053. 		pause_menu_update_option(PAUSE_MENU_DISPLAY_ID, idx, false, menu_data.cur_value) 
  2054. 		local h = vint_object_find("value_text", menu_label.control.grp_h) 
  2055. 		vint_set_property(h, "text_tag", floor(menu_data.cur_value * 100) .. "%%") 
  2056. 	else 
  2057. 		local update_menu = true 
  2058. 		local boolean = false 
  2059.  
  2060.         if get_platform() == "PC" then 
  2061. 			pause_menu_update_option( PAUSE_MENU_DISPLAY_ID, idx, boolean, menu_data.text_slider_values.cur_value ) 
  2062. 			vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_display", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_DISPLAY_ID, false) 
  2063.  
  2064. 			menu_update_labels() 
  2065. 			menu_update_nav_bar(Menu_active.highlighted_item) 
  2066.  
  2067. 			return 
  2068.         end 
  2069.  
  2070.  
  2071.  
  2072. 		if menu_data.text_slider_values.cur_value == 1 then 
  2073. 			boolean = true 
  2074. 		end 
  2075. 		if menu_data.initialized == nil or menu_data.initialized == false then 
  2076. 			if boolean == true then 
  2077. 				-- menu_data.initialized = true 
  2078. 				if menu_data.id == 2 then 
  2079. 					dialog_box_confirmation("MENU_TITLE_NOTICE", "MENU_VSYNC_WARNING_TEXT", "vsync_gameplay_confirm") 
  2080. 					update_menu = false 
  2081. 				elseif menu_data.id == 3 then 
  2082. 					dialog_box_confirmation("MENU_TITLE_NOTICE", "MENU_VSYNC_WARNING_TEXT", "vsync_cutscene_confirm") 
  2083. 					update_menu = false; 
  2084. 				end 
  2085. 			end 
  2086. 		end 
  2087. 		if update_menu == true then 
  2088. 			pause_menu_update_option(PAUSE_MENU_DISPLAY_ID, idx, boolean) 
  2089. 		end 
  2090. 	end 
  2091. end 
  2092.  
  2093. function pause_menu_display_options_update_value_adv(menu_label, menu_data) 
  2094. 	local idx = menu_data.id 
  2095. 	if menu_data.type == MENU_ITEM_TYPE_NUM_SLIDER then 
  2096. 		pause_menu_update_option(PAUSE_MENU_DISPLAY_ADV_ID, idx, false, menu_data.cur_value) 
  2097. 		local h = vint_object_find("value_text", menu_label.control.grp_h) 
  2098. 		vint_set_property(h, "text_tag", floor(menu_data.cur_value * 100) .. "%%") 
  2099. 	else 
  2100. 		local update_menu = true 
  2101. 		local boolean = false 
  2102. 	        if get_platform() == "PC" then 
  2103. 			pause_menu_update_option(PAUSE_MENU_DISPLAY_ADV_ID, idx, boolean, menu_data.text_slider_values.cur_value) 
  2104. 			return 
  2105. 	        end 
  2106. 		if menu_data.text_slider_values.cur_value == 1 then 
  2107. 			boolean = true 
  2108. 		end 
  2109. 		if menu_data.initialized == nil or menu_data.initialized == false then 
  2110. 			if boolean == true then 
  2111. 				-- menu_data.initialized = true 
  2112. 				if menu_data.id == 2 then 
  2113. 					dialog_box_confirmation("MENU_TITLE_NOTICE", "MENU_VSYNC_WARNING_TEXT", "vsync_gameplay_confirm") 
  2114. 					update_menu = false 
  2115. 				elseif menu_data.id == 3 then 
  2116. 					dialog_box_confirmation("MENU_TITLE_NOTICE", "MENU_VSYNC_WARNING_TEXT", "vsync_cutscene_confirm") 
  2117. 					update_menu = false; 
  2118. 				end 
  2119. 			end 
  2120. 		end 
  2121. 		if update_menu == true then 
  2122. 			pause_menu_update_option(PAUSE_MENU_DISPLAY_ADV_ID, idx, boolean) 
  2123. 		end 
  2124. 	end 
  2125. end 
  2126.  
  2127. function pm_bool_to_1(value) 
  2128. 	if value == true then 
  2129. 		return 1 
  2130. 	elseif value == false then 
  2131. 		return 0 
  2132. 	else 
  2133. 		return value 
  2134. 	end 
  2135. end 
  2136.  
  2137. function pause_menu_populate_display(gamma, resolution, fullscreen, vsync, quality, subtitles, minimap,ssao,mblur,antial,anisotropy,hdr,shadows,viewdist,dynamiclights,blur,depthoffield) 
  2138. 	Pause_display_menu_PC[0].cur_value = gamma 
  2139. 	resolution_slider_values.cur_value = resolution 
  2140. 	fullscreen_slider_values.cur_value = pm_bool_to_1(fullscreen) 
  2141. 	vsync_slider_values.cur_value = pm_bool_to_1(vsync) 
  2142. 	graphics_quality_slider_values.cur_value = quality 
  2143. 	subtitles_slider_values.cur_value = pm_bool_to_1(subtitles) 
  2144. 	minimap_slider_values.cur_value = pm_bool_to_1(minimap) 
  2145.  
  2146. 	adv_ambient_slider_values.cur_value = ssao 
  2147. 	adv_motion_blur_slider_values.cur_value = pm_bool_to_1(mblur) 
  2148. 	adv_antiali_slider_values.cur_value = antial 
  2149. 	adv_anisotropy_slider_values.cur_value = anisotropy 
  2150. 	adv_hdr_slider_values.cur_value = pm_bool_to_1(hdr) 
  2151. 	adv_shadow_slider_values.cur_value = shadows 
  2152. 	adv_distance_slider_values.cur_value = viewdist 
  2153. 	adv_dynamic_lights_slider_values.cur_value = dynamiclights 
  2154. 	adv_blur_slider_values.cur_value = pm_bool_to_1(blur) 
  2155. 	adv_depthoffield_slider_values.cur_value = pm_bool_to_1(depthoffield) 
  2156. 	 
  2157. 	if Pause_display_menu_PC.highlighted_item == nil then 
  2158. 		Pause_display_menu_PC.highlighted_item = 0 
  2159. 	end 
  2160. 		 
  2161. 	pause_menu_display_options_nav() 
  2162. end 
  2163.  
  2164. function  pause_menu_display_options_nav(menu_label, menu_data) 
  2165. 	if Pause_display_menu.highlighted_item == 0 then 
  2166. 		Pause_options_btn_tips.a_button.label = "CONTROL_SELECT" 
  2167. 	else  
  2168. 		Pause_options_btn_tips.a_button.label = "PAUSE_MENU_ACCEPT" 
  2169. 	end 
  2170. 	 
  2171. 	btn_tips_update() 
  2172. end 
  2173.  
  2174. function pause_menu_audio_nav(menu_label, menu_data) 
  2175. 	pause_menu_audio_play_preview(-1)	--	Shut 'er off 
  2176. end 
  2177.  
  2178. function pause_menu_audio_options_update_value(menu_label, menu_data) 
  2179. 	local idx = menu_data.id 
  2180. 	if menu_data.type == MENU_ITEM_TYPE_NUM_SLIDER then 
  2181. 		pause_menu_update_option(PAUSE_MENU_AUDIO_ID, idx, false, menu_data.cur_value) 
  2182. 		local h = vint_object_find("value_text", menu_label.control.grp_h) 
  2183. 		vint_set_property(h, "text_tag", floor(menu_data.cur_value * 100) .. "%%") 
  2184. 	else 
  2185. 		pause_menu_update_option(PAUSE_MENU_AUDIO_ID, idx, false, menu_data.text_slider_values.cur_value) 
  2186. 	end 
  2187. 	 
  2188. 	if menu_data.id == 0 then 
  2189. 		pause_menu_audio_play_preview(0) 	-- SFX 
  2190. 	elseif menu_data.id == 2 then 
  2191. 		pause_menu_audio_play_preview(1)	-- VOICE 
  2192. 	end 
  2193. end 
  2194.  
  2195. function pause_menu_build_audio_options_menu(menu_data) 
  2196. 	Pause_menu_current_option_menu = PAUSE_MENU_AUDIO_ID 
  2197. 	menu_data.parent_menu = nil 
  2198. 	-- set the label for the six axis sensor.  
  2199. 	if get_platform() == "PS3" then 
  2200. 	-- the last item is not needed in the PS3 build (the audio player) 
  2201. 		Pause_audio_menu.num_items = 4 
  2202. 	end 
  2203.  
  2204. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_audio", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_AUDIO_ID, true) 
  2205. end 
  2206.  
  2207. function pause_menu_populate_audio(sound, music, volume, radio_on_entry) 
  2208. 	Pause_audio_menu[0].cur_value = sound  
  2209. 	Pause_audio_menu[1].cur_value = music 
  2210. 	Pause_audio_menu[2].cur_value = volume  
  2211. 	vehicle_radio_slider_values.cur_value = radio_on_entry  
  2212. end 
  2213.  
  2214. ---------------- 
  2215. -- CELL PHONE -- 
  2216. ---------------- 
  2217. Menu_out_tween_h = 0 
  2218. Cellphone_doc_h = 0 
  2219. function pause_menu_cellphone_show() 
  2220. 	vint_force_lua_gc() 
  2221. 	vint_document_load("cellphone") 
  2222. 	Cellphone_doc_h = vint_document_find("cellphone") 
  2223. end 
  2224.  
  2225. function pause_menu_cellphone_exit() 
  2226. 	local phone_h = vint_object_find("cell_phone", nil, Cellphone_doc_h) 
  2227. 	Menu_out_tween_h = vint_object_create("cell_phone_custom_transition_out", "tween", vint_object_find("root_animation", nil, Cellphone_doc_h), Cellphone_doc_h) 
  2228. 	vint_set_property(Menu_out_tween_h, "duration", 0.15) 
  2229. 	vint_set_property(Menu_out_tween_h, "target_handle", phone_h) 
  2230. 	vint_set_property(Menu_out_tween_h, "target_property", "anchor") 
  2231. 	vint_set_property(Menu_out_tween_h, "start_time", vint_get_time_index(Cellphone_doc_h)) 
  2232. 	vint_set_property(Menu_out_tween_h, "is_paused", false) 
  2233. 	vint_set_property(Menu_out_tween_h, "start_value", Menu_active_anchor_end_x, Menu_active_anchor_end_y) 
  2234. 	vint_set_property(Menu_out_tween_h, "end_value", 0 - Menu_active.menu_width, Menu_active_anchor_end_y) 
  2235. 	vint_set_property(Menu_out_tween_h, "end_event", "pause_menu_cellphone_exit_final") 
  2236. end 
  2237.  
  2238. function pause_menu_cellphone_exit_final() 
  2239. 	vint_object_destroy(Menu_out_tween_h) 
  2240. 	vint_document_unload(Cellphone_doc_h) 
  2241. 	Cellphone_doc_h = 0 
  2242. end 
  2243. ---------------------- 
  2244. -- STATION SELECTOR -- 
  2245. ---------------------- 
  2246.  
  2247. --  
  2248. --  
  2249. Station_Images = { 
  2250.    ["105.0 EZZZY FM"] = "ui_radio_105_ezzzy", 
  2251. 	["89.0 ULTOR FM"] = "ui_radio_89_ultor", 
  2252. 	["RADIO FREE STILWATER 87.6"] = "ui_radio_876_rfs", -- Cut probably  
  2253. 	["89.0 GENERATION X"] = "ui_radio_89_gen_x", 
  2254. 	["95.4 KRhyme FM"] = "ui_radio_954_khryme", 
  2255. 	["97.6 K12 FM"] = "ui_radio_976_k12", 
  2256. 	["FUNK 98.4"] = "ui_radio_984_funk", 
  2257. 	["99.0 THE UNDERGROUND"] = "ui_radio_99_underground", 
  2258. 	["101.69 SIZZURP FM"] = "ui_radio_10169_sizzurp", 
  2259. 	["102.4 KLASSIC FM"] = "ui_radio_1024_klassic",  
  2260. 	["103.6 420 FM"] = "ui_radio_1036_four_20", 
  2261. 	["105.0 THE WORLD"] = "ui_radio_105_world", 
  2262. 	["THE KRUNCH 106.66"] = "ui_radio_10666_krunch", 
  2263. 	["107.77 THE MIX FM"] = "ui_radio_10777_the_mix", 
  2264. 	["108.0 WMD KBOOM FM"] = "ui_radio_108_wmd_kboom", -- Cut probably 
  2265. } 
  2266.  
  2267. Station_Genres = { 
  2268. 	["105.0 EZZZY FM"] = "RADIO_STATION_GENRE_EZZZY", 
  2269. 	["89.0 ULTOR FM"] = "RADIO_STATION_GENRE_ULTOR", 
  2270. 	["RADIO FREE STILWATER 87.6"] = "RADIO_STATION_GENRE_RFS",  
  2271. 	["89.0 GENERATION X"] = "RADIO_STATION_GENRE_GEN_X", 
  2272. 	["95.4 KRhyme FM"] = "RADIO_STATION_GENRE_KRHYME", 
  2273. 	["97.6 K12 FM"] = "RADIO_STATION_GENRE_K12FM", 
  2274. 	["FUNK 98.4"] = "RADIO_STATION_GENRE_FUNK", 
  2275. 	["99.0 THE UNDERGROUND"] = "RADIO_STATION_GENRE_UNDERGROUND", 
  2276. 	["101.69 SIZZURP FM"] = "RADIO_STATION_GENRE_SIZZURP", 
  2277. 	["102.4 KLASSIC FM"] = "RADIO_STATION_GENRE_KLASSIC",  
  2278. 	["103.6 420 FM"] = "RADIO_STATION_GENRE_FOUR_20", 
  2279. 	["105.0 THE WORLD"] = "RADIO_STATION_GENRE_THE_WORLD", 
  2280. 	["THE KRUNCH 106.66"] = "RADIO_STATION_GENRE_KRUNCH", 
  2281. 	["107.77 THE MIX FM"] = "RADIO_STATION_GENRE_MIX", 
  2282. 	["108.0 WMD KBOOM FM"] = "RADIO_STATION_GENRE_KBOOM", 
  2283. } 
  2284.  
  2285. Station_Songs = { 
  2286. 	["105.0 EZZZY FM"] = "Bachelor Samba", 
  2287. 	["89.0 ULTOR FM"] = "Misery Business", 
  2288. 	["RADIO FREE STILWATER 87.6"] = "RADIO_STATION_GENRE_RFS",  
  2289. 	["89.0 GENERATION X"] = "Misery Business", 
  2290. 	["95.4 KRhyme FM"] = "Ridin In That Black Joint", 
  2291. 	["97.6 K12 FM"] = "Over and Over", 
  2292. 	["FUNK 98.4"] = "Love Fades", 
  2293. 	["99.0 THE UNDERGROUND"] = "Shoot The Runner", 
  2294. 	["101.69 SIZZURP FM"] = "RADIO_STATION_GENRE_SIZZURP", 
  2295. 	["102.4 KLASSIC FM"] = "Ride of the Valkyries",  
  2296. 	["103.6 420 FM"] = "Ganja Smuggling", 
  2297. 	["105.0 THE WORLD"] = "Bangara Dance", 
  2298. 	["THE KRUNCH 106.66"] = "Resurrection", 
  2299. 	["107.77 THE MIX FM"] = "Everybody Wants To Rule The World", 
  2300. 	["108.0 WMD KBOOM FM"] = "RADIO_STATION_GENRE_KBOOM", 
  2301. } 
  2302.  
  2303. function pause_menu_station_exit(menu_data) 
  2304. 	peg_unload("ui_radio_logos") 
  2305. 	radio_station_preview(true) 
  2306. 	menu_grid_release(Pause_menu_station_selection[0]) 
  2307. end 
  2308.  
  2309. function pause_menu_station_build_footer(menu_data) 
  2310. 	local grp = vint_object_clone(vint_object_find("station_footer"), Menu_option_labels.control_parent) 
  2311. 	vint_set_property(grp, "visible", true) 
  2312.  
  2313. 	if menu_data.footer ~= nil and menu_data.footer.footer_grp ~= nil and menu_data.footer.footer_grp ~= 0 then 
  2314. 		vint_object_destroy(menu_data.footer.footer_grp) 
  2315. 	end 
  2316.  
  2317. 	menu_data.footer = { } 
  2318. 	menu_data.footer.footer_grp = grp 
  2319. 	 
  2320. 	menu_data.footer.label_h = vint_object_find("station_label", grp) 
  2321. 	menu_data.footer.genre_h = vint_object_find("genre_label", grp) 
  2322. 	 
  2323. 	vint_set_property(menu_data.footer.label_h, "tint", MENU_FOOTER_CASH_NORMAL_COLOR.R, MENU_FOOTER_CASH_NORMAL_COLOR.G, MENU_FOOTER_CASH_NORMAL_COLOR.B) 
  2324. end 
  2325.  
  2326. function pause_menu_station_update_footer(label, genre) 
  2327. 	vint_set_property(Pause_menu_station_selection.footer.label_h, "text_tag", label) 
  2328. 	vint_set_property(Pause_menu_station_selection.footer.genre_h, "text_tag", genre) 
  2329. end 
  2330.  
  2331. function pause_menu_station_show(menu_data) 
  2332. 	local menu_item = menu_data[0] 
  2333. 	 
  2334. 	-- Reset the swatches 
  2335. 	menu_item.swatches = { num_swatches = 0 } 
  2336. 	local swatches = menu_item.swatches  
  2337. 	swatches.num_swatches = 0 
  2338. 	 
  2339. 	-- Load the peg 
  2340. 	peg_load("ui_radio_logos") 
  2341. 	 
  2342. 	-- Get the data 
  2343. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_station_build", 0, 19) 
  2344. 	 
  2345. 	local master_swatch = vint_object_find("swatch_radio") 
  2346. 	vint_set_property(master_swatch, "visible", true) 
  2347. 	menu_grid_show(menu_data, menu_item, master_swatch)		 
  2348.  
  2349. 	pause_menu_station_build_footer(menu_data) 
  2350. 	 
  2351. 	pause_menu_station_update_footer(swatches[0].label_str, swatches[0].genre) 
  2352. 	radio_station_preview(false, swatches[0].track_name) 
  2353. 	vint_set_property(vint_object_find("icon", swatches[0].swatch_h), "tint", 1.0, 1.0, 1.0) 
  2354. end 
  2355.  
  2356. function pause_menu_station_build(display_name, selected, identifier, index) 
  2357. 	if identifier == "OFF" then 
  2358. 		return 
  2359. 	end 
  2360. 	 
  2361. 	local swatches = Pause_menu_station_selection[0].swatches 
  2362. 	 
  2363. 	local genre = nil 
  2364. 	local bitmap_name = nil 
  2365. 	 
  2366. 	swatches[swatches.num_swatches] =  
  2367. 	{ label_str = display_name, swatch_str = Station_Images[identifier], genre = Station_Genres[identifier], track_name = Station_Songs[identifier], selected = selected, index = index} 
  2368. 	swatches.num_swatches = swatches.num_swatches + 1	 
  2369. end 
  2370.  
  2371. function pause_menu_station_select(menu_label, menu_data) 
  2372. 	local swatches = menu_data.swatches 
  2373. 	local idx = menu_data.cur_row * menu_data.num_cols + menu_data.cur_col 
  2374. 	 
  2375. 	if idx < swatches.num_swatches then 
  2376. 		swatches[idx].selected = swatches[idx].selected == false 
  2377. 		radio_station_disable(swatches[idx].index, swatches[idx].selected) 
  2378. 		pause_menu_station_update_swatch(swatches[idx]) 
  2379. 		vint_set_property(vint_object_find("icon", swatches[idx].swatch_h), "tint", 1.0, 1.0, 1.0) 
  2380. 	end 
  2381. 	 
  2382. end 
  2383.   
  2384. function pause_menu_station_nav(menu_label, menu_data) 
  2385. 	local swatches = menu_data.swatches 
  2386. 	local idx = menu_data.cur_row * menu_data.num_cols + menu_data.cur_col 
  2387. 	 
  2388. 	if idx < swatches.num_swatches then 
  2389. 		pause_menu_station_update_footer(swatches[idx].label_str, swatches[idx].genre) 
  2390. 		radio_station_preview(false, swatches[idx].track_name) 
  2391. 		vint_set_property(vint_object_find("icon", swatches[idx].swatch_h), "tint", 1.0, 1.0, 1.0) 
  2392. 	end 
  2393. end 
  2394.  
  2395. function pause_menu_station_leave_swatch(swatch) 
  2396. 	local icon_h = vint_object_find("icon", swatch.swatch_h) 
  2397. 	 
  2398. 	if swatch.selected == false then 
  2399. 		vint_set_property(icon_h, "tint", 0.5, 0.5, 0.5) 
  2400. 	else 
  2401. 		vint_set_property(icon_h, "tint", 0.7, 0.7, 0.7) 
  2402. 	end 
  2403. end 
  2404.  
  2405. function pause_menu_station_update_swatch(swatch) 
  2406. 	local deselect_h = vint_object_find("deselected", swatch.swatch_h) 
  2407. 	local icon_h = vint_object_find("icon", swatch.swatch_h) 
  2408. 	if swatch.selected == false then 
  2409. 		vint_set_property(deselect_h, "visible", true) 
  2410. 		vint_set_property(deselect_h, "alpha", 1.0) 
  2411. 		vint_set_property(deselect_h, "render_mode", "default") 
  2412. 		vint_set_property(deselect_h, "scale", 1.25, 1.25) 
  2413. 		vint_set_property(icon_h, "tint", 0.5, 0.5, 0.5) 
  2414. 	else 
  2415. 		vint_set_property(deselect_h, "visible", false) 
  2416. 		vint_set_property(icon_h, "tint", 0.7, 0.7, 0.7) 
  2417. 	end 
  2418. 	 
  2419. 	vint_set_property(vint_object_find("icon_highlight", swatch.swatch_h), "visible", false) 
  2420. 	vint_set_property(vint_object_find("bg", swatch.swatch_h), "visible", false) 
  2421. 	vint_set_property(vint_object_find("shadow", swatch.swatch_h), "visible", false) 
  2422. end 
  2423.  
  2424. ----------------------------------- 
  2425. --------[ CUSTOM CONTROLS ]-------- 
  2426. ----------------------------------- 
  2427. --------------------------------------[ OBJECTIVE_TEXT_LINE ]-------------------------------------- 
  2428. function pause_menu_control_objective_text_line_show(menu_label, menu_data) 
  2429. 	local control = menu_label.control 
  2430.  
  2431. 	if control ~= nil then 
  2432. 		if control.type ~= PAUSE_MENU_CONTROL_OBJECTIVE_TEXT_LINE then 
  2433. 			-- this isn't a PAUSE_MENU_CONTROL_OBJECTIVE_TEXT_LINE so release it 
  2434. 			menu_release_control(control) 
  2435. 			control = nil 
  2436. 		end 
  2437. 	end 
  2438.  
  2439. 	if control == nil then 
  2440. 		local control_h = vint_object_clone(vint_object_find("pm_objective_text_line"), Menu_option_labels.control_parent) 
  2441. 		control = { grp_h = control_h, type = PAUSE_MENU_CONTROL_OBJECTIVE_TEXT_LINE, is_highlighted = false } 
  2442. 		menu_label.original_anchor = { } 
  2443. 		menu_label.original_anchor.x, menu_label.original_anchor.y  = vint_get_property(vint_object_find("pm_objective_text_line_label"), "anchor") 
  2444. 	end 
  2445.  
  2446. 	menu_label.control = control 
  2447. 	 
  2448. 	--	Hide the O.G. Label 
  2449. 	vint_set_property(menu_label.label_h, "visible", false) 
  2450. 	 
  2451. 	--	Show the new control 
  2452. 	vint_set_property(control.grp_h, "visible", true) 
  2453. 	vint_set_property(control.grp_h, "anchor", menu_label.anchor_x, menu_label.anchor_y) 
  2454. 	vint_set_property(control.grp_h, "depth", menu_label.depth) 
  2455. 	 
  2456. 	--	Set the color and text_tag 
  2457. 	menu_label.real_label_h = vint_object_find("pm_objective_text_line_label", control.grp_h) 
  2458. 	vint_set_property(menu_label.real_label_h, "text_tag", menu_data.label) 
  2459. 	 
  2460. 	vint_set_property(menu_label.real_label_h, "tint", 0.623, 0.635, 0.643) 
  2461. 	 
  2462. 	vint_set_property(menu_label.real_label_h, "visible", true) 
  2463. 	menu_label.checkbox_h = vint_object_find("pm_objective_checkbox", control.grp_h) 
  2464. 	menu_label.check_h = vint_object_find("pm_objective_checkmark", control.grp_h) 
  2465. 	vint_set_property(menu_label.checkbox_h, "tint", 0.364, 0.368, 0.376) 
  2466.  
  2467. 	--	Set whether or not it's checked. 
  2468. 	if menu_data.checked == nil then 
  2469. 		vint_set_property(menu_label.real_label_h, "anchor", 6, 0) 
  2470. 		-- hide the check box		 
  2471. 		vint_set_property(menu_label.checkbox_h, "visible", false) 
  2472. 		vint_set_property(menu_label.check_h, "visible", false) 
  2473. 	else 
  2474. 		vint_set_property(menu_label.real_label_h, "anchor", menu_label.original_anchor.x, menu_label.original_anchor.y) 
  2475. 		vint_set_property(menu_label.checkbox_h, "visible", true) 
  2476. 		if menu_data.checked == true then 
  2477. 			vint_set_property(menu_label.check_h, "visible", true) 
  2478. 			vint_set_property(menu_label.check_h, "tint", menu_data.check_color.R, menu_data.check_color.G, menu_data.check_color.B) 
  2479. 		else 
  2480. 			vint_set_property(menu_label.real_label_h, "alpha", 1.0) 
  2481. 			vint_set_property(menu_label.check_h, "visible", false) 
  2482. 		end 
  2483. 	end 
  2484. end 
  2485.  
  2486. --------------------------------------[ OBJECTIVE_WRAP_LINE ]-------------------------------------- 
  2487.  
  2488. -- for the data responder 
  2489. function pause_menu_objective_menu_show(menu_data) 
  2490. 	menu_scroll_bar_hide() 
  2491. 	menu_data.header_label_str = "INFO_OBJECTIVES_TITLE" 
  2492. 	--	Populate the menu 
  2493. 	vint_dataresponder_request("pause_menu_objectives_populate", "pause_menu_populate_objectives", OBJECTIVES_MAX_ITEMS) 
  2494. 	 
  2495. 	local menu_label = Menu_option_labels[0] 
  2496. 	 
  2497. 	local control = menu_label.control 
  2498.  
  2499. 	if control ~= nil then 
  2500. 		if control.type ~= PAUSE_MENU_CONTROL_OBJECTIVE_WRAP_LINE then 
  2501. 			-- this isn't a PAUSE_MENU_CONTROL_OBJECTIVE_TEXT_LINE so release it 
  2502. 			menu_release_control(control) 
  2503. 			control = nil 
  2504. 		end 
  2505. 	end 
  2506.  
  2507. 	vint_set_property(menu_label.label_h, "text_tag", "")	 
  2508. 	 
  2509. 	if control == nil then 
  2510. 		local control_h = vint_object_clone(vint_object_find("pm_objectives_control"), Menu_option_labels.control_parent) 
  2511. 		control = { grp_h = control_h, type = PAUSE_MENU_CONTROL_OBJECTIVE_WRAP_LINE, is_highlighted = false, label = ""} 
  2512. 		menu_label.control = control		 
  2513. 		 
  2514. --		menu_label.original_anchor = { } 
  2515. 		 
  2516. 		menu_label.objective_list = { } 
  2517. 		 
  2518. 		menu_label.clip_object = vint_object_find("pm_objective_clip", control.grp_h)  
  2519. 		 
  2520. 		vint_set_property(menu_label.clip_object, "clip_size", 565.0, OBJECTIVE_MAX_VISIBLE_PIXELS) 
  2521. 		menu_label.objective_list.line_h = vint_object_find("pm_objective_wrap_line", menu_label.clip_object) 
  2522.  
  2523. 		--	Create the labels 
  2524. 		menu_label.objective_list.objective_lines 		= { [0] = { label_h = menu_label.objective_list.line_h } } 
  2525. 	end 
  2526.  
  2527. 	--	Create the labels 
  2528. 	-- menu_label.edit.option_labels 		= { [0] = { label_h = menu_label.objective_list.line_h } } 
  2529. 	--vint_get_property(menu_label.objective_list.line_h, "anchor") 
  2530. 	 
  2531. 	 
  2532. 	 
  2533.  
  2534. 	local current_y = 0 
  2535. 	Pause_info_objective_lines.total_y  = 0 
  2536. 	 
  2537. 	local obj_lines = menu_label.objective_list.objective_lines 
  2538. 	for i = 0, Pause_info_objective_lines.num_lines - 1 do 
  2539. 		local line_data = obj_lines[i] 
  2540.  
  2541. 		if line_data == nil then 
  2542. 			obj_lines[i] = { label_h	= vint_object_clone(menu_label.objective_list.line_h) } 
  2543. 			line_data = obj_lines[i] 
  2544. 		end 
  2545. 		 
  2546. 		local text_box_h = vint_object_find("pm_objective_wrap_line_label", line_data.label_h) 
  2547. 		 
  2548. 		vint_set_property(text_box_h, "text_tag", Pause_info_objective_lines[i].text_string) 
  2549. 		vint_set_property(text_box_h, "tint", 0.623, 0.635, 0.643) 
  2550. 		local dummy_x, size_y = element_get_actual_size(text_box_h) 
  2551.  
  2552.  
  2553. 		current_y = current_y + size_y 
  2554. 		 
  2555. 		Pause_info_objective_lines.current_y = current_y 
  2556. 		 
  2557. 		-- we need the max as well. 
  2558. 		Pause_info_objective_lines.total_y = Pause_info_objective_lines.total_y + size_y 
  2559. 		 
  2560. 		if (current_y > OBJECTIVE_MAX_VISIBLE_PIXELS) then 
  2561. 			current_y = OBJECTIVE_MAX_VISIBLE_PIXELS 
  2562. 			Pause_info_objective_lines.more_lines = true 
  2563. 			Pause_info_objective_lines.current_y = OBJECTIVE_MAX_VISIBLE_PIXELS 
  2564. 			vint_set_property(menu_label.clip_object, "clip_enabled", true) 
  2565. 		end 
  2566. 	end 
  2567. --	vint_set_property(menu_label.objective_list.objective_lines[0].label_h, "anchor", text_pos_x, current_y ) 
  2568. 	 
  2569. end 
  2570.  
  2571. function pause_menu_objective_menu_release(menu_data) 
  2572. 	 
  2573. 	local menu_label = Menu_option_labels[0] 
  2574. 	 
  2575. 	if menu_label.control ~= nil then 
  2576. 		vint_object_destroy(menu_label.control)  
  2577. 	end 
  2578. 	 
  2579. 	if menu_label.objective_list ~= nil then  
  2580. 	 
  2581. 		local obj_lines = menu_label.objective_list.objective_lines 
  2582. 		for i = 0, Pause_info_objective_lines.num_lines - 1 do 
  2583. 			local line_data = obj_lines[i] 
  2584. 			vint_object_destroy(line_data.label_h) 
  2585. 		end 
  2586. 	end 
  2587. 	 
  2588. 	Pause_info_objective_lines.num_lines = 0 
  2589. 	Pause_info_objective_lines.current_line = 0 
  2590. end 
  2591.  
  2592. 	 
  2593.  
  2594. function pause_menu_control_objective_wrap_line_show(menu_label, menu_data) 
  2595. 	 
  2596. 	-- we need to move this back because there is an unknown offset. 
  2597. 	local clip_y = -20 
  2598. 	-- TODO: you probably want a small offset here instead of 0.  
  2599. 	vint_set_property(menu_label.clip_object, "anchor", 6, clip_y ) 
  2600. 			 
  2601. 	 
  2602. 	local current_x = 0 
  2603. 	local current_y = 0 
  2604. 	 
  2605. 	local total_y = 0 
  2606. 	local real_y = 0 
  2607. 	 
  2608. 	local first_vis_item_location = -1 
  2609. 	 
  2610. 	local control = menu_label.control 
  2611. 		 
  2612. 	Pause_info_objective_lines.more_lines = false 
  2613. 	local obj_lines = menu_label.objective_list.objective_lines 
  2614. 	for i = 0, Pause_info_objective_lines.num_lines - 1 do 
  2615. 		local line_data = obj_lines[i] 
  2616. 		local text_box_h = vint_object_find("pm_objective_wrap_line_label", line_data.label_h)	 
  2617. 		 
  2618. 		local dummy_x, size_y = element_get_actual_size(text_box_h) 
  2619. 			 
  2620. 		if(i >= Pause_info_objective_lines.current_line and  total_y  < OBJECTIVE_MAX_VISIBLE_PIXELS and i < Pause_info_objective_lines.num_lines) then 
  2621. 			vint_set_property(line_data.label_h, "visible", true) 
  2622. 			if (first_vis_item_location == -1) then 
  2623. 				first_vis_item_location = real_y 
  2624. 			end 
  2625. 				 
  2626. 			local dummy_x, size_y = element_get_actual_size(text_box_h) 
  2627. 			-- move it down to the next line. 
  2628. 			vint_set_property(line_data.label_h, "anchor", current_x, current_y ) 
  2629. 			if ( i == 0 ) then  
  2630. 				vint_set_property(vint_object_find("pm_objective_wrap_checkbox", line_data.label_h), "visible", false) 
  2631. 				vint_set_property(vint_object_find("pm_objective_wrap_checkmark", line_data.label_h), "visible", false) 
  2632. 				vint_set_property(text_box_h, "anchor",  current_x, current_y) 
  2633. 			else 
  2634. 				vint_set_property(vint_object_find("pm_objective_wrap_checkmark", line_data.label_h), "visible", Pause_info_objective_lines[i].checked) 
  2635. 			end 
  2636. 			 
  2637.  
  2638. 			 
  2639. 			current_y = current_y + size_y 
  2640. 			total_y = total_y + size_y 
  2641. 			if (total_y > OBJECTIVE_MAX_VISIBLE_PIXELS) then 
  2642. 				total_y = OBJECTIVE_MAX_VISIBLE_PIXELS 
  2643. 				Pause_info_objective_lines.more_lines = true 
  2644. 			 
  2645. 			end 
  2646. 		else  
  2647. 			vint_set_property(line_data.label_h, "visible", false) 
  2648. 			if (i >= Pause_info_objective_lines.current_line) then 
  2649. 				Pause_info_objective_lines.more_lines = true 
  2650. 			end 
  2651. 		end 
  2652. 		 
  2653. 		real_y = real_y + size_y 
  2654. 	end 
  2655. 	 
  2656.  
  2657. 	if (Pause_info_objective_lines.more_lines) then 
  2658. 		pause_menu_objective_create_scroll_bar(menu_label,menu_data) 
  2659. 	end 
  2660. 	 
  2661. 	pause_menu_objective_set_thumb_pos_scroll_bar(menu_data, first_vis_item_location / (Pause_info_objective_lines.total_y)) 
  2662.  
  2663. 	--	Show the new control 
  2664. 	vint_set_property(control.grp_h, "visible", true) 
  2665. 	vint_set_property(control.grp_h, "anchor", menu_label.anchor_x, menu_label.anchor_y) 
  2666. 	 
  2667. end 
  2668.  
  2669. function pause_menu_control_objective_release(Menu_control) 
  2670.  
  2671. 	local menu_data = Pause_menu_objective_menu[0] 
  2672.  
  2673. 	if menu_data.has_scroll_bar == true then 
  2674. 		menu_data.has_scroll_bar = false 
  2675. 		vint_object_destroy(menu_data.scroll_bar.bar_grp) 
  2676. 		menu_data.scroll_bar = nil 
  2677. 	end 
  2678.  
  2679. 	 
  2680. 	 
  2681. 	local menu_label = Menu_option_labels_inactive[0] 
  2682. 	pause_menu_control_release(menu_label.control) 
  2683. 	 
  2684. 	 
  2685. 	 
  2686. end  
  2687.  
  2688.  
  2689. function pause_menu_control_objective_nav_down(menu_label, menu_data) 
  2690. 	 
  2691. 	if(Pause_info_objective_lines.more_lines) then  
  2692. 		Pause_info_objective_lines.current_line = Pause_info_objective_lines.current_line + 1 
  2693. 		 
  2694. 		local first_vis_item_location = -1 
  2695. 		 
  2696. 		local control = menu_label.control 
  2697.  
  2698. 		local current_x, current_y, real_y	= 0, 0, 0 
  2699. 	 
  2700. 		Pause_info_objective_lines.more_lines = false 
  2701. 		 
  2702. 		local obj_lines = menu_label.objective_list.objective_lines 
  2703. 		for i = 0, Pause_info_objective_lines.num_lines - 1 do 
  2704. 			local line_data = obj_lines[i] 
  2705. 			 
  2706. 			local text_box_h = vint_object_find("pm_objective_wrap_line_label", line_data.label_h)	 
  2707. 			local dummy_x, size_y = element_get_actual_size(text_box_h) 
  2708. 			 
  2709. 			if(i >= Pause_info_objective_lines.current_line and  current_y < OBJECTIVE_MAX_VISIBLE_PIXELS and i < Pause_info_objective_lines.num_lines) then 
  2710. 				vint_set_property(line_data.label_h, "visible", true) 
  2711. 				if (first_vis_item_location == -1) then 
  2712. 					first_vis_item_location = real_y 
  2713. 				end 
  2714. 				 
  2715. 				local dummy_x, size_y = element_get_actual_size(text_box_h) 
  2716. 				-- move it down to the next line. 
  2717. 				vint_set_property(line_data.label_h, "anchor", current_x, current_y ) 
  2718. 				 
  2719. 				current_y = current_y + size_y 
  2720. 				if (current_y > OBJECTIVE_MAX_VISIBLE_PIXELS) then 
  2721. 					current_y = OBJECTIVE_MAX_VISIBLE_PIXELS 
  2722. 					Pause_info_objective_lines.more_lines = true 
  2723. 				end 
  2724. 			else  
  2725. 				if (i >= Pause_info_objective_lines.current_line) then 
  2726. 					Pause_info_objective_lines.more_lines = true 
  2727. 				end 
  2728. 				vint_set_property(line_data.label_h, "visible", false) 
  2729. 			end 
  2730. 			 
  2731. 			 
  2732. 			real_y = real_y + size_y 
  2733. 		end 
  2734. 		 
  2735. 		 
  2736. 		pause_menu_objective_set_thumb_pos_scroll_bar(menu_data, first_vis_item_location / Pause_info_objective_lines.total_y) 
  2737.  
  2738. 	end 
  2739. end 
  2740.  
  2741. function pause_menu_control_objective_nav_up(menu_label, menu_data) 
  2742. 	if(Pause_info_objective_lines.current_line > 0 ) then  
  2743. 		Pause_info_objective_lines.current_line = Pause_info_objective_lines.current_line - 1 
  2744. 		 
  2745. 		local first_vis_item_location = -1 
  2746. 		 
  2747. 		local control = menu_label.control 
  2748.  
  2749. 		local current_x, current_y, real_y		= 0, 0, 0 
  2750. 		 
  2751. 		Pause_info_objective_lines.more_lines = false 
  2752. 					 
  2753. 		local obj_lines = menu_label.objective_list.objective_lines 
  2754. 		for i = 0, Pause_info_objective_lines.num_lines - 1 do 
  2755. 			local line_data = obj_lines[i] 
  2756. 			local text_box_h = vint_object_find("pm_objective_wrap_line_label", line_data.label_h)	 
  2757. 			 
  2758. 			local dummy_x, size_y = element_get_actual_size(text_box_h) 
  2759. 			 
  2760. 			if(i >= Pause_info_objective_lines.current_line and  current_y < OBJECTIVE_MAX_VISIBLE_PIXELS and i < Pause_info_objective_lines.num_lines) then 
  2761. 				vint_set_property(line_data.label_h, "visible", true) 
  2762. 				if (first_vis_item_location == -1) then 
  2763. 					first_vis_item_location = real_y 
  2764. 				end 
  2765. 		 
  2766. 				 
  2767. 				-- move it down to the next line. 
  2768. 				vint_set_property(line_data.label_h, "anchor", current_x, current_y ) 
  2769. 				current_y = current_y + size_y 
  2770. 				if (current_y > OBJECTIVE_MAX_VISIBLE_PIXELS) then 
  2771. 					current_y = OBJECTIVE_MAX_VISIBLE_PIXELS 
  2772. 					Pause_info_objective_lines.more_lines = true 
  2773. 				 
  2774. 				end 
  2775. 			else  
  2776. 				if (i >= Pause_info_objective_lines.current_line) then 
  2777. 					Pause_info_objective_lines.more_lines = true 
  2778. 				end 
  2779. 				vint_set_property(line_data.label_h, "visible", false) 
  2780. 			end 
  2781. 			 
  2782. 				 
  2783. 			real_y = real_y + size_y 
  2784. 				 
  2785. 		end 
  2786.  
  2787. 		 
  2788. 		pause_menu_objective_set_thumb_pos_scroll_bar(menu_data, first_vis_item_location / Pause_info_objective_lines.total_y) 
  2789.  
  2790. 	end 
  2791. end 
  2792.  
  2793. function pause_menu_objective_wrap_get_width(menu_item) 
  2794. 	local menu_data = Menu_active[Menu_active.first_vis_item] 
  2795. 	 
  2796. 	if (menu_data.has_scroll_bar == true) then 
  2797. 		return 565.0 + 25.0 -- for the scroll bar 
  2798. 	else  
  2799. 		return 565.0 
  2800. 	end 
  2801. end 
  2802.  
  2803. function pause_menu_objective_wrap_get_height(menu_item) 
  2804. 	return Pause_info_objective_lines.current_y 
  2805. end 
  2806.  
  2807. 	 
  2808. function pause_menu_objective_get_width(menu_item) 
  2809. 	return 565.0 
  2810. end 
  2811.  
  2812. function pause_menu_objective_get_height(menu_item) 
  2813. 	return Pause_info_objective_lines.current_y 
  2814. end 
  2815.  
  2816. function pause_menu_objective_create_scroll_bar(menu_label, menu_data) 
  2817. 	if menu_data.has_scroll_bar == true then 
  2818. 		menu_data.has_scroll_bar = false 
  2819. 		vint_object_destroy(menu_data.scroll_bar.bar_grp) 
  2820. 		menu_data.scroll_bar = nil 
  2821. 	end 
  2822. 	 
  2823. 	local thumb_size = OBJECTIVE_MAX_VISIBLE_PIXELS / Pause_info_objective_lines.total_y  
  2824. 	menu_data.has_scroll_bar = true; 
  2825. 	 
  2826. 	 
  2827.  
  2828. 	local bar_grp = vint_object_clone(vint_object_find("menu_scroll_bar", nil, MENU_BASE_DOC_HANDLE), Menu_option_labels.control_parent) 
  2829. 		 
  2830. 		 
  2831. 	local scroll_data = { 
  2832. 		visible =			false, 
  2833. 		bar_grp =			bar_grp, 
  2834. 		bg_n_h =			vint_object_find("menu_scroll_bg_n", bar_grp), 
  2835. 		bg_c_h =			vint_object_find("menu_scroll_bg_c", bar_grp), 
  2836. 		bg_s_h =			vint_object_find("menu_scroll_bg_s", bar_grp), 
  2837. 		thumb_n_h =			vint_object_find("menu_scroll_thumb_n", bar_grp), 
  2838. 		thumb_s_h =			vint_object_find("menu_scroll_thumb_s", bar_grp), 
  2839. 		thumb_blend_h =		vint_object_find("menu_scroll_thumb_blend", bar_grp), 
  2840. 		thumb_pos =			0, 
  2841. 		bar_height =		332, 
  2842. 		thumb_height =		332, 
  2843. 	} 
  2844.  
  2845. 	menu_data.scroll_bar = scroll_data 
  2846. 		 
  2847. 	pause_menu_objective_show_scroll_bar(menu_data) 
  2848. 	pause_menu_objective_set_bar_height(menu_data, OBJECTIVE_MAX_VISIBLE_PIXELS) -- 33? 
  2849. 	pause_menu_objective_set_thumb_size_scroll_bar(menu_data, thumb_size) 
  2850. 	pause_menu_objective_set_pos_scroll_bar(menu_data, 565, Pause_menu_objective_menu.header_height) 
  2851. end 
  2852.  
  2853. -- working! 
  2854. function pause_menu_objective_show_scroll_bar(menu_data) 
  2855. 	local scroll_data = menu_data.scroll_bar 
  2856. 	vint_set_property(scroll_data.bar_grp, "visible", true) 
  2857. end 
  2858.  
  2859. function pause_menu_objective_set_pos_scroll_bar(menu_data, x, y) 
  2860. 	vint_set_property(menu_data.scroll_bar.bar_grp, "anchor", x, y) 
  2861. end 
  2862.  
  2863. -- working I think 
  2864. function pause_menu_objective_set_bar_height(menu_data, new_height) 
  2865. 	local scroll_data = menu_data.scroll_bar 
  2866. 	scroll_data.bar_height = new_height - 54 --This magic number will allow you to change the base height of the scrollbar 
  2867.  
  2868. 	 
  2869. 	vint_set_property(scroll_data.bg_s_h, "anchor", 38, new_height +10 ) 
  2870. 	vint_set_property(scroll_data.bg_c_h, "source_se", 10, new_height) 
  2871.  
  2872. 	pause_menu_objective_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  2873. end 
  2874.  
  2875. function pause_menu_objective_set_thumb_size_scroll_bar(menu_data, height) 
  2876. 	local scroll_data = menu_data.scroll_bar 
  2877. 	scroll_data.thumb_height = height * scroll_data.bar_height 
  2878. 	 
  2879. 	 
  2880. 	if scroll_data.thumb_height < 10 then 
  2881. 		scroll_data.thumb_height = 10 
  2882. 	end 
  2883. 	 
  2884. 	 
  2885. 	vint_set_property(scroll_data.thumb_n_h, "source_se", 32, scroll_data.thumb_height - 20) 
  2886. 	pause_menu_objective_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  2887. end 
  2888.  
  2889. function pause_menu_objective_set_thumb_pos_scroll_bar(menu_data, value) 
  2890. 	 
  2891. 	if menu_data.has_scroll_bar ~= true then 
  2892. 		return 
  2893. 	end 
  2894. 	 
  2895. 	local scroll_data = menu_data.scroll_bar 
  2896. 	 
  2897. 	if scroll_data.thumb_pos ~= value then 
  2898. 		scroll_data.thumb_pos = value 
  2899. 		pause_menu_objective_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  2900. 	end 
  2901. end 
  2902.  
  2903. function pause_menu_objective_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  2904. 	if menu_data.has_scroll_bar ~= true then 
  2905. 		return 
  2906. 	end 
  2907. 	 
  2908. 	-- update the thumb pos 
  2909. 	local thumb_offset = scroll_data.thumb_pos * scroll_data.bar_height + 10 
  2910. 	 
  2911. 	 
  2912. 	if thumb_offset > scroll_data.bar_height then 
  2913. 		thumb_offset = scroll_data.bar_height 
  2914. 	end 
  2915. 	 
  2916. 	 
  2917. 	vint_set_property(scroll_data.thumb_n_h,		"anchor", 3, thumb_offset) 
  2918. 	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 
  2919. 	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 
  2920. end 
  2921.  
  2922. --------------------------------------[ STAT_TEXT_LINE ]-------------------------------------- 
  2923. function pause_menu_control_stat_text_line_show_internal(menu_label, menu_data, control_type) 
  2924. 	local control = menu_label.control 
  2925.  
  2926. 	if control ~= nil then 
  2927. 		if control.type ~= control_type then 
  2928. 			-- this isn't my control so release it 
  2929. 			menu_release_control(control) 
  2930. 			control = nil 
  2931. 		end 
  2932. 	end 
  2933.  
  2934. 	vint_set_property(menu_label.label_h, "text_tag", "")	 
  2935. 	 
  2936. 	if control == nil then 
  2937. 		local control_h = vint_object_clone(vint_object_find("pm_stat_text_line"), Menu_option_labels.control_parent) 
  2938. 		control = { grp_h = control_h, type = control_type, is_highlighted = false } 
  2939. 		 
  2940. 		menu_label.control = control		 
  2941. 		menu_label.stars = { star_h = { } } 
  2942. 		menu_label.value_h = vint_object_find("stat_value", control.grp_h) 
  2943. 		menu_label.real_label_h = vint_object_find("stat_label", control.grp_h) 
  2944. 		menu_label.stars.star_grp = vint_object_find("stat_stars", control.grp_h) 
  2945. 		menu_label.stars.star_h[0] = vint_object_find("stat_star1", menu_label.stars.star_grp) 
  2946. 		menu_label.stars.star_h[1]= vint_object_find("stat_star2", menu_label.stars.star_grp) 
  2947. 		menu_label.stars.star_h[2] = vint_object_find("stat_star3", menu_label.stars.star_grp) 
  2948. 	end 
  2949. 	 
  2950. 	--	Show the new control 
  2951. 	vint_set_property(control.grp_h, "visible", true) 
  2952. 	vint_set_property(control.grp_h, "anchor", menu_label.anchor_x + 7, menu_label.anchor_y) 
  2953. 	vint_set_property(control.grp_h, "depth", menu_label.depth) 
  2954. 	 
  2955. 	--	Set the color and text_tag 
  2956. 	vint_set_property(menu_label.real_label_h, "text_tag", menu_data.label) 
  2957. 	 
  2958. 	if control_type == PAUSE_MENU_CONTROL_STAT_TEXT_LINE then 
  2959. 		vint_set_property(menu_label.real_label_h, "tint", 0.623, 0.635, 0.643) 
  2960. 	else 
  2961. 		vint_set_property(menu_label.real_label_h, "tint", 0.364, 0.368, 0.376) 
  2962. 	end 
  2963. 	vint_set_property(menu_label.real_label_h, "visible", true) 
  2964. 		 
  2965. 	if menu_data.show_value == true then 
  2966. 		vint_set_property(menu_label.value_h, "visible", true) 
  2967. 		vint_set_property(menu_label.value_h, "text_tag", menu_data.value) 
  2968.  
  2969. 		if control_type == PAUSE_MENU_CONTROL_STAT_TEXT_LINE then 
  2970. 			vint_set_property(menu_label.value_h, "tint", 0.623, 0.635, 0.643) 
  2971. 		else 
  2972. 			vint_set_property(menu_label.value_h, "tint", 0.364, 0.368, 0.376) 
  2973. 		end 
  2974. 	else 
  2975. 		vint_set_property(menu_label.value_h, "visible", false) 
  2976. 	end 
  2977. 	 
  2978. 	if menu_data.data_type == DIV_DATA_STAR then 
  2979. 		vint_set_property(menu_label.value_h, "visible", false) 
  2980. 		vint_set_property(menu_label.stars.star_grp, "visible", true) 
  2981. 		pause_menu_diversions_update_stars(menu_label, menu_data) 
  2982. 	end 
  2983. end 
  2984.  
  2985. function pause_menu_control_diversion_text_line_show(menu_label, menu_data) 
  2986. 	pause_menu_control_stat_text_line_show_internal(menu_label, menu_data, PAUSE_MENU_CONTROL_DIVERSION_TEXT_LINE) 
  2987. 	 
  2988. --	pause_menu_control_stat_text_line_show_internal(menu_label, menu_data, PAUSE_MENU_CONTROL_DIVERSION_TEXT_LINE) 
  2989. --	if Menu_active[Menu_active.highlighted_item] == menu_data then 
  2990. --		pause_menu_control_diversion_text_line_enter(menu_label, menu_data) 
  2991. --	end 
  2992. end 
  2993.  
  2994. function pause_menu_control_stat_text_line_show(menu_label, menu_data) 
  2995. 	pause_menu_control_stat_text_line_show_internal(menu_label, menu_data, PAUSE_MENU_CONTROL_STAT_TEXT_LINE) 
  2996. end 
  2997.  
  2998. function pause_menu_control_diversion_text_line_enter(menu_label, menu_data) 
  2999. 	if menu_label.control.hl_control ~= nil then 
  3000. 		vint_object_destroy(menu_label.control.hl_control) 
  3001. 		menu_label.control.hl_control = nil 
  3002. 	end 
  3003. 	 
  3004. 	local hl_bar_label_h = vint_object_find("menu_sel_bar_label", Menu_option_labels.hl_bar) 
  3005. 	vint_set_property(hl_bar_label_h, "visible", false)		--	Disable the previous label from showing 
  3006. 	 
  3007. 	local clone = vint_object_clone(menu_label.control.grp_h, Menu_option_labels.hl_bar) 
  3008. 	menu_label.control.hl_control = clone 
  3009. 	vint_set_property(clone, "anchor", 12, 0) 
  3010. 	 
  3011. 	for i, n in { "stat_label", "stat_value" } do 
  3012. 		local t = vint_object_find(n, clone) 
  3013. 		vint_set_property(t, "tint", 0, 0, 0) 
  3014. 		vint_set_property(t, "font", "thin") 
  3015. 	end 
  3016. end 
  3017.  
  3018. function pause_menu_control_diversion_text_line_leave(menu_label, menu_data) 
  3019. 	if menu_label.control.hl_control ~= nil then 
  3020. 		vint_object_destroy(menu_label.control.hl_control) 
  3021. 		menu_label.control.hl_control = nil 
  3022. 	end 
  3023. end 
  3024.  
  3025. function pause_menu_control_stat_text_line_release(control) 
  3026. 	if control.grp_h ~= nil then 
  3027. 		vint_object_destroy(control.grp_h) 
  3028. 		control.grp_h = nil 
  3029. 	end 
  3030. 	 
  3031. 	if control.hl_control ~= nil then 
  3032. 		vint_object_destroy(control.hl_control) 
  3033. 		control.hl_control = nil 
  3034. 	end 
  3035. end 
  3036.  
  3037. --------------------------------------[ CHECKBOX IMAGE ]-------------------------------------- 
  3038. function pause_menu_control_checkbox_image_show(menu_label, menu_data) 
  3039. 	pause_menu_control_objective_text_line_show(menu_label, menu_data) 
  3040.  
  3041. 	vint_set_property(menu_label.real_label_h, "tint", 0.364, 0.368, 0.376) 
  3042. 	 
  3043. 	if menu_data.dead == true or menu_data.retrieved == true then 
  3044. 		vint_set_property(menu_label.real_label_h, "alpha", 0.6) 
  3045. 		vint_set_property(menu_label.checkbox_h, "alpha", 0.6) 
  3046. 	end 
  3047. end 
  3048.  
  3049.  
  3050. function pause_menu_control_checkbox_image_update_select_bar(old_index) 
  3051. 	local new_idx = Menu_active.highlighted_item 
  3052. 		 
  3053. 	local anchor_x, anchor_y = vint_get_property(Menu_option_labels[new_idx].real_label_h, "anchor") 
  3054. 	local hl_bar_label_h = vint_object_find("menu_sel_bar_label", Menu_option_labels.hl_bar) 
  3055. 	 
  3056. 	if old_index ~= nil then 
  3057. 		vint_set_property(Menu_option_labels[old_index].checkbox_h, "tint", 0.364, 0.368, 0.376) 
  3058. 	end 
  3059. 	 
  3060. 	vint_set_property(Menu_option_labels[new_idx].checkbox_h, "tint", 0.9, 0.74, 0.05) 
  3061. 	vint_set_property(Menu_option_labels.hl_bar, "anchor", anchor_x + 5, Menu_option_labels[new_idx].anchor_y + 1) 
  3062. 	vint_set_property(hl_bar_label_h, "text_tag", Menu_active[new_idx].label) 
  3063. end 
  3064.  
  3065. function pause_menu_control_checkbox_image_nav_up(menu_label, menu_data) 
  3066. 	local idx = Menu_active.highlighted_item  
  3067. 	 
  3068. 	if idx - 1 >= 0 then 
  3069. 		Menu_active.highlighted_item = Menu_active.highlighted_item - 1 
  3070. 	else  
  3071. 		Menu_active.highlighted_item = Menu_active.num_items - 1 
  3072. 	end 
  3073. 		 
  3074. 	pause_menu_control_checkbox_image_update_select_bar(idx) 
  3075. 	 
  3076. 	if Menu_active.on_nav ~= nil then 
  3077. 		Menu_active.on_nav(Menu_active) 
  3078. 	end 
  3079. end 
  3080.  
  3081. function pause_menu_control_checkbox_image_nav_down(menu_label, menu_data) 
  3082. 	local idx = Menu_active.highlighted_item  
  3083. 	 
  3084. 	if idx + 1 < Menu_active.num_items then 
  3085. 		Menu_active.highlighted_item = Menu_active.highlighted_item + 1 
  3086. 	else 
  3087. 		Menu_active.highlighted_item = 0 
  3088. 	end 
  3089. 	 
  3090. 	pause_menu_control_checkbox_image_update_select_bar(idx) 
  3091. 	 
  3092. 	if Menu_active.on_nav ~= nil then 
  3093. 		Menu_active.on_nav(Menu_active) 
  3094. 	end 
  3095. end 
  3096.  
  3097. function pause_menu_control_checkbox_image_release(menu_label, menu_data) 
  3098. end 
  3099.  
  3100. function pause_menu_control_checkbox_image_compute_width(menu_data) 
  3101. 	local width, max_width 
  3102. 	local grp_h = vint_object_find("pm_objective_text_line") 
  3103. 	local label_h = vint_object_find("pm_objective_text_line_label", grp_h) 
  3104. 	local anchor_x, anchor_y = vint_get_property(label_h, "anchor") 
  3105. 	 
  3106. 	width = 0 
  3107. 	max_width = 0 
  3108. 	for i = 0, menu_data.num_items - 1 do 
  3109. 		vint_set_property(label_h, "text_tag", menu_data[i].label) 
  3110. 		width = element_get_actual_size(label_h) 
  3111. 		if width > max_width then 
  3112. 			max_width = width 
  3113. 		end 
  3114. 	end 
  3115. 	 
  3116. 	return max_width + anchor_x 
  3117. end 
  3118.  
  3119. function pause_menu_control_checkbox_image_resize_select_bar(menu_data) 
  3120. 	--Resize Selector bar 
  3121. 	local	width = pause_menu_control_checkbox_image_compute_width(menu_data) 
  3122. 	 
  3123. 	local frame_h = Menu_option_labels.frame 
  3124. 	local sel_bar_width = floor(width) - 8 
  3125. 		 
  3126. 	local bg_h = vint_object_find("menu_sel_bar_w", frame_h) 
  3127. 	vint_set_property(bg_h, "source_se", sel_bar_width, 36) 
  3128. 		 
  3129. 	bg_h = vint_object_find("menu_sel_bar_w_hl", frame_h) 
  3130. 	vint_set_property(bg_h, "source_se", sel_bar_width, 36) 
  3131. 		 
  3132. 	local menu_bar_e_anchor_x, menu_bar_e_anchor_y = vint_get_property(vint_object_find("menu_sel_bar_e", frame_h), "anchor") 
  3133. 	local menu_bar_e_anchor_x = sel_bar_width + 5 
  3134. 		 
  3135. 	local bg_h = vint_object_find("menu_sel_bar_e", frame_h) 
  3136. 	vint_set_property(bg_h, "anchor", menu_bar_e_anchor_x, menu_bar_e_anchor_y) 
  3137. 		 
  3138. 	local bg_h = vint_object_find("menu_sel_bar_e_hl", frame_h) 
  3139. 	vint_set_property(bg_h, "anchor", menu_bar_e_anchor_x - 1, menu_bar_e_anchor_y) 
  3140. 		 
  3141. 	vint_set_property(Menu_option_labels.hl_clip, "offset", 12, -15) 
  3142. 	vint_set_property(Menu_option_labels.hl_clip, "clip_size", width - 17, MENU_ITEM_HEIGHT) 
  3143. 	 
  3144. 	Pause_menu_checkbox_image_width = width + menu_data.image_offset.x 
  3145. 	pause_menu_control_checkbox_image_update_select_bar() 
  3146. end 
  3147.  
  3148. --------------------------------------[ HELP TEXT ]-------------------------------------- 
  3149. function pause_menu_control_help_text_show(menu_label, menu_data) 
  3150. 	local control = menu_label.control 
  3151.  
  3152. 	if control ~= nil then 
  3153. 		if control.type ~= PAUSE_MENU_CONTROL_HELP_TEXT then 
  3154. 			-- this isn't my control so release it 
  3155. 			menu_release_control(control) 
  3156. 			control = nil 
  3157. 		end 
  3158. 	end 
  3159.  
  3160. 	vint_set_property(menu_label.label_h, "text_tag", "")	 
  3161. 	 
  3162. 	if control == nil then 
  3163. 		local control_h = vint_object_clone(vint_object_find("pm_help_text"), Menu_option_labels.control_parent) 
  3164. 		control = { grp_h = control_h, type = PAUSE_MENU_CONTROL_HELP_TEXT, is_highlighted = false } 
  3165. 			 
  3166. 		menu_label.control = control		 
  3167. 		menu_label.help_clip_h = vint_object_find("pm_help_text_clip", control.grp_h) 
  3168. 		menu_label.real_label_h = vint_object_find("pm_help_text_label", control.grp_h) 
  3169. 	end 
  3170. 	 
  3171. 	--	Show the new control 
  3172. 	vint_set_property(control.grp_h, "visible", true) 
  3173. 	vint_set_property(control.grp_h, "anchor", menu_label.anchor_x + 7, menu_label.anchor_y) 
  3174. 	vint_set_property(control.grp_h, "depth", menu_label.depth) 
  3175.  
  3176. 	vint_set_property(menu_label.real_label_h, "text_tag", menu_data.label) 
  3177. 	vint_set_property(menu_label.real_label_h, "wrap_width", PAUSE_MENU_HELP_TEXT_WIDTH) 
  3178. 	vint_set_property(menu_label.help_clip_h, "clip_size", PAUSE_MENU_HELP_TEXT_CLIP_WIDTH, PAUSE_MENU_HELP_TEXT_CLIP_HEIGHT) 
  3179. 	 
  3180. 	-- we need a version we can manipulate 
  3181. 	 
  3182. 	local anchor_x, anchor_y= vint_get_property(menu_label.real_label_h, "anchor") 
  3183. 	Pause_menu_help_page.original_y = anchor_y 
  3184. 	 
  3185. 	local size_x, size_y = element_get_actual_size(menu_label.real_label_h) 
  3186. 	 
  3187. 	if menu_data.has_scroll_bar == nil then 
  3188. 		menu_data.has_scroll_bar = false 
  3189. 	end 
  3190. 		 
  3191. 	 
  3192. 	if  size_y > PAUSE_MENU_HELP_TEXT_CLIP_HEIGHT then 
  3193. 		Pause_menu_help_page.use_slider = true 
  3194. 		vint_set_property(menu_label.real_label_h, "wrap_width", PAUSE_MENU_HELP_TEXT_CLIP_WIDTH - PAUSE_MENU_HELP_SLIDER_WIDTH) 
  3195. 		vint_set_property(menu_label.help_clip_h, "clip_size", PAUSE_MENU_HELP_TEXT_CLIP_WIDTH - PAUSE_MENU_HELP_SLIDER_WIDTH, PAUSE_MENU_HELP_TEXT_CLIP_HEIGHT) 
  3196.  
  3197. 		pause_menu_control_help_create_scroll_bar(menu_label, menu_data) 
  3198. 		 
  3199. 		local accel_repeat = 0.08 
  3200. 		local accel_factor = 15 
  3201. 		local accel_limit  = 1000 
  3202.  
  3203. 		menu_label.input1 = vint_subscribe_to_input_event(nil, "nav_up", "pause_menu_help_page_up", 5) 
  3204. 		vint_set_input_params(menu_label.input1, accel_repeat, accel_factor, accel_limit, true) 
  3205. 		menu_label.input2 = vint_subscribe_to_input_event(nil, "nav_down", "pause_menu_help_page_down", 5) 
  3206. 		vint_set_input_params(menu_label.input2, accel_repeat, accel_factor, accel_limit, true) 
  3207.  
  3208. 	else  
  3209. 		Pause_menu_help_page.use_slider = false 
  3210. 	end 
  3211.  
  3212.  
  3213. end 
  3214. 	 
  3215. 	 
  3216. function pause_menu_control_help_release() 
  3217. 	local menu_data 
  3218. 	 
  3219. 	if Menu_mode_current == "pause" then 
  3220. 		menu_data = Pause_info_help_sub_menu[0] 
  3221. 	else 
  3222. 		menu_data = Main_menu_mp_help_info[0] 
  3223. 	end 
  3224. 	 
  3225. 	if menu_data.has_scroll_bar == true then 
  3226. 		menu_data.has_scroll_bar = false 
  3227. 		vint_object_destroy(menu_data.scroll_bar.bar_grp) 
  3228. 		menu_data.scroll_bar = nil 
  3229. 	end 
  3230. 		 
  3231.  
  3232. 	local menu_label = Menu_option_labels_inactive[0] 
  3233. 	if menu_label.input1 ~= nil then 
  3234. 		vint_unsubscribe_to_input_event(menu_label.input1) 
  3235. 		vint_unsubscribe_to_input_event(menu_label.input2) 
  3236. 		menu_label.input1 = nil 
  3237. 		menu_label.input2 = nil 
  3238. 	end 
  3239. 	 
  3240. 	pause_menu_control_release(menu_label.control) 
  3241. 	menu_label.real_label_h = nil 
  3242. end 
  3243.  
  3244. function pause_menu_control_help_set_pos_scroll_bar(menu_data, x, y) 
  3245. 	vint_set_property(menu_data.scroll_bar.bar_grp, "anchor", x, y) 
  3246. end 
  3247.  
  3248. function pause_menu_control_help_create_scroll_bar(menu_label, menu_data) 
  3249. 	if menu_data.has_scroll_bar == true then 
  3250. 		menu_data.has_scroll_bar = false 
  3251. 		vint_object_destroy(menu_data.scroll_bar.bar_grp) 
  3252. 		menu_data.scroll_bar = nil 
  3253. 	end 
  3254. 	 
  3255. 	menu_data.has_scroll_bar = true; 
  3256. 	 
  3257. 	 
  3258. 	 
  3259. 	local bar_grp = vint_object_clone(vint_object_find("menu_scroll_bar", nil, MENU_BASE_DOC_HANDLE), Menu_option_labels.control_parent) 
  3260. 		 
  3261. 		 
  3262. 	local scroll_data = { 
  3263. 		visible =			false, 
  3264. 		bar_grp =			bar_grp, 
  3265. 		bg_n_h =			vint_object_find("menu_scroll_bg_n", bar_grp), 
  3266. 		bg_c_h =			vint_object_find("menu_scroll_bg_c", bar_grp), 
  3267. 		bg_s_h =			vint_object_find("menu_scroll_bg_s", bar_grp), 
  3268. 		thumb_n_h =			vint_object_find("menu_scroll_thumb_n", bar_grp), 
  3269. 		thumb_s_h =			vint_object_find("menu_scroll_thumb_s", bar_grp), 
  3270. 		thumb_blend_h =		vint_object_find("menu_scroll_thumb_blend", bar_grp), 
  3271. 		thumb_pos =			0, 
  3272. 		bar_height =		332, 
  3273. 		thumb_height =		332, 
  3274. 	} 
  3275.  
  3276. 	menu_data.scroll_bar = scroll_data 
  3277. 	 
  3278. 	local dummy_x, size_y = element_get_actual_size(menu_label.real_label_h) 
  3279. 	local thumb_size =  PAUSE_MENU_HELP_TEXT_CLIP_HEIGHT / size_y 
  3280. 	 
  3281. 	 
  3282. 	pause_menu_control_help_show_scroll_bar(menu_data) 
  3283. 	pause_menu_control_help_set_bar_height(menu_data, PAUSE_MENU_HELP_TEXT_CLIP_HEIGHT) 
  3284. 	pause_menu_control_help_set_thumb_size_scroll_bar(menu_data, thumb_size) 
  3285. 	local box_x, box_y = vint_get_property(menu_label.control.grp_h, "anchor") 
  3286. 	local clip_x, clip_y = vint_get_property(menu_label.help_clip_h, "anchor") 
  3287. 	local label_x, label_y = vint_get_property(menu_label.real_label_h, "anchor") 
  3288. 	local real_y = box_y + clip_y + label_y 
  3289. 	local real_x = box_x + clip_x + label_x 
  3290. 	pause_menu_control_help_set_pos_scroll_bar(menu_data, real_x + PAUSE_MENU_HELP_TEXT_CLIP_WIDTH - PAUSE_MENU_HELP_SLIDER_WIDTH + 5, real_y) 
  3291. 	 
  3292. end 
  3293.  
  3294. function pause_menu_control_help_text_get_width() 
  3295. 	return PAUSE_MENU_HELP_TEXT_WIDTH 
  3296. end 
  3297.  
  3298. function pause_menu_control_help_text_get_height() 
  3299. 	return PAUSE_MENU_HELP_TEXT_HEIGHT 
  3300. end 
  3301.  
  3302. function pause_menu_help_page_down(target, event, accelleration) 
  3303. 	local menu_label = Menu_option_labels[0] 
  3304. 	local menu_data = Menu_active[0] 
  3305. 	 
  3306. 	if menu_label.real_label_h == nil then 
  3307. 		return 
  3308. 	end 
  3309. 	 
  3310.  
  3311. 	local size_x, size_y = element_get_actual_size(menu_label.real_label_h) 
  3312. 	local anchor_x, anchor_y = vint_get_property(menu_label.real_label_h, "anchor") 
  3313.  
  3314. 	if 0 - anchor_y < size_y - PAUSE_MENU_HELP_TEXT_CLIP_HEIGHT then 
  3315. 		-- we only manipulate the working text object.  
  3316. 		anchor_y = anchor_y - 0.9 * accelleration 
  3317. 		 
  3318. 		if 0 - anchor_y > size_y - PAUSE_MENU_HELP_TEXT_CLIP_HEIGHT then 
  3319. 			anchor_y = 0 - (size_y - PAUSE_MENU_HELP_TEXT_CLIP_HEIGHT) 
  3320. 		end 
  3321. 		 
  3322. 		vint_set_property(menu_label.real_label_h, "anchor", anchor_x, anchor_y) 
  3323. 		pause_menu_control_help_set_thumb_pos_scroll_bar(menu_data, (0 - anchor_y) / size_y) 
  3324. 	end 
  3325. end 
  3326.  
  3327. function pause_menu_help_page_up(target, event, accelleration) 
  3328. 	local menu_label = Menu_option_labels[0] 
  3329. 	local menu_data = Menu_active[0] 
  3330. 	 
  3331. 	if menu_label.real_label_h == nil then 
  3332. 		return 
  3333. 	end 
  3334.  
  3335. 	local size_x, size_y = element_get_actual_size(menu_label.real_label_h) 
  3336. 	local anchor_x, anchor_y = vint_get_property(menu_label.real_label_h, "anchor") 
  3337. 	 
  3338. 	if anchor_y < 0 then 
  3339. 		anchor_y = anchor_y + 0.9 * accelleration 
  3340. 		if anchor_y > 0 then 
  3341. 			anchor_y = 0 
  3342. 		end 
  3343.  
  3344. 		vint_set_property(menu_label.real_label_h, "anchor", anchor_x, anchor_y) 
  3345.  
  3346. 		pause_menu_control_help_set_thumb_pos_scroll_bar(menu_data, (0 - anchor_y) / size_y) 
  3347. 	end 
  3348. end 
  3349.  
  3350. -- working I think 
  3351. function pause_menu_control_help_set_bar_height(menu_data, new_height) 
  3352. 	local scroll_data = menu_data.scroll_bar 
  3353. 	scroll_data.bar_height = new_height - 54--This magic number will allow you to change the base height of the scrollbar 
  3354.  
  3355. 	vint_set_property(scroll_data.bg_s_h, "anchor", 38, new_height - 10 ) 
  3356. 	vint_set_property(scroll_data.bg_c_h, "source_se", 10, new_height - 28) 
  3357.  
  3358. 	pause_menu_control_help_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  3359. end 
  3360.  
  3361. function pause_menu_control_help_set_thumb_size_scroll_bar(menu_data, height) 
  3362. 	local scroll_data = menu_data.scroll_bar 
  3363. 	scroll_data.thumb_height = height * scroll_data.bar_height 
  3364. 	 
  3365. 	if scroll_data.thumb_height < 60 then 
  3366. 		scroll_data.thumb_height = 60 
  3367. 	end 
  3368. 	 
  3369. 	 
  3370. 	vint_set_property(scroll_data.thumb_n_h, "source_se", 32, scroll_data.thumb_height - 20) 
  3371. 	pause_menu_control_help_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  3372. 	 
  3373. end 
  3374.  
  3375. -- working! 
  3376. function pause_menu_control_help_show_scroll_bar(menu_data) 
  3377. 	local scroll_data = menu_data.scroll_bar 
  3378. 	vint_set_property(scroll_data.bar_grp, "visible", true) 
  3379. end 
  3380.  
  3381. 	 
  3382. function pause_menu_control_help_set_thumb_pos_scroll_bar(menu_data, value) 
  3383. 	 
  3384. 	if menu_data.has_scroll_bar ~= true then 
  3385. 		return 
  3386. 	end 
  3387. 	 
  3388. 	local scroll_data = menu_data.scroll_bar 
  3389. 	 
  3390. 	if scroll_data.thumb_pos ~= value then 
  3391. 		scroll_data.thumb_pos = value 
  3392. 		pause_menu_control_help_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  3393. 	end 
  3394. end 
  3395.  
  3396. function pause_menu_control_help_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  3397. 	if menu_data.has_scroll_bar ~= true then 
  3398. 		return 
  3399. 	end 
  3400. 	 
  3401. 	-- update the thumb pos 
  3402. 	local thumb_offset = scroll_data.thumb_pos * scroll_data.bar_height + 10 
  3403. 	 
  3404. 	 
  3405. 	if thumb_offset > scroll_data.bar_height then 
  3406. 		thumb_offset = scroll_data.bar_height - 50 
  3407. 	end 
  3408. 	 
  3409. 	 
  3410. 	vint_set_property(scroll_data.thumb_n_h,		"anchor", 3, thumb_offset) 
  3411. 	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 
  3412. 	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 
  3413. end 
  3414.  
  3415. --------------------------------------[ PLAYLIST EDITOR ]-------------------------------------- 
  3416.  
  3417. ------------ 
  3418. -- Control Functions 
  3419. ------------ 
  3420. function pause_menu_control_playlist_editor_show(menu_label, menu_data) 
  3421. 	local control = menu_label.control 
  3422.  
  3423. 	if control ~= nil then 
  3424. 		if control.type ~= PAUSE_MENU_CONTROL_PLAYLIST_EDITOR then 
  3425. 			-- this isn't my control so release it 
  3426. 			menu_release_control(control) 
  3427. 			control = nil 
  3428. 		end 
  3429. 	end 
  3430.  
  3431. 	vint_set_property(menu_label.label_h, "text_tag", "")	 
  3432. 	 
  3433. 	if control == nil then 
  3434. 		local control_h = vint_object_clone(vint_object_find("plist_frame"), Menu_option_labels.control_parent) 
  3435. 		control = { grp_h = control_h, type = PAUSE_MENU_CONTROL_PLAYLIST_EDITOR, is_highlighted = false } 
  3436. 			 
  3437. 		menu_label.control = control		 
  3438.  
  3439. 		menu_label.edit = { } 
  3440. 		menu_label.playlist = { } 
  3441. 		 
  3442. 		menu_label.edit.header_h = vint_object_find("plist_edit_header", control.grp_h) 
  3443. 		menu_label.playlist.header_h = vint_object_find("plist_playlist_header", control.grp_h) 
  3444. 		menu_label.edit.label_h = vint_object_find("plist_edit_label00", control.grp_h) 
  3445. 		menu_label.playlist.label_h = vint_object_find("plist_playlist_label00", control.grp_h) 
  3446. 		menu_label.arrow_h = vint_object_find("plist_arrow", control.grp_h) 
  3447. 		 
  3448. 		menu_label.edit_clip_h = vint_object_find("edit_clip", control.grp_h) 
  3449. 		menu_label.playlist_clip_h = vint_object_find("playlist_clip", control.grp_h) 
  3450. 	end 
  3451. 	 
  3452. 	--	Create the labels 
  3453. 	menu_label.edit.option_labels 		= { [0] = { label_h = menu_label.edit.label_h } } 
  3454. 	menu_label.playlist.option_labels 	= { [0] = { label_h = menu_label.playlist.label_h } } 
  3455. 	local edit_x, edit_y 		= vint_get_property(menu_label.edit.label_h, "anchor") 
  3456. 	local plist_x, plist_y 		= vint_get_property(menu_label.playlist.label_h, "anchor") 
  3457. 	 
  3458. 	for i = 1, PLAYLIST_MAX_ITEMS - 1 do 
  3459. 		menu_label.edit.option_labels[i] = { label_h	= vint_object_clone(menu_label.edit.label_h) } 
  3460. 		vint_set_property(menu_label.edit.option_labels[i].label_h, "anchor", edit_x, edit_y + (i * 33)) 
  3461. 		 
  3462. 		menu_label.playlist.option_labels[i] = { label_h = vint_object_clone(menu_label.playlist.label_h) } 
  3463. 		vint_set_property(menu_label.playlist.option_labels[i].label_h, "anchor", plist_x, plist_y + (i * 33)) 
  3464. 	end 
  3465.  
  3466. 	-- For the select bar 
  3467. 	menu_label.edit.offset_x 		= vint_get_property(menu_label.edit.header_h, "anchor") 
  3468. 	menu_label.playlist.offset_x 	= vint_get_property(menu_label.playlist.label_h, "anchor") 
  3469. 		 
  3470. 	-- Set that arrow 
  3471. 	vint_set_property(menu_label.arrow_h, "tint", MENU_FOOTER_CASH_NORMAL_COLOR.R, MENU_FOOTER_CASH_NORMAL_COLOR.G, MENU_FOOTER_CASH_NORMAL_COLOR.B) 
  3472. 			 
  3473. 	--	Show the new control 
  3474. 	vint_set_property(control.grp_h, "visible", true) 
  3475. 	vint_set_property(control.grp_h, "anchor", menu_label.anchor_x, menu_label.anchor_y) 
  3476. 	vint_set_property(control.grp_h, "depth", menu_label.depth) 
  3477. 	 
  3478. 	pause_menu_playlist_update_labels(menu_label, menu_data) 
  3479. 	 
  3480. 	menu_label.input = { 
  3481. 		vint_subscribe_to_input_event(nil, "playlist_up",		"pause_menu_plist_up_down", 10), 
  3482. 		vint_subscribe_to_input_event(nil, "playlist_down",		"pause_menu_plist_up_down", 10),  
  3483. 		--vint_subscribe_to_input_event(nil, "dpad_left",		"pause_menu_plist_sort", 10), 
  3484. 		--vint_subscribe_to_input_event(nil, "dpad_right",	"pause_menu_plist_sort", 10), 
  3485. 		--vint_subscribe_to_input_event(nil, "joy_up",			"pause_menu_plist_nav", 10), 
  3486. 		--vint_subscribe_to_input_event(nil, "joy_down",		"pause_menu_plist_nav", 10), 
  3487. 		--vint_subscribe_to_input_event(nil, "joy_left",		"pause_menu_plist_nav", 10), 
  3488. 		--vint_subscribe_to_input_event(nil, "joy_right",		"pause_menu_plist_nav", 10), 
  3489. 		--vint_subscribe_to_input_event(nil, "nav_up",			"pause_menu_plist_nav", 10), 
  3490. 		--vint_subscribe_to_input_event(nil, "nav_left",		"pause_menu_plist_nav", 10), 
  3491. 		--vint_subscribe_to_input_event(nil, "nav_down",		"pause_menu_plist_nav", 10), 
  3492. 		--vint_subscribe_to_input_event(nil, "nav_right",		"pause_menu_plist_nav", 10), 
  3493. 		vint_subscribe_to_input_event(nil, "scroll_left",		"pause_menu_plist_nav", 10), 
  3494. 		vint_subscribe_to_input_event(nil, "scroll_right",		"pause_menu_plist_nav", 10), 
  3495. 	} 
  3496. end 
  3497.  
  3498. function pause_menu_plist_up_down(target, event, accelleration) 
  3499. 	if menu_input_is_blocked() == true then 
  3500. 		return 
  3501. 	end 
  3502. 	 
  3503. 	if Pause_menu_playlist_editor[0].active_pane == Pause_menu_playlist_editor[0].playlist then 
  3504. 		if event == "playlist_up" then 
  3505. 			pause_menu_playlist_rs_input(0); -- move track up 
  3506. 		elseif event == "playlist_down" then 
  3507. 			pause_menu_playlist_rs_input(1); -- move track down 
  3508. 		end 
  3509. 	elseif Pause_menu_playlist_editor[0].active_pane == Pause_menu_playlist_editor[0].edit then 
  3510. 		if Pause_menu_playlist_editor[0].active_pane.in_genre == false then 
  3511. 			pause_menu_plist_sort(); 
  3512. 		else 
  3513. 			local menu_label = Menu_option_labels[Menu_active.highlighted_item - Menu_active.first_vis_item]; 
  3514. 			local menu_data =  Menu_active[Menu_active.highlighted_item]; 
  3515. 			if event == "playlist_up" then 
  3516. 				pause_menu_control_playlist_nav_up(menu_label, menu_data); 
  3517. 			elseif event == "playlist_down" then 
  3518. 				pause_menu_control_playlist_nav_down(menu_label, menu_data); 
  3519. 			end		 
  3520. 		end 
  3521. 	end 
  3522. 	return; 
  3523. end 
  3524.  
  3525. function pause_menu_plist_nav(target, event, accelleration) 
  3526. 	-- if menu_input_is_blocked() == true then 
  3527. 		-- return 
  3528. 	-- end 
  3529. 	 
  3530. 	-- btn_tips_update() 
  3531. 	-- local item_type = 0 
  3532. 	-- if Menu_active.num_items > 0 then 
  3533. 		-- item_type = Menu_active[Menu_active.highlighted_item].type 
  3534. 		-- Menu_input_accelleration = accelleration 
  3535. 	-- end 
  3536.  
  3537. 	-- if event == "joy_up" then 
  3538. 		-- local menu_option = Menu_option_labels[Menu_active.highlighted_item - Menu_active.first_vis_item] 
  3539. 		-- Menu_control_callbacks[item_type].on_nav_up(menu_option, Menu_active[Menu_active.highlighted_item]) 
  3540. 		-- audio_play(Menu_sound_item_nav) 
  3541. 	-- elseif event == "joy_down" then 
  3542. 		-- local menu_option = Menu_option_labels[Menu_active.highlighted_item - Menu_active.first_vis_item] 
  3543. 		-- Menu_control_callbacks[item_type].on_nav_down(menu_option, Menu_active[Menu_active.highlighted_item]) 
  3544. 		-- audio_play(Menu_sound_item_nav) 
  3545. 	-- elseif event == "joy_left" then 
  3546. 		-- local menu_option = Menu_option_labels[Menu_active.highlighted_item - Menu_active.first_vis_item] 
  3547. 		-- Menu_control_callbacks[item_type].on_nav_right(menu_option, Menu_active[Menu_active.highlighted_item]) 
  3548. 		-- audio_play(Menu_sound_item_nav) 
  3549. 	-- elseif event == "joy_right" then 
  3550. 		-- local menu_option = Menu_option_labels[Menu_active.highlighted_item - Menu_active.first_vis_item] 
  3551. 		-- Menu_control_callbacks[item_type].on_nav_left(menu_option, Menu_active[Menu_active.highlighted_item]) 
  3552. 		-- audio_play(Menu_sound_item_nav) 
  3553. 	-- end 
  3554. end 
  3555.  
  3556. function pause_menu_control_playlist_on_release() 
  3557. 	local menu_label = Menu_option_labels_inactive[0] 
  3558.  
  3559. 	--	Unsubscribe to input 
  3560. 	if menu_label.input ~= nil then 
  3561. 		for idx, val in menu_label.input do 
  3562. 			vint_unsubscribe_to_input_event(val) 
  3563. 		end 
  3564. 	end 
  3565. 	menu_label.input = nil 
  3566. 	 
  3567. 	for i = 1, PLAYLIST_MAX_ITEMS - 1 do 
  3568. 		vint_object_destroy(menu_label.edit.option_labels[i].label_h) 
  3569. 		vint_object_destroy(menu_label.playlist.option_labels[i].label_h) 
  3570. 	end 
  3571. 	 
  3572. 	pause_menu_control_release(menu_label.control) 
  3573.  
  3574. 	if Pause_menu_playlist_editor[0].edit.has_scroll_bar == true then 
  3575. 		Pause_menu_playlist_editor[0].edit.has_scroll_bar = false 
  3576. 		vint_object_destroy(Pause_menu_playlist_editor[0].edit.scroll_bar.bar_grp) 
  3577. 		Pause_menu_playlist_editor[0].edit.scroll_bar = nil 
  3578. 	end 
  3579. 	 
  3580. 	if Pause_menu_playlist_editor[0].playlist.has_scroll_bar == true then 
  3581. 		Pause_menu_playlist_editor[0].playlist.has_scroll_bar = false 
  3582. 		vint_object_destroy(Pause_menu_playlist_editor[0].playlist.scroll_bar.bar_grp) 
  3583. 		Pause_menu_playlist_editor[0].playlist.scroll_bar = nil 
  3584. 	end 
  3585.  
  3586. 	playlist_play_track(0, 0, true)	--	Stop any song playing 
  3587. 	pause_menu_set_playlist_input_callback() 
  3588. end 
  3589.  
  3590. ------------ 
  3591. -- Scrollbar Functions 
  3592. ------------ 
  3593. function pause_menu_playlist_create_scroll_bar(menu_label, menu_data) 
  3594. 	if menu_data.has_scroll_bar == true then 
  3595. 		menu_data.has_scroll_bar = false 
  3596. 		vint_object_destroy(menu_data.scroll_bar.bar_grp) 
  3597. 		menu_data.scroll_bar = nil 
  3598. 	end 
  3599. 	 
  3600. 	if menu_data.num_items > PLAYLIST_MAX_ITEMS then 
  3601. 		local thumb_size = PLAYLIST_MAX_ITEMS / menu_data.num_items 
  3602. 		menu_data.has_scroll_bar = true; 
  3603.  
  3604. 		local bar_grp = vint_object_clone(vint_object_find("menu_scroll_bar", nil, MENU_BASE_DOC_HANDLE), Menu_option_labels.control_parent) 
  3605. 		 
  3606. 		 
  3607. 		local scroll_data = { 
  3608. 			visible =			false, 
  3609. 			bar_grp =			bar_grp, 
  3610. 			bg_n_h =				vint_object_find("menu_scroll_bg_n", bar_grp), 
  3611. 			bg_c_h =				vint_object_find("menu_scroll_bg_c", bar_grp), 
  3612. 			bg_s_h =				vint_object_find("menu_scroll_bg_s", bar_grp), 
  3613. 			thumb_n_h =			vint_object_find("menu_scroll_thumb_n", bar_grp), 
  3614. 			thumb_s_h =			vint_object_find("menu_scroll_thumb_s", bar_grp), 
  3615. 			thumb_blend_h =	vint_object_find("menu_scroll_thumb_blend", bar_grp), 
  3616. 			thumb_pos =			0, 
  3617. 			bar_height =		332, 
  3618. 			thumb_height =		332, 
  3619. 		} 
  3620.  
  3621. 		menu_data.scroll_bar = scroll_data 
  3622. 		 
  3623. 		pause_menu_playlist_show_scroll_bar(menu_data) 
  3624. 		pause_menu_playlist_set_bar_height(menu_data, PLAYLIST_MAX_ITEMS * 34) -- 33? 
  3625. 		pause_menu_playlist_set_thumb_size_scroll_bar(menu_data, thumb_size) 
  3626. 		pause_menu_playlist_set_pos_scroll_bar(menu_data, menu_label.offset_x + menu_label.select_bar_width - 25, Pause_menu_playlist_editor.header_height + 20) 
  3627. 		 
  3628. 		pause_menu_playlist_update_clip_region() 
  3629. 	end 
  3630. end 
  3631.  
  3632. function pause_menu_playlist_show_scroll_bar(menu_data) 
  3633. 	local scroll_data = menu_data.scroll_bar 
  3634. 	vint_set_property(scroll_data.bar_grp, "visible", true) 
  3635. end 
  3636.  
  3637. function pause_menu_playlist_set_pos_scroll_bar(menu_data, x, y) 
  3638. 	local current_clip = 0 
  3639. 	 
  3640. 	if menu_data == Menu_active[0].edit then 
  3641. 		current_clip = Menu_option_labels[0].edit_clip_h 
  3642. 	elseif menu_data == Menu_active[0].playlist then 
  3643. 		current_clip = Menu_option_labels[0].playlist_clip_h 
  3644. 	end 
  3645.  
  3646. 	local anchor_x, anchor_y = vint_get_property(current_clip, "anchor") 
  3647.  
  3648. 	vint_set_property(menu_data.scroll_bar.bar_grp, "anchor", x + anchor_x, y + anchor_y) 
  3649. end 
  3650.  
  3651. function pause_menu_playlist_set_bar_height(menu_data, new_height) 
  3652. 	local scroll_data = menu_data.scroll_bar 
  3653. 	scroll_data.bar_height = new_height - 54 --This magic number will allow you to change the base height of the scrollbar 
  3654.  
  3655. 	vint_set_property(scroll_data.bg_s_h, "anchor", 38, new_height - 10) 
  3656. 	vint_set_property(scroll_data.bg_c_h, "source_se", 10, new_height - 28) 
  3657.  
  3658. 	pause_menu_playlist_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  3659. end 
  3660.  
  3661. function pause_menu_playlist_set_thumb_size_scroll_bar(menu_data, height) 
  3662. 	local scroll_data = menu_data.scroll_bar 
  3663. 	scroll_data.thumb_height = floor(height * scroll_data.bar_height) 
  3664. 	 
  3665. 	if scroll_data.thumb_height < 60 then 
  3666. 		scroll_data.thumb_height = 60 
  3667. 	end 
  3668. 	 
  3669. 	vint_set_property(scroll_data.thumb_n_h, "source_se", 32, scroll_data.thumb_height - 20) 
  3670. 	pause_menu_playlist_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  3671. end 
  3672.  
  3673. function pause_menu_playlist_set_thumb_pos_scroll_bar(menu_data, value) 
  3674. 	if menu_data.has_scroll_bar ~= true then 
  3675. 		return 
  3676. 	end 
  3677. 	 
  3678. 	local scroll_data = menu_data.scroll_bar 
  3679. 	if scroll_data.thumb_pos ~= value then 
  3680. 		scroll_data.thumb_pos = value 
  3681. 		pause_menu_playlist_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  3682. 	end 
  3683. end 
  3684.  
  3685. function pause_menu_playlist_update_scroll_bar_scroll_bar(menu_data, scroll_data) 
  3686. 	if menu_data.has_scroll_bar ~= true then 
  3687. 		return 
  3688. 	end 
  3689. 	 
  3690. 	-- update the thumb pos 
  3691. 	local thumb_offset = scroll_data.thumb_pos * (scroll_data.bar_height - scroll_data.thumb_height) + 10  
  3692. 	thumb_offset = floor(thumb_offset) 
  3693. 	 
  3694. 	vint_set_property(scroll_data.thumb_n_h,		"anchor", 3, thumb_offset) 
  3695. 	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 
  3696. 	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 
  3697. end 
  3698.  
  3699.  
  3700.  
  3701. function pause_menu_playlist_resize_select_bar() 
  3702. 	 
  3703. 	local width = Menu_option_labels[0].active_pane.select_bar_width 
  3704. 	local bg_h 
  3705. 	local frame_h = Menu_option_labels.frame 
  3706. 	local sel_bar_width = width 
  3707. 	 
  3708. 	-- Resize the scroll bar 
  3709. 	if Pause_menu_playlist_editor[0].active_pane.has_scroll_bar == true then 
  3710. 		sel_bar_width = sel_bar_width - 40 
  3711. 	end 
  3712. 	 
  3713. 	--Floor the selection bar width 
  3714. 	sel_bar_width = floor(sel_bar_width) 
  3715. 	 
  3716. 	Menu_option_labels.item_width = sel_bar_width 
  3717. 	 
  3718. 	bg_h = vint_object_find("menu_sel_bar_w", frame_h) 
  3719. 	vint_set_property(bg_h, "source_se", sel_bar_width, 36) 
  3720. 	 
  3721. 	bg_h = vint_object_find("menu_sel_bar_w_hl", frame_h) 
  3722. 	vint_set_property(bg_h, "source_se", sel_bar_width, 36) 
  3723. 	 
  3724. 	bg_h = vint_object_find("menu_sel_bar_e", frame_h) 
  3725. 	local menu_bar_e_anchor_x, menu_bar_e_anchor_y = vint_get_property(bg_h, "anchor") 
  3726. 	menu_bar_e_anchor_x = sel_bar_width + 5 
  3727. 	vint_set_property(bg_h, "anchor", menu_bar_e_anchor_x, menu_bar_e_anchor_y) 
  3728. 	 
  3729. 	local bg_h = vint_object_find("menu_sel_bar_e_hl", frame_h) 
  3730. 	vint_set_property(bg_h, "anchor", menu_bar_e_anchor_x - 1, menu_bar_e_anchor_y) 
  3731. 	 
  3732. 	vint_set_property(Menu_option_labels.hl_clip, "offset", 12, -15) 
  3733. 	vint_set_property(Menu_option_labels.hl_clip, "clip_size", sel_bar_width - 17, MENU_ITEM_HEIGHT) 
  3734.  
  3735. end 
  3736.  
  3737. function pause_menu_playlist_refresh() 
  3738. 	pause_menu_playlist_update_labels(Menu_option_labels[0], Pause_menu_playlist_editor[0]) 
  3739.  
  3740. 	-- Create the scroll bars (if necessary) 
  3741. 	pause_menu_playlist_create_scroll_bar(Menu_option_labels[0].edit, Pause_menu_playlist_editor[0].edit) 
  3742. 	pause_menu_playlist_create_scroll_bar(Menu_option_labels[0].playlist, Pause_menu_playlist_editor[0].playlist) 
  3743.  
  3744. 	--	Update other things 
  3745. 	 
  3746. 	pause_menu_control_playlist_update_scroll_bar(Menu_option_labels[0], Pause_menu_playlist_editor[0], Pause_menu_playlist_editor[0].edit) 
  3747. 	pause_menu_control_playlist_update_scroll_bar(Menu_option_labels[0], Pause_menu_playlist_editor[0], Pause_menu_playlist_editor[0].playlist) 
  3748. 	pause_menu_control_playlist_update_selectbar(Menu_option_labels[0], Pause_menu_playlist_editor[0]) 
  3749. 	pause_menu_control_playlist_update_arrow(Menu_option_labels[0], Pause_menu_playlist_editor[0]) 
  3750. 	 
  3751. 	-- If necessary again... 
  3752. 	pause_menu_playlist_resize_select_bar() 
  3753. 	pause_menu_playlist_update_clip_region() 
  3754. end 
  3755.  
  3756. ------------ 
  3757. -- Update Functions 
  3758. ------------ 
  3759. function pause_menu_playlist_update_labels(menu_label, menu_data) 
  3760. 	local index 
  3761. 	for i = 0, PLAYLIST_MAX_ITEMS - 1 do 
  3762. 		index = menu_data.edit.first_vis_item + i 
  3763. 		if index < menu_data.edit.num_items then 
  3764. 			vint_set_property(menu_label.edit.option_labels[i].label_h, "visible", true) 
  3765. 			vint_set_property(menu_label.edit.option_labels[i].label_h, "text_tag", menu_data.edit[index].label) 
  3766. 		else 
  3767. 			vint_set_property(menu_label.edit.option_labels[i].label_h, "visible", false) 
  3768. 		end 
  3769. 		 
  3770. 		index = menu_data.playlist.first_vis_item + i 
  3771. 		if i < menu_data.playlist.num_items then 
  3772. 			vint_set_property(menu_label.playlist.option_labels[i].label_h, "visible", true) 
  3773. 			vint_set_property(menu_label.playlist.option_labels[i].label_h, "text_tag", menu_data.playlist[index].label) 
  3774. 		else 
  3775. 			vint_set_property(menu_label.playlist.option_labels[i].label_h, "visible", false) 
  3776. 		end 
  3777. 	end 
  3778. end 
  3779.  
  3780. function pause_menu_playlist_stop() 
  3781. 	Pause_menu_playlist_editor[0].arrow_index = -1 
  3782. 	pause_menu_control_playlist_update_arrow(Menu_option_labels[0], Pause_menu_playlist_editor[0]) 
  3783. end 
  3784.  
  3785. function pause_menu_control_playlist_update_arrow(menu_label, menu_data) 
  3786. 	if menu_label.active_pane == menu_label.edit then 
  3787. 		return 
  3788. 	end 
  3789.  
  3790. 	if menu_data.active_pane.highlighted_item == menu_data.arrow_index then 
  3791. 		Pause_menu_playlist_right_tips.x_button.label = "MP3_PLAY_STATE_STOP" 
  3792. 	else 
  3793. 		Pause_menu_playlist_right_tips.x_button.label = "MP3_PLAY_STATE_PLAY" 
  3794. 	end 
  3795. 	btn_tips_update() 
  3796.  
  3797. 	local opt_idx = menu_data.arrow_index - menu_data.active_pane.first_vis_item 
  3798. 	if opt_idx >= PLAYLIST_MAX_ITEMS or opt_idx < 0  then 
  3799. 		vint_set_property(menu_label.arrow_h, "visible", false) 
  3800. 		return 
  3801. 	end 
  3802. 	 
  3803. 	local clip_x, clip_y = vint_get_property(Menu_option_labels[0].playlist_clip_h, "anchor") 
  3804. 	local x, y = vint_get_property(menu_label.active_pane.option_labels[opt_idx].label_h, "anchor") 
  3805. 	vint_set_property(menu_label.arrow_h, "anchor", clip_x + x, clip_y + y) 
  3806. 	vint_set_property(menu_label.arrow_h, "visible", true) 
  3807. end 
  3808.  
  3809. function pause_menu_control_playlist_update_scroll_bar(menu_label, menu_data, active_pane) 
  3810. 	local first_vis_item 		= 0 
  3811. 	local prev_first_vis_item 	= active_pane.first_vis_item 
  3812. 	local new_idx 					= active_pane.highlighted_item 
  3813. 	 
  3814. 	-- Gotta keep it in the middle 
  3815. 	if active_pane.num_items > PLAYLIST_MAX_ITEMS then 
  3816. 		local half_max = floor(PLAYLIST_MAX_ITEMS / 2) 
  3817. 		first_vis_item = limit(new_idx - half_max, 0, active_pane.num_items - PLAYLIST_MAX_ITEMS) 
  3818. 	end 
  3819. 	 
  3820. 	active_pane.first_vis_item = first_vis_item 
  3821. 	pause_menu_playlist_update_labels(menu_label, menu_data) 
  3822. 	pause_menu_control_playlist_update_arrow(menu_label, menu_data) 
  3823. 	pause_menu_playlist_set_thumb_pos_scroll_bar(active_pane, first_vis_item / (active_pane.num_items - PLAYLIST_MAX_ITEMS)) 
  3824.  
  3825. 	return first_vis_item 
  3826. end	 
  3827. 	 
  3828.  
  3829. function pause_menu_control_playlist_update_selectbar(menu_label, menu_data) 
  3830. 	local option_labels 	= menu_label.active_pane.option_labels 
  3831. 	local active_menu 	= menu_data.active_pane 
  3832. 		 
  3833. 	if active_menu.highlighted_item >= active_menu.num_items then 
  3834. 		active_menu.highlighted_item = active_menu.num_items - 1 
  3835. 	end 
  3836.  
  3837. 	local current_clip = 0 
  3838. 	 
  3839. 	if active_menu == Menu_active[0].edit then 
  3840. 		current_clip = Menu_option_labels[0].edit_clip_h 
  3841. 	elseif active_menu == Menu_active[0].playlist then 
  3842. 		current_clip = Menu_option_labels[0].playlist_clip_h 
  3843. 	end 
  3844. 		 
  3845. 	local new_idx 			= active_menu.highlighted_item 
  3846. 	 
  3847. 	local first_vis_item = pause_menu_control_playlist_update_scroll_bar(menu_label, menu_data, active_menu) 
  3848. 	local opt_idx 			= menu_data.active_pane.highlighted_item - first_vis_item 
  3849. 	 
  3850. 	local x, y = vint_get_property(current_clip, "anchor") 
  3851. 	 
  3852. 	local anchor_x, anchor_y = vint_get_property(option_labels[opt_idx].label_h, "anchor") 
  3853. 	local hl_bar_label_h = vint_object_find("menu_sel_bar_label", Menu_option_labels.hl_bar) 
  3854. 	 
  3855. 	anchor_x = anchor_x + x 
  3856. 	anchor_y = anchor_y + y + 99 
  3857. 	 
  3858. 	vint_set_property(Menu_option_labels.hl_bar, "anchor", anchor_x + 6, anchor_y + 1) 
  3859. 	vint_set_property(hl_bar_label_h, "text_tag", active_menu[new_idx].label) 
  3860. end 
  3861.  
  3862. ------------ 
  3863. -- Input Functions 
  3864. ------------ 
  3865. function pause_menu_control_playlist_activate_pane(menu_label, menu_data) 
  3866. 	local first_vis_item = menu_data.active_pane.first_vis_item 
  3867. 	 
  3868. 	if menu_label.active_pane == menu_label.edit then 
  3869. 		if menu_data.playlist.num_items == 0 then 
  3870. 			return 
  3871. 		end 
  3872. 		 
  3873. 		menu_label.active_pane = menu_label.playlist 
  3874. 		menu_data.active_pane = menu_data.playlist 
  3875. 	else 
  3876. 		menu_label.active_pane = menu_label.edit 
  3877. 		menu_data.active_pane = menu_data.edit 
  3878. 	end 
  3879. 	 
  3880. 	-- Swap btn tips 
  3881. 	Pause_menu_playlist_editor.btn_tips = menu_data.active_pane.btn_tips 
  3882. 	btn_tips_update() 
  3883. 	 
  3884. 	-- Update the select bar 
  3885. 	pause_menu_control_playlist_update_selectbar(menu_label, menu_data) 
  3886. 	pause_menu_playlist_resize_select_bar()	 
  3887. 	pause_menu_playlist_update_clip_region() 
  3888. 	 
  3889. 	-- Update the footer 
  3890. 	local hl_item = menu_data.active_pane.highlighted_item 
  3891. 	pause_menu_playlist_update_footer(menu_data.active_pane[hl_item].artist_name, menu_data.active_pane[hl_item].track_name) 
  3892. end 
  3893.  
  3894. function pause_menu_control_playlist_nav_up(menu_label, menu_data) 
  3895. 	local hl_item = menu_data.active_pane.highlighted_item 
  3896. 	hl_item = hl_item - 1 
  3897. 	if hl_item < 0 then 
  3898. 		hl_item = menu_data.active_pane.num_items - 1 
  3899. 	end 
  3900. 	 
  3901. 	menu_data.active_pane.highlighted_item = hl_item 
  3902. 	pause_menu_control_playlist_update_selectbar(menu_label, menu_data) 
  3903. 	 
  3904. 	pause_menu_playlist_update_footer(menu_data.active_pane[hl_item].artist_name, menu_data.active_pane[hl_item].track_name) 
  3905. end 
  3906.  
  3907. function pause_menu_control_playlist_nav_down(menu_label, menu_data) 
  3908. 	local hl_item = menu_data.active_pane.highlighted_item 
  3909. 	hl_item = hl_item + 1 
  3910. 	if hl_item >= menu_data.active_pane.num_items then 
  3911. 		hl_item = 0 
  3912. 	end 
  3913. 	 
  3914. 	menu_data.active_pane.highlighted_item = hl_item 
  3915. 	pause_menu_control_playlist_update_selectbar(menu_label, menu_data) 
  3916. 	 
  3917. 	pause_menu_playlist_update_footer(menu_data.active_pane[hl_item].artist_name, menu_data.active_pane[hl_item].track_name) 
  3918. end 
  3919.  
  3920. function pause_menu_playlist_rs_input(direction) 
  3921. 	--	Only do this is we're the playlist pane 
  3922. 	if Pause_menu_playlist_editor[0].active_pane ~= Pause_menu_playlist_editor[0].playlist then 
  3923. 		return 
  3924. 	end 
  3925. 	 
  3926. 	local menu_data = Pause_menu_playlist_editor[0].playlist 
  3927. 	 
  3928. 	local hl_item = menu_data.highlighted_item 
  3929. 	local other_item 
  3930. 	local swap = menu_data[hl_item] 
  3931. 	if direction == 0 then 
  3932. 		other_item = hl_item - 1 
  3933. 		if other_item < 0 then 
  3934. 			return 
  3935. 		end		 
  3936. 	elseif direction == 1 then 
  3937. 		other_item = hl_item + 1 
  3938. 		if other_item == menu_data.num_items then 
  3939. 			return 
  3940. 		end 
  3941. 	end 
  3942. 	 
  3943. 	if Pause_menu_playlist_editor[0].arrow_index == hl_item then 
  3944. 		Pause_menu_playlist_editor[0].arrow_index = other_item 
  3945. 	elseif Pause_menu_playlist_editor[0].arrow_index == other_item then 
  3946. 		Pause_menu_playlist_editor[0].arrow_index = hl_item 
  3947. 	end 
  3948. 	 
  3949. 	menu_data[hl_item] = menu_data[other_item] 
  3950. 	menu_data[other_item] = swap 
  3951. 	 
  3952. 	menu_data.highlighted_item = other_item 
  3953. 	audio_play(Menu_sound_item_nav) 
  3954. 	pause_menu_playlist_update_labels(Menu_option_labels[0], Pause_menu_playlist_editor[0]) 
  3955. 	pause_menu_control_playlist_update_arrow(Menu_option_labels[0], Pause_menu_playlist_editor[0]) 
  3956. 	pause_menu_control_playlist_update_selectbar(Menu_option_labels[0], Pause_menu_playlist_editor[0]) 
  3957. 	pause_menu_playlist_update_clip_region() 
  3958. 	 
  3959. end 
  3960.  
  3961. function pause_menu_plist_sort() 
  3962. 	if Pause_menu_playlist_editor.block_sort == true then 
  3963. 		return 
  3964. 	end 
  3965. 	 
  3966. 	if Pause_menu_playlist_editor[0].edit ~= Pause_menu_playlist_editor[0].active_pane then 
  3967. 		return 
  3968. 	end 
  3969. 	 
  3970. 	local pane_data = Pause_menu_playlist_editor[0].edit 
  3971. 	if pane_data.sort_by_artist == true then 
  3972. 		pane_data.sort_by_artist = false 
  3973. 		Pause_menu_playlist_left_tips.right_stick.label_text = "MP3_PLAYLIST_OPTIONS_SORT_ARTIST" 
  3974. 	else 
  3975. 		pane_data.sort_by_artist = true 
  3976. 		Pause_menu_playlist_left_tips.right_stick.label_text = "MP3_PLAYLIST_OPTIONS_SORT_TITLE" 
  3977. 	end 
  3978. 	 
  3979. 	btn_tips_update() 
  3980. 	 
  3981. 	if pane_data.in_genre == true then 
  3982. 		return 
  3983. 	end 
  3984. 	 
  3985. 	audio_play(Menu_sound_item_nav) 
  3986. 	pane_data.num_items = 0 
  3987. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_playlist_populate_genre_tracks", 0, 18, pane_data.genre_number, pane_data.sort_by_artist)		-- 18: Genre  
  3988.  
  3989. 	-- Check for no items 
  3990. 	if pane_data.num_items == 0 then 
  3991. 		pane_data.num_items = 1 
  3992. 		pane_data.no_items = true 
  3993. 		pane_data[0] = { label = "PLIST_NO_TRACKS" } 
  3994. 	else 
  3995. 		pane_data.no_items = false 
  3996. 	end 
  3997.  
  3998. 	pause_menu_playlist_refresh()	 
  3999. 	local hl_item = pane_data.highlighted_item 
  4000. 	pause_menu_playlist_update_footer(Pause_menu_playlist_editor[0].active_pane[hl_item].artist_name, Pause_menu_playlist_editor[0].active_pane[hl_item].track_name) 
  4001. end 
  4002.  
  4003. function pause_menu_playlist_on_select(menu_label, menu_data) 
  4004. 	menu_data.active_pane.on_select(menu_label, menu_data) 
  4005. end 
  4006.  
  4007. function pause_menu_playlist_on_back(menu_data) 
  4008. 	menu_data[0].active_pane.on_back() 
  4009. 	btn_tips_update() 
  4010. end 
  4011.  
  4012. function pause_menu_playlist_plist_select(menu_label, menu_data) 
  4013. 	local pane_data = Pause_menu_playlist_editor[0].playlist 
  4014. 	local hl_item = pane_data.highlighted_item 
  4015. 	 
  4016. 	for i = hl_item, pane_data.num_items - 2 do 
  4017. 		pane_data[i] = pane_data[i + 1] 
  4018. 	end 
  4019. 	 
  4020. 	if menu_data.arrow_index > hl_item then 
  4021. 		menu_data.arrow_index = menu_data.arrow_index  - 1 
  4022. 		pause_menu_control_playlist_update_arrow(menu_label, menu_data) 
  4023. 	end 
  4024.  
  4025. 	if menu_data.arrow_index == hl_item then 
  4026. 		menu_data.arrow_index = -1 
  4027. 		pause_menu_control_playlist_update_arrow(menu_label, menu_data) 
  4028. 	end 
  4029. 	 
  4030. 	pane_data.num_items = pane_data.num_items - 1 
  4031. 	if pane_data.num_items <= 0 then 
  4032. 		pause_menu_control_playlist_activate_pane(menu_label, menu_data) 
  4033. 	end 
  4034. 	 
  4035. 	-- Remove it from the genre list 
  4036. 	pane_data = Pause_menu_playlist_editor[0].edit 
  4037. 	if pane_data.in_genre == true then 
  4038. 		pause_menu_playlist_refresh()	 
  4039. 		local hl_item = Pause_menu_playlist_editor[0].playlist.highlighted_item 
  4040. 		pause_menu_playlist_update_footer(Pause_menu_playlist_editor[0].playlist[hl_item].artist_name, Pause_menu_playlist_editor[0].playlist[hl_item].track_name) 
  4041. 		return 
  4042. 	end 
  4043. 	 
  4044. 	pane_data.num_items = 0 
  4045. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_playlist_populate_genre_tracks", 0, 18, pane_data.genre_number, pane_data.sort_by_artist)		-- 18: Genre  
  4046.  
  4047. 	-- Check for no items 
  4048. 	if pane_data.num_items == 0 then 
  4049. 		pane_data.num_items = 1 
  4050. 		pane_data.no_items = true 
  4051. 		pane_data[0] = { label = "PLIST_NO_TRACKS" } 
  4052. 		pause_menu_playlist_update_footer(" ", " ") 
  4053. 	else 
  4054. 		pane_data.no_items = false 
  4055. 	end 
  4056.  
  4057. 	pause_menu_playlist_refresh()	 
  4058. 	 
  4059. 	local hl_item = Pause_menu_playlist_editor[0].playlist.highlighted_item 
  4060. 	pause_menu_playlist_update_footer(Pause_menu_playlist_editor[0].playlist[hl_item].artist_name, Pause_menu_playlist_editor[0].playlist[hl_item].track_name) 
  4061. end 
  4062.  
  4063. function btn_tip_always_hidden() 
  4064. 	return false 
  4065. end 
  4066.  
  4067. function pause_menu_playlist_in_genre() 
  4068. 	local pane_data = Pause_menu_playlist_editor[0].edit 
  4069. 	 
  4070. 	if pane_data.in_genre == true then 
  4071. 		return false 
  4072. 	else 
  4073. 		return true 
  4074. 	end 
  4075. end 
  4076.  
  4077. function pause_menu_playlist_edit_select(menu_label, menu_data) 
  4078. 	local pane_data = Pause_menu_playlist_editor[0].edit 
  4079. 	local hl_item = pane_data.highlighted_item 
  4080. 	 
  4081. 	if pane_data.no_items == true then 
  4082. 		return 
  4083. 	end 
  4084. 	 
  4085. 	if pane_data.in_genre == true then 
  4086. 		pane_data.num_items = 0 
  4087. 		pane_data.in_genre = false 
  4088. 		pane_data.genre_number = pane_data[hl_item].idx 
  4089. 		pane_data.old_hl_item = hl_item 
  4090. 		pane_data.old_first_index = pane_data.first_vis_index 
  4091. 		vint_dataresponder_request("pause_menu_populate", "pause_menu_playlist_populate_genre_tracks", 0, 18, pane_data[hl_item].idx, pane_data.sort_by_artist)		-- 18: Genre  
  4092. 		pane_data.highlighted_item = 0 
  4093. 		 
  4094. 		pause_menu_playlist_update_footer(pane_data[0].artist_name, pane_data[0].track_name) 
  4095. 	else 
  4096. 		local playlist 	= Pause_menu_playlist_editor[0].playlist 
  4097. 		local num_items 	= playlist.num_items 
  4098.  
  4099. 		-- Add it to the playlist 
  4100. 		playlist[num_items] = {  
  4101. 			label = pane_data[hl_item].label,  
  4102. 			track_name = pane_data[hl_item].track_name,  
  4103. 			artist_name = pane_data[hl_item].artist_name,  
  4104. 			genre = pane_data[hl_item].genre, 
  4105. 			idx = pane_data[hl_item].idx 
  4106. 		} 
  4107. 		playlist.num_items = num_items + 1 
  4108. 		 
  4109. 		-- Remove it from the genre list 
  4110. 		pane_data.num_items = 0 
  4111. 		pane_data.in_genre = false 
  4112. 		vint_dataresponder_request("pause_menu_populate", "pause_menu_playlist_populate_genre_tracks", 0, 18, pane_data.genre_number, pane_data.sort_by_artist)		-- 18: Genre  
  4113. 	end 
  4114.  
  4115. 	-- Check for no items 
  4116. 	if pane_data.num_items == 0 then 
  4117. 		pane_data.num_items = 1 
  4118. 		pane_data.highlighted_item = 0 
  4119. 		pane_data.no_items = true 
  4120. 		pane_data[0] = { label = "PLIST_NO_TRACKS", artist_name = "", track_name = "" } 
  4121. 		pause_menu_playlist_update_footer("", "") 
  4122. 	else 
  4123. 		local hl_item = pane_data.highlighted_item 
  4124. 		if hl_item >= pane_data.num_items then 
  4125. 			hl_item = pane_data.num_items - 1 
  4126. 		end 
  4127. 		pause_menu_playlist_update_footer(pane_data[hl_item].artist_name, pane_data[hl_item].track_name) 
  4128. 		pane_data.no_items = false 
  4129. 	end 
  4130. 	 
  4131. 	btn_tips_update() 
  4132. 	pause_menu_playlist_refresh() 
  4133. end 
  4134.  
  4135. function pause_menu_playlist_horz_show(horz_selection) 
  4136. 	Pause_menu_option_horz_swap_menu = horz_selection 
  4137. 	Pause_menu_playlist_editor.block_sort = true 
  4138. 	local indices = { } 
  4139. 	local playlist = table_clone(Pause_menu_playlist_editor[0].playlist) 
  4140. 	local pos = 0 
  4141. 	for i = 0, playlist.num_items - 1 do 
  4142. 		indices[pos] = playlist[i].genre 
  4143. 		indices[pos + 1] =  playlist[i].idx 
  4144. 		pos = pos + 2 
  4145. 	end 
  4146. 	 
  4147. 	if playlist_is_dirty(indices) == true then 
  4148. 		local header = "PAUSE_MENU_PLAYLIST_SAVE_TITLE" 
  4149. 		local body = "PAUSE_MENU_PLAYLIST_SAVE_PROMPT" 	-- Would you like to save your changes? 
  4150. 		local options = { [0] = "CONTROL_YES", [1] = "CONTROL_NO", [2] = "CONTROL_CANCEL" } 
  4151. 		dialog_box_open(header, body, options, "pause_menu_playlist_cb", 0, DIALOG_PRIORITY_ACTION) 
  4152. 	else  
  4153. 		pause_menu_playlist_cb(1, DIALOG_ACTION_CLOSE) 
  4154. 	end 
  4155.  
  4156. end 
  4157.  
  4158. function pause_menu_playlist_plist_back() 
  4159. 	pause_menu_playlist_edit_back() 
  4160. end 
  4161.  
  4162. function pause_menu_playlist_cb(result, action) 
  4163. 	if action ~= DIALOG_ACTION_CLOSE then 
  4164. 		return 
  4165. 	end 
  4166. 	 
  4167. 	if result == 0 then 
  4168. 		local indices = { } 
  4169. 		local playlist = table_clone(Pause_menu_playlist_editor[0].playlist) 
  4170. 		local pos = 0 
  4171. 		for i = 0, playlist.num_items - 1 do 
  4172. 			indices[pos] = playlist[i].genre 
  4173. 			indices[pos + 1] =  playlist[i].idx 
  4174. 			pos = pos + 2 
  4175. 		end 
  4176. 		 
  4177. 		playlist_save_list(indices, Pause_menu_playlist_editor[0].arrow_index) 
  4178. 		Pause_menu_playlist_editor.block_sort = false 
  4179. 	end 
  4180. 	 
  4181. 	if result == 0 or result == 1 then 
  4182. 		local menu_label = Menu_option_labels[0] 
  4183. 		--	Unsubscribe to input 
  4184. 		if menu_label.input ~= nil then 
  4185. 			for idx, val in menu_label.input do 
  4186. 				vint_unsubscribe_to_input_event(val) 
  4187. 			end 
  4188. 		end 
  4189. 		menu_label.input = nil 
  4190.  
  4191. 		if Pause_menu_option_horz_swap_menu ~= -1 then 
  4192. 			menu_horz_do_nav(Pause_menu_option_horz_swap_menu) 
  4193. 			menu_show(Menu_horz_active[Pause_menu_option_horz_swap_menu].sub_menu, MENU_TRANSITION_SWAP) 
  4194. 			Pause_menu_option_horz_swap_menu = -1 
  4195. 		else  
  4196. 		 
  4197. 			if Pause_menu_exit_after == true then 
  4198. 				pause_menu_exit() 
  4199. 				return 
  4200. 			end 
  4201. 			 
  4202. 			menu_show(Pause_menu_playlist_editor.parent_menu, MENU_TRANSITION_SWEEP_RIGHT) 
  4203. 			audio_play(Menu_sound_back) 
  4204. 		end 
  4205. 	end 
  4206. 	 
  4207. 	Pause_menu_playlist_editor.block_sort = false 
  4208. 	Pause_menu_swap_to_map = false 
  4209. 	Pause_menu_exit_after = false 
  4210. 	 
  4211. end 
  4212.  
  4213. function pause_menu_playlist_confirm_exit() 
  4214. 	Pause_menu_swap_to_map = false 
  4215. 	Pause_menu_exit_after = true 
  4216. 	Pause_menu_playlist_editor.block_sort = true 
  4217. 	 
  4218. 	local indices = { } 
  4219. 	local playlist = table_clone(Pause_menu_playlist_editor[0].playlist) 
  4220. 	local pos = 0 
  4221. 	for i = 0, playlist.num_items - 1 do 
  4222. 		indices[pos] = playlist[i].genre 
  4223. 		indices[pos + 1] =  playlist[i].idx 
  4224. 		pos = pos + 2 
  4225. 	end 
  4226. 	 
  4227. 	if playlist_is_dirty(indices) == true then 
  4228. 		local header = "PAUSE_MENU_PLAYLIST_SAVE_TITLE" 
  4229. 		local body = "PAUSE_MENU_PLAYLIST_SAVE_PROMPT" 	-- Would you like to save your changes? 
  4230. 		local options = { [0] = "CONTROL_YES", [1] = "CONTROL_NO", [2] = "CONTROL_CANCEL" } 
  4231. 		dialog_box_open(header, body, options, "pause_menu_playlist_cb", 0, DIALOG_PRIORITY_ACTION) 
  4232. 	else  
  4233. 		pause_menu_playlist_cb(1, DIALOG_ACTION_CLOSE) 
  4234. 	end 
  4235.  
  4236. end 
  4237.  
  4238. function pause_menu_playlist_confirm_swap() 
  4239.  
  4240. 	if pause_menu_can_swap() == false then 
  4241. 		return 
  4242. 	end 
  4243. 	 
  4244. 	Pause_menu_swap_to_map = true 
  4245. 	Pause_menu_exit_after = true 
  4246. 	Pause_menu_playlist_editor.block_sort = true 
  4247. 	local indices = { } 
  4248. 	local playlist = table_clone(Pause_menu_playlist_editor[0].playlist) 
  4249. 	local pos = 0 
  4250. 	for i = 0, playlist.num_items - 1 do 
  4251. 		indices[pos] = playlist[i].genre 
  4252. 		indices[pos + 1] =  playlist[i].idx 
  4253. 		pos = pos + 2 
  4254. 	end 
  4255. 	 
  4256. 	if playlist_is_dirty(indices) == true then 
  4257. 		local header = "PAUSE_MENU_PLAYLIST_SAVE_TITLE" 
  4258. 		local body = "PAUSE_MENU_PLAYLIST_SAVE_PROMPT" 	-- Would you like to save your changes? 
  4259. 		local options = { [0] = "CONTROL_YES", [1] = "CONTROL_NO", [2] = "CONTROL_CANCEL" } 
  4260. 		dialog_box_open(header, body, options, "pause_menu_playlist_cb", 0, DIALOG_PRIORITY_ACTION) 
  4261. 	else  
  4262. 		pause_menu_playlist_cb(1, DIALOG_ACTION_CLOSE) 
  4263. 	end 
  4264.  
  4265. end 
  4266.  
  4267. function pause_menu_playlist_edit_back() 
  4268. 	local pane_data = Pause_menu_playlist_editor[0].edit 
  4269.  
  4270. 	if pane_data.in_genre == true then 
  4271. 		local indices = { } 
  4272. 		local playlist = table_clone(Pause_menu_playlist_editor[0].playlist) 
  4273. 		local pos = 0 
  4274. 		for i = 0, playlist.num_items - 1 do 
  4275. 			indices[pos] = playlist[i].genre 
  4276. 			indices[pos + 1] =  playlist[i].idx 
  4277. 			pos = pos + 2 
  4278. 		end 
  4279. 		 
  4280. 		if playlist_is_dirty(indices) == true then 
  4281. 			local header = "PAUSE_MENU_PLAYLIST_SAVE_TITLE" 
  4282. 			local body = "PAUSE_MENU_PLAYLIST_SAVE_PROMPT" 	-- Would you like to save your changes? 
  4283. 			local options = { [0] = "CONTROL_YES", [1] = "CONTROL_NO", [2] = "CONTROL_CANCEL" } 
  4284. 			Pause_menu_playlist_editor.block_sort = true 
  4285. 			dialog_box_open(header, body, options, "pause_menu_playlist_cb", 0, DIALOG_PRIORITY_ACTION) 
  4286. 		else  
  4287. 			pause_menu_playlist_cb(1, DIALOG_ACTION_CLOSE) 
  4288. 		end 
  4289. 	 
  4290. 		return 
  4291. 	end 
  4292. 	 
  4293. 	pane_data.num_items = 0 
  4294. 	pane_data.no_items = false 
  4295. 	pane_data.in_genre = true 
  4296. 	pane_data.highlighted_item = pane_data.old_hl_item 
  4297. 	pane_data.first_vis_index = pane_data.old_first_index 
  4298. 	 
  4299. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_playlist_populate_genre", 0, 18, -1)		-- 18: Genre  
  4300. 	pause_menu_playlist_refresh() 
  4301. 	 
  4302. 	local active_pane = Pause_menu_playlist_editor[0].active_pane 
  4303. 	local hl_item = active_pane.highlighted_item 
  4304. 	pause_menu_playlist_update_footer(active_pane[hl_item].artist_name, active_pane[hl_item].track_name) 
  4305. end 
  4306.  
  4307. function pause_menu_control_playlist_alt_select(menu_label, menu_data) 
  4308. 	if menu_data.active_pane.in_genre == true then 
  4309. 		return 
  4310. 	end 
  4311.  
  4312. 	if menu_data.active_pane.no_items == true then 
  4313. 		return 
  4314. 	end 
  4315. 	 
  4316. 	if menu_label.active_pane == menu_label.edit then 
  4317. 		local play_index = menu_data.active_pane.highlighted_item 
  4318. 		menu_data.arrow_index = -1 
  4319. 		pause_menu_control_playlist_update_arrow(menu_label, menu_data) 
  4320. 		vint_set_property(menu_label.arrow_h, "visible", false) 
  4321.  
  4322. 		if menu_data.active_pane.playing == play_index then 
  4323. 			if playlist_is_playing() == true then 
  4324. 				playlist_play_track(0, 0, true) 
  4325. 				return 
  4326. 			end 
  4327. 		end 
  4328. 		 
  4329. 		menu_data.active_pane.playing = play_index		 
  4330. 		playlist_play_track(menu_data.active_pane[play_index].genre, menu_data.active_pane[play_index].idx) 
  4331. 		return 
  4332. 	end 
  4333. 	 
  4334. 	local arrow_index = menu_data.active_pane.highlighted_item 
  4335. 	 
  4336. 	if arrow_index ~= menu_data.arrow_index then 
  4337. 		menu_data.arrow_index = arrow_index 
  4338. 		-- Play song 
  4339. 		local play_index = menu_data.active_pane.highlighted_item 
  4340. 		playlist_play_track(menu_data.active_pane[play_index].genre, menu_data.active_pane[play_index].idx) 
  4341. 	else 
  4342. 		menu_data.arrow_index = -1 
  4343. 		-- stop song 
  4344. 		playlist_play_track(0, 0, true) 
  4345. 	end 
  4346. 	 
  4347. 	pause_menu_control_playlist_update_arrow(menu_label, menu_data) 
  4348. end 
  4349.  
  4350. ------------ 
  4351. -- Content Functions 
  4352. ------------ 
  4353.  
  4354. function pause_menu_playlist_build_footer(menu_data) 
  4355. 	local grp = vint_object_clone(vint_object_find("plist_footer"), Menu_option_labels.control_parent) 
  4356. 	vint_set_property(grp, "visible", true) 
  4357.  
  4358. 	if menu_data.footer ~= nil and menu_data.footer.footer_grp ~= nil and menu_data.footer.footer_grp ~= 0 then 
  4359. 		vint_object_destroy(menu_data.footer.footer_grp) 
  4360. 	end 
  4361.  
  4362. 	menu_data.footer = { } 
  4363. 	menu_data.footer.footer_grp = grp 
  4364. 	 
  4365. 	menu_data.footer.title_h 	= vint_object_find("title_label", grp) 
  4366. 	menu_data.footer.artist_h 	= vint_object_find("artist_label", grp) 
  4367. 	 
  4368. 	menu_data.footer.title_text_h = vint_object_find("title_text", grp) 
  4369. 	menu_data.footer.artist_text_h = vint_object_find("artist_text", grp) 
  4370. 	 
  4371. 	local x,y = vint_get_property(menu_data.footer.title_h, "anchor") 
  4372. 	local width, height = element_get_actual_size(menu_data.footer.title_h) 
  4373. 	vint_set_property(menu_data.footer.title_text_h, "anchor", width + x + 5, y) 
  4374. 	 
  4375. 	x,y = vint_get_property(menu_data.footer.artist_h, "anchor") 
  4376. 	width, height = element_get_actual_size(menu_data.footer.artist_h) 
  4377. 	vint_set_property(menu_data.footer.artist_text_h, "anchor", width + x + 5, y) 
  4378. 	 
  4379. 	vint_set_property(menu_data.footer.title_text_h, "tint", MENU_FOOTER_CASH_NORMAL_COLOR.R, MENU_FOOTER_CASH_NORMAL_COLOR.G, MENU_FOOTER_CASH_NORMAL_COLOR.B) 
  4380. 	vint_set_property(menu_data.footer.artist_text_h, "tint", MENU_FOOTER_CASH_NORMAL_COLOR.R, MENU_FOOTER_CASH_NORMAL_COLOR.G, MENU_FOOTER_CASH_NORMAL_COLOR.B) 
  4381. end 
  4382.  
  4383. function pause_menu_playlist_update_footer(artist, track) 
  4384. 	local track_h = Pause_menu_playlist_editor.footer.title_text_h 
  4385. 	local artist_h = Pause_menu_playlist_editor.footer.artist_text_h 
  4386. 	 
  4387. 	vint_set_property(track_h, "text_tag", track) 
  4388. 	vint_set_property(artist_h, "text_tag", artist) 
  4389. end 
  4390.  
  4391. function pause_menu_playlist_show(menu_data) 
  4392.  
  4393. 	-- Initialize everything 
  4394. 	menu_data[0].edit 		= {  
  4395. 		num_items = 0,  
  4396. 		first_vis_item = 0,  
  4397. 		highlighted_item = 0,  
  4398. 		in_genre = true, 	 
  4399. 		on_back = pause_menu_playlist_edit_back, 
  4400. 		on_select = pause_menu_playlist_edit_select,	 
  4401. 		btn_tips = Pause_menu_playlist_left_tips, 	 
  4402. 	} 
  4403. 	 
  4404. 	menu_data[0].playlist 	= {  
  4405. 		num_items = 0,  
  4406. 		first_vis_item = 0,  
  4407. 		highlighted_item = 0,  
  4408. 		on_back = pause_menu_playlist_plist_back, 
  4409. 		on_select = pause_menu_playlist_plist_select, 		 
  4410. 		btn_tips = Pause_menu_playlist_right_tips,	 
  4411. 	} 
  4412.  
  4413. 	menu_data[0].arrow_index = -1 
  4414. 	menu_data[0].sort_by_artist = false 
  4415. 	-- Set the inpuit callback for the right stick 
  4416. 	pause_menu_set_playlist_input_callback("pause_menu_playlist_rs_input") 
  4417.  
  4418. 	--	Populate the menu 
  4419. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_playlist_populate_playlist", 0, 17) 	-- 17: Playlist 
  4420. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_playlist_populate_genre", 0, 18, -1)		-- 18: Genre -1: No specific genre (list genres) 
  4421. 	Pause_menu_playlist_editor.block_sort = false 
  4422. 	 
  4423. 	-- Check for no items 
  4424. 	local pane_data = menu_data[0].edit 
  4425. 	if pane_data.num_items == 0 then 
  4426. 		pane_data.num_items = 1 
  4427. 		pane_data.no_items = true 
  4428. 		pane_data[0] = { label = "No tracks available", artist_name = "", track_name = "" } 
  4429. 	else 
  4430. 		pane_data.no_items = false 
  4431. 	end 
  4432.  
  4433. 	--	Set the active pane and the current button tips 
  4434. 	menu_data[0].active_pane = menu_data[0].edit 
  4435. 	menu_data.btn_tips = menu_data[0].active_pane.btn_tips 
  4436.  
  4437. 	Pause_menu_playlist_right_tips.x_button.label = "MP3_PLAY_STATE_PLAY" 
  4438. 	btn_tips_update() 
  4439. 	 
  4440. 	-- And finally, build the footer 
  4441. 	pause_menu_playlist_build_footer(menu_data) 
  4442. 	pause_menu_playlist_update_footer(menu_data[0].active_pane[0].artist_name, menu_data[0].active_pane[0].artist_name) 
  4443. end 
  4444.  
  4445. function pause_menu_playlist_populate_genre(genre_name, index) 
  4446. 	local menu_data = Pause_menu_playlist_editor[0].edit 
  4447. 	local num_items = menu_data.num_items 
  4448. 	 
  4449. 	menu_data[num_items] = { label = genre_name, idx = index, artist_name = "", track_name = "" } 
  4450. 	 
  4451. 	menu_data.num_items = num_items + 1 
  4452. end 
  4453.  
  4454. function pause_menu_playlist_populate_genre_tracks(track_name, artist_name, genre, index) 
  4455. 	local menu_data = Pause_menu_playlist_editor[0].edit 
  4456. 	local playlist_menu = Pause_menu_playlist_editor[0].playlist 
  4457. 	local num_items = menu_data.num_items 
  4458. 	local is_on_playlist = false 
  4459. 	 
  4460. 	for i = 0, playlist_menu.num_items - 1 do 
  4461. 		if track_name == playlist_menu[i].track_name then 
  4462. 			is_on_playlist = true 
  4463. 			break 
  4464. 		end 
  4465. 	end 
  4466. 	 
  4467. 	if is_on_playlist == false then 
  4468. 		menu_data[num_items] = { label = track_name, track_name = track_name, artist_name = artist_name, genre = genre, idx = index } 
  4469. 		menu_data.num_items = num_items + 1 
  4470. 	end 
  4471. end 
  4472.  
  4473. function pause_menu_playlist_populate_playlist(track_name, artist_name, genre, index) 
  4474. 	local menu_data = Pause_menu_playlist_editor[0].playlist 
  4475. 	local num_items = menu_data.num_items 
  4476. 	 
  4477. 	menu_data[num_items] = { label = track_name, track_name = track_name, artist_name = artist_name, genre = genre, idx = index } 
  4478. 	 
  4479. 	menu_data.num_items = num_items + 1 
  4480. 	 
  4481. end 
  4482.  
  4483. function pause_menu_playlist_post_show(menu_data) 
  4484. 	Menu_option_labels[0].active_pane = Menu_option_labels[0].edit 
  4485. 	Menu_option_labels[0].edit.select_bar_width = PLAYLIST_LEFT_SELECTBAR_WIDTH 
  4486. 	Menu_option_labels[0].playlist.select_bar_width = PLAYLIST_RIGHT_SELECTBAR_WIDTH 
  4487.  
  4488. 	pause_menu_playlist_update_clip_region() 
  4489. 	 
  4490. 	-- Create the scroll bars 
  4491. 	pause_menu_playlist_create_scroll_bar(Menu_option_labels[0].edit, menu_data[0].edit) 
  4492. 	pause_menu_playlist_create_scroll_bar(Menu_option_labels[0].playlist, menu_data[0].playlist) 
  4493.  
  4494. 	pause_menu_control_playlist_update_arrow(Menu_option_labels[0], Pause_menu_playlist_editor[0]) 
  4495. 	pause_menu_control_playlist_update_selectbar(Menu_option_labels[0], Pause_menu_playlist_editor[0]) 
  4496. 	pause_menu_playlist_resize_select_bar() 
  4497. end 
  4498.  
  4499. function pause_menu_playlist_update_clip_region() 
  4500. 	local w, height = element_get_actual_size(Menu_option_labels[0].edit_clip_h) 
  4501. 	 
  4502. 	local edit_sel_bar_width = 0 
  4503. 	local playlist_sel_bar_width = 0 
  4504. 	 
  4505. 	if Pause_menu_playlist_editor[0].edit.has_scroll_bar == true then 
  4506. 		edit_sel_bar_width = 40 
  4507. 	end 
  4508. 	 
  4509. 	if Pause_menu_playlist_editor[0].playlist.has_scroll_bar == true then 
  4510. 		playlist_sel_bar_width = 40 
  4511. 	end 
  4512. 	 
  4513. 	vint_set_property(Menu_option_labels[0].edit_clip_h, "clip_size", PLAYLIST_LEFT_SELECTBAR_WIDTH - 7 - edit_sel_bar_width, 1000) 
  4514. 	vint_set_property(Menu_option_labels[0].playlist_clip_h, "clip_size", PLAYLIST_RIGHT_SELECTBAR_WIDTH - 7 - playlist_sel_bar_width, 1000) 
  4515. end 
  4516.  
  4517. function pause_menu_playlist_get_width() 
  4518. 	return PLAYLIST_WIDTH 
  4519. end 
  4520.  
  4521. function pause_menu_playlist_get_height() 
  4522. 	return PLAYLIST_HEIGHT 
  4523. end 
  4524.  
  4525. --------------------------------------[ SCOREBOARD ]-------------------------------------- 
  4526. SCOREBOARD_DOC_H = 0 
  4527. function pause_menu_control_scoreboard_on_show(menu_label, menu_data) 
  4528.  
  4529. 	 
  4530. 	if get_is_syslink() then 
  4531. 		Pause_score_board.btn_tips = Multi_scoreboard_tips_syslink 
  4532. 	else 
  4533. 		Pause_score_board.btn_tips = Multi_scoreboard_tips 
  4534. 	end 
  4535. 	 
  4536.  
  4537. 	vint_document_load("mp_scoreboard") 
  4538. 	SCOREBOARD_DOC_H = vint_document_find("mp_scoreboard") 
  4539. 	 
  4540. 	local control = menu_label.control 
  4541.  
  4542. 	if control ~= nil then 
  4543. 		if control.type ~= PAUSE_MENU_CONTROL_SCOREBOARD then 
  4544. 			-- this isn't my control so release it 
  4545. 			menu_release_control(control) 
  4546. 			control = nil 
  4547. 		end 
  4548. 	end 
  4549.  
  4550. 	vint_set_property(menu_label.label_h, "text_tag", "")	 
  4551. 	 
  4552. 	if control == nil then 
  4553. 		vint_object_set_parent(vint_object_find("mp_scoreboard", nil, SCOREBOARD_DOC_H), Menu_option_labels.control_parent) 
  4554. 		local control_h = vint_object_find("mp_scoreboard") 
  4555. 		vint_set_property(control_h, "anchor", 0, 0) 
  4556. 		control = { grp_h = control_h, type = PAUSE_MENU_CONTROL_SCOREBOARD, is_highlighted = false } 
  4557. 		menu_label.control = control		 
  4558. 	end 
  4559. 	 
  4560. 	--	Show the new control 
  4561. 	vint_set_property(control.grp_h, "visible", true) 
  4562. 	vint_set_property(control.grp_h, "anchor", menu_label.anchor_x, menu_label.anchor_y - 67) 
  4563. 	vint_set_property(control.grp_h, "depth", menu_label.depth) 
  4564.  
  4565. end 
  4566.  
  4567. function pause_menu_control_scoreboard_on_release(control) 
  4568. 	vint_object_destroy(control.grp_h) 
  4569. 	vint_document_unload(SCOREBOARD_DOC_H) 
  4570. 	SCOREBOARD_DOC_H = 0 
  4571. end 
  4572.  
  4573. function pause_menu_scoreboard_get_width(menu_data) 
  4574. 	return SCOREBOARD_WIDTH 
  4575. end 
  4576.  
  4577. function pause_menu_scoreboard_get_height(menu_data) 
  4578. 	return SCOREBOARD_HEIGHT 
  4579. end 
  4580.  
  4581. function pause_menu_scoreboard_show(menu_data) 
  4582. 	-- vint_dataresponder_request("Mp_scoreboard_populate, "mp_scoreboard_populate", 0) 
  4583.  
  4584. end 
  4585.  
  4586. --------------------------------------[ LOBBY_PLAYERS ]-------------------------------------- 
  4587. LOBBY_PLAYERS_DOC_H = 0 
  4588. function pause_menu_control_lobby_players_on_show(menu_label, menu_data) 
  4589. 	vint_document_load("mp_lobby_players") 
  4590. 	LOBBY_PLAYERS_DOC_H = vint_document_find("mp_lobby_players") 
  4591. 	 
  4592. 	local control = menu_label.control 
  4593.  
  4594. 	if control ~= nil then 
  4595. 		if control.type ~= PAUSE_MENU_CONTROL_LOBBY_PLAYERS then 
  4596. 			-- this isn't my control so release it 
  4597. 			menu_release_control(control) 
  4598. 			control = nil 
  4599. 		end 
  4600. 	end 
  4601.  
  4602. 	vint_set_property(menu_label.label_h, "text_tag", "")	 
  4603. 	 
  4604. 	if control == nil then 
  4605. 		vint_object_set_parent(vint_object_find("mp_lobby_players", nil, LOBBY_PLAYERS_DOC_H), Menu_option_labels.control_parent) 
  4606. 		local control_h = vint_object_find("mp_lobby_players") 
  4607. 		vint_set_property(control_h, "anchor", 0, 0) 
  4608. 		control = { grp_h = control_h, type = PAUSE_MENU_CONTROL_LOBBY_PLAYERS, is_highlighted = false } 
  4609. 		menu_label.control = control		 
  4610. 	end 
  4611. 	 
  4612. 	--	Show the new control 
  4613. 	vint_set_property(control.grp_h, "visible", true) 
  4614. 	vint_set_property(control.grp_h, "anchor", menu_label.anchor_x, menu_label.anchor_y - 67) 
  4615. 	vint_set_property(control.grp_h, "depth", menu_label.depth) 
  4616.  
  4617. end 
  4618.  
  4619. function pause_menu_control_lobby_players_on_release(control) 
  4620. 	vint_object_destroy(control.grp_h) 
  4621. 	vint_document_unload(LOBBY_PLAYERS_DOC_H) 
  4622. 	LOBBY_PLAYERS_DOC_H = 0 
  4623. end 
  4624.  
  4625. function pause_menu_lobby_players_get_width(menu_data) 
  4626. 	return LOBBY_PLAYERS_WIDTH 
  4627. end 
  4628.  
  4629. function pause_menu_lobby_players_get_height(menu_data) 
  4630. 	return LOBBY_PLAYERS_HEIGHT 
  4631. end 
  4632.  
  4633. --------------------------------------[ COMMON ]-------------------------------------- 
  4634. function pause_menu_update_custom_control() 
  4635. 	local h, ch, item, label_w, control 
  4636.  
  4637. 	-- set the labels and hide unused 
  4638. 	for i = 0, Menu_option_labels.max_rows - 1 do 
  4639. 		if Menu_active.first_vis_item < 0 then 
  4640. 			Menu_active.first_vis_item = 0 
  4641. 		end 
  4642. 		 
  4643. 		item = Menu_active.first_vis_item + i 
  4644. 		if item < Menu_active.num_items then 
  4645. 			local item_type = Menu_active[item].type 
  4646. 			 
  4647. 			-- update control 
  4648. 			local cb = Menu_control_callbacks[item_type] 
  4649. 			if cb ~= nil then 
  4650. 				if cb.on_show ~= nil then 
  4651. 					cb.on_show(Menu_option_labels[i], Menu_active[item]) 
  4652. 				end 
  4653. 			end 
  4654. 			 
  4655. 			vint_set_property(Menu_option_labels[i].stripe_h, "visible", true) 
  4656. 		else 
  4657. 			if Menu_option_labels[i].control ~= nil then 
  4658. 				h = Menu_option_labels[i].control.grp_h 
  4659. 				vint_set_property(Menu_option_labels[i].stripe_h, "visible", false) 
  4660. 				vint_set_property(h, "visible", false) 
  4661. 			end 
  4662. 		end 
  4663. 	end 
  4664.  
  4665. 	-- update scroll bar 
  4666. 	if Menu_option_labels.scroll_bar_visible == true then 
  4667. 		menu_scroll_bar_set_thumb_pos(Menu_active.first_vis_item / (Menu_active.num_items - Menu_option_labels.max_rows)) 
  4668. 	end 
  4669. end 
  4670.  
  4671. function pause_menu_control_nav_up(menu_label, menu_data) 
  4672. 	if Menu_active.first_vis_item > 0 then 
  4673. 		Menu_active.first_vis_item = Menu_active.first_vis_item - 1 
  4674. 	end 
  4675. 	pause_menu_update_custom_control() 
  4676. 	menu_scroll_bar_set_thumb_pos(Menu_active.first_vis_item / (Menu_active.num_items - Menu_option_labels.max_rows)) 
  4677. 	 
  4678. 	if Menu_active.on_nav ~= nil then 
  4679. 		Menu_active.on_nav(Menu_active) 
  4680. 	end 
  4681. end 
  4682.  
  4683. function pause_menu_control_nav_down(menu_label, menu_data) 
  4684. 	if Menu_active.first_vis_item < Menu_active.num_items then 
  4685. 		Menu_active.first_vis_item = Menu_active.first_vis_item + 1 
  4686. 	end 
  4687. 	if Menu_active.first_vis_item > Menu_active.num_items - Menu_option_labels.max_rows then 
  4688. 		Menu_active.first_vis_item = Menu_active.num_items - Menu_option_labels.max_rows  
  4689. 	end 
  4690. 	 
  4691. 	pause_menu_update_custom_control() 
  4692. 	menu_scroll_bar_set_thumb_pos(Menu_active.first_vis_item / (Menu_active.num_items - Menu_option_labels.max_rows)) 
  4693. 	 
  4694. 	if Menu_active.on_nav ~= nil then 
  4695. 		Menu_active.on_nav(Menu_active) 
  4696. 	end 
  4697. end 
  4698.  
  4699. function pause_menu_control_page_up(menu_label, menu_data) 
  4700. 	if Pause_menu_page.current == nil then 
  4701. 		return 
  4702. 	end 
  4703.  
  4704. 	if Pause_menu_page.current > 1 then 
  4705. 		Menu_active.first_vis_item = Menu_active.first_vis_item - Menu_option_labels.max_rows 
  4706. 		Pause_menu_page.current = Pause_menu_page.current - 1 
  4707. 	end 
  4708. 		 
  4709. 	if Menu_active.first_vis_item < 0 then 
  4710. 		Menu_active.first_vis_item = 0 
  4711. 	end 
  4712. 	 
  4713. 	pause_menu_update_page() 
  4714. 	pause_menu_update_custom_control() 
  4715. 	menu_scroll_bar_hide() 
  4716. 	 
  4717. 	if Menu_active.on_nav ~= nil then 
  4718. 		Menu_active.on_nav(Menu_active) 
  4719. 	end 
  4720. end 
  4721.  
  4722. function pause_menu_control_page_down(menu_label, menu_data) 
  4723. 	if Pause_menu_page.current == nil then 
  4724. 		return 
  4725. 	end 
  4726. 	 
  4727. 	if Pause_menu_page.current < Pause_menu_page.max then 
  4728. 		Menu_active.first_vis_item = Menu_active.first_vis_item + Menu_option_labels.max_rows 
  4729. 		Pause_menu_page.current = Pause_menu_page.current + 1 
  4730. 	end 
  4731. 	 
  4732. 	pause_menu_update_page() 
  4733. 	pause_menu_update_custom_control() 
  4734. 	menu_scroll_bar_hide() 
  4735. 	 
  4736. 	if Menu_active.on_nav ~= nil then 
  4737. 		Menu_active.on_nav(Menu_active) 
  4738. 	end 
  4739. end 
  4740.  
  4741. function pause_menu_control_release(control) 
  4742. 	if control == nil then 
  4743. 		return 
  4744. 	end 
  4745. 	 
  4746. 	if control.grp_h ~= nil then 
  4747. 		vint_object_destroy(control.grp_h) 
  4748. 		control.grp_h = nil 
  4749. 	end 
  4750. end 
  4751.  
  4752. ----------------[ SAVE LOAD CONTROL ]---------------- 
  4753.  
  4754. function pause_menu_control_save_load_show(menu_label, menu_data) 
  4755. 	local control = menu_label.control 
  4756.  
  4757. 	if control ~= nil then 
  4758. 		if control.type ~= PAUSE_MENU_CONTROL_SAVE_LOAD then 
  4759. 			-- this isn't my control type so release it 
  4760. 			menu_release_control(control) 
  4761. 			control = nil 
  4762. 		end 
  4763. 	end 
  4764. 	 
  4765. 	vint_set_property(menu_label.label_h, "text_tag", "") 
  4766.  
  4767. 	if control == nil then 
  4768. 		local master_h = vint_object_find("save_game_control") 
  4769. 		local control_h = vint_object_clone(master_h, Menu_option_labels.control_parent) 
  4770. 		control = { grp_h = control_h, type = PAUSE_MENU_CONTROL_SAVE_LOAD, is_highlighted = false } 
  4771. 		vint_set_property(control.grp_h, "visible", true) 
  4772. 		menu_label.control = control 
  4773.  
  4774. 		-- store handles of elements 
  4775. 		menu_label.last_mission_name_h = vint_object_find("last_mission_name", control_h) 
  4776. 		menu_label.percent_complete_h = vint_object_find("percent_complete", control_h) 
  4777. 		menu_label.cheats_enabled_h = vint_object_find("cheats_enabled", control_h) 
  4778. 		menu_label.game_time_h = vint_object_find("game_time", control_h) 
  4779. 	--	menu_label.missions_complete_h = vint_object_find("missions_complete", control_h) 
  4780. 		menu_label.size_point_h = vint_object_find("size_point", control_h) 
  4781. 	end 
  4782.  
  4783. 	-- update pos and depth 
  4784. 	vint_set_property(control.grp_h, "anchor", menu_label.anchor_x, menu_label.anchor_y) 
  4785. 	vint_set_property(control.grp_h, "depth", menu_label.depth) 
  4786. 	vint_set_property(menu_label.size_point_h, "anchor", Menu_option_labels.item_width - 150, 0) 
  4787. 	 
  4788. 	--	Update the values 
  4789. 	local label 
  4790. 	if menu_data.autosave == true then 
  4791. 		label = "SAVELOAD_AUTOSAVE_LABEL" 
  4792. 	else 
  4793. 		label = menu_data.last_mission_name 
  4794. 	end 
  4795. 	vint_set_property(menu_label.last_mission_name_h, "text_tag", label) 
  4796. 	 
  4797. 	vint_set_property(menu_label.percent_complete_h, "text_tag", menu_data.percent_complete.."%") 
  4798. 	vint_set_property(menu_label.game_time_h, "text_tag", menu_data.game_time) 
  4799. 	--vint_set_property(menu_label.missions_complete_h, "text_tag", menu_data.missions_complete) 
  4800. 	vint_set_property(menu_label.cheats_enabled_h, "visible", menu_data.cheats_enabled) 
  4801.  
  4802. end 
  4803.  
  4804. function pause_menu_control_save_load_enter(menu_label, menu_data) 
  4805. 	local clone = vint_object_clone(menu_label.control.grp_h, Menu_option_labels.hl_bar) 
  4806. 	menu_label.control.hl_control = clone 
  4807. 	vint_set_property(clone, "anchor", 5, 0) 
  4808. 	 
  4809. 	for i, n in { "last_mission_name", "percent_complete", "game_time" } do 
  4810. 		local t = vint_object_find(n, clone)		 
  4811. 		vint_set_property(t, "tint", 0, 0, 0) 
  4812. 		vint_set_property(t, "font", "thin") 
  4813. 	end 
  4814. end 
  4815.  
  4816. function pause_menu_control_save_load_release(control) 
  4817. 	if control.hl_control ~= nil then 
  4818. 		vint_object_destroy(control.hl_control) 
  4819. 		control.hl_control = nil 
  4820. 	end 
  4821. 	 
  4822. 	if control.grp_h ~= nil then 
  4823. 		vint_object_destroy(control.grp_h) 
  4824. 		control.grp_h = nil 
  4825. 	end 
  4826. end 
  4827.  
  4828. function pause_menu_control_save_load_leave(menu_label, menu_data) 
  4829. 	local control = menu_label.control 
  4830. 	if control.hl_control ~= nil then 
  4831. 		vint_object_destroy(control.hl_control) 
  4832. 		control.hl_control = nil 
  4833. 	end 
  4834. end 
  4835.  
  4836. function pause_menu_control_save_load_get_width(menu_item) 
  4837.  
  4838. 	local h = vint_object_find("save_game_header") 
  4839. 	local status_h = vint_object_find("game_status",h) 
  4840. 	local difficulty_h = vint_object_find("difficulty",h) 
  4841. 	local width = element_get_actual_size(status_h) + element_get_actual_size(difficulty_h) 
  4842. 	width = width + 200 
  4843.  
  4844. 	return width 
  4845. end 
  4846.  
  4847. Pause_save_new_master = 0 
  4848.  
  4849. function pause_menu_control_centered_label_get_master() 
  4850. 	if Pause_save_new_master == 0 then 
  4851. 		Pause_save_new_master = vint_object_create("save_new_game_label", "text", vint_object_find("safe_frame")) 
  4852. 		-- the doc is checked out by other persons so I'll build it manually 
  4853. --		vint_set_property(Pause_save_new_master, "text_tag", "SAVELOAD_NEW_SAVE_GAME") 
  4854. 		vint_set_property(Pause_save_new_master, "tint", 0.3647, 0.3725, 0.384) 
  4855. 		vint_set_property(Pause_save_new_master, "auto_offset", "c") 
  4856. 		vint_set_property(Pause_save_new_master, "font", "thin_overlay") 
  4857. 		vint_set_property(Pause_save_new_master, "scale", 0.68, 0.68) 
  4858. 		vint_set_property(Pause_save_new_master, "visible", false) 
  4859. 	end 
  4860. 	 
  4861. 	return Pause_save_new_master 
  4862. end 
  4863.  
  4864. function pause_menu_control_centered_label_show(menu_label, menu_data) 
  4865. 	local control = menu_label.control 
  4866.  
  4867. 	if control ~= nil then 
  4868. 		if control.type ~= PAUSE_MENU_CONTROL_CENTERED_LABEL then 
  4869. 			-- this isn't my control type so release it 
  4870. 			menu_release_control(control) 
  4871. 			control = nil 
  4872. 		end 
  4873. 	end 
  4874. 	 
  4875. 	vint_set_property(menu_label.label_h, "text_tag", "") 
  4876.  
  4877. 	if control == nil then 
  4878. 		local control_h = vint_object_clone(pause_menu_control_centered_label_get_master(), Menu_option_labels.control_parent) 
  4879. 		 
  4880. 		control = { grp_h = control_h, type = PAUSE_MENU_CONTROL_CENTERED_LABEL, is_highlighted = false } 
  4881. 		menu_label.control = control 
  4882. 		vint_set_property(control_h, "visible", true) 
  4883. 	end 
  4884.  
  4885. 	-- update pos and depth 
  4886. 	vint_set_property(control.grp_h, "anchor", menu_label.anchor_x + Menu_option_labels.item_width * 0.5, menu_label.anchor_y) 
  4887. 	vint_set_property(control.grp_h, "depth", menu_label.depth) 
  4888. 	vint_set_property(control.grp_h, "text_tag", menu_data.label_str) 
  4889.  
  4890. end 
  4891.  
  4892. function pause_menu_control_centered_label_enter(menu_label, menu_data) 
  4893. 	local clone = vint_object_clone(menu_label.control.grp_h, Menu_option_labels.hl_bar) 
  4894. 	menu_label.control.hl_control = clone 
  4895. 	vint_set_property(clone, "anchor", 5 + (Menu_option_labels.item_width * 0.5), 0) 
  4896. 	vint_set_property(clone, "tint", 0, 0, 0) 
  4897. 	vint_set_property(clone, "font", "thin") 
  4898. end 
  4899.  
  4900. function pause_menu_control_centered_label_release(control) 
  4901. 	if control.hl_control ~= nil then 
  4902. 		vint_object_destroy(control.hl_control) 
  4903. 		control.hl_control = nil 
  4904. 	end 
  4905. 	 
  4906. 	if control.grp_h ~= nil then 
  4907. 		vint_object_destroy(control.grp_h) 
  4908. 		control.grp_h = nil 
  4909. 	end 
  4910. end 
  4911.  
  4912. function pause_menu_control_centered_label_leave(menu_label, menu_data) 
  4913. 	local control = menu_label.control 
  4914. 	if control.hl_control ~= nil then 
  4915. 		vint_object_destroy(control.hl_control) 
  4916. 		control.hl_control = nil 
  4917. 	end 
  4918. end 
  4919.  
  4920. function pause_menu_control_centered_label_get_width(menu_item) 
  4921. 	local master_h = pause_menu_control_centered_label_get_master() 
  4922. 	vint_set_property(master_h, "text_tag", menu_item.label_str) 
  4923. 	local w = vint_get_property(master_h, "unscaled_size") 
  4924. 	return w * 0.68 
  4925. end 
  4926.  
  4927. ----------------[ SAVE LOAD MENU ]---------------- 
  4928.  
  4929. Pause_save_global_info = { } 
  4930. Pause_save_cheats_enabled_color = { r = 1, g = .5, b = .25 } 
  4931. Pause_save_cheats_disabled_color = { r = .3, g = .3, b = .3 } 
  4932. Pause_save_crib_peg_refs = 0 
  4933.  
  4934. Pause_save_team_icons = { 
  4935. 	[0] = "ui_hud_act_ico_saints", 
  4936. 	[1] = "ui_hud_act_ico_samedi", 
  4937. 	[2] = "ui_hud_act_ico_ronin", 
  4938. 	[3] = "ui_hud_act_ico_ultor", 
  4939. 	[4] = "ui_hud_act_ico_brotherhood", 
  4940. } 
  4941.  
  4942. function pause_save_load_crib_peg() 
  4943. 	if Pause_save_crib_peg_refs == 0 then 
  4944. 		peg_load("ui_crib_photos") 
  4945. 	end 
  4946. 	 
  4947. 	Pause_save_crib_peg_refs = Pause_save_crib_peg_refs + 1 
  4948. end 
  4949.  
  4950. function pause_save_unload_crib_peg() 
  4951. 	if Pause_save_crib_peg_refs == 1 then 
  4952. 		peg_unload("ui_crib_photos") 
  4953. 	end 
  4954.  
  4955. 	Pause_save_crib_peg_refs = Pause_save_crib_peg_refs - 1 
  4956. end 
  4957.  
  4958. function pause_save_get_device_result(success, cancelled) 
  4959. 	if success == true then 
  4960. 		thread_new("pause_save_get_device_result_deferred") 
  4961. 	elseif Pause_menu_save_for_server_drop == true then 
  4962. 		if cancelled == false then 
  4963. 			thread_new("pause_save_get_device_deferred") 
  4964. 		else 
  4965. 			vint_document_unload(vint_document_find("pause_menu")) 
  4966. 		end 
  4967. 	end 
  4968. end 
  4969.  
  4970. function pause_save_get_device_result_deferred() 
  4971. 	pause_save_get_global_info() 
  4972. 	menu_show(Pause_save_menu, MENU_TRANSITION_SWEEP_LEFT) 
  4973. end 
  4974.  
  4975. -- called by C if the current device is removed 
  4976. function pause_save_device_removed() 
  4977. 	if Menu_active ~= 0 then 
  4978. 		if Menu_active.is_load_menu == true or Menu_active.is_save_menu == true then 
  4979. 			dialog_box_message("MENU_TITLE_WARNING", "SAVELOAD_SELECTED_DEVICE_REMOVED_FULL") 
  4980. 			Menu_active.on_back() 
  4981. 		end 
  4982. 	end 
  4983. end 
  4984.  
  4985. function pause_save_get_device_deferred() 
  4986. 	vint_dataresponder_request("save_load", "pause_save_get_device_result", 0, "get_device") 
  4987. end 
  4988.  
  4989. function pause_save_menu_select() 
  4990. 	thread_new("pause_save_sign_in_deferred") 
  4991. end 
  4992.  
  4993. function pause_save_sign_in_deferred() 
  4994. 	vint_dataresponder_request("save_load", "pause_save_sign_in_result", 0, "sign_in") 
  4995. end 
  4996.  
  4997. function pause_save_sign_in_result(success) 
  4998. 	if success == false then 
  4999. 		if Pause_menu_return_to_main ~= 0 then 
  5000. 			Pause_menu_return_to_main() 
  5001. 		end 
  5002. 	else 
  5003. 		thread_new("pause_save_get_device_deferred") 
  5004. 	end 
  5005. end 
  5006.  
  5007. function pause_save_get_global_info(get_device) 
  5008. 	vint_dataresponder_request("save_load", "pause_save_consume_global_info", 0, "global_info", get_device == true) 
  5009. end 
  5010.  
  5011. function pause_save_menu_select_deferred() 
  5012. 	pause_save_get_global_info() 
  5013. 	 
  5014. 	if Pause_save_global_info.device_selected == true and Pause_save_global_info.in_profile == true then 
  5015. 		local t 
  5016. 		if Menu_mode_current == "pause" then 
  5017. 			t = MENU_TRANSITION_SWEEP_LEFT 
  5018. 		else 
  5019. 			t = MENU_TRANSITION_SWAP 
  5020. 		end 
  5021. 		 
  5022. 		menu_show(Pause_save_pending_menu, t) 
  5023. 	elseif Pause_menu_save_for_server_drop == true then 
  5024. 		vint_document_unload(vint_document_find("pause_menu")) 
  5025. 	end 
  5026. end 
  5027.  
  5028. function pause_save_consume_global_info(can_save_new, device_selected, total_missions, total_hoods, continue_avail, in_profile) 
  5029. 	Pause_save_global_info.can_save_new = can_save_new 
  5030. 	Pause_save_global_info.device_selected = device_selected 
  5031. 	Pause_save_global_info.total_missions = total_missions 
  5032. 	Pause_save_global_info.total_hoods = total_hoods 
  5033. 	Pause_save_global_info.continue_avail = continue_avail 
  5034. 	Pause_save_global_info.in_profile = in_profile 
  5035. end 
  5036.  
  5037. function pause_save_populate_header(handle, last_mission_name, last_mission_icon, loadable, missions, hoods, crib_photo, cheats, time_played, difficulty, autosave, percent_complete) 
  5038. 	-- not used: handle, loadable 
  5039. 	local hdr = Menu_option_labels.header_h 
  5040.  
  5041. 	local o = vint_object_find("last_mission_logo", hdr) 
  5042. 	vint_set_property(o, "image", last_mission_icon) 
  5043.  
  5044. 	o = vint_object_find("missions_complete", hdr) 
  5045. 	vint_set_property(o, "insert_values", missions, 0) 
  5046. 	 
  5047. 	o = vint_object_find("game_status", hdr) 
  5048. 	vint_set_property(o, "insert_values", percent_complete.."%", 0) 
  5049.  
  5050. 	time_played = floor(time_played) 
  5051. 	local hours = floor(time_played / 60) 
  5052. 	local minutes = time_played - (hours * 60) 
  5053. 	if minutes > 9 then 
  5054. 		vint_set_property(o, "insert_values", hours..":"..minutes, 1) 
  5055. 	else 
  5056. 		vint_set_property(o, "insert_values", hours..":0"..minutes, 1) 
  5057. 	end 
  5058. 	 
  5059. 	o = vint_object_find("hoods_owned", hdr) 
  5060. 	vint_set_property(o, "insert_values", hoods, 0) 
  5061. 	vint_set_property(o, "insert_values", Pause_save_global_info.total_hoods, 1) 
  5062. 	 
  5063. 	o = vint_object_find("cheats_enabled", hdr) 
  5064. 	vint_set_property(o, "visible", cheats) 
  5065. 	 
  5066. 	o = vint_object_find("difficulty", hdr) 
  5067. 	vint_set_property(o, "insert_values", difficulty, 0) 
  5068. end 
  5069.  
  5070. function pause_save_show(menu_data) 
  5071. 	-- clone the header CLUSTER 
  5072. 	local header_h = vint_object_clone(vint_object_find("save_game_header"), Menu_option_labels.control_parent) 
  5073. 	vint_set_property(header_h, "anchor", 0, 0) 
  5074. 	vint_set_property(header_h, "visible", true) 
  5075. 	Menu_option_labels.header_h = header_h 
  5076. 	 
  5077. 	-- now put some info in header 
  5078. 	vint_dataresponder_request("save_load", "pause_save_populate_header", 0, "current") 
  5079. 	 
  5080. 	if Pause_save_global_info.can_save_new == true then 
  5081. 		menu_data[0] = {  
  5082. 			type = PAUSE_MENU_CONTROL_CENTERED_LABEL, 
  5083. 			label_str = "SAVELOAD_NEW_SAVE_GAME", 
  5084. 			on_select = pause_save_save_new_selected 
  5085. 		} 
  5086. 		 
  5087. 		menu_data.num_items = 1 
  5088. 	else 
  5089. 		menu_data.num_items = 0 
  5090. 	end 
  5091. 	 
  5092. 	Pause_menu_building = menu_data 
  5093. 	vint_dataresponder_request("save_load", "pause_save_add_item", 0, "save_files") 
  5094.  
  5095. 	if get_platform() ~= "PS3" then 
  5096. 		if menu_data.num_items == 0 then 
  5097. 			dialog_box_message("MENU_TITLE_WARNING", "SAVELOAD_CANNOT_SAVE_TO_FULL_DEVICE") 
  5098. 			 
  5099. 			menu_data[0] = { 
  5100. 				type = PAUSE_MENU_CONTROL_CENTERED_LABEL, 
  5101. 				label_str = "SAVELOAD_SELECT_DEVICE", 
  5102. 				on_select = pause_save_select_device 
  5103. 			} 
  5104. 			 
  5105. 			menu_data.num_items = 1 
  5106. 		end 
  5107. 		 
  5108. 	else -- if ps3 
  5109. 	 
  5110. 		if Pause_save_global_info.can_save_new == false then 
  5111. 		 
  5112. 			pause_menu_error_message_while_saving_PS3() 
  5113. 			if menu_data.num_items == 0 then 
  5114. 			 
  5115. 				menu_data[0] = { 
  5116. 					type = PAUSE_MENU_CONTROL_CENTERED_LABEL, 
  5117. 					label_str = "PS3_SAVE_SELECTION_MANAGE_MEMORY", 
  5118. 					on_select = pause_save_delete_data 
  5119. 				} 
  5120. 				menu_data.num_items = 1 
  5121. 			end  
  5122. 		end 
  5123. 	end 
  5124. 	 
  5125. 	--Object names 
  5126. 	local game_status_h = vint_object_find("game_status", header_h) 
  5127. 	local difficulty_h = vint_object_find("difficulty", header_h) 
  5128. 	local b_w, b_h = element_get_actual_size(difficulty_h) 
  5129. 	local a_w, a_h = element_get_actual_size(game_status_h) 
  5130. 	local a_x, a_y = vint_get_property(game_status_h, "anchor") 
  5131. 	menu_data.header_width = a_x + a_w + b_w + 10 
  5132. end 
  5133.  
  5134. function pause_save_add_item(handle, desc, team_index, loadable, missions, hoods, crib_icon, cheats, time_played, difficulty, autosave, percent) 
  5135. 	if autosave == true and Pause_menu_building.is_save_menu == true then 
  5136. 		-- don't show autosave for save over 
  5137. 		return 
  5138. 	end 
  5139. 	 
  5140. 	local num_items = Pause_menu_building.num_items 
  5141.  
  5142. 	local item = { type = PAUSE_MENU_CONTROL_SAVE_LOAD, handle = handle, last_mission_name = desc, autosave = autosave, 
  5143. 		cheats_enabled = cheats, loadable = loadable, crib_icon = crib_icon, difficulty = difficulty, hoods = hoods } 
  5144. 		 
  5145. 	local played_hours = floor(time_played / 60) 
  5146. 	local played_mins = floor(time_played - (played_hours * 60)) 
  5147. 	if played_mins > 9 then 
  5148. 		item.game_time = ""..played_hours..":"..played_mins 
  5149. 	else 
  5150. 		item.game_time = ""..played_hours..":0"..played_mins 
  5151. 	end 
  5152. 	 
  5153. 	item.missions_complete = missions 
  5154.  
  5155. 	item.mission_icon = Pause_save_team_icons[team_index] 
  5156. 	if item.mission_icon == nil then 
  5157. 		item.mission_icon = Pause_save_team_icons[0] 
  5158. 	end 
  5159. 	 
  5160. 	item.percent_complete = ""..percent.."%" 
  5161. 	 
  5162. 	item.on_select = pause_save_save_over_select 
  5163. 	Pause_menu_building[num_items] = item 
  5164. 	num_items = num_items + 1      
  5165. 	Pause_menu_building.num_items = num_items 
  5166. end 
  5167.  
  5168. function pause_save_release(menu_data) 
  5169. 	if Menu_option_labels_inactive.header_h ~= nil then 
  5170. 		vint_object_destroy(Menu_option_labels_inactive.header_h) 
  5171. 		Menu_option_labels_inactive.header_h = nil 
  5172. 	end 
  5173. end 
  5174.  
  5175. function pause_save_post_show(menu_data) 
  5176. 	if Menu_option_labels.header_h ~= nil then 
  5177. 		local cheats = vint_object_find("cheats_enabled", Menu_option_labels.header_h) 
  5178. 		local ax, ay = vint_get_property(cheats, "anchor") 
  5179. 		vint_set_property(cheats, "anchor", menu_data.menu_width, ay) 
  5180. 		 
  5181. 		local difficulty = vint_object_find("difficulty", Menu_option_labels.header_h) 
  5182. 		local ax, ay = vint_get_property(difficulty, "anchor") 
  5183. 		vint_set_property(difficulty, "anchor", menu_data.menu_width, ay) 
  5184. 		 
  5185. 		--Set Header line width 
  5186. 		vint_set_property(vint_object_find("header_horz", Menu_option_labels.header_h), "source_se", menu_data.menu_width - 10, 10) 
  5187. 	end 
  5188. end 
  5189.  
  5190. function pause_save_save_new_selected() 
  5191. 	thread_new("pause_save_save_new_deferred") 
  5192. end 
  5193.  
  5194. function pause_save_save_new_deferred() 
  5195. 	menu_input_block(true) 
  5196. 	-- this needs to be deferred since it's a multi-frame operation 
  5197. 	vint_dataresponder_request("save_load", "pause_save_save_new_results", 0, "save_new") 
  5198. 	menu_input_block(false) 
  5199. end 
  5200.  
  5201. function pause_save_save_new_results(success) 
  5202. 	if success == true then 
  5203. 		if Pause_menu_save_for_server_drop == true then 
  5204. 			pause_menu_exit() 
  5205. 		else 
  5206. 			menu_show(Pause_save_load_menu, MENU_TRANSITION_SWEEP_LEFT) 
  5207. 		end 
  5208. 	end 
  5209. end 
  5210.  
  5211. function pause_save_save_over_select() 
  5212. 	thread_new("pause_save_save_over_deferred") 
  5213. end 
  5214.  
  5215. function pause_save_save_over_deferred() 
  5216. 	menu_input_block(true) 
  5217. 	-- this needs to be deferred since it's a multi-frame operation 
  5218. 	local over_handle = Pause_save_menu[Pause_save_menu.highlighted_item].handle 
  5219. 	vint_dataresponder_request("save_load", "pause_save_save_over_results", 0, "save_over", over_handle) 
  5220. 	menu_input_block(false) 
  5221. end 
  5222.  
  5223. function pause_save_save_over_results(success) 
  5224. 	if success == true then 
  5225. 		if Pause_menu_save_for_server_drop == true then 
  5226. 			pause_menu_exit() 
  5227. 		else 
  5228. 			menu_show(Pause_save_load_menu, MENU_TRANSITION_SWEEP_LEFT) 
  5229. 		end 
  5230. 	end 
  5231. end 
  5232.  
  5233. function pause_save_select_device() 
  5234. 	thread_new("pause_save_select_device2") 
  5235. end 
  5236.  
  5237. function pause_save_delete_data() 
  5238. 	thread_new("pause_save_delete_system") 
  5239. end 
  5240.  
  5241. function pause_save_select_device2() 
  5242. 	menu_input_block(true) 
  5243. 	vint_dataresponder_request("save_load", "pause_save_refresh", 0, "get_device", true) 
  5244. 	menu_input_block(false) 
  5245. end 
  5246.  
  5247. function pause_save_delete_system() 
  5248. 	menu_input_block(true) 
  5249. 	vint_dataresponder_request("save_load", "pause_save_refresh", 0, "delete_data", true) 
  5250. 	menu_input_block(false) 
  5251. end 
  5252.  
  5253. function pause_save_dropped_device_response(result, action) 
  5254. 	if action ~= DIALOG_ACTION_CLOSE then 
  5255. 		return 
  5256. 	end 
  5257. 	 
  5258. 	if result == 0 then 
  5259. 		pause_save_select_device() 
  5260. 	else 
  5261. 		pause_menu_exit() 
  5262. 	end 
  5263. end 
  5264.  
  5265. function pause_save_refresh(success) 
  5266. 	if success == true then 
  5267. 		pause_save_get_global_info() 
  5268. 		local m = menu_clone(Menu_active) 
  5269. 		menu_show(m, MENU_TRANSITION_NONE) 
  5270. 	else 
  5271. 		if Pause_menu_save_for_server_drop == true then 
  5272. 			local options = { [0] = "OPTION_YES", [1] = "MENU_OPTIONS_QUIT_GAME" } 
  5273. 			dialog_box_open("MENU_TITLE_WARNING", "SAVELOAD_SELECT_DEVICE_NOW", options, "pause_save_dropped_device_response", 0, DIALOG_PRIORITY_ACTION) 
  5274. 		elseif Menu_mode_current == "pause" then 
  5275. 			menu_show(Pause_save_load_menu, MENU_TRANSITION_SWEEP_LEFT) 
  5276. 		else 
  5277. 			if Pause_menu_return_to_main ~= 0 then 
  5278. 				Pause_menu_return_to_main() 
  5279. 			end 
  5280. 		end 
  5281. 	end 
  5282. end 
  5283.  
  5284. function pause_load_get_device_success() 
  5285. 	pause_save_get_global_info() 
  5286.  
  5287. 	local t 
  5288. 	if Menu_mode_current == "pause" then 
  5289. 		t = MENU_TRANSITION_SWEEP_LEFT 
  5290. 	else 
  5291. 		t = MENU_TRANSITION_SWAP 
  5292. 	end 
  5293. 	 
  5294. 	if vint_document_find("main_menu") ~= 0 then 
  5295. 		--Darken main menu if we are in it 
  5296. 		main_menu_screen_fade(Main_menu_screen_alpha) 
  5297. 	end 
  5298. 	 
  5299. 	menu_show(Pause_load_menu, t) 
  5300. end 
  5301.  
  5302. function pause_load_get_device_result(success) 
  5303. 	if success == false then 
  5304. 		if Pause_menu_return_to_main ~= 0 then 
  5305. 			Pause_menu_return_to_main() 
  5306. 		end 
  5307. 	else 
  5308. 		thread_new("pause_load_get_device_success") 
  5309. 	end 
  5310. end 
  5311.  
  5312. function pause_load_get_device_deferred() 
  5313. 	vint_dataresponder_request("save_load", "pause_load_get_device_result", 0, "get_device") 
  5314. end 
  5315.  
  5316. function pause_load_sign_in_result(success) 
  5317. 	if success == false then 
  5318. 		if Pause_menu_return_to_main ~= 0 then 
  5319. 			Pause_menu_return_to_main() 
  5320. 		end 
  5321. 	else 
  5322. 		thread_new("pause_load_get_device_deferred") 
  5323. 	end 
  5324. end 
  5325.  
  5326. function pause_load_menu_select_deferred() 
  5327. 	vint_dataresponder_request("save_load", "pause_load_sign_in_result", 0, "sign_in") 
  5328. end 
  5329.  
  5330. function pause_load_menu_select() 
  5331. 	if get_is_coop_client() == true then 
  5332. 		dialog_box_message("MENU_TITLE_WARNING", "SAVELOAD_LOAD_NOT_AS_CLIENT") 
  5333. 		return 
  5334. 	end 
  5335.  
  5336. 	thread_new("pause_load_menu_select_deferred") 
  5337. end 
  5338.  
  5339. function pause_load_show(menu_data) 
  5340. 	local header_h = vint_object_clone(vint_object_find("load_game_header"), Menu_option_labels.control_parent) 
  5341. 	vint_set_property(header_h, "anchor", 0, 0) 
  5342. 	vint_set_property(header_h, "visible", true) 
  5343. 	Menu_option_labels.header_h = header_h 
  5344. 	pause_save_load_crib_peg() 
  5345. 	menu_data.num_items = 0 
  5346. 	 
  5347. 	Pause_menu_building = menu_data 
  5348. 	vint_dataresponder_request("save_load", "pause_save_add_item", 0, "save_files") 
  5349. 	 
  5350. 	menu_data.highlighted_item = 0 
  5351. 	 
  5352. 	if menu_data.num_items > 0 then 
  5353. 		for i = 0, menu_data.num_items - 1 do 
  5354. 			menu_data[i].on_select = pause_load_select 
  5355. 		end 
  5356. 		 
  5357. 		pause_load_nav(Pause_menu_building) 
  5358. 		menu_data.loadable = true 
  5359. 	else 
  5360. 		menu_data[0] = { label = "SAVELOAD_NOTHING_TO_LOAD", type = MENU_ITEM_TYPE_SELECTABLE } 
  5361. 		menu_data.num_items = 1 
  5362. 		menu_data.loadable = false 
  5363. 	end 
  5364. 	 
  5365. 	 
  5366. 	--Calculate Header width 
  5367. 	 
  5368. 	--Object names 
  5369. 	local game_status_h = vint_object_find("game_status", header_h) 
  5370. 	local difficulty_h = vint_object_find("difficulty", header_h) 
  5371. 	local b_w, b_h = element_get_actual_size(difficulty_h) 
  5372. 	local a_w, a_h = element_get_actual_size(game_status_h) 
  5373. 	local a_x, a_y = vint_get_property(game_status_h, "anchor") 
  5374. 	menu_data.header_width = a_x + a_w + b_w + 10 
  5375. end 
  5376.  
  5377. function pause_load_release(menu_data) 
  5378. 	if Menu_option_labels_inactive.header_h ~= nil then 
  5379. 		vint_object_destroy(Menu_option_labels_inactive.header_h) 
  5380. 		Menu_option_labels_inactive.header_h = nil 
  5381. 	end 
  5382. 	pause_save_unload_crib_peg() 
  5383. 	Pause_load_is_coop = false 
  5384. 	Pause_load_from_menu = PAUSE_LOAD_FROM_MENU_OTHER 
  5385. end 
  5386.  
  5387. function pause_load_post_show(menu_data) 
  5388. 	if Menu_option_labels.header_h ~= nil then 
  5389. 		if menu_data.loadable == true then 
  5390. 			local cheats = vint_object_find("cheats_enabled", Menu_option_labels.header_h) 
  5391. 			local ax, ay = vint_get_property(cheats, "anchor") 
  5392. 			vint_set_property(cheats, "anchor", menu_data.menu_width, ay) 
  5393. 			 
  5394. 			local difficulty = vint_object_find("difficulty", Menu_option_labels.header_h) 
  5395. 			local ax, ay = vint_get_property(difficulty, "anchor") 
  5396. 			vint_set_property(difficulty, "anchor", menu_data.menu_width, ay) 
  5397. 		end 
  5398. 		 
  5399. 		for k, v in {"difficulty", "crib_image", "game_status", "hoods_owned", "last_mission_logo", "missions_complete", "last_mission_name"} do 
  5400. 			local h = vint_object_find(v, Menu_option_labels.header_h) 
  5401. 			vint_set_property(h, "visible", menu_data.loadable) 
  5402. 		end 
  5403. 		--Set Header line width 
  5404. 		vint_set_property(vint_object_find("header_horz", Menu_option_labels.header_h), "source_se", menu_data.menu_width - 10, 10) 
  5405. 	end 
  5406. end         
  5407.  
  5408. function pause_load_nav(menu_data) 
  5409. 	local item = menu_data[menu_data.highlighted_item] 
  5410. 	local hdr = Menu_option_labels.header_h 
  5411. 	local o = vint_object_find("last_mission_name", hdr) 
  5412. 	vint_set_property(o, "text_tag", item.last_mission_name) 
  5413. 	 
  5414. 	o = vint_object_find("last_mission_logo", hdr) 
  5415. 	vint_set_property(o, "image", item.mission_icon) 
  5416.  
  5417. 	o = vint_object_find("missions_complete", hdr) 
  5418. 	vint_set_property(o, "insert_values", item.missions_complete, 0) 
  5419.  
  5420. 	o = vint_object_find("game_status", hdr) 
  5421. 	vint_set_property(o, "insert_values", item.percent_complete, 0) 
  5422. 	vint_set_property(o, "insert_values", item.game_time, 1) 
  5423. 	 
  5424. 	o = vint_object_find("hoods_owned", hdr) 
  5425. 	vint_set_property(o, "insert_values", item.hoods, 0) 
  5426. 	vint_set_property(o, "insert_values", Pause_save_global_info.total_hoods, 1) 
  5427. 	 
  5428. 	o = vint_object_find("cheats_enabled", hdr) 
  5429. 	vint_set_property(o, "visible", item.cheats_enabled) 
  5430. 	 
  5431. 	o = vint_object_find("crib_image", hdr) 
  5432. 	vint_set_property(o, "image", item.crib_icon) 
  5433. 	 
  5434. 	o = vint_object_find("difficulty", hdr) 
  5435. 	vint_set_property(o, "insert_values", item.difficulty, 0) 
  5436. end 
  5437.  
  5438. Pause_load_is_coop = false 
  5439. PAUSE_LOAD_FROM_MENU_OTHER = 0 
  5440. PAUSE_LOAD_FROM_MENU_COOP_ONLINE = 1 
  5441. PAUSE_LOAD_FROM_MENU_COOP_SYSLINK = 2 
  5442. Pause_load_from_menu = PAUSE_LOAD_FROM_MENU_OTHER 
  5443.  
  5444. function pause_load_select_deferred(handle) 
  5445. 	menu_input_block(true) 
  5446. 	vint_dataresponder_request("save_load", "pause_load_results", 0, "load", handle, Pause_load_is_coop, Pause_load_from_menu) 
  5447. 	menu_input_block(false) 
  5448. end 
  5449.  
  5450. function pause_load_select(menu_label, menu_data) 
  5451. 	if menu_data.loadable == true then 
  5452. 		thread_new("pause_load_select_deferred", menu_data.handle) 
  5453. 	else 
  5454. 		dialog_box_message("SAVELOAD_ERROR", "SAVELOAD_FILE_NOT_LOADABLE") 
  5455. 	end 
  5456. end 
  5457.  
  5458. function pause_load_results(success) 
  5459. 	if success == true then 
  5460. 		local for_main_menu = Menu_mode_current ~= "pause" 
  5461. 		 
  5462. 		if for_main_menu == true then 
  5463. 			Pause_menu_main_close_ref() 
  5464. 		else 
  5465. 			vint_document_unload() 
  5466. 		end 
  5467. 	end 
  5468. end 
  5469.  
  5470. -- coop menu 
  5471. Coop_pause_loading_friends_dialog_handle = 0 
  5472. Coop_pause_loading_friends_at_startup = false 
  5473. Coop_pause_waiting_on_join_dialog_handle = 0 
  5474.  
  5475. function pause_menu_maybe_quit_game_callback(result, action) 
  5476. 	if action ~= DIALOG_ACTION_CLOSE then 
  5477. 		return 
  5478. 	end 
  5479.  
  5480. 	if result == 0 then	 
  5481. 		pause_menu_quit_game() 
  5482. 	end 
  5483. 	 
  5484. end 
  5485.  
  5486. function coop_player_joined_start() 
  5487. 	start_intro_cutscene() 
  5488. end 
  5489.  
  5490. function coop_pause_close_wait_on_join_dialog() 
  5491. 	if Coop_pause_waiting_on_join_dialog_handle ~= 0 then 
  5492. 		dialog_box_force_close(Coop_pause_waiting_on_join_dialog_handle) 
  5493. 		Coop_pause_waiting_on_join_dialog_handle = 0 
  5494. 	end 
  5495. end 
  5496.  
  5497. function coop_pause_send_invite_and_wait() 
  5498. 	local result = send_pause_menu_player_invite(Menu_active.highlighted_item) 
  5499. 	if result == true then 
  5500. 		--popup the waiting to end dialogue 
  5501. 		local options = { [0] = "QUIT_TO_MAIN_MENU", [1] = "CONTROL_CANCEL" } 
  5502. 		Coop_pause_waiting_on_join_dialog_handle = dialog_box_open("MENU_TITLE_NOTICE", "MULTI_COOP_WAITING_PLAYER_2", options, "pause_menu_maybe_quit_game_callback", 0, DIALOG_PRIORITY_ACTION, false, true) 
  5503. 	else 
  5504. 		local style_insert = {[0] = Coop_pause_invite_player_menu[Menu_active.highlighted_item].label} 
  5505. 		local style_string = vint_insert_values_in_string("INVITE_FAILED_BODY", style_insert) 
  5506. 		dialog_box_message("INVITE_FAILED_TITLE", style_string) 
  5507. 	end 
  5508. end 
  5509.  
  5510. function pause_menu_get_gamercard() 
  5511. 	debug_print("vint", "Get friend gamercard here!\n") 
  5512. 	show_pause_menu_friend_gamercard(Menu_active.highlighted_item) 
  5513. end 
  5514.  
  5515. function coop_pause_just_wait() 
  5516. 	--popup the waiting to end dialogue 
  5517. 	local options = { [0] = "QUIT_TO_MAIN_MENU", [1] = "CONTROL_CANCEL" } 
  5518. 	Coop_pause_waiting_on_join_dialog_handle = dialog_box_open("MENU_TITLE_NOTICE", "MULTI_COOP_WAITING_PLAYER_2", options, "pause_menu_maybe_quit_game_callback", 0, DIALOG_PRIORITY_ACTION, false, true) 
  5519. end 
  5520.  
  5521. function coop_pause_send_invite() 
  5522. 	local result = send_pause_menu_player_invite(Menu_active.highlighted_item) 
  5523. 	 
  5524. 	if result == true then 
  5525. 		--say we invited the friend   
  5526. 		local style_insert = {[0] = Coop_pause_invite_player_menu[Menu_active.highlighted_item].label} 
  5527. 		local style_string = vint_insert_values_in_string("MP_INVITE_SENT_BODY", style_insert) 
  5528. 		dialog_box_message("MP_INVITE_SENT_TITLE", style_string) 
  5529. 	else 
  5530. 		local style_insert = {[0] = Coop_pause_invite_player_menu[Menu_active.highlighted_item].label} 
  5531. 		local style_string = vint_insert_values_in_string("INVITE_FAILED_BODY", style_insert) 
  5532. 		dialog_box_message("INVITE_FAILED_TITLE", style_string) 
  5533. 	end 
  5534. end 
  5535.  
  5536. function coop_pause_populate_friends(display_name) 
  5537. 	local num_items = Coop_pause_invite_player_menu.num_items 
  5538. 	--add item yay 
  5539. 	if Coop_pause_loading_friends_at_startup then 
  5540. 		Coop_pause_invite_player_menu[num_items] = {label = display_name, type = MENU_ITEM_TYPE_SELECTABLE, on_select = coop_pause_send_invite_and_wait }	 
  5541. 		Coop_pause_invite_player_menu.on_back = pause_menu_quit_game 
  5542. 	else 
  5543. 		Coop_pause_invite_player_menu[num_items] = {label = display_name, type = MENU_ITEM_TYPE_SELECTABLE, on_select = coop_pause_send_invite 	} 
  5544. 	end 
  5545. 	Coop_pause_invite_player_menu.num_items = num_items + 1 
  5546.  
  5547. end 
  5548.  
  5549. function coop_pause_build_invite_player_request() 
  5550. 	Coop_pause_invite_player_menu.num_items = 0 
  5551. 	vint_dataresponder_request("sr2_pause_menu_friends", "coop_pause_populate_friends", 0)  
  5552.  
  5553. 	if Coop_pause_loading_friends_dialog_handle ~= 0 then 
  5554. 		dialog_box_force_close(Coop_pause_loading_friends_dialog_handle) 
  5555. 		Coop_pause_loading_friends_dialog_handle = 0 
  5556. 	end 
  5557. 	if Coop_pause_invite_player_menu.num_items == 0 then 
  5558. 		dialog_box_message("MENU_TITLE_NOTICE", "NO_FRIENDS_ONLINE") 
  5559. 		--change the current menu to not say loading 
  5560. 		if is_coop_start_screen() then 
  5561. 			Pause_menu_no_friends_menu.on_alt_select = nil 
  5562. 			Pause_menu_no_friends_menu.btn_tips = Pause_menu_quit_to_main_only_tips 
  5563. 		else 
  5564. 			Pause_menu_no_friends_menu.on_back = nil 
  5565. 			Pause_menu_no_friends_menu.btn_tips = Pause_menu_back_only 
  5566. 		end 
  5567. 		menu_show(Pause_menu_no_friends_menu, MENU_TRANSITION_SWAP) 
  5568. 	else 
  5569. 		if is_coop_start_screen() then 
  5570. 			if get_coop_join_type() == 2 then 
  5571. 				Coop_pause_invite_player_menu.on_alt_select = nil 
  5572. 				Coop_pause_invite_player_menu.btn_tips = Pause_menu_quit_to_main_only_tips 
  5573. 			else 
  5574. 				Coop_pause_invite_player_menu.on_alt_select = pause_menu_get_gamercard 
  5575. 				Coop_pause_invite_player_menu.btn_tips = Pause_menu_quit_to_main_tips 
  5576. 			end 
  5577. 			Pause_horz_menu[0].sub_menu = Coop_pause_invite_player_menu 
  5578. 		end 
  5579. 		menu_show(Coop_pause_invite_player_menu, MENU_TRANSITION_SWEEP_RIGHT) 
  5580. 	end 
  5581.  
  5582. end 
  5583.  
  5584. --load friends 
  5585. function coop_pause_load_friends() 
  5586. 	--open a dialog box 
  5587. 	Coop_pause_loading_friends_at_startup = false 
  5588. 	Coop_pause_loading_friends_dialog_handle = dialog_box_message("GAME_LOADING", "MULTI_INVITE_FILTER_FRIENDS") 
  5589. 	--request the friends 
  5590. 	thread_new("coop_pause_build_invite_player_request") 
  5591. end 
  5592.  
  5593. --load friends for coop start, have invite sent, popup a waiting dialogue instead 
  5594. function coop_pause_load_friends_coop_start() 
  5595. 	if is_coop_start_screen() then 
  5596. 		if get_coop_join_type() == 2 then 
  5597. 			Coop_invite_friends_menu.on_alt_select = nil 
  5598. 			Coop_invite_friends_menu.btn_tips = Pause_menu_quit_to_main_only_tips 
  5599. 		else 
  5600. 			Coop_invite_friends_menu.on_alt_select = pause_menu_get_gamercard 
  5601. 			Coop_invite_friends_menu.btn_tips = Pause_menu_quit_to_main_tips 
  5602. 		end 
  5603. 	end 
  5604. 	Coop_pause_loading_friends_at_startup = true 
  5605. 	Coop_pause_loading_friends_dialog_handle = dialog_box_message("GAME_LOADING", "MULTI_INVITE_FILTER_FRIENDS") 
  5606. 	--request the friends 
  5607. 	thread_new("coop_pause_build_invite_player_request") 
  5608. end 
  5609.  
  5610. function coop_pause_change_privacy() 
  5611. 	if get_is_host() then 
  5612. 		local type = coop_privacy_slider_values_pc.cur_value 
  5613. 		set_coop_join_type(type) 
  5614. 	end 
  5615. end 
  5616.  
  5617. function coop_pause_change_friendly_fire() 
  5618. 	if get_is_host() then 
  5619. 		local type = coop_friendly_fire_slider_values.cur_value 
  5620. 		set_coop_friendly_fire(type) 
  5621. 	end 
  5622. end 
  5623.  
  5624. function coop_pause_kick_player_confirm(result, action) 
  5625.  
  5626. 	if action ~= DIALOG_ACTION_CLOSE then 
  5627. 		return 
  5628. 	end 
  5629. 	 
  5630. 	if result == 0 and get_is_host() then 
  5631. 		kick_coop_player() 
  5632. 	end 
  5633. 	 
  5634. end 
  5635.  
  5636. function coop_pause_maybe_kick_player() 
  5637. 	--set this up in code so we can get players name 
  5638. 	coop_kick_player() 
  5639. end 
  5640.  
  5641. function coop_update_friendly_fire(data_item_handle, event_name) 
  5642. 	local option = vint_dataitem_get(data_item_handle) 
  5643. 	if get_is_host() then 
  5644. 		return 
  5645. 	end 
  5646. 	 
  5647. 	local ff_option = get_coop_friendly_fire() 
  5648. 	if coop_is_active() then 
  5649. 		if ff_option == 0 then 
  5650. 			Pause_coop_menu[3].info_text_str = "MULTI_LOBBY_ON" 
  5651. 		elseif ff_option == 1 then 
  5652. 			Pause_coop_menu[3].info_text_str = "GENERAL_LIGHT" 
  5653. 		else 
  5654. 			Pause_coop_menu[3].info_text_str = "MULTI_LOBBY_OFF" 
  5655. 		end 
  5656. 	else 
  5657. 		if ff_option == 0 then 
  5658. 			Pause_coop_menu[2].info_text_str = "MULTI_LOBBY_ON" 
  5659. 		elseif ff_option == 1 then 
  5660. 			Pause_coop_menu[2].info_text_str = "GENERAL_LIGHT" 
  5661. 		else 
  5662. 			Pause_coop_menu[2].info_text_str = "MULTI_LOBBY_OFF" 
  5663. 		end 
  5664. 	end 
  5665. 	 
  5666. 	if Menu_active == Pause_coop_menu then 
  5667. 		menu_info_box_show(Menu_option_labels[pos-top], Menu_active[pos]) 
  5668. 	end 
  5669. end 
  5670.  
  5671. function pause_menu_display_coop_tab() 
  5672. 	menu_show(Pause_coop_menu, MENU_TRANSITION_SWAP) 
  5673. end 
  5674.  
  5675. function on_multi_login_enter_sp_session_name(menu_label, menu_data) 
  5676. 	menu_open_game_name_window() 
  5677. 	vint_dataresponder_request( "enter_login_PC_data_responder", "dummy_login_pc_func", 0 ) 
  5678. 	if menu_open_enter_name_result() == 1 then 
  5679. 		local entered_text = menu_open_enter_name_result_string(5) 
  5680. 		if entered_text == nil then 
  5681. 			entered_text = "" 
  5682. 		end 
  5683. 		vint_set_property(vint_object_find("value_text", menu_label.control.grp_h), "text_tag", entered_text ) 
  5684. 	end 
  5685. 	menu_resize() 
  5686. end 
  5687.  
  5688. function pause_menu_coop_show(menu_label, menu_data) 
  5689. 	Pause_coop_menu.num_items = 0 
  5690. 	-- see if we already have a second player 
  5691. 	if get_is_host() then 
  5692. 		if coop_is_active() then 
  5693. 			--show kick player  
  5694. 			Pause_coop_menu[0] = { label = "CONTROL_KICK_PLAYER",		type = MENU_ITEM_TYPE_SELECTABLE, on_select = coop_pause_maybe_kick_player } 
  5695. 			Pause_coop_menu.num_items = 1 
  5696. 		elseif is_signed_in() and is_connected_to_service() and user_has_online_privlage() and get_is_syslink() == false then 
  5697. 			--show invite players 
  5698. 			if get_platform() ~= "PC" then 
  5699. 				Pause_coop_menu[0] = { label = "MULTI_LOBBY_INVITE_FRIENDS",		type = MENU_ITEM_TYPE_SELECTABLE, on_select = coop_pause_load_friends } 
  5700. 				Pause_coop_menu.num_items = 1 
  5701. 			end 
  5702. 		end 
  5703. 		 
  5704. 		if get_platform() == "PC" then 
  5705. 			Pause_coop_menu[Pause_coop_menu.num_items] = 	{ label = "MULTI_SESSION_NAME",			type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "",   on_select = on_multi_login_enter_sp_session_name } --{ label = "MULTI_SESSION_PASS",			type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "", on_select = on_multi_login_enter_session_pass } 
  5706. 			 
  5707. 			local entered_text = menu_open_enter_name_result_string(5) 
  5708. 			if entered_text == nil then 
  5709. 				entered_text = "" 
  5710. 			end 
  5711. 			Pause_coop_menu[Pause_coop_menu.num_items].info_text_str = entered_text 
  5712. 			 
  5713. 			Pause_coop_menu.num_items = Pause_coop_menu.num_items + 1 
  5714. 		end 
  5715. 		 
  5716. 		if get_platform() == "PC" then 
  5717. 			Pause_coop_menu[Pause_coop_menu.num_items] = 	{ label = "MULTI_LOBBY_PRIVACY",		type = MENU_ITEM_TYPE_TEXT_SLIDER,  text_slider_values = coop_privacy_slider_values_pc, on_value_update = coop_pause_change_privacy } 
  5718. 			Pause_coop_menu.num_items = Pause_coop_menu.num_items + 1 
  5719. 			coop_privacy_slider_values_pc.cur_value = get_coop_join_type() 
  5720. 		else 
  5721. 			Pause_coop_menu[Pause_coop_menu.num_items] = 	{ label = "MULTI_LOBBY_PRIVACY",		type = MENU_ITEM_TYPE_TEXT_SLIDER,  text_slider_values = coop_privacy_slider_values, on_value_update = coop_pause_change_privacy } 
  5722. 			Pause_coop_menu.num_items = Pause_coop_menu.num_items + 1 
  5723. 			coop_privacy_slider_values.cur_value = get_coop_join_type() 
  5724. 		end		 
  5725. 		 
  5726. 		Pause_coop_menu[Pause_coop_menu.num_items] = 	{ label = "MULTI_LOBBY_FRIENDLY_FIRE",		type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values = coop_friendly_fire_slider_values, on_value_update = coop_pause_change_friendly_fire } 
  5727. 		Pause_coop_menu.num_items = Pause_coop_menu.num_items + 1 
  5728. 		coop_friendly_fire_slider_values.cur_value = get_coop_friendly_fire() 
  5729. 	else 
  5730. 		Pause_coop_menu[Pause_coop_menu.num_items] = 	 {label = "MULTI_LOBBY_FRIENDLY_FIRE",	type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "CONTROL_NO"} 
  5731. 		local option =  get_coop_friendly_fire() 
  5732. 		if option == 0 then 
  5733. 			Pause_coop_menu[Pause_coop_menu.num_items].info_text_str = "MULTI_LOBBY_ON" 
  5734. 		elseif option == 1 then 
  5735. 			Pause_coop_menu[Pause_coop_menu.num_items].info_text_str = "GENERAL_LIGHT" 
  5736. 		else 
  5737. 			Pause_coop_menu[Pause_coop_menu.num_items].info_text_str = "MULTI_LOBBY_OFF" 
  5738. 		end 
  5739. 		Pause_coop_menu.num_items = Pause_coop_menu.num_items + 1 
  5740.  
  5741. 		vint_dataitem_add_subscription("sr2_pause_menu_friendly_fire", "update", "coop_update_friendly_fire") 
  5742. 	end 
  5743. 	 
  5744. 	 
  5745. end 
  5746.  
  5747.  
  5748. ------------------------- 
  5749. --------[ MENUS ]-------- 
  5750. ------------------------- 
  5751.  
  5752. --[ Menu populate information ]-- 
  5753. Pause_info_menu_population_data = { 
  5754. 	--	Objectives menu 
  5755. 	[0] = { header = "INFO_OBJECTIVES_TITLE", callback = "pause_menu_populate_objectives", prep_function = nil}, 
  5756. 	 
  5757. 	--	Stats menu 
  5758. 	[1] = { header = "PAUSE_STATS_TITLE", 		callback = "pause_menu_populate_stats", 		prep_function = pause_menu_prep_stats}, 
  5759.  
  5760. 	--	Hitman menus 
  5761. 	[2] = { header = "PAUSE_ACT_HITMAN_TITLE", callback = "pause_menu_populate_hitman_list", prep_function = nil, empty = "PAUSE_ACT_HITMAN_EMPTY" }, 
  5762. 	[3] = { header = nil, callback = "pause_menu_populate_hitman_target", prep_function = pause_menu_prep_hitman_targets }, 
  5763. 	 
  5764. 	-- Chopshop Menus 
  5765. 	[4] = { header = "PAUSE_ACT_CHOP_TITLE", callback = "pause_menu_populate_chop_shop_list", prep_function = nil, empty = "PAUSE_ACT_CHOPSHOP_EMPTY" }, 
  5766. 	[5] = { header = nil, callback = "pause_menu_populate_chop_shop_vehicle", prep_function = pause_menu_prep_chop_shop_vehicle }, 
  5767. 	 
  5768. 	--	Diversions Menus 
  5769. 	[6] = { header = nil, callback = "pause_menu_populate_diversions_menu", prep_function = pause_menu_prep_diversions }, 
  5770. 	[7] = { header = nil, callback = "pause_menu_populate_diversions_stat", prep_function = pause_menu_prep_diversions_stats }, 
  5771. 	[8] = { header = nil, callback = "pause_menu_populate_diversions_stat_sub", prep_function = pause_menu_prep_diversions_stats_sub }, 
  5772. 	 
  5773. 	-- Collections 
  5774. 	[9] = { header = nil, callback = "pause_menu_populate_collection", prep_function = nil }, 
  5775. 	 
  5776. 	--	Unlockables 
  5777. 	[10] = { header = nil, callback = "pause_menu_populate_player_unlockables", prep_function = pause_menu_prep_stats, empty = "PAUSE_INFO_UNLOCKABLE_EMPTY" }, 
  5778. 	 
  5779. 	-- Help Menu 
  5780. 	[11] = { header = nil, callback = "pause_menu_populate_help_categories", prep_function = nil }, 
  5781. 	[12] = { header = nil, callback = "pause_menu_populate_help_topics", prep_function = pause_menu_prep_help_topics }, 
  5782. 	[13] = { header = nil, callback = "pause_menu_populate_help", prep_function = pause_menu_prep_help_menu }, 
  5783. 	 
  5784. 	--14 Options 
  5785. 	--15 Control Scheme 
  5786. 	 
  5787. 	--16 Cellphone 
  5788. 	 
  5789. 	--17 Play list Editor 
  5790. 	--18 Play list editor 
  5791. } 
  5792.  
  5793. ----[ Sliders for the Menus ]---- 
  5794.  
  5795. adv_ambient_slider_values 			= { [0] = { label = "SHADOW_NONE" },[1] = { label = "SHADOW_STENCIL" }, [2] = { label = "SHADOW_HYBRID" },														num_values = 3, cur_value = 0 } 
  5796. adv_motion_blur_slider_values		= { [0] = { label = "CONTROL_NO" }, [1] = { label = "CONTROL_YES" },																							num_values = 2, cur_value = 0 } 
  5797. adv_antiali_slider_values 			= { [0] = { label = "CONTROL_NO" }, [1] = { label = "2x" },				[2] = { label = "4x" },																	num_values = 3, cur_value = 0 } 
  5798. adv_anisotropy_slider_values 		= { [0] = { label = "CONTROL_NO" }, [1] = { label = "2x" }, 			[2] = { label = "4x" },				[3] = { label = "8x" },	[4] = { label = "16x" },	num_values = 5,	cur_value = 0 } 
  5799. adv_hdr_slider_values 				= { [0] = { label = "CONTROL_NO" },	[1] = { label = "CONTROL_YES" },																							num_values = 2, cur_value = 0 } 
  5800. adv_shadow_slider_values 			= { [0] = { label = "SHADOW_NONE" },[1] = { label = "SHADOW_STENCIL" }, [2] = { label = "SHADOW_HYBRID" },														num_values = 3, cur_value = 0 } 
  5801. adv_distance_slider_values 			= { [0] = { label = "VIEW_NEAR" },	[1] = { label = "VIEW_MEDIUM" 	},	[2] = { label = "VIEW_FAR" },															num_values = 3, cur_value = 0 } 
  5802. adv_dynamic_lights_slider_values	= { [0] = { label = "SHADOW_NONE" },[1] = { label = "SHADOW_STENCIL" }, [2] = { label = "SHADOW_HYBRID" },														num_values = 3, cur_value = 0 } 
  5803. adv_blur_slider_values				= { [0] = { label = "CONTROL_NO" }, [1] = { label = "CONTROL_YES" },																							num_values = 2, cur_value = 0 } 
  5804. adv_depthoffield_slider_values		= { [0] = { label = "CONTROL_NO" }, [1] = { label = "CONTROL_YES" },																							num_values = 2, cur_value = 0 } 
  5805.  
  5806. invert_y_slider_values 			= { [1] = { label = "CONTROL_YES" }, [0] = { label = "CONTROL_NO" }, num_values = 2, cur_value = 0 } 
  5807. invert_rot_slider_values	 	= { [1] = { label = "CONTROL_YES" }, [0] = { label = "CONTROL_NO" }, num_values = 2, cur_value = 0 } 
  5808. left_stick_slider_values	 	= { [1] = { label = "CONTROL_YES" }, [0] = { label = "CONTROL_NO" }, num_values = 2, cur_value = 0 } 
  5809. vibration_slider_values 		= { [1] = { label = "CONTROL_YES" }, [0] = { label = "CONTROL_NO" }, num_values = 2, cur_value = 0 } 
  5810. crouch_slider_values 			= { [1] = { label = "CONTROL_YES" }, [0] = { label = "CONTROL_NO" }, num_values = 2, cur_value = 0 } 
  5811. subtitles_slider_values 		= { [1] = { label = "CONTROL_YES" }, [0] = { label = "CONTROL_NO" }, num_values = 2, cur_value = 0 } 
  5812. vsync_gameplay_slider_values	= { [1] = { label = "CONTROL_YES" }, [0] = { label = "CONTROL_NO" }, num_values = 2, cur_value = 0 } 
  5813. vsync_cutscene_slider_values	= { [1] = { label = "CONTROL_YES" }, [0] = { label = "CONTROL_NO" }, num_values = 2, cur_value = 0 } 
  5814. minimap_slider_values 			= { [0] = { label = "MINIMAP_ROTATIONAL" 	}, [1] = { label = "MINIMAP_STATIC" 	}, num_values = 2, cur_value = 0 } 
  5815. vehicle_radio_slider_values 	= { [2] = { label = "RADIO_LIFE_LIKE" 		}, [0] = { label = "RADIO_ALWAYS_ON" 	}, [1] = { label = "RADIO_HIJACK_ON" }, num_values = 3, cur_value = 0 } 
  5816. coop_privacy_slider_values		= { [0] = { label = "MULTI_LOBBY_OPEN" }, [1] = { label = "MULTI_LOBBY_FRIENDS_ONLY" }, [2] = { label = "MULTI_LOBBY_INVITE_ONLY" }, num_values = 3, cur_value = 0 } 
  5817. coop_friendly_fire_slider_values = { [0] = { label = "MULTI_LOBBY_ON" }, [1] = { label = "GENERAL_LIGHT"}, [2] = { label = "MULTI_LOBBY_OFF" }, num_values = 3, cur_value = 0 } 
  5818. coop_privacy_slider_values_pc	= { [0] = { label = "MULTI_LOBBY_OPEN" }, [1] = { label = "MULTI_LOBBY_CLOSED" }, num_values = 2, cur_value = 1 } 
  5819.  
  5820.  
  5821. pad_axis_lx_slider_values 		= { [0] = { label = "AXIS_1" }, [1] = { label = "AXIS_2" }, [2] = { label = "AXIS_3" }, [3] = { label = "AXIS_4" }, num_values = 4, cur_value = 0 } 
  5822. pad_axis_ly_slider_values 		= { [0] = { label = "AXIS_1" }, [1] = { label = "AXIS_2" }, [2] = { label = "AXIS_3" }, [3] = { label = "AXIS_4" }, num_values = 4, cur_value = 1 } 
  5823. pad_axis_rx_slider_values 		= { [0] = { label = "AXIS_1" }, [1] = { label = "AXIS_2" }, [2] = { label = "AXIS_3" }, [3] = { label = "AXIS_4" }, num_values = 4, cur_value = 2 } 
  5824. pad_axis_ry_slider_values 		= { [0] = { label = "AXIS_1" }, [1] = { label = "AXIS_2" }, [2] = { label = "AXIS_3" }, [3] = { label = "AXIS_4" }, num_values = 4, cur_value = 3 } 
  5825.  
  5826. ----[ Button Tips for the Menus ]---- 
  5827. Pause_options_btn_tips = { 
  5828. 	a_button 	= 	{ label = "PAUSE_MENU_ACCEPT", 	enabled = btn_tips_default_a, }, 
  5829. 	x_button 	= 	{ label = "CONTROLS_DEFAULTS", 	enabled = btn_tips_default_a, }, 
  5830. 	b_button 	= 	{ label = "MENU_BACK", 			enabled = btn_tips_default_a, }, 
  5831. } 
  5832.  
  5833. Multi_scoreboard_tips_syslink = { 
  5834. 	b_button 	= 	{ label = "MENU_RESUME", 		enabled = btn_tips_default_a, }, 
  5835. } 
  5836. 	 
  5837. Multi_scoreboard_tips = { 
  5838. 	a_button 	= 	{ label = "CONTROL_SELECT", 	enabled = btn_tips_default_a, }, 
  5839. 	b_button 	= 	{ label = "MENU_RESUME", 		enabled = btn_tips_default_a, }, 
  5840. } 
  5841.  
  5842. Pause_save_load_btn_tips = { 
  5843. 	a_button 	= 	{ label = "CONTROL_SELECT", 					enabled = btn_tips_default_a, }, 
  5844. 	x_button 	= 	{ label = "MENU_OPTIONS_SELECT_STORAGE", 		enabled = btn_tips_default_a, }, 
  5845. 	b_button 	= 	{ label = "CONTROL_RESUME",						enabled = btn_tips_default_a, }, 
  5846. } 
  5847.  
  5848. Pause_save_load_btn_tips_PC = { 
  5849. 	a_button 	= 	{ label = "CONTROL_SELECT", 					enabled = btn_tips_default_a, }, 
  5850. 	b_button 	= 	{ label = "CONTROL_RESUME",						enabled = btn_tips_default_a, }, 
  5851. } 
  5852.  
  5853. Pause_menu_accept_back_btn_tips = { 
  5854. 	a_button 	= 	{ label = "CONTROL_SELECT", 	enabled = btn_tips_default_a, }, 
  5855. 	b_button 	= 	{ label = "CONTROL_BACK", 		enabled = btn_tips_default_a, }, 
  5856. } 
  5857.  
  5858. Pause_menu_playlist_left_tips = { 
  5859. 	a_button 	=	{ label = "MP3_CTRL_ADD_TRK", 					enabled = btn_tips_default_a,		}, 	  
  5860. 	x_button 	=	{ label = "MP3_CTRL_PREVIEW",					enabled = pause_menu_playlist_in_genre,		}, 
  5861. 	b_button 	=	{ label = "MENU_BACK", 							enabled = btn_tips_default_a,		}, 
  5862. 	right_stick =  	{ label = "{MENU_UP}{0}", label_text="MP3_PLAYLIST_OPTIONS_SORT_ARTIST", enabled = pause_menu_playlist_in_genre, in_playlist = true},--btn_tip_always_hidden,	use_dpad = true, independent = false}, 
  5863. } 
  5864.  
  5865. Pause_menu_playlist_right_tips = { 
  5866. 	a_button		= 	{ label = "MP3_CTRL_REMOVE_TRK", 			enabled = btn_tips_default_a,	}, 	  
  5867. 	x_button		=  	{ label = "MP3_PLAY_STATE_PLAY", 			enabled = btn_tips_default_a,	}, 
  5868. 	b_button		=	{ label = "MENU_BACK", 					enabled = btn_tips_default_a,	}, 
  5869. 	right_stick		= 	{ label = "{MENU_UP}{MENU_DOWN}{0}", label_text="MP3_FOOTER_MOVE_TRACK", enabled = btn_tips_default_a, in_playlist = true}, 
  5870. } 
  5871.  
  5872. Pause_control_schemes_btn_tips = { 
  5873. 	a_button 	= 	{ label = "CONTROL_SELECT", 	enabled = btn_tips_default_a, }, 
  5874. 	b_button 	= 	{ label = "MENU_BACK", 			enabled = btn_tips_default_a, }, 
  5875. } 
  5876.  
  5877. Pause_menu_back_only = {  
  5878. 	b_button	=	{ label = "MENU_BACK",			enabled = btn_tips_default_a, }, 
  5879. } 
  5880.  
  5881. Pause_menu_quit_to_main_tips = { 
  5882. 	a_button 	= 	{ label = "CONTROL_SELECT", 	enabled = btn_tips_default_a, }, 
  5883. 	x_button 	= 	{ label = "COOP_WAIT_FOR_ANYONE", 	enabled = btn_tips_default_a, }, 
  5884. 	b_button 	= 	{ label = "QUIT_TO_MAIN_MENU", 	enabled = btn_tips_default_a, }, 
  5885. } 
  5886.  
  5887. Pause_menu_quit_to_main_tips_ps3 = { 
  5888. 	a_button 	= 	{ label = "CONTROL_SELECT", 	enabled = btn_tips_default_a, }, 
  5889. 	b_button 	= 	{ label = "QUIT_TO_MAIN_MENU", 	enabled = btn_tips_default_a, }, 
  5890. } 
  5891.  
  5892. Pause_menu_quit_to_main_only_tips = { 
  5893. 	b_button 	= 	{ label = "QUIT_TO_MAIN_MENU", 	enabled = btn_tips_default_a, }, 
  5894. } 
  5895.  
  5896. Pause_menu_friends_tips = { 
  5897. 	a_button 	= 	{ label = "CONTROL_SELECT", 					enabled = btn_tips_default_a, }, 
  5898. 	x_button 	= 	{ label = "MULTI_MENU_SHOW_GAMERCARD", 			enabled = btn_tips_default_a, }, 
  5899. 	b_button 	= 	{ label = "MENU_BACK", 						enabled = btn_tips_default_a, }, 
  5900. } 
  5901.  
  5902. Pause_menu_friends_tips_ps3 = { 
  5903. 	a_button 	= 	{ label = "CONTROL_SELECT", 					enabled = btn_tips_default_a, }, 
  5904. 	b_button 	= 	{ label = "MENU_BACK", 						enabled = btn_tips_default_a, }, 
  5905. } 
  5906.  
  5907.  
  5908. --Button tips for cellphone page 
  5909. Pause_cellphone_btn_tips = {  
  5910. 	a_button 	=	{ label = "CONTROL_SELECT",		enabled = btn_tips_default_a, }, 
  5911. 	b_button 	=	{ label = "CONTROL_RESUME",		enabled = btn_tips_default_a, }, 
  5912. } 
  5913.  
  5914. ---[ TEMP MENU while implementing shings ]--- 
  5915. Pause_menu_temp = { 
  5916. 	header_label_str = "NOT IMPLEMENTED", 
  5917. 	on_pause	= pause_menu_exit, 
  5918. 	on_map = pause_menu_swap, 
  5919. 	num_items = 1, 
  5920. 	 
  5921. 	[0] = { label = "Not implemented yet", type = MENU_ITEM_TYPE_SELECTABLE, }, 
  5922. } 
  5923.  
  5924. --[ Actual menus ]-- 
  5925.  
  5926. Pause_info_collection_sub_menu = { 
  5927. 	on_show  = pause_menu_build_info_menu, 
  5928. 	on_pause = pause_menu_exit, 
  5929. 	on_map 	 = pause_menu_swap, 
  5930. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  5931. } 
  5932.  
  5933. 	 
  5934. Pause_info_activities_menu = { 
  5935. 	num_items = 2, 
  5936. 	header_label_str = "INFO_ACTIVITIES", 
  5937. 	on_pause	= pause_menu_exit, 
  5938. 	on_map 		= pause_menu_swap, 
  5939.  
  5940. 	[0] = { label = "INFO_COLLECTIONS_HITMAN", 			type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_collection_sub_menu, id = 2 }, 
  5941. 	[1] = { label = "INFO_COLLECTIONS_CHOPSHOP", 		type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_collection_sub_menu, id = 4 }, 
  5942. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  5943. } 
  5944.  
  5945. Pause_info_collection_menu = { 
  5946. 	num_items = 6, 
  5947. 	header_label_str = "INFO_COLLECTION", 
  5948. 	on_pause	= pause_menu_exit, 
  5949. 	on_map = pause_menu_swap, 
  5950. 	on_show = pause_menu_build_collection_menu, 
  5951. 	get_width = pause_menu_diversions_get_width, 
  5952. 	on_post_show = pause_menu_diversions_post_show, 
  5953.  
  5954. 	[0] = { label = "INFO_COLLECTIONS_BARNSTORMING", 	type = PAUSE_MENU_CONTROL_STAT_TEXT_LINE, data_type = DIV_DATA_X_OF_Y, show_value = true},  
  5955. 	[1] = { label = "INFO_COLLECTIONS_CD_COLLECTION",	type = PAUSE_MENU_CONTROL_STAT_TEXT_LINE, data_type = DIV_DATA_X_OF_Y, show_value = true},  
  5956. 	[2] = { label = "INFO_COLLECTIONS_SECRET_AREAS",	type = PAUSE_MENU_CONTROL_STAT_TEXT_LINE, data_type = DIV_DATA_X_OF_Y, show_value = true},  
  5957. 	[3] = { label = "INFO_COLLECTIONS_STUNT_JUMPS",		type = PAUSE_MENU_CONTROL_STAT_TEXT_LINE, data_type = DIV_DATA_X_OF_Y, show_value = true},  
  5958. 	[4] = { label = "INFO_COLLECTIONS_TAGGING",			type = PAUSE_MENU_CONTROL_STAT_TEXT_LINE, data_type = DIV_DATA_X_OF_Y, show_value = true},  
  5959. 	 
  5960. 	btn_tips = Pause_menu_back_only, 
  5961. } 
  5962.  
  5963. Pause_info_diversions_stat_sub_menu = { 
  5964. 	on_show = pause_menu_build_info_menu, 
  5965. 	on_pause = pause_menu_exit, 
  5966. 	on_map = pause_menu_swap,  
  5967. 	get_width = pause_menu_diversions_get_width, 
  5968. 	 
  5969. 	btn_tips = Pause_menu_back_only, 
  5970. } 
  5971.  
  5972. Pause_info_diversions_stat_menu = { 
  5973. 	on_show = pause_menu_build_info_menu, 
  5974. 	on_pause = pause_menu_exit, 
  5975. 	on_map = pause_menu_swap, 
  5976. 	get_width = pause_menu_diversions_get_width, 
  5977. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  5978. } 
  5979.  
  5980. Pause_info_diversions_sub_menu = { 
  5981. 	on_show = pause_menu_build_info_menu, 
  5982. 	on_pause	= pause_menu_exit, 
  5983. 	on_map = pause_menu_swap, 
  5984. 	get_width = pause_menu_diversions_get_width, 
  5985. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  5986. } 
  5987.  
  5988. Pause_info_diversions_menu = { 
  5989. 	num_items = 4, 
  5990. 	header_label_str = "INFO_DIVERSIONS", 
  5991. 	on_pause	= pause_menu_exit, 
  5992. 	on_map = pause_menu_swap, 
  5993. 	 
  5994. 	[0] = { label = "INFO_DIVERSIONS_COLLECTION", 	type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_collection_menu, }, 
  5995. 	[1] = { label = "INFO_DIVERSIONS_JOBS", 		type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_diversions_sub_menu, id = 6	}, 
  5996. 	[2] = { label = "INFO_DIVERSIONS_STUNTS", 		type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_diversions_sub_menu, id = 6	}, 
  5997. 	[3] = { label = "INFO_DIVERSIONS_GAMES", 		type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_diversions_sub_menu, id = 6	}, 
  5998. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  5999. } 
  6000.  
  6001. Pause_info_help_sub_menu = { 
  6002. 	num_items = 0, 
  6003. 	on_show = pause_menu_build_info_menu, 
  6004. 	on_pause = pause_menu_exit, 
  6005. 	on_map = pause_menu_swap, 
  6006. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  6007. } 
  6008.  
  6009. Pause_info_help_topics_menu = { 
  6010. 	num_items = 0, 
  6011. 	on_show = pause_menu_build_info_menu, 
  6012. 	on_pause = pause_menu_exit, 
  6013. 	on_map = pause_menu_swap, 
  6014. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  6015. } 
  6016.  
  6017. Pause_info_help_menu = { 
  6018. 	num_items = 0, 
  6019. 	on_show = pause_menu_build_info_menu, 
  6020. 	on_pause = pause_menu_exit, 
  6021. 	on_map = pause_menu_swap, 
  6022. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  6023. } 
  6024.  
  6025. Pause_info_unlockables_sub_menu = { 
  6026. 	num_items = 0, 
  6027. 	on_show = pause_menu_build_info_menu, 
  6028. 	on_pause = pause_menu_exit, 
  6029. 	on_map = pause_menu_swap, 
  6030. 	on_post_show = pause_menu_finalize_stats, 
  6031. 	 
  6032. 	btn_tips = Pause_menu_back_only 
  6033. } 
  6034.  
  6035. Pause_info_unlockables_menu = { 
  6036. 	header_label_str = "INFO_UNLOCKABLES", 
  6037. 	num_items = 6, 
  6038. 	on_pause = pause_menu_exit, 
  6039. 	on_map = pause_menu_swap, 
  6040. 	 
  6041. 	[0] = { label = "INFO_UNLOCKABLES_PLAYER_ABILITIES", 	type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_unlockables_sub_menu, id = 10 }, 
  6042. 	[1] = { label = "INFO_UNLOCKABLES_WEAPONS", 				type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_unlockables_sub_menu, id = 10 }, 
  6043. 	[2] = { label = "INFO_UNLOCKABLES_VEHICLES", 			type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_unlockables_sub_menu, id = 10 }, 
  6044. 	[3] = { label = "INFO_UNLOCKABLES_DISCOUNTS", 			type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_unlockables_sub_menu, id = 10 }, 
  6045. 	[4] = { label = "INFO_UNLOCKABLES_HOMIES", 				type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_unlockables_sub_menu, id = 10 }, 
  6046. 	[5] = { label = "INFO_UNLOCKABLES_CUSTOMIZATION", 		type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_unlockables_sub_menu, id = 10 }, 
  6047. 	 
  6048. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  6049. } 
  6050.  
  6051. Pause_info_sub_menu_template = { 
  6052. 	num_items = 0, 
  6053. 	on_show = pause_menu_build_info_menu, 
  6054. 	on_pause	= pause_menu_exit, 
  6055. 	on_map = pause_menu_swap, 
  6056. 	multi_menu = true, 
  6057. 	 
  6058. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  6059. } 
  6060.  
  6061. Pause_info_sub_menu = { 
  6062. 	num_items = 0, 
  6063. 	on_show = pause_menu_build_info_menu, 
  6064. 	on_pause	= pause_menu_exit, 
  6065. 	on_map = pause_menu_swap, 
  6066. 	multi_menu = true, 
  6067. 	 
  6068. 	btn_tips = Pause_menu_accept_back_btn_tips 
  6069. } 
  6070.  
  6071. Pause_info_objective_lines = { 
  6072. -- start at 0 
  6073. 	num_lines = 0, 
  6074. 	current_line = 0, 
  6075. 	current_y = 0, 
  6076. 	total_y = 0, 
  6077. 	more_lines = false, 
  6078. } 
  6079.  
  6080. Pause_menu_objective_menu = { 
  6081. --	header_label_str = "PAUSE_MENU_CAT_RADIO",  
  6082. 	on_show			= pause_menu_objective_menu_show, 
  6083. --	on_back			= pause_menu_playlist_on_back, 
  6084. --	on_exit			= pause_menu_playlist_on_exit, 
  6085. --	on_post_show	= pause_menu_playlist_post_show, 
  6086. 	on_map = pause_menu_swap, 
  6087. 	on_pause 		= pause_menu_exit, 
  6088. 	on_release		= pause_menu_objective_menu_release, 
  6089. --	get_width 		= pause_menu_playlist_get_width, 
  6090. --	get_height 		= pause_menu_playlist_get_height, 
  6091. 	 
  6092. 	num_items 		= 1, 
  6093. 	header_height = 65, 
  6094. 	 
  6095. 	[0] = { label = "", type = PAUSE_MENU_CONTROL_OBJECTIVE_WRAP_LINE, on_select = pause_menu_playlist_on_select }, 
  6096. 	 
  6097. 	btn_tips = Pause_menu_back_only 
  6098. } 
  6099.  
  6100. Pause_info_menu = { 
  6101. 	num_items = 7, 
  6102. 	header_label_str = "PAUSEMENU_CAT_INFO", 
  6103. 	on_show = pause_menu_info_on_show, 
  6104. 	on_back = pause_menu_exit, 
  6105. 	on_pause	= pause_menu_exit, 
  6106. 	on_map = pause_menu_swap, 
  6107. 	 
  6108. 	[0] = { label = "INFO_OBJECTIVES",  on_select = pause_menu_info_select, type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Pause_menu_objective_menu		}, 
  6109. 	[1] = { label = "INFO_ACTIVITIES",	on_select = pause_menu_info_select, type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_info_activities_menu		}, 
  6110. 	[2] = { label = "INFO_DIVERSIONS",	on_select = pause_menu_info_select, type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Pause_info_diversions_menu		}, 
  6111. 	[3] = { label = "INFO_STATS",		on_select = pause_menu_info_select, type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Pause_info_sub_menu, id = 1		}, 
  6112. 	[4] = { label = "INFO_UNLOCKABLES",	on_select = pause_menu_info_select, type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Pause_info_unlockables_menu, 	},  
  6113. 	[5] = { label = "INFO_ACHIEVE",		on_select = pause_menu_info_select, type = MENU_ITEM_TYPE_SELECTABLE, on_select = pause_menu_do_achievements }, 
  6114. 	[6] = { label = "INFO_HELP",		on_select = pause_menu_info_select, type = MENU_ITEM_TYPE_SUB_MENU,	sub_menu = Pause_info_help_menu, id = 11	}, 
  6115. } 
  6116.  
  6117. Pause_save_menu = { 
  6118. 	on_show = pause_save_show, 
  6119. 	on_release = pause_save_release, 
  6120. 	on_post_show = pause_save_post_show, 
  6121. 	num_items = 0, 
  6122. 	on_back = pause_menu_save_load_exit, 
  6123. 	on_pause	= pause_menu_exit, 
  6124. 	on_map = pause_menu_swap, 
  6125. 	header_height = 150, 
  6126. 	header_width = 525, 
  6127. 	 
  6128. 	is_save_menu = true, 
  6129. 	 
  6130. 	btn_tips = Pause_save_load_btn_tips_PC, 
  6131. } 
  6132.  
  6133. Pause_load_menu = { 
  6134. 	on_show = pause_load_show, 
  6135. 	on_release = pause_load_release, 
  6136. 	on_post_show = pause_load_post_show, 
  6137. 	on_nav = pause_load_nav, 
  6138. 	on_back = pause_menu_save_load_exit, 
  6139. 	on_map = pause_menu_swap, 
  6140. 	num_items = 0, 
  6141. 	header_height = 198, 
  6142. 	header_width = 525, 
  6143. 	 
  6144. 	is_load_menu = true, 
  6145. 	 
  6146. 	btn_tips = Pause_save_load_btn_tips_PC, 
  6147. } 
  6148.  
  6149. Pause_save_load_menu = { 
  6150. 	num_items = 2, 
  6151. 	header_label_str = "PAUSEMENU_CAT_SAVELOAD", 
  6152. 	on_back = pause_menu_exit, 
  6153. 	on_pause	= pause_menu_exit, 
  6154. 	on_map = pause_menu_swap, 
  6155. 	 
  6156. 	[0] = { label = "SAVELOAD_SAVE_GAME", type = MENU_ITEM_TYPE_SELECTABLE, on_select = pause_save_menu_select },  
  6157. 	[1] = { label = "SAVELOAD_LOAD_GAME", type = MENU_ITEM_TYPE_SELECTABLE, on_select = pause_load_menu_select },  
  6158. } 
  6159.  
  6160. Pause_menu_control_sub_menu = { 
  6161. 	on_show 	= pause_menu_build_control_scheme_menu, 
  6162. 	on_pause	= pause_menu_options_exit_confirm, 
  6163. 	on_map 	 	= pause_menu_options_swap_confirm, 
  6164. 	on_back 	= pause_menu_control_scheme_on_back, 
  6165. 	on_release 	= pause_menu_exit_control_scheme, 
  6166. 	num_items 	= 1, 
  6167. 	 
  6168. 	[0] = { label = "CONTROL_SETUP_CHANGE_SCHEME", 		type = MENU_ITEM_TYPE_TEXT_SLIDER, on_select = pause_menu_control_update_scheme, text_slider_values = control_scheme_values, on_value_update = pause_menu_rebuild_control_scheme }, 
  6169.  
  6170. 	btn_tips = Pause_control_schemes_btn_tips, 
  6171. } 
  6172.  
  6173. Pause_menu_pad_control_sub_menu = { 
  6174. 	on_show 	= pause_menu_build_control_scheme_menu, 
  6175. 	on_pause	= pause_menu_options_exit_confirm, 
  6176. 	on_map 	 	= pause_menu_options_swap_confirm, 
  6177. 	on_back 	= pause_menu_control_scheme_on_back, 
  6178. 	on_release 	= pause_menu_exit_control_scheme, 
  6179. 	num_items 	= 1, 
  6180. 	 
  6181. 	[0] = { label = "CONTROL_SETUP_CHANGE_SCHEME", 		type = MENU_ITEM_TYPE_TEXT_SLIDER, on_select = pause_menu_control_update_scheme, text_slider_values = control_scheme_values, on_value_update = pause_menu_rebuild_control_scheme }, 
  6182.  
  6183. 	btn_tips = Pause_control_schemes_btn_tips, 
  6184. } 
  6185.  
  6186. function dummy_pc_func() 
  6187.  
  6188. end 
  6189.  
  6190. function pause_menu_build_control_scheme_menu_PC( menu_data ) 
  6191. 	for i = 0, Pause_menu_control_sub_menu_PC.num_items - 1 do 
  6192. 		if Pause_menu_control_sub_menu_PC[i].actid ~= nil then 
  6193. 			local action_key_text = pc_get_action_key_pure_text( Pause_menu_control_sub_menu_PC[i].actid ) 
  6194. 			Pause_menu_control_sub_menu_PC[i].info_text_str = action_key_text 
  6195. 		end 
  6196. 	end 
  6197. end 
  6198.  
  6199. function pause_menu_populate_pad_axes(axis_lx, axis_ly, axis_rx, axis_ry) 
  6200. 	pad_axis_lx_slider_values.cur_value = axis_lx; 
  6201. 	pad_axis_ly_slider_values.cur_value = axis_ly; 
  6202. 	pad_axis_rx_slider_values.cur_value = axis_rx; 
  6203. 	pad_axis_ry_slider_values.cur_value = axis_ry; 
  6204. end 
  6205.  
  6206. function pause_menu_build_pad_control_scheme_menu_PC( menu_data ) 
  6207. 	for i = 0, Pause_menu_pad_control_sub_menu_PC.num_items - 1 do 
  6208. 		if Pause_menu_pad_control_sub_menu_PC[i].actid ~= nil then 
  6209. 			local action_key_text = pc_get_action_pad_pure_text( Pause_menu_pad_control_sub_menu_PC[i].actid ) 
  6210. 			Pause_menu_pad_control_sub_menu_PC[i].info_text_str = action_key_text 
  6211. 		end 
  6212. 	end 
  6213. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_pad_axes", 0, PAUSE_MENU_PAD_AXES_POPULATE_ID) 
  6214. end 
  6215.  
  6216. function pause_menu_controls_restore_defaults_PC(menu_data) 
  6217. 	local options = { [0] = "PAUSE_MENU_ACCEPT", [1] = "CONTROL_CANCEL" } 
  6218. 	dialog_box_open("OPTIONS_MENU_DEFAULTS_TITLE", "OPTIONS_MENU_DEFAULTS_DESC", options, "pm_option_controls_defaults_PC", 0, DIALOG_PRIORITY_ACTION) 
  6219. end 
  6220.  
  6221. function pause_menu_pad_controls_restore_defaults_PC(menu_data) 
  6222. 	local options = { [0] = "PAUSE_MENU_ACCEPT", [1] = "CONTROL_CANCEL" } 
  6223. 	dialog_box_open("OPTIONS_MENU_DEFAULTS_TITLE", "OPTIONS_MENU_DEFAULTS_DESC", options, "pm_option_pad_controls_defaults_PC", 0, DIALOG_PRIORITY_ACTION) 
  6224. end 
  6225.  
  6226. function pm_option_controls_defaults_PC(result, action) 
  6227. 	if action ~= DIALOG_ACTION_CLOSE then 
  6228. 		return 
  6229. 	end 
  6230. 	 
  6231. 	if result == 0 then 
  6232. 		input_controls_restore_defaults_PC() 
  6233. 		for i = 0, Pause_menu_control_sub_menu_PC.num_items - 1 do 
  6234. 			local action_key_text = pc_get_action_key_pure_text( Pause_menu_control_sub_menu_PC[i].actid ) 
  6235. 			Pause_menu_control_sub_menu_PC[i].info_text_str = action_key_text 
  6236. 		end 
  6237. 		menu_update_labels() 
  6238. 		menu_update_nav_bar(Menu_active.highlighted_item) 
  6239. 	end	 
  6240. end 
  6241.  
  6242. function pm_option_pad_controls_defaults_PC(result, action) 
  6243. 	if action ~= DIALOG_ACTION_CLOSE then 
  6244. 		return 
  6245. 	end 
  6246. 	 
  6247. 	if result == 0 then 
  6248. 		input_pad_controls_restore_defaults_PC() 
  6249. 		for i = 0, Pause_menu_pad_control_sub_menu_PC.num_items - 1 do 
  6250. 			local action_key_text = pc_get_action_pad_pure_text( Pause_menu_pad_control_sub_menu_PC[i].actid ) 
  6251. 			Pause_menu_pad_control_sub_menu_PC[i].info_text_str = action_key_text 
  6252. 		end 
  6253. 		vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_pad_axes", 0, PAUSE_MENU_PAD_AXES_POPULATE_ID) 
  6254. 		menu_update_labels() 
  6255. 		menu_update_nav_bar(Menu_active.highlighted_item) 
  6256. 	end	 
  6257. end 
  6258.  
  6259. function pause_menu_pad_axis_update_value(menu_label, menu_data) 
  6260. 	local idx = menu_data.id 
  6261. 	pause_menu_update_option( PAUSE_MENU_PAD_CONTROL_ID, idx, false, menu_data.text_slider_values.cur_value ) 
  6262. end 
  6263.  
  6264. function pause_menu_exit_control_scheme_PC(menu_data) 
  6265.  
  6266. end 
  6267.  
  6268. function pause_menu_exit_pad_control_scheme_PC(menu_data) 
  6269.  
  6270. end 
  6271.  
  6272. pause_control_key_refresh_item_PC = {} 
  6273.  
  6274. function pause_control_key_change_PC(menu_label, menu_data) 
  6275. 	pc_capture_input_key( menu_data.actid ) 
  6276. 	vint_dataresponder_request( "pause_control_key_change_PC_data_responder", "dummy_pc_func", 0, "save_files") 
  6277. 	local action_changed = pc_capture_input_key_get_result() 
  6278. 	if action_changed >= 0 then 
  6279. 		-- have to refresh all items 
  6280. 		for i = 0, Pause_menu_control_sub_menu_PC.num_items - 1 do 
  6281. 			local action_key_text = pc_get_action_key_pure_text( Pause_menu_control_sub_menu_PC[i].actid ) 
  6282. 			Pause_menu_control_sub_menu_PC[i].info_text_str = action_key_text 
  6283. 		end 
  6284. 		menu_update_labels() 
  6285. 		menu_update_nav_bar(Menu_active.highlighted_item) 
  6286. 	end 
  6287. end 
  6288.  
  6289. function pause_control_pad_button_change_PC(menu_label, menu_data) 
  6290. 	pc_capture_input_pad( menu_data.actid ) 
  6291. 	vint_dataresponder_request( "pause_control_pad_button_change_PC_data_responder", "dummy_pc_func", 0, "save_files") 
  6292. 	local action_changed = pc_capture_input_pad_get_result() 
  6293. 	if action_changed >= 0 then 
  6294. 		-- have to refresh all items 
  6295. 		for i = 0, Pause_menu_pad_control_sub_menu_PC.num_items - 1 do 
  6296. 			local action_key_text = pc_get_action_pad_pure_text( Pause_menu_pad_control_sub_menu_PC[i].actid ) 
  6297. 			Pause_menu_pad_control_sub_menu_PC[i].info_text_str = action_key_text 
  6298. 		end 
  6299. 		menu_update_labels() 
  6300. 		menu_update_nav_bar(Menu_active.highlighted_item) 
  6301. 	end 
  6302. end 
  6303.  
  6304. function pause_control_key_refresh_item_PC() 
  6305. --	pc_capture_input_key( 101 ) 
  6306. end 
  6307.  
  6308. PC_BTN_MOVE_UP = 0 
  6309. PC_BTN_MOVE_DOWN = 1 
  6310. PC_BTN_MOVE_LEFT = 2 
  6311. PC_BTN_MOVE_RIGHT = 3 
  6312. PC_BTN_ACTION = 4 
  6313. PC_BTN_JUMP = 5 
  6314. PC_BTN_RADIAL = 6 
  6315. PC_BTN_BREAK = 7 
  6316. PC_DPAD_RIGHT = 8 
  6317. PC_DPAD_UP = 9 
  6318. PC_DPAD_LEFT = 10 
  6319. PC_DPAD_DOWN = 11 
  6320. PC_BTN_START = 12 
  6321. PC_BTN_BACK = 13 
  6322. PC_BTN_RELOAD = 14 
  6323. PC_BTN_CROUCH = 15 
  6324. PC_BTN_FINE_AIM = 16 
  6325. PC_BTN_GRAB_HUMAN = 17 
  6326. PC_BTN_SPRINT = 18 
  6327. PC_BTN_BLOCK = 19 
  6328. PC_BTN_MAP = 20 
  6329. PC_BTN_PAUSE = 21 
  6330. PC_BTN_HORN = 26 
  6331. PC_BTN_CRUISE = 27 
  6332. PC_BTN_RESET_CAMERA = 28 
  6333. PC_BTN_RADIO_PREV = 29 
  6334. PC_BTN_RADIO_NEXT = 30 
  6335. PC_BTN_LOOK_RIGHT = 31 
  6336. PC_BTN_LOOK_LEFT = 32 
  6337. PC_WPN_SWITCH_UP = 33 
  6338. PC_WPN_SWITCH_DOWN = 34 
  6339. PC_BTN_ATTACK = 35 
  6340. PC_BTN_ATTACK2 = 36 
  6341. PC_BTN_ACCELERATE = 37 
  6342. PC_BTN_REVERSE = 38 
  6343. PC_BTN_SELECT_WEAPON_1 = 39 
  6344. PC_BTN_SELECT_WEAPON_2 = 40 
  6345. PC_BTN_SELECT_WEAPON_3 = 41 
  6346. PC_BTN_SELECT_WEAPON_4 = 42 
  6347. PC_BTN_SELECT_WEAPON_5 = 43 
  6348. PC_BTN_SELECT_WEAPON_6 = 44 
  6349. PC_BTN_SELECT_WEAPON_7 = 45 
  6350. PC_BTN_SELECT_WEAPON_8 = 46 
  6351. PC_BTN_HELI_TURN_LEFT = 47 
  6352. PC_BTN_HELI_TURN_RIGHT = 48 
  6353. PC_BTN_VEHICLE_LOOK_BEHIND = 49 
  6354. PC_BTN_AIR_ACCELERATE = 50 
  6355. PC_BTN_AIR_DECELERATE = 51 
  6356. PC_BTN_RECRUIT = 52 
  6357. PC_BTN_CANCEL = 53 
  6358. PC_BTN_TAUNT = 54 
  6359. PC_BTN_COMPLIMENT = 55 
  6360. PC_BTN_HYDRAULICS = 56 
  6361. PC_BTN_NITRO = 57 
  6362. PC_BTN_FIGHT_CLUB_MASH_1 = 58 
  6363. PC_BTN_FIGHT_CLUB_MASH_2 = 59 
  6364. PC_BTN_FIGHT_CLUB_MASH_3 = 60 
  6365. PC_BTN_FIGHT_CLUB_MASH_4 = 61 
  6366. PC_BTN_PAD_MENU_SELECT = 62 
  6367. PC_BTN_WALK = 63 
  6368. PC_BTN_MOTO_PITCH_UP = 64 
  6369. PC_BTN_MOTO_PITCH_DOWN = 65 
  6370. PC_BTN_ZOOM_IN = 66 
  6371. PC_BTN_ZOOM_OUT = 67 
  6372. PC_BTN_MENU_SCROLL_LEFT = 68 
  6373. PC_BTN_MENU_SCROLL_RIGHT = 69 
  6374. PC_BTN_MENU_DPAD_UP = 70 
  6375. PC_BTN_MENU_DPAD_DOWN = 71 
  6376. PC_BTN_MENU_DPAD_LEFT = 72 
  6377. PC_BTN_MENU_DPAD_RIGHT = 73 
  6378. PC_BTN_MENU_ALT_SELECT = 74 
  6379. PC_BTN_X = 75 
  6380. PC_BTN_PAD_BACK = 76 
  6381. PC_PAD_DPAD_RIGHT = 77 
  6382. PC_PAD_DPAD_UP = 78 
  6383. PC_PAD_DPAD_LEFT = 79 
  6384. PC_PAD_DPAD_DOWN = 80 
  6385. PC_BTN_PAD_START = 81 
  6386. PC_BTN_PAD_LS_PRESS = 82 
  6387. PC_BTN_PAD_RS_PRESS = 83 
  6388. PC_BTN_CHAT_ALL = 84 
  6389. PC_BTN_CHAT_TEAM = 85 
  6390. 	 
  6391. Pause_menu_control_sub_menu_PC = { 
  6392. 	header_label_str = "CONTROLS_SETUP", 
  6393. 	on_show = pause_menu_build_control_scheme_menu_PC, 
  6394. 	on_alt_select = pause_menu_controls_restore_defaults_PC, 
  6395. 	on_pause	= pause_menu_exit, 
  6396. 	on_map = pause_menu_swap, 
  6397. 	on_exit = pause_menu_exit_control_scheme_PC, 
  6398. 	num_items = 54, 
  6399. 	btn_tips = Pause_options_btn_tips,	 
  6400.  
  6401. 	[0] = { label = "GENERAL_CONTROLS", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true, dimm_disabled = true }, 
  6402.  
  6403. 	[1] = { label = "PCACTION_ACTION", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "E", actid = PC_BTN_ACTION, on_select = pause_control_key_change_PC }, 
  6404. 	[2] = { label = "PCACTION_ATTACK_PRIMARY", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "LMB", actid = PC_BTN_ATTACK, on_select = pause_control_key_change_PC }, 
  6405. 	[3] = { label = "PCACTION_ATTACK_SECONDARY", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "RMB", actid = PC_BTN_ATTACK2, on_select = pause_control_key_change_PC }, 
  6406. 	[4] = { label = "PCACTION_RECRUIT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "AU", actid = PC_BTN_RECRUIT, on_select = pause_control_key_change_PC }, 
  6407. 	[5] = { label = "PCACTION_DISMISS_CANCEL", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "AU", actid = PC_BTN_CANCEL, on_select = pause_control_key_change_PC }, 
  6408. 	[6] = { label = "PCACTION_RADIAL_MENU", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Q", actid = PC_BTN_RADIAL, on_select = pause_control_key_change_PC }, 
  6409. 	[7] = { label = "PCACTION_WEAPON_1", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "1", actid = PC_BTN_SELECT_WEAPON_1, on_select = pause_control_key_change_PC }, 
  6410. 	[8] = { label = "PCACTION_WEAPON_2", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "2", actid = PC_BTN_SELECT_WEAPON_2, on_select = pause_control_key_change_PC }, 
  6411. 	[9] = { label = "PCACTION_WEAPON_3", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "3", actid = PC_BTN_SELECT_WEAPON_3, on_select = pause_control_key_change_PC }, 
  6412. 	[10] = { label = "PCACTION_WEAPON_4", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "4", actid = PC_BTN_SELECT_WEAPON_4, on_select = pause_control_key_change_PC }, 
  6413. 	[11] = { label = "PCACTION_WEAPON_5", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "5", actid = PC_BTN_SELECT_WEAPON_5, on_select = pause_control_key_change_PC }, 
  6414. 	[12] = { label = "PCACTION_WEAPON_6", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "6", actid = PC_BTN_SELECT_WEAPON_6, on_select = pause_control_key_change_PC }, 
  6415. 	[13] = { label = "PCACTION_WEAPON_7", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "7", actid = PC_BTN_SELECT_WEAPON_7, on_select = pause_control_key_change_PC }, 
  6416. 	[14] = { label = "PCACTION_WEAPON_8", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "8", actid = PC_BTN_SELECT_WEAPON_8, on_select = pause_control_key_change_PC }, 
  6417. 	[15] = { label = "PCACTION_CHAT_ALL", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Y", actid = PC_BTN_CHAT_ALL, on_select = pause_control_key_change_PC }, 
  6418. 	[16] = { label = "PCACTION_CHAT_TEAM", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "T", actid = PC_BTN_CHAT_TEAM, on_select = pause_control_key_change_PC }, 
  6419.  
  6420. 	[17] = { label = " ", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true }, 
  6421. 	[18] = { label = "ON_FOOT_CONTROLS", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true, dimm_disabled = true }, 
  6422. 	 
  6423. 	[19] = { label = "PCACTION_FORWARD", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "W", actid = PC_BTN_MOVE_UP, on_select = pause_control_key_change_PC },  
  6424. 	[20] = { label = "PCACTION_BACKWARD", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "S", actid = PC_BTN_MOVE_DOWN, on_select = pause_control_key_change_PC}, 
  6425. 	[21] = { label = "PCACTION_STRAFE_LEFT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "A", actid = PC_BTN_MOVE_LEFT, on_select = pause_control_key_change_PC}, 
  6426. 	[22] = { label = "PCACTION_STRAFE_RIGHT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "D", actid = PC_BTN_MOVE_RIGHT, on_select = pause_control_key_change_PC}, 
  6427. 	[23] = { label = "PCACTION_JUMP", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "SPACEBAR", actid = PC_BTN_JUMP, on_select = pause_control_key_change_PC }, 
  6428. 	[24] = { label = "PCACTION_SPRINT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "LSHIFT", actid = PC_BTN_SPRINT, on_select = pause_control_key_change_PC }, 
  6429. 	[25] = { label = "PCACTION_WALK", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "CAPSLOCK", actid = PC_BTN_WALK, on_select = pause_control_key_change_PC }, 
  6430. 	[26] = { label = "PCACTION_RELOAD", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "R", actid = PC_BTN_RELOAD, on_select = pause_control_key_change_PC }, 
  6431. 	[27] = { label = "PCACTION_CROUCH", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "C", actid = PC_BTN_CROUCH, on_select = pause_control_key_change_PC }, 
  6432. 	[28] = { label = "PCACTION_FINE_AIM", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "V", actid = PC_BTN_FINE_AIM, on_select = pause_control_key_change_PC }, 
  6433. 	[29] = { label = "PCACTION_GRAB_HUMAN", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "LCTRL", actid = PC_BTN_GRAB_HUMAN, on_select = pause_control_key_change_PC }, 
  6434. 	[30] = { label = "PCACTION_TAUNT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "AU", actid = PC_BTN_TAUNT, on_select = pause_control_key_change_PC }, 
  6435. 	[31] = { label = "PCACTION_COMPLIMENT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "AU", actid = PC_BTN_COMPLIMENT, on_select = pause_control_key_change_PC },  
  6436. 	[32] = { label = "PCACTION_ZOOM_IN", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "H", actid = PC_BTN_ZOOM_IN, on_select = pause_control_key_change_PC }, 
  6437. 	[33] = { label = "PCACTION_ZOOM_OUT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "N", actid = PC_BTN_ZOOM_OUT, on_select = pause_control_key_change_PC }, 
  6438.  
  6439. 	[34] =  { label = " ", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true }, 
  6440. 	[35] =  { label = "VEHICLE_CONTROLS", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true, dimm_disabled = true }, 
  6441.  
  6442. 	[36] = { label = "PCACTION_ACCELERATE", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "W", actid = PC_BTN_ACCELERATE, on_select = pause_control_key_change_PC }, 
  6443. 	[37] = { label = "PCACTION_REVERSE", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "S", actid = PC_BTN_REVERSE, on_select = pause_control_key_change_PC }, 
  6444. 	[38] = { label = "PCACTION_BREAK", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "SPACEBAR", actid = PC_BTN_BREAK, on_select = pause_control_key_change_PC }, 
  6445. 	[39] = { label = "PCACTION_CRUISE_CONTROL", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "SPACEBAR", actid = PC_BTN_CRUISE, on_select = pause_control_key_change_PC }, 
  6446. 	[40] = { label = "PCACTION_HORN", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "H", actid = PC_BTN_HORN, on_select = pause_control_key_change_PC }, 
  6447. 	[41] = { label = "PCACTION_RADIO_NEXT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "RIGHT", actid = PC_BTN_RADIO_NEXT, on_select = pause_control_key_change_PC }, 
  6448. 	[42] = { label = "PCACTION_RADIO_PREVIOUS", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "LEFT", actid = PC_BTN_RADIO_PREV, on_select = pause_control_key_change_PC }, 
  6449. 	[43] = { label = "PCACTION_LOOK_BEHIND", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "X", actid = PC_BTN_VEHICLE_LOOK_BEHIND, on_select = pause_control_key_change_PC }, 
  6450. 	[44] = { label = "PCACTION_HYDRAULICS", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "P", actid = PC_BTN_HYDRAULICS, on_select = pause_control_key_change_PC }, 
  6451. 	[45] = { label = "PCACTION_NITRO", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "X", actid = PC_BTN_NITRO, on_select = pause_control_key_change_PC }, 
  6452. 	[46] = { label = "PCACTION_LEAN_FORWARD", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "R", actid = PC_BTN_MOTO_PITCH_DOWN, on_select = pause_control_key_change_PC }, 
  6453. 	[47] = { label = "PCACTION_LEAN_BACK", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "F", actid = PC_BTN_MOTO_PITCH_UP, on_select = pause_control_key_change_PC }, 
  6454.  
  6455. 	[48] =  { label = " ", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true }, 
  6456. 	[49] = { label = "AIRCRAFT_CONTROLS", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true, dimm_disabled = true }, 
  6457.  
  6458. 	[50] = { label = "PCACTION_AIR_ACCELERATE", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "W", actid = PC_BTN_AIR_ACCELERATE, on_select = pause_control_key_change_PC }, 
  6459. 	[51] = { label = "PCACTION_AIR_DECELERATE", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "S", actid = PC_BTN_AIR_DECELERATE, on_select = pause_control_key_change_PC }, 
  6460. 	[52] = { label = "PCACTION_RUDDER_LEFT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Z", actid = PC_BTN_HELI_TURN_LEFT, on_select = pause_control_key_change_PC }, 
  6461. 	[53] = { label = "PCACTION_RUDDER_RIGHT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "C", actid = PC_BTN_HELI_TURN_RIGHT, on_select = pause_control_key_change_PC } 
  6462. } 
  6463.  
  6464. Pause_menu_pad_control_sub_menu_PC = { 
  6465. 	header_label_str = "PAD_CONTROLS_SETUP", 
  6466. 	on_show		= pause_menu_build_pad_control_scheme_menu_PC, 
  6467. 	on_alt_select 	= pause_menu_pad_controls_restore_defaults_PC, 
  6468. 	on_pause	= pause_menu_exit, 
  6469. 	on_map 		= pause_menu_swap, 
  6470. 	on_exit = pause_menu_exit_pad_control_scheme_PC, 
  6471. 	num_items = 55, 
  6472. 	btn_tips = Pause_options_btn_tips, 
  6473.  
  6474. 	[0] = { label = "PC_PAD_AXES", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true, dimm_disabled = true }, 
  6475.  
  6476. 	[1] = { label = "PC_PAD_LEFT_AXIS_X", type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values = pad_axis_lx_slider_values, on_value_update = pause_menu_pad_axis_update_value, id = 0 }, 
  6477. 	[2] = { label = "PC_PAD_LEFT_AXIS_Y", type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values = pad_axis_ly_slider_values, on_value_update = pause_menu_pad_axis_update_value, id = 1 }, 
  6478. 	[3] = { label = "PC_PAD_RIGHT_AXIS_X", type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values = pad_axis_rx_slider_values, on_value_update = pause_menu_pad_axis_update_value, id = 2 }, 
  6479. 	[4] = { label = "PC_PAD_RIGHT _AXIS_Y", type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values = pad_axis_ry_slider_values, on_value_update = pause_menu_pad_axis_update_value, id = 3 }, 
  6480.  
  6481. 	[5] =  { label = " ", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true }, 
  6482. 	[6] = { label = "GENERAL_CONTROLS", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true, dimm_disabled = true }, 
  6483.  
  6484. 	[7] = { label = "PCACTION_ACTION", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "E", actid = PC_BTN_ACTION, on_select = pause_control_pad_button_change_PC }, 
  6485. 	[8] = { label = "PCACTION_ATTACK_PRIMARY", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "LMB", actid = PC_BTN_ATTACK, on_select = pause_control_pad_button_change_PC }, 
  6486. 	[9] = { label = "PCACTION_ATTACK_SECONDARY", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "RMB", actid = PC_BTN_ATTACK2, on_select = pause_control_pad_button_change_PC }, 
  6487. 	[10] = { label = "PCACTION_RECRUIT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "AU", actid = PC_BTN_RECRUIT, on_select = pause_control_pad_button_change_PC }, 
  6488. 	[11] = { label = "PCACTION_DISMISS_CANCEL", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "AU", actid = PC_BTN_CANCEL, on_select = pause_control_pad_button_change_PC }, 
  6489. 	[12] = { label = "PCACTION_MAP", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "TAB", actid = PC_BTN_MAP, on_select = pause_control_pad_button_change_PC }, 
  6490. 	[13] = { label = "PCACTION_PAUSE", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "ESC", actid = PC_BTN_PAUSE, on_select = pause_control_pad_button_change_PC }, 
  6491. 	[14] = { label = "PCACTION_START", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "ESC", actid = PC_BTN_PAD_START, on_select = pause_control_pad_button_change_PC }, 
  6492. 	[15] = { label = "PCACTION_RADIAL_MENU", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Q", actid = PC_BTN_RADIAL, on_select = pause_control_pad_button_change_PC }, 
  6493. 	[16] = { label = "PCACTION_MENU_SELECT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Q", actid = PC_BTN_PAD_MENU_SELECT, on_select = pause_control_pad_button_change_PC }, 
  6494. 	[17] = { label = "PCACTION_MENU_ALT_SELECT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Q", actid = PC_BTN_MENU_ALT_SELECT, on_select = pause_control_pad_button_change_PC }, 
  6495. 	[18] = { label = "PCACTION_MENU_BACK", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Q", actid = PC_BTN_PAD_BACK, on_select = pause_control_pad_button_change_PC }, 
  6496. 	[19] = { label = "PCACTION_MENU_SCROLL_LEFT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Q", actid = PC_BTN_MENU_SCROLL_LEFT, on_select = pause_control_pad_button_change_PC }, 
  6497. 	[20] = { label = "PCACTION_MENU_SCROLL_RIGHT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Q", actid = PC_BTN_MENU_SCROLL_RIGHT, on_select = pause_control_pad_button_change_PC }, 
  6498.  
  6499. 	[21] =  { label = " ", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true }, 
  6500. 	[22] = { label = "ON_FOOT_CONTROLS", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true, dimm_disabled = true }, 
  6501. 	 
  6502. 	[23] = { label = "PCACTION_JUMP", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "SPACEBAR", actid = PC_BTN_JUMP, on_select = pause_control_pad_button_change_PC }, 
  6503. 	[24] = { label = "PCACTION_SPRINT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "LSHIFT", actid = PC_BTN_SPRINT, on_select = pause_control_pad_button_change_PC }, 
  6504. 	[25] = { label = "PCACTION_RELOAD", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "R", actid = PC_BTN_RELOAD, on_select = pause_control_pad_button_change_PC }, 
  6505. 	[26] = { label = "PCACTION_CROUCH", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "C", actid = PC_BTN_CROUCH, on_select = pause_control_pad_button_change_PC }, 
  6506. 	[27] = { label = "PCACTION_FINE_AIM", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "V", actid = PC_BTN_FINE_AIM, on_select = pause_control_pad_button_change_PC }, 
  6507. 	[28] = { label = "PCACTION_GRAB_HUMAN", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "LCTRL", actid = PC_BTN_GRAB_HUMAN, on_select = pause_control_pad_button_change_PC }, 
  6508. 	[29] = { label = "PCACTION_TAUNT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "AU", actid = PC_BTN_TAUNT, on_select = pause_control_pad_button_change_PC }, 
  6509. 	[30] = { label = "PCACTION_COMPLIMENT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "AU", actid = PC_BTN_COMPLIMENT, on_select = pause_control_pad_button_change_PC },  
  6510. 	[31] = { label = "PCACTION_ZOOM_IN", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "H", actid = PC_BTN_ZOOM_IN, on_select = pause_control_pad_button_change_PC }, 
  6511. 	[32] = { label = "PCACTION_ZOOM_OUT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "N", actid = PC_BTN_ZOOM_OUT, on_select = pause_control_pad_button_change_PC }, 
  6512.  
  6513. 	[33] = { label = "PCACTION_FIGHT_CLUB_1", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "AU", actid = PC_BTN_FIGHT_CLUB_MASH_1, on_select = pause_control_pad_button_change_PC }, 
  6514. 	[34] = { label = "PCACTION_FIGHT_CLUB_2", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "AU", actid = PC_BTN_FIGHT_CLUB_MASH_2, on_select = pause_control_pad_button_change_PC },  
  6515. 	[35] = { label = "PCACTION_FIGHT_CLUB/AMBULANCE_L", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "H", actid = PC_BTN_FIGHT_CLUB_MASH_3, on_select = pause_control_pad_button_change_PC }, 
  6516. 	[36] = { label = "PCACTION_FIGHT_CLUB/AMBULANCE_R", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "N", actid = PC_BTN_FIGHT_CLUB_MASH_4, on_select = pause_control_pad_button_change_PC }, 
  6517.  
  6518. 	[37] =  { label = " ", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true }, 
  6519. 	[38] = { label = "VEHICLE_CONTROLS", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true, dimm_disabled = true }, 
  6520.  
  6521. 	[39] = { label = "PCACTION_ACCELERATE", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "W", actid = PC_BTN_ACCELERATE, on_select = pause_control_pad_button_change_PC }, 
  6522. 	[40] = { label = "PCACTION_REVERSE", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "S", actid = PC_BTN_REVERSE, on_select = pause_control_pad_button_change_PC }, 
  6523. 	[41] = { label = "PCACTION_BREAK", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "SPACEBAR", actid = PC_BTN_BREAK, on_select = pause_control_pad_button_change_PC }, 
  6524. 	[42] = { label = "PCACTION_CRUISE_CONTROL", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "SPACEBAR", actid = PC_BTN_CRUISE, on_select = pause_control_pad_button_change_PC }, 
  6525. 	[43] = { label = "PCACTION_HORN", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "H", actid = PC_BTN_HORN, on_select = pause_control_pad_button_change_PC }, 
  6526. 	[44] = { label = "PCACTION_RADIO_NEXT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "RIGHT", actid = PC_BTN_RADIO_NEXT, on_select = pause_control_pad_button_change_PC }, 
  6527. 	[45] = { label = "PCACTION_RADIO_PREVIOUS", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "LEFT", actid = PC_BTN_RADIO_PREV, on_select = pause_control_pad_button_change_PC }, 
  6528. 	[46] = { label = "PCACTION_LOOK_BEHIND", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "X", actid = PC_BTN_VEHICLE_LOOK_BEHIND, on_select = pause_control_pad_button_change_PC }, 
  6529. 	[47] = { label = "PCACTION_HYDRAULICS", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "P", actid = PC_BTN_HYDRAULICS, on_select = pause_control_pad_button_change_PC }, 
  6530. 	[48] = { label = "PCACTION_NITRO", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "X", actid = PC_BTN_NITRO, on_select = pause_control_pad_button_change_PC }, 
  6531.  
  6532. 	[49] =  { label = " ", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true }, 
  6533. 	[50] = { label = "AIRCRAFT_CONTROLS", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil, disabled = true, it_is_caption_label = true, dimm_disabled = true }, 
  6534.  
  6535. 	[51] = { label = "PCACTION_AIR_ACCELERATE", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "W", actid = PC_BTN_AIR_ACCELERATE, on_select = pause_control_pad_button_change_PC }, 
  6536. 	[52] = { label = "PCACTION_AIR_DECELERATE", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "S", actid = PC_BTN_AIR_DECELERATE, on_select = pause_control_pad_button_change_PC }, 
  6537. 	[53] = { label = "PCACTION_RUDDER_LEFT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "Z", actid = PC_BTN_HELI_TURN_LEFT, on_select = pause_control_pad_button_change_PC }, 
  6538. 	[54] = { label = "PCACTION_RUDDER_RIGHT", type = MENU_ITEM_TYPE_INFO_BOX, info_text_str = "C", actid = PC_BTN_HELI_TURN_RIGHT, on_select = pause_control_pad_button_change_PC } 
  6539. } 
  6540.  
  6541. Pause_control_menu = { 
  6542. 	header_label_str 	= "MENU_OPTIONS_CONTROLS", 
  6543. 	on_show 			= pause_menu_build_control_options_menu, 
  6544. 	on_alt_select 		= pause_menu_options_restore_defaults, 
  6545. 	on_back 			= pause_menu_option_revert, 
  6546. 	on_pause			= pause_menu_options_exit_confirm, 
  6547. 	on_map 				= pause_menu_options_swap_confirm, 
  6548. 	on_nav				= pause_menu_control_options_nav,  
  6549. 	on_horz_show 		= pause_menu_option_accept_horz, 
  6550. 	num_items 			= 9, 
  6551.  
  6552. 	[0] = { label = "CONTROLS_SETUP_FOOT_SCHEMES", 		type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_menu_control_sub_menu, id = 0 }, 
  6553. 	[1] = { label = "CONTROLS_SETUP_DRIVING_SCHEMES", 	type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_menu_control_sub_menu, id = 0 }, 
  6554. 	[2] = { label = "MENU_CONTROLS_INVERT_Y", 			type = MENU_ITEM_TYPE_TEXT_SLIDER, 	text_slider_values = invert_y_slider_values, 	on_value_update = pause_menu_control_options_update_value, id = 0, on_select = pause_menu_option_accept, }, 
  6555. 	[3] = { label = "MENU_CONTROLS_INVERT_ROTATION", 	type = MENU_ITEM_TYPE_TEXT_SLIDER, 	text_slider_values = invert_rot_slider_values,	on_value_update = pause_menu_control_options_update_value, id = 1, on_select = pause_menu_option_accept, }, 
  6556. 	[4] = { label = "MENU_CONTROLS_STICK", 				type = MENU_ITEM_TYPE_TEXT_SLIDER, 	text_slider_values = left_stick_slider_values,	on_value_update = pause_menu_control_options_update_value, id = 2, on_select = pause_menu_option_accept, }, 
  6557. 	[5] = { label = "CONTROLS_SENSE_V",		 			type = MENU_ITEM_TYPE_NUM_SLIDER,	thumb_width = 70, cur_value = 0, 				on_value_update = pause_menu_control_options_update_value, id = 3, on_select = pause_menu_option_accept, }, 
  6558. 	[6] = { label = "CONTROLS_SENSE_H",				 	type = MENU_ITEM_TYPE_NUM_SLIDER,	thumb_width = 70, cur_value = 0, 				on_value_update = pause_menu_control_options_update_value, id = 4, on_select = pause_menu_option_accept, }, 
  6559. 	[7] = { label = "CONTROLS_FORCE_FEED", 				type = MENU_ITEM_TYPE_TEXT_SLIDER, 	text_slider_values = vibration_slider_values,	on_value_update = pause_menu_control_options_update_value, id = 5, on_select = pause_menu_option_accept, }, 
  6560. 	[8] = { label = "CONTROLS_CROUCH_TOGGLE", 			type = MENU_ITEM_TYPE_TEXT_SLIDER, 	text_slider_values = crouch_slider_values,		on_value_update = pause_menu_control_options_update_value, id = 6, on_select = pause_menu_option_accept, }, 
  6561.  
  6562. 	btn_tips = Pause_options_btn_tips,	 
  6563. } 
  6564.  
  6565. Pause_control_menu_PC = { 
  6566. 	header_label_str	= "MENU_OPTIONS_CONTROLS", 
  6567. 	on_show				= pause_menu_build_control_options_menu, 
  6568. 	on_back 			= pause_menu_option_revert, 
  6569. 	on_alt_select		= pause_menu_options_restore_defaults, 
  6570. 	on_map 				= pause_menu_options_swap_confirm, 
  6571. 	on_pause			= pause_menu_options_exit_confirm, 
  6572. 	num_items = 11, 
  6573. 	 
  6574. 	[0] = { label = "CONTROLS_SETUP", 		        	type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_menu_control_sub_menu_PC, id = -1 }, 
  6575. 	[1] = { label = "PAD_CONTROLS_SETUP",				type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_menu_pad_control_sub_menu_PC, id = -1 }, 
  6576. 	[2] = { label = "MENU_CONTROLS_INVERT_Y", 			type = MENU_ITEM_TYPE_TEXT_SLIDER, 	text_slider_values = invert_y_slider_values, 	on_value_update = pause_menu_control_options_update_value, id = 0, on_select = pause_menu_option_accept, }, 
  6577. 	[3] = { label = "MENU_CONTROLS_INVERT_ROTATION", 		type = MENU_ITEM_TYPE_TEXT_SLIDER, 	text_slider_values = invert_rot_slider_values,	on_value_update = pause_menu_control_options_update_value, id = 1, on_select = pause_menu_option_accept, }, 
  6578. --uwaga! jak sie zmienia numeracje tu to trzeba poprawic w funkcji pause_menu_populate_control_options 
  6579. 	[4] = { label = "CONTROLS_MOUSE_SENS_V",		 	type = MENU_ITEM_TYPE_NUM_SLIDER,	thumb_width = 70, cur_value = 0, on_value_update = pause_menu_control_options_update_value, id = 7, on_select = pause_menu_option_accept, }, 
  6580. 	[5] = { label = "CONTROLS_MOUSE_SENSE_H",			type = MENU_ITEM_TYPE_NUM_SLIDER,	thumb_width = 70, cur_value = 0, on_value_update = pause_menu_control_options_update_value, id = 8, on_select = pause_menu_option_accept, }, 
  6581. 	[6] = { label = "CONTROLS_SENSE_V",		 		type = MENU_ITEM_TYPE_NUM_SLIDER,	thumb_width = 70, cur_value = 0, on_value_update = pause_menu_control_options_update_value, id = 3, on_select = pause_menu_option_accept, }, 
  6582. 	[7] = { label = "CONTROLS_SENSE_H",				type = MENU_ITEM_TYPE_NUM_SLIDER,	thumb_width = 70, cur_value = 0, on_value_update = pause_menu_control_options_update_value, id = 4, on_select = pause_menu_option_accept, }, 
  6583. 	[8] = { label = "MENU_CONTROLS_STICK", 				type = MENU_ITEM_TYPE_TEXT_SLIDER, 	text_slider_values = left_stick_slider_values,	on_value_update = pause_menu_control_options_update_value, id = 2, on_select = pause_menu_option_accept, }, 
  6584. 	[9] = { label = "CONTROLS_CROUCH_TOGGLE", 			type = MENU_ITEM_TYPE_TEXT_SLIDER, 	text_slider_values = crouch_slider_values,		on_value_update = pause_menu_control_options_update_value, id = 6, on_select = pause_menu_option_accept, }, 
  6585. 	[10] = { label = "CONTROLS_FORCE_FEED", 			type = MENU_ITEM_TYPE_TEXT_SLIDER, 	text_slider_values = vibration_slider_values,	on_value_update = pause_menu_control_options_update_value, id = 5, on_select = pause_menu_option_accept, }, 
  6586.  
  6587. 	btn_tips = Pause_options_btn_tips,	 
  6588. } 
  6589.  
  6590.  
  6591. Pause_difficulty_menu = { 
  6592. 	num_items = 3, 
  6593. 	header_label_str = "MULTI_MENU_QUICK_MATCH_COOP_DIFFICULTY", 
  6594. 	on_show = pause_menu_build_difficulty_options_menu, 
  6595. 	on_back = pause_menu_option_revert, 
  6596. 	on_pause	= pause_menu_exit, 
  6597. 	on_map = pause_menu_swap, 
  6598. 	on_nav = pause_menu_difficulty_nav, 
  6599. 	 
  6600. 	 
  6601. 	[0] = { label = "DLT_CASUAL", type = MENU_ITEM_TYPE_SELECTABLE, difficulty_level = DIFFICULTY_CASUAL, on_select = pause_menu_option_revert },  
  6602. 	[1] = { label = "DLT_NORMAL", type = MENU_ITEM_TYPE_SELECTABLE, difficulty_level = DIFFICULTY_NORMAL, on_select = pause_menu_option_revert },  
  6603. 	[2] = { label = "DLT_HARDCORE", type = MENU_ITEM_TYPE_SELECTABLE, difficulty_level = DIFFICULTY_HARDCORE, on_select = pause_menu_option_revert },  
  6604. 	 
  6605. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  6606. } 
  6607.  
  6608. Pause_display_menu = { 
  6609. 	header_label_str = "MENU_OPTIONS_DISPLAY", 
  6610. 	on_show 			= pause_menu_build_display_options_menu, 
  6611. 	on_alt_select 		= pause_menu_options_restore_defaults, 
  6612. 	on_back 			= pause_menu_option_revert, 
  6613. 	on_pause			= pause_menu_options_exit_confirm, 
  6614. 	on_map 				= pause_menu_options_swap_confirm, 
  6615. 	on_nav				= pause_menu_display_options_nav, 
  6616. 	on_horz_show 		= pause_menu_option_accept_horz, 
  6617. 	num_items = 5, 
  6618.  
  6619. 	[0] = { label = "MENU_DISPLAY_MONITOR_ADJUSTMENT",	type = MENU_ITEM_TYPE_SELECTABLE,	on_select = pause_menu_display_brightness_screen,	}, 
  6620. 	[1] = { label = "MENU_CONTROLS_SUBTITLES",			type = MENU_ITEM_TYPE_TEXT_SLIDER,	text_slider_values =	subtitles_slider_values,		on_value_update = pause_menu_display_options_update_value, id = 1, on_select = pause_menu_option_accept,	}, 
  6621. 	[2] = { label = "MENU_VSYNC_GAMEPLAY_TEXT",			type = MENU_ITEM_TYPE_TEXT_SLIDER,	text_slider_values =	vsync_gameplay_slider_values,	on_value_update = pause_menu_display_options_update_value, id = 2, on_select = pause_menu_option_accept,	}, 
  6622. 	[3] = { label = "MENU_VSYNC_CUTSCENE_TEXT",			type = MENU_ITEM_TYPE_TEXT_SLIDER,	text_slider_values =	vsync_cutscene_slider_values,	on_value_update = pause_menu_display_options_update_value, id = 3, on_select = pause_menu_option_accept,	}, 
  6623. 	[4] = { label = "CONTROLS_MINIMAP_VIEW",				type = MENU_ITEM_TYPE_TEXT_SLIDER,	text_slider_values =	minimap_slider_values,			on_value_update = pause_menu_display_options_update_value, id = 4, on_select = pause_menu_option_accept,	}, 
  6624.  
  6625. 	btn_tips = Pause_options_btn_tips, 
  6626. } 
  6627.  
  6628. function pause_menu_build_display_options_menu_PC(menu_data) 
  6629. 	Pause_menu_current_option_menu = PAUSE_MENU_DISPLAY_ID 
  6630. 	menu_data.parent_menu = nil 
  6631. 	 
  6632. 	vint_dataresponder_request("pause_menu_populate", "pause_menu_populate_display", 0, PAUSE_MENU_OPTIONS_POPULATE_ID, PAUSE_MENU_DISPLAY_ID, false) 
  6633. end 
  6634.  
  6635. function screen_change_failed_pc() 
  6636. 	dialog_box_message( "MENU_TITLE_WARNING", "GRAPHICS_CHANGE_FAILED" ) 
  6637. end 
  6638.  
  6639. fullscreen_slider_values	= { 
  6640. 	[0] = { label = "CONTROL_NO" }, 
  6641. 	[1] = { label = "CONTROL_YES" }, 
  6642. 	num_values = 2, 
  6643. 	cur_value = 1 
  6644. } 
  6645.  
  6646. vsync_slider_values	= { 
  6647. 	[0] = { label = "CONTROL_NO" }, 
  6648. 	[1] = { label = "CONTROL_YES" }, 
  6649. 	num_values = 2, 
  6650. 	cur_value = 0 
  6651. } 
  6652.  
  6653. resolution_slider_values	= { 
  6654. 	[0] = { label = "640x480" }, 
  6655. 	[1] = { label = "800x600" }, 
  6656. 	[2] = { label = "1024x768" }, 
  6657. 	[3] = { label = "1280x720" }, 
  6658. 	[4] = { label = "1280x800" }, 
  6659. 	[5] = { label = "1280x960" }, 
  6660. 	[6] = { label = "1280x1024" }, 
  6661. 	[7] = { label = "1440x900" }, 
  6662. 	[8] = { label = "1600x1200" }, 
  6663. 	[9] = { label = "1680x1050" }, 
  6664. 	[10] = { label = "1920x1080" }, 
  6665. 	[11] = { label = "1920x1200" }, 
  6666. 	[12] = { label = "1920x1440" }, 
  6667. 	[13] = { label = "2048x1536" }, 
  6668. 	num_values = 14, 
  6669. 	cur_value = 0 
  6670. } 
  6671.  
  6672. graphics_quality_slider_values	= { 
  6673. 	[0] = { label = "QUALITY_LOW_TEXT" }, 
  6674. 	[1] = { label = "QUALITY_MEDIUM_TEXT" }, 
  6675. 	[2] = { label = "QUALITY_HIGH_TEXT" }, 
  6676. 	[3] = { label = "QUALITY_CUSTOM_TEXT" }, 
  6677.  
  6678. 	num_values = 4, 
  6679. 	cur_value = 2 
  6680. } 
  6681.  
  6682. function pause_menu_display_options_update_value_fullscreen(menu_label, menu_data) 
  6683.  
  6684. end 
  6685.  
  6686. function pause_menu_display_options_update_value_resolution(menu_label, menu_data) 
  6687.  
  6688. end 
  6689.  
  6690. Pause_display_menu_PC = { 
  6691. 	header_label_str	= "MENU_OPTIONS_DISPLAY", 
  6692. 	on_show 			= pause_menu_build_display_options_menu_PC, 
  6693. 	on_alt_select 		= pause_menu_options_restore_defaults, 
  6694. 	on_back 			= pause_menu_option_revert, 
  6695. 	on_pause			= pause_menu_options_exit_confirm, 
  6696. 	on_map 				= pause_menu_options_swap_confirm, 
  6697. 	on_nav				= pause_menu_display_options_nav, 
  6698. 	on_horz_show 		= pause_menu_option_accept_horz, 
  6699. 	num_items = 17, 
  6700.  
  6701. 	[0] = { label = "MENU_DISPLAY_MONITOR_ADJUSTMENT",	type = MENU_ITEM_TYPE_SELECTABLE,																																		on_select = pause_menu_display_brightness_screen,	cur_value = 0, }, 
  6702. 	[1] = { label = "MENU_RESOLUTION_TEXT",				type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	resolution_slider_values,				on_value_update = pause_menu_display_options_update_value,	id = 1,		on_select = pause_menu_options_submenu_exit_confirm }, 
  6703. 	[2] = { label = "MENU_FULLSCREEN_TEXT",				type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	fullscreen_slider_values,				on_value_update = pause_menu_display_options_update_value,	id = 2,		on_select = pause_menu_options_submenu_exit_confirm }, 
  6704. 	[3] = { label = "MENU_VSYNC",						type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	vsync_slider_values,					on_value_update = pause_menu_display_options_update_value,	id =15,		on_select = pause_menu_options_submenu_exit_confirm }, 
  6705. 	[4] = { label = "MENU_CONTROLS_SUBTITLES",			type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	subtitles_slider_values,				on_value_update = pause_menu_display_options_update_value,	id = 4,		on_select = pause_menu_options_submenu_exit_confirm }, 
  6706. 	[5] = { label = "CONTROLS_MINIMAP_VIEW",			type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	minimap_slider_values,					on_value_update = pause_menu_display_options_update_value,	id = 5,		on_select = pause_menu_options_submenu_exit_confirm }, 
  6707. 	[6] = { label = "MENU_GRAPHICS_QUALITY_TEXT",		type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	graphics_quality_slider_values,			on_value_update = pause_menu_display_options_update_value,	id = 3,		on_select = pause_menu_options_submenu_exit_confirm }, 
  6708. 	[7] = { label = "Ambient_Occlussion",				type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	adv_ambient_slider_values,				on_value_update = pause_menu_display_options_update_value,	id = 6,		on_select = pause_menu_options_submenu_exit_confirm },  
  6709. 	[8] = { label = "MENU_MOTION_BLUR",					type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	adv_motion_blur_slider_values,			on_value_update = pause_menu_display_options_update_value,	id =11,		on_select = pause_menu_options_submenu_exit_confirm },  
  6710. 	[9] = { label = "Fullscreen_Antialiasing",			type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	adv_antiali_slider_values,				on_value_update = pause_menu_display_options_update_value,	id = 7,		on_select = pause_menu_options_submenu_exit_confirm },  
  6711. 	[10] = { label = "ANISOTROPY_FILTERING",			type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	adv_anisotropy_slider_values,			on_value_update = pause_menu_display_options_update_value,	id =16,		on_select = pause_menu_options_submenu_exit_confirm },  
  6712. 	[11] = { label = "HDR",								type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	adv_hdr_slider_values,					on_value_update = pause_menu_display_options_update_value,	id = 8,		on_select = pause_menu_options_submenu_exit_confirm },  
  6713. 	[12] = { label = "Shadow_Maps",						type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	adv_shadow_slider_values,				on_value_update = pause_menu_display_options_update_value,	id = 9,		on_select = pause_menu_options_submenu_exit_confirm },  
  6714. 	[13] = { label = "View_Distance",					type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	adv_distance_slider_values,				on_value_update = pause_menu_display_options_update_value,	id =10,		on_select = pause_menu_options_submenu_exit_confirm },  
  6715. 	[14] = { label = "MENU_DYNAMIC_LIGHTS",				type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	adv_dynamic_lights_slider_values,		on_value_update = pause_menu_display_options_update_value,	id =12,		on_select = pause_menu_options_submenu_exit_confirm },  
  6716. 	[15] = { label = "MENU_BLUR",						type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	adv_blur_slider_values,					on_value_update = pause_menu_display_options_update_value,	id =13,		on_select = pause_menu_options_submenu_exit_confirm },  
  6717. 	[16] = { label = "MENU_DEPTH_OF_FIELD",				type = MENU_ITEM_TYPE_TEXT_SLIDER, text_slider_values =	adv_depthoffield_slider_values,			on_value_update = pause_menu_display_options_update_value,	id =14,		on_select = pause_menu_options_submenu_exit_confirm },  
  6718.  
  6719. 	btn_tips = Pause_options_btn_tips, 
  6720. } 
  6721.  
  6722.  
  6723. Pause_audio_menu = { 
  6724. 	header_label_str 	= "MENU_OPTIONS_AUDIO", 
  6725. 	on_alt_select 		= pause_menu_options_restore_defaults, 
  6726. 	on_back 			= pause_menu_option_revert, 
  6727. 	on_show 			= pause_menu_build_audio_options_menu, 
  6728. 	on_pause			= pause_menu_options_exit_confirm, 
  6729. 	on_map 				= pause_menu_options_swap_confirm, 
  6730. 	on_nav_down			= pause_menu_audio_nav, 
  6731. 	on_horz_show 		= pause_menu_option_accept_horz, 
  6732. 	num_items = 4, 
  6733. 	 
  6734. 	[0] = { label = "MENU_AUDIO_SFX", 						type = MENU_ITEM_TYPE_NUM_SLIDER,	thumb_width = 70, cur_value = 0, 							on_value_update = pause_menu_audio_options_update_value, id = 0, on_select = pause_menu_option_accept,	}, 
  6735. 	[1] = { label = "MENU_AUDIO_MUSIC", 					type = MENU_ITEM_TYPE_NUM_SLIDER,	thumb_width = 70, cur_value = 0,  							on_value_update = pause_menu_audio_options_update_value, id = 1, on_select = pause_menu_option_accept,	}, 
  6736. 	[2] = { label = "MENU_AUDIO_VOICE",						type = MENU_ITEM_TYPE_NUM_SLIDER,	thumb_width = 70, cur_value = 0,  							on_value_update = pause_menu_audio_options_update_value, id = 2, on_select = pause_menu_option_accept,	}, 
  6737. 	[3] = { label = "MENU_AUDIO_RADIO",						type = MENU_ITEM_TYPE_TEXT_SLIDER,	text_slider_values = vehicle_radio_slider_values,		on_value_update = pause_menu_audio_options_update_value, id = 3, on_select = pause_menu_option_accept,	}, 
  6738.  
  6739. 	btn_tips = Pause_options_btn_tips, 
  6740. } 
  6741.  
  6742. function pause_menu_options_show_pc() 
  6743. 	pause_menu_options_init_call() 
  6744. end 
  6745.  
  6746. --modes: 
  6747. -- 0 natural 
  6748. -- 1 main menu 
  6749. -- 2 multiplayer 
  6750. Pause_options_menu = { 
  6751. 	num_items = 5, 
  6752. 	header_label_str = "PAUSEMENU_CAT_OPTIONS", 
  6753. 	on_show = pause_menu_options_show_pc, 
  6754. 	on_back = pause_menu_exit, 
  6755. 	on_pause	= pause_menu_exit, 
  6756. 	on_map = pause_menu_swap, 
  6757. 	on_show = pause_menu_options_on_show, 
  6758. 	 
  6759. 	[0] = { label = "MULTI_MENU_QUICK_MATCH_COOP_DIFFICULTY",	type = MENU_ITEM_TYPE_SUB_MENU, 	sub_menu = Pause_difficulty_menu, 			}, 
  6760. 	[1] = { label = "MENU_OPTIONS_CONTROLS", 	type = MENU_ITEM_TYPE_SUB_MENU, 	sub_menu = Pause_control_menu_PC, 		}, 
  6761. 	[2] = { label = "MENU_OPTIONS_DISPLAY",	type = MENU_ITEM_TYPE_SUB_MENU, 	sub_menu = Pause_display_menu_PC, 		}, 
  6762. 	[3] = { label = "MENU_OPTIONS_AUDIO",		type = MENU_ITEM_TYPE_SUB_MENU, 	sub_menu = Pause_audio_menu, 			}, 
  6763. 	[4] = { label = "MENU_OPTIONS_QUIT_GAME",	type = MENU_ITEM_TYPE_SELECTABLE, on_select = pause_menu_quit_game 	}, 
  6764. } 
  6765.  
  6766. Pause_options_menu_no_difficulty = { 
  6767. 	num_items = 4, 
  6768. 	header_label_str = "PAUSEMENU_CAT_OPTIONS", 
  6769. 	on_back = pause_menu_exit, 
  6770. 	on_pause	= pause_menu_exit, 
  6771. 	 
  6772. 	[0] = { label = "MENU_OPTIONS_CONTROLS", 	type = MENU_ITEM_TYPE_SUB_MENU, 	sub_menu = Pause_control_menu_PC, 		}, 
  6773. 	[1] = { label = "MENU_OPTIONS_DISPLAY",	type = MENU_ITEM_TYPE_SUB_MENU, 	sub_menu = Pause_display_menu_PC, 		}, 
  6774. 	[2] = { label = "MENU_OPTIONS_AUDIO",		type = MENU_ITEM_TYPE_SUB_MENU, 	sub_menu = Pause_audio_menu, 			}, 
  6775. 	[3] = { label = "MENU_OPTIONS_QUIT_GAME",	type = MENU_ITEM_TYPE_SELECTABLE, on_select = pause_menu_quit_game 	}, 
  6776. } 
  6777.  
  6778. Pause_menu_cell_phone = { 
  6779. 	on_show 	= pause_menu_cellphone_show, 
  6780. 	on_pause = pause_menu_exit, 
  6781. 	on_map = pause_menu_swap, 
  6782. 	on_exit 	= pause_menu_cellphone_exit, 
  6783. 	custom_show = true, 
  6784. 	num_items = 1, 
  6785.  
  6786. 	[0] = { label = "", type = MENU_ITEM_TYPE_SELECTABLE }, 
  6787. 	 
  6788. 	btn_tips = Pause_cellphone_btn_tips, 
  6789. } 
  6790.  
  6791. Pause_menu_playlist_editor = { 
  6792. 	header_label_str = "PAUSE_MENU_CAT_RADIO",  
  6793. 	on_show			= pause_menu_playlist_show, 
  6794. 	on_back			= pause_menu_playlist_on_back, 
  6795. 	--on_exit			= pause_menu_playlist_on_exit, 
  6796. 	on_post_show	= pause_menu_playlist_post_show, 
  6797. 	--on_pause 		= pause_menu_playlist_confirm_exit, 
  6798. 	on_map 			= pause_menu_playlist_confirm_swap, 
  6799. 	get_width 		= pause_menu_playlist_get_width, 
  6800. 	get_height 		= pause_menu_playlist_get_height, 
  6801. 	on_horz_show 	= pause_menu_playlist_horz_show, 
  6802. 	 
  6803. 	 
  6804. 	num_items 		= 1, 
  6805. 	 
  6806. 	[0] = { label = "", type = PAUSE_MENU_CONTROL_PLAYLIST_EDITOR, on_select = pause_menu_playlist_on_select }, 
  6807. 	 
  6808. 	footer_height = 40, 
  6809. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  6810. } 
  6811.  
  6812. Pause_menu_station_selection = { 
  6813. 	header_label_str = "PAUSE_MENU_STATION_SELECTION", 
  6814. 	on_show  = pause_menu_station_show, 
  6815. 	on_release = pause_menu_station_exit, 
  6816. 	on_pause = pause_menu_exit, 
  6817. 	on_map = pause_menu_swap, 
  6818. 	num_items = 1, 
  6819. 	 
  6820. 	[0] = {	label = "", type = MENU_ITEM_TYPE_GRID, on_select = pause_menu_station_select, on_nav = pause_menu_station_nav, update_swatch = pause_menu_station_update_swatch, 
  6821. 				col_width = 138, row_height = 108, num_cols = 5, highlight_scale = 1, unhighlight_scale = 0.75, on_leave = pause_menu_station_leave_swatch	}, 
  6822. 				 
  6823. 	footer_height = 40, 
  6824. 	btn_tips = Pause_menu_accept_back_btn_tips, 
  6825. } 
  6826.  
  6827. Pause_menu_radio = { 
  6828. 	header_label_str = "PAUSEMENU_CAT_AUDIO", 
  6829. 	on_pause = pause_menu_exit, 
  6830. 	on_back = pause_menu_exit, 
  6831. 	on_map = pause_menu_swap, 
  6832. 	num_items = 2, 
  6833. 	 
  6834. 	[0] = { label = "PAUSE_MENU_STATION_SELECTION", type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_menu_station_selection,		}, 
  6835. 	[1] = { label = "PAUSE_MENU_CAT_RADIO", 			type = MENU_ITEM_TYPE_SUB_MENU, sub_menu = Pause_menu_playlist_editor,			}, 
  6836. } 
  6837.  
  6838. Pause_score_board	= {  
  6839. 	header_label_str = "MP_SCOREBOARD_CAPS", 
  6840. 	on_show = pause_menu_scoreboard_show, 
  6841. 	on_back = pause_menu_exit, 
  6842. 	on_pause = pause_menu_exit, 
  6843. 	num_items = 1, 
  6844. 	get_width = pause_menu_scoreboard_get_width, 
  6845. 	get_height = pause_menu_scoreboard_get_height, 
  6846. 	on_map = pause_menu_swap, 
  6847. 	 
  6848. 	[0] = { label = "", type = PAUSE_MENU_CONTROL_SCOREBOARD } 
  6849. } 
  6850.  
  6851. Coop_pause_invite_player_menu = { 
  6852. 	num_items = 1, 
  6853. 	header_label_str = "MULTI_LOBBY_INVITE_FRIENDS", 
  6854. 	btn_tips = Pause_control_schemes_btn_tips, 
  6855. 	 
  6856. 	[0] =  { label = "MM_LOAD_LOADING", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil }, 
  6857. } 
  6858.  
  6859. Pause_coop_menu = { 
  6860. 	header_label_str = "MAINMENU_COOP", 
  6861. 	on_show = pause_menu_coop_show, 
  6862. 	on_back = pause_menu_exit, 
  6863. 	on_pause	= pause_menu_exit, 
  6864. 	on_map = pause_menu_swap, 
  6865. 	num_items = 0, 
  6866. } 
  6867.  
  6868. Pause_horz_menu = { 
  6869. 	num_items = 5, 
  6870. 	current_selection = 0, 
  6871. 	on_back = pause_menu_exit, 
  6872. 	on_pause	= pause_menu_exit, 
  6873. 	on_map = pause_menu_swap, 
  6874. 	 
  6875. 	[0] = { label = "PAUSEMENU_CAT_INFO", 			sub_menu = Pause_info_menu 		}, 
  6876. 	[1] = { label = "PAUSEMENU_CAT_SAVELOAD", 	sub_menu = Pause_save_load_menu 	}, 
  6877. 	[2] = { label = "PAUSEMENU_CAT_OPTIONS",		sub_menu = Pause_options_menu 	}, 
  6878. 	[3] = { label = "PAUSEMENU_CAT_AUDIO", 		sub_menu = Pause_menu_radio		},	 
  6879. 	[4] = { label = "PAUSEMENU_CAT_PHONE", 		sub_menu = Pause_menu_cell_phone },  
  6880.    [5] = { label = "MP_SCOREBOARD_CAPS", 			sub_menu = Pause_score_board		}, 
  6881. } 
  6882.  
  6883. Multi_pause_horz_menu_options_only = { 
  6884. 	num_items = 1, 
  6885. 	current_selection = 0, 
  6886. 	on_back = pause_menu_exit, 
  6887. 	on_pause	= pause_menu_exit, 
  6888. 	 
  6889. 	[0] = { label = "TUTORIAL_LOBBY",	sub_menu = Pause_options_menu_no_difficulty 	}, 
  6890. } 
  6891.  
  6892. Pause_menu_no_friends_menu = { 
  6893. 	num_items = 1, 
  6894. 	header_label_str = "MULTI_LOBBY_INVITE_FRIENDS", 
  6895. 	on_back = pause_menu_quit_game, 
  6896. 	 
  6897. 	[0] =  { label = "NO_FRIENDS_ONLINE", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil }, 
  6898. } 
  6899.  
  6900. Coop_invite_friends_menu = { 
  6901. 	num_items = 1, 
  6902. 	header_label_str = "MULTI_LOBBY_INVITE_FRIENDS", 
  6903. 	on_show = coop_pause_load_friends_coop_start, 
  6904. 	on_back = pause_menu_quit_game, 
  6905. 	 
  6906. 	[0] =  { label = "MM_LOAD_LOADING", type = MENU_ITEM_TYPE_SELECTABLE, on_select = nil }, 
  6907. } 
  6908.  
  6909. Coop_invite_friends_horz_menu = { 
  6910. 	num_items = 0,  
  6911. 	current_selection = 0, 
  6912. 	on_back = pause_menu_quit_game, 
  6913. 	btn_tips = Pause_menu_quit_to_main_only_tips, 
  6914.  
  6915. 	--[0] = { label = "MULTI_LOBBY_INVITE_FRIENDS", sub_menu = Coop_invite_friends_menu }, 
  6916. } 
  6917.  
  6918. MP_Pause_horz_menu = { 
  6919. 	num_items = 2,  
  6920. 	current_selection = 0, 
  6921. 	on_back = pause_menu_exit, 
  6922. 	on_pause = pause_menu_exit, 
  6923. 	on_map = pause_menu_swap, 
  6924.  
  6925. 	[0] = { label = "MP_SCOREBOARD_CAPS", 	sub_menu = Pause_score_board		}, 
  6926. 	[1] = { label = "PAUSEMENU_CAT_OPTIONS",		sub_menu = Pause_options_menu 	}, 
  6927. } 
  6928.  
  6929. Pause_menu_controls = { 
  6930. 	[PAUSE_MENU_CONTROL_OBJECTIVE_TEXT_LINE] = { 
  6931. 		on_show 		=	pause_menu_control_objective_text_line_show, 
  6932. 		on_select 	=	nil, 
  6933. 		on_nav_up	=	pause_menu_control_nav_up, 
  6934. 		on_nav_down	=	pause_menu_control_nav_down, 
  6935. 		on_release	=  pause_menu_control_release, 
  6936. --		get_width	=	pause_menu_objective_get_width, 
  6937. --		get_height	=	pause_menu_objective_get_height, 	 
  6938. 		use_scroll_bar  = false, 
  6939. 		hide_select_bar = true, 
  6940. 	}, 
  6941. 	 
  6942. 	[PAUSE_MENU_CONTROL_OBJECTIVE_WRAP_LINE] = { 
  6943. 	 
  6944. 		on_show 		=	pause_menu_control_objective_wrap_line_show, 
  6945. 		on_select 	=	nil, 
  6946. 		on_release  =  pause_menu_control_objective_release, 
  6947. 		on_nav_up	=	pause_menu_control_objective_nav_up, 
  6948. 		on_nav_down	=	pause_menu_control_objective_nav_down, 
  6949. 		get_width		=	pause_menu_objective_wrap_get_width, 
  6950. 		get_height		=	pause_menu_objective_wrap_get_height, 	 
  6951. 		uses_scroll_bar =		true, 
  6952. 		hide_select_bar =		true, 
  6953. 		hide_label_stripe =	true, 
  6954. 	}, 
  6955.  
  6956. 	[PAUSE_MENU_CONTROL_STAT_TEXT_LINE] = { 
  6957. 		on_show			=	pause_menu_control_stat_text_line_show, 
  6958. 		on_select		= 	nil, 
  6959. 		on_nav_left 	=  pause_menu_control_page_up, 
  6960. 		on_nav_up		=	pause_menu_control_page_up, 
  6961. 		on_nav_right	=	pause_menu_control_page_down, 
  6962. 		on_nav_down		=	pause_menu_control_page_down, 
  6963. 		on_release		=  pause_menu_control_stat_text_line_release, 
  6964. 		uses_scroll_bar = false, 
  6965. 		hide_select_bar = true, 
  6966. 	}, 
  6967. 	 
  6968. 	[PAUSE_MENU_CONTROL_DIVERSION_TEXT_LINE] = { 
  6969. 		on_show			=	pause_menu_control_diversion_text_line_show, 
  6970. 		on_select		= 	menu_submenu_on_select, 
  6971. 		on_release		=	pause_menu_control_release, 
  6972. 		on_enter			=	pause_menu_control_diversion_text_line_enter, 
  6973. 		on_leave			=	pause_menu_control_diversion_text_line_leave, 
  6974. 	}, 
  6975. 	 
  6976. 	[PAUSE_MENU_CONTROL_CHECKBOX_IMAGE] = { 
  6977. 		on_show			=	pause_menu_control_checkbox_image_show, 
  6978. 		on_select		= 	menu_control_on_select, 
  6979. 		on_nav_up		=	pause_menu_control_checkbox_image_nav_up, 
  6980. 		on_nav_down		=	pause_menu_control_checkbox_image_nav_down, 
  6981. 		on_release		=  pause_menu_control_checkbox_image_release, 
  6982. 		uses_scroll_bar = false, 
  6983. 	}, 
  6984.  
  6985. 	[PAUSE_MENU_CONTROL_SAVE_LOAD] = { 
  6986. 		on_show			=	pause_menu_control_save_load_show, 
  6987. 		on_select		= 	menu_control_on_select, 
  6988. 		on_release		=  pause_menu_control_save_load_release, 
  6989. 		on_enter			=	pause_menu_control_save_load_enter, 
  6990. 		on_leave			=	pause_menu_control_save_load_leave, 
  6991. 		get_width		=	pause_menu_control_save_load_get_width, 
  6992. 	}, 
  6993. 	 
  6994. 	[PAUSE_MENU_CONTROL_HELP_TEXT] = {  
  6995. 		on_show			=  pause_menu_control_help_text_show, 
  6996. 		on_select		=	nil, 
  6997. 		on_release		=	pause_menu_control_help_release, 
  6998. 		uses_scroll_bar = true, 
  6999. 		hide_select_bar = true, 
  7000. 	}, 
  7001.  
  7002. 	[PAUSE_MENU_CONTROL_CENTERED_LABEL] = { 
  7003. 		on_show			=	pause_menu_control_centered_label_show, 
  7004. 		on_select		= 	menu_control_on_select, 
  7005. 		on_release		=  pause_menu_control_centered_label_release, 
  7006. 		on_enter			=	pause_menu_control_centered_label_enter, 
  7007. 		on_leave			=	pause_menu_control_centered_label_leave, 
  7008. 		get_width		=	pause_menu_control_centered_label_get_width, 
  7009. 	}, 
  7010. 	 
  7011. 	[PAUSE_MENU_CONTROL_PLAYLIST_EDITOR] = { 
  7012. 		on_show			=	pause_menu_control_playlist_editor_show, 
  7013. 		on_release		=  pause_menu_control_playlist_on_release, 
  7014. 		on_select		= 	menu_control_on_select, 
  7015. 		on_alt_select	=	pause_menu_control_playlist_alt_select, 
  7016. 		on_nav_up		=	pause_menu_control_playlist_nav_up, 
  7017. 		on_nav_down		=  pause_menu_control_playlist_nav_down, 
  7018. 		on_nav_left		= 	pause_menu_control_playlist_activate_pane, 
  7019. 		on_nav_right	= 	pause_menu_control_playlist_activate_pane, 
  7020. 		use_scroll_bar  = false, 
  7021. 		hide_label_stripe =	true, 
  7022. 	}, 
  7023. 	 
  7024. 	[PAUSE_MENU_CONTROL_SCOREBOARD] = { 
  7025. 		on_show			=	pause_menu_control_scoreboard_on_show, 
  7026. 		on_release		=  pause_menu_control_scoreboard_on_release, 
  7027. 			 
  7028. 		hide_select_bar = true, 
  7029. 		use_scroll_bar  = false, 
  7030. 	}, 
  7031. 	 
  7032. 	[PAUSE_MENU_CONTROL_LOBBY_PLAYERS] = { 
  7033. 		on_show			=	pause_menu_control_lobby_players_on_show, 
  7034. 		on_release		=  pause_menu_control_lobby_players_on_release, 
  7035. 			 
  7036. 		hide_select_bar = true, 
  7037. 		use_scroll_bar  = false, 
  7038. 	} 
  7039. } 
  7040.  
  7041.