local Main_sl_about_doc_h
--Define screen width...
local Screen_width
if vint_is_std_res() then
Screen_width = 750
else
Screen_width = 840
end
local Input_tracker
local Mouse_input_tracker
local Tween_done = true
function main_sl_about_init()
Main_sl_about_doc_h = vint_document_find("main_sl_about")
Input_tracker = Vdo_input_tracker:new()
Input_tracker:add_input("back", "main_sl_about_button_b", 50)
Input_tracker:subscribe(false)
--Initialize Header
Header_obj:show_me(false)
Header_mini_obj:set_text("SL_TITLE_ABOUT")
Header_mini_obj:set_visible(true)
--Setup Button Hints
local hint_data = {
{CTRL_MENU_BUTTON_B, "MENU_BACK"},
}
Menu_hint_bar:set_hints(hint_data)
--Store some locals to the pause menu common for screen processing.
menu_common_set_list_style(List, Header_obj, Screen_width)
--Hide the list...
vint_set_property(List.handle, "visible", false)
bg_saints_show(true)
menu_common_set_screen_data(List, Header_obj, Input_tracker, Screen_back_out_anim, Screen_slide_out_anim)
--Transition Screen In
local anim_in_h = vint_object_find("anim_in")
lua_play_anim(anim_in_h)
-- Add mouse inputs for the PC
if game_get_platform() == "PC" then
Menu_hint_bar:set_highlight(0)
Mouse_input_tracker = Vdo_input_tracker:new()
Menu_hint_bar:add_mouse_inputs("main_sl_about", Mouse_input_tracker)
Mouse_input_tracker:subscribe(true)
end
end
function main_sl_about_cleanup()
-- Nuke all button subscriptions
Input_tracker:subscribe(false)
if Mouse_input_tracker ~= nil then
Mouse_input_tracker:subscribe(false)
end
List:enable_toggle_input(false)
Header_obj:show_me(true)
Header_mini_obj:set_visible(false)
end
-------------------------------------------------------------------------------
-- Input Tracker Callbacks
-------------------------------------------------------------------------------
function main_sl_about_nav_up(event, acceleration)
-- Move highlight up
--List:move_cursor(-1)
end
function main_sl_about_nav_down(event, acceleration)
-- Move highlight down
--List:move_cursor(1)
end
function main_sl_about_nav_left(event, acceleration)
-- Move highlight left
--List:move_slider(-1)
end
function main_sl_about_nav_right(event, acceleration)
-- Move highlight right
--List:move_slider(1)
end
function main_sl_about_button_a(event, acceleration)
if Tween_done == true then
--Set the screen data to the list data
Data = List:return_data()
local current_id = List:get_id()
end
end
function main_sl_about_button_b(event, acceleration)
if Tween_done == true then
List:button_b()
Input_tracker:subscribe(false)
if Mouse_input_tracker ~= nil then
Mouse_input_tracker:subscribe(false)
end
-- final pop...
--Remove current menu from the stack
menu_common_stack_remove()
--Pop Screen off the list
menu_common_transition_pop(1)
--Transition Screen Out
local anim_out_h = vint_object_find("anim_out", 0, Main_sl_about_doc_h)
vint_debug_print("anim_out_h", anim_out_h)
lua_play_anim(anim_out_h, 0, Main_sl_about_doc_h)
end
end
function main_sl_about_mouse_click(event, target_handle)
local hint_index = Menu_hint_bar:get_hint_index(target_handle)
if hint_index == 1 then
main_sl_about_button_b()
end
local new_index = List:get_button_index(target_handle)
if new_index ~= 0 then
List:set_selection(new_index)
main_sl_about_button_a()
end
end
function main_sl_about_mouse_move(event, target_handle)
Menu_hint_bar:set_highlight(0)
local hint_index = Menu_hint_bar:get_hint_index(target_handle)
if hint_index ~= 0 then
Menu_hint_bar:set_highlight(hint_index)
end
local new_index = List:get_button_index(target_handle)
if new_index ~= 0 then
List:set_selection(new_index)
List:move_cursor(0, true)
end
end