./cutscene_titles.lua

  1. local CUTSCENE_HIDE 		= 0 
  2. local CUTSCENE_HOST 		= 1 
  3. local CUTSCENE_CLIENT 	= 2 
  4. local CUTSCENE_CONFIRM_SKIP = 3 
  5. ------------------------------------------------------------------------------- 
  6. -- Screen to handle cutscene titles 
  7. ------------------------------------------------------------------------------- 
  8. local title_txt_h = 0 
  9. local hint_text_h = 0 
  10. function cutscene_titles_init() 
  11. 	title_txt_h = vint_object_find("cutscene_title_txt") 
  12. 	vint_set_property(title_txt_h, "alpha", 0) 
  13. 	 
  14. 	hint_text_h = vint_object_find("cutscene_hint_txt")	 
  15. 	 
  16. 	vint_dataitem_add_subscription("cutscene_titles", "update", "cutscene_titles_update") 
  17. 	 
  18. end 
  19.  
  20. function cutscene_titles_cleanup() 
  21. end 
  22.  
  23. ------------------------------------------------------------------------------- 
  24. -- Sets the text on the cutscene title and starts it 
  25. -- @param	title_txt	String for the title on the screen 
  26. --  
  27. function cutscene_titles_start(title_txt) 
  28. 	 
  29. 	--Replace text 
  30. 	vint_set_property(title_txt_h, "text_tag", title_txt) 
  31. 	--Play anim 
  32. 	local cutscene_title_anim_h = vint_object_find("cutscene_title_anim") 
  33. 	lua_play_anim(cutscene_title_anim_h) 
  34. end 
  35.  
  36. ------------------------------------------------------------------------------- 
  37. -- Data item to update the hint text 
  38. --  
  39. function cutscene_titles_update(di_h) 
  40. 	local hint_type = vint_dataitem_get(di_h) 
  41. 	 
  42. 	if hint_type == CUTSCENE_HIDE then 
  43. 		vint_set_property(hint_text_h,"visible",false) 
  44. 	elseif hint_type == CUTSCENE_HOST then 
  45. 		vint_set_property(hint_text_h,"visible",true) 
  46. 		vint_set_property(hint_text_h,"text_tag","CUTSCENE_HOST_SKIPPING") 
  47. 	elseif hint_type == CUTSCENE_CLIENT then 
  48. 		vint_set_property(hint_text_h,"visible",true) 
  49. 		vint_set_property(hint_text_h,"text_tag","CUTSCENE_REMOTE_SKIPPING") 
  50. 	elseif hint_type == CUTSCENE_CONFIRM_SKIP then 
  51. 		vint_set_property(hint_text_h,"visible",true) 
  52. 		vint_set_property(hint_text_h,"text_tag","CUTSCENE_CONFIRM_SKIPPING") 
  53. 	else 
  54. 		vint_set_property(hint_text_h,"visible",false) 
  55. 	end 
  56. end