press dd to redefine last delay length
This commit is contained in:
@@ -44,6 +44,7 @@ interface Director<Set:Cloneable<Set>, Actor, Sound, Song, Prop, VoiceTrack, Cam
|
||||
function showPauseMenu(resume:Continuation):Void;
|
||||
|
||||
function chooseString(prompt:String, choices:Array<String>, submit:String->Void):Void;
|
||||
function enterString(prompt:String, submit:String->Void):Void;
|
||||
|
||||
function defineStagePosition(submit:StagePosition->Void):Void;
|
||||
function defineLightSource(submit:LightSource->Void):Void;
|
||||
|
@@ -21,6 +21,10 @@
|
||||
|
||||
(prop &mut :DelayHandling delayHandling AutoWithSkip)
|
||||
|
||||
(prop &mut :String lastDelay "")
|
||||
(prop &mut :Float lastDelayLength 0)
|
||||
|
||||
|
||||
// Mutable representation of frames in time:
|
||||
(prop :FuzzyMap<Scene<Set,Actor,Prop,Camera>> scenes (new FuzzyMap<Scene<Set,Actor,Prop,Camera>>))
|
||||
|
||||
@@ -230,6 +234,13 @@
|
||||
->cc (director.showPauseMenu cc))
|
||||
|
||||
(#when debug
|
||||
(shortcutHandler.registerItem "[d]efine [d]elay"
|
||||
->cc
|
||||
(director.enterString "Redefine $lastDelay from $lastDelayLength sec?"
|
||||
->lengthStr
|
||||
(let [length (Std.parseFloat lengthStr)]
|
||||
(delayLengths.put lastDelay (new DelayLength length))
|
||||
(cc))))
|
||||
(shortcutHandler.registerItem "[d]efine [p]osition"
|
||||
->cc
|
||||
(director.chooseString "Which position?" (dictGet positionsInScene sceneKey)
|
||||
@@ -304,7 +315,11 @@
|
||||
(hollywooMethod :Void delay true [:Dynamic length :Continuation cc]
|
||||
(let [sec (typeCase [length]
|
||||
([:Float sec] sec)
|
||||
([:String key] .length (delayLengths.get key))
|
||||
([:String key]
|
||||
(let [lengthFloat .length (delayLengths.get key)]
|
||||
(set lastDelay key)
|
||||
(set lastDelayLength lengthFloat)
|
||||
lengthFloat))
|
||||
(never otherwise))]
|
||||
(case delayHandling
|
||||
(Auto
|
||||
|
Reference in New Issue
Block a user