--This interface is used in the Mission 21 Killbane Mask removal sequence.
local Input_tracker
local Mouse_input_tracker = 0
local Option_selected = -1
local KILLBANE_OPTION_REMOVE_MASK = 0
local KILLBANE_OPTION_LET_GO = 1
local Pressed_left_image = -1
local Pressed_right_image = -1
local Image_left_h = -1
local Image_right_h = -1
function msn_killbane_init()
local platform = game_get_platform()
--Do input subscription...
Input_tracker = Vdo_input_tracker:new()
-- Button images
Image_left_h = vint_object_find("button_left_img")
Image_right_h = vint_object_find("button_right_img")
-- Different inputs for PC only (when gamepad is not active)
if game_is_active_input_gamepad() == false then
Input_tracker:add_input("key_left", "msn_killbane_nav", 50)
Input_tracker:add_input("key_right", "msn_killbane_nav", 50)
vint_set_property(Image_left_h, "image", "ui_pc_qte_arrow_off")
vint_set_property(Image_right_h, "image", "ui_pc_qte_arrow_off")
--Store to use for replacement later...
Pressed_left_image = "ui_pc_qte_arrow_on"
Pressed_right_image = "ui_pc_qte_arrow_on"
vint_set_property(Image_left_h, "scale", -1.0, 1.0)
else
Input_tracker:add_input("scroll_left", "msn_killbane_nav", 50)
Input_tracker:add_input("scroll_right", "msn_killbane_nav", 50)
if platform == "PS3" then
vint_set_property(Image_left_h, "image", "ui_qte_l1_up_ps3")
vint_set_property(Image_right_h, "image", "ui_qte_r1_up_ps3")
--Store to use for replacement later...
Pressed_left_image = "ui_qte_l1_down_ps3"
Pressed_right_image = "ui_qte_r1_down_ps3"
else
vint_set_property(Image_left_h, "image", "ui_qte_lt_up_xbox2")
vint_set_property(Image_right_h, "image", "ui_qte_rt_up_xbox2")
--Store to use for replacement later...
Pressed_left_image = "ui_qte_lt_down_xbox2"
Pressed_right_image = "ui_qte_rt_down_xbox2"
end
end
Input_tracker:subscribe(true)
if game_get_platform() == "PC" then
Mouse_input_tracker = Input_tracker:new()
msn_killbane_mouse_input_add()
end
--Hide screen
local screen_grp_h = vint_object_find("screen_grp")
vint_set_property(screen_grp_h, "alpha", 0)
--Fade in screen
local anim_h = vint_object_find("fade_in_anim")
lua_play_anim(anim_h)
local anim_h = vint_object_find("fade_out_anim")
local twn_h = vint_object_find("fade_out_twn", anim_h)
vint_set_property(twn_h, "end_event", "msn_killbane_select")
-- hide this stuff if the game pauses
vint_dataitem_add_subscription("game_paused_item", "update", "msn_killbane_game_is_paused") --to check if game is paused...
end
function msn_killbane_cleanup()
end
function msn_killbane_game_is_paused(di_h)
local is_paused = vint_dataitem_get(di_h)
local screen_grp_h = vint_object_find("screen_grp")
vint_set_property(screen_grp_h, "visible", is_paused == false)
end
-------------------------------------------------------------------------------
-- Input
-------------------------------------------------------------------------------
function msn_killbane_nav(event)
if Option_selected == -1 then
if event == "scroll_right" or event == "key_right" then
Option_selected = KILLBANE_OPTION_REMOVE_MASK
vint_set_property(Image_right_h, "image", Pressed_right_image)
elseif event == "scroll_left" or event == "key_left" then
Option_selected = KILLBANE_OPTION_LET_GO
vint_set_property(Image_left_h, "image", Pressed_left_image)
end
local anim_h = vint_object_find("fade_out_anim")
lua_play_anim(anim_h)
end
end
-------------------------------------------------------------------------------
-- Callback from fade out animation tells the game we are finished,
-- what option we've selected and pops screen...
-------------------------------------------------------------------------------
function msn_killbane_select()
--Tell game which option we've selected...
msn_killbane_selected_option(Option_selected)
--and Pop screen
pop_screen()
end
function msn_killbane_mouse_input_add()
Mouse_input_tracker:add_mouse_input("mouse_click", "msn_killbane_mouse_click", 50, Image_left_h)
Mouse_input_tracker:add_mouse_input("mouse_click", "msn_killbane_mouse_click", 50, Image_right_h)
Mouse_input_tracker:subscribe(true)
end
-------------------------------------------------------------------------------
-- Mouse inputs
function msn_killbane_mouse_click(event, target_handle, mouse_x, mouse_y)
if target_handle == Image_right_h then
msn_killbane_nav("key_right")
elseif target_handle == Image_left_h then
msn_killbane_nav("key_left")
end
end
function msn_killbane_mouse_move(event, target_handle)
end
function horde_results_mouse_drag(event, target_handle, mouse_x, mouse_y)
end
function horde_results_mouse_drag_release(event, target_handle, mouse_x, mouse_y)
end