From 8e068e18b3725af83e32d48843203b4726dec428 Mon Sep 17 00:00:00 2001 From: FengMing <83573615+3093FengMing@users.noreply.github.com> Date: Tue, 14 Mar 2023 20:00:45 +0800 Subject: [PATCH] readme update --- README.md | 40 +++++++++++++++++++++++++++------------- README_en_us.md | 46 +++++++++++++++++++++++++++++----------------- 2 files changed, 56 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 0b42ef0..5ada8cf 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,7 @@ -# Vault Patcher ~~(Vanilla Hardcoded Breaker)~~ +# Vault Patcher +## 语言:**[简体中文](README.md)丨[English](README_en_us.md)** -语言:**[简体中文](README.md)丨[English](README_en_us.md)** - -### 硬编码 -> 本地化 - -### Let the hard coded strings change into localization strings in some mods. +## ⚠警告:1.2.7及以下的版本不再受支持! # 配置文件 @@ -24,6 +21,11 @@ "is_enable": false, "output_mode": 0, "output_format": " -> " + }, + "optimize_params": { + "disable_export": true, + "stack_min": -1, + "stack_max": -1 } } ``` @@ -32,21 +34,33 @@ `模块.json`才会被正常读取读取并使用。反之亦然。 ### 调试模式(Debug Mode) -**(Tips: 仅供调试使用)** -`is_enable`决定调试功能是否开启。 -若为`true`,那么会在替换字符串时向日志中输出一行调试信息,调试信息的格式由`output_format`决定,调试信息的内容由`output_mode`决定。 -若为`false`,则不会在替换字符串时向日志中输出任何内容。 +可以在调试和查找文本时使用。 + +`is_enable`决定调试功能是否开启。开启时会在替换字符串时向日志中输出一行调试信息,调试信息的格式由`output_format`决定,调试信息的内容由`output_mode`决定。 +默认为 false。 `output_format`决定了调试信息的格式,默认为` -> `。 -``为源内容,即未做替换前的字符串;``为做替换后的字符串。 -还有一个``未展示出来,因为输出的很多,容易污染日志。 -``为堆栈跟踪数组,是此字符串所在类的`StackTrace`(包括本mod),它更多是为`target_class`中的`stack_depth`和`name`服务的。 +允许占位符,支持的占位符如下: +* ``:源内容,即未做替换前的字符串。 +* ``:替换后的字符串。 +* ``:堆栈跟踪数组,是此字符串所在类的`StackTrace`(包括本mod)。 +* ``:该文本渲染所调用的方法。 `output_mode`决定了调试信息的内容。 若为 0, 则仅输出替换的字符串; 若为 1, 则仅输出不被替换的字符串。 +### 优化参数(Optimization Parameters) + +更改优化替换算法的参数。 + +`disable_export`决定是否禁用`export`功能,该选项对于优化有很大的作用。但同时`/vaultpatcher export`也将禁用。 +默认为 false。 + +`stack_min`和`stack_max`,决定了堆栈跟踪数组中的上限与下限,适当调整参数可以达到优化效果。 +默认均为 -1(即不更改上限下限)。 + ## 模块 模块的格式大概这样: diff --git a/README_en_us.md b/README_en_us.md index e57c8bd..a091f6c 100644 --- a/README_en_us.md +++ b/README_en_us.md @@ -1,16 +1,13 @@ -# Vault Patcher ~~(Vanilla Hardcoded Breaker)~~ +# Vault Patcher +## **Language:[简体中文](README.md)丨[English](README_en_us.md)** -**Language:[简体中文](README.md)丨[English](README_en_us.md)** - -### Hardcoded -> Localization - -### Let the hard coded strings change into localization strings in some mods. +## ⚠Warning: Version 1.2.7 and below is no longer supported! # Configs File ## Modular -the format in `config/vaultpatcher/` directory like is `config.json` and several `module.json`. +The format in `config/vaultpatcher/` directory like is `config.json` and several `module.json`. `config.json` must be provided. It is as follows: @@ -23,6 +20,11 @@ It is as follows: "is_enable": false, "output_mode": 0, "output_format": " -> " + }, + "optimize_params": { + "disable_export": true, + "stack_min": -1, + "stack_max": -1 } } ``` @@ -32,24 +34,34 @@ It is as follows: Only in this way can `module.json` read and used normally. ### Debug Mode -**(Tips: ONLY DEBUG)** -`is_enable` determines whether the debugging feature is enabled. -If it is `true`, a line of debugging information will be output to the log when replacing the string, -The format of debugging information is `output_format`, and determines the content of debugging information by `output_format`. -If it is `false`, Will not output anything to the log when replacing the string. +Can be used when debugging and finding text. + +`is_enable` determines whether the debugging feature is enabled. If it is `true`, a line of debugging information will be output to the log when replacing the string, +The format of debugging information is `output_format`, and determines the content of debugging information by `output_mode`. `output_format` determines the format of debugging information. The default is ` -> `. -`` is the source string, that is, the string before replacement. and ``is the replacement string. -There is another `` that is not shown, if you include it in `output_format`, -the log will be polluted because of the large amount of output information. -`` is a stacktrace array, which is the `StackTrace` (including this mod) of the class of this string, -This value is more for `stack_depth` and `name` in `target_class`. +* ``: Source string, the string before replacement. +* ``: The replacement string. +* ``: Stacktrace array, which is the `StackTrace` (including this mod) of the class of this string. +* ``: The method called when this text rendering. `output_mode` determines the content of debugging information. If it is 0, only the replaced string will be output, If it is 1, only the strings that are not replaced are output. +### Optimization Parameters + +Optimize the parameters of the algorithm. + +`disable_export` determines whether to disable the `export` feature, which is very useful for optimization. +But at the same time, `/vaultpatcher export` will also be disabled. +The default is false. + +`stack_min` and `stack_max` determines the upper and lower limits of the stack trace array, +and the optimization effect can be achieved by properly adjusting the parameters. +The default is -1 (The upper and lower limits are not changed). + ## Module The format of the Module File is roughly as follows: