overpy 9.6.5 → 9.6.7

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,10 @@ rule "Disable inspector":
65855
65859
  spentExtensionPoints,
65856
65860
  availableExtensionPoints,
65857
65861
  translationLanguages: translationLanguages2,
65858
- translatedStrings
65862
+ translatedStrings,
65863
+ writeToOutputFile,
65864
+ mainFileName,
65865
+ rootPath
65859
65866
  };
65860
65867
  }
65861
65868
  function compileRules(astRules) {
@@ -69807,6 +69814,8 @@ var rulePrefixTemplateFilestack = [];
69807
69814
  var setRulePrefixTemplateFilestack = (filestack) => rulePrefixTemplateFilestack = filestack;
69808
69815
  var useVariableForCompressionAlphabet = false;
69809
69816
  var setUseVariableForCompressionAlphabet = (use) => useVariableForCompressionAlphabet = use;
69817
+ var writeToOutputFile = false;
69818
+ var setWriteToOutputFile = (write) => writeToOutputFile = write;
69810
69819
  var decompilerGotos;
69811
69820
  var resetDecompilerGotos = () => decompilerGotos = [];
69812
69821
  var nbTabs;
@@ -69888,6 +69897,7 @@ function resetGlobalVariables(language) {
69888
69897
  rulePrefixTemplate = "";
69889
69898
  rulePrefixTemplateFilestack = [];
69890
69899
  useVariableForCompressionAlphabet = false;
69900
+ writeToOutputFile = false;
69891
69901
  }
69892
69902
  var operatorPrecedence = {
69893
69903
  "=": 1,
@@ -72372,6 +72382,9 @@ You can also specify \`noTlErr\` to have spectators view the default language wh
72372
72382
  "disableTranslationSourceLines": {
72373
72383
  "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
72384
  },
72385
+ "writeToOutputFile": {
72386
+ "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`)."
72387
+ },
72375
72388
  "postCompileHook": {
72376
72389
  "description": `
72377
72390
  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.7",
11
11
  "readme": "README.md",
12
12
  "keywords": [
13
13
  "overpy",