./msn_logo.lua

  1. Msn_logo_doc_handle = -1 
  2.  
  3. Msn_logo_fade_out_done = false 
  4.  
  5. function msn_logo_init() 
  6. 	Msn_logo_doc_handle = vint_document_find("msn_logo") 
  7. 	vint_dataitem_add_subscription( "game_paused_item", "update", "msn_logo_game_is_paused" ) 
  8. 	thread_new( "msn_logo_load_assets" ) 
  9. end 
  10.  
  11. function msn_logo_load_assets() 
  12. 	pause_map_dump( true ) 
  13. 	game_peg_load_with_cb("msn_logo_peg_loaded", 1, "ui_msn_logo_splash") 
  14. 	 
  15. end 
  16.  
  17. function msn_logo_peg_loaded() 
  18. 	vint_set_glitch_preset("splash") 
  19. 	vint_spike_glitch( 10, .1 ) 
  20. 	 
  21. 	local logo_blue_h = vint_object_find("logo_blue", 0, Msn_logo_doc_handle) 
  22. 	vint_set_property(logo_blue_h, "image", "ui_msn_logo_splash") 
  23. 	 
  24. 	local logo_red_h = vint_object_find("logo_red", 0, Msn_logo_doc_handle) 
  25. 	vint_set_property(logo_red_h, "image", "ui_msn_logo_splash") 
  26. 	 
  27. 	local logo_green_h = vint_object_find("logo_green", 0, Msn_logo_doc_handle) 
  28. 	vint_set_property(logo_green_h, "image", "ui_msn_logo_splash") 
  29. 	 
  30. 	local anim_h = vint_object_find("logo_anim", 0, Msn_logo_doc_handle) 
  31. 	vint_apply_start_values(anim_h) 
  32. 	lua_play_anim(anim_h) 
  33. end 
  34.  
  35. function msn_logo_game_is_paused( di_h ) 
  36. 	if Msn_logo_fade_out_done then  
  37. 		return 
  38. 	end 
  39. 	 
  40. 	local is_paused = vint_dataitem_get(di_h) 
  41. 	 
  42. 	local root_anim_h = vint_object_find( "logo_anim" ) 
  43. 	vint_set_property( root_anim_h, "is_paused", is_paused ) 
  44. end 
  45.  
  46. function msn_logo_glitch_out() 
  47. 	vint_set_glitch_preset("splash") 
  48. 	vint_spike_glitch( 900, 0 ) 
  49. end 
  50.  
  51. --Called by game to unload when ready 
  52. function msn_logo_fade_out() 
  53. 	local anim_out_h = vint_object_find("logo_out_anim", 0, Msn_logo_doc_handle) 
  54. 	local twn_h = vint_object_find("end_event_twn", anim_out_h) 
  55. 	vint_set_property(twn_h, "end_event", "msn_logo_unload") 
  56. 	vint_set_property(twn_h, "start_event", "msn_logo_glitch_out") 
  57. 	lua_play_anim(anim_out_h) 
  58. end 
  59.  
  60. function msn_logo_unload() 
  61. 	game_peg_unload_wait("ui_msn_logo_splash") 
  62. 	pause_map_restore() 
  63. 	Msn_logo_fade_out_done = true 
  64. end 
  65.  
  66. function msn_logo_cleanup() 
  67. end 
  68.