Emergency 20 Dokumentation  4.2.0
em5::CutscenePlayer Class Reference

EMERGENCY 5 cutscene player. More...

#include <CutscenePlayer.h>

Inheritance diagram for em5::CutscenePlayer:

Public Types

enum  SkipSetting { SkipSetting::DISABLED, SkipSetting::STOP, SkipSetting::FASTFORWARD }
 

Public Member Functions

 CutscenePlayer ()
 Default constructor. More...
 
virtual ~CutscenePlayer ()
 Destructor. More...
 
bool isPlaying () const
 Return the cutscene player' playback status. More...
 
bool startCutscene (const std::string &sequenceLocalAssetName, bool movePlayerCamera, bool allowVideo=true, SkipSetting skipSetting=SkipSetting::STOP)
 Start a cutscene with the given sequence. More...
 
void stopCutscene (bool emitMessage)
 Stop the running cutscene, if there is one. More...
 
void skipCutscene ()
 Skip the running cutscene, i.e. jump to its end. More...
 
bool reactToEscape ()
 Reaction to Esc key or similar. More...
 
void showUserInterface (bool show)
 Show or hide the user interface. More...
 
bool isScreenFading () const
 Return whether a screen fade is currently in progress. More...
 
void startScreenFade (float targetVisibility, const qsf::Time &fadeLength, const qsf::Color3 &backgroundColor=qsf::Color3::BLACK, const qsf::Time &endPause=qsf::Time::ZERO)
 Start a screen fading over time. More...
 
void setScreenFade (float targetVisibility, const qsf::Color3 &backgroundColor=qsf::Color3::BLACK)
 
bool flyCameraTo (qsf::Entity &targetCameraEntity, float maximumAcceleration=100.0f, float maximumSpeed=25.0f)
 Helper function to fly the camera to a certain camera entity. More...
 
void startCameraFlight (qsf::Entity &targetCameraEntity, float maximumAcceleration=100.0f, float maximumSpeed=25.0f)
 Start a camera flight. More...
 

Detailed Description

EMERGENCY 5 cutscene player.

Member Enumeration Documentation

Enumerator
DISABLED 

No cutscene skipping allowed.

STOP 

Skipping immediately ends playback.

FASTFORWARD 

Skipping fast-forwards playback with increased game speed (only for sequences, not videos)

Constructor & Destructor Documentation

em5::CutscenePlayer::CutscenePlayer ( )

Default constructor.

virtual em5::CutscenePlayer::~CutscenePlayer ( )
virtual

Destructor.

Member Function Documentation

bool em5::CutscenePlayer::flyCameraTo ( qsf::Entity targetCameraEntity,
float  maximumAcceleration = 100.0f,
float  maximumSpeed = 25.0f 
)

Helper function to fly the camera to a certain camera entity.

  • This is more for internal use; from event code, prefer using "startCameraFlight"
bool em5::CutscenePlayer::isPlaying ( ) const

Return the cutscene player' playback status.

Returns
"true" if playback of a sequence (but not a screen fade) is currently active, "false" otherwise
See also
  • "em5::CutscenePlayer::isScreenFading()"
bool em5::CutscenePlayer::isScreenFading ( ) const

Return whether a screen fade is currently in progress.

Returns
"true" if a screen fade is currently active, "false" otherwise
See also
  • "em5::CutscenePlayer::isPlaying()"
bool em5::CutscenePlayer::reactToEscape ( )

Reaction to Esc key or similar.

Returns
"true" in case Esc should not be further evaluated
void em5::CutscenePlayer::setScreenFade ( float  targetVisibility,
const qsf::Color3 backgroundColor = qsf::Color3::BLACK 
)
void em5::CutscenePlayer::showUserInterface ( bool  show)

Show or hide the user interface.

Parameters
[in]showIf "true", the user interface will be shown, otherwise it will be hidden
void em5::CutscenePlayer::skipCutscene ( )

Skip the running cutscene, i.e. jump to its end.

void em5::CutscenePlayer::startCameraFlight ( qsf::Entity targetCameraEntity,
float  maximumAcceleration = 100.0f,
float  maximumSpeed = 25.0f 
)

Start a camera flight.

  • Emits the message "em5::Messages::EM5_CUTSCENE_CAMERA_FLIGHT_FINISHED" when camera flight is done
  • Blocks Esc menu during camera flight
bool em5::CutscenePlayer::startCutscene ( const std::string &  sequenceLocalAssetName,
bool  movePlayerCamera,
bool  allowVideo = true,
SkipSetting  skipSetting = SkipSetting::STOP 
)

Start a cutscene with the given sequence.

Parameters
[in]sequenceLocalAssetNameLocal asset name of the sequence to load
[in]movePlayerCameraIf "true", the player camera gets moved with the sequence's camera, otherwise it stays where it was
[in]allowVideoIf "true", video usage is allowed, otherwise it's always realtime
Returns
"true" if playback has started, "false" on error like the sequence could not be loaded
void em5::CutscenePlayer::startScreenFade ( float  targetVisibility,
const qsf::Time fadeLength,
const qsf::Color3 backgroundColor = qsf::Color3::BLACK,
const qsf::Time endPause = qsf::Time::ZERO 
)

Start a screen fading over time.

Parameters
[in]targetVisibilityScreen visibility to fade to, between 0.0 for a totally faded-out scene and 1.0 for a fully visible scene
[in]fadeLengthTime to fade to the given target visibility
[in]backgroundColorColor to show as background, usually "qsf::Color3::BLACK" or for a white-screen fading "qsf::Color3::WHITE"
[in]endPauseOptional additional pause at the end of the fading
Note
  • This will only affect the 3D scene, not the UI or debug output
void em5::CutscenePlayer::stopCutscene ( bool  emitMessage)

Stop the running cutscene, if there is one.


The documentation for this class was generated from the following file: