This commit is contained in:
JA
2026-08-21 10:39:51 +08:00
parent 46e4f8471a
commit c18f9d5536
12 changed files with 285 additions and 783 deletions
+19 -17
View File
@@ -1,42 +1,43 @@
{
"description": "CSV数据源到文档章节的映射关系",
"csv_base_dir": "d:\\p-L12\\work\\cvs",
"description": "配置表数据源到文档章节的映射关系",
"table_base_dir": "*_config 目录(优先读 .xlsx,其次 .csv,无需预先转换)",
"read_strategy": "universal_tool.find_file 优先查找 name.xlsx,找不到再找 name.csv;两种格式都直接读取,表头结构一致",
"mappings": {
"system_prompts": {
"source": "GameTextConst.cs (代码引用分析)",
"section": "一、系统提示",
"field": "常量值文本",
"filter": "仅保留在代码中被实际引用的常量排除仅在注释中出现的",
"filter": "仅保留在代码中被实际引用的常量(排除仅在注释中出现的)",
"dedup": "按文本值去重"
},
"quest_texts": {
"source": "quest.csv",
"source": "quest.xlsx/csv",
"section": "二、任务文本",
"field": "desc (第4列, index=3)",
"filter": "category == 1 或 category == 2",
"dedup": "按desc文本去重"
},
"achievement_texts": {
"source": "quest.csv",
"source": "quest.xlsx/csv",
"section": "三、成就文本",
"field": "desc (第4列, index=3)",
"filter": "category == 9",
"dedup": "按desc文本去重"
},
"player_names": {
"source": "原始文档固定数据 (100对姓名)",
"source": "name.xlsx/csv (找不到则用内置默认100对姓名)",
"section": "四、玩家随机名称文本",
"format": "表格: 姓 | 名"
},
"guide_texts": {
"source": "guide.csv",
"source": "guide.xlsx/csv",
"section": "五、新手指引文本",
"field": "desc (第8列, index=7)",
"filter": "无",
"dedup": "按desc文本去重"
},
"props": {
"source": "prop.csv",
"source": "prop.xlsx/csv",
"section": "六、道具说明",
"fields": {
"name": "第3列 (index=2)",
@@ -47,7 +48,7 @@
"icon_naming": "icon_product_XX.png (XX为补零两位数, 如 icon_product_01)"
},
"skills": {
"source": "skill.csv",
"source": "skill.xlsx/csv",
"section": "七、技能",
"fields": {
"name": "第2列 (index=1)",
@@ -58,7 +59,7 @@
"icon_naming": "skillX.png (X为数字, 不补零, 如 skill1, skill10)"
},
"runes": {
"source": "rune.csv",
"source": "rune.xlsx/csv",
"section": "八、灵石",
"fields": {
"name": "第2列 (index=1)",
@@ -69,7 +70,7 @@
"icon_naming": "rune_icon_X.png (X为数字, 不补零)"
},
"talents": {
"source": "playerlevel.csv",
"source": "playerlevel.xlsx/csv",
"section": "九、天赋",
"fields": {
"name": "第14列 (index=13)",
@@ -81,7 +82,7 @@
"dedup": "按name去重"
},
"equipment": {
"source": "equip.csv",
"source": "equip.xlsx/csv",
"section": "十、装备",
"fields": {
"name": "第2列 (index=1)",
@@ -90,19 +91,20 @@
"icon_dir": "atlas_equip_icons",
"icon_naming": "equip_icon_X.png (X为数字, 不补零)",
"dedup": "按name去重",
"note": "equip.csv无desc字段"
"note": "equip无desc字段"
},
"level_names": {
"source": "fight_sample.csv",
"source": "fight_sample.xlsx/csv",
"section": "十一、关卡名称",
"field": "name (第3列, index=2)",
"filter": "无",
"dedup": "按name去重"
}
},
"csv_format": {
"table_format": {
"header_rows": 3,
"header_structure": "第1行:中文头, 第2行:类型定义, 第3行:英文字段名",
"encoding_note": "部分文件为GBK编码,需自动检测"
"header_structure": "第1行:中文头, 第2行:类型定义, 第3行:英文字段名(用作字段映射)",
"data_start_row": "第4行起",
"encoding_note": "csv需自动检测(优先级 utf-8-sig -> gbk -> gb2312 -> utf-8)xlsx由openpyxl直接读取无编码问题"
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
{
"document_title": "《不朽封仙》文字脚本",
"document_title_example": "《<项目名>》文字脚本 (universal_tool 用扫描到的项目名生成)",
"sections": [
{"number": "一", "title": "系统提示", "type": "numbered_list"},
{"number": "二", "title": "任务文本", "type": "numbered_list"},
@@ -35,7 +35,7 @@
"font_en": "FangSong",
"size": "四号 (14pt)",
"bold": false,
"numbering": "阿拉伯数字 (1. 2. 3. ...)"
"numbering": "Word自动编号列表 (decimal, 每章节独立numId从1开始),增删条目后编号自动重排;段落文本不再硬编码 1. 2. 3."
},
"table_images": {
"height": "3cm",
@@ -1,10 +1,10 @@
{
"description": "图标资源名称到图片文件的映射规则与目录结构",
"base_dir": "d:\\p-L12\\P-L12_game\\unity\\Assets\\Resources\\Resources_moved\\gui\\atlas_ui",
"base_dir_example": "<game_dir>/unity/Assets/Resources/Resources_moved/gui/atlas_ui (universal_tool 自动扫描 atlas_* 子目录)",
"directories": {
"atlas_product_icons": {
"section": "六、道具说明",
"csv_field": "prop.csv icon (index=7)",
"table_field": "prop.xlsx/csv icon (index=7)",
"naming_pattern": "icon_product_XX.png",
"naming_note": "XX为补零两位数 (01-63), 如 icon_product_1 -> icon_product_01.png",
"file_count": 63,
@@ -12,7 +12,7 @@
},
"atlas_skill": {
"section": "七、技能",
"csv_field": "skill.csv icon (index=6)",
"table_field": "skill.xlsx/csv icon (index=6)",
"naming_pattern": "skillX.png",
"naming_note": "X为数字不补零 (1-99), 如 skill1, skill10, skill99",
"file_count": 99,
@@ -20,7 +20,7 @@
},
"atlas_rune_icons": {
"section": "八、灵石",
"csv_field": "rune.csv icon (index=2)",
"table_field": "rune.xlsx/csv icon (index=2)",
"naming_pattern": "rune_icon_X.png",
"naming_note": "X为数字不补零 (1-18)",
"file_count": 12,
@@ -28,7 +28,7 @@
},
"atlas_talent_icons": {
"section": "九、天赋",
"csv_field": "playerlevel.csv icon (index=15)",
"table_field": "playerlevel.xlsx/csv icon (index=15)",
"naming_pattern": "icon_talent_X.png",
"naming_note": "X为数字不补零 (1-6)",
"file_count": 6,
@@ -36,7 +36,7 @@
},
"atlas_equip_icons": {
"section": "十、装备",
"csv_field": "equip.csv icon (index=5)",
"table_field": "equip.xlsx/csv icon (index=5)",
"naming_pattern": "equip_icon_X.png",
"naming_note": "X为数字不补零 (1-6)",
"file_count": 6,
+17 -19
View File
@@ -1,17 +1,15 @@
{
"project_name": "P-L12《不朽封仙》",
"workspace_root": "d:\\p-L12",
"paths": {
"config_dir": "d:\\p-L12\\P-L12_config",
"game_dir": "d:\\p-L12\\P-L12_game",
"csv_dir": "d:\\p-L12\\work\\cvs",
"scripts_dir": "d:\\p-L12\\work\\py",
"memories_dir": "d:\\p-L12\\work\\memories",
"output_doc": "d:\\p-L12\\work\\《不朽封仙》游戏文字脚本.docx"
"project_name": "P-L12《不朽封仙》(历史参考项目)",
"note": "本文件记录历史项目的路径约定,作为通用工具 universal_tool.py 的参考。当前工具自动扫描项目结构,不再依赖固定路径。",
"paths_example": {
"config_dir": "<project_root>/<项目名>_config (xlsx/csv 配置表)",
"game_dir": "<project_root>/<项目名>_game",
"scripts_dir": "<project_root>/<项目名>_game/unity/Assets/Scripts",
"memories_dir": "<本项目>/memories",
"output_doc": "<project_root>/work/《项目名》游戏文字脚本.docx"
},
"scripts": {
"xlsx_to_csv": "d:\\p-L12\\work\\py\\xlsx_to_csv.py",
"generate_doc": "d:\\p-L12\\work\\py\\generate_doc.py"
"universal_tool": "<本项目>/py/universal_tool.py (唯一入口,自动扫描+生成)"
},
"dependencies": {
"python_packages": ["openpyxl", "python-docx"],
@@ -20,14 +18,14 @@
"pip install python-docx"
]
},
"csv_encoding": {
"note": "部分CSV文件使用GBK/GB2312编码,非UTF-8",
"read_strategy": "按优先级尝试 utf-8-sig -> gbk -> gb2312 -> utf-8",
"write_encoding": "xlsx_to_csv.py 输出使用 UTF-8 with BOM (utf-8-sig)"
"data_reading": {
"strategy": "直接读取 xlsx(优先)或 csv,无需预先转换",
"csv_encoding": "按优先级尝试 utf-8-sig -> gbk -> gb2312 -> utf-8 (仅csv需要)",
"xlsx_reading": "openpyxl read_only/data_only 直接读取"
},
"game_code_paths": {
"game_text_const": "d:\\p-L12\\P-L12_game\\unity\\Assets\\Scripts\\mgame\\error\\GameTextConst.cs",
"scripts_root": "d:\\p-L12\\P-L12_game\\unity\\Assets\\Scripts"
"game_code_paths_example": {
"game_text_const": "<game_dir>/unity/Assets/Scripts/.../GameTextConst.cs",
"scripts_root": "<game_dir>/unity/Assets/Scripts"
},
"icon_resource_base": "d:\\p-L12\\P-L12_game\\unity\\Assets\\Resources\\Resources_moved\\gui\\atlas_ui"
"icon_resource_base_example": "<game_dir>/unity/Assets/Resources/Resources_moved/gui/atlas_ui"
}
+3 -2
View File
@@ -1,6 +1,7 @@
{
"description": "GameTextConst.cs 中被代码实际引用的系统提示常量",
"source_file": "d:\\p-L12\\P-L12_game\\unity\\Assets\\Scripts\\mgame\\error\\GameTextConst.cs",
"description": "GameTextConst.cs 中被代码实际引用的系统提示常量(历史项目参考)",
"source_file_example": "<game_dir>/unity/Assets/Scripts/.../GameTextConst.cs (universal_tool 自动扫描定位)",
"note": "universal_tool.parse_game_text_const 自动解析 *Const*.cs 中所有 public const string,扫描其他 .cs 确认被引用后按文本去重;本文件为历史项目的静态快照参考",
"total_referenced": 85,
"total_unique_text": 83,
"note": "85个被引用常量中,有2对文本值重复('{0}不足。' 和 '保存失败。'),去重后为83条",