|
|
@@ -574,7 +574,7 @@ return aaa";
|
|
|
private static void CheckLauCfg_CS(List<CfgLanguageCfg> cfg, string path, Dictionary<string, LanguageCfg> language, string outputPath)
|
|
|
{
|
|
|
string[] rowDatas = File.ReadAllLines(path);
|
|
|
-
|
|
|
+ bool iswrite = true;
|
|
|
using (LuaState runTime = new LuaState())
|
|
|
{
|
|
|
runTime.Start();
|
|
|
@@ -584,7 +584,10 @@ return aaa";
|
|
|
for (int i = 0; i < cfg.Count; i++)
|
|
|
{
|
|
|
if (cfg[i].Enable == 0)
|
|
|
+ {
|
|
|
+ iswrite = false;
|
|
|
continue;
|
|
|
+ }
|
|
|
string value = luatable.RawGet<string, string>(cfg[i].Field);
|
|
|
if (string.IsNullOrEmpty(value))
|
|
|
{
|
|
|
@@ -607,11 +610,12 @@ return aaa";
|
|
|
SetLuaLine(rowDatas, id, cfg[i].Field, key);
|
|
|
if (value.Contains("\n"))
|
|
|
{
|
|
|
- Debug.Log(value);
|
|
|
+ //Debug.Log(value);
|
|
|
value = value.Replace("\n", "\\n");
|
|
|
- Debug.Log(value);
|
|
|
+ //Debug.Log(value);
|
|
|
}
|
|
|
- language.Add(key, new LanguageCfg() { key = key, Language = value });
|
|
|
+ if(!language.ContainsKey(key))
|
|
|
+ language.Add(key, new LanguageCfg() { key = key, Language = value });
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -619,8 +623,8 @@ return aaa";
|
|
|
});
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- File.WriteAllLines(outputPath,rowDatas);
|
|
|
+ if (iswrite)
|
|
|
+ File.WriteAllLines(outputPath,rowDatas);
|
|
|
|
|
|
}
|
|
|
|