文字脚本自动生成

This commit is contained in:
JA
2026-06-08 10:49:52 +08:00
commit c0dfa441a5
10 changed files with 1704 additions and 0 deletions

View File

@@ -0,0 +1,108 @@
{
"description": "CSV数据源到文档章节的映射关系",
"csv_base_dir": "d:\\p-L12\\work\\cvs",
"mappings": {
"system_prompts": {
"source": "GameTextConst.cs (代码引用分析)",
"section": "一、系统提示",
"field": "常量值文本",
"filter": "仅保留在代码中被实际引用的常量(排除仅在注释中出现的)",
"dedup": "按文本值去重"
},
"quest_texts": {
"source": "quest.csv",
"section": "二、任务文本",
"field": "desc (第4列, index=3)",
"filter": "category == 1 或 category == 2",
"dedup": "按desc文本去重"
},
"achievement_texts": {
"source": "quest.csv",
"section": "三、成就文本",
"field": "desc (第4列, index=3)",
"filter": "category == 9",
"dedup": "按desc文本去重"
},
"player_names": {
"source": "原始文档固定数据 (100对姓名)",
"section": "四、玩家随机名称文本",
"format": "表格: 姓 | 名"
},
"guide_texts": {
"source": "guide.csv",
"section": "五、新手指引文本",
"field": "desc (第8列, index=7)",
"filter": "无",
"dedup": "按desc文本去重"
},
"props": {
"source": "prop.csv",
"section": "六、道具说明",
"fields": {
"name": "第3列 (index=2)",
"tips": "第7列 (index=6)",
"icon": "第8列 (index=7)"
},
"icon_dir": "atlas_product_icons",
"icon_naming": "icon_product_XX.png (XX为补零两位数, 如 icon_product_01)"
},
"skills": {
"source": "skill.csv",
"section": "七、技能",
"fields": {
"name": "第2列 (index=1)",
"icon": "第7列 (index=6)",
"desc": "第22列 (index=21)"
},
"icon_dir": "atlas_skill",
"icon_naming": "skillX.png (X为数字, 不补零, 如 skill1, skill10)"
},
"runes": {
"source": "rune.csv",
"section": "八、灵石",
"fields": {
"name": "第2列 (index=1)",
"icon": "第3列 (index=2)",
"desc": "第9列 (index=8)"
},
"icon_dir": "atlas_rune_icons",
"icon_naming": "rune_icon_X.png (X为数字, 不补零)"
},
"talents": {
"source": "playerlevel.csv",
"section": "九、天赋",
"fields": {
"name": "第14列 (index=13)",
"desc": "第15列 (index=14)",
"icon": "第16列 (index=15)"
},
"icon_dir": "atlas_talent_icons",
"icon_naming": "icon_talent_X.png (X为数字, 不补零)",
"dedup": "按name去重"
},
"equipment": {
"source": "equip.csv",
"section": "十、装备",
"fields": {
"name": "第2列 (index=1)",
"icon": "第6列 (index=5)"
},
"icon_dir": "atlas_equip_icons",
"icon_naming": "equip_icon_X.png (X为数字, 不补零)",
"dedup": "按name去重",
"note": "equip.csv无desc字段"
},
"level_names": {
"source": "fight_sample.csv",
"section": "十一、关卡名称",
"field": "name (第3列, index=2)",
"filter": "无",
"dedup": "按name去重"
}
},
"csv_format": {
"header_rows": 3,
"header_structure": "第1行:中文头, 第2行:类型定义, 第3行:英文字段名",
"encoding_note": "部分文件为GBK编码需自动检测"
}
}

View File

@@ -0,0 +1,52 @@
{
"document_title": "《不朽封仙》文字脚本",
"sections": [
{"number": "一", "title": "系统提示", "type": "numbered_list"},
{"number": "二", "title": "任务文本", "type": "numbered_list"},
{"number": "三", "title": "成就文本", "type": "numbered_list"},
{"number": "四", "title": "玩家随机名称文本", "type": "table", "columns": ["姓", "名"]},
{"number": "五", "title": "新手指引文本", "type": "numbered_list"},
{"number": "六", "title": "道具说明", "type": "table", "columns": ["道具名称", "图标", "道具描述"]},
{"number": "七", "title": "技能", "type": "table", "columns": ["技能名称", "技能图标", "技能描述"]},
{"number": "八", "title": "灵石", "type": "table", "columns": ["灵石名称", "灵石图标", "灵石介绍"]},
{"number": "九", "title": "天赋", "type": "table", "columns": ["天赋名称", "天赋图标", "天赋介绍"]},
{"number": "十", "title": "装备", "type": "table", "columns": ["装备名称", "装备图标"]},
{"number": "十一", "title": "关卡名称", "type": "numbered_list"}
],
"format_rules": {
"title": {
"font": "宋体",
"font_en": "SimSun",
"size": "二号 (22pt)",
"bold": true,
"underline": false,
"color": "黑色 (无蓝色)",
"alignment": "居中"
},
"section_heading": {
"font": "仿宋",
"font_en": "FangSong",
"size": "四号 (14pt)",
"bold": true,
"numbering": "中文数字 (一、二、三...十一)"
},
"text_content": {
"font": "仿宋",
"font_en": "FangSong",
"size": "四号 (14pt)",
"bold": false,
"numbering": "阿拉伯数字 (1. 2. 3. ...)"
},
"table_images": {
"height": "3cm",
"aspect_ratio": "锁定纵横比",
"missing_image": "留空"
}
},
"dedup_rules": {
"general": "所有文本和表格内容不得出现重复项",
"system_prompts": "GameTextConst中相同文本值的常量只保留第一个",
"talents": "天赋按name去重同一天赋在不同等级重复出现",
"equipment": "装备按name去重同一装备不同品质重复出现"
}
}

View File

@@ -0,0 +1,52 @@
{
"description": "图标资源名称到图片文件的映射规则与目录结构",
"base_dir": "d:\\p-L12\\P-L12_game\\unity\\Assets\\Resources\\Resources_moved\\gui\\atlas_ui",
"directories": {
"atlas_product_icons": {
"section": "六、道具说明",
"csv_field": "prop.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,
"missing_icons": []
},
"atlas_skill": {
"section": "七、技能",
"csv_field": "skill.csv icon (index=6)",
"naming_pattern": "skillX.png",
"naming_note": "X为数字不补零 (1-99), 如 skill1, skill10, skill99",
"file_count": 99,
"missing_icons": []
},
"atlas_rune_icons": {
"section": "八、灵石",
"csv_field": "rune.csv icon (index=2)",
"naming_pattern": "rune_icon_X.png",
"naming_note": "X为数字不补零 (1-18)",
"file_count": 12,
"missing_icons": ["rune_icon_13", "rune_icon_14", "rune_icon_15", "rune_icon_16", "rune_icon_17", "rune_icon_18"]
},
"atlas_talent_icons": {
"section": "九、天赋",
"csv_field": "playerlevel.csv icon (index=15)",
"naming_pattern": "icon_talent_X.png",
"naming_note": "X为数字不补零 (1-6)",
"file_count": 6,
"missing_icons": []
},
"atlas_equip_icons": {
"section": "十、装备",
"csv_field": "equip.csv icon (index=5)",
"naming_pattern": "equip_icon_X.png",
"naming_note": "X为数字不补零 (1-6)",
"file_count": 6,
"missing_icons": []
}
},
"image_lookup_strategy": "先直接匹配 icon_name.png若失败则对末尾数字补零至2位或3位重试",
"image_insert_rules": {
"height": "3cm",
"aspect_ratio": "锁定纵横比",
"missing_image_action": "留空单元格"
}
}

View File

@@ -0,0 +1,33 @@
{
"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"
},
"scripts": {
"xlsx_to_csv": "d:\\p-L12\\work\\py\\xlsx_to_csv.py",
"generate_doc": "d:\\p-L12\\work\\py\\generate_doc.py"
},
"dependencies": {
"python_packages": ["openpyxl", "python-docx"],
"install_commands": [
"pip install openpyxl",
"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)"
},
"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"
},
"icon_resource_base": "d:\\p-L12\\P-L12_game\\unity\\Assets\\Resources\\Resources_moved\\gui\\atlas_ui"
}

View File

@@ -0,0 +1,104 @@
{
"description": "GameTextConst.cs 中被代码实际引用的系统提示常量",
"source_file": "d:\\p-L12\\P-L12_game\\unity\\Assets\\Scripts\\mgame\\error\\GameTextConst.cs",
"total_referenced": 85,
"total_unique_text": 83,
"note": "85个被引用常量中有2对文本值重复'{0}不足。' 和 '保存失败。'去重后为83条",
"referenced_constants": {
"ErrorAlreadyClaimed": "已领取。",
"ErrorApplySuccess": "申请成功。",
"ErrorBagFull": "背包已满。",
"ErrorBreakthroughSuccess": "突破成功。",
"ErrorBuyFailed": "购买失败。",
"ErrorBuySuccess": "购买成功。",
"ErrorChallengeTimesNotEnough": "今日挑战次数不足。",
"ErrorCollectionUnlock": "请在关卡中拾取藏品解锁。",
"ErrorConditionNotMet": "条件不足。",
"ErrorCopySuccess": "复制成功。",
"ErrorCreateGuildSuccess": "创建公会成功。",
"ErrorCurrencyNotEnough": "货币不足。",
"ErrorDiamondNotEnough": "星棱幻晶不足。",
"ErrorEnergyNotEnough": "体力不足。",
"ErrorEquipBreakthroughSuccess": "装备升品成功。",
"ErrorEquipStrengthSuccess": "装备强化成功。",
"ErrorFriendAddOrNotExist": "玩家已添加或不存在。",
"ErrorFriendApplyRefuse": "已拒绝成为好友。",
"ErrorFriendApplySuccess": "已同意成为好友。",
"ErrorFusionRuneCountMax": "合成铭文所需数量已达上限。",
"ErrorFusionRuneCountNotEnough": "合成铭文所需数量不足。",
"ErrorFusionRuneNotFusion": "该铭文不能合成。",
"ErrorFusionRuneRarityNotSame": "合成铭文必须是相同稀有度。",
"ErrorGuildNameEmpty": "公会名称不能为空。",
"ErrorGuildNameTooLong": "公会名称不能超过6个字符。",
"ErrorGuildSetSuccess": "设置公会成功。",
"ErrorHeroLevelUnlock": "修士{0}级解锁。",
"ErrorHeroNotUnlock": "该伙伴尚未获得,需前往旅人驿站招募哦。",
"ErrorHeroStarUpSuccess": "升星成功。",
"ErrorInvalidGuideId": "无效的引导。",
"ErrorItemDailyUseTimesReached": "该道具今日使用次数已达上限。",
"ErrorItemNotEnough": "道具不足。",
"ErrorJoinSuccess": "加入成功。",
"ErrorLearnSuccess": "学习成功。",
"ErrorLevelNotEnough": "等级不足。",
"ErrorLevelNotExist": "关卡不存在。",
"ErrorMaterialNotEnough": "材料不足。",
"ErrorNameNotAvailable": "含有敏感字符,无法使用该名字。",
"ErrorNameOnlyChinese": "昵称只能包含中文。",
"ErrorNoFreePos": "人数已达上限。",
"ErrorNoHeroCarry": "无上阵伙伴。",
"ErrorNoHeroInTeam": "至少上阵一名修士。",
"ErrorNoPackagePurchased": "未购买礼包。",
"ErrorNoReward": "暂无奖励。",
"ErrorNotMeetClaimCondition": "暂未达到领取条件。",
"ErrorNotNewApply": "暂无新的好友申请。",
"ErrorNotPassBigBox": "请通关当前所有关卡后领取。",
"ErrorNotPassBigBoxStar": "满星通过前置关卡后解锁。",
"ErrorNotSettlementTime": "未到结算时间。",
"ErrorNotUnlock": "未解锁。",
"ErrorPassNotOpen": "关卡未开放。",
"ErrorPassNotUnlock": "通关后解锁。",
"ErrorPleaseInputName": "请输入昵称。",
"ErrorPreyFailed": "祈愿失败。",
"ErrorPushBoxLock": "通过{0}后解锁。",
"ErrorQuickSweepTimesNotEnough": "快速游历次数不足。",
"ErrorQuitGuildSuccess": "退出公会成功。",
"ErrorRefreshTimesNotEnough": "刷新次数不足。",
"ErrorRetreatNotNow": "现在还不能撤离。",
"ErrorRewardAlreadyClaimed": "您已领奖。",
"ErrorRunePutOnSuccess": "镶嵌成功。",
"ErrorRuneSlotFull": "铭文槽已满,请先卸下。",
"ErrorSaveHostage": "解救{0}个人质后解锁。",
"ErrorSaveSuccess": "保存成功。",
"ErrorScoreNotEnough": "积分不足。",
"ErrorSendGiftSuccess": "赠送成功",
"ErrorSetSuccess": "修改成功。",
"ErrorSomethingNotEnough": "{0}不足。",
"ErrorTakesuccess": "领取成功。",
"ErrorTargetNotEnough": "{0}不足。",
"ErrorTaskFailed": "领取失败。",
"ErrorTaskNotFinish": "任务未完成。",
"ErrorTaskRewardNotClaimed": "任务奖励未领取。",
"ErrorTimesNotEnough": "次数不足。",
"ErrorTitleNotUnlock": "称号未解锁。",
"ErrorUpLevelFirst": "请先升级。",
"ErrorUpLevelSuccess": "升级成功。",
"ErrorUpStage1First": "请先升品。",
"ErrorUpStageFirst": "请先升阶。",
"ErrorUpStageSuccess": "升阶成功。",
"ErrorUpStrengthFirst": "请先强化。",
"ErrorVipLevelNotEnough": "权益等级不足。",
"TipChallengeTimesConfirm": "\u3000是否消耗{0}进行挑战。\n\u3000今日剩余<color=#19F45C>{1}</color>/{2})次。",
"TipFusionSuccess": "合成成功。"
},
"duplicates_removed": [
{"kept": "ErrorTargetNotEnough", "removed": "ErrorSomethingNotEnough", "text": "{0}不足。"},
{"kept": "ErrorBuyFailed", "removed": "ErrorSaveFailed", "text": "保存失败。"}
],
"unreferenced_constants": [
"ErrorUseFailed", "ErrorStrengthLimit", "ErrorRecruitTimesNotEnough",
"ErrorRecruitTicketNotEnough", "ErrorRecruitDiamondNotEnough",
"ErrorUpStarFirst", "ErrorUpStrengthFirst", "ErrorTujianProgressNotEnough",
"ErrorHeroMaxCountReached", "ErrorNoHeroToCombine", "ErrorStrengthSuccess",
"ErrorSaveFailed", "ErrorInvalidId", "ErrorReceiveConditionNotMet"
]
}