non-automatic conversions
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
(dictSet fullUpdateFunctions document.fileName requestFullUpdate)
|
||||
|
||||
(localFunction :Void chooseConversion [blockIdx]
|
||||
(let [validConversions (project.validConversions blockIdx ->m (errorMessage m))]
|
||||
(let [validConversions (project.validConversions blockIdx false ->m (errorMessage m))]
|
||||
(cond
|
||||
((= 1 (count validConversions))
|
||||
(let [text (first (collect (validConversions.iterator)))]
|
||||
@@ -146,7 +146,7 @@
|
||||
(awaitLet [number (inputBox)]
|
||||
(findLineNumber (Std.parseInt number) output)))
|
||||
((ConfirmManualEdit blockIdx)
|
||||
(let [validConversions (project.validConversions blockIdx ->m (errorMessage m))]
|
||||
(let [validConversions (project.validConversions blockIdx true ->m (errorMessage m))]
|
||||
(cond
|
||||
((= 0 (count validConversions))
|
||||
(postMessage YesManualEdit))
|
||||
|
@@ -5,5 +5,6 @@ typedef Conversion = {
|
||||
outputType:String,
|
||||
canConvert:String->Bool,
|
||||
convert:String->String,
|
||||
name:String
|
||||
name:String,
|
||||
?neverAutomatic:Bool
|
||||
};
|
||||
|
@@ -210,7 +210,7 @@
|
||||
(function registerConversion [:Conversion c]
|
||||
(_conversions.push c))
|
||||
|
||||
(method :Map<String,String> validConversions [index :String->Dynamic reportError]
|
||||
(method :Map<String,String> validConversions [index :Bool automatic :String->Dynamic reportError]
|
||||
(let [sourceFile inFile
|
||||
outputFile outFile
|
||||
block (nth blocks index)
|
||||
@@ -219,6 +219,7 @@
|
||||
(doFor c _conversions
|
||||
(case c
|
||||
((when (and
|
||||
(or !automatic !c.neverAutomatic)
|
||||
(= sourceType (sourceFile.extension))
|
||||
(= outputType (outputFile.extension))
|
||||
(canConvert source))
|
||||
@@ -232,7 +233,7 @@
|
||||
(method :Void fullAutoConvert [:String->Dynamic reportError]
|
||||
(doFor [idx block] (enumerate blocks)
|
||||
(when (or block.locked block.outText) (continue))
|
||||
(let [vc (validConversions idx reportError)]
|
||||
(let [vc (validConversions idx true reportError)]
|
||||
(when (= 1 (count vc))
|
||||
(doFor =>conversionName text vc
|
||||
(print "Converting block $(+ idx 1)/${blocks.length}")
|
||||
|
@@ -2,7 +2,8 @@
|
||||
&prop &mut :String sourceType
|
||||
&prop &mut :String outputType
|
||||
:(String,Array<String>)->Bool canConvertNames
|
||||
:(String,Array<String>)->String convertBlock]
|
||||
:(String,Array<String>)->String convertBlock
|
||||
&opt :Bool _neverAutomatic]
|
||||
[
|
||||
&mut :String->Bool canConvert ->block {
|
||||
(Main.updateNameExceptions)
|
||||
@@ -12,4 +13,5 @@
|
||||
(Main.updateNameExceptions)
|
||||
(let [names (Names.findNames block)] (convertBlock block names))
|
||||
}
|
||||
&mut :Null<Bool> neverAutomatic _neverAutomatic
|
||||
])
|
@@ -2,8 +2,10 @@
|
||||
&prop &mut :String sourceType
|
||||
&prop &mut :String outputType
|
||||
:Stream->Bool canConvertStream
|
||||
:Stream->String convertStream]
|
||||
:Stream->String convertStream
|
||||
&opt :Bool _neverAutomatic]
|
||||
[
|
||||
&mut :String->Bool canConvert ->block (canConvertStream (Stream.fromString block))
|
||||
&mut :String->String convert ->block (convertStream (Stream.fromString block))
|
||||
&mut :Null<Bool> neverAutomatic _neverAutomatic
|
||||
])
|
@@ -127,7 +127,8 @@
|
||||
(FileConversionProject.registerConversion
|
||||
(new tct.StreamConversion "Delay" "fountain" "hollywoo"
|
||||
->stream (isScreenLine stream.content)
|
||||
->stream "DELAY ##\"$(stream.content.trim)\"##\n"))
|
||||
->stream "DELAY ##\"$(stream.content.trim)\"##\n"
|
||||
true))
|
||||
|
||||
(function newSceneConversion [engine command setArgs newCamera containsPlaceholders]
|
||||
(FileConversionProject.registerConversion
|
||||
|
Reference in New Issue
Block a user