local CUTSCENE_HIDE = 0
local CUTSCENE_HOST = 1
local CUTSCENE_CLIENT = 2
local CUTSCENE_CONFIRM_SKIP = 3
-------------------------------------------------------------------------------
-- Screen to handle cutscene titles
-------------------------------------------------------------------------------
local title_txt_h = 0
local hint_text_h = 0
function cutscene_titles_init()
title_txt_h = vint_object_find("cutscene_title_txt")
vint_set_property(title_txt_h, "alpha", 0)
hint_text_h = vint_object_find("cutscene_hint_txt")
vint_dataitem_add_subscription("cutscene_titles", "update", "cutscene_titles_update")
end
function cutscene_titles_cleanup()
end
-------------------------------------------------------------------------------
-- Sets the text on the cutscene title and starts it
-- @param title_txt String for the title on the screen
--
function cutscene_titles_start(title_txt)
--Replace text
vint_set_property(title_txt_h, "text_tag", title_txt)
--Play anim
local cutscene_title_anim_h = vint_object_find("cutscene_title_anim")
lua_play_anim(cutscene_title_anim_h)
end
-------------------------------------------------------------------------------
-- Data item to update the hint text
--
function cutscene_titles_update(di_h)
local hint_type = vint_dataitem_get(di_h)
if hint_type == CUTSCENE_HIDE then
vint_set_property(hint_text_h,"visible",false)
elseif hint_type == CUTSCENE_HOST then
vint_set_property(hint_text_h,"visible",true)
vint_set_property(hint_text_h,"text_tag","CUTSCENE_HOST_SKIPPING")
elseif hint_type == CUTSCENE_CLIENT then
vint_set_property(hint_text_h,"visible",true)
vint_set_property(hint_text_h,"text_tag","CUTSCENE_REMOTE_SKIPPING")
elseif hint_type == CUTSCENE_CONFIRM_SKIP then
vint_set_property(hint_text_h,"visible",true)
vint_set_property(hint_text_h,"text_tag","CUTSCENE_CONFIRM_SKIPPING")
else
vint_set_property(hint_text_h,"visible",false)
end
end