feat: as3 fla export - option to disable scripts layer (#2673)

Closes #2673
This commit is contained in:
Jindra Petřík
2026-03-28 10:26:22 +01:00
parent fdc18ce9f5
commit 8c0b16938a
6 changed files with 30 additions and 8 deletions

View File

@@ -1209,6 +1209,10 @@ public final class Configuration {
@ConfigurationCategory("export")
public static ConfigurationItem<Boolean> svgExportGaussianBlur = null;
@ConfigurationDefaultBoolean(false)
@ConfigurationCategory("export")
public static ConfigurationItem<Boolean> exportFlaAs3DisableScriptLayer = null;
private static Map<String, String> configurationDescriptions = new LinkedHashMap<>();
private static Map<String, String> configurationTitles = new LinkedHashMap<>();

View File

@@ -3736,11 +3736,13 @@ public class XFLConverter {
}
}
StringBuilderTextWriter writer = new StringBuilderTextWriter(Configuration.getCodeFormatting(), scriptBuilder);
frameBody.toString(new LinkedHashSet<>(), swfVersion, callStack, abcIndex, "??", ScriptExportMode.AS, abc, methodTrait, writer, new ArrayList<>(), new HashSet<>(), classIndex);
if (!Configuration.exportFlaAs3DisableScriptLayer.get()) {
StringBuilderTextWriter writer = new StringBuilderTextWriter(Configuration.getCodeFormatting(), scriptBuilder);
frameBody.toString(new LinkedHashSet<>(), swfVersion, callStack, abcIndex, "??", ScriptExportMode.AS, abc, methodTrait, writer, new ArrayList<>(), new HashSet<>(), classIndex);
String script = scriptBuilder.toString();
ret.put(frame, script);
String script = scriptBuilder.toString();
ret.put(frame, script);
}
}
}
@@ -6236,7 +6238,7 @@ public class XFLConverter {
}
if (useAS3 && settings.exportScript) {
try {
ScriptExportSettings scriptExportSettings = new ScriptExportSettings(ScriptExportMode.AS, false, true, false, true, "/_assets/", Configuration.linkAllClasses.get(), true);
ScriptExportSettings scriptExportSettings = new ScriptExportSettings(ScriptExportMode.AS, false, !Configuration.exportFlaAs3DisableScriptLayer.get(), false, true, "/_assets/", Configuration.linkAllClasses.get(), true);
swf.exportActionScript(handler, scriptsDir.getAbsolutePath(), scriptExportSettings, parallel, null);
} catch (Exception ex) {
logger.log(Level.SEVERE, "Error during ActionScript3 export", ex);

View File

@@ -675,3 +675,7 @@ config.description.sortDebugVariablesAlphabetically = Sorts variables in the deb
config.name.svgExportGaussianBlur = Use gaussian blur in SVG export
config.description.svgExportGaussianBlur = Use gaussian blur instead of box blur (which uses convolution matrix) in SVG exports. Box blur causes scaling problems on some browsers. Gaussian blur on the other hand is not 100 % accurate to what SWF shows.
#after 25.1.3
config.name.exportFlaAs3DisableScriptLayer = FLA export - AS3 - disable script layer
config.description.exportFlaAs3DisableScriptLayer = In ActionScript 3 FLA export, the scripts in frames will stay inside class they belong, instead of putting them separately to Script layer. True = in class, False = in Script layer.

View File

@@ -674,4 +674,8 @@ config.name.sortDebugVariablesAlphabetically = Se\u0159adit prom\u011bnn\u00e9 v
config.description.sortDebugVariablesAlphabetically = Se\u0159ad\u00ed prom\u011bnn\u00e9 v debuggeru abecedn\u011b.
config.name.svgExportGaussianBlur = Pou\u017e\u00edt gaussovsk\u00fd blur p\u0159i exportu do SVG
config.description.svgExportGaussianBlur = Pou\u017e\u00edt gaussovsk\u00fd blur m\u00edsto box blur (kter\u00e9 pou\u017e\u00edv\u00e1 konvolu\u010dn\u00ed matici) p\u0159i exportu do SVG. Box blur zp\u016fsobuje probl\u00e9my se \u0161k\u00e1lov\u00e1n\u00edm v n\u011bkter\u00fdch prohl\u00ed\u017ee\u010d\u00edch. Gaussovsk\u00fd blur na druhou stranu nen\u00ed 100% p\u0159esn\u00fd oproti zobrazen\u00ed ve SWF.
config.description.svgExportGaussianBlur = Pou\u017e\u00edt gaussovsk\u00fd blur m\u00edsto box blur (kter\u00e9 pou\u017e\u00edv\u00e1 konvolu\u010dn\u00ed matici) p\u0159i exportu do SVG. Box blur zp\u016fsobuje probl\u00e9my se \u0161k\u00e1lov\u00e1n\u00edm v n\u011bkter\u00fdch prohl\u00ed\u017ee\u010d\u00edch. Gaussovsk\u00fd blur na druhou stranu nen\u00ed 100% p\u0159esn\u00fd oproti zobrazen\u00ed ve SWF.
#after 25.1.3
config.name.exportFlaAs3DisableScriptLayer = Export FLA \u2013 AS3 - zak\u00e1zat vrstvu skript\u016f
config.description.exportFlaAs3DisableScriptLayer = P\u0159i exportu ActionScript 3 FLA z\u016fstanou skripty ve sn\u00edmc\u00edch uvnit\u0159 t\u0159\u00eddy, do kter\u00e9 pat\u0159\u00ed, m\u00edsto aby byly odd\u011blen\u011b um\u00edst\u011bny do vrstvy Script. True = ve t\u0159\u00edd\u011b, False = ve vrstv\u011b Script.

View File

@@ -603,4 +603,8 @@ config.name.sortDebugVariablesAlphabetically = Variablen im Debugger alphabetisc
config.description.sortDebugVariablesAlphabetically = Sortiert die Variablen im Debugger alphabetisch.
config.name.svgExportGaussianBlur = Gau\u00dfschen Weichzeichner beim SVG-Export verwenden
config.description.svgExportGaussianBlur = Beim SVG-Export den gau\u00dfschen Weichzeichner anstelle des Box-Weichzeichners (der eine Faltungsmatrix verwendet) nutzen. Der Box-Weichzeichner verursacht in einigen Browsern Skalierungsprobleme. Der gau\u00dfsche Weichzeichner hingegen entspricht nicht zu 100 % der Darstellung in SWF.
config.description.svgExportGaussianBlur = Beim SVG-Export den gau\u00dfschen Weichzeichner anstelle des Box-Weichzeichners (der eine Faltungsmatrix verwendet) nutzen. Der Box-Weichzeichner verursacht in einigen Browsern Skalierungsprobleme. Der gau\u00dfsche Weichzeichner hingegen entspricht nicht zu 100 % der Darstellung in SWF.
#after 25.1.3
config.name.exportFlaAs3DisableScriptLayer = FLA-Export \u2013 AS3 - Skriptebene deaktivieren
config.description.exportFlaAs3DisableScriptLayer = Beim Export von ActionScript 3 FLA bleiben die Skripte in Frames innerhalb der Klasse, zu der sie geh\u00f6ren, anstatt separat in die Skriptebene verschoben zu werden. True = in der Klasse, False = in der Skriptebene.

View File

@@ -674,4 +674,8 @@ config.name.sortDebugVariablesAlphabetically = Zoradi\u0165 premenn\u00e9 v ladi
config.description.sortDebugVariablesAlphabetically = Zorad\u00ed premenn\u00e9 v ladi\u010di abecedne.
config.name.svgExportGaussianBlur = Pou\u017ei\u0165 gaussovsk\u00fd blur pri exporte do SVG
config.description.svgExportGaussianBlur = Pou\u017ei\u0165 gaussovsk\u00fd blur namiesto box blur (ktor\u00e9 pou\u017e\u00edva konvolu\u010dn\u00fa maticu) pri exporte do SVG. Box blur sp\u00f4sobuje probl\u00e9my so \u0161k\u00e1lovan\u00edm v niektor\u00fdch prehliada\u010doch. Gaussovsk\u00fd blur na druhej strane nie je 100 % presn\u00fd oproti zobrazeniu v SWF.
config.description.svgExportGaussianBlur = Pou\u017ei\u0165 gaussovsk\u00fd blur namiesto box blur (ktor\u00e9 pou\u017e\u00edva konvolu\u010dn\u00fa maticu) pri exporte do SVG. Box blur sp\u00f4sobuje probl\u00e9my so \u0161k\u00e1lovan\u00edm v niektor\u00fdch prehliada\u010doch. Gaussovsk\u00fd blur na druhej strane nie je 100 % presn\u00fd oproti zobrazeniu v SWF.
#after 25.1.3
config.name.exportFlaAs3DisableScriptLayer = Export FLA \u2013 AS3 - zak\u00e1za\u0165 vrstvu skriptov
config.description.exportFlaAs3DisableScriptLayer = Pri exporte ActionScript 3 FLA zostan\u00fa skripty v sn\u00edmkach vn\u00fatri triedy, do ktorej patria, namiesto toho, aby boli oddelene umiestnen\u00e9 do vrstvy Script. True = v triede, False = vo vrstve Script.