./store_crib.lua

  1.  
  2. SCALE_FONT_STORE_CRIB_LIST = 0.8 
  3. STORE_CRIB_POPUP_X = 132 
  4. STORE_CRIB_POPUP_Y = 267 
  5.  
  6. Store_common_screen_grp_x = -640 
  7.  
  8. Store_crib_doc_handle = -1 
  9. Crib_title = -1 
  10. Store_crib_top_menu = {} 
  11. Store_crib_title_in_anim = -1 
  12.  
  13. -- Hint bar and store header vdo's. 
  14. local Store_logo1 
  15. local Store_logo2 
  16. local Not_popup_grp 
  17. local Reward_image 
  18.  
  19. local GVT_CARS					= 0 
  20. local	GVT_HELICOPTERS 		= 1 
  21. local	GVT_AIRPLANES 			= 2 
  22. local	GVT_WATERCRAFT			= 3 
  23.  
  24. local Previous_screen 
  25.  
  26. -- We used this as a reference to the current submenu we are building. 
  27. local Store_crib_building_menu = {} 
  28.  
  29. -- keeps track of which selection we were on when leaving to a sub-document 
  30. local Store_crib_current_menu_selection = 1 
  31. local Store_crib_screen_to_push = -1 
  32.  
  33. local Hint_bar_mouse_input_tracker 
  34. local Game_platform 
  35.  
  36. local Transition_to_garage_type = -1  
  37. local Wait_for_fade_thread_id = -1 
  38.  
  39. ---------------------------------------------------------------------------  
  40. -- Initialize crib Store (Customization) 
  41. --------------------------------------------------------------------------- 
  42. function store_crib_build_top_menu() 
  43. 	Store_crib_top_menu = {} 
  44.  
  45. 	local always_valid = true 
  46. 	-- cash MOVED TO CELL PHONE, MAYBE IT WILL COME BACK? 
  47. 	--[[if always_valid then 
  48. 		local index = #Store_crib_top_menu + 1 
  49. 		Store_crib_top_menu[index] = { label = "COMPLETION_CASH", type = TYPE_BUTTON, on_select = store_crib_open_cash, screen = "store_crib_cash", id = index } 
  50. 	end]] 
  51. 	 
  52. 	-- wardrobe 
  53. 	if always_valid then 
  54. 		local index = #Store_crib_top_menu + 1 
  55. 		Store_crib_top_menu[index] = { label = "MENU_SWAP_WARDROBE", type = TYPE_BUTTON, on_select = store_crib_open_screen, screen = "store_clothing",  id = index} 
  56. 	end 
  57. 	 
  58. 	local disable_garage = crib_is_garage_disabled()	 
  59. 	if disable_garage ~= true then 
  60. 		-- garage GVT_CARS 
  61. 		if crib_has_garage_with_vehicles_of_type(GVT_CARS) then 
  62. 			local index = #Store_crib_top_menu + 1 
  63. 			Store_crib_top_menu[index] = { label = "GARAGE_CRIB_NAME", type = TYPE_BUTTON, on_select = store_crib_open_garage, screen = "store_vehicle", id = index, garage_type = GVT_CARS } 
  64. 		end 
  65. 		 
  66. 		-- garage GVT_HELICOPTERS 
  67. 		if crib_has_garage_with_vehicles_of_type(GVT_HELICOPTERS) then 
  68. 			local index = #Store_crib_top_menu + 1 
  69. 			Store_crib_top_menu[index] = { label = "GARAGE_HELIPORT", type = TYPE_BUTTON, on_select = store_crib_open_garage, screen = "store_vehicle", id = index, garage_type = GVT_HELICOPTERS } 
  70. 		end 
  71. 		 
  72. 		-- garage GVT_AIRPLANES 
  73. 		if crib_has_garage_with_vehicles_of_type(GVT_AIRPLANES) then 
  74. 			local index = #Store_crib_top_menu + 1 
  75. 			Store_crib_top_menu[index] = { label = "GARAGE_HANGAR", type = TYPE_BUTTON, on_select = store_crib_open_garage, screen = "store_vehicle", id = index, garage_type = GVT_AIRPLANES } 
  76. 		end 
  77. 		 
  78. 		-- garage GVT_WATERCRAFT 
  79. 		if crib_has_garage_with_vehicles_of_type(GVT_WATERCRAFT) then 
  80. 			local index = #Store_crib_top_menu + 1 
  81. 			Store_crib_top_menu[index] = { label = "GARAGE_DOCK", type = TYPE_BUTTON, on_select = store_crib_open_garage, screen = "store_vehicle", id = index, garage_type = GVT_WATERCRAFT } 
  82. 		end 
  83. 	end 
  84. 	 
  85. 	-- weapons 
  86. 	if always_valid then 
  87. 		local index = #Store_crib_top_menu + 1 
  88. 		Store_crib_top_menu[index] = { label = "WPNSTOR_TITLE_WEAPON_CACHE", type = TYPE_BUTTON, on_select = store_crib_open_screen, screen = "store_weapon", id = index } 
  89. 	end 
  90. 	 
  91. 	-- Check to see if we've unlocked the gang customization menu... 
  92. 	if store_gang_is_unlocked() then 
  93. 		local index = #Store_crib_top_menu + 1 
  94. 		Store_crib_top_menu[index] = { label = "GANG_CUST_TITLE", type = TYPE_BUTTON, on_select = store_crib_open_screen, screen = "store_gang", id = index } 
  95. 	end 
  96. 	 
  97. 	--add the exit option 
  98. 	local index = #Store_crib_top_menu + 1 
  99. 	Store_crib_top_menu[index] = 	{ label = "STORE_EXIT", type = TYPE_BUTTON, on_select = store_crib_exit, screen = "", id = index } 
  100. 	 
  101. end 
  102.  
  103. function store_crib_init() 
  104.  
  105. 	Store_common_current_highlight_color = COLOR_STORE_CRIB_PRIMARY 
  106.  
  107. 	Wait_for_fade_thread_id = -1 
  108. 	 
  109. 	-- unload the full screen map to pillage memory 
  110. 	pause_map_dump() 
  111. 	 
  112. 	Game_platform = game_get_platform() 
  113.  
  114. 	Store_crib_doc_handle = vint_document_find("store_crib") 
  115. 	 
  116. 	Store_crib_title_in_anim = Vdo_anim_object:new("crib_title_anim", 0, Store_crib_doc_handle) 
  117. 	 
  118. 	local store_group = vint_object_find("screen_grp",0,Store_common_doc_handle) 
  119. 	vint_set_property(store_group,"visible",false) 
  120. 	 
  121. 	-- Set up some callbacks for the common store script 
  122. 	Store_common_populate_list_cb = store_crib_populate_list 
  123. 	Store_common_exit_cb				= store_crib_exit 
  124.  
  125. 	-- Subscribe to the button presses we need, Input_tracker is created in store_common.lua 
  126. 	Input_tracker:subscribe(false) 
  127. 	 
  128. 	bg_saints_set_type(BG_TYPE_CRIB) 
  129. 	 
  130. 	if vint_is_std_res() then 
  131. 		Store_common_screen_grp_x = -320 
  132. 	end 
  133. 	 
  134. 	--Setup Button Hints 
  135. 	local hint_data = { 
  136. 		{CTRL_MENU_BUTTON_B, "MENU_BACK"},	 
  137. 	} 
  138. 	Store_common_hint_bar:set_hints(hint_data)  
  139. 	Store_common_hint_bar:set_visible(true) 
  140. 	 
  141. 	if game_is_active_input_gamepad() then 
  142. 		local hint_rotate_data = { 
  143. 			{CTRL_BUTTON_RS, "STORE_ZOOM_ROTATE"}, 
  144. 		} 
  145. 		Store_common_rotate_hint:set_hints(hint_rotate_data)  
  146. 	end 
  147. 	 
  148. 	if Game_platform == "PC" then 
  149. 		Mouse_input_tracker:subscribe(false) 
  150. 		 
  151. 		Hint_bar_mouse_input_tracker = Vdo_input_tracker:new() 
  152. 		Store_common_hint_bar:add_mouse_inputs("store_crib", Hint_bar_mouse_input_tracker) 
  153. 		Hint_bar_mouse_input_tracker:subscribe(true) 
  154. 	end 
  155. 	 
  156. 	local store_megalist_grp_h = vint_object_find("store_megalist_grp",0,Store_common_doc_handle) 
  157. 	vint_set_property(store_megalist_grp_h, "anchor", 0, 0) 
  158. 	 
  159. 	-- Set Store Header colors 
  160. 	Store_header:set_color(COLOR_STORE_CRIB_PRIMARY, COLOR_STORE_CRIB_SECONDARY, COLOR_STORE_CRIB_TERTIARY) 
  161. 	Store_header:set_visible(true) 
  162.  
  163. 	Active_list:set_highlight_color(COLOR_STORE_CRIB_PRIMARY, COLOR_STORE_CRIB_SECONDARY)			 
  164. 		 
  165. 	-- Everything that is not in the popup so we can fade it when the popup is active 
  166. 	Not_popup_grp = Vdo_base_object:new("not_popup_grp", 0, Store_common_doc_handle) 
  167. 	 
  168. 	-- Setup purchase popup 
  169. 	Store_common_popup:set_visible(false) 
  170. 	Store_common_popup:set_color(COLOR_STORE_CRIB_PRIMARY, COLOR_STORE_CRIB_SECONDARY, COLOR_STORE_CRIB_TERTIARY) 
  171. 	Store_common_popup:set_size(STORE_COMMON_LIST_SIZE, (LIST_BUTTON_HEIGHT * 5) + (LIST_BUTTON_SPACE * 5)) 
  172. 	 
  173. 	Store_common_popup:set_anchor(STORE_CRIB_POPUP_X,STORE_CRIB_POPUP_Y) 
  174. 	 
  175. 	Crib_title = vint_object_find("store_title_grp",0,Store_crib_doc_handle) 
  176. 	 
  177. 	store_crib_build_top_menu() 
  178. 	 
  179. 	-- Pass the table data to the megalist vdo. 
  180. 	Menu_data = Store_crib_top_menu 
  181. 	 
  182. 	-- Pass the table data to the megalist vdo. 
  183. 	store_crib_populate_list(Menu_data, 1)	 
  184. 	 
  185. 	ui_audio_post_event("enter_gateway") 
  186. 	 
  187. 	--play background anim... 
  188. 	store_crib_bg_anim() 
  189. 	 
  190. 	store_unlock_controls() 
  191. 	 
  192. 	character_enable_mouse_drag(false) 
  193. end 
  194.  
  195. -- Cleanup function called on document unload. 
  196. -- 
  197. function store_crib_cleanup()	 
  198. 	if Wait_for_fade_thread_id ~= -1 then 
  199. 		thread_kill(Wait_for_fade_thread_id) 
  200. 	end 
  201. 	 
  202. 	-- Nuke all button subscriptions 
  203. 	Input_tracker:subscribe(false) 
  204. 	store_crib_enable_mouse(false) 
  205. 	 
  206. 	-- reload the full screen map 
  207. 	pause_map_restore() 
  208. 	 
  209. 	-- Some things need to be cleaned up right away when a store doc is unloading, particular disabled inputs which have 
  210. 	-- callbacks to the script that is unloading. 
  211. 	store_common_cleanup_current_store()	 
  212. end 
  213.  
  214. -- Called when this interface becomes the top one on the stack again. 
  215. -- 
  216. function store_crib_gained_focus() 
  217.  
  218. 	Store_common_current_highlight_color = COLOR_STORE_CRIB_PRIMARY 
  219.  
  220. 	Wait_for_fade_thread_id = thread_new("store_crib_waiting_for_fade") 
  221. end 
  222.  
  223. function store_crib_waiting_for_fade() 
  224. 	while not sfx_faded_in() do 
  225. 		thread_yield() 
  226. 	end 
  227. 	-- Reset our header 
  228. 	Store_header:clear_titles() 
  229. 	--	Store_header:enable_price_respect(true) 
  230. 	Store_header:reformat_and_resize(false) 
  231. 	Store_header:set_price(nil) 
  232. 	 
  233. 	Store_common_popup:set_anchor(STORE_CRIB_POPUP_X,STORE_CRIB_POPUP_Y) 
  234. 	 
  235. 	--clear the rotate hint out 
  236. 	Store_common_rotate_hint:set_visible(false) 
  237. 	 
  238. 	-- make background so it covers up the world 
  239. 	 
  240. 	Input_tracker:subscribe(true)	 
  241. 	 
  242. 	vint_set_property(Crib_title,"visible",true) 
  243. 	 
  244. 	-- Need to clear out menu and menu stacks 
  245. 	store_common_stack_clear_menu() 
  246. 	store_common_stack_clear_id() 
  247. 	store_common_stack_clear_index() 
  248. 	 
  249. 	--reset the exit cb 
  250. 	Store_common_exit_cb = store_crib_exit 
  251. 	 
  252. 	-- Pass the table data to the megalist vdo. 
  253. 	Menu_data = Store_crib_top_menu 
  254. 	 
  255. 	--reset the bg to a strip 
  256. 	bg_saints_set_type(BG_TYPE_CRIB,true) 
  257. 	 
  258. 	local store_crib_in_anim = Vdo_anim_object:new("store_crib_in_anim", 0, Store_common_doc_handle) 
  259. 	 
  260. 	 
  261. 	local store_common_screen_grp_h = vint_object_find("screen_grp", 0, Store_common_doc_handle) 
  262. 	local screen_x,screen_y = vint_get_property(store_common_screen_grp_h, "anchor") 
  263. 	 
  264. 	vint_set_property(store_common_screen_grp_h, "anchor", Store_common_screen_grp_x, screen_y) 
  265. 	 
  266. 	if Previous_screen == "store_stronghold" then 
  267. 		store_crib_build_top_menu() 
  268. 		store_crib_populate_list(Store_crib_top_menu, Store_crib_current_menu_selection)	 
  269. 		if Hint_bar_mouse_input_tracker ~= nil then 
  270. 			Store_common_hint_bar:add_mouse_inputs("store_crib", Hint_bar_mouse_input_tracker) 
  271. 			Hint_bar_mouse_input_tracker:subscribe(true) 
  272. 		end 
  273. 	end 
  274. 	 
  275. 	if Previous_screen == "store_stronghold" or Previous_screen == "store_vehicle" then 
  276. 		local title_twn = Vdo_tween_object:new("title_twn", 0, Store_crib_doc_handle) 
  277. 		title_twn:set_property("start_value",-800,0) 
  278. 		title_twn:set_property("end_value",0,0) 
  279. 		title_twn:set_end_event("store_crib_anim_complete") 
  280. 		 
  281. 		 
  282. 		local new_x = 104 
  283. 		if vint_is_std_res() then 
  284. 			new_x = 50 
  285. 		end 
  286. 		 
  287. 		 
  288. 		vint_apply_start_values(Store_crib_title_in_anim.handle) 
  289. 		 
  290. 		Store_crib_title_in_anim:play() 
  291. 		 
  292. 		if Hint_bar_mouse_input_tracker ~= nil then 
  293. 			Hint_bar_mouse_input_tracker:subscribe(true) 
  294. 		end 
  295. 	end 
  296. 	 
  297. 	vint_apply_start_values(store_crib_in_anim.handle) 
  298.  
  299. 	store_crib_in_anim:play() 
  300. 	 
  301. 	Not_popup_grp:set_alpha(1) 
  302. 	 
  303. 	--reset the hints 
  304. 	local hint_data = {} 
  305. 	hint_data = { {CTRL_MENU_BUTTON_B, "MENU_BACK"}, }	 
  306. 	Store_common_hint_bar:set_hints(hint_data)  
  307. 	 
  308. 	-- Pass the table data to the megalist vdo. 
  309. 	store_crib_populate_list(Menu_data, Store_crib_current_menu_selection) 
  310. 	store_crib_enable_mouse(true) 
  311. 	 
  312. 	Wait_for_fade_thread_id = -1 
  313. end 
  314.  
  315. function store_crib_bg_anim() 
  316. 	 
  317. 	local store_crib_in_anim = Vdo_anim_object:new("store_crib_in_anim", 0, Store_common_doc_handle) 
  318. 	store_crib_in_anim:play() 
  319. 	 
  320. 	vint_apply_start_values(store_crib_in_anim.handle) 
  321. 	vint_apply_start_values(Store_crib_title_in_anim.handle) 
  322. 	 
  323. 	Store_crib_title_in_anim:play() 
  324. 	 
  325. 	local store_group = vint_object_find("screen_grp",0,Store_common_doc_handle) 
  326. 	vint_set_property(store_group,"visible",true) 
  327. 	 
  328. 	bg_saints_show(true) 
  329. 	bg_saints_slide_in() 
  330. 	 
  331. end 
  332.  
  333. function store_crib_back_out_anim( animate_title ) 
  334. 	 
  335. 	local back_out_anim = Vdo_anim_object:new("store_crib_out_anim", 0, Store_common_doc_handle) 
  336. 	local back_out_end_twn = Vdo_tween_object:new("common_anchor_out_twn", back_out_anim.handle) 
  337. 	back_out_end_twn:set_end_event("store_crib_back_out_anim_complete") 
  338. 	 
  339. 	if animate_title then 
  340. 		local title_twn = Vdo_tween_object:new("title_twn", 0, Store_crib_doc_handle) 
  341. 		title_twn:set_property("start_value",0,0) 
  342. 		title_twn:set_property("end_value",-800,0) 
  343. 		Store_crib_title_in_anim:play()	 
  344. 	end 
  345. 	 
  346. 	bg_saints_set_background(false) 
  347. 	 
  348. 	back_out_anim:play() 
  349. 	 
  350. end 
  351.  
  352. function store_crib_anim_complete() 
  353. end 
  354.  
  355. function store_crib_back_out_anim_complete(tween_h, event) 
  356. 	 
  357. 	 
  358. 	if Store_crib_screen_to_push ~= "store_stronghold" then 
  359. 		 
  360. 	end 
  361.  
  362. 	if Transition_to_garage_type ~= -1 then 
  363. 		-- Set up going to garage 
  364. 		store_crib_init_crib_garage(Transition_to_garage_type) 
  365. 		Transition_to_garage_type = -1 
  366. 	end 
  367.  
  368. 	 
  369. 	if Previous_screen == "store_vehicle" then 
  370. 		bg_saints_set_type(BG_TYPE_CRIB, true, 1280) 
  371. 		return 
  372. 	end 
  373.  
  374. 	-- attempt to push screen.  If something bad happens kick the user back to game. 
  375. 	local success = push_screen(Store_crib_screen_to_push) 
  376. 	 
  377. 	if success == false then 
  378. 		pop_screen() 
  379. 	end 
  380. end 
  381.  
  382. function store_lock_controls() 
  383. 	Input_tracker:subscribe(false) 
  384. 	store_crib_enable_mouse(false) 
  385. end 
  386.  
  387. function store_unlock_controls() 
  388. 	debug_print("vint","THIS IS REALLY BAD\n") 
  389. 	Input_tracker:subscribe(true) 
  390. 	store_crib_enable_mouse(true) 
  391. end 
  392.  
  393. 	 
  394. -- Called when player requests exiting store. 
  395. -- 
  396. function store_crib_exit() 
  397. 	Store_common_popup:populate_list(Yes_no_choices, 2, STORE_COMMON_LIST_SIZE, 2)	 
  398. 	Store_common_popup:set_title("MENU_TITLE_WARNING") 
  399. 	Store_common_popup:set_text("MENU_EXIT_CRIB")	 
  400. 	Store_common_popup:nav_enable(true, "store_crib_exit_final", "store_crib_popup_nav") 
  401. 	Not_popup_grp:set_alpha(.5) 
  402. 	 
  403. 	store_crib_enable_mouse(false) 
  404. end 
  405.  
  406. -- Called when player has responded to store exit confirmation dialog. 
  407. -- 
  408. -- event: input response from the player 
  409. -- 
  410. function store_crib_exit_final(event) 
  411. 	Store_common_popup:nav_enable(false, nil, nil) 
  412. 		 
  413. 	-- The user hit the B button and is exiting 
  414. 	-- This is redundant to selecting "No" in the list 
  415. 	if event == "back" then 
  416. 		game_UI_audio_play("UI_Main_Menu_Nav_Back") 
  417. 		Not_popup_grp:set_alpha(1) 
  418. 		store_crib_enable_mouse(true) 
  419. 		return 
  420. 	end 
  421. 	 
  422. 	game_UI_audio_play("UI_Main_Menu_Select") 
  423. 	 
  424. 	-- Did we select yes?  This assumes yes is the first item 
  425. 	if Store_common_popup:get_selected_data() ~= 1 then 
  426. 		Not_popup_grp:set_alpha(1) 
  427. 		store_crib_enable_mouse(true) 
  428. 		return 
  429. 	end 
  430. 	 
  431. 	Not_popup_grp:set_alpha(0) 
  432. 	-- exit the interface 
  433. 	pop_screen() 
  434. end 
  435.  
  436. -- Populate the active megalist menu, and hide the previous menu 
  437. -- 
  438. -- list_data: 		this table contains the data to populate the megalist 
  439. -- current_index: 	the current index in the menu that's selected 
  440. -- 
  441. function store_crib_populate_list(list_data, current_index) 
  442. 	Active_list:draw_items(list_data, current_index, STORE_COMMON_LIST_SIZE, 10, LIST_FONT_SCALE, true)	 
  443. 	Active_list:set_visible(true) 
  444. 	 
  445. 	if Game_platform == "PC" then 
  446. 		Mouse_input_tracker:remove_all() 
  447. 		 
  448. 		Active_list:set_store("store_crib") 
  449. 		Active_list:add_mouse_inputs("store_common", Mouse_input_tracker) 
  450. 		Mouse_input_tracker:subscribe(true) 
  451. 	end 
  452. end 
  453.  
  454. -- Clears the price and respect values from the store header. 
  455. -- 
  456. function store_crib_header_revert(menu_data) 
  457. 	Store_header:set_price(nil) 
  458. 	Store_header:set_respect(nil) 
  459. end 
  460.  
  461. -- Handles navigation of any popups 
  462. function store_crib_popup_nav(event, value) 
  463. 	 
  464. 	if event == "nav_up" then	 
  465. 		Store_common_popup.list:move_cursor(-1)	 
  466. 	elseif event == "nav_down" then 
  467. 		Store_common_popup.list:move_cursor(1) 
  468. 	elseif event == "mouse_move" then 
  469. 		-- value contains the target_handle in this case 
  470. 		local new_index = Store_common_popup.list:get_button_index(value) 
  471. 		if new_index ~= 0 then 
  472. 			Store_common_popup.list:set_selection(new_index) 
  473. 			Store_common_popup.list:move_cursor(0, true) 
  474. 		end 
  475. 		 
  476. 	else 
  477. 		--do nothing 
  478. 	end 
  479. end 
  480.  
  481. -- Pushes a new UI screen on the stack based on the "screen" parameter in menu_data. 
  482. -- 
  483. function store_crib_open_screen(menu_data) 
  484. 	 
  485. 	Previous_screen = menu_data.screen 
  486. 	Store_crib_current_menu_selection = menu_data.id 
  487. 	Store_crib_screen_to_push = menu_data.screen 
  488. 	 
  489. 	--LOCK INPUT 
  490. 	store_lock_controls() 
  491. 	 
  492. 	if menu_data.screen == "store_stronghold" then 
  493. 		bg_saints_set_type(BG_TYPE_CRIB,true) 
  494. 		store_crib_back_out_anim(true) 
  495. 		Hint_bar_mouse_input_tracker:subscribe(false) 
  496. 		Hint_bar_mouse_input_tracker:remove_all() 
  497. 	elseif menu_data.screen == "store_weapon" or menu_data.screen == "store_gang" or menu_data.screen == "store_clothing" then 
  498. 		store_crib_back_out_anim() 
  499. 	else	 
  500. 		bg_saints_set_type(BG_TYPE_CRIB_USE,true) 
  501. 		store_crib_back_out_anim() 
  502. 	end 
  503.  
  504. end 
  505.  
  506. function store_crib_open_cash(menu_data) 
  507. 	 
  508. 	Previous_screen = menu_data.screen 
  509. 	Store_crib_current_menu_selection = menu_data.id 
  510. 	push_screen(menu_data.screen) 
  511. 	store_crib_enable_mouse(false) 
  512. end 
  513.  
  514. function store_crib_open_garage(menu_data) 
  515. 	--LOCK INPUT 
  516. 	store_lock_controls() 
  517. 	 
  518. 	Previous_screen = menu_data.screen 
  519. 	Store_crib_current_menu_selection = menu_data.id 
  520. 	 
  521. 	Transition_to_garage_type = menu_data.garage_type 
  522.  
  523. 	store_crib_back_out_anim(true) 
  524. 	store_crib_enable_mouse(false) 
  525. end 
  526. 		 
  527. -- Base Menu Options always available 
  528. --[[ 
  529. Store_crib_top_menu = { 
  530. 	[1] = { label = "COMPLETION_CASH", type = TYPE_BUTTON, on_select = store_crib_open_cash, screen = "store_crib_cash", id = 1 }, 
  531. 	[2] = { label = "MENU_SWAP_WARDROBE", type = TYPE_BUTTON, on_select = store_crib_open_screen, screen = "store_clothing",  id = 2}, 
  532. 	[3] = { label = "GARAGE_CRIB_NAME", type = TYPE_BUTTON, on_select = store_crib_open_garage, screen = "store_vehicle", id = 3 },	 
  533. 	[4] = { label = "WPNSTOR_TITLE_WEAPON_CACHE", type = TYPE_BUTTON, on_select = store_crib_open_screen, screen = "store_weapon", id = 4 }, 
  534. } 
  535. --]] 
  536.  
  537. -- ===================================== 
  538. --       Mouse Specific Functions 
  539. -- ===================================== 
  540.  
  541. function store_crib_enable_mouse(enable) 
  542. 	if Game_platform == "PC" and enable ~= nil then 
  543. 		if Mouse_input_tracker ~= 0 then 
  544. 			Mouse_input_tracker:subscribe(enable) 
  545. 		end 
  546. 		 
  547. 		if Hint_bar_mouse_input_tracker ~= nil then 
  548. 			Hint_bar_mouse_input_tracker:subscribe(enable) 
  549. 		end 
  550. 		 
  551. 	end 
  552. end 
  553.  
  554. function store_crib_mouse_click(event, target_handle) 
  555. 	local hint_index = Store_common_hint_bar:get_hint_index(target_handle) 
  556. 	if hint_index ~= 0 then 
  557. 		store_common_button_b() 
  558. 	end 
  559. end 
  560.  
  561. function store_crib_mouse_move(event, target_handle) 
  562. 	-- Reset all highlights 
  563. 	Store_common_hint_bar:set_highlight(0) 
  564. 	 
  565. 	-- Check if the mouse is over the hint bar buttons 
  566. 	local hint_index = Store_common_hint_bar:get_hint_index(target_handle) 
  567. 	if hint_index ~= 0 then 
  568. 		Store_common_hint_bar:set_highlight(hint_index, Store_common_current_highlight_color) 
  569. 		return 
  570. 	end 
  571. 	 
  572. 	-- Check if the mouse is over a button on the mega list 
  573. 	local old_index = Active_list:get_selection() 
  574. 	local new_index = Active_list:get_button_index(target_handle) 
  575. 	if new_index ~= 0 and new_index ~= old_index then 
  576. 		Active_list:set_selection(new_index) 
  577. 		Active_list:move_cursor(0, true) 
  578. 		return 
  579. 	end 
  580. end 
  581.  
  582. function store_crib_mouse_scroll(event, target_handle, mouse_x, mouse_y, scroll_lines) 
  583. end 
  584.  
  585. function store_crib_mouse_drag(event, target_handle, mouse_x, mouse_y) 
  586. end 
  587.  
  588. function store_crib_mouse_drag_release(event, target_handle, mouse_x, mouse_y) 
  589. end 
  590.