Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
3093FengMing committed Mar 14, 2023
1 parent 08b876f commit 8e068e1
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 30 deletions.
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -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及以下的版本不再受支持!

# 配置文件

Expand All @@ -24,6 +21,11 @@
"is_enable": false,
"output_mode": 0,
"output_format": "<source> -> <target>"
},
"optimize_params": {
"disable_export": true,
"stack_min": -1,
"stack_max": -1
}
}
```
Expand All @@ -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`决定了调试信息的格式,默认为`<source> -> <target>`
`<source>`为源内容,即未做替换前的字符串;`<target>`为做替换后的字符串。
还有一个`<stack>`未展示出来,因为输出的很多,容易污染日志。
`<stack>`为堆栈跟踪数组,是此字符串所在类的`StackTrace`(包括本mod),它更多是为`target_class`中的`stack_depth``name`服务的。
允许占位符,支持的占位符如下:
* `<source>`:源内容,即未做替换前的字符串。
* `<target>`:替换后的字符串。
* `<stack>`:堆栈跟踪数组,是此字符串所在类的`StackTrace`(包括本mod)。
* `<method>`:该文本渲染所调用的方法。

`output_mode`决定了调试信息的内容。
若为 0, 则仅输出替换的字符串;
若为 1, 则仅输出不被替换的字符串。

### 优化参数(Optimization Parameters)

更改优化替换算法的参数。

`disable_export`决定是否禁用`export`功能,该选项对于优化有很大的作用。但同时`/vaultpatcher export`也将禁用。
默认为 false。

`stack_min``stack_max`,决定了堆栈跟踪数组中的上限与下限,适当调整参数可以达到优化效果。
默认均为 -1(即不更改上限下限)。

## 模块

模块的格式大概这样:
Expand Down
46 changes: 29 additions & 17 deletions README_en_us.md
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -23,6 +20,11 @@ It is as follows:
"is_enable": false,
"output_mode": 0,
"output_format": "<source> -> <target>"
},
"optimize_params": {
"disable_export": true,
"stack_min": -1,
"stack_max": -1
}
}
```
Expand All @@ -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 `<source> -> <target>`.
`<source>` is the source string, that is, the string before replacement. and `<target>`is the replacement string.
There is another `<stack>` that is not shown, if you include it in `output_format`,
the log will be polluted because of the large amount of output information.
`<stack>` 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>`: Source string, the string before replacement.
* `<target>`: The replacement string.
* `<stack>`: Stacktrace array, which is the `StackTrace` (including this mod) of the class of this string.
* `<method>`: 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:
Expand Down

0 comments on commit 8e068e1

Please sign in to comment.