./pause_map.lua

  1. --TODO invert all items. 
  2. -- highlight_grp 
  3.  
  4. -- Uninvert the folllowing 
  5. -- icon 
  6. -- icon_highlight 
  7. -- line_1_txt 
  8. -- line_2_txt 
  9. -- line_3_txt 
  10. -- line_4_txt 
  11. -- line_5_txt 
  12. -- hint_bar_highlight 
  13. ---- Need to add functionality to invert this one.. 
  14.  
  15. local Entered_with_gamepad = false 
  16. local Crib_exit_is_crib = true 
  17. local PAUSE_MAP_COLOR_ZOOM_SELECTED 		= {R = 220/255, 	G = 220/255, 		B = 220/255} 
  18. local PAUSE_MAP_COLOR_ZOOM_UNSELECTED 		= {R = 170/255, 	G = 170/255,		B = 170/255} 
  19.  
  20. -- Info is on left side of icon... 
  21. local PAUSE_MAP_HIGHLIGHT_TEXT_X_OFFSET_LEFT = 8 
  22. local PAUSE_MAP_HIGHLIGHT_HINTS_X_OFFSET_LEFT = 17 
  23.  
  24. -- Info is on right side of icon... 
  25. local PAUSE_MAP_HIGHLIGHT_TEXT_X_OFFSET_RIGHT = 27 
  26. local PAUSE_MAP_HIGHLIGHT_HINTS_X_OFFSET_RIGHT = 35 
  27.  
  28. --Invert scale for std definition... this needs to match the scale of the screen set in cell_forground.lua for standard definition. 
  29. -- it is used because coordinates are sent to pause_map.lua in screen space and not translated scale. 
  30. local PAUSE_MAP_CURSOR_STD_RES_SCALE = 1.67 
  31.  
  32. local X_FUNC_NO_OP					= 0 
  33. local X_FUNC_PLACE_BOOKMARK		= 1 
  34. local X_FUNC_REMOVE_BOOKMARK		= 2 
  35. local X_FUNC_TAXI						= 3 
  36.  
  37. local INTERFACE_EVENT_ADD_GPS				= 0 
  38. local INTERFACE_EVENT_REMOVE_GPS			= 1 
  39. local INTERFACE_EVENT_ADD_BOOKMARK		= 2 
  40. local INTERFACE_EVENT_REMOVE_BOOKMARK	= 3 
  41.  
  42. --Icons that are oriented horizontally. 
  43. Pause_map_icons_rectangle = { 
  44. 	["map_other_bookmark_a_1"]	 		= true, 
  45. 	["map_other_bookmark_a_2"] 		= true, 
  46. 	["map_other_bookmark_a_3"] 		= true, 
  47. 	["map_other_bookmark_a_4"] 		= true, 
  48. 	["map_other_bookmark_a_5"] 		= true, 
  49. 	["map_other_bookmark_b_1"] 		= true, 
  50. 	["map_other_bookmark_b_2"] 		= true, 
  51. 	["map_other_bookmark_b_3"] 		= true, 
  52. 	["map_other_bookmark_b_4"] 		= true, 
  53. 	["map_other_bookmark_b_5"]			= true, 
  54. 	["map_other_crib"]               = true, 
  55. 	["map_other_crib_4sale"]         = true, 
  56. 	["map_other_crib_purchase"]      = true, 
  57. 	["map_other_train"]              = true, 
  58. 	["map_start_mission_3ss"]        = true, 
  59. 	["map_start_mission_bh"]         = true, 
  60. 	["map_start_mission_rn"] 			= true, 
  61.    ["map_start_mission_ss"] 			= true, 
  62. 	["map_start_mission_ul"] 			= true, 
  63. 	["map_other_hidden_mission"] 		= true, 
  64. 	 
  65. 	["map_store_property_owned"] 		= true, 
  66. 	 
  67. } 
  68.  
  69. local PAUSE_MAP_GREEN = 	{R = 136/255, 	G = 211/255,	B = 24/255} 
  70. local PAUSE_MAP_BLUE =  	{R = 25/255, 	G = 159/255, 	B = 229/255} 
  71. local PAUSE_MAP_YELLOW =  	{R = 245/255,	G = 228/255, 	B = 68/255} 
  72. local PAUSE_MAP_GREY =  	{R = 220/255,	G = 37/255, 	B = 0/255} 
  73. local PAUSE_MAP_PINK =  	{R = 204/255,	G =  73/255, 	B = 143/255} 
  74. local PAUSE_MAP_BROWN =  	{R = 153/255,	G =  69/255, 	B = 011/255} 
  75. local PAUSE_MAP_RED = 		{R = 220/255,	G =  37/255, 	B = 0/255} 
  76.  
  77. PAUSE_MAP_ICON_COLORS = {	 
  78. 	--Activities 
  79. 	["map_start_chopshop"] 			= PAUSE_MAP_RED, 
  80. 	 
  81. 	["map_start_crowdcontrol"] 		= PAUSE_MAP_BLUE, 
  82. 	["map_start_drugtrafficking"]	= PAUSE_MAP_BLUE, 
  83. 	["map_start_escort"] 			= PAUSE_MAP_BLUE, 
  84. 	["map_start_fightclub"] 		= PAUSE_MAP_RED, 
  85. 	["map_start_fuzz"] 				= PAUSE_MAP_BLUE,  
  86. 	["map_start_guardianangel"] 	= PAUSE_MAP_BLUE, 
  87. 	["map_start_heliassault"] 		= PAUSE_MAP_BLUE, 
  88. 	["map_start_hitman"] 			= PAUSE_MAP_RED, 
  89. 	["map_start_humantorch"] 		= PAUSE_MAP_BLUE, 
  90. 	["map_start_humantorch_grey"] 	= PAUSE_MAP_BLUE, 
  91. 	["map_start_insfraud"] 			= PAUSE_MAP_BLUE,  
  92. 	["map_start_insfraud_grey"] 	= PAUSE_MAP_BLUE,  
  93. 	["map_start_mayhem"] 			= PAUSE_MAP_BLUE,  
  94. 	["map_start_piracy"] 			= PAUSE_MAP_BLUE, 
  95. 	["map_start_racing"] 			= PAUSE_MAP_BLUE, 
  96. 	["map_start_snatch"] 			= PAUSE_MAP_BLUE, 
  97. 	["map_start_taxi"] 				= PAUSE_MAP_BLUE, 
  98. 	["map_start_flashpoint"] 		= PAUSE_MAP_RED, 
  99. 	["map_start_mayhem_ufo"]		= PAUSE_MAP_BLUE, 
  100. 	["map_start_genki_targets"]		= PAUSE_MAP_BLUE, 
  101. 	["map_start_mayhem_atank"]		= PAUSE_MAP_BLUE, 
  102. 	["map_start_hotspot"]			= PAUSE_MAP_RED, 
  103. 	["map_start_rift"]				= PAUSE_MAP_BLUE, 
  104. 	["map_start_catandmouse"]		= PAUSE_MAP_RED, 
  105. 	["map_start_coopdeathtag"]		= PAUSE_MAP_RED, 
  106. 	["map_start_sp_fightclub"]		= PAUSE_MAP_RED, 
  107. 	["map_start_xmas_present"]		= PAUSE_MAP_BLUE, 
  108. 	["map_start_xmas_genki"]		= PAUSE_MAP_BLUE, 
  109. 	["map_start_mayhem_mech"]		= PAUSE_MAP_BLUE, 
  110. 	["map_start_tk_mayhem"]			= PAUSE_MAP_BLUE, 
  111. 	["map_start_flight_mayhem"]		= PAUSE_MAP_BLUE, 
  112. 	["map_start_flight_mayhem_grey"]		= PAUSE_MAP_BLUE, 
  113. 	["map_start_mayhem_grey"]		= PAUSE_MAP_BLUE, 
  114.  
  115. 	--Stores 
  116. 	["map_store_cardealer_high"] 	= PAUSE_MAP_GREEN, 
  117. 	["map_store_cardealer_low"]	= PAUSE_MAP_GREEN, 
  118. 	["map_store_clothing"]			= PAUSE_MAP_GREEN,	 
  119. 	["map_store_food"]				= PAUSE_MAP_GREEN, 
  120. 	["map_store_forgive"]			= PAUSE_MAP_GREEN, 
  121. 	["map_store_gun"]					= PAUSE_MAP_GREEN, 
  122. 	["map_store_jewelry"]			= PAUSE_MAP_GREEN, 
  123. 	["map_store_liqour"]				= PAUSE_MAP_GREEN, 
  124. 	["map_store_mechanic"]			= PAUSE_MAP_GREEN, 
  125. 	["map_store_music"]				= PAUSE_MAP_GREEN, 
  126. 	["map_store_surgeon"]			= PAUSE_MAP_GREEN, 
  127. 	["map_store_tattoo"] 			= PAUSE_MAP_GREEN, 
  128. 	 
  129. 	-- 
  130. 	["map_store_cardealer_high_4sale"] 	= PAUSE_MAP_GREEN, 
  131. 	["map_store_cardealer_low_4sale"]	= PAUSE_MAP_GREEN, 
  132. 	["map_store_clothing_4sale"]			= PAUSE_MAP_GREEN,	 
  133. 	["map_store_food_4sale"]				= PAUSE_MAP_GREEN, 
  134. 	["map_store_forgive_4sale"]			= PAUSE_MAP_GREEN, 
  135. 	["map_store_gun_4sale"]					= PAUSE_MAP_GREEN, 
  136. 	["map_store_jewelry_4sale"]			= PAUSE_MAP_GREEN, 
  137. 	["map_store_liqour_4sale"]				= PAUSE_MAP_GREEN, 
  138. 	["map_store_mechanic_4sale"]			= PAUSE_MAP_GREEN, 
  139. 	["map_store_music_4sale"]				= PAUSE_MAP_GREEN, 
  140. 	["map_store_surgeon_4sale"]			= PAUSE_MAP_GREEN, 
  141. 	["map_store_tattoo_4sale"] 			= PAUSE_MAP_GREEN, 
  142. 	["map_store_property_4sale"] 			= PAUSE_MAP_RED,	 
  143. 	--Other 
  144. 	--Bookmarks 
  145. 	["map_other_bookmark_a_1"]			= PAUSE_MAP_GREY, 
  146. 	["map_other_bookmark_a_2"]			= PAUSE_MAP_GREY, 
  147. 	["map_other_bookmark_a_3"]			= PAUSE_MAP_GREY, 
  148. 	["map_other_bookmark_a_4"]			= PAUSE_MAP_GREY, 
  149. 	["map_other_bookmark_a_5"]			= PAUSE_MAP_GREY, 
  150. 	["map_other_bookmark_b_1"]			= PAUSE_MAP_GREY, 
  151. 	["map_other_bookmark_b_2"]			= PAUSE_MAP_GREY, 
  152. 	["map_other_bookmark_b_3"]			= PAUSE_MAP_GREY, 
  153. 	["map_other_bookmark_b_4"]			= PAUSE_MAP_GREY, 
  154. 	["map_other_bookmark_b_5"]			= PAUSE_MAP_GREY, 
  155.  
  156. 	--Collectables 
  157. 	 
  158. 	 
  159. 	--Randoms 
  160. 	["map_other_crib"]						= PAUSE_MAP_YELLOW, 
  161. 	["map_other_crib_4sale"]				= PAUSE_MAP_YELLOW,	 
  162. 	["map_other_ultor"]						= PAUSE_MAP_YELLOW,	 
  163. 	["map_other_crib_purchase"]			= PAUSE_MAP_YELLOW, 
  164. 	["map_other_hidden_act"]				= PAUSE_MAP_BLUE, 
  165. 	["map_other_hidden_crib"]				= PAUSE_MAP_YELLOW, 
  166. 	["map_other_hidden_mission"]			= PAUSE_MAP_RED, 
  167. 	["map_other_hidden_property"]			= PAUSE_MAP_GREY, 
  168. 	["map_other_hidden_store"]				= PAUSE_MAP_GREEN, 
  169. 	["map_other_property"]					= PAUSE_MAP_GREEN,			 
  170. 	["map_other_property_owned"]			= PAUSE_MAP_GREEN, 
  171. 	["map_other_hidden_diversion"]		= PAUSE_MAP_RED, 
  172.  
  173. 	--[[ 
  174. 	map_start_mission_3ss 
  175. 	map_start_mission_bh 
  176. 	map_start_mission_rn 
  177. 	map_start_mission_ss 
  178. 	map_start_mission_ul 
  179. ]] 
  180. } 
  181. PAUSE_MAP_ICON_SMALL = { 
  182. 	["map_other_hidden_act"]				= true, 
  183. 	["map_other_hidden_crib"]				= true, 
  184. 	["map_other_hidden_mission"]			= true, 
  185. 	["map_other_hidden_store"]				= true, 
  186. 	["map_other_hidden_property"]			= true, 
  187. 	["map_other_hidden_diversion"]		= true, 
  188. } 
  189.  
  190. PAUSE_MAP_HOMIE_HEADS = { 
  191. 	["ui_homie_pierce"]						= true, 
  192. 	["ui_homie_shaundi"]					= true, 
  193. 	["ui_homie_kinzie"]						= true, 
  194. 	["ui_homie_35_ben"]						= true, 
  195. 	["ui_homie_35_cid"]						= true, 
  196. 	["ui_homie_35_dane"]					= true, 
  197. 	["ui_homie_35_dj"]						= true, 
  198. 	["ui_homie_35_donnie"]					= true, 
  199. 	["ui_homie_35_julius"]					= true, 
  200. 	["ui_homie_matt"]						= true, 
  201. 	["ui_homie_35_maero"]					= true, 
  202. 	["ui_homie_35_shaundi"]					= true, 
  203. 	["ui_homie_35_tanya"]					= true, 
  204. 	["ui_homie_gat"]					= true, 
  205. 	["ui_homie_35_cyrus"]					= true, 
  206. 	["ui_homie_keith"]						= true, 
  207. 	["ui_homie_asha"]						= true, 
  208. } 
  209.  
  210. PAUSE_MAP_ORB = { 
  211. 	["map_other_collect_orb"]				= true, 
  212. } 
  213.  
  214. Pause_map_elements = { 
  215. 	base = { 
  216. 		map_grp_h = -1, 
  217. 		map_h = -1, 
  218. 		cursor_h = -1, 
  219. 		info_h = -1 
  220. 	}, 
  221. 	filters = { 
  222. 		activities_h = -1, 
  223. 		all_h = -1, 
  224. 		collectibles = -1, 
  225. 		cribs_h = -1, 
  226. 		flashpoints = -1, 
  227. 		missions_h = -1, 
  228. 		none_h = -1, 
  229. 		stores_h = -1, 
  230. 		strongholds_h = -1, 
  231. 		text_h = -1, 
  232. 	}, 
  233. }		 
  234.  
  235. Pause_map_anims = {} 
  236.  
  237. Pause_map = { done = false, } 
  238.  
  239. Map_mask_handle = 0 
  240. Filter_list_handle = 0 
  241. Filter_list_x = 0 
  242. Filter_list_y = 0 
  243. Hint_bar_bg = 0 
  244. Cursor_tool_handle = 0 
  245. Pause_map_gamepad_monitor_thread_handle = 0 
  246.  
  247. Pause_map_cursor_status = { 
  248. 	x = -1, 
  249. 	y = -1, 
  250. 	gps_active = false, 
  251. 	x_func = -1, 
  252. 	fade_mode = "in" 
  253. } 
  254.  
  255. Pause_map_filter = -1 
  256. Pause_map_filter_locked = false 
  257.  
  258. Pause_map_highlight_status = { } 
  259. Pause_map_stag_popup = {}		--Popup for stag mode... 
  260. Pause_map_stag_popup_x = 0 
  261. Pause_map_stag_popup_y = 0 
  262.  
  263. Yes_no_choices = { 
  264. 	[1] = { 
  265. 		type = TYPE_BUTTON, 
  266. 		label = "PAUSE_MENU_ACCEPT", 
  267. 		id = 1, 
  268. 	}, 
  269. 	[2] = { 
  270. 		type = TYPE_BUTTON, 
  271. 		label = "CONTROL_CANCEL", 
  272. 		id = 2, 
  273. 	}, 
  274. } 
  275.  
  276. --Default all special modes to false. 
  277. Pause_map_taxi_mode = false 
  278. Pause_map_stag_mode = false 
  279. Pause_map_underground = false 
  280. Pause_map_crib_exit = false 
  281.  
  282. Pause_map_swapping = false 
  283.  
  284. Pause_map_exit_phone = false 
  285.  
  286. --Local globals... 
  287. local Input_tracker				--Keeps track on input mapping... 
  288. local Mouse_input_tracker = 0 
  289. local Filter_mouse_input_tracker = 0 
  290. local Hint_bar 					--Hintbar for main screen. 
  291.  
  292. local Pause_map_filter_x = 0 
  293. local Pause_map_filter_y = 0 
  294.  
  295. local PC_hint_bar 
  296. local PC_zoom_in 
  297. local PC_zoom_out 
  298.  
  299. local Pause_map_control_meter 						--Control meter 
  300. local Pause_map_district_overlays = {}				--Table for the district overlays on the map.(LUCHADORES, 25%) 
  301. local Pause_map_district_overlays_count = 0		 
  302.  
  303. local Main_hint_data_set_gps 				= {CTRL_MENU_BUTTON_A,			"MENU_SET_GPS"} 
  304. local Main_hint_data_back 					= {CTRL_MENU_BUTTON_B,			"MENU_BACK"} 
  305. local Main_hint_data_back_map 			= {CTRL_MENU_BUTTON_BACK,		"MENU_RESUME_GAME"} 
  306. local Main_hint_data_add_bookmark 		= {CTRL_BUTTON_X,					"ADD_BOOKMARK", "B"}  
  307. local Main_hint_data_remove_gps 			= {CTRL_MENU_BUTTON_A,			"MENU_REMOVE_GPS"} 
  308. local Main_hint_data_remove_bookmark 	= {CTRL_BUTTON_X,					"REMOVE_BOOKMARK", "B"}  
  309. local Main_hint_data_taxi 					= {CTRL_BUTTON_X,					"CELL_TAXI_CAB" } 
  310. local Main_hint_data_set_gps_rmb 		= {HINT_BUTTON_RMB_OVERRIDE, 	"MENU_SET_GPS"} 
  311. local Main_hint_data_remove_gps_rmb 	= {HINT_BUTTON_RMB_OVERRIDE, 	"MENU_REMOVE_GPS"} 
  312. local Main_hint_data_exit_crib		 	= {CTRL_MENU_BUTTON_A,			"PAUSE_MAP_EXIT_CRIB"} 
  313. local Main_hint_data_exit_crib_rmb	 	= {HINT_BUTTON_RMB_OVERRIDE,	"PAUSE_MAP_EXIT_CRIB"} 
  314.  
  315. -- Only used for initialization 
  316. local Main_hint_data_waypoint_off = { 
  317. 		Main_hint_data_set_gps, 
  318. 		Main_hint_data_back_map, 
  319. 		Main_hint_data_back, 
  320. 		Main_hint_data_add_bookmark,		 
  321. } 
  322.  
  323. -- Only used for initialization 
  324. local Main_hint_data_waypoint_off_pc = { 
  325. 		Main_hint_data_set_gps_rmb, 
  326. 		Main_hint_data_add_bookmark,		 
  327. } 
  328.  
  329. local Pause_map_hints_stag				= {{CTRL_MENU_BUTTON_A,					"PAUSE_MAP_STAG_TAKEOVER_HINT"}} 
  330. local Pause_map_hint_exit_crib		= { Main_hint_data_exit_crib,			Main_hint_data_back } 
  331. local Pause_map_hint_exit_crib_kb	= { Main_hint_data_exit_crib_rmb,	Main_hint_data_back } 
  332. local Pause_map_hint_just_exit		= { Main_hint_data_back } 
  333.  
  334. function pause_map_init() 
  335.  
  336. 	Entered_with_gamepad = game_is_active_input_gamepad() 
  337. 	 
  338. 	local pause_map_doc_h = vint_document_find("pause_map") 
  339. 	Map_mask_handle = vint_object_find("map_mask", 0, pause_map_doc_h) 
  340. 	Filter_list_handle = vint_object_find("filter_list", 0, pause_map_doc_h) 
  341. 	Filter_list_x, Filter_list_y = vint_get_property(Filter_list_handle, "anchor") 
  342. 	Hint_bar_bg = vint_object_find("hint_bar_bg", 0, pause_map_doc_h) 
  343. 	Cursor_tool_handle = vint_object_find("cursor_tool", 0, pause_map_doc_h) 
  344.  
  345. 	Pause_map_filter = Vdo_cell_filter:new("filter_list") 
  346. 	Pause_map_filter:set_use_icons(true) 
  347. 	 
  348. 	Pause_map_control_meter = Vdo_city_control:new("control_meter") 
  349. 	 
  350. 	--Set callback for filter changing, the function that is passed here  
  351. 	--tells the game to change the map filter. 
  352. 	Pause_map_filter:filter_callback_set(game_pause_map_filter) 
  353. 	 
  354. 	-- Store off the Filter's default X & Y 
  355.  	Pause_map_filter_x, Pause_map_filter_y = Pause_map_filter:get_anchor() 
  356. 	 
  357. 	vint_set_property(vint_object_find("pause_map"), "map_mode", "pause_map") 
  358. 		 
  359. 	--Set transition in and out events after into/extros 
  360. 	local h = vint_object_find("root_animation") 
  361.  
  362. 	-- Check if we come from phone or open the map cold 
  363. 	-- Pause_map_from_menu is initialized in cell_foreground 
  364. 	-- and set in cell_menu_main 
  365. 	 
  366. 	local map_alpha_out_twn_h = vint_object_find("map_alpha_out_twn") 
  367. 	vint_set_property(map_alpha_out_twn_h, "end_event", "pause_map_hide_c_map") 
  368. 	 
  369. 	--Transition elements from our screen in... 
  370. 	--lua_play_anim(map_open_phone_anim_h, 0) 
  371.  
  372. 	--Make sure our cellphone frame is in view, sometimes we could come straight into this menu... 
  373. 	cell_show_frame() 
  374. 	 
  375. 	--Transition screen in... 
  376. 	if Cell_mission_to_map == true then 
  377. 		-- cto mission, show map 
  378. 		cell_transition_screen(CELL_STATE_LANDSCAPE, CELL_SCREEN_MAP, CELL_SCREEN_MISSIONS, pause_map_trans_in_complete) 
  379. 		cell_foreground_fade_out_header() 
  380. 	elseif Cell_rewards_to_map then 
  381. 		cell_transition_screen(CELL_STATE_LANDSCAPE, CELL_SCREEN_MAP, CELL_SCREEN_NONE, pause_map_trans_in_complete) 
  382. 	elseif Pause_map_from_menu then	 
  383. 		cell_transition_screen(CELL_STATE_LANDSCAPE, CELL_SCREEN_MAP, CELL_SCREEN_MAIN, pause_map_trans_in_complete) 
  384. 	else 
  385. 		--fade out header from the foreground... 
  386. 		cell_foreground_fade_out_header() 
  387. 		 
  388. 		cell_transition_screen(CELL_STATE_LANDSCAPE, CELL_SCREEN_MAP, CELL_SCREEN_NONE, pause_map_trans_in_complete) 
  389. 	end 
  390.  
  391. 	--hintbar...	 
  392. 	local hint_bar_element_name = "hint_bar" 
  393. 	if game_get_platform() == "PC" then 
  394. 		hint_bar_element_name = "pc_hint_bar" 
  395. 	end 
  396. 	Hint_bar = Vdo_hint_bar:new(hint_bar_element_name) 
  397. 	if game_get_platform() == "PC" then 
  398. 		Hint_bar:set_visible(false) 
  399. 	end 
  400. 	Hint_bar:enable_mini_mode(true) 
  401. 	 
  402. 	--Setup button hints	 
  403. 	if Pause_map_crib_exit == true then 
  404. 		pause_map_update_button_hints(Pause_map_hint_exit_crib) 
  405. 	elseif game_get_platform() == "PC" then 
  406. 		pause_map_update_button_hints(Main_hint_data_waypoint_off_pc) 
  407. 	else 
  408. 		pause_map_update_button_hints(Main_hint_data_waypoint_off) 
  409. 	end 
  410.  
  411. 	--Setup Cursor to data_item 
  412. 	vint_dataitem_add_subscription("PAUSE_MAP_CURSOR", "update", "pause_map_cursor_update")	 
  413. 	 
  414. 	--TODO: Cleanup the following 
  415. 	--Map Elements 
  416. 	local h = vint_object_find("map_grp") 
  417. 	Pause_map_elements.base.cursor_h = vint_object_find("cursor", h) 
  418. 	 
  419. 	h = vint_object_find("highlight_grp") 
  420. 	vint_set_property(h, "visible", false) 
  421. 	 
  422. 	h = vint_object_find("map_frame") 
  423. 	 
  424. 	--Hide info 
  425. 	vint_set_property(vint_object_find("info"), "visible", false) 
  426. 	--Hide original filter 
  427. 	vint_set_property(vint_object_find("filter_type_grp"), "visible", false) 
  428. 	 
  429. 	--hide map overlays 
  430. 	vint_set_property(vint_object_find("hood_overlay_grp"), "visible", false) 
  431.  
  432. 	--Animation find and pause 
  433. 	h = vint_object_find("root_animation") 
  434. 	Pause_map_anims.cursor_fade_anim_h 		= vint_object_find("cursor_fade_anim", h) 
  435. 	Pause_map_anims.cursor_fade_twn_h 		= vint_object_find("cursor_fade_twn", Pause_map_anims.cursor_fade_anim_h) 
  436. 	Pause_map_anims.highlight_anim_in_h		= vint_object_find("highlight_anim_in", h) 
  437. 	Pause_map_anims.highlight_anim_out_h	= vint_object_find("highlight_anim_out", h) 
  438. 	Pause_map_anims.icon_highlight_anim_h	= vint_object_find("icon_highlight_anim", h) 
  439. 	 
  440. 	--Subscribe to data items 
  441. 	vint_dataitem_add_subscription("PAUSE_MAP_HIGHLIGHT1", "update", "pause_map_highlight_update") 
  442. 	vint_dataitem_add_subscription("PAUSE_MAP_HIGHLIGHT2", "update", "pause_map_highlight_update") 
  443. 	vint_datagroup_add_subscription("map_filter", "update", "pause_map_filters_populate") 
  444. 	vint_datagroup_add_subscription("map_district_names", "update", "pause_map_district_overlay_update") 
  445.  
  446. 	--Set cash on interface 
  447. 	local cash_txt_h = vint_object_find("cash_value_txt") 
  448. 	vint_set_property(cash_txt_h, "text_tag", "{GAME_CASH}" .. format_cash(Hud_player_status.cash) .. "\n") 
  449.  
  450. 	--Set income per day 
  451. 	local income_per_day = get_world_income_dollars() 
  452. 	local income_value_txt_h = vint_object_find("income_value_txt") 
  453. 	--vint_set_property(income_value_txt_h, "text_tag", "{GAME_CASH}" .. format_cash(income_per_day) .. "\n") 
  454. 	vint_set_property(income_value_txt_h, "visible", false) 
  455. 	local income_label_txt_h = vint_object_find("income_label_txt") 
  456. 	vint_set_property(income_label_txt_h, "visible", false) 
  457.  
  458. 	Pause_map_stag_mode = pause_map_is_stag_mode() 
  459. 	local stag_grp_h = vint_object_find("stag_grp") 
  460. 	local stag_filter_h = vint_object_find("stag_filter") 
  461. 	 
  462. 	 
  463.  
  464. 	local stag_popup_overlay_grp_h = vint_object_find("stag_popup_overlay_grp") 
  465. 	vint_set_property(stag_popup_overlay_grp_h, "visible", false) 
  466. 	 
  467. 	if Pause_map_stag_mode == true then 
  468. 		--update help 
  469. 		local stag_grp_h = vint_object_find("stag_grp") 
  470. 		vint_set_property(stag_grp_h, "visible", true) 
  471. 		vint_set_property(stag_filter_h, "visible", true) 
  472. 		 
  473. 		-- Move normal map group down to make room for stag group... 
  474. 		local map_info_grp_h = vint_object_find("map_info_grp") 
  475. 		local x, y = vint_get_property(map_info_grp_h, "anchor") 
  476. 		y = 110	--positions the other stuff right below the stag block... 
  477. 		vint_set_property(map_info_grp_h, "anchor", x, y ) 
  478. 		 
  479. 		--Align instructions for localized text, this spaces our text out properly. 
  480. 		local stag_title_txt_h = vint_object_find("stag_title_txt") 
  481. 		local stag_instructions_txt_h = vint_object_find("stag_instructions_txt") 
  482. 		local align_text_table = { 
  483. 			{h = stag_title_txt_h, type = VINT_OBJECT_TEXT, space = 0}, 
  484. 			{h = stag_instructions_txt_h, type = VINT_OBJECT_TEXT, space = 2} 
  485. 		} 
  486. 		local width, height = vint_align_elements(align_text_table) 
  487. 	 
  488. 		-- now align group to center, text is center aligned in the document. 
  489. 		-- so current y position minus half the height of our text. Aligns perfectly with the stag logo. 
  490. 		local stag_text_grp_h = vint_object_find("stag_text_grp") 
  491. 		local x, y = vint_get_property(stag_text_grp_h, "anchor") 
  492. 		y = y - (height * .5) 
  493. 		vint_set_property(stag_text_grp_h, "anchor", x, y ) 
  494. 		 
  495. 		--setup popup... 
  496. 		Pause_map_stag_popup = Vdo_store_popup:new("stag_popup") 
  497. 		Pause_map_stag_popup:set_color({R = 204/255, G = 89/255, B = 10/255}) -- Stag color referenced from our document... 
  498. 		Pause_map_stag_popup:set_size(840, 400) 
  499. 		Pause_map_stag_popup:set_menu_option_text_scale(.9) 
  500. 		Pause_map_stag_popup:populate_list(Yes_no_choices, 2, 840, 2) 
  501. 		Pause_map_stag_popup:set_title("PAUSE_MAP_STAG_POPUP_TITLE") 
  502. 		 
  503. 		Pause_map_stag_popup_x, Pause_map_stag_popup_y = Pause_map_stag_popup:get_anchor() 
  504. 	else 
  505. 		--hide any stag related stuff... 
  506. 		vint_set_property(stag_grp_h, "visible", false) 
  507. 		vint_set_property(stag_filter_h, "visible", false) 
  508. 	end 
  509. 	 
  510. 	--Lock tutorials 
  511. 	if pause_map_is_tutorial_mode() == true then 
  512. 		pause_map_tutorial_mode_enable(true) 
  513. 		pause_map_filter_lock(true) 
  514. 	else 
  515. 		if not challenge_tutorial_mode_is_active() then 
  516. 			pause_map_tutorial_mode_enable(false) 
  517. 		end 
  518. 	end 
  519. 	 
  520. 	-- PC-specific elements 
  521. 	if game_get_platform() == "PC" then 
  522. 		PC_hint_bar = Vdo_hint_bar:new("hint_bar") 
  523. 	else 
  524. 		PC_hint_bar = Vdo_hint_bar:new("pc_hint_bar") 
  525. 	end 
  526.  
  527. 	PC_zoom_in = Vdo_base_object:new("zoom_in_bmp", 0, pause_map_doc_h) 
  528. 	PC_zoom_out = Vdo_base_object:new("zoom_out_bmp", 0, pause_map_doc_h) 
  529. 	if game_get_platform() == "PC" then 
  530.  
  531. 		if Pause_map_stag_mode == false then 
  532. 			local hint_data = { Main_hint_data_back, Main_hint_data_back_map } 
  533. 			PC_hint_bar:enable_mini_mode(true) 
  534. 			PC_hint_bar:enable_text_shadow(true) 
  535. 			PC_hint_bar:set_hints(hint_data, false, false) --Entered_with_gamepad, not Entered_with_gamepad) 
  536. 			 
  537. 			local width, height = PC_hint_bar:get_size() 
  538. 			width = floor(width) 
  539. 			height = floor(height) 
  540. 			local bg_width, bg_height = element_get_actual_size(Hint_bar_bg, width, height) 
  541. 			local hint_background_padding = 35 -- Additional padding needed for background height 
  542. 			element_set_actual_size(Hint_bar_bg, width + 35, bg_height) 
  543. 		else 
  544. 			PC_hint_bar:set_visible(false) 
  545. 			vint_set_property(Hint_bar_bg, "visible", false) 
  546. 		end 
  547. 		 
  548. 		Pause_map_gamepad_monitor_thread_handle = thread_new("pause_map_gamepad_monitor_thread") 
  549. 	else 
  550. 		-- Hide the elements on console 
  551. 		PC_hint_bar:set_visible(false) 
  552. 		PC_zoom_in:set_visible(false) 
  553. 		PC_zoom_out:set_visible(false) 
  554. 	end 
  555.  
  556. 	if game_machinima_hide_hints() then 
  557. 		 
  558. 		PC_hint_bar:set_visible(false) 
  559. 		vint_set_property(Hint_bar_bg, "visible", false) 
  560. 	end 
  561. 	 
  562. 	--glitch 
  563. 	--glitch_cell() 
  564. end 
  565.  
  566. function pause_map_cleanup() 
  567. 	--Event Tracking(Exit Menu) 
  568. 	game_event_tracking_interface_exit() 
  569. 	 
  570. 	if Pause_map_gamepad_monitor_thread_handle ~= 0 then 
  571. 		thread_kill(Pause_map_gamepad_monitor_thread_handle) 
  572. 	end 
  573. 	vint_set_mouse_cursor("") 
  574. 	 
  575. 	Pause_map_filter:cleanup() 
  576. end 
  577.  
  578. function pause_map_is_taxi_mode(tm) 
  579. 	Pause_map_taxi_mode = (tm == true) 
  580. 	--pause_map_btn_tips_format()   -- Can cause a crash if called during finish init 
  581. end 
  582.  
  583. function pause_map_is_crib_exit( ce ) 
  584. 	Pause_map_crib_exit = ( ce == true ) 
  585. 	 
  586. 	if ce == true then 
  587. 		pause_map_update_button_hints(Pause_map_hint_exit_crib) 
  588. 		pause_map_filter_lock( true ) 
  589. 	end 
  590. end 
  591.  
  592. --This gets called after diaglog confirming takeover of hood 
  593. function pause_map_stag_exit() 
  594. 	--close cell phone 
  595. 	Pause_map_exit_phone = true 
  596. 	pause_map_close() 
  597. 	vint_dataresponder_post("cell_menu_state_dr", "Set", ID_MAIN) --Load cell phone next time 
  598.  
  599. 	--set up delayed reward screen (cash and respect only) 
  600. 	if Pause_map_stag_mode then 
  601. 		pause_map_stag_takeover_do_reward() 
  602. 	end		 
  603. end 
  604.  
  605. -- This gets called from code when the 'A' button is pressed in STAG takeover mode 
  606. -- and the cursor is over a valid hood 
  607. function pause_map_stag_completion() 
  608. 	--A button is pressed bring up poopup... 
  609. 	local stag_popup_overlay_grp_h = vint_object_find("stag_popup_overlay_grp") 
  610. 	vint_set_property(stag_popup_overlay_grp_h, "visible", true) 
  611. 	 
  612. 	local insert_string = "PAUSE_MAP_STAG_POPUP_BODY" 
  613. 	if Completion_is_client() then 
  614. 		insert_string = "PAUSE_MAP_STAG_POPUP_BODY_CLIENT" 
  615. 	end 
  616. 	 
  617. 	local percent_hood_owned = {[0] = floor(100 * pause_map_stag_current_district_control())} 
  618. 	local percent_string = vint_insert_values_in_string(insert_string, percent_hood_owned) 
  619. 	Pause_map_stag_popup:set_text(percent_string) 
  620. 		 
  621. 	--Reset Position because of new text... 
  622. 	local width, height = Pause_map_stag_popup:get_size() 
  623. 	Pause_map_stag_popup:set_anchor(Pause_map_stag_popup_x, Pause_map_stag_popup_y- height) 
  624. 	 
  625. 	Pause_map_stag_popup:nav_enable(true, "pause_map_stag_popup_select", "pause_map_stag_popup_nav") 
  626. 	if Mouse_input_tracker ~= 0 then 
  627. 		Mouse_input_tracker:subscribe(false) 
  628. 	end 
  629. 	 
  630. 	if Filter_mouse_input_tracker ~= 0 then 
  631. 		Filter_mouse_input_tracker:subscribe(false) 
  632. 	end 
  633. 	vint_set_mouse_cursor("") 
  634. 	 
  635. 	game_UI_audio_play("UI_Main_Menu_Select")	 
  636. end 
  637.  
  638. ----------------------------------------------- 
  639. -- Closes pause map 
  640. ----------------------------------------------- 
  641. function pause_map_close() 
  642.  
  643. 	Input_tracker:subscribe(false) 
  644. 	 
  645. 	if Mouse_input_tracker ~= 0 then 
  646. 		Mouse_input_tracker:subscribe(false) 
  647. 	end 
  648. 	 
  649. 	if Filter_mouse_input_tracker ~= 0 then 
  650. 		Filter_mouse_input_tracker:subscribe(false) 
  651. 	end 
  652.  
  653. 	if Pause_map_exit_phone then 
  654. 		--Play menu back audio 
  655. 		ui_audio_post_event("UI_Hub_Menu_Back") 
  656. 		 
  657. 		cell_transition_screen(CELL_STATE_OUT, CELL_SCREEN_NONE, CELL_SCREEN_MAP, pause_map_trans_out_complete) 
  658. 	else 
  659. 		--Play menu back audio 
  660. 		ui_audio_post_event("UI_Hub_Menu_Back") 
  661. 		 
  662. 		if Cell_mission_to_map == true then 
  663. 			cell_foreground_fade_in_header() 
  664. 			cell_transition_screen(CELL_STATE_PORTRAIT, CELL_SCREEN_MISSIONS, CELL_SCREEN_MAP, pause_map_trans_out_complete) 
  665. 			 
  666. 		else 
  667. 			cell_transition_screen(CELL_STATE_PORTRAIT, CELL_SCREEN_MAIN, CELL_SCREEN_MAP, pause_map_trans_out_complete) 
  668. 			cell_foreground_update_tutorial("access_map") 
  669. 			cell_foreground_update_tutorial("open_menu") 
  670. 		end 
  671. 	end 
  672. end 
  673.  
  674. -- HVS_TBT 6/3/2014 - Added missing "pause_map_unload" function 
  675. function pause_map_unload() 
  676. 	Input_tracker:subscribe(false); 
  677. 	 
  678. 	if Mouse_input_tracker ~= 0 then 
  679. 		Mouse_input_tracker:subscribe(false) 
  680. 	end 
  681. 	 
  682. 	if Filter_mouse_input_tracker ~= 0 then 
  683. 		Filter_mouse_input_tracker:subscribe(false) 
  684. 	end 
  685.  
  686. 	cell_transition_screen(CELL_STATE_PORTRAIT, CELL_SCREEN_MAIN, CELL_SCREEN_MAP, nil) 
  687. 	--pop_screen() 
  688. end 
  689. ----------------------------------------------- 
  690. -- After all the map slides in, this sets up   
  691. -- subscrptions and shit 
  692. ----------------------------------------------- 
  693. function pause_map_trans_in_complete() 
  694. 	-- Track Input 
  695. 	Input_tracker = Vdo_input_tracker:new() 
  696. 	 
  697. 	Input_tracker:add_input("dpad_up", "pause_map_filter_nav", 50) 
  698. 	Input_tracker:add_input("dpad_down", "pause_map_filter_nav", 50)  
  699. 	 
  700. 	Input_tracker:add_input("map", "pause_map_input", 50) 
  701. 	Input_tracker:add_input("back", "pause_map_input", 50) 
  702. 	 
  703. 	Input_tracker:add_input("select", "pause_map_input_button_a", 50) 
  704. 	 
  705. 	if vint_is_std_res() then 
  706. 		local pause_map_doc_h = vint_document_find("pause_map") 
  707. 		-- Positions and scale values for map in SD 
  708. 		local pause_map_h = vint_object_find("pause_map") 
  709. 		vint_set_property(pause_map_h, "scale", 640, 480) 
  710. 		vint_set_property(pause_map_h, "anchor", -600, -400) 
  711. 		 
  712. 		local map_grp_h = vint_object_find("map_grp", 0, pause_map_doc_h) 
  713. 		vint_set_property(map_grp_h, "anchor", -600, -400) 
  714. 		 
  715. 		vint_set_property(Map_mask_handle, "scale", 640, 480) 
  716. 	 
  717. 		local map_all_grp_h = vint_object_find("map_all_grp", 0, pause_map_doc_h) 
  718. 		vint_set_property(map_all_grp_h, "anchor", 360, 240) 
  719.  
  720. 	end 
  721. 	 
  722. 	if game_get_platform() == "PC" then 
  723. 		Input_tracker:add_input("scancode", "pause_map_filter_nav", 50, false, 59) -- F1 key 
  724. 		 
  725. 		Input_tracker:add_input("scancode", "pause_map_input_button_x", 50, false, 48) 
  726. 		Input_tracker:add_input("gamepad_x", "pause_map_input_button_x", 50) 
  727. 	else 
  728. 		Input_tracker:add_input("alt_select", "pause_map_input_button_x", 50) 
  729. 	end 
  730.  
  731. 	Input_tracker:subscribe(true) 
  732. 	 
  733. 	if game_get_platform() == "PC" then 
  734. 	 
  735. 		local filter_list_visible = vint_get_property(Filter_list_handle, "visible") 
  736. 		if filter_list_visible then 
  737. 			Filter_mouse_input_tracker = Vdo_input_tracker:new() 
  738. 			Pause_map_filter:add_mouse_inputs("pause_map", Filter_mouse_input_tracker) 
  739. 			Filter_mouse_input_tracker:subscribe(true) 
  740. 		end 
  741.  
  742. 		Mouse_input_tracker = Vdo_input_tracker:new() 
  743. 		Mouse_input_tracker:add_mouse_input("mouse_right_click", "pause_map_mouse_right_click", 50, Map_mask_handle) 
  744. 		Mouse_input_tracker:add_mouse_input("mouse_middle_click", "pause_map_mouse_middle_click", 50, Map_mask_handle) 
  745. 		Mouse_input_tracker:add_mouse_input("mouse_move", "pause_map_mouse_move", 50, Map_mask_handle) 
  746. 		Mouse_input_tracker:add_mouse_input("mouse_click", "pause_map_mouse_move", 50, Map_mask_handle) 
  747. 		Mouse_input_tracker:add_mouse_input("mouse_drag", "pause_map_mouse_drag", 50, Map_mask_handle) 
  748. 		Mouse_input_tracker:add_mouse_input("mouse_drag_release", "pause_map_mouse_drag_release", 50, Map_mask_handle) 
  749. 		-- Zoom buttons 
  750. 		Mouse_input_tracker:add_mouse_input("mouse_move", "pause_map_mouse_move", 50, PC_zoom_in.handle) 
  751. 		Mouse_input_tracker:add_mouse_input("mouse_click", "pause_map_mouse_click", 50, PC_zoom_in.handle) 
  752. 		Mouse_input_tracker:add_mouse_input("mouse_move", "pause_map_mouse_move", 50, PC_zoom_out.handle) 
  753. 		Mouse_input_tracker:add_mouse_input("mouse_click", "pause_map_mouse_click", 50, PC_zoom_out.handle) 
  754. 		 
  755. 		--Mouse_input_tracker:add_mouse_input("mouse_click", "pause_map_mouse_click", 50, Hint_bar_bg) 
  756. 		--vint_set_property(Hint_bar_bg, "mouse_depth", -4004) 
  757. 		PC_hint_bar:add_mouse_inputs("pause_map", Mouse_input_tracker) 
  758. 		--vint_set_property(PC_hint_bar.handle, "mouse_depth", -4003) 
  759.  
  760. 		Mouse_input_tracker:subscribe(true) 
  761. 	end 
  762. end 
  763.  
  764. function pause_map_trans_out_complete() 
  765. 	pop_screen(); 
  766. 	if Pause_map_exit_phone == true then 
  767. 		pop_screen(); -- exit the phone completely 
  768. 		pop_screen(); -- pop off the cell phone fore/background 
  769. 		 
  770. 		if Cell_mission_to_map == true then 
  771. 			pop_screen()	-- extra pop for mission screen 
  772. 		end 
  773. 	end 
  774. end 
  775.  
  776. function pause_map_input(event, accelleration) 
  777.  
  778. 	if Pause_map_stag_mode then 
  779. 		--cannot exit during stag mode... 
  780. 		return 
  781. 	end 
  782.  
  783. 	if event == "map" then 
  784. 		--Close the interface 
  785. 		Pause_map_exit_phone = true 
  786. 		pause_map_close() 
  787. 		vint_dataresponder_post("cell_menu_state_dr", "Set", ID_MAP) --come back to the map next time 
  788. 	elseif event == "back" then 
  789. 		if Pause_map_crib_exit == true then 
  790. 			Pause_map_exit_phone = true 
  791. 			pause_map_close() 
  792. 		else 
  793. 			Pause_map_exit_phone = false 
  794. 			pause_map_close() 
  795. 			vint_dataresponder_post("cell_menu_state_dr", "Set", ID_MAIN) --Load cell phone next time 
  796. 		end 
  797. 	end 
  798. end 
  799.  
  800. ------------------------------------------------------------------------------- 
  801. -- Adds a filter to the list. Should be called via data responder. 
  802. -- 
  803. -- @param	filter_type		String indicating filter type 
  804. -- @param	filter_name		String of actual filter name 
  805. -- @param	x					X# of icons for the filter left to complete 
  806. -- @param	y					Y# of icons total for the filter 
  807. ------------------------------------------------------------------------------- 
  808. function pause_map_filters_populate(di_h) 
  809. 	local filter_type, filter_name, x, y = vint_dataitem_get(di_h) 
  810.  
  811. 	-- If we get PFT_ALL (always the first item), then we need to rebuild the list 
  812. 	if filter_type == "PFT_ALL" then 
  813. 		if Filter_mouse_input_tracker ~= 0 then 
  814. 			Filter_mouse_input_tracker:subscribe(false) 
  815. 			Filter_mouse_input_tracker:remove_all() 
  816. 		end 
  817. 		Pause_map_filter:clear() 
  818. 	end 
  819.  
  820. 	-- Add item to list... 
  821. 	Pause_map_filter:add(filter_type, filter_name, x, y) 
  822. 	 
  823. 	if filter_type == "PFT_NONE" then 
  824. 		--Last Item in list... now update... 
  825. 		local current_mode = game_pause_map_filter() 
  826. 		 
  827. 		if current_mode == "PFT_FILTER_LOCKED" then 
  828. 			pause_map_filter_lock(true) 
  829. 			--Hide the filters... 
  830. 			Pause_map_filter:set_visible(false) 
  831. 			 
  832. 			--Hide player info... 
  833. 			vint_set_property(vint_object_find("player_info_grp"), "visible", false) 
  834. 			return 
  835. 		end 
  836. 		 
  837. 		if Pause_map_stag_mode then 
  838. 			--Stag filter change 
  839. 			Pause_map_filter:change_filter_by_type("PFT_ALL", false) 
  840. 			pause_map_filter_lock(true) 
  841. 			Pause_map_filter:set_visible(false) 
  842. 			 
  843. 			--Hide player info... 
  844. 			vint_set_property(vint_object_find("player_info_grp"), "visible", false) 
  845. 		else		 
  846. 			--Change filter 
  847. 			Pause_map_filter:change_filter_by_type(current_mode, false) 
  848. 		end 
  849.  
  850. 		--List is completed... 
  851. 		pause_map_adjust_layout() 
  852. 		if Filter_mouse_input_tracker ~= 0 then 
  853. 			Pause_map_filter:add_mouse_inputs("pause_map", Filter_mouse_input_tracker) 
  854. 			Filter_mouse_input_tracker:subscribe(true) 
  855. 		end 
  856. 	end	 
  857.  
  858. end 
  859.  
  860. ------------------------------------------------------------------------------- 
  861. -- Navigating for filters 
  862. -- This is a callback setup via input tracker for changing filters. 
  863. ------------------------------------------------------------------------------- 
  864. function pause_map_filter_nav(event, accelleration) 
  865. 	if Pause_map_filter_locked == true then 
  866. 		--do not nav the filters... 
  867. 		return 
  868. 	end 
  869. 	--Check event type and move cursor... 
  870. 	if event == "dpad_up" then 
  871. 		Pause_map_filter:move_cursor(-1) 
  872. 	elseif event == "dpad_down" or event == "scancode" then 
  873. 		Pause_map_filter:move_cursor(1) 
  874. 	end 
  875. 	 
  876. 	--Play menu back audio 
  877. 	ui_audio_post_event("UI_Hub_Navigate") 
  878. end 
  879.  
  880. function pause_map_input_button_a() 
  881.  
  882. 	pause_map_set_gps() 
  883.  
  884. end 
  885.  
  886. function pause_map_input_button_x() 
  887. 	pause_map_add_bookmark() 
  888. end 
  889.  
  890. ------------------------------------------------------------------------------- 
  891. -- Turns screen into a locked mode where the user can't interact with filters  
  892. -- at all. 
  893. -- @param	is_locked			(Bool) Determines if the screen should be locked or not 
  894. ------------------------------------------------------------------------------- 
  895. function pause_map_filter_lock(is_locked) 
  896. 	Pause_map_filter_locked  = is_locked 
  897. 	--Hide the filters... 
  898. 	if Pause_map_crib_exit then 
  899. 		Pause_map_filter:set_visible(false) 
  900. 		Pause_map_filter:set_anchor( -1000, -1000 ) -- Move the filter out of the way to allow for mouse input on this part of the screen 
  901. 	else 
  902. 		Pause_map_filter:set_visible(is_locked) 
  903. 		Pause_map_filter:set_anchor( Pause_map_filter_x, Pause_map_filter_y ) -- Move the filter to its default position in case it's been moved 
  904. 	end 
  905. end 
  906.  
  907. function pause_map_adjust_layout() 
  908.  
  909. 	--Hood width 
  910. 	local district_name_txt_h = vint_object_find("district_name_txt") 
  911. 	local hood_name_txt_h = vint_object_find("hood_name_txt") 
  912.  
  913. 	local data = { 
  914. 		district_name_txt_h, 
  915. 		hood_name_txt_h, 
  916. 	} 
  917. 	local widest_element_h, hood_width = find_widest_text_element(data) 
  918. 	local widest_element_x, widest_element_y = 0, 0 
  919.  
  920. 	if widest_element_h ~= 0 then 
  921. 		widest_element_x, widest_element_y = vint_get_property(widest_element_h, "anchor") 
  922. 	end 
  923. 	 
  924. 	hood_width = hood_width + widest_element_x 
  925. 	 
  926. 	--Cash Width 
  927. 	local cash_label_txt_h 		= vint_object_find("cash_label_txt") 
  928. 	local income_label_txt_h 	= vint_object_find("income_label_txt") 
  929.  
  930. 	local data = { 
  931. 		cash_label_txt_h, 
  932. 		--income_label_txt_h, 
  933. 	} 
  934. 	local widest_element_h, cash_width = find_widest_text_element(data) 
  935. 	 
  936. 	local income_value_txt_h 	= vint_object_find("income_value_txt") 
  937. 	local cash_value_txt_h 		= vint_object_find("cash_value_txt") 
  938. 	local data = { 
  939. 		--income_value_txt_h, 
  940. 		cash_value_txt_h, 
  941. 	} 
  942. 	 
  943. 	local widest_element_h, cash_value_width = find_widest_text_element(data) 
  944. 	local cash_label_x, cash_label_y = vint_get_property(cash_label_txt_h, "anchor") 
  945. 	local income_x, income_y 			= vint_get_property(income_value_txt_h, "anchor") 
  946. 	local cash_x, cash_y  				= vint_get_property(cash_value_txt_h, "anchor") 
  947. 	local player_cash_width = cash_label_x + cash_width + cash_value_width + 10 
  948. 	 
  949. 	--Get Filter Width... 
  950. 	local filter_element_width = Pause_map_filter:adjust_layout() 
  951. 	 
  952. 	local bg_width = 290 
  953. 	 
  954. 	--Hood Info 
  955. 	bg_width = max(bg_width, hood_width)  
  956. 	 
  957. 	if Pause_map_stag_mode then 
  958. 		bg_width = max(bg_width, 300) 	--Stag bg width hardcode. 
  959. 	end 
  960.  
  961. 	if not Pause_map_stag_mode then 
  962. 		--Filter width... 
  963. 		bg_width = max(bg_width, filter_element_width) 
  964. 		 
  965. 		--Player Cash width 
  966. 		bg_width = max(bg_width, player_cash_width)  
  967. 	end 
  968. 	 
  969. 	--Reset Width of filters... 
  970. 	Pause_map_filter:adjust_layout(bg_width) 
  971. 	 
  972. 	--Reset width of cash values. 
  973. 	local player_info_bg_h = vint_object_find("player_info_bg") 
  974. 	vint_set_property(income_value_txt_h, "anchor", bg_width, income_y) 
  975. 	vint_set_property(cash_value_txt_h, "anchor", bg_width, cash_y) 
  976. 	 
  977. 	--pad out the width for our backgrounds 
  978. 	bg_width = bg_width + 10 
  979.  
  980. 	local cash_value_width, cash_value_height =  element_get_actual_size(cash_label_txt_h) 
  981. 	local new_cash_value_height = cash_value_height + 5 
  982.  
  983. 	--filter padding... 
  984. 	local filter_bg_h = vint_object_find("filter_bg") 
  985. 	local hood_info_bg_h = vint_object_find("hood_info_bg") 
  986. 	local width, height = element_get_actual_size(filter_bg_h) 
  987. 	element_set_actual_size(filter_bg_h, bg_width, height) 
  988.  
  989. 	width, height = element_get_actual_size(hood_info_bg_h) 
  990. 	element_set_actual_size(hood_info_bg_h, bg_width, height) 
  991.  
  992. 	local stag_bg_h = vint_object_find("stag_bg") 
  993. 	width, height = element_get_actual_size(stag_bg_h) 
  994. 	element_set_actual_size(stag_bg_h, bg_width, height) 
  995. 	 
  996. 	local player_info_bg_width, player_info_bg_height = element_get_actual_size(player_info_bg_h) 
  997. 	element_set_actual_size(player_info_bg_h, bg_width, new_cash_value_height) 
  998.  
  999. 	local new_filter_y = Filter_list_y - cash_value_height + 8 
  1000. 	vint_set_property(Filter_list_handle, "anchor", Filter_list_x, new_filter_y) 
  1001.  
  1002. end 
  1003.  
  1004. -------------------------------------------------- 
  1005. --Highlight Update 
  1006. -------------------------------------------------- 
  1007. function anim_out_complete(tween_h) 
  1008. 	for idx, val in pairs(Pause_map_highlight_status) do  
  1009. 		if val.last_tween_out == tween_h then 
  1010. 		 
  1011. 			local status = Pause_map_highlight_status[idx] 
  1012. 			vint_object_destroy(status.info_h) 
  1013. 			vint_object_destroy(status.in_anim_h) 
  1014. 			vint_object_destroy(status.out_anim_h) 
  1015. 			vint_object_destroy(status.icon_highlight_anim_h) 
  1016.  
  1017. 			Pause_map_highlight_status[idx] = nil 
  1018. 			break 
  1019. 		end 
  1020. 	end 
  1021. end 
  1022.  
  1023. function anim_in_complete() 
  1024. 	debug_print("vint", "anim_in_complete \n") 
  1025. 	Pause_map.done = true 
  1026. end 
  1027.  
  1028.  
  1029. ------------------------------------------------------------------------------- 
  1030. -- Updates the highlight on the pause map... this is done via 2 dataitems that 
  1031. -- Swap 
  1032. -- DATAITEM: PAUSE_MAP_HIGHLIGHT1, PAUSE_MAP_HIGHLIGHT2 
  1033. -- @param	icon_bmp_name,  
  1034. -- @param	text_line_1				-- First line 
  1035. -- @param	text_line_2				-- Second Line 
  1036. -- @param	text_line_3				-- Third Line (Left) 
  1037. -- @param	text_line_4				-- Fourth Line (Right) 
  1038. -- @param	text_line_5				-- Fifth Line (Left - Medals) 
  1039. -- @param	is_highlighted			-- Is Highlighted? (Are we over the icon or off) 
  1040. -- @param 	is_gps_target			--	Is the thing a gps target? 
  1041. -- @param	is_mad_icon				-- Is the thing a mad icon? 
  1042. -- @param	is_store_icon			-- Is the thing a store icon? 
  1043. -- @param 	is_crib_icon			-- Is the thing a crib icon? 
  1044. -- @param 	taxi_available			-- Is there a taxi available? 
  1045. ------------------------------------------------------------------------------- 
  1046. function pause_map_highlight_update(di_h) 
  1047.  
  1048. 	-- Get dataitem... 
  1049. 	local icon_bmp_name, overlay_bmp_name, text_line_1, text_line_2, text_line_3, text_line_4, text_line_5, is_highlighted, is_gps_target, is_mad_icon, is_store_icon, is_crib_icon, taxi_available = vint_dataitem_get(di_h) 
  1050.  
  1051. 	--dataitem_to_debug(di_h, "icon_bmp_name", "text_line_1", "text_line_2", "text_line_3", "text_line_4", "is_highlighted", "is_gps_target", "taxi_available") 
  1052.  
  1053. 	--Exit if there is no icon 
  1054. 	if icon_bmp_name == nil then 
  1055. 		return 
  1056. 	end 
  1057. 	 
  1058. 	Crib_exit_is_crib = is_crib_icon 
  1059. 	local status = Pause_map_highlight_status[di_h] 
  1060.  
  1061. 	--Check to see if the highlight/info element has been created then initalize the element if it hasn't. 
  1062. 	if status == nil then 
  1063. 		 
  1064. 		--Clone the object and find targets. 
  1065. 		local info_h = vint_object_clone(vint_object_find("highlight_grp")) 
  1066. 		local icon_h = vint_object_find("icon", info_h) 
  1067. 		local icon_highlight_h = vint_object_find("icon_highlight", info_h) 
  1068. 		local icon_overlay_h = vint_object_find("icon_overlay", info_h) 
  1069. 		local lock_h = vint_object_find("lock", info_h) 
  1070. 		local text_grp_h = vint_object_find("text_grp", info_h) 
  1071.  
  1072. 		local text_line_1_h = vint_object_find("line_1_txt", info_h) 
  1073. 		local text_line_2_h = vint_object_find("line_2_txt", info_h) 
  1074. 		local text_line_3_h = vint_object_find("line_3_txt", info_h) 
  1075. 		local text_line_4_h = vint_object_find("line_4_txt", info_h) 
  1076. 		local text_line_5_h = vint_object_find("line_5_txt", info_h) 
  1077. 		 
  1078. 		--Clone, Retarget, and Pause Animations 
  1079. 		local in_anim_h = vint_object_clone(Pause_map_anims.highlight_anim_in_h) 
  1080. 		local out_anim_h = vint_object_clone(Pause_map_anims.highlight_anim_out_h) 
  1081. 		local icon_highlight_anim_h = vint_object_clone(Pause_map_anims.icon_highlight_anim_h) 
  1082. 		vint_set_property(in_anim_h, "is_paused", true) 
  1083. 		vint_set_property(out_anim_h, "is_paused", true) 
  1084.  
  1085. 		vint_set_property(icon_highlight_anim_h, "is_paused", true) 
  1086. 		vint_set_property(in_anim_h, "target_handle", info_h) 
  1087. 		vint_set_property(out_anim_h, "target_handle", info_h) 
  1088. 		vint_set_property(icon_highlight_anim_h, "target_handle", info_h) 
  1089. 		 
  1090. 		 
  1091. 		local hint_bar = Vdo_hint_bar:new("hint_bar_highlight", info_h) 
  1092. 		hint_bar:enable_mini_mode(true)			--Make hintbar mini! 
  1093. 		 
  1094. 		Pause_map_highlight_status[di_h] = { 
  1095. 			info_h = info_h, 
  1096. 			in_anim_h = in_anim_h, 
  1097. 			out_anim_h = out_anim_h, 
  1098. 			 
  1099. 			hint_bar = hint_bar, 
  1100.  
  1101. 			icon_highlight_anim_h = icon_highlight_anim_h, 
  1102. 			icon_h = icon_h, 
  1103. 			icon_highlight_h = icon_highlight_h, 
  1104. 			icon_overlay_h = icon_overlay_h, 
  1105. 			lock_h = lock_h, 
  1106. 			text_grp_h = text_grp_h, 
  1107. 			text_line_1_h = text_line_1_h, 
  1108. 			text_line_2_h = text_line_2_h, 
  1109. 			text_line_3_h = text_line_3_h, 
  1110. 			text_line_4_h = text_line_4_h, 
  1111. 			text_line_5_h = text_line_5_h, 
  1112. 			icon_bmp_name = -1, 
  1113. 			overlay_bmp_name = -1, 
  1114. 			text_line_1 = -1, 
  1115. 			text_line_2 = -1, 
  1116. 			text_line_3 = -1, 
  1117. 			text_line_4 = -1, 
  1118. 			text_line_5 = -1, 
  1119. 			text_width = -1, 
  1120. 			text_height = -1, 
  1121. 			alignment = "left", 
  1122. 			is_highlighted = -1, 
  1123. 			is_gps_target = -1, 
  1124. 		} 
  1125. 		 
  1126. 		status = Pause_map_highlight_status[di_h] 
  1127. 	end 
  1128. 	 
  1129. 	--Create locals from the status table 
  1130. 	local info_h = status.info_h 
  1131. 	local icon_h = status.icon_h 
  1132. 	local icon_highlight_h = status.icon_highlight_h 
  1133. 	local icon_overlay_h = status.icon_overlay_h 
  1134. 	local text_grp_h = status.text_grp_h 
  1135. 	local lock_h = status.lock_h 
  1136. 	local text_line_1_h = status.text_line_1_h 
  1137. 	local text_line_2_h = status.text_line_2_h 
  1138. 	local text_line_3_h = status.text_line_3_h 
  1139. 	local text_line_4_h = status.text_line_4_h 
  1140. 	local text_line_5_h = status.text_line_5_h 
  1141. 	 
  1142. 	 
  1143. 	local icon_tween_scale_h = vint_object_find( "icon_scale_twn_1", status.in_anim_h ) 
  1144. 	local its_a_homie_head = PAUSE_MAP_HOMIE_HEADS[ icon_bmp_name ] 
  1145. 	local its_an_orb = PAUSE_MAP_ORB[ icon_bmp_name ] 
  1146. 	 
  1147. 	--Set Icon bitmap 
  1148. 	if icon_bmp_name ~= status.icon_bmp_name or overlay_bmp_name ~= status.overlay_bmp_name then 
  1149. 		vint_set_property(icon_h, "image", icon_bmp_name) 
  1150. 		vint_set_property(icon_h, "alpha", 0) 
  1151. 		vint_set_property(icon_highlight_h, "image", icon_bmp_name) 
  1152. 		vint_set_property(icon_highlight_h, "alpha", 0) 
  1153. 		 
  1154. 		if its_a_homie_head == true then 
  1155. 			vint_set_property( icon_h, "scale", .5, .5 ) 
  1156. 			vint_set_property( icon_highlight_h, "scale", .5, .5 ) 
  1157. 		elseif its_an_orb == true then 
  1158. 			vint_set_property( icon_h, "scale", .5, .5 ) 
  1159. 			vint_set_property( icon_highlight_h, "scale", .5, .5 ) 
  1160. 		else 
  1161. 			vint_set_property( icon_h, "scale", 1, 1 ) 
  1162. 			vint_set_property( icon_highlight_h, "scale", 1, 1 ) 
  1163. 		end 
  1164. 		 
  1165. 		--Set overlay image (e.g. 4sale) 
  1166. 		vint_set_property(icon_overlay_h, "image", overlay_bmp_name) 
  1167. 		vint_set_property(icon_overlay_h, "alpha", 0) 
  1168. 		status.icon_bmp_name = icon_bmp_name 
  1169. 		status.overlay_bmp_name = overlay_bmp_name 
  1170. 	end 
  1171. 	 
  1172. 	--Determine if we are going to show the overlay image... 
  1173. 	if status.overlay_bmp_name ~= "" then 
  1174. 		vint_set_property(icon_overlay_h, "visible", true) 
  1175. 	else 
  1176. 		vint_set_property(icon_overlay_h, "visible", false) 
  1177. 	end 
  1178. 	 
  1179. 	--vint_set_property(info_h, "anchor", position_x, position_y)			--Set screen coordinate positions 
  1180. 	vint_set_property(info_h, "visible", true)								--show item 
  1181.  
  1182. 	if its_a_homie_head == true then 
  1183. 		--vint_set_property( lock_h, "visible", false ) 
  1184. 		 
  1185. 		vint_set_property( icon_tween_scale_h, "start_value", 0.5, 0.5 ) 
  1186. 		vint_set_property( icon_tween_scale_h, "end_value", 0.6 * 1.25, 0.6 * 1.25 ) 
  1187. 	elseif its_an_orb == true then 
  1188. 		vint_set_property( icon_tween_scale_h, "start_value", 0.5, 0.5 ) 
  1189. 		vint_set_property( icon_tween_scale_h, "end_value", 1.25, 1.25 ) 
  1190. 	else 
  1191. 		vint_set_property( lock_h, "visible", true ) 
  1192. 	 
  1193. 		vint_set_property( icon_tween_scale_h, "start_value", 1, 1 ) 
  1194. 		vint_set_property( icon_tween_scale_h, "end_value", 1.25, 1.25 ) 
  1195.  
  1196. 		--Adjust angle of the lock on graphic based on the icon name 
  1197. 		if Pause_map_icons_rectangle[icon_bmp_name] == true then 
  1198. 			vint_set_property(lock_h, "rotation", 0) 
  1199. 		else 
  1200. 			vint_set_property(lock_h, "rotation", .78) 
  1201. 		end 
  1202. 		 
  1203. 		-- Re-Scale the lock icon that goes around the icon in the tween... 
  1204. 		local in_twn_h = vint_object_find("lock_scale_twn", status.in_anim_h) 
  1205. 		local out_twn_h = vint_object_find("lock_scale_twn", status.out_anim_h) 
  1206. 		 
  1207. 		if PAUSE_MAP_ICON_SMALL[icon_bmp_name] == true then 
  1208. 			vint_set_property(in_twn_h, "end_value", .75, .75) 
  1209. 			vint_set_property(out_twn_h, "start_value", .75, .75) 
  1210. 		else 
  1211. 			vint_set_property(in_twn_h, "end_value", 1.0, 1.0) 
  1212. 			vint_set_property(out_twn_h, "start_value", 1.0, 1.0) 
  1213. 		end 
  1214. 	end 
  1215. 	 
  1216. 	--Set color of highlight bar 
  1217. 	local cursor_line_h = vint_object_find("cursor_line_bg", info_h) 
  1218. 	local color = PAUSE_MAP_ICON_COLORS[icon_bmp_name] 
  1219. 	if color then 
  1220. 		vint_set_property(cursor_line_h, "tint", color.R, color.G, color.B) 
  1221. 	else 
  1222. 		vint_set_property(cursor_line_h, "tint", PAUSE_MAP_GREY.R, PAUSE_MAP_GREY.G, PAUSE_MAP_GREY.B) 
  1223. 	end 
  1224. 	 
  1225. 		 
  1226. 	-- Hintbar 
  1227. 	local hint_data 
  1228. 	if taxi_available then 
  1229. 		hint_data = { 
  1230. 			{CTRL_MENU_BUTTON_A, "MENU_GPS"}, 
  1231. 			{CTRL_BUTTON_X, "CELL_TAXI_CAB"} 
  1232. 		} 
  1233. 	elseif Pause_map_crib_exit then 
  1234. 		if is_crib_icon ~= true then 
  1235. 			hint_data = nil 
  1236. 			local hint_bar_highlight_bg_h = vint_object_find("hint_bar_highlight_bg", info_h) 
  1237. 			vint_set_property(hint_bar_highlight_bg_h, "visible", false) 
  1238. 		else 
  1239. 			if game_get_platform() == "PC" then	 
  1240. 				hint_data = { 
  1241. 					{HINT_BUTTON_RMB_OVERRIDE, "PAUSE_MAP_EXIT_CRIB"} 
  1242. 				} 
  1243. 			else 
  1244. 				hint_data = { 
  1245. 					{CTRL_MENU_BUTTON_A, "PAUSE_MAP_EXIT_CRIB"}, 
  1246. 				} 
  1247. 			end 
  1248. 		end 
  1249. 	else 
  1250. 		if game_get_platform() == "PC" then	 
  1251. 			hint_data = { 
  1252. 				{HINT_BUTTON_RMB_OVERRIDE, "MENU_GPS"} 
  1253. 			} 
  1254. 		else 
  1255. 			hint_data = { 
  1256. 				{CTRL_MENU_BUTTON_A, "MENU_GPS"} 
  1257. 			} 
  1258. 		end 
  1259. 	end 
  1260.  
  1261. 	if game_machinima_hide_hints() then 
  1262. 		--hint_data = nil 
  1263. 		local hint_bar_highlight_bg_h = vint_object_find("hint_bar_highlight_bg", info_h) 
  1264. 		vint_set_property(hint_bar_highlight_bg_h, "visible", false) 
  1265. 	end 
  1266.  
  1267. 	if Pause_map_stag_mode then 
  1268. 		hint_data = nil 
  1269. 		local hint_bar_highlight_bg_h = vint_object_find("hint_bar_highlight_bg", info_h) 
  1270. 		vint_set_property(hint_bar_highlight_bg_h, "visible", false) 
  1271. 	end 
  1272.  
  1273. 	status.hint_bar:set_hints(hint_data, false, false)--Entered_with_gamepad, not Entered_with_gamepad) 
  1274. 	 
  1275. 	--Set text tags 
  1276. 	vint_set_property(text_line_1_h, "text_tag", text_line_1) 
  1277. 	vint_set_property(text_line_2_h, "text_tag", text_line_2) 
  1278. 	vint_set_property(text_line_3_h, "text_tag", text_line_3) 
  1279. 	vint_set_property(text_line_4_h, "text_tag", text_line_4) 
  1280. 	vint_set_property(text_line_5_h, "text_tag", text_line_5) 
  1281. 	 
  1282. 	--debug_print("text_line_2: " ..var_to_string(text_line_2) .. "\n") 
  1283. 	--debug_print("text_line_5: " ..var_to_string(text_line_5) .. "\n") 
  1284.  
  1285. 	--Now update boxes... We will calculate vertical size first for each box... 
  1286. 	 
  1287. 	local box_height_new = 83	--Fullsize 
  1288. 	local hint_y_offset = 15 
  1289. 	--If text tags equal nil then we need to set the string to "" 
  1290. 	if text_line_5 == nil or text_line_5 == "" then 
  1291. 		text_line_5 = "" 
  1292. 		box_height_new = 56 
  1293. 	end 
  1294. 	 
  1295. 	if text_line_4 == nil or text_line_4 == "" then 
  1296. 		text_line_4 = "" 
  1297. 	end 
  1298. 	 
  1299. 	if text_line_3 == nil or text_line_3 == "" then 
  1300. 		text_line_3 = "" 
  1301. 		box_height_new = 32 
  1302. 	end 
  1303.  
  1304. 	if text_line_2 == nil or text_line_2 == "" then 
  1305. 		text_line_2 = "" 
  1306. 		box_height_new = 1 
  1307. 		hint_y_offset = 15 
  1308. 	end 
  1309. 	 
  1310. 	if text_line_1 == nil or text_line_1 == "" then 
  1311. 		text_line_1 = ""	 
  1312. 		box_height_new = 1 
  1313. 		hint_y_offset = 0 
  1314. 	end 
  1315. 	 
  1316. 	 
  1317.  
  1318. 	--Get the largets width of the text... so we know what to do... 
  1319. 	if text_line_1 ~= status.text_line_1 or text_line_2 ~= status.text_line_2 or text_line_3 ~= status.text_line_3 or text_line_4 ~= status.text_line_4 or text_line_5 ~= status.text_line_5 then 
  1320. 					 
  1321. 		--Get Largest text width and height 
  1322. 		local text_width = 0 
  1323. 		local text_height = 0 
  1324. 		local temp1_width, temp1_height = element_get_actual_size(text_line_1_h) 
  1325. 		local temp2_width, temp2_height = element_get_actual_size(text_line_2_h) 
  1326. 		local temp3_width, temp3_height = element_get_actual_size(text_line_3_h) 
  1327. 		local temp4_width, temp4_height = element_get_actual_size(text_line_4_h) 
  1328. 		local temp5_width, temp5_height = element_get_actual_size(text_line_5_h) 
  1329. 		local temp3_x, temp3_y = vint_get_property(text_line_1_h, "anchor") 
  1330. 		local temp4_x, temp4_y = vint_get_property(text_line_4_h, "anchor") 
  1331. 		local temp4_width = temp4_width + temp4_x - temp3_x 
  1332. 		local hintbar_width, hintbar_height = status.hint_bar:get_size() 
  1333. 		 
  1334. 		text_width = max(temp1_width, text_width) 
  1335. 		text_width = max(temp2_width, text_width) 
  1336. 		text_width = max(temp3_width, text_width) 
  1337. 		text_width = max(temp4_width, text_width) 
  1338. 		text_width = max(temp5_width, text_width) 
  1339. 		text_width = max(hintbar_width, text_width) 
  1340.  
  1341. 		text_width = text_width + 40 
  1342. 		 
  1343. 		if temp3_height > 30 then 
  1344. 			box_height_new = 80 
  1345. 		end 
  1346. 		 
  1347. 		--Resize boxes... 
  1348. 		local box_h = vint_object_find("cursor_bg", info_h) 
  1349. 		local hint_bar_highlight_bg_h = vint_object_find("hint_bar_highlight_bg", info_h) 
  1350. 		local hint_bar_bg_width, hint_bar_bg_height = element_get_actual_size(hint_bar_highlight_bg_h) 
  1351. 		local box_width, box_height = element_get_actual_size(box_h) 
  1352. 		local cursor_line_width, cursor_line_height = element_get_actual_size(cursor_line_h) 
  1353. 		 
  1354. 		-- Colored box (No that is not racist) 
  1355. 		element_set_actual_size(cursor_line_h, text_width, cursor_line_height) 
  1356. 		 
  1357. 		-- Backgorund for descripton text... 
  1358. 		element_set_actual_size(box_h, text_width, box_height_new) 
  1359. 		 
  1360. 		--Hintbar... 
  1361. 		local hint_grp_h = vint_object_find("highlight_hint_grp", info_h) 
  1362. 		local x, y = vint_get_property(hint_grp_h, "anchor") 
  1363. 		 
  1364. 		vint_set_property(hint_grp_h, "anchor", x, box_height_new + hint_y_offset) 
  1365. 		 
  1366. 		element_set_actual_size(hint_bar_highlight_bg_h, text_width, hint_bar_bg_height ) 
  1367. 		 
  1368. 		--Invert highlight or not?' 
  1369. 		local invert = false 
  1370. 		 
  1371. 		local right_side_of_box = Pause_map_cursor_status.x + text_width 
  1372. 		if vint_is_std_res() then 
  1373. 			if right_side_of_box > 996 then 
  1374. 				invert = true 
  1375. 			end 
  1376. 		else 
  1377. 			if right_side_of_box > 1175 then 
  1378. 				invert = true 
  1379. 			end 
  1380. 		end 
  1381. 		if invert then 
  1382. 			--Move group elements... (Boxes) 
  1383. 			local x, y = vint_get_property(hint_grp_h, "anchor") 
  1384. 			vint_set_property(hint_grp_h, "anchor", -text_width, y) 
  1385. 			local x, y = vint_get_property(text_grp_h, "anchor") 
  1386. 			vint_set_property(text_grp_h, "anchor", -text_width, y) 
  1387. 			 
  1388. 			--Move insides of boxes 
  1389. 			local hint_bar_highlight_h = vint_object_find("hint_bar_highlight", hint_grp_h) 
  1390. 			local x, y = vint_get_property(hint_bar_highlight_h, "anchor") 
  1391. 			vint_set_property(hint_bar_highlight_h, "anchor", PAUSE_MAP_HIGHLIGHT_HINTS_X_OFFSET_LEFT, y) 
  1392. 		 
  1393. 			local text_items_grp_h = vint_object_find("text_items_grp", text_grp_h) 
  1394. 			local x, y = vint_get_property(text_items_grp_h, "anchor") 
  1395. 			vint_set_property(text_items_grp_h, "anchor", PAUSE_MAP_HIGHLIGHT_TEXT_X_OFFSET_LEFT, y) 
  1396. 		else 
  1397. 			 
  1398. 			--Move group elements... (Boxes) 
  1399. 			local x, y = vint_get_property(hint_grp_h, "anchor") 
  1400. 			vint_set_property(hint_grp_h, "anchor", 0, y) 
  1401. 			local x, y = vint_get_property(text_grp_h, "anchor") 
  1402. 			vint_set_property(text_grp_h, "anchor", 0, y) 
  1403. 		 
  1404. 			--Move insides of boxes 
  1405. 			local hint_bar_highlight_h = vint_object_find("hint_bar_highlight", hint_grp_h) 
  1406. 			local x, y = vint_get_property(hint_bar_highlight_h, "anchor") 
  1407. 			vint_set_property(hint_bar_highlight_h, "anchor", PAUSE_MAP_HIGHLIGHT_HINTS_X_OFFSET_RIGHT, y) 
  1408. 		 
  1409. 			local text_items_grp_h = vint_object_find("text_items_grp", text_grp_h) 
  1410. 			local x, y = vint_get_property(text_items_grp_h, "anchor") 
  1411. 			vint_set_property(text_items_grp_h, "anchor", PAUSE_MAP_HIGHLIGHT_TEXT_X_OFFSET_RIGHT, y) 
  1412. 		end 
  1413. 		 
  1414. 		--Store values 
  1415. 		status.text_width = text_width 
  1416. 		status.text_height = text_height 
  1417. 		status.text_line_1 = text_line_1 
  1418. 		status.text_line_2 = text_line_2 
  1419. 		status.text_line_3 = text_line_3 
  1420. 		status.text_line_4 = text_line_4 
  1421. 		status.text_line_5 = text_line_5 
  1422. 	end 
  1423.  
  1424. 	 
  1425. 	 
  1426. 	--If the highlighted item changes state the we need to change how it is displayed 
  1427. 	if is_highlighted ~= status.is_highlighted then 
  1428. 		 
  1429. 		--1. Check if we need to fade in or fade out the info box 
  1430. 		if is_highlighted == true then 
  1431. 			--Reset elements 
  1432. 			vint_set_property(vint_object_find("bg_wrapper",info_h), "alpha", 0) 
  1433. 			vint_set_property(status.text_grp_h, "alpha", 0) 
  1434. 			vint_set_property(status.out_anim_h, "is_paused", true)	--Pause the out animation 
  1435. 			lua_play_anim(status.in_anim_h, 0)								--Play in animation 
  1436. 			lua_play_anim(status.icon_highlight_anim_h, 0) 
  1437. 			Pause_map.done = false 
  1438. 		elseif is_highlighted == false then 
  1439. 			--if the fade in tweens are done, then its ok to fade them out 
  1440. 			if Pause_map.done == true then 
  1441. 				vint_set_property(status.in_anim_h, "is_paused", true)	--Pause the in animation 
  1442. 				local alpha = vint_get_property(status.text_grp_h, "alpha") 
  1443. 				vint_set_property(vint_object_find("txt_grp_alpha_twn_1",status.out_anim_h), "start_value", alpha) 
  1444. 				lua_play_anim(status.out_anim_h, 0)	 
  1445. 			else 
  1446. 				--if fade in tweens arent finished, just destroy them 
  1447. 				vint_object_destroy(status.info_h) 
  1448. 				vint_object_destroy(status.in_anim_h) 
  1449. 				vint_object_destroy(status.out_anim_h) 
  1450. 				vint_object_destroy(status.icon_highlight_anim_h) 
  1451.  
  1452. 				Pause_map_highlight_status[di_h] = nil				 
  1453. 			end			 
  1454. 		end 
  1455.  
  1456. 		status.is_highlighted = is_highlighted 
  1457. 		 
  1458. 		--2. Fade the cursor if highlight and cursor state have changed 
  1459. 		local is_active = false 
  1460. 		for idx, val in pairs(Pause_map_highlight_status) do  
  1461. 			if val.is_highlighted == true then 
  1462. 				is_active = true 
  1463. 				break 
  1464. 			end 
  1465. 		end 
  1466. 		 
  1467. 		if is_active == true then 
  1468. 			if Pause_map_cursor_status.fade_mode == "in" then 
  1469. 				--Fade out Cursor 
  1470. 				local current_alpha = vint_get_property(Pause_map_elements.base.cursor_h, "alpha") 
  1471. 				vint_set_property(Pause_map_anims.cursor_fade_twn_h, "start_value", current_alpha)  
  1472. 				vint_set_property(Pause_map_anims.cursor_fade_twn_h, "end_value", 0)  
  1473. 				lua_play_anim(Pause_map_anims.cursor_fade_anim_h, 0) 
  1474. 				Pause_map_cursor_status.fade_mode = "out" 
  1475. 			end 
  1476. 		else 
  1477. 			if Pause_map_cursor_status.fade_mode == "out" then 
  1478. 				--Fade In Cursor 
  1479. 				local current_alpha = vint_get_property(Pause_map_elements.base.cursor_h, "alpha") 
  1480. 				vint_set_property(Pause_map_anims.cursor_fade_twn_h, "start_value", current_alpha)  
  1481. 				vint_set_property(Pause_map_anims.cursor_fade_twn_h, "end_value", 1)  
  1482. 				lua_play_anim(Pause_map_anims.cursor_fade_anim_h, 0) 
  1483. 				Pause_map_cursor_status.fade_mode = "in" 
  1484. 			end 
  1485. 		end 
  1486. 	end 
  1487. 	 
  1488. --	This functionality causes inconsistant results... taking it out (JMH 7/29/2011) 
  1489. --	if is_gps_target == true then 
  1490. --		vint_set_property(lock_h, "tint", 0,1,0) 
  1491. --	else 
  1492. --		vint_set_property(lock_h, "tint", 1,1,1) 
  1493. --	end 
  1494. 	 
  1495. 	--[[if is_highlighted == true and is_mad_icon == true then 
  1496. 		game_UI_audio_play("UI_Cell_Hover_MAD") 
  1497. 	elseif is_highlighted == true and is_store_icon == true then 
  1498. 		game_UI_audio_play("UI_Cell_Hover_Store") 
  1499. 	elseif is_highlighted == true and is_crib_icon == true then 
  1500. 		game_UI_audio_play("UI_Cell_Hover_MAD") 
  1501. 	end]] 
  1502. 	 
  1503. 	if is_highlighted == true then 
  1504. 		game_UI_audio_play("UI_Cell_Waypoint") 
  1505. 	end 
  1506. 	 
  1507. end 
  1508.  
  1509.  
  1510. ------------------------------------------------------------------------------- 
  1511. -- Updates the pause map cursor and other navigational style elements via Dataitem. 
  1512. -- 
  1513. -- DATAITEM: 
  1514. -- @param 	cursor_x				Position of the cursor, relative to the upper left of the pause_map object. 
  1515. -- @param 	cursor_y				Position of the cursor, relative to the upper left of the pause_map object. 
  1516. -- @param 	highlight_icon_x	Position of the highlighted icon, relative to the upper left of the pause_map object. 
  1517. -- @param 	highlight_icon_y	Position of the highlighted icon, relative to the upper left of the pause_map object. 
  1518. -- @param 	gps_active			Is the GPS Active? 
  1519. -- @param 	district_str		--District name 
  1520. -- @param 	hood_str				--Hood Name 
  1521. -- @param 	control_pct   		--control percentage for the district 
  1522. ------------------------------------------------------------------------------- 
  1523. function pause_map_cursor_update(di_h) 
  1524. 	--Get data from dataitem... 
  1525. 	local cursor_x, cursor_y, highlight_icon_x, highlight_icon_y, gps_active, x_func, district_str, hood_str, control_pct = vint_dataitem_get(di_h) 
  1526. 	 
  1527. 	--Translate cursor position... 
  1528.  
  1529. 	if vint_is_std_res() then 
  1530. 		cursor_x = cursor_x * PAUSE_MAP_CURSOR_STD_RES_SCALE 
  1531. 		cursor_y = cursor_y * PAUSE_MAP_CURSOR_STD_RES_SCALE 
  1532. 		highlight_icon_x = highlight_icon_x * PAUSE_MAP_CURSOR_STD_RES_SCALE 
  1533. 		highlight_icon_y = highlight_icon_y * PAUSE_MAP_CURSOR_STD_RES_SCALE 
  1534. 	end 
  1535. 	 
  1536. 	-- NOTE: when no icon is highlighted, highlight_icon_x, highlight_icon_y is 0,0 
  1537.  
  1538. 	--Update the cursor position on the screen... 
  1539. 	local cursor_h = vint_object_find("cursor") 
  1540. 	vint_set_property(cursor_h, "anchor", cursor_x, cursor_y) 
  1541.  
  1542. 	Pause_map_cursor_status.x = cursor_x 
  1543. 	Pause_map_cursor_status.y = cursor_y 
  1544. 	 
  1545. 	--Offset icon from the cursor, because the location could be at a different spot. 
  1546. 	if highlight_icon_x ~= 0 or highlight_icon_y ~=0 then 
  1547. 		for idx, val in pairs(Pause_map_highlight_status) do 
  1548. 			if val.info_h ~= nil then 
  1549. 				local x = highlight_icon_x - cursor_x 
  1550. 				local y = highlight_icon_y - cursor_y 
  1551. 				vint_set_property(val.info_h, "anchor", x, y) 
  1552. 			end 
  1553. 		end 
  1554. 	end 
  1555.  
  1556. 	--Update button tips depending on if the GPS is active or not... 
  1557. 	if gps_active ~= Pause_map_cursor_status.gps_active or x_func ~= Pause_map_cursor_status.x_func then 
  1558.  
  1559. 		local main_hint_bar = { } 
  1560. 		 
  1561. 		if Pause_map_stag_mode == true then 
  1562. 			pause_map_update_button_hints(Pause_map_hints_stag) 
  1563. 		elseif Pause_map_crib_exit == true then 
  1564. 			if (highlight_icon_x ~= 0 or highlight_icon_y ~= 0) and Crib_exit_is_crib == true then 
  1565. 				if game_is_active_input_gamepad() ~= true then 
  1566. 					pause_map_update_button_hints(Pause_map_hint_exit_crib_kb) 
  1567. 				else 
  1568. 					pause_map_update_button_hints(Pause_map_hint_exit_crib) 
  1569. 				end 
  1570. 			else 
  1571. 				pause_map_update_button_hints(Pause_map_hint_just_exit)   
  1572. 			end 
  1573. 		else 
  1574. 			if game_get_platform() == "PC" then 
  1575. 				if gps_active == true then 
  1576. 					main_hint_bar[#main_hint_bar + 1] = Main_hint_data_remove_gps_rmb 
  1577. 				else 
  1578. 					main_hint_bar[#main_hint_bar + 1] = Main_hint_data_set_gps_rmb 
  1579. 				end 
  1580. 			else 
  1581. 				if gps_active == true then 
  1582. 					main_hint_bar[#main_hint_bar + 1] = Main_hint_data_remove_gps 
  1583. 				else 
  1584. 					main_hint_bar[#main_hint_bar + 1] = Main_hint_data_set_gps 
  1585. 				end 
  1586. 			end 
  1587. 			 
  1588. 			if game_get_platform() ~= "PC" then 
  1589. 				main_hint_bar[#main_hint_bar + 1] = Main_hint_data_back 
  1590. 				main_hint_bar[#main_hint_bar + 1] = Main_hint_data_back_map 
  1591. 			end 
  1592. 			 
  1593. 			if pause_map_is_tutorial_mode() == false then 
  1594. 				--book mark only available in normal mode... 
  1595. 				if x_func == X_FUNC_PLACE_BOOKMARK then 
  1596. 					main_hint_bar[#main_hint_bar + 1] = Main_hint_data_add_bookmark 
  1597. 				elseif x_func == X_FUNC_TAXI then 
  1598. 					main_hint_bar[#main_hint_bar + 1] = Main_hint_data_taxi 
  1599. 				elseif x_func == X_FUNC_REMOVE_BOOKMARK then 
  1600. 					main_hint_bar[#main_hint_bar + 1] = Main_hint_data_remove_bookmark 
  1601. 				end 
  1602. 			end 
  1603. 			 
  1604. 			pause_map_update_button_hints(main_hint_bar)   
  1605. 		end 
  1606. 		 
  1607. 		Pause_map_cursor_status.gps_active = gps_active 
  1608. 		Pause_map_cursor_status.x_func = x_func 
  1609. 	end 
  1610. 	 
  1611. 	--Update Contact information... 
  1612. 	local district_name_txt_h 	= vint_object_find("district_name_txt") 
  1613. 	local hood_name_txt_h 		= vint_object_find("hood_name_txt") 
  1614. 	local hood_info_grp_h 		= vint_object_find("hood_info_grp") 
  1615. 	 
  1616. 	--Set District Name 
  1617. 	vint_set_property(district_name_txt_h, "text_tag", "MAP_CITY_NAME") 
  1618. 	 
  1619. 	--Set hood name... 
  1620. 	vint_set_property(hood_name_txt_h, "text_tag", hood_str) 
  1621. 	 
  1622. 	--Update control pct... 
  1623. 	if district_str == "" then 
  1624. 		Pause_map_control_meter:set_visible(false) 
  1625. 	else 
  1626. 		Pause_map_control_meter:set_visible(true) 
  1627. 		Pause_map_control_meter:update(control_pct, false) 
  1628. 	end 
  1629.  
  1630. 	pause_map_adjust_layout() 
  1631. end 
  1632.  
  1633. ------------------------------------------------------------------------------- 
  1634. -- Updates the pause map cursor and other navigational style elements via Datagroup. 
  1635. -- 
  1636. -- DATAGROUP: 
  1637. -- @param 	district_str		String of the district name. 
  1638. -- @param 	district_pct		This is the percentage the player has control of the district... 
  1639. -- @param 	position_x			Position of the item, relative to the upper left of the pause_map object. 
  1640. -- @param 	position_y			Position of the item, relative to the upper left of the pause_map object. 
  1641. -- @param 	scale					Scale of the item in relation to the map... 
  1642. -- @param 	is_visible			Is the overlay visible, this is flagged to false if the overlay should be hidden... 
  1643. ------------------------------------------------------------------------------- 
  1644. function pause_map_district_overlay_update(di_h) 
  1645.  
  1646. 	--Check to see if we havn't updated this item before... if we havn't we need to clone a group for it... 
  1647. 	if Pause_map_district_overlays[di_h] == nil then 
  1648. 		--Clone overlay item... 
  1649. 		local grp_h = vint_object_find("hood_overlay_grp") 
  1650. 		grp_h = vint_object_clone(grp_h) 
  1651. 		vint_set_property(grp_h, "visible", true) 
  1652. 		vint_set_property(grp_h, "alpha", 0) 
  1653. 		 
  1654. 		local anim_h = vint_object_find("hood_overlay_fade_anim") 
  1655. 		anim_h = vint_object_clone(anim_h) 
  1656. 		vint_set_property(anim_h, "target_handle", grp_h) 
  1657. 		 
  1658. 		--Store it to a table... 
  1659. 		Pause_map_district_overlays[di_h] = { 
  1660. 			grp_h = grp_h, 
  1661. 			anim_h = anim_h, 
  1662. 			is_visible = -1 
  1663. 		} 
  1664. 		Pause_map_district_overlays_count = Pause_map_district_overlays_count + 1 
  1665. 	end 
  1666. 	 
  1667. 	--Update the overlay... 
  1668. 	 
  1669. 	--Find overlay we stored in the table... 
  1670. 	local grp_h = Pause_map_district_overlays[di_h].grp_h 
  1671. 	 
  1672. 	--Get data out of dataitem 
  1673. 	local district_str, district_pct, position_x, position_y, scale, is_visible = vint_dataitem_get(di_h) 
  1674.  
  1675. 	--Update visibility... 
  1676. 	if is_visible ~= Pause_map_district_overlays[di_h].is_visible then 
  1677. 		local target_alpha = 1.0 
  1678. 		if is_visible == false then 
  1679. 			--Going to fade out... 
  1680. 			target_alpha = 0 
  1681. 		end 
  1682. 		 
  1683. 		--Find animation to fade in or out... 
  1684. 		local anim_h = Pause_map_district_overlays[di_h].anim_h 
  1685. 	 
  1686. 		--Set properties for tween to current alpha of the object and the target value... 
  1687. 		local hood_overlay_fade_twn_h = vint_object_find("hood_overlay_fade_twn", anim_h) 
  1688. 		local current_alpha = vint_get_property(grp_h, "alpha") 
  1689. 		vint_set_property(hood_overlay_fade_twn_h, "start_value", current_alpha) 
  1690. 		vint_set_property(hood_overlay_fade_twn_h, "end_value", target_alpha) 
  1691. 		 
  1692. 		--Play the animation... 
  1693. 		lua_play_anim(anim_h) 
  1694. 		 
  1695. 		--Store to global... 
  1696. 		Pause_map_district_overlays[di_h].is_visible = is_visible 
  1697. 	end 
  1698. 	 
  1699. 	--Update text... 
  1700. 	local hood_overlay_district_txt_h = vint_object_find("hood_overlay_district_txt", grp_h) 
  1701. 	local hood_overlay_pct_txt_h = vint_object_find("hood_overlay_pct_txt", grp_h) 
  1702. 	vint_set_property(hood_overlay_district_txt_h, "text_tag", district_str) 
  1703. 	 
  1704. 	--local district_pct_string = floor((district_pct * 100) + .5) .. "%%" 
  1705. 	vint_set_property(hood_overlay_pct_txt_h, "text_tag", "") 
  1706. 	 
  1707. 	if vint_is_std_res() then 
  1708. 		position_x = position_x * PAUSE_MAP_CURSOR_STD_RES_SCALE 
  1709. 		position_y = position_y * PAUSE_MAP_CURSOR_STD_RES_SCALE 
  1710. 	end 
  1711. 	 
  1712. 	--Update position 
  1713. 	vint_set_property(grp_h, "anchor", position_x, position_y) 
  1714.  
  1715. 	local target_scale = 3.5 * scale 
  1716. 	 
  1717. 	--Update the scale 
  1718. 	vint_set_property(grp_h, "scale", target_scale, target_scale) 
  1719. 	 
  1720. end 
  1721.  
  1722. ------------------------------------------------------------------------------- 
  1723. -- Updates main button hints. This is essentially a wrapper for our button hints 
  1724. -- It allows us to draw a nifty little background behind the hints that is 
  1725. -- Custom to the phone. 
  1726. -- 
  1727. -- @param	hint_data	Table representing button hints.. 
  1728. ------------------------------------------------------------------------------- 
  1729. function pause_map_update_button_hints(hint_data) 
  1730. 	Hint_bar:set_hints(hint_data, false, false) --Entered_with_gamepad, not Entered_with_gamepad) 
  1731. 	 
  1732. 	if game_get_platform() ~= "PC" then 
  1733. 		local width, height = Hint_bar:get_size() 
  1734. 		width = floor(width) 
  1735. 		height = floor(height) 
  1736. 		local bg_width, bg_height = element_get_actual_size(Hint_bar_bg, width, height) 
  1737. 		local hint_background_padding = 35 -- Additional padding needed for background height 
  1738. 		element_set_actual_size(Hint_bar_bg, width + 35, bg_height) 
  1739. 	end 
  1740. end 
  1741.  
  1742.  
  1743. ------------------------------------------------------------------------------- 
  1744. -- Flips an element in the horizontal direction... 
  1745.  
  1746. -- @param	h				handle to element 
  1747. -- @param	x_flip 		(bool)Do we flip the item or not? horizontal 
  1748. -- @param	y_flip 		(bool)Do we flip the item or not? vertical 
  1749. -- @param	override		(bool)true if we don't care if the item was flipped initially. 
  1750. ------------------------------------------------------------------------------- 
  1751. function pause_map_flip_element(h, x_flip, y_flip, override) 
  1752. 	local scale_x, scale_y = vint_get_property(h, "scale") 
  1753. 	if override == true then 
  1754. 		scale_x = abs(scale_x) 
  1755. 		scale_y = abs(scale_y) 
  1756. 	end 
  1757. 	local x_direction = 1 
  1758. 	local y_direction = 1 
  1759. 	 
  1760. 	if x_flip == true then 
  1761. 		x_direction = -1 
  1762. 	end 
  1763. 	if y_flip == true then 
  1764. 		y_direction = -1 
  1765. 	end 
  1766. 	 
  1767. 	scale_x = scale_x * x_direction 
  1768. 	scale_y = scale_y * y_direction 
  1769. 	vint_set_property(h, "scale", scale_x, scale_y)  
  1770. end 
  1771.  
  1772. function pause_map_hide_c_map() 
  1773. 	local h = vint_object_find("pause_map") 
  1774. 	vint_set_property(h, "visible", false) 
  1775. 	vint_object_destroy(h) 
  1776. end 
  1777.  
  1778. function pause_map_interface_event(event) 
  1779. 	--supported events: 
  1780. 	--INTERFACE_EVENT_ADD_GPS	 
  1781. 	--INTERFACE_EVENT_REMOVE_GPS 
  1782. 	--INTERFACE_EVENT_ADD_BOOKMARK 
  1783. 	--INTERFACE_EVENT_REMOVE_BOOKMARK 
  1784. 	--for now just use the same sound for all 
  1785. 	 
  1786. 	if event == INTERFACE_EVENT_ADD_GPS then 
  1787. 		if pause_map_is_tutorial_mode() == true then 
  1788. 			cell_foreground_update_tutorial("exit_hub") 
  1789. 			Gps_has_been_set = true 
  1790. 		end 
  1791. 	elseif event == INTERFACE_EVENT_REMOVE_GPS then 
  1792. 		if pause_map_is_tutorial_mode() == true then 
  1793. 			cell_foreground_update_tutorial("gps_weapon") 
  1794. 		end 
  1795. 	end 
  1796. 	 
  1797. 	game_UI_audio_play("UI_Cell_Nav") 
  1798. end 
  1799.  
  1800.  
  1801. function pause_map_stag_popup_select(event, target_handle) 
  1802.  
  1803. 	--User wanted to go back... 
  1804. 	if event == "back" or Pause_map_stag_popup:get_selected_data() == 2 then 
  1805. 		-- The user hit the B button and cancelled the change 
  1806. 		 
  1807. 		Pause_map_stag_popup:nav_enable(false, nil, nil) 
  1808. 		 
  1809. 		--Play menu back audio 
  1810. 		ui_audio_post_event("UI_Hub_Menu_Back") 
  1811. 		 
  1812. 		local stag_popup_overlay_grp_h = vint_object_find("stag_popup_overlay_grp") 
  1813. 		vint_set_property(stag_popup_overlay_grp_h, "visible", false) 
  1814. 		 
  1815. 		if Mouse_input_tracker ~= 0 then 
  1816. 			Mouse_input_tracker:subscribe(true) 
  1817. 		end 
  1818. 	 
  1819. 		if Filter_mouse_input_tracker ~= 0 then 
  1820. 			Filter_mouse_input_tracker:subscribe(true) 
  1821. 		end 
  1822. 		 
  1823. 		return 
  1824. 	end 
  1825. 	 
  1826. 	-- Did we select yes?  Now exit to via stag exit... 
  1827. 	if Pause_map_stag_popup:get_selected_data() == 1 then 
  1828. 		Pause_map_stag_popup:nav_enable(false, nil, nil) 
  1829. 		 
  1830. 		--Play menu forward audio 
  1831. 		--ui_audio_post_event("UI_Hub_Menu_Forward") 
  1832. 		 
  1833. 		pause_map_stag_exit() 
  1834. 		return 
  1835. 	end 
  1836. end 
  1837.  
  1838. function pause_map_stag_popup_nav(event, value) 
  1839. 	 
  1840. 	if event == "nav_up" then	 
  1841. 		Pause_map_stag_popup.list:move_cursor(-1)	 
  1842. 	elseif event == "nav_down" then 
  1843. 		Pause_map_stag_popup.list:move_cursor(1) 
  1844. 	elseif event == "mouse_move" then 
  1845. 		-- value contains the target_handle in this case 
  1846. 		local new_index = Pause_map_stag_popup.list:get_button_index(value) 
  1847. 		if new_index ~= 0 then 
  1848. 			Pause_map_stag_popup.list:set_selection(new_index) 
  1849. 			Pause_map_stag_popup.list:move_cursor(0, true) 
  1850. 		end 
  1851. 	else 
  1852. 		--do nothing 
  1853. 	end 
  1854. end 
  1855.  
  1856. ------------------------------------------------------------------------------- 
  1857. -- Enables or disables tutorial mode dialog. 
  1858. -- 
  1859. function pause_map_tutorial_mode_enable(enabled) 
  1860.  
  1861. 	if enabled then 
  1862. 		cell_foreground_update_tutorial("gps_weapon") 
  1863. 		local map_info_grp_h = vint_object_find("map_info_grp") 
  1864. 		vint_set_property(map_info_grp_h, "visible", false) 
  1865. 	else 
  1866. 		if Gps_has_been_set == false then 
  1867. 			cell_foreground_update_tutorial("off") 
  1868. 		end 
  1869. 	end 
  1870. end 
  1871.  
  1872. function pause_map_mouse_move(event, target_handle, x, y, lines_to_scroll, current_target_handle) 
  1873.  
  1874. 	if target_handle == Map_mask_handle then 
  1875. 		vint_set_mouse_cursor("Ui_cursor_hand_open") 
  1876. 	else 
  1877. 		vint_set_mouse_cursor("") 
  1878. 	end 
  1879. 	 
  1880. 	local hint_index = PC_hint_bar:get_hint_index(target_handle) 
  1881. 	if hint_index ~= 0 then 
  1882. 		PC_hint_bar:set_highlight(hint_index) 
  1883. 	else 
  1884. 		PC_hint_bar:set_highlight(0) 
  1885. 	end 
  1886. 	 
  1887. 	-- Zoom in/out highlighting 
  1888. 	vint_set_property(PC_zoom_in.handle, "tint", PAUSE_MAP_COLOR_ZOOM_UNSELECTED.R, PAUSE_MAP_COLOR_ZOOM_UNSELECTED.G, PAUSE_MAP_COLOR_ZOOM_UNSELECTED.B) 
  1889. 	vint_set_property(PC_zoom_out.handle, "tint", PAUSE_MAP_COLOR_ZOOM_UNSELECTED.R, PAUSE_MAP_COLOR_ZOOM_UNSELECTED.G, PAUSE_MAP_COLOR_ZOOM_UNSELECTED.B) 
  1890. 	if target_handle == PC_zoom_in.handle then 
  1891. 		vint_set_property(PC_zoom_in.handle, "tint", PAUSE_MAP_COLOR_ZOOM_SELECTED.R, PAUSE_MAP_COLOR_ZOOM_SELECTED.G, PAUSE_MAP_COLOR_ZOOM_SELECTED.B) 
  1892. 	end 
  1893. 	if target_handle == PC_zoom_out.handle then 
  1894. 		vint_set_property(PC_zoom_out.handle, "tint", PAUSE_MAP_COLOR_ZOOM_SELECTED.R, PAUSE_MAP_COLOR_ZOOM_SELECTED.G, PAUSE_MAP_COLOR_ZOOM_SELECTED.B) 
  1895. 	end 
  1896. end 
  1897.  
  1898. function pause_map_mouse_click(event, target_handle, x, y, lines_to_scroll, current_target_handle) 
  1899.  
  1900. 	local hint_index = PC_hint_bar:get_hint_index(target_handle) 
  1901. 	if hint_index == 1 then 
  1902. 		pause_map_input("back") 
  1903. 	elseif hint_index == 2 then 
  1904. 		pause_map_input("map") 
  1905. 	end 
  1906.  
  1907. 	local filter_target_idx = Pause_map_filter:get_filter_index(current_target_handle) 
  1908. 	if filter_target_idx >= 0 then 
  1909. 		Pause_map_filter:change_filter(filter_target_idx, true) 
  1910. 	end 
  1911.  
  1912. 	if target_handle == PC_zoom_in.handle then 
  1913. 		pause_map_zoom(true) 
  1914. 	end 
  1915. 	if target_handle == PC_zoom_out.handle then 
  1916. 		pause_map_zoom(false) 
  1917. 	end 
  1918. end 
  1919.  
  1920. function pause_map_mouse_right_click(event, target_handle, x, y, lines_to_scroll, current_target_handle) 
  1921.  
  1922. 	if target_handle == Map_mask_handle then 
  1923. 		pause_map_set_gps() 
  1924. 	end 
  1925. 	 
  1926. end 
  1927.  
  1928. function pause_map_mouse_middle_click(event, target_handle, x, y, lines_to_scroll, current_target_handle) 
  1929.  
  1930. 	if target_handle == Map_mask_handle then 
  1931. 		pause_map_add_bookmark() 
  1932. 	end 
  1933. 	 
  1934. end 
  1935.  
  1936. function pause_map_mouse_drag(event, target_handle, x, y, lines_to_scroll, current_target_handle) 
  1937.  
  1938. 	if target_handle == Map_mask_handle then 
  1939. 		vint_set_mouse_cursor("Ui_cursor_hand_closed") 
  1940. 		pause_map_drag_map() 
  1941. 		--vint_set_property(Cursor_tool_handle, "visible", false) 
  1942. 	end 
  1943.  
  1944. end 
  1945.  
  1946. function pause_map_mouse_drag_release(event, target_handle, x, y, lines_to_scroll, current_target_handle) 
  1947.  
  1948. 	if current_target_handle ~= Map_mask_handle then 
  1949. 		vint_set_mouse_cursor("") 
  1950. 	elseif target_handle == Map_mask_handle then 
  1951. 		vint_set_mouse_cursor("Ui_cursor_hand_open") 
  1952. 	end 
  1953. 	 
  1954. 	--vint_set_property(Cursor_tool_handle, "visible", true) 
  1955. end 
  1956.  
  1957. function pause_map_gamepad_monitor_thread() 
  1958.  
  1959. 	while true do 
  1960. 		vint_set_property(Cursor_tool_handle, "visible", game_is_active_input_gamepad()) 
  1961. 		delay(0.5) 
  1962. 	end 
  1963.  
  1964. end 
  1965.  
  1966. -- This is required because we're using Vdo_store_popup 
  1967. -- 
  1968. function store_common_do_nothing() 
  1969.  
  1970. end 
  1971.