./pause_ctrl_scheme.lua

  1. local ON_FOOT_INDEX					= 1 
  2. local VEHICLE_INDEX						= 2 
  3.  
  4. local Anims = {} 
  5. local Screen_width = 840 
  6. local Input_tracker 
  7. local Mouse_input_tracker 
  8.  
  9. Control_list = -1 
  10. local Ctrl_scheme_doc = -1 
  11. Pause_menu_controller 				= -1 
  12. Pause_menu_controller_thread_h 	= -1 
  13. local PAUSE_MENU_CONTROL_SCHEME_ID		= 14 
  14.  
  15. local Tween_done = true 
  16.  
  17. local pad_anchor_x, pad_anchor_y 
  18.  
  19. function pause_ctrl_scheme_init() 
  20. 	Ctrl_scheme_doc = vint_document_find("pause_ctrl_scheme") 
  21. 	-- Subscribe to the button presses we need 
  22. 	Input_tracker = Vdo_input_tracker:new() 
  23. 	Input_tracker:add_input("select", "pause_ctrl_scheme_button_a", 50) 
  24. 	Input_tracker:add_input("back", "pause_ctrl_scheme_button_b", 50) 
  25. 	Input_tracker:add_input("nav_up", "pause_ctrl_scheme_nav_up", 50) 
  26. 	Input_tracker:add_input("nav_down", "pause_ctrl_scheme_nav_down", 50) 
  27. 	Input_tracker:add_input("nav_left", "pause_ctrl_scheme_nav_left", 50) 
  28. 	Input_tracker:add_input("nav_right", "pause_ctrl_scheme_nav_right", 50) 
  29. 	if In_pause_menu then 
  30. 		Input_tracker:add_input("pause", "pause_ctrl_scheme_button_start", 50) 
  31. 	end 
  32. 	 
  33. 	if vint_is_std_res() then 
  34. 		Screen_width = 750 
  35. 	else 
  36. 		Screen_width = 840 
  37. 	end 
  38. 	 
  39. 	 
  40. 	 
  41. 	 
  42. 	Input_tracker:subscribe(false) 
  43.  
  44. 	--Initialize Header 
  45. 	local ctrl_header_obj = Vdo_pause_header:new("header",0,Ctrl_scheme_doc) 
  46. 	ctrl_header_obj:set_text("MENU_CONTROL_SCHEMES", Screen_width) 
  47.  
  48. 	Control_list = Vdo_mega_list:new("list", 0, Ctrl_scheme_doc, "pause_ctril_scheme.lua", "Control_list") 
  49. 	Control_list:set_highlight_color(COLOR_STORE_REWARDS_PRIMARY, COLOR_STORE_REWARDS_SECONDARY) 
  50. 	 
  51. 	--Get the selection option from when the menu was last loaded 
  52. 	local last_option_selected = menu_common_stack_get_index() 
  53.  
  54. 	--Setup button hints 
  55. 	local hint_data = { 
  56. 		{CTRL_MENU_BUTTON_B, "MENU_BACK"}, 
  57. 	} 
  58. 	Menu_hint_bar:set_hints(hint_data)   
  59. 	 
  60. 	--Change controller image based on platform... 
  61. 	local controller_h = vint_object_find("controller") 
  62. 	local platform = game_get_platform() 
  63. 	if platform == "PS3" then 
  64. 		vint_set_property(controller_h, "image", "ui_menu_ctrl_ps3") 
  65. 	elseif platform == "PS4" then	-- HVS_JRP[PRINCE] 3/18/2014 
  66. 		vint_set_property(controller_h, "image", "ui_menu_ctrl_ps4") 
  67. 	elseif platform == "XBOX3" then	-- HVS_JRP[PRINCE] 3/18/2014 
  68. 		vint_set_property(controller_h, "image", "ui_menu_ctrl_xbox3") 
  69. 	else 
  70. 		vint_set_property(controller_h, "image", "ui_menu_ctrl_xbox2") 
  71. 	end 
  72.  
  73. 	local grp_h = vint_object_find("ctrls", 0, Ctrl_scheme_doc) 
  74. 	local h = vint_object_find("19_btn", grp_h) 
  75. 	pad_anchor_x, pad_anchor_y = vint_get_property(h, "anchor") 
  76.  
  77. 	--Get control schemes and populate stuff 
  78. 	-- On foot Controls 
  79. 	local which_controller, which_scheme, num_buttons = pause_menu_control_scheme_init(true, 0) 
  80. 	--Options_Controls_Data[1].current_value = which_scheme + 1 
  81. 	 
  82. 	-- Vehicle Controls 
  83. 	local which_controller, which_scheme, num_buttons = pause_menu_control_scheme_init(true, 1) 
  84. 	--Options_Controls_Data[2].current_value = which_scheme + 1 
  85. 	 
  86. 	-- Aircraft Controls 
  87. 	-- local which_controller, which_scheme, num_buttons = pause_menu_control_scheme_init(true, 2) 
  88. 	 
  89. 	--Reset Controls Menu... 
  90. 	pause_ctrl_scheme_reset(0) 
  91. 	 
  92. 	-- Draw the list for the first time 
  93. 	 
  94. 	Control_list:draw_items(Options_Controls_Data, 1, Screen_width, nil, nil, nil, false) 
  95. 	 
  96. 	--Store some locals to the pause menu common for screen processing. 
  97. 	menu_common_set_list_style(List, Header_obj, Screen_width) 
  98. 	menu_common_set_screen_data(List, Header_obj, Input_tracker, Screen_back_out_anim, Screen_slide_out_anim) 
  99. 	 
  100. 	-- Add mouse inputs for the PC 
  101. 	if platform == "PC" then 
  102. 		Menu_hint_bar:set_highlight(0) 
  103. 		 
  104. 		Mouse_input_tracker = Vdo_input_tracker:new() 
  105. 		Control_list:add_mouse_inputs("pause_ctrl_scheme", Mouse_input_tracker) 
  106. 		Menu_hint_bar:add_mouse_inputs("pause_ctrl_scheme", Mouse_input_tracker) 
  107. 		Mouse_input_tracker:subscribe(true) 
  108. 		 
  109. 		--menu_common_set_mouse_tracker(Mouse_input_tracker) 
  110. 	end 
  111. 	 
  112. 	List:set_visible(false) 
  113. 	Header_obj:set_visible(false) 
  114.  
  115. 	 
  116. 	if not In_pause_menu then 
  117. 		--get the list x and y 
  118. 		local new_x 
  119. 		local middle_x 
  120. 		if vint_is_std_res() == false then 
  121. 			middle_x = 640 
  122. 		else 
  123. 			middle_x = 320 * 1.5 
  124. 		end 
  125. 		new_x = middle_x - (Screen_width * 0.5) 
  126. 		 
  127. 		 
  128. 		 
  129. 		 
  130. 		bg_saints_set_type(BG_TYPE_PAUSE, true, Screen_width) 
  131. 		 
  132. 	else 
  133. 		 
  134. 		 
  135. 		 
  136. 	end 
  137. 	 
  138. 	local screen_in_anim = Vdo_anim_object:new("ctrl_back_in_anim", 0, Ctrl_scheme_doc) 
  139. 	screen_in_anim:play(0) 
  140. 	 
  141. 	vdo_mega_list_enable_listener(false) 
  142. end 
  143.  
  144.  
  145. function pause_ctrl_scheme_cleanup() 
  146. 	--Kill menu cycle thread... 
  147. 	thread_kill(Pause_menu_controller_thread_h) 
  148. 	Pause_menu_controller_thread_h = -1 
  149.  
  150. 	--Free up Memory... 
  151. 	pause_menu_control_scheme_init(false) 
  152. 	 
  153. 	-- Nuke all button subscriptions 
  154. 	Input_tracker:subscribe(false) 
  155. 	if Mouse_input_tracker ~= nil then 
  156. 		Mouse_input_tracker:subscribe(false) 
  157. 	end 
  158. 	List:enable_toggle_input(false) 
  159. 	 
  160. 	vdo_mega_list_enable_listener(true) 
  161. end 
  162.  
  163. function pause_ctrl_scheme_nav_up(event, acceleration) 
  164. end 
  165.  
  166. function pause_ctrl_scheme_nav_down(event, acceleration) 
  167. end 
  168.  
  169. function pause_ctrl_scheme_nav_left(event, acceleration) 
  170. 	-- Move highlight left 
  171. 	Control_list:move_slider(-1) 
  172. 	 
  173. 	--Update control menu... 
  174. 	pause_ctrl_scheme_reset(Control_list:get_toggle_selection() - 1) 
  175. end 
  176.  
  177. function pause_ctrl_scheme_nav_right(event, acceleration) 
  178. 	-- Move highlight right 
  179. 	Control_list:move_slider(1) 
  180. 	 
  181. 	--Update control menu... 
  182. 	pause_ctrl_scheme_reset(Control_list:get_toggle_selection() - 1) 
  183. end 
  184.  
  185. function pause_ctrl_scheme_button_a(event, acceleration) 
  186. 	if Tween_done == true then 
  187. 		--pass off the input to the list 
  188. 		--Control_list:button_a() 
  189. 		pause_ctrl_scheme_nav_right(event, acceleration) 
  190. 	end 
  191. end 
  192.  
  193. function pause_ctrl_scheme_button_b(event, acceleration) 
  194. 	if Tween_done == true then 
  195. 		--slide the screen out 
  196. 		local screen_out_anim = Vdo_anim_object:new("ctrl_slide_out_anim",0,Ctrl_scheme_doc) 
  197. 		screen_out_anim:play(0) 
  198. 	 
  199. 		if Mouse_input_tracker ~= nil then 
  200. 			Mouse_input_tracker:subscribe(false) 
  201. 		end 
  202. 		List:enable_toggle_input(false) 
  203.  
  204. 		-- Save options 
  205. 		pause_menu_accept_options() 
  206. 		 
  207. 		--Remove from internal stack for button tracking and pop screen. 
  208. 		menu_common_stack_remove() 
  209. 		 
  210. 		Control_list:button_b() 
  211. 		menu_common_transition_pop(1)	 
  212. 		 
  213. 		--List:set_visible(true) 
  214. 		--Header_obj:set_visible(true) 
  215. 	end 
  216. end 
  217.  
  218. -------------------------------------------------- 
  219. -- SR2 Stuff... 
  220. -------------------------------------------------- 
  221.  
  222. function pause_ctrl_scheme_reset(scheme_id) 
  223. 	local which_controller, which_scheme, num_buttons = pause_menu_control_scheme_init(true, scheme_id) 
  224. 	local grp_h = vint_object_find("ctrls", 0, Ctrl_scheme_doc) 
  225. 	 
  226. 	Pause_menu_controller = {} 
  227. 	 
  228. 	if which_controller == 0 then 
  229. 		--XBOX2 
  230. 	else  
  231. 		--PS3/PS4 
  232. 		local h = vint_object_find("dpad", grp_h) 
  233. 		vint_set_property(h, "anchor", 0, -109 ) 
  234. 		local h = vint_object_find("left_sticks", grp_h) 
  235. 		vint_set_property(h, "anchor", 0, 190) 
  236. 		local h = vint_object_find("start", grp_h) 
  237. 		vint_set_property(h, "anchor", 20, 0) 
  238. 	end 
  239.  
  240. 	if which_controller == 2 then 
  241. 		--PS4 
  242. 		local h = vint_object_find("19_btn", grp_h) 
  243. 		vint_set_property(h, "anchor", pad_anchor_x, pad_anchor_y+6) 
  244. 	end 
  245. 	 
  246. 	--Left Side buttons 
  247. 	local btn_lt_h = vint_object_find("0_btn", grp_h) 
  248. 	vint_set_property(btn_lt_h, "image", CTRL_BUTTON_LT) 
  249. 	 
  250. 	local btn_lb_h = vint_object_find("1_btn", grp_h) 
  251. 	vint_set_property(btn_lb_h, "image", CTRL_BUTTON_LB) 
  252. 	 
  253. 	local btn_ls_h = vint_object_find("3_btn", grp_h) 
  254. 	vint_set_property(btn_ls_h, "image", CTRL_BUTTON_LS) 
  255.  
  256. 	local btn_ls_press_h = vint_object_find("4_btn", grp_h) 
  257. 	vint_set_property(btn_ls_press_h, "image", CTRL_BUTTON_LS_PRESS) 
  258.  
  259. 	local btn_dpad_up_h = vint_object_find("6_btn", grp_h) 
  260. 	vint_set_property(btn_dpad_up_h, "image", CTRL_BUTTON_DPAD_UP) 
  261.  
  262. 	local btn_dpad_left_h = vint_object_find("7_btn", grp_h) 
  263. 	vint_set_property(btn_dpad_left_h, "image", CTRL_BUTTON_DPAD_LEFT) 
  264.  
  265. 	local btn_dpad_down_h = vint_object_find("8_btn", grp_h) 
  266. 	vint_set_property(btn_dpad_down_h, "image", CTRL_BUTTON_DPAD_DOWN) 
  267.  
  268. 	local btn_dpad_right_h = vint_object_find("9_btn", grp_h) 
  269. 	vint_set_property(btn_dpad_right_h, "image", CTRL_BUTTON_DPAD_RIGHT) 
  270. 	 
  271. 	--Right Side Button... 
  272. 	local btn_rt_h = vint_object_find("10_btn", grp_h) 
  273. 	vint_set_property(btn_rt_h, "image", CTRL_BUTTON_RT) 
  274. 	 
  275. 	local btn_rb_h = vint_object_find("11_btn", grp_h) 
  276. 	vint_set_property(btn_rb_h, "image", CTRL_BUTTON_RB) 
  277.  
  278. 	local btn_y_h = vint_object_find("12_btn", grp_h) 
  279. 	vint_set_property(btn_y_h, "image", CTRL_BUTTON_Y) 
  280. 	 
  281. 	local btn_b_h = vint_object_find("13_btn", grp_h) 
  282. 	vint_set_property(btn_b_h, "image", get_actual_b_button()) 
  283. 	 
  284. 	local btn_a_h = vint_object_find("14_btn", grp_h) 
  285. 	vint_set_property(btn_a_h, "image", CTRL_BUTTON_X) 
  286. 	 
  287. 	local btn_x_h = vint_object_find("15_btn", grp_h) 
  288. 	vint_set_property(btn_x_h, "image", get_actual_a_button()) 
  289. 	 
  290. 	local btn_rs_h = vint_object_find("16_btn", grp_h) 
  291. 	vint_set_property(btn_rs_h, "image", CTRL_BUTTON_RS) 
  292. 	 
  293. 	local btn_rs_press_h = vint_object_find("17_btn", grp_h) 
  294. 	vint_set_property(btn_rs_press_h, "image", CTRL_BUTTON_RS_PRESS) 
  295. 	 
  296. 	--Middle Buttons 
  297. 	local btn_start_h = vint_object_find("18_btn", grp_h) 
  298. 	vint_set_property(btn_start_h, "image", CTRL_BUTTON_START) 
  299.  
  300. 	local btn_back_h = vint_object_find("19_btn", grp_h) 
  301. 	vint_set_property(btn_back_h, "image", CTRL_MENU_BUTTON_BACK) 
  302. 	 
  303. 	Pause_menu_controller = {  
  304. 		["L1"] 						= { labels = { }, num_buttons = 0, cur_button = 0,  
  305. 										  handles = { button_h = vint_object_find("1_txt", grp_h), label_h = btn_lb_h } }, 
  306. 		["L2"] 						= { labels = { }, num_buttons = 0, cur_button = 0,  
  307. 										  handles = { button_h = vint_object_find("0_txt", grp_h), label_h = btn_lt_h } }, 
  308. 		["analog left"] 			= { labels = { }, num_buttons = 0, cur_button = 0,  
  309. 										  handles = { button_h = vint_object_find("3_txt", grp_h), label_h = btn_ls_h } }, 
  310. 		["analog left click 1"]	= { labels = { }, num_buttons = 0, cur_button = 0,  
  311. 										  handles = { button_h = vint_object_find("4_txt", grp_h), label_h = btn_ls_press_h } }, 
  312. 	--	["analog left click 2"]	= { labels = { }, num_buttons = 0, cur_button = 0,  
  313. 	--									  handles = { button_h = 0, label_h = 0 } }, 
  314. 		["dpad up"]					= { labels = { }, num_buttons = 0, cur_button = 0,  
  315. 										  handles = { button_h = vint_object_find("6_txt", grp_h), label_h = btn_dpad_up_h } }, 
  316. 		["dpad left"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  317. 										  handles = { button_h = vint_object_find("7_txt", grp_h), label_h = btn_dpad_left_h } }, 
  318. 		["dpad down"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  319. 										  handles = { button_h = vint_object_find("8_txt", grp_h), label_h = btn_dpad_down_h } }, 
  320. 		["dpad right"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  321. 										  handles = { button_h = vint_object_find("9_txt", grp_h), label_h = btn_dpad_right_h } }, 
  322. 		["R2"]						= { labels = { }, num_buttons = 0, cur_button = 0,  
  323. 										  handles = { button_h = vint_object_find("10_txt", grp_h), label_h = btn_rt_h } }, 
  324. 		["R1"]						= { labels = { }, num_buttons = 0, cur_button = 0,  
  325. 										  handles = { button_h = vint_object_find("11_txt", grp_h), label_h = btn_rb_h } }, 
  326. 		["button y"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  327. 										  handles = { button_h = vint_object_find("12_txt", grp_h), label_h = btn_y_h } }, 
  328. 		["button b"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  329. 										  handles = { button_h = vint_object_find("13_txt", grp_h), label_h = btn_b_h } }, 
  330. 		["button a"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  331. 										  handles = { button_h = vint_object_find("14_txt", grp_h), label_h = btn_a_h } }, 
  332. 		["button x"]				= { labels = { }, num_buttons = 0, cur_button = 0,  
  333. 										  handles = { button_h = vint_object_find("15_txt", grp_h), label_h = btn_x_h } }, 
  334. 		["analog right"]			= { labels = { }, num_buttons = 0, cur_button = 0,  
  335. 										  handles = { button_h = vint_object_find("16_txt", grp_h), label_h = btn_rs_h } }, 
  336. 		["analog right click"]	= { labels = { }, num_buttons = 0, cur_button = 0,  
  337. 										  handles = { button_h = vint_object_find("17_txt", grp_h), label_h = btn_rs_press_h } }, 
  338. 		["back"]						= { labels = { }, num_buttons = 0, cur_button = 0,  
  339. 										  handles = { button_h = vint_object_find("19_txt", grp_h), label_h = btn_back_h } }, 
  340. 		["start"]					= { labels = { }, num_buttons = 0, cur_button = 0,  
  341. 										  handles = { button_h = vint_object_find("18_txt", grp_h), label_h = btn_start_h } },  
  342. 	} 
  343. 	 
  344. 	for idx, val in pairs(Pause_menu_controller) do 
  345. 		vint_set_property(val.handles.button_h, "visible", false) 
  346. 		vint_set_property(val.handles.label_h, "visible", false) 
  347. 		val.num_buttons = 0 
  348. 		val.cur_button = 0 
  349. 	end 
  350.  
  351. 	vint_dataresponder_request("pause_menu_control_scheme", "pause_ctrl_scheme_populate", 0, scheme_id) 
  352. 	 
  353. 	if Pause_menu_controller_thread_h ~= -1 then 
  354. 		thread_kill(Pause_menu_controller_thread_h) 
  355. 		Pause_menu_controller_thread_h = -1 
  356. 	end	 
  357. 	Pause_menu_controller_thread_h = thread_new("pause_ctrl_scheme_cycle") 
  358. end 
  359.  
  360. function pause_ctrl_scheme_cycle() 
  361. 	while true do 
  362. 		delay(2) 
  363. 		for i, val in pairs(Pause_menu_controller) do 
  364. 			local num_buttons = val.num_buttons 
  365. 			local cur_button = val.cur_button 
  366. 			 
  367. 			cur_button = cur_button + 1 
  368. 			if cur_button >= num_buttons then 
  369. 				cur_button = 0 
  370. 			end 
  371. 			 
  372. 			if cur_button ~= val.cur_button then 
  373. 				val.cur_button = cur_button 
  374. 				vint_set_property(val.handles.button_h, "text_tag", val.labels[cur_button])	 
  375. 			end 
  376. 		end 
  377. 	end 
  378. end 
  379.  
  380.  
  381.  
  382. --Populates the control scheme with propert text.. 
  383. --This gets called by a dataresponder... 
  384. -- 
  385. --@param 	button_name		This is the ID sent from game to change text for a certain button... 
  386. --@param		button			this is the text that gets used on the button. 
  387. function pause_ctrl_scheme_populate(button_name, button) 
  388. 	local num_buttons = Pause_menu_controller[button_name].num_buttons 
  389. 	Pause_menu_controller[button_name].labels[num_buttons] = button 
  390. 	 
  391. 	if num_buttons == 0 then 
  392. 		vint_set_property(Pause_menu_controller[button_name].handles.button_h, "visible", true) 
  393. 		vint_set_property(Pause_menu_controller[button_name].handles.button_h, "text_tag", button) 
  394. 		 
  395. 		if Pause_menu_controller[button_name].handles.label_h ~= 0 then  
  396. 			vint_set_property(Pause_menu_controller[button_name].handles.label_h, "visible", true) 
  397. 		end	 
  398. 	end 
  399. 	Pause_menu_controller[button_name].num_buttons = num_buttons + 1 
  400. end 
  401.  
  402.  
  403. -- This gets called after naving or pressing a button... 
  404. -- Changes the Controlscheme internally and updates the menu. 
  405. -- 
  406. -- @param	button_data			Table of button data... 
  407. function pause_ctrl_scheme_update_scheme(button_data) 
  408. 	--This gets called after naving... 
  409. 	pause_menu_change_control_scheme(0) --always use first control scheme in list... 
  410. 	pause_ctrl_scheme_reset(button_data.current_value - 1) 
  411. end 
  412.  
  413.  
  414. function pause_ctrl_scheme_button_start(event, acceleration) 
  415. 	if Tween_done == true then 
  416. 		local screen_grp_h = vint_object_find("screen_grp", 0, Ctrl_scheme_doc) 
  417. 	 
  418. 		local screen_out_anim_h = vint_object_find("screen_out_anim", 0, Ctrl_scheme_doc) 
  419. 		lua_play_anim(screen_out_anim_h, 0, Ctrl_scheme_doc) 
  420. 		 
  421. 		menu_common_set_screen_data(List, Header_obj, Input_tracker, Screen_back_out_anim, Screen_out_anim, pause_menu_top_anim_in_done) 
  422.  
  423. 		bg_saints_slide_out() 
  424. 		-- stack is part of common, which is getting popped, so we don't update it. 
  425. 		if game_get_platform() ~= "PC" then 
  426. 			menu_common_transition_pop(5)	-- pause_ctrl_scheme, options_control, options, pause menu top, pause_menu common 
  427. 		else 
  428. 			menu_common_transition_pop(6) 
  429. 		end 
  430. 	end	 
  431. end 
  432.  
  433. Options_Controls_Data = { 
  434. 	[1] = { 
  435. 		type = TYPE_TOGGLE, 
  436. 		label = "CONTROL_SCHEME", 
  437. 		options = {"CONTROLS_SETUP_FOOT", "CONTROLS_SETUP_DRIVING", "CONTROLS_SETUP_AIRCRAFT"}, 
  438. 		current_value = 1, 
  439. 		on_nav = pause_ctrl_scheme_update_scheme, 
  440. 		on_select = pause_ctrl_scheme_update_scheme, 
  441. 	},	 
  442. } 
  443.  
  444. function pause_ctrl_scheme_mask_morph( screen_type, size_end_x, anchor_end_x ) 
  445. 	 
  446. end 
  447.  
  448. function pause_ctrl_scheme_set_slide_in_values( new_x ) 
  449. 	local ctrl_anchor_twn_h = vint_object_find("ctrl_ctrls_back_anchor", 0, Ctrl_scheme_doc) 
  450. 	local header_anchor_twn_h = vint_object_find("ctrl_header_back_anchor", 0, Ctrl_scheme_doc)  
  451. 	local list_anchor_twn_h = vint_object_find("ctrl_list_back_anchor", 0, Ctrl_scheme_doc)  
  452. 	 
  453. 	local ctrl_x,ctrl_y = vint_get_property(ctrl_anchor_twn_h, "end_value") 
  454. 	local header_x,header_y = vint_get_property(header_anchor_twn_h, "end_value") 
  455. 	local list_x,list_y = vint_get_property(list_anchor_twn_h, "end_value") 
  456. 	 
  457. 	local ctrl_offset = 46 
  458. 	local header_offset = 30 
  459. 	local list_offset = 0 
  460. 	if vint_is_std_res() == true then 
  461. 		ctrl_offset = 75 
  462. 		header_offset = 60 
  463. 		list_offset = 28 
  464. 	end 
  465. 	 
  466. 	--vint_set_property(ctrl_anchor_twn_h, "end_value", new_x + ctrl_offset, ctrl_y) 
  467. 	--vint_set_property(header_anchor_twn_h, "end_value", new_x + header_offset, header_y) 
  468. 	--vint_set_property(list_anchor_twn_h, "end_value", new_x + list_offset, list_y) 
  469. end 
  470.  
  471. -- Mouse inputs 
  472. function pause_ctrl_scheme_mouse_click(event, target_handle, mouse_x, mouse_y) 
  473. 	local hint_index = Menu_hint_bar:get_hint_index(target_handle) 
  474. 	if hint_index == 1 then 
  475. 		pause_ctrl_scheme_button_b() 
  476. 	end 
  477.  
  478. 	local new_index = Control_list:get_button_index(target_handle) 
  479. 	if new_index ~= 0 then 
  480. 		Control_list:set_selection(new_index) 
  481. 		pause_ctrl_scheme_nav_right() 
  482. 	end 
  483. 	if Control_list:is_left_arrow(target_handle) then 
  484. 		pause_ctrl_scheme_nav_left() 
  485. 	end 
  486. end 
  487.  
  488. function pause_ctrl_scheme_mouse_move(event, target_handle) 
  489. 	Menu_hint_bar:set_highlight(0) 
  490. 	 
  491. 	local hint_index = Menu_hint_bar:get_hint_index(target_handle) 
  492. 	if hint_index ~= 0 then 
  493. 		Menu_hint_bar:set_highlight(hint_index) 
  494. 	end 
  495. 	 
  496. 	local new_index = Control_list:get_button_index(target_handle) 
  497. 	if new_index ~= 0 then 
  498. 		Control_list:set_selection(new_index) 
  499. 		Control_list:move_cursor(0, true) 
  500. 	end 
  501. end