|
|
@@ -160,6 +160,12 @@ return aaa";
|
|
|
{
|
|
|
ChangeLuaCfg("Assets/Lua/Config/CardCfg.lua", "Assets\\Editor\\CsvToLua\\LuaCfg.lua", "Build/NewCfg/CardCfg.lua");
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ if (GUILayout.Button("合并Language"))
|
|
|
+ {
|
|
|
+ MergeLanauage("Assets/Content/Config/LanguagePackage_cn.csv", "Build/NewCfg/ROLanguagePackage_cn.csv", "Build/NewCfg/Language_merge.csv");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static string GetFilePath()
|
|
|
@@ -724,5 +730,66 @@ return aaa";
|
|
|
|
|
|
File.WriteAllLines(outputPath, rowDatas);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ struct lgInfo
|
|
|
+ {
|
|
|
+ public int index;
|
|
|
+ public int off;
|
|
|
+ }
|
|
|
+ private static void MergeLanauage(string oldPath,string newPath, string outputPath)
|
|
|
+ {
|
|
|
+ List<string> oldLg = File.ReadAllLines(oldPath).ToList();
|
|
|
+ List<string> newLg = File.ReadAllLines(newPath).ToList();
|
|
|
+ Dictionary<string, lgInfo> cfgmap = new Dictionary<string, lgInfo>();
|
|
|
+
|
|
|
+ int length = oldLg.Count;
|
|
|
+ int off = -1;
|
|
|
+ for (int i = 0; i < length; i++)
|
|
|
+ {
|
|
|
+ off = oldLg[i].IndexOf(',');
|
|
|
+
|
|
|
+ if (off < 0)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ string key = oldLg[i].Substring(0,off);
|
|
|
+
|
|
|
+ if (!cfgmap.ContainsKey(key))
|
|
|
+ {
|
|
|
+ lgInfo info = new lgInfo();
|
|
|
+ info.index = i;
|
|
|
+ info.off = off;
|
|
|
+ cfgmap.Add(key, info);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ foreach (var item in newLg)
|
|
|
+ {
|
|
|
+ if (item == "" || item == ","||item == "key"||item == "string")
|
|
|
+ continue;
|
|
|
+
|
|
|
+ off = item.IndexOf(',');
|
|
|
+ if (off < 0)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ string key = item.Substring(0,off);
|
|
|
+ if (!cfgmap.ContainsKey(key))
|
|
|
+ {
|
|
|
+ oldLg.Add(item);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lgInfo lgIf = cfgmap[key];
|
|
|
+ oldLg[lgIf.index] = item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ string data = FileHelper.CatStringArray(oldLg);
|
|
|
+ FileHelper.WirteStringToFile(outputPath, data);
|
|
|
+ }
|
|
|
+
|
|
|
}
|