Director KeyShortcutHandler
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
{
|
||||
"main": "hollywoo.Main",
|
||||
"name": "hollywoo",
|
||||
"description": "produce Fountain screenplays as visual novels",
|
||||
"description": "Portable interface for kinetic novel dev/animated filmmaking",
|
||||
"classPath": "src/",
|
||||
"dependencies": {
|
||||
"kiss": ""
|
||||
"kiss": "",
|
||||
"kiss-tools": ""
|
||||
},
|
||||
"url": "https://github.com/NQNStudios/kisslang",
|
||||
"contributors": [
|
||||
|
@@ -4,6 +4,7 @@ import hollywoo.Scene;
|
||||
import hollywoo.Movie;
|
||||
import haxe.ds.Option;
|
||||
import kiss_tools.JsonMap;
|
||||
import kiss_tools.KeyShortcutHandler;
|
||||
|
||||
enum Appearance {
|
||||
FirstAppearance;
|
||||
@@ -27,26 +28,45 @@ typedef AutoZConfig = {
|
||||
interface Director<Set:Cloneable<Set>, Actor, Sound, Song, Prop, VoiceTrack, Camera, LightSource:Jsonable<LightSource>> {
|
||||
var movie(default, default):Movie<Set, Actor, Sound, Song, Prop, VoiceTrack, Camera, LightSource>;
|
||||
function autoZConfig():Option<AutoZConfig>;
|
||||
|
||||
function shortcutHandler():KeyShortcutHandler<Continuation->Void>;
|
||||
|
||||
function pause():Void;
|
||||
function resume():Void;
|
||||
function showPauseMenu(resume:Continuation):Void;
|
||||
|
||||
function defineLightSource(submit:LightSource->Void):Void;
|
||||
|
||||
function showSet(set:Set, time:SceneTime, perspective:ScenePerspective, appearance:Appearance, camera:Camera, cc:Continuation):Void;
|
||||
function hideSet(set:Set, camera: Camera, cc:Continuation):Void;
|
||||
|
||||
function showLighting(sceneTime:SceneTime, lightSources:Array<LightSource>, camera:Camera):Void;
|
||||
function hideLighting():Void;
|
||||
|
||||
function showCharacter(character:Character<Actor>, appearance:Appearance, camera:Camera, cc:Continuation):Void;
|
||||
function hideCharacter(character:Character<Actor>, camera:Camera, cc:Continuation):Void;
|
||||
|
||||
function playSound(sound:Sound, volumeMod:Float, waitForEnd:Bool, cc:Continuation):Void;
|
||||
function stopSound(sound:Sound):Void;
|
||||
|
||||
function playSong(song:Song, volumeMod:Float, loop:Bool, waitForEnd:Bool, cc:Continuation):Void;
|
||||
function stopSong():Void;
|
||||
|
||||
function playVoiceTrack(track:VoiceTrack, volumeMod:Float, start:Float, end:Float, cc:Continuation):Void;
|
||||
function stopVoiceTrack(track:VoiceTrack):Void;
|
||||
|
||||
function startWaitForInput(cc:Continuation):Void;
|
||||
function stopWaitForInput(cc:Continuation):Void;
|
||||
|
||||
function showDialog(speakerName:String, type:SpeechType<Actor>, wryly:String, dialog:String, cc:Continuation):Void;
|
||||
function hideDialog():Void;
|
||||
|
||||
function showTitleCard(text:Array<String>, cc:Continuation):Void;
|
||||
function hideTitleCard():Void;
|
||||
|
||||
function showBlackScreen():Void;
|
||||
function hideBlackScreen():Void;
|
||||
|
||||
function showProp(prop:Prop, position:StagePosition, cc:Continuation):Void;
|
||||
function hideProp(prop:Prop, cc:Continuation):Void;
|
||||
|
||||
|
@@ -172,6 +172,29 @@
|
||||
(when voiceLinesJson
|
||||
(voiceLines.loadMatches voiceLinesJson))
|
||||
|
||||
(let [shortcutHandler (director.shortcutHandler)
|
||||
cc ->(director.resume)]
|
||||
(set shortcutHandler.onSelectItem
|
||||
->process {
|
||||
// TODO pause all delays (which will require ditching haxe.Timer!!!)
|
||||
(director.pause)
|
||||
(process cc)
|
||||
})
|
||||
(shortcutHandler.registerItem "{escape} Pause the movie"
|
||||
->cc (director.showPauseMenu cc))
|
||||
(shortcutHandler.registerItem "[d]efine [l]ight source"
|
||||
->cc
|
||||
(director.defineLightSource
|
||||
->[:LightSource source] {
|
||||
(let [arr (lightSources.get sceneKey)]
|
||||
(arr.elements.push source)
|
||||
(lightSources.put sceneKey arr)
|
||||
(director.hideLighting)
|
||||
(director.showLighting .time (_currentScene) arr.elements .camera (_currentScene))
|
||||
(cc))
|
||||
}))
|
||||
(shortcutHandler.start))
|
||||
|
||||
(super)))
|
||||
|
||||
// END Parent class definitions
|
||||
|
Reference in New Issue
Block a user