./cutscene_titles.lua

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