Skip to content

Commit

Permalink
支持CSV物编
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Mar 11, 2024
1 parent c7c12ce commit 1f4106b
Show file tree
Hide file tree
Showing 74 changed files with 3,754 additions and 70 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,13 @@
1.`F1` 打开命令列表,使用命令 `Y3:初始化开发环境`
2. 选择地图路径
3. 完成!

## 生成CSV格式的物编数据表格
在使用从CSV格式的表格中导入物编数据的功能之前,推荐使用此功能生成模板以填写需要的数据。
1.`F1` 打开命令列表,使用命令 `Y3:生成CSV格式的物编数据表格`将在当前工程项目的script文件夹下的resource/editor_table文件夹下生成CSV格式的物编数据表格
请直接在生成的表格中填写物编数据,导入时会按此导入。
## 从CSV格式的表格中导入物体编辑数据
1.`F1` 打开命令列表,使用命令 `Y3:从CSV格式的表格中导入物体编辑数据`
从刚刚从生成的CSV表格中导入物编数据

**推荐和[Edit csv](https://marketplace.visualstudio.com/items?itemName=janisdd.vscode-edit-csv)插件配合使用,以便在Visual Code内编辑CSV表格,无需打开新的窗口**
298 changes: 267 additions & 31 deletions package-lock.json

Large diffs are not rendered by default.

96 changes: 91 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@
],
"main": "./out/extension.js",
"contributes": {
"viewsContainers": {
"activitybar": [
{
"id": "Y3-Helper-container",
"title": "Y3-Helper",
"icon": "image/logo.png"
}
]
},
"views": {
"editor_table-container": [
{
"id": "editor_table-view",
"type": "webview",
"name": "editor_table"
}
]
},
"commands": [
{
"command": "y3-helper.initProject",
Expand All @@ -35,17 +53,80 @@
{
"command": "y3-helper.launchGameAndAttach",
"title": "Y3:启动游戏并附加调试"
},
{
"command": "y3-helper.importObjectDataFromAllCSV",
"title": "Y3:导入物编数据(CSV)"
},
{
"command": "y3-helper.generateAllTemplateCSV",
"title": "Y3:生成物编模板(CSV)"
}
],
"configuration": {
"title": "Y3-Helper",
"type": "object",
"properties": {
"Y3-Helper.EditorPath": {
"title": "Y3编辑器路径",
"description": "Y3编辑器的完整路径。如果为空则会从注册表中获取。",
"type": "string",
"default": "",
"ignoreSync": true,
"description": "Y3编辑器的完整路径。如果为空则会从注册表中获取。"
"ignoreSync": true
},
"Y3-Helper.CSVPath": {
"title": "CSV物编路径",
"description": "",
"type": "object",
"default": {},
"additionalProperties": false,
"properties": {
"unit": {
"type": "string",
"default": "./resource/editor_table/单位",
"description": "单位的CSV物编数据的默认存放文件夹名"
},
"decoration": {
"type": "string",
"default": "./resource/editor_table/装饰物",
"description": "装饰物的CSV物编数据的默认存放文件夹名"
},
"item": {
"type": "string",
"default": "./resource/editor_table/物品",
"description": "物品的CSV物编数据的默认存放文件夹名"
},
"ability": {
"type": "string",
"default": "./resource/editor_table/技能",
"description": "技能的CSV物编数据的默认存放文件夹名"
},
"modifier": {
"type": "string",
"default": "./resource/editor_table/魔法效果",
"description": "魔法效果的CSV物编数据的默认存放文件夹名"
},
"projectile": {
"type": "string",
"default": "./resource/editor_table/投射物",
"description": "投射物的CSV物编数据的默认存放文件夹名"
},
"technology": {
"type": "string",
"default": "./resource/editor_table/科技",
"description": "科技的CSV物编数据的默认存放文件夹名"
},
"destructible": {
"type": "string",
"default": "./resource/editor_table/可破坏物",
"description": "可破坏物的CSV物编数据的默认存放文件夹名"
},
"sound": {
"type": "string",
"default": "./resource/editor_table/声音",
"description": "声音的CSV物编数据的默认存放文件夹名"
}
}
}
}
},
Expand All @@ -68,22 +149,27 @@
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js"
"test": "node ./out/src/test/runTest.js"
},
"dependencies": {
"@types/uuid": "^9.0.8",
"csv-parser": "^3.0.0",
"fs-extra": "^11.2.0",
"uuid": "^9.0.1",
"winreg": "^1.2.5"
},
"devDependencies": {
"@types/mocha": "^10.0.3",
"@types/node": "18.x",
"@types/node": "^18.19.18",
"@types/vscode": "^1.83.0",
"@types/winreg": "^1.2.34",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"@vscode/test-electron": "^2.3.6",
"eslint": "^8.52.0",
"eslint": "^8.57.0",
"glob": "^10.3.10",
"mocha": "^10.2.0",
"ts-node": "^10.9.2",
"typescript": "^5.2.2"
}
}
Loading

0 comments on commit 1f4106b

Please sign in to comment.