overpy 9.4.22 → 9.4.24
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 +27 -0
- package/overpy.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -764,6 +764,33 @@ You can use `len(GameStatus)` to have the amount of values in the enum and `Game
|
|
|
764
764
|
|
|
765
765
|
Note that enum members are inlined, so if you use a value such as `getAllPlayers()` that changes during a game, the value of the enum will also change.
|
|
766
766
|
|
|
767
|
+
## #!postCompileHook
|
|
768
|
+
|
|
769
|
+
Runs a JavaScript post-processing script after OverPy finishes compilation. This can effectively resolve certain compilation errors caused by language translation.
|
|
770
|
+
|
|
771
|
+
```hs
|
|
772
|
+
#!postCompileHook "hooks/postCompileHook.js"
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
### How it works:
|
|
776
|
+
|
|
777
|
+
- The compiled Workshop text is exposed to the script as a `content` variable.
|
|
778
|
+
- The final value produced by the script is used as the final compiled output.
|
|
779
|
+
- The hook path is resolved from the main file root path (the compile `rootPath`).
|
|
780
|
+
- Only one `#!postCompileHook` directive can be defined per compilation.
|
|
781
|
+
|
|
782
|
+
Example `hooks/postCompileHook.js`:
|
|
783
|
+
|
|
784
|
+
```js
|
|
785
|
+
content = content.replace(/abc/g, "def");
|
|
786
|
+
|
|
787
|
+
// If the last operation returns an interpreter object,
|
|
788
|
+
// force a plain string as final output.
|
|
789
|
+
content.toString();
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
The hook script does not need to declare a wrapper function; writing statements that transform `content` is enough.
|
|
793
|
+
|
|
767
794
|
# Advanced constructs
|
|
768
795
|
|
|
769
796
|
## Switches
|
package/overpy.js
CHANGED
|
@@ -172102,7 +172102,7 @@ var heroKw = (
|
|
|
172102
172102
|
"ru-RU": "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C \u043E\u0433\u043D\u044F \u0440\u0435\u043B\u044C\u0441\u043E\u0442\u0440\u043E\u043D\u0430",
|
|
172103
172103
|
"th-TH": "\u0E2D\u0E32\u0E27\u0E38\u0E18\u0E2A\u0E33\u0E23\u0E2D\u0E07\u0E40\u0E23\u0E25\u0E01\u0E31\u0E19",
|
|
172104
172104
|
"tr-TR": "Rayl\u0131 T\xFCfek Alternatif Ate\u015Fi",
|
|
172105
|
-
"zh-CN": "\
|
|
172105
|
+
"zh-CN": "\u5145\u80FD\u5C04\u51FB",
|
|
172106
172106
|
"zh-TW": "\u78C1\u8ECC\u69CD\u6B21\u8981\u653B\u64CA"
|
|
172107
172107
|
},
|
|
172108
172108
|
"ability1": {
|
|
@@ -196850,8 +196850,8 @@ var reinitInterpreter = (code) => {
|
|
|
196850
196850
|
|
|
196851
196851
|
// src/utils/other.ts
|
|
196852
196852
|
var import_standalone = __toESM(require_babel());
|
|
196853
|
-
var MAX_SCRIPT_STEP_COUNT =
|
|
196854
|
-
var MAX_SCRIPT_STACK_SIZE =
|
|
196853
|
+
var MAX_SCRIPT_STEP_COUNT = 655360;
|
|
196854
|
+
var MAX_SCRIPT_STACK_SIZE = 1e8;
|
|
196855
196855
|
var scriptCache = {};
|
|
196856
196856
|
function camelCaseToUpperCase(str) {
|
|
196857
196857
|
return str.split(/(?=[A-Z])/).join("_").toUpperCase();
|
package/package.json
CHANGED