./msn_title.lua

  1. Msn_title_doc_handle = -1 
  2.  
  3. function msn_title_init() 
  4. 	Msn_title_doc_handle = vint_document_find("msn_title") 
  5. 	vint_dataitem_add_subscription( "game_paused_item", "update", "msn_title_game_is_paused" ) 
  6. 	thread_new( "msn_title_load_assets" ) 
  7. end 
  8.  
  9. function msn_title_load_assets() 
  10. 	pause_map_dump( true ) 
  11. 	game_peg_load_with_cb("msn_title_peg_loaded", 2, "ui_msn_title_leave", "ui_msn_title_fryer") 
  12. 	 
  13. end 
  14.  
  15. function msn_title_peg_loaded() 
  16. 	local title_h = vint_object_find("title", 0, Msn_title_doc_handle) 
  17. 	vint_set_property(title_h, "image", "ui_msn_title_leave") 
  18. 	 
  19. 	local ad1_h = vint_object_find("ad1", 0, Msn_title_doc_handle) 
  20. 	vint_set_property(ad1_h, "image", "ui_msn_title_fryer") 
  21. 	 
  22. 	local anim_h = vint_object_find("title_anim", 0, Msn_title_doc_handle) 
  23. 	local twn_h = vint_object_find("end_event_twn", anim_h) 
  24. 	vint_set_property(twn_h, "end_event", "msn_title_unload") 
  25. 	vint_apply_start_values(anim_h) 
  26. 	lua_play_anim(anim_h) 
  27. end 
  28.  
  29. function msn_title_game_is_paused( di_h ) 
  30. 	local is_paused = vint_dataitem_get(di_h) 
  31. 	 
  32. 	local root_anim_h = vint_object_find( "title_anim" ) 
  33. 	vint_set_property( root_anim_h, "is_paused", is_paused ) 
  34. end 
  35.  
  36. function msn_title_unload() 
  37. 	game_peg_unload_wait("ui_msn_title_leave") 
  38. 	game_peg_unload_wait("ui_msn_title_fryer") 
  39. 	pause_map_restore() 
  40. 	pop_screen() 
  41. end 
  42.  
  43. function msn_title_cleanup() 
  44. end 
  45.