提交修改
This commit is contained in:
@@ -492,6 +492,48 @@ public static class ConfigLinkDatabase
|
||||
_tableInfoCache = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有缺少中文配置的表(displayName == name 或 description 为空)
|
||||
/// </summary>
|
||||
public static List<ConfigTableInfo> GetTablesMissingChineseConfig()
|
||||
{
|
||||
return GetAllTableInfo().Where(table =>
|
||||
string.IsNullOrEmpty(table.displayName) ||
|
||||
table.displayName.Equals(table.tableName, StringComparison.OrdinalIgnoreCase) ||
|
||||
string.IsNullOrEmpty(table.description)
|
||||
).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查是否存在缺少中文配置的表
|
||||
/// </summary>
|
||||
public static bool HasTablesMissingChineseConfig()
|
||||
{
|
||||
return GetTablesMissingChineseConfig().Count > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 输出缺少中文配置的表信息到控制台
|
||||
/// </summary>
|
||||
public static void LogMissingChineseConfig()
|
||||
{
|
||||
var missingTables = GetTablesMissingChineseConfig();
|
||||
if (missingTables.Count == 0)
|
||||
{
|
||||
Debug.Log("[ConfigLinkViewer] 所有表均已配置中文名称和描述");
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine($"[ConfigLinkViewer] 发现 {missingTables.Count} 个表缺少中文配置:");
|
||||
foreach (var table in missingTables)
|
||||
{
|
||||
sb.AppendLine($" - {table.tableName}: displayName='{table.displayName}', description='{table.description}'");
|
||||
}
|
||||
sb.AppendLine("建议使用智能体辅助补充中文配置。");
|
||||
Debug.Log(sb.ToString());
|
||||
}
|
||||
|
||||
private static void LoadSettings()
|
||||
{
|
||||
if (_settings != null) return;
|
||||
|
||||
@@ -403,14 +403,17 @@ public class ConfigLinkViewerWindow : EditorWindow
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginHorizontal(GUILayout.ExpandHeight(true));
|
||||
float innerHeight = windowHeight - 80; // 减去头部和边距
|
||||
|
||||
EditorGUILayout.BeginHorizontal(GUILayout.Height(innerHeight));
|
||||
|
||||
float leftPanelWidth = Mathf.Clamp(windowWidth * 0.3f, 180f, 300f);
|
||||
float rightPanelWidth = windowWidth - leftPanelWidth - 20f;
|
||||
|
||||
EditorGUILayout.BeginVertical(GUILayout.Width(leftPanelWidth), GUILayout.ExpandHeight(true));
|
||||
EditorGUILayout.BeginVertical(GUILayout.Width(leftPanelWidth));
|
||||
EditorGUILayout.LabelField($"配置表列表 ({filteredTables.Count}):", EditorStyles.miniBoldLabel);
|
||||
relationScrollPos = EditorGUILayout.BeginScrollView(relationScrollPos, false, true, GUILayout.ExpandHeight(true));
|
||||
float scrollHeight = innerHeight - 40; // 减去标签高度和边距
|
||||
relationScrollPos = EditorGUILayout.BeginScrollView(relationScrollPos, false, true, GUILayout.Height(scrollHeight));
|
||||
|
||||
GUIStyle listButtonStyle = new GUIStyle(EditorStyles.label) { wordWrap = false, stretchWidth = true };
|
||||
|
||||
@@ -432,9 +435,9 @@ public class ConfigLinkViewerWindow : EditorWindow
|
||||
EditorGUILayout.EndScrollView();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.BeginVertical(GUILayout.Width(rightPanelWidth), GUILayout.ExpandHeight(true));
|
||||
EditorGUILayout.BeginVertical(GUILayout.Width(rightPanelWidth));
|
||||
EditorGUILayout.LabelField("当前表详情:", EditorStyles.miniBoldLabel);
|
||||
detailScrollPos = EditorGUILayout.BeginScrollView(detailScrollPos, false, true, GUILayout.ExpandHeight(true));
|
||||
detailScrollPos = EditorGUILayout.BeginScrollView(detailScrollPos, false, true, GUILayout.Height(scrollHeight));
|
||||
DrawCurrentTableInfo(rightPanelWidth);
|
||||
EditorGUILayout.EndScrollView();
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
@@ -665,12 +665,31 @@ def main():
|
||||
print(" AI 补全提示词(可复制发送给 AI)")
|
||||
print("=" * 60)
|
||||
print()
|
||||
print("请帮我补全以下配置表联动关系配置:")
|
||||
print("我需要你帮助维护配置表联动查看器的配置文件。")
|
||||
print()
|
||||
print(f"当前目录:{output_file.parent}")
|
||||
print()
|
||||
print("请:")
|
||||
print("1. 读取 ConfigLinkData.json,分析所有表的配置情况")
|
||||
print("2. 找出缺少中文名称(displayName == name)或描述为空的表,补充中文名称和描述")
|
||||
print("3. 分析字段引用关系,为缺少联动关系的表添加 relations")
|
||||
print("4. 对于 target_id 字段,通常引用对应的基础表(如 herolevel.target_id -> hero)")
|
||||
print("5. 对于 xxxId/xxx_id 字段,根据前缀推断目标表(如 itemId -> prop)")
|
||||
print("6. 同时更新 table_info.json(中文名称)和 ConfigLinkData.json(完整配置)")
|
||||
print("7. 输出修改摘要")
|
||||
print()
|
||||
print("需要处理的内容:")
|
||||
print()
|
||||
for part in ai_prompt_parts:
|
||||
print(part)
|
||||
print()
|
||||
print("请直接返回修改后的 JSON 配置。")
|
||||
print("注意:")
|
||||
print("- displayName 应该是简洁的中文名称(如\"英雄\"、\"装备\")")
|
||||
print("- description 应该是清晰的功能描述(如\"英雄基础属性配置\")")
|
||||
print("- relations 字段格式:{\"field\": \"字段名\", \"target\": \"目标表名\", \"targetField\": \"id\", \"description\": \"关联描述\"}")
|
||||
print("- 保持 JSON 格式正确,不要添加多余逗号")
|
||||
print("- table_info.json 只需更新 displayName 和 description")
|
||||
print("- ConfigLinkData.json 需要更新 displayName、description 和 relations")
|
||||
|
||||
print()
|
||||
|
||||
|
||||
@@ -80,6 +80,15 @@
|
||||
{"name": "trainbreak", "displayName": "训练突破", "description": "训练突破阶段配置"},
|
||||
{"name": "trainlevel", "displayName": "训练等级", "description": "训练等级属性配置"},
|
||||
{"name": "vip", "displayName": "VIP", "description": "VIP等级特权配置"},
|
||||
{"name": "dirty_words", "displayName": "敏感词", "description": "敏感词过滤库"}
|
||||
{"name": "dirty_words", "displayName": "敏感词", "description": "敏感词过滤库"},
|
||||
{"name": "bigmap", "displayName": "大地图", "description": "大地图配置"},
|
||||
{"name": "collect", "displayName": "收集", "description": "收集系统配置"},
|
||||
{"name": "droplevel", "displayName": "掉落等级", "description": "掉落等级配置"},
|
||||
{"name": "dropLib", "displayName": "掉落库", "description": "掉落库配置"},
|
||||
{"name": "equipblocklevel", "displayName": "装备格挡等级", "description": "装备格挡等级配置"},
|
||||
{"name": "pet", "displayName": "宠物", "description": "宠物基础属性配置"},
|
||||
{"name": "petlevel", "displayName": "宠物等级", "description": "宠物等级成长属性配置"},
|
||||
{"name": "talent", "displayName": "天赋", "description": "天赋系统配置"},
|
||||
{"name": "talentlevel", "displayName": "天赋等级", "description": "天赋等级属性配置"}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user