Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19,730 changes: 19,730 additions & 0 deletions CODE_NDT/a

Large diffs are not rendered by default.

106 changes: 106 additions & 0 deletions CODE_NDT/test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import org.json.JSONArray;
import org.json.JSONObject;

public class test {
static File outPath=new File("sdcard/out");
public static void main(String[] args) throws Exception {
outPath.mkdirs();
outfromdata();
System.out.println();
}
/*
https://products.aspose.app/cells/zh/conversion/xlsx-to-json
NDT-1.15.json xlxs2json
*/
public static void outfromdata() throws Exception {
JSONObject js=pare(new File("sdcard/a"));
BufferedWriter index=new BufferedWriter(new FileWriter(new File(outPath, "index.md")));
index.write("# index");
JSONArray list= js.getJSONArray("单位代码");
BufferedWriter buff=null;
for (int i=0;i < list.length();++i) {
JSONObject obj=list.optJSONObject(i);
if (obj == null) {
if (buff != null) {
buff.close();
buff = null;
}
continue;
}
String str=obj.optString("key翻译");
if (str == null)continue;
String key=obj.optString("key描述解释");
boolean isSection=key == null ?false: key.startsWith("[") && key.endsWith("]");
if (isSection || str.matches("[a-zA-Z]{2,}")) {
if (buff != null)buff.close();
if (isSection) {
int j=key.indexOf('_');
if (j < 0)j = key.length() - 1;
str = key.substring(1, j);
}
if ("comment".equals(str)) {
continue;
}
index.write("\n## [");
char c=str.charAt(0);
if (c >= 'A' && c <= 'Z') {
char[] crr=str.toCharArray();
crr[0] = Character.toLowerCase(c);
str = new String(crr);
}
String rstr=str.equals("leg") ?"leg/arm": str.equals("global") ?"global_resource": str.equals("action") ?"action/hiddenAction": str;
index.write(rstr);
index.write("](");
index.write(str);
index.write(".md");
index.write(")\n");
index.write(obj.optString("key代码"));
buff = new BufferedWriter(new FileWriter(new File(outPath, str + ".md")));
buff.write("# ");
buff.write(rstr);
buff.write("\n");
} else if (buff != null) {
key = obj.optString("key代码");
if (key == null || key.length() == 0)continue;
char c=key.charAt(0);
if (Character.isLowerCase(c) || Character.isUpperCase(c) || c == '@') {
buff.write("## ");
buff.write(key);
buff.write("\ntranslation:");
buff.write(str.replaceFirst(":$", ""));
buff.write("\n<br>type:");
String type=obj.optString("key值类型", "string");
buff.write(type);
String type2=obj.optString("Column8");
if (type2 != null && type2.length() > 0) {
if (!type.equals(type2)) {
buff.write('/');
buff.write(type2);
}
}
str = obj.optString("key描述解释");
if (str != null) {
buff.write("\n<br>");
buff.write(str);
}
buff.write('\n');
}
}
}
if (buff != null)
buff.close();
index.close();
}
public static JSONObject pare(File f) throws Exception {
FileInputStream fi=new FileInputStream(f);
byte[] by=new byte[fi.available()];
fi.read(by);
return new JSONObject(new String(by));
}
}

3 changes: 1 addition & 2 deletions rustedwarfareapicode/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default defineConfig({
{ text: '主页', link: '/' },
{ text: '单位API', link: '/src/Unit/core' },
{ text: '地图API', link: '/src/Map/all' },
{ text: '调试API', link: '/src/Debug/test' },
{ text: '编写指南', link: '/api-dev' },
{ text: 'RW-Engine指南', link: '/src/RW-Engine/quick-start' },
{ text: '感谢名单', link: '/cos' }
Expand Down Expand Up @@ -48,7 +47,7 @@ export default defineConfig({
{ text: '逻辑-LOGIC', link: '/src/Unit/loginboolean' },
{ text: '刷兵/刷单位-SPAWN', link: '/src/Unit/spawnunit_spawnprojectile' },
{ text: '-------------------------', link: '' },
{ text: '格式', link: '/src/Map/all' },
{ text: '地图格式', link: '/src/Map/all' },
{ text: 'Trigger', link: '/src/Map/trigger' }
]
}
Expand Down
7 changes: 4 additions & 3 deletions rustedwarfareapicode/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ features:
details: 学习最基础的铁锈单位API-Code
link: /src/Unit/core
linkText: 让我们立刻开始吧!
- title: 单位代码表(NDT)
details: NDT数据集
link: /src/UnitNDT/index
linkText: 查阅
- title: 地图代码表
details: 学习铁锈的地图TMX代码表
link: /src/Map/all
linkText: (当前仅Trigger部分)
- title: 调试代码表
details: 学习铁锈的高级调试代码表(仅Android)
linkText: 让我们立刻开始吧![开发中]
- title: RW-Engine指南
details: 学习铁锈Mod RW-Engine的使用(仅Android)
link: /src/RW-Engine/quick-start
Expand Down
1 change: 0 additions & 1 deletion rustedwarfareapicode/src/Debug/test.md

This file was deleted.

2 changes: 1 addition & 1 deletion rustedwarfareapicode/src/Map/trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ outline: deep
```

- **repeatDelay**
- 重复延迟。宾语被触发后,再次执行效果的时间(会被 `deactivatedBy` 终止)。
- 重复延迟。宾语被触发后,再次执行效果的时间(不会检查`activatedBy`,会被 `deactivatedBy` 终止)。
- `time`

- **deactivatedBy**
Expand Down
Loading
Loading