- 添加对话表结构
- 调整部分类的命名空间 - 引入 EnumUtility 用于string与enum的转换
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
# 对话标识表 筛选用数据
|
||||
# Id Title UIMode ChapterId
|
||||
# int string DialogUIMode int
|
||||
# 对话编号 策划备注 对话标识 对话形式 章节编号
|
||||
1001 第一章介绍 Chapter1_Intro Mask 1.001
|
||||
1002 第一章主流程 Chapter1_Main BottomBox 1.002
|
||||
1003 第一章玩法开始前闲聊 Chapter1_SmallTalk1 BubbleBox 1.003
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
# 对话内容表 筛选用数据
|
||||
# Id SpeakerId Expression SpeakerName Direction Text Emphasis ChapterId DialogId
|
||||
# int int ExpressionType string int string EmphasisType int int
|
||||
# 对话行编号 策划备注 说话人Id 表情 显示人名 说话朝向 说话内容 演出效果 章节Id 对话Id
|
||||
100100001 Id规则为 Null Null Null 0 相传。 1.00100001 1001.00001
|
||||
100100002 第1位数为章节Id Null Null Null 0 Mask。 1.00100002 1001.00002
|
||||
100100003 第2-4位数为对话Id Null Null Null 0 很好。 1.00100003 1001.00003
|
||||
100200001 第5-9位数为对话行Id Xu Normal 徐晟壹 0 你好,王。 1.00200001 1002.00001
|
||||
100200002 Wang Normal 王可嘉 1 你好,徐。 1.00200002 1002.00002
|
||||
100200003 Master Normal 李诫 1 你们好。 1.00200003 1002.00003
|
||||
100300001 Npc1 Null Null 0 这人谁啊? 1.00300001 1003.00001
|
||||
100300002 Npc2 Null Null 0 不知道啊? 1.00300002 1003.00002
|
||||
100300003 Npc1 Null Null 0 不知道你在这干嘛。 1.00300003 1003.00003
|
||||
Binary file not shown.
@@ -5,4 +5,3 @@
|
||||
1 菜单场景 Menu 1
|
||||
2 战斗场景 Main 2
|
||||
3 压力测试场景 StressTest 0
|
||||
4 玩法A测试场景 GameplayA 0
|
||||
@@ -6,4 +6,3 @@
|
||||
100 主菜单 MenuForm Default False True
|
||||
101 设置 SettingForm Default False True
|
||||
102 关于 AboutForm Default False True
|
||||
103 ºËÐÄÍæ·¨A MVC²âÊÔ½çÃæ CoreGameplayAMvcForm Default False True
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
# 武器表
|
||||
# Id Attack AttackInterval BulletId BulletSpeed BulletSoundId
|
||||
# int int float int float int
|
||||
# 武器编号 策划备注 攻击力 攻击间隔 子弹编号 子弹速度 子弹声音编号
|
||||
30000 玩家武器 100 0.2 50000 20 10000
|
||||
Binary file not shown.
+29
-21
@@ -1,45 +1,53 @@
|
||||
import pandas as pd
|
||||
import os
|
||||
import os
|
||||
import shutil
|
||||
|
||||
import pandas as pd
|
||||
|
||||
|
||||
def convert_excel_to_txt(folder_path='.'):
|
||||
# 计数器,用于最后汇总
|
||||
# 计数器,用于最后统计
|
||||
count = 0
|
||||
target_dir = os.path.join(os.path.dirname(__file__), '../Assets/GameMain/DataTables')
|
||||
target_dir = os.path.abspath(target_dir)
|
||||
|
||||
|
||||
# 确保目标目录存在
|
||||
os.makedirs(target_dir, exist_ok=True)
|
||||
|
||||
for file_name in os.listdir(folder_path):
|
||||
if file_name.endswith(('.xlsx', '.xls')):
|
||||
file_path = os.path.join(folder_path, file_name)
|
||||
|
||||
for root, _, files in os.walk(folder_path):
|
||||
for file_name in files:
|
||||
if not file_name.lower().endswith(('.xlsx', '.xls')):
|
||||
continue
|
||||
# 跳过 Excel 临时锁文件
|
||||
if file_name.startswith('~$'):
|
||||
continue
|
||||
|
||||
file_path = os.path.join(root, file_name)
|
||||
base_name = os.path.splitext(file_path)[0]
|
||||
output_file = base_name.replace(os.path.basename(base_name), os.path.basename(base_name)) + '.txt'
|
||||
|
||||
print(f"正在处理: {file_name}...")
|
||||
|
||||
output_file = base_name + '.txt'
|
||||
|
||||
print(f"正在处理: {file_path}...")
|
||||
|
||||
try:
|
||||
df = pd.read_excel(file_path, header=None)
|
||||
|
||||
|
||||
df.to_csv(output_file, sep='\t', index=False, header=False, encoding='utf-8')
|
||||
|
||||
|
||||
# 复制文件到目标目录
|
||||
target_file = os.path.join(target_dir, os.path.basename(output_file))
|
||||
shutil.copy2(output_file, target_file)
|
||||
|
||||
|
||||
print(f"成功转换 -> {output_file}")
|
||||
print(f"已复制到 -> {target_file}")
|
||||
count += 1
|
||||
|
||||
|
||||
except Exception as e:
|
||||
print(f"处理 {file_name} 时出错: {e}")
|
||||
print(f"处理 {file_path} 时出错: {e}")
|
||||
|
||||
print(f"\n任务完成!共转换了 {count} 个文件。")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
convert_excel_to_txt('.')
|
||||
|
||||
# --- 关键修改:在这里添加暂停 ---
|
||||
print("\n" + "="*30)
|
||||
input("按回车键(Enter)退出程序...")
|
||||
|
||||
print("\n" + "=" * 30)
|
||||
input("按回车键(Enter)退出程序...")
|
||||
|
||||
Reference in New Issue
Block a user