./horde_results.lua

  1. --ENUMS 
  2. --Screen types... Wave, win or fail... 
  3.  
  4. local HORDE_SCREEN_TYPE_WAVE	= 0 
  5. local HORDE_SCREEN_TYPE_WIN 	= 1 
  6. local HORDE_SCREEN_TYPE_FAIL 	= 2 
  7.  
  8. local HMEA_RETRY 	= 0 
  9. local HMEA_NEW		= 1 
  10. local	HMEA_QUIT	= 2 
  11.  
  12. --Player ids... 
  13. local PLAYER_1_ID	= 0 
  14. local PLAYER_2_ID = 1 
  15.  
  16. --Menu ids... 
  17. local MENU_ID_CONTINUE = 1 
  18. local MENU_ID_NEW_GAME = 2 
  19. local MENU_ID_QUIT = 3 
  20.  
  21. --Constants 
  22. local WAVE_SCREEN_TIME 		= 8	-- Displays for Eight seconds on the screen... 
  23.  
  24. --Internal name is on left, bitmap on right. 
  25. local HORDE_PLAYER_IMAGES = { 
  26. 	["Bobert"] 		= "ui_whored_bobert", 
  27. 	["Cowgirl"] 	= "ui_whored_cowgirl", 
  28. 	["Cyril"] 		= "ui_whored_cyril", 
  29. 	["Gimpy"] 		= "ui_whored_gimpy", 
  30. 	["Super"] 		= "ui_whored_super", 
  31. } 
  32.  
  33. local Screen_animated_in = false 
  34. local Horde_results_doc_h = -1 
  35. --Global Vdo's 
  36. local Input_tracker 
  37. local Mouse_input_tracker = 0 
  38. local Mega_list 
  39.  
  40. Horde_results_disconnect_dialog_handle = 0 
  41.  
  42. -- for host when players win... 
  43. Horde_host_list = { 
  44. 	[1] = {	 
  45. 		type = TYPE_BUTTON, 
  46. 		label = "HORDE_MODE_MENU_NEW_GAME", 
  47. 		id = MENU_ID_NEW_GAME, 
  48. 	}, 
  49. 	[2] = {	 
  50. 		type = TYPE_BUTTON, 
  51. 		label = "HORDE_MODE_MENU_EXIT", 
  52. 		id = MENU_ID_QUIT, 
  53. 	} 
  54. } 
  55.  
  56. -- for host when players fail... 
  57. Horde_host_fail_list = { 
  58. 	[1] = {	 
  59. 		type = TYPE_BUTTON, 
  60. 		label = "HORDE_MODE_MENU_RETRY", 
  61. 		id = MENU_ID_CONTINUE, 
  62. 	}, 
  63. 	[2] = {	 
  64. 		type = TYPE_BUTTON, 
  65. 		label = "HORDE_MODE_MENU_NEW_GAME", 
  66. 		id = MENU_ID_NEW_GAME, 
  67. 	}, 
  68. 	[3] = {	 
  69. 		type = TYPE_BUTTON, 
  70. 		label = "HORDE_MODE_MENU_EXIT", 
  71. 		id = MENU_ID_QUIT, 
  72. 	} 
  73. } 
  74.  
  75. Horde_wave_end_audio = -1 
  76.  
  77. function horde_results_init() 
  78. 	Horde_results_doc_h = vint_document_find("horde_results") 
  79. 	 
  80. 	bg_saints_show(true) 
  81. 	 
  82. 	--init megalist... 
  83. 	Mega_list = Vdo_mega_list:new("megalist") 
  84. 	Input_tracker = Vdo_input_tracker:new() 
  85. 	 
  86. 	-- Add mouse inputs for the PC 
  87. 	if game_get_platform() == "PC" then 
  88. 		Mouse_input_tracker = Vdo_input_tracker:new() 
  89. 		Mouse_input_tracker:subscribe(false) 
  90. 	end 
  91. 	 
  92. 	 
  93. 	 
  94. 	--hide screen group... will fade in via animation... 
  95. 	local screen_grp_h = vint_object_find("screen_grp") 
  96. 	vint_set_property(screen_grp_h, "alpha", 0) 
  97. 	 
  98. 	Horde_wave_end_audio = audio_object_post_event("ui_whr_wave_end") 
  99. 	 
  100. 	if vint_is_std_res() then 
  101. 		bg_saints_set_type(BG_TYPE_DEFAULT, false, 1280, 0) 
  102. 	else 
  103. 		bg_saints_set_type(BG_TYPE_DEFAULT, false) 
  104. 	end 
  105. 	 
  106. 	bg_saints_set_background(false) 
  107. 	 
  108. 	--set and resize headers if necessary 
  109. 	local scores_header_grp_h = vint_object_find("scores_header_grp") 
  110. 	local kills_header_h = vint_object_find("kills_txt", scores_header_grp_h) 
  111. 	local time_header_h = vint_object_find("time_txt", scores_header_grp_h) 
  112. 	 
  113. 	vint_set_property(kills_header_h,"text_tag", "HORDE_MODE_TITLE_KILLS") 
  114. 	vint_set_property(time_header_h,"text_tag", "HORDE_MODE_TITLE_SURVIVAL_TIME") 
  115. 	 
  116. 	local KILLS_MAX_WIDTH = 120 
  117. 	local TIME_MAX_WIDTH = 215 
  118. 	local kills_width, kills_height = element_get_actual_size(kills_header_h) 
  119. 	local time_width, time_height = element_get_actual_size(time_header_h) 
  120. 	 
  121. 	if kills_width > KILLS_MAX_WIDTH then 
  122. 		local text_scale = KILLS_MAX_WIDTH/kills_width 
  123. 		vint_set_property(kills_header_h, "scale", text_scale,1) 
  124. 	end	 
  125. 	 
  126. 	if time_width > TIME_MAX_WIDTH then 
  127. 		local text_scale = TIME_MAX_WIDTH/time_width 
  128. 		vint_set_property(time_header_h, "scale", text_scale,1) 
  129. 	end		 
  130. 	 
  131. 	--do data responder... 
  132. 	vint_dataresponder_request("horde_results_populate", "horde_results_populate", 0) 
  133. 	 
  134. 	--fake populate... for testing :) 
  135. 	--horde_results_populate(HORDE_SCREEN_TYPE_FAIL, 10,  "EXCELLENT WAVE", "You might want to try something special next time. It is the only way.", 20000, 40000, "Zimos", "James Designer", 200, 500000, .5, "Zimos", "Joe Mazooola", 400, 520000, .6) 
  136. 	--horde_results_populate(HORDE_SCREEN_TYPE_FAIL, 12, "EXCELLENT WAVE", "You might want to try something special next time. It is the only way.", 300000, 120000, "Zimos", "James Designer", 200, 500000, .5, "Zimos", "Joe Mazooola", 400, 520000, .6) 
  137. 	--horde_results_populate(HORDE_SCREEN_TYPE_WAVE, 12, "DUMBASS WAVE", "You might want to try something special next time. It is the only way.", 300000, 120000, "Bobert", "James Designer", 200, 500000, .5, "Super", "Joe Mazooola", 400, 520000, 1) 
  138. end 
  139.  
  140. function horde_results_cleanup() 
  141. 	audio_stop(Horde_wave_end_audio) 
  142. end 
  143.  
  144. function horde_results_populate(type, wave_num, wave_title, wave_failure_text, score, previous_high_score, local_player_character, local_player_name, local_player_kills, local_player_survival_time_ms, local_player_wave_progress, remote_player_character, remote_player_name, remote_player_kills, remote_player_survival_time_ms, remote_player_wave_progress) 
  145.  
  146. 	--Do titles... 
  147. 	local title_grp_h = vint_object_find("title_grp") 
  148. 	local title_wave_txt_h = vint_object_find("title_wave_txt", 	title_grp_h) 
  149. 	local title_result_txt_h = vint_object_find("title_result_txt", 	title_grp_h) 
  150. 	local title_game_txt_h = vint_object_find("title_game_txt", 	title_grp_h) 
  151. 	 
  152. 	--figure out how to display each title... depending on type and final wave... 
  153. 	local title_wave_combined_txt = ""  
  154. 	local values = {[0] = wave_num + 1} 
  155. 	title_wave_combined_txt = vint_insert_values_in_string("COOP_LOBBY_WAVE", values) 
  156. 	 
  157. 	local result_txt = "" 
  158. 	local result_color = {148/255,0,197/255} 
  159. 	if type == HORDE_SCREEN_TYPE_WAVE then 
  160. 		result_txt = "COMPLETION_COMPLETE" 
  161. 	elseif type == HORDE_SCREEN_TYPE_WIN then 
  162. 		result_txt = "COMPLETION_COMPLETE" 
  163. 		title_wave_combined_txt = "" 
  164. 	elseif type == HORDE_SCREEN_TYPE_FAIL then 
  165. 		result_txt = "COMPLETION_FAILED" 
  166. 		result_color = {225/255, 42/255, 1/255} 
  167. 	end 
  168. 	 
  169. 	vint_set_property(title_wave_txt_h, "text_tag", title_wave_combined_txt)		--"WAVE 10" 
  170. 	vint_set_property(title_result_txt_h, "text_tag", result_txt)		--"COMPLETE" 
  171. 	vint_set_property(title_game_txt_h, "text_tag", wave_title)							--"ZOMBIE FISTING" 
  172. 	vint_set_property(title_result_txt_h, "tint", result_color[1], result_color[2], result_color[3]) 
  173. 	 
  174. 	--Reposition result text 
  175. 	local x, y = vint_get_property(title_wave_txt_h, "anchor") 
  176. 	local width, height = element_get_actual_size(title_wave_txt_h) 
  177. 	if type ~= HORDE_SCREEN_TYPE_WIN then 
  178. 		x = x + width + 10 
  179. 	else  
  180. 	end 
  181. 	vint_set_property(title_result_txt_h, "anchor", x, y) 
  182. 	 
  183. 	--setup data... 
  184. 	local player_local = {} 
  185. 	player_local.name 			= local_player_name 
  186. 	player_local.kills 		= local_player_kills 
  187. 	player_local.time 			= local_player_survival_time_ms 
  188. 	player_local.character 	= local_player_character 
  189. 	player_local.progress 	= local_player_wave_progress 
  190. 	 
  191. 	local player_remote = {} 
  192. 	player_remote.name 			= remote_player_name 
  193. 	player_remote.kills 		= remote_player_kills 
  194. 	player_remote.time 			= remote_player_survival_time_ms 
  195. 	player_remote.character	= remote_player_character 
  196. 	player_remote.progress 	= remote_player_wave_progress 
  197. 	 
  198. 	local data = {} 
  199. 	data[1] = player_local 
  200. 	 
  201. 	if remote_player_name ~= "" then 
  202. 		data[2] = player_remote 
  203. 	end 
  204. 	 
  205. 	local player_grp_h = vint_object_find("player_grp") 
  206.  
  207. 	-- store sizes about progress bar... 
  208. 	local progress_bg_h = vint_object_find("progress_bg", player_grp_h) 
  209. 	local progress_base_width, progress_base_height = element_get_actual_size(progress_bg_h) 
  210. 	 
  211. 	for idx, player_data in pairs(data) do 
  212. 		local base_h 
  213. 		if idx == 1 then 
  214. 			base_h = player_grp_h 
  215. 		else 
  216. 			base_h = vint_object_clone(player_grp_h) 
  217. 			--position 
  218. 			local x, y = vint_get_property(base_h, "anchor") 
  219. 			vint_set_property(base_h, "anchor", x, y + 100) 
  220. 			vint_set_property(base_h, "depth", idx) 
  221. 		end 
  222. 	 
  223. 		local name_txt_h 		= vint_object_find("name_txt", 	base_h) 
  224. 		local kills_txt_h 	= vint_object_find("kills_txt", 	base_h) 
  225. 		local time_txt_h 		= vint_object_find("time_txt", 	base_h) 
  226. 		local player_img_h 	= vint_object_find("player_img", 	base_h) 
  227. 	 
  228. 		--set text files... 
  229. 		vint_set_property(name_txt_h, 	"text_tag", player_data.name ) 
  230. 		vint_set_property(kills_txt_h, 	"text_tag", format_cash(player_data.kills) )  
  231. 		 
  232. 		local time_in_seconds = abs(player_data.time / 1000)		 
  233. 		 
  234. 		if time_in_seconds < 60 then 
  235. 			vint_set_property(time_txt_h, 	"text_tag", ":".. format_time(player_data.time / 1000, false, false) )	 
  236. 		else	 
  237. 			vint_set_property(time_txt_h, 	"text_tag", format_time(player_data.time / 1000, false, false) )	 
  238. 		end 
  239.  
  240. 		-- set image based on character info...... 
  241. 		local image = HORDE_PLAYER_IMAGES[player_data.character] 
  242. 		image = image or "ui_homie_zimos" 
  243. 		vint_set_property(player_img_h, "image", image) 
  244. 		 
  245. 		--Set player progress data... 
  246. 		 
  247. 		local progress_bg_h = vint_object_find("progress_bg", base_h) 
  248. 		local progress_img_h = vint_object_find("progress_img", base_h) 
  249. 		 
  250. 		local progress_anim_h = vint_object_find("progress_anim", 0, Horde_results_doc_h) 
  251. 		 
  252. 		if player_data.progress == 1 then 
  253. 			--full progress 
  254. 			 
  255. 			--reset bar to full size... 
  256. 			element_set_actual_size(progress_bg_h, progress_base_width, progress_base_height) 
  257. 			 
  258. 			--no icon... 
  259. 			vint_set_property( progress_img_h, "visible", false) 
  260. 			 
  261. 			--animate 
  262. 			lua_play_anim(progress_anim_h) 
  263. 		else 
  264.  
  265. 			--set bar bar to full size... 
  266. 			 
  267. 			local width = progress_base_width * player_data.progress 
  268. 			 
  269. 			element_set_actual_size(progress_bg_h, progress_base_width, progress_base_height) 
  270. 			--element_set_actual_size(progress_bg_h, width, progress_base_height) 
  271. 			 
  272. 			--position end icon... 
  273. 			 
  274. 			local progress_img_twn_h = vint_object_find("progress_img_twn", 0, Horde_results_doc_h) 
  275. 			local progress_bg_twn_h = vint_object_find("progress_bg_twn", 0, Horde_results_doc_h) 
  276. 			 
  277. 			local x, y = vint_get_property(progress_img_h, "anchor") 
  278. 			x = width  
  279. 			vint_set_property(progress_img_twn_h,"end_value", x, y) 
  280. 			vint_set_property(progress_bg_twn_h,"end_value", x, y) 
  281. 			--vint_set_property(progress_img_h, "anchor", x, y) 
  282. 			vint_set_property( progress_img_h, "visible", true) 
  283. 			 
  284. 			--animate 
  285. 			lua_play_anim(progress_anim_h) 
  286. 		end 
  287.  
  288. 		local shadow = Vdo_shadow:new("shadow", base_h) 
  289. 		shadow:set_props(815,82, false, 20) 
  290. 	end 
  291.  
  292.  
  293. 	 --score, previous_high_score 
  294. 	--Do scores now... 
  295. 	local total_score_grp_h = vint_object_find("total_score_grp") 
  296. 	--local wave_fail_grp_h = vint_object_find("wave_fail_grp") 
  297. 	--local wave_failure_txt_h = vint_object_find("wave_failure_txt_h") 
  298.  
  299. 	--vint_set_property(wave_failure_txt_h, "text_tag", "This is hello") 
  300. 	 
  301. 	--TODO: SET POSITION OF SCORES... 
  302. 	--vint_set_property(total_score_grp_h, "anchor",) 
  303. 	 
  304. 	 
  305. 	--set crown image 
  306. 	 
  307. 	local winner_bmp_h = vint_object_find("winner_bmp") 
  308. 	if remote_player_name ~= "" then 
  309. 		vint_set_property(winner_bmp_h, "visible", true) 
  310. 	else 
  311. 		vint_set_property(winner_bmp_h, "visible", false) 
  312. 	end 
  313. 		 
  314. 	 
  315. 	--Set score... 
  316. 	local score_value_txt_h = vint_object_find("score_value_txt", total_score_grp_h) 
  317. 	local score_high_value_txt_h = vint_object_find("score_high_value_txt", total_score_grp_h) 
  318. 	 
  319. 	local score_high_title_txt_h	= vint_object_find("score_high_title_txt", total_score_grp_h) 
  320. 	 
  321. 	vint_set_property(score_value_txt_h, "text_tag", format_cash(score)) 
  322. 	 
  323. 	--Check to see if we broke a previous high score... 
  324. 	if score > previous_high_score then 
  325. 		--NEW HIGHSCORE... 
  326. 		vint_set_property(score_high_value_txt_h, "text_tag", format_cash(score)) 
  327. 		vint_set_property(score_high_title_txt_h, "text_tag", "HORDE_MODE_TITLE_HIGHSCORE_NEW") 
  328. 		vint_set_property(score_high_title_txt_h, "tint", 148/255, 0/255, 197/255) 
  329. 	else 
  330. 		vint_set_property(score_high_value_txt_h, "text_tag", format_cash(previous_high_score)) 
  331. 		vint_set_property(score_high_title_txt_h, "text_tag", "HORDE_MODE_TITLE_HIGHSCORE") 
  332. 		vint_set_property(score_high_title_txt_h, "tint", 153/255, 153/255, 153/255) 
  333. 	end 
  334. 	 
  335. 	-- Only show options if we are in a win or fail screen... 
  336. 	local waiting_for_coop_grp_h = vint_object_find("waiting_for_coop_grp") 
  337. 	if ( type == HORDE_SCREEN_TYPE_WIN or type == HORDE_SCREEN_TYPE_FAIL ) then	 
  338. 		if not game_get_is_host() then 
  339. 			--Coop players screen... 
  340. 			vint_set_property(waiting_for_coop_grp_h, "visible", true) 
  341. 			Mega_list:set_visible(false) 
  342. 			-- do coop player inputs... 
  343. 			Input_tracker:add_input("map", "horde_results_input_coop_back") 
  344. 			Input_tracker:add_input("pause", "horde_results_input_nothing", 50) 
  345. 		else 
  346. 			--Host players screen... this is the same even if we aren't in coop... 
  347. 			vint_set_property(waiting_for_coop_grp_h, "visible", false) 
  348. 			 
  349. 			--Use the appropriate list options... 
  350. 			local mega_list_data = Horde_host_fail_list 
  351. 			if type == HORDE_SCREEN_TYPE_WIN then 
  352. 				mega_list_data = Horde_host_list 
  353. 			end 
  354. 			 
  355. 			Mega_list:draw_items(mega_list_data, 1, 815) 
  356. 			Mega_list:set_highlight_color(COLOR_STORE_REWARDS_PRIMARY, COLOR_STORE_REWARDS_SECONDARY) 
  357.  
  358. 			--subscribe to inputs... 
  359. 			Input_tracker:add_input("select", "horde_results_input_a", 50) 
  360. 			Input_tracker:add_input("back", "horde_results_input_nothing", 50) 
  361. 			Input_tracker:add_input("nav_up", "horde_results_nav_up", 50) 
  362. 			Input_tracker:add_input("nav_down", "horde_results_nav_down", 50) 
  363. 			Input_tracker:add_input("nav_left", "horde_results_input_nothing", 50) 
  364. 			Input_tracker:add_input("nav_right", "horde_results_input_nothing", 50) 
  365. 			Input_tracker:add_input("map", "horde_results_input_nothing") 
  366. 			Input_tracker:add_input("pause", "horde_results_input_a", 50) 
  367. 			 
  368. 			if Mouse_input_tracker ~= 0 then 
  369. 				Mouse_input_tracker:remove_all() 
  370. 				Mega_list:add_mouse_inputs("horde_results", Mouse_input_tracker) 
  371. 				Mouse_input_tracker:subscribe(true) 
  372. 			end 
  373. 		end 
  374. 	else 
  375. 		Input_tracker:add_input("map", "horde_results_input_nothing") 
  376. 		Input_tracker:add_input("pause", "horde_results_input_nothing", 50) 
  377. 		--wave mode... 
  378. 		vint_set_property(waiting_for_coop_grp_h, "visible", false) 
  379. 		Mega_list:set_visible(false) 
  380. 		 
  381. 		--delay the animation of the screen out... 
  382. 		horde_results_animate_out(WAVE_SCREEN_TIME) 
  383. 	end 
  384. 	 
  385. 	--Animate screen in... 
  386. 	horde_results_animate_in() 
  387. 	Input_tracker:subscribe(true) 
  388. end 
  389.  
  390. -------------------------------------------------------------------------------- 
  391. -- Host input... 
  392. -------------------------------------------------------------------------------- 
  393. function horde_results_input_a() 
  394. 	if Screen_animated_in == false then 
  395. 		return 
  396. 	end 
  397. 	 
  398. 	--make selection on current megalist... 
  399. 	local id = Mega_list:get_id() 
  400. 	if id == MENU_ID_CONTINUE then 
  401. 		--Continue/restart from last wave... 
  402. 		horde_results_set_end_action(HMEA_RETRY) 
  403. 		horde_results_exit() 
  404. 	elseif id == MENU_ID_NEW_GAME then 
  405. 		--State new game... 
  406. 		horde_results_set_end_action(HMEA_NEW) 
  407. 		horde_results_exit() 
  408. 	elseif id == MENU_ID_QUIT then 
  409. 		--Quit game 
  410. 		audio_object_post_event("ui_whr_quit_gameplay") 
  411. 		horde_results_set_end_action(HMEA_QUIT) 
  412. 		horde_results_exit() 
  413. 	end 
  414. end 
  415.  
  416. function horde_results_nav_up() 
  417. 	if Screen_animated_in == false then 
  418. 		return 
  419. 	end 
  420.  
  421. 	Mega_list:move_cursor(-1) 
  422. end 
  423.  
  424. function horde_results_nav_down() 
  425. 	if Screen_animated_in == false then 
  426. 		return 
  427. 	end 
  428.  
  429. 	Mega_list:move_cursor(1) 
  430. end 
  431.  
  432. function horde_results_input_nothing() 
  433. 	--do nothing... 
  434. end 
  435.  
  436. -------------------------------------------------------------------------------- 
  437. -- Coop player input... 
  438. -------------------------------------------------------------------------------- 
  439. function horde_results_input_coop_back() 
  440. 	local options = { [0] = "CONTROL_YES", [1] = "CONTROL_NO" } 
  441. 	Horde_results_disconnect_dialog_handle = dialog_box_open("MENU_TITLE_WARNING", "DIALOG_PAUSE_DISCONNECT_PROMPT", options, "horde_results_coop_disconnect", 1, DIALOG_PRIORITY_SYSTEM_CRITICAL, true, nil, false, false) 
  442. end 
  443.  
  444.  
  445. ------------------------------------------------------------------------------- 
  446. -- When the coop disconnect dialog closes... this is called. 
  447. -- 
  448. function horde_results_coop_disconnect(result, action) 
  449. 	--They selected yes... 
  450. 	if result == 0 then 
  451. 		dialog_box_disconnect() 
  452. 	end 
  453. 	 
  454. 	Horde_results_disconnect_dialog_handle = 0 
  455. end 
  456.  
  457.  
  458. ------------------------------------------------------------------------------- 
  459. -- animates the screen in... 
  460. ------------------------------------------------------------------------------- 
  461. function horde_results_animate_in() 
  462. 	--animate in... 
  463. 	bg_saints_slide_in() 
  464. 	local screen_grp_h = vint_object_find("screen_grp") 
  465. 	vint_set_property(screen_grp_h, "alpha", 1) 
  466. 	local screen_slide_in_anim_h = vint_object_find("screen_slide_in_anim", 0, Horde_results_doc_h) 
  467. 	local screen_slide_in_twn_h = vint_object_find("screen_slide_in_twn", screen_slide_in_anim_h) 
  468. 	vint_set_property(screen_slide_in_twn_h, "end_event", "horde_results_anim_in_cb") 
  469. 	lua_play_anim(screen_slide_in_anim_h) 
  470. end 
  471.  
  472. function horde_results_anim_in_cb() 
  473. 	--subscribe to registered inputs... 
  474. 	Screen_animated_in = true 
  475. end 
  476.  
  477. ------------------------------------------------------------------------------- 
  478. -- animates the screen out... 
  479. -- @param time		time in seconds you want to fade out... 
  480. ------------------------------------------------------------------------------- 
  481. function horde_results_animate_out(time) 
  482. 	--animate out... 
  483. 	local screen_slide_out_anim_h = vint_object_find("screen_slide_out_anim", 0, Horde_results_doc_h) 
  484. 	local screen_slide_out_twn_h = vint_object_find("screen_slide_out_twn", screen_slide_out_anim_h) 
  485. 	vint_set_property(screen_slide_out_twn_h, "start_event", "horde_results_bg_slide_out") 
  486. 	vint_set_property(screen_slide_out_twn_h, "end_event", "horde_results_anim_out_cb") 
  487. 	lua_play_anim(screen_slide_out_anim_h, time) 
  488. end 
  489.  
  490. --slides out the bg_saints once the screen animation actually kicks off 
  491. function horde_results_bg_slide_out() 
  492. 	bg_saints_slide_out(1300) 
  493. end 
  494.  
  495. function horde_results_anim_out_cb() 
  496. 	horde_results_exit() 
  497. end 
  498.  
  499. ------------------------------------------------------------------------------- 
  500. -- Exits whored mode... 
  501. ------------------------------------------------------------------------------- 
  502. function horde_results_exit() 
  503. 	--unload screen... 
  504. --	local horde_results_h = vint_document_find("horde_results") 
  505. --	vint_document_unload(horde_results_h) 
  506. 	pop_screen() 
  507. end 
  508.  
  509.  
  510.  
  511. ------------------------------------------------------------------------------- 
  512. -- Mouse inputs 
  513. function horde_results_mouse_click(event, target_handle, mouse_x, mouse_y) 
  514. 	local new_index = Mega_list:get_button_index(target_handle) 
  515. 	if new_index ~= 0 then 
  516. 		Mega_list:set_selection(new_index) 
  517. 		horde_results_input_a() 
  518. 	end 
  519. end 
  520.  
  521. function horde_results_mouse_move(event, target_handle) 
  522. 	local new_index = Mega_list:get_button_index(target_handle) 
  523. 	if new_index ~= 0 then 
  524. 		Mega_list:set_selection(new_index) 
  525. 		Mega_list:move_cursor(0, true) 
  526. 	end 
  527. end 
  528.  
  529. function horde_results_mouse_drag(event, target_handle, mouse_x, mouse_y) 
  530. end 
  531.  
  532. function horde_results_mouse_drag_release(event, target_handle, mouse_x, mouse_y) 
  533. end 
  534.  
  535.