Menu_hint_bar = -1
SAVE_OPERATION_SAVE_GAME = 0
SAVE_OPERATION_LOAD_GAME = 1
Save_system_operation = SAVE_OPERATION_LOAD_GAME
COOP_INVITE_LIST = 0
COOP_ONLINE_JOIN_LIST = 1
COOP_SYSLINK_JOIN_LIST = 2
Coop_connect_operation = COOP_INVITE_LIST
In_pause_menu = true
Load_for_coop = false
Exit_after_closing = false
Save_message_displayed = false
Close_all_menu = false
Pause_menu_common_doc_h = -1
Header_obj = -1
List = -1
Screen_slide_out_anim = -1
Screen_slide_in_anim = -1
Screen_in_anim = -1
Screen_out_anim = -1
Screen_back_in_anim = -1
Screen_back_out_anim = -1
First_time = true
Start_game_after_display = false
Join_friend_after_display = -1
function pause_menu_common_init()
Pause_menu_common_doc_h = vint_document_find("pause_menu_common")
local hacking_doc_h = vint_document_find("hack_main_sticks")
if Bg_saints_doc_handle ~= 0 then
if hacking_doc_h ~= 0 then
vint_document_set_depth( Bg_saints_doc_handle, -31 )
else
vint_document_set_depth( Bg_saints_doc_handle, 0 )
end
end
--Apply purple lut!
pause_menu_lut_effect("none")
-- Play sound effect for pause menu starting up
--play_ui_sound( "INT_PAUSE" )
--Initialize Hint Bar store it to global Menu_hint_bar
Menu_hint_bar = Vdo_hint_bar:new("hint_bar")
Screen_in_anim = Vdo_anim_object:new("screen_in_anim",0,Pause_menu_common_doc_h)
local twn = Vdo_tween_object:new("screen_in_twn", Screen_in_anim.handle)
twn:set_end_event("menu_common_anim_in_cb")
Screen_out_anim = Vdo_anim_object:new("screen_out_anim",0,Pause_menu_common_doc_h)
local twn2 = Vdo_tween_object:new("screen_out_twn", Screen_out_anim.handle)
twn2:set_end_event("menu_common_anim_out_cb")
Screen_slide_out_anim = Vdo_anim_object:new("screen_slide_out_anim",0,Pause_menu_common_doc_h)
local twn_out = Vdo_tween_object:new("screen_slide_out_twn1", Screen_slide_out_anim.handle)
twn_out:set_end_event("menu_common_anim_out_cb")
Screen_slide_in_anim = Vdo_anim_object:new("screen_slide_in_anim",0,Pause_menu_common_doc_h)
local twn_in = Vdo_tween_object:new("screen_slide_in_twn1", Screen_slide_in_anim.handle)
twn_in:set_end_event("menu_common_anim_in_cb")
Screen_back_in_anim = Vdo_anim_object:new("screen_back_in_anim",0,Pause_menu_common_doc_h)
local twn_back_in = Vdo_tween_object:new("back_in_twn1", Screen_back_in_anim.handle)
twn_back_in:set_end_event("menu_common_anim_in_cb")
Screen_back_out_anim = Vdo_anim_object:new("screen_back_out_anim",0,Pause_menu_common_doc_h)
local twn_back_out = Vdo_tween_object:new("back_out_twn1", Screen_back_out_anim.handle)
twn_back_out:set_end_event("menu_common_anim_out_cb")
List = Vdo_mega_list:new("list", 0, Pause_menu_common_doc_h, "pause_menu_common.lua", "List")
List:set_highlight_color(COLOR_STORE_REWARDS_PRIMARY, COLOR_STORE_REWARDS_SECONDARY)
Header_obj = Vdo_pause_header:new("header",0,Pause_menu_common_doc_h)
bg_saints_show(false)
vint_apply_start_values(Screen_in_anim.handle)
-- HVS_EC Set GPU Reserve on (Enable Kinect Eye)
os_set_gpu_reserve_state(true)
end
function pause_menu_common_cleanup()
-- HVS_EC Set GPU Reserve off (Disable Kinect Eye)
os_set_gpu_reserve_state(false)
-- Possibly, free up controller memory when document is unloaded...
-- This also happens in pause_options_controls_config() but is done here in case the user presses
-- The back button...
pause_menu_control_scheme_init(false)
--Remove purple lut...
pause_menu_lut_effect("none")
Menu_hint_bar:cleanup()
end
function pause_menu_common_server_drop()
Save_system_operation = SAVE_OPERATION_SAVE_GAME
Exit_after_closing = true
push_screen("pause_save_game")
end
function pause_menu_common_open_invite()
Exit_after_closing = true
push_screen("pause_invite_friends")
end
function pause_menu_common_open_cheat_save()
Save_system_operation = SAVE_OPERATION_SAVE_GAME
Close_all_menu = true
push_screen("pause_save_game")
end
function pause_menu_intro_done()
-- Jeff: This needs to be setup properly
--pause_menu_top_anim_in()
end
-- Make the pause menu megalist look pause menu
--
function pause_menu_set_style(list, header, width, num_pops)
--get the list width
local list_w, list_h = vint_get_property(List.handle, "screen_size")
list_w = width or list_w
header:set_visible(true)
list:set_visible(true)
local max_width = 650
local back_out_twn1_h = vint_object_find("back_out_twn1", Screen_back_out_anim.handle)
local back_out_twn2_h = vint_object_find("back_out_twn2", Screen_back_out_anim.handle)
local back_out_twn3_h = vint_object_find("back_out_twn3", Screen_back_out_anim.handle)
--[[
if list_w > max_width then
vint_set_property(back_out_twn1_h, "end_value", -1 * max_width, 652)
vint_set_property(back_out_twn2_h, "end_value", -1 * max_width, 230)
vint_set_property(back_out_twn3_h, "end_value", -1 * max_width, 267)
else
vint_set_property(back_out_twn1_h, "end_value", -300, 652)
vint_set_property(back_out_twn2_h, "end_value", -300, 230)
vint_set_property(back_out_twn3_h, "end_value", -300, 267)
end
]]
local bg_anchor = 100
if vint_is_std_res() then
bg_anchor = 74
end
if not First_time then
bg_saints_set_type(BG_TYPE_PAUSE, true, list_w, bg_anchor)
if num_pops > 0 then
vint_apply_start_values(Screen_slide_in_anim.handle)
Screen_slide_in_anim:play(0)
else
vint_apply_start_values(Screen_back_in_anim.handle)
Screen_back_in_anim:play(0)
end
else
bg_saints_set_type(BG_TYPE_PAUSE, false, list_w, bg_anchor)
end
end
function pause_menu_mask_morph( screen_type, size_end_x, anchor_end_x )
--get handles for everyone
--set up the left shadow start and end values
--get the starting x position
--create the center anchor point from the width of the mask, only if we are center aligned
--setup the anchor for the mask
--get the starting x position
--setup the scale of the mask
--get the starting scale
end
--Wrapper for c++ lut swap function...
function pause_menu_lut_effect(lut_table_string)
if lut_table_string ~= "none" then
local platform = game_get_platform()
local lut_platform_string = ""
if platform == "PS3" then
lut_platform_string = "_ps3"
elseif platform == "XBOX360" then
lut_platform_string = "_xbox2"
elseif platform == "XBOX3" then
lut_platform_string = "_xbox3"
elseif platform == "PS4" then
lut_platform_string = "_ps4"
elseif platform == "PC" then
lut_platform_string = "_pc"
end
completion_load_lut(lut_table_string .. lut_platform_string)
else
completion_load_lut(lut_table_string)
end
end