API:CanPlayCinematic
From RoR Wiki
UI Lua API · Pregame functions
Version: WAR 1.4.8
Returns whether the intro cinematic can be played.
canPlay = CanPlayCinematic()
Arguments
None.
Returns
- canPlay
boolean–trueif the cinematic can be played.
Details
- The result is
falseif the sound system exists and reports that it is not ready for video. - Otherwise the result is
trueonly if the filevideos/Cinematic1_720p.bikexists in the game archives. - PregamePlayCinematic checks the same conditions before it starts playback.
- Unlike the other pregame cinematic functions, this one does not depend on the game state.
Errors
None.
Example
From interfacecore/source/cinematicwindow.lua, which offers the cinematic web page when the video cannot be played:
if ( CanPlayCinematic() )
then
-- show EA_Window_CinematicDisplay ...
PregamePlayCinematic()
else
DialogManager.MakeTwoButtonDialog( GetPregameString(StringTables.Pregame.DIALOG_CONFIRM_OPEN_CINEMATIC),
GetString(StringTables.Default.LABEL_YES), OpenCinematicPageInBrowser,
GetString(StringTables.Default.LABEL_NO), nil,
nil, nil, false, nil, nil )
end
