overpy 9.5.0 → 9.5.1

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.
Files changed (2) hide show
  1. package/overpy.js +1 -1
  2. package/package.json +1 -1
package/overpy.js CHANGED
@@ -551,7 +551,7 @@ rule "Integrity check":
551
551
  @Condition getControlScoringTeam() != Team.1
552
552
  print("This gamemode cannot be played!")
553
553
  \`\`\`
554
- `},translations:{description:'\nSetups the translation system. Arguments are the language codes separated by spaces.\n\nFor example:\n\n`#!translations en fr es zh_cn`\n\nOnly the es_mx, es_es, zh_cn and zh_tw languages can be specified fully. For the rest, you can only specify the first two letters.\n\nTo translate a string, wrap it with the "\\_" function, such as `_("You have ${} money").format(money)`. Note that the formatter has to be outside of the function. You can also use the "t" string modifier, such as `t"${} money".format(money)`.\n\nIf two strings are the same but have to be translated differently, you can add a context string as the first argument, such as `_("the direction", "left")`.\n\nLastly, if a translated string is stored in a variable, you **have** to use the "\\_" function when displaying it, such as `hudHeader(text=_(someVariable))`. Else, "TLErr" will be displayed. Note that you also have to use the "\\_" function when storing the string in the variable, else "0" will be displayed.\n\nOverPy will generate and parse .po files for each language based on the name of the main file. You can then use an online editor to edit those files. Leading and trailing whitespace is automatically stripped from the string when put into translation files.\n\n**WARNING**: A translated string cannot be used as a normal string **when stored in a variable**, as it becomes a string array. This means you cannot use `.replace()`, `.charAt()`, etc. When translating your gamemode, look out for these functions.\n\nThis also means that, when used in a variable, you cannot use a translated string as an argument of a string: `"{}{}".format(t"string", 1234)` will not work. Instead, do `t"string{}".format(1234)`. The translated string must always be top-level. You will also get "TLErr" if trying to use a translated string as an argument for another function.\n\nYou can also potentially save a lot of elements by using the #!translateWithPlayerVar directive (see the associated documentation).\n\n**Note**: The way string formatting works is via the .replace() function and some constants. This means you cannot have the following in your translated strings if using formatters:\n\n- `(0.00, 1.00, 0.00)` (`Vector.UP`)\n- `(0.00, -1.00, 0.00)` (`Vector.DOWN`)\n- `(1.00, 0.00, 0.00)` (`Vector.LEFT`)\n- `(-1.00, 0.00, 0.00)` (`Vector.RIGHT`)\n- `(0.00, 0.00, 1.00)` (`Vector.FORWARD`)\n- `(0.00, 0.00, -1.00)` (`Vector.BACKWARD`)\n- `1876650.25`, `1876651.25`, `1876652.25`, `1876653.25`, `1876654.25`, `1876655.25`, `1876656.25`, `1876657.25`, `1876658.25`, `1876659.25`\n '},translateWithPlayerVar:{description:"\nStores the player's language in a variable using a rule which uses the `.startFacing()` function when the player spawns (the language is determined based on the player's facing direction).\n\nIf using translations, this can save a lot of elements. However, it will make translated strings not display correctly for spectators; you will have to wrap them with the `__` function (which behaves the same as the `_` function, except it will not use the `__languageIndex__` player variable).\n\nIf your gamemode changes the facing direction on spawn, you must modify it so that it changes it once `eventPlayer.__languageIndex__ != 1.1`.\n\nYou can specify `noDetectionRule` to not create the rule which sets the variable to the player's language, in which case you'll have to define the rule yourself; the variable must be set to the language as defined in the order specified in the `#!translations` directive, where the first language is index 1, and must be set to 1 by default if no language could be determined.\n "},extension:{description:"You shouldn't be reading this. Contact CactusPuppy if you can see this.",snippet:"You shouldn't be reading this. Contact CactusPuppy if you can see this."},globalvarInitRuleName:{description:'Sets the name of the autogenerated rule that initializes global variables.\n\nExample: `#!globalvarInitRuleName "Init global variables"`'},playervarInitRuleName:{description:'Sets the name of the autogenerated rule that initializes player variables.\n\nExample: `#!playervarInitRuleName "Init player variables"`'},keepUnusedTranslations:{description:"If set, unused translations will not be removed from the generated .po files."},disableTranslationSourceLines:{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."},postCompileHook:{description:`
554
+ `},translations:{description:'\nSetups the translation system. Arguments are the language codes separated by spaces.\n\nFor example:\n\n`#!translations en fr es zh_cn`\n\nOnly the es_mx, es_es, zh_cn and zh_tw languages can be specified fully. For the rest, you can only specify the first two letters.\n\nTo translate a string, wrap it with the "\\_" function, such as `_("You have ${} money").format(money)`. Note that the formatter has to be outside of the function. You can also use the "t" string modifier, such as `t"${} money".format(money)`.\n\nIf two strings are the same but have to be translated differently, you can add a context string as the first argument, such as `_("the direction", "left")`.\n\nLastly, if a translated string is stored in a variable, you **have** to use the "\\_" function when displaying it, such as `hudHeader(text=_(someVariable))`. Else, "TLErr" will be displayed. Note that you also have to use the "\\_" function when storing the string in the variable, else "0" will be displayed.\n\nOverPy will generate and parse .po files for each language based on the name of the main file. You can then use an online editor to edit those files. Leading and trailing whitespace is automatically stripped from the string when put into translation files.\n\n**WARNING**: A translated string cannot be used as a normal string **when stored in a variable**, as it becomes a string array. This means you cannot use `.replace()`, `.charAt()`, etc. When translating your gamemode, look out for these functions.\n\nThis also means that, when used in a variable, you cannot use a translated string as an argument of a string: `"{}{}".format(t"string", 1234)` will not work. Instead, do `t"string{}".format(1234)`. The translated string must always be top-level. You will also get "TLErr" if trying to use a translated string as an argument for another function.\n\nYou can also potentially save a lot of elements by using the #!translateWithPlayerVar directive (see the associated documentation).\n\n**Note**: The way string formatting works is via the .replace() function and some constants. This means you cannot have the following in your translated strings if using formatters:\n\n- `(0.00, 1.00, 0.00)` (`Vector.UP`)\n- `(0.00, -1.00, 0.00)` (`Vector.DOWN`)\n- `(1.00, 0.00, 0.00)` (`Vector.LEFT`)\n- `(-1.00, 0.00, 0.00)` (`Vector.RIGHT`)\n- `(0.00, 0.00, 1.00)` (`Vector.FORWARD`)\n- `(0.00, 0.00, -1.00)` (`Vector.BACKWARD`)\n- `1876650.25`, `1876651.25`, `1876652.25`, `1876653.25`, `1876654.25`, `1876655.25`, `1876656.25`, `1876657.25`, `1876658.25`, `1876659.25`\n '},translateWithPlayerVar:{description:"\nStores the player's language in a variable using a rule which uses the `.startFacing()` function when the player spawns (the language is determined based on the player's facing direction).\n\nIf using translations, this can save a lot of elements. However, it will make translated strings not display correctly for spectators; you will have to wrap them with the `__` function (which behaves the same as the `_` function, except it will not use the `__languageIndex__` player variable).\n\nIf your gamemode changes the facing direction on spawn, you must modify it so that it changes it once `eventPlayer.__languageIndex__ != 1.1`.\n\nYou can specify `noDetectionRule` to not create the rule which sets the variable to the player's language, in which case you'll have to define the rule yourself; the variable must be set to the language as defined in the order specified in the `#!translations` directive, where the first language is index 1, and must be set to 1 by default if no language could be determined.\n "},extension:{description:"You shouldn't be reading this. Contact Zezombye if you can see this.",snippet:"You shouldn't be reading this. Contact Zezombye if you can see this."},globalvarInitRuleName:{description:'Sets the name of the autogenerated rule that initializes global variables.\n\nExample: `#!globalvarInitRuleName "Init global variables"`'},playervarInitRuleName:{description:'Sets the name of the autogenerated rule that initializes player variables.\n\nExample: `#!playervarInitRuleName "Init player variables"`'},keepUnusedTranslations:{description:"If set, unused translations will not be removed from the generated .po files."},disableTranslationSourceLines:{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."},postCompileHook:{description:`
555
555
  Specifies a JavaScript file to be executed after compilation, with the compiled code as a \`content\` variable. The script must return the modified code.
556
556
 
557
557
  Please do not use this directive to work around OverPy bugs; instead, report the bugs so they can be fixed at the source.
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.5.0",
10
+ "version": "9.5.1",
11
11
  "readme": "README.md",
12
12
  "keywords": [
13
13
  "overpy",