overpy 9.6.5 → 9.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -602,6 +602,10 @@ If specified, allows redefining a `macro`, `#!define` or `enum` member. Can be u
602
602
 
603
603
  Will generate a summary of the used elements per rule in the output, and add a comment with the number of elements used for each rule/condition/action.
604
604
 
605
+ ## #!writeToOutputFile
606
+
607
+ If specified, the compiled code will not be copied to the clipboard but instead written to a file with the same name as the main file, but with a `.ws.txt` extension (eg `myGamemode.opy` will produce `myGamemode.ws.txt`).
608
+
605
609
  ## Optimizations
606
610
 
607
611
  By default, OverPy automatically optimizes gamemodes for speed. This means useless code is removed, calculations are done when possible, and function patterns are replaced with builtin functions.
package/overpy.d.ts CHANGED
@@ -18,6 +18,7 @@ declare namespace overpy {
18
18
  availableExtensionPoints: number;
19
19
  translationLanguages: string[];
20
20
  translatedStrings: unknown[];
21
+ writeToOutputFile: boolean;
21
22
  }
22
23
 
23
24
  function compile(
package/overpy.js CHANGED
@@ -38582,6 +38582,10 @@ ${scriptText}`, {
38582
38582
  setDisableInspector(true);
38583
38583
  return;
38584
38584
  }
38585
+ if (content2.startsWith("#!writeToOutputFile")) {
38586
+ setWriteToOutputFile(true);
38587
+ return;
38588
+ }
38585
38589
  if (content2.startsWith("#!disableTranslationSourceLines")) {
38586
38590
  setDisableTranslationSourceLines(true);
38587
38591
  return;
@@ -65855,7 +65859,8 @@ rule "Disable inspector":
65855
65859
  spentExtensionPoints,
65856
65860
  availableExtensionPoints,
65857
65861
  translationLanguages: translationLanguages2,
65858
- translatedStrings
65862
+ translatedStrings,
65863
+ writeToOutputFile
65859
65864
  };
65860
65865
  }
65861
65866
  function compileRules(astRules) {
@@ -69807,6 +69812,8 @@ var rulePrefixTemplateFilestack = [];
69807
69812
  var setRulePrefixTemplateFilestack = (filestack) => rulePrefixTemplateFilestack = filestack;
69808
69813
  var useVariableForCompressionAlphabet = false;
69809
69814
  var setUseVariableForCompressionAlphabet = (use) => useVariableForCompressionAlphabet = use;
69815
+ var writeToOutputFile = false;
69816
+ var setWriteToOutputFile = (write) => writeToOutputFile = write;
69810
69817
  var decompilerGotos;
69811
69818
  var resetDecompilerGotos = () => decompilerGotos = [];
69812
69819
  var nbTabs;
@@ -69888,6 +69895,7 @@ function resetGlobalVariables(language) {
69888
69895
  rulePrefixTemplate = "";
69889
69896
  rulePrefixTemplateFilestack = [];
69890
69897
  useVariableForCompressionAlphabet = false;
69898
+ writeToOutputFile = false;
69891
69899
  }
69892
69900
  var operatorPrecedence = {
69893
69901
  "=": 1,
@@ -72372,6 +72380,9 @@ You can also specify \`noTlErr\` to have spectators view the default language wh
72372
72380
  "disableTranslationSourceLines": {
72373
72381
  "description": "If set, the source lines of the translations will not be included in the generated .po files. Use this if you are not actively translating your gamemode, to prevent cluttering git diffs."
72374
72382
  },
72383
+ "writeToOutputFile": {
72384
+ "description": "If specified, the compiled code will not be copied to the clipboard but instead written to a file with the same name as the main file, but with a `.ws.txt` extension (eg `myGamemode.opy` will produce `myGamemode.ws.txt`)."
72385
+ },
72375
72386
  "postCompileHook": {
72376
72387
  "description": `
72377
72388
  Specifies a JavaScript file to be executed after compilation, with the compiled code as a \`content\` variable. The script must return the modified code.
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "https://github.com/Zezombye/overpy"
8
8
  },
9
9
  "description": "High-level language for the Overwatch Workshop, with decompilation and compilation.",
10
- "version": "9.6.5",
10
+ "version": "9.6.6",
11
11
  "readme": "README.md",
12
12
  "keywords": [
13
13
  "overpy",