Class CutsceneEvents
java.lang.Object
net.ixdarklord.coolcatcanvas.api.event.v2.client.CutsceneEvents
Cutscenes playing on this client, whoever started them: a mod, the server, a command. All fire on the client's main
thread;
CAMERA fires every frame, the rest on ticks. Previews in the cutscene editor fire MARKER
only.
CutsceneEvents.STARTED.register(playback -> music.duck());
CutsceneEvents.KEYFRAME.register((playback, index, keyframe) -> { if (index == 2) roar(); });
CutsceneEvents.ENDED.register((playback, reason) -> music.restore());
A listener is told about every cutscene; tell yours apart by CutscenePlayback.id().-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EventInvoker<CutsceneEvents.BeforeSkip> Before the player skips a cutscene by holding the skip key.static final EventInvoker<CutsceneEvents.BeforeStart> Before a cutscene starts, from any source.static final EventInvoker<CutsceneEvents.Camera> Every frame, with the camera a cutscene is about to use: listeners may hand back another, each seeing what the one before returned.static final EventInvoker<CutsceneEvents.Ended> After a cutscene ended, for any reason: seen through, skipped, stopped, replaced by another, or cut short by leaving the world.static final EventInvoker<CutsceneEvents.Keyframe> As a cutscene's camera reaches one of its keyframes, the first included.static final EventInvoker<CutsceneEvents.Marker> As a cutscene passes one of its markers: the cue for a sound, an effect, a shake.static final EventInvoker<CutsceneEvents.Paused> After a cutscene was paused or resumed through itsCutscenePlayback.static final EventInvoker<CutsceneEvents.Started> After a cutscene started playing.static final EventInvoker<CutsceneEvents.Subtitle> As one of a cutscene's subtitles appears: for a voice line that goes with it.static final EventInvoker<CutsceneEvents.Tick> Every tick a cutscene's clock moves, after it has: not while it or the game is paused. -
Method Summary
-
Field Details
-
BEFORE_START
Before a cutscene starts, from any source. ReturningEventResult.INTERRUPTkeeps it from playing: whatever was on screen stays, and a server that asked for it is told it was stopped. -
STARTED
After a cutscene started playing. -
TICK
Every tick a cutscene's clock moves, after it has: not while it or the game is paused. The place for anything that should run alongside it. -
KEYFRAME
As a cutscene's camera reaches one of its keyframes, the first included. Keyframes jumped over by a seek or a skip don't fire. -
MARKER
As a cutscene passes one of its markers: the cue for a sound, an effect, a shake. Markers jumped over by a seek or a skip don't fire. -
SUBTITLE
As one of a cutscene's subtitles appears: for a voice line that goes with it. -
PAUSED
After a cutscene was paused or resumed through itsCutscenePlayback. Pausing the game doesn't fire it. -
CAMERA
Every frame, with the camera a cutscene is about to use: listeners may hand back another, each seeing what the one before returned. For a camera that reacts to the world: nudged by an explosion, kept out of a wall. -
BEFORE_SKIP
Before the player skips a cutscene by holding the skip key. ReturningEventResult.INTERRUPTkeeps it playing. Not fired forCutscenePlayback.skip(), nor for cutscenes that aren't skippable. -
ENDED
After a cutscene ended, for any reason: seen through, skipped, stopped, replaced by another, or cut short by leaving the world. The camera is the player's again.
-