./main_menu_load.lua

  1. Main_menu_load_doc = -1 
  2.  
  3. -- Initializes main menu loading... 
  4. -- 
  5. function main_menu_load_init() 
  6. 	--This doc is included as a dependency of main_menu_top, so the only thing we want to do is store a global reference to it... 
  7. 	Main_menu_load_doc = vint_document_find("main_menu_load") 
  8. 	 
  9. end 
  10.  
  11. function main_menu_load_cleanup() 
  12. end 
  13.  
  14. -- Starts the main menu load. 
  15. function main_menu_load_start() 
  16. 	--Play animations... 
  17. 	local intro_loading_anim_h = vint_object_find("intro_loading_anim", 0, Main_menu_load_doc)		--Fade in percent... 
  18. 	local loading_pulse_anim_h = vint_object_find("loading_pulse_anim", 0, Main_menu_load_doc)		-- 
  19. 	lua_play_anim(intro_loading_anim_h, 0, Main_menu_load_doc) 
  20. 	lua_play_anim(loading_pulse_anim_h, 0, Main_menu_load_doc) 
  21. end 
  22.  
  23. -- if percent < 1 then update the loading progress indicator 
  24. -- otherwise transition to "press start..." 
  25.  
  26. -- Update from game the percentage of the loading... 
  27. -- when it is done loading it should called 
  28. function main_menu_load_complete(percent) 
  29. 	if percent >= 1 then 
  30. 		--Main menu loaded.... 
  31. 		main_menu_load_finished() 
  32. 		percent = 1 
  33. 	end 
  34. 	 
  35. 	--Insert Percent into loading text 
  36. 	local values = {[0] = "GAME_LOADING", [1] = floor(percent*100)} 
  37. 	local str = vint_insert_values_in_string("{0} {1}%%%", values) 
  38. 	vint_set_property(vint_object_find("mm_percent_complete", 0, Main_menu_load_doc), "text_tag", str) 
  39. end 
  40.  
  41. function main_menu_load_finished() 
  42. 	-- Show press start... call to main_menu_top.lua 
  43. 	main_menu_top_press_start_show() 
  44. 	 
  45. 	--Show Logo... 
  46. 	main_menu_logo_show() 
  47. 	 
  48. 	-- Force pause intro loading anim... 
  49. 	local intro_loading_anim_h = vint_object_find("intro_loading_anim", 0, Main_menu_load_doc)		--Fade in percent... 
  50. 	vint_set_property(intro_loading_anim_h, "is_paused", true) 
  51. 	 
  52. 	-- Hide loading stuff... 
  53. 	local intro_loading_fadeout_anim_h = vint_object_find("intro_loading_fadeout_anim", 0, Main_menu_load_doc) 
  54. 	lua_play_anim(intro_loading_fadeout_anim_h, 0, Main_menu_load_doc) 
  55. end 
  56.  
  57. function main_menu_load_skip() 
  58. 	local screen_black_out_h = vint_object_find("screen_black_out", 0, Main_menu_load_doc) 
  59. 	vint_set_property(screen_black_out_h, "alpha", 0) 
  60. 	 
  61. 	local loading_grp_h = vint_object_find("loading_grp", 0, Main_menu_load_doc) 
  62. 	vint_set_property(loading_grp_h, "alpha", 0) 
  63. end