./main_sl_about.lua

  1. local Main_sl_about_doc_h 
  2.  
  3. --Define screen width... 
  4. local Screen_width 
  5. if vint_is_std_res() then 
  6. 	Screen_width = 750 
  7. else 
  8. 	Screen_width = 840 
  9. end 
  10.  
  11. local Input_tracker 
  12. local Mouse_input_tracker 
  13.  
  14. local Tween_done = true 
  15.  
  16. function main_sl_about_init() 
  17. 	 
  18. 	Main_sl_about_doc_h = vint_document_find("main_sl_about") 
  19. 	 
  20. 	Input_tracker = Vdo_input_tracker:new() 
  21. 	Input_tracker:add_input("back", "main_sl_about_button_b", 50) 
  22.  
  23. 	Input_tracker:subscribe(false) 
  24.  
  25. 	--Initialize Header 
  26. 	Header_obj:show_me(false) 
  27. 	Header_mini_obj:set_text("SL_TITLE_ABOUT") 
  28. 	Header_mini_obj:set_visible(true) 
  29. 	 
  30. 	--Setup Button Hints 
  31. 	local hint_data = { 
  32. 		{CTRL_MENU_BUTTON_B, "MENU_BACK"}, 
  33. 	} 
  34. 	Menu_hint_bar:set_hints(hint_data) 
  35.  
  36. 	--Store some locals to the pause menu common for screen processing. 
  37. 	menu_common_set_list_style(List, Header_obj, Screen_width) 
  38. 	 
  39. 	--Hide the list... 
  40. 	vint_set_property(List.handle, "visible", false) 
  41. 	 
  42. 	bg_saints_show(true) 
  43. 	menu_common_set_screen_data(List, Header_obj, Input_tracker, Screen_back_out_anim, Screen_slide_out_anim)	 
  44.  
  45. 	--Transition Screen In 
  46. 	local anim_in_h = vint_object_find("anim_in") 
  47. 	lua_play_anim(anim_in_h) 
  48. 	 
  49. 		-- Add mouse inputs for the PC 
  50. 	if game_get_platform() == "PC" then 
  51. 		Menu_hint_bar:set_highlight(0) 
  52. 		 
  53. 		 
  54. 		Mouse_input_tracker = Vdo_input_tracker:new() 
  55. 		Menu_hint_bar:add_mouse_inputs("main_sl_about", Mouse_input_tracker) 
  56. 		Mouse_input_tracker:subscribe(true) 
  57. 	end 
  58. end 
  59.  
  60. function main_sl_about_cleanup() 
  61. 	-- Nuke all button subscriptions 
  62. 	Input_tracker:subscribe(false) 
  63. 	if Mouse_input_tracker ~= nil then 
  64. 		Mouse_input_tracker:subscribe(false) 
  65. 	end 
  66. 	List:enable_toggle_input(false) 
  67. 	 
  68. 	Header_obj:show_me(true) 
  69. 	Header_mini_obj:set_visible(false) 
  70. end 
  71.  
  72.  
  73.  
  74. ------------------------------------------------------------------------------- 
  75. -- Input Tracker Callbacks 
  76. ------------------------------------------------------------------------------- 
  77. function main_sl_about_nav_up(event, acceleration) 
  78. 	-- Move highlight up 
  79. 	--List:move_cursor(-1) 
  80. end 
  81.  
  82. function main_sl_about_nav_down(event, acceleration) 
  83. 	-- Move highlight down 
  84. 	--List:move_cursor(1) 
  85. end 
  86.  
  87. function main_sl_about_nav_left(event, acceleration) 
  88. 	-- Move highlight left 
  89. 	--List:move_slider(-1) 
  90. end 
  91.  
  92. function main_sl_about_nav_right(event, acceleration) 
  93. 	-- Move highlight right 
  94. 	--List:move_slider(1) 
  95. end 
  96.  
  97. function main_sl_about_button_a(event, acceleration) 
  98. 	if Tween_done == true then 
  99. 		--Set the screen data to the list data 
  100. 		Data = List:return_data() 
  101. 		local current_id = List:get_id() 
  102. 	end 
  103. end 
  104.  
  105.  
  106. function main_sl_about_button_b(event, acceleration) 
  107. 	if Tween_done == true then 
  108. 		List:button_b() 
  109.  
  110. 		Input_tracker:subscribe(false) 
  111. 		if Mouse_input_tracker ~= nil then 
  112. 			Mouse_input_tracker:subscribe(false) 
  113. 		end 
  114. 		 
  115. 		 
  116. 		-- final pop... 
  117. 		--Remove current menu from the stack 
  118. 		menu_common_stack_remove() 
  119. 		 
  120. 		--Pop Screen off the list 
  121. 		menu_common_transition_pop(1) 
  122. 		 
  123. 		--Transition Screen Out 
  124. 		local anim_out_h = vint_object_find("anim_out", 0, Main_sl_about_doc_h) 
  125. 		vint_debug_print("anim_out_h", anim_out_h) 
  126. 		lua_play_anim(anim_out_h, 0, Main_sl_about_doc_h) 
  127. 	end 
  128. end 
  129.  
  130.  
  131. function main_sl_about_mouse_click(event, target_handle) 
  132. 	local hint_index = Menu_hint_bar:get_hint_index(target_handle) 
  133. 	if hint_index == 1 then 
  134. 		main_sl_about_button_b() 
  135. 	end 
  136.  
  137. 	local new_index = List:get_button_index(target_handle) 
  138. 	if new_index ~= 0 then 
  139. 		List:set_selection(new_index) 
  140. 		main_sl_about_button_a() 
  141. 	end 
  142. end 
  143.  
  144. function main_sl_about_mouse_move(event, target_handle) 
  145. 	Menu_hint_bar:set_highlight(0) 
  146. 	 
  147. 	local hint_index = Menu_hint_bar:get_hint_index(target_handle) 
  148. 	if hint_index ~= 0 then 
  149. 		Menu_hint_bar:set_highlight(hint_index) 
  150. 	end 
  151. 	 
  152. 	local new_index = List:get_button_index(target_handle) 
  153. 	if new_index ~= 0 then 
  154. 		List:set_selection(new_index) 
  155. 		List:move_cursor(0, true) 
  156. 	end 
  157. end 
  158.