Просмотр исходного кода

Merge branch 'main' of ssh://192.168.0.8:29418/xianjing into hy_en

# Conflicts:
#	UserSettings/AndroidLogcatSettings.asset
gdl_123 8 месяцев назад
Родитель
Сommit
5768a02ff0

+ 68 - 1
Assets/Editor/CsvToLua/CsvToLua.cs

@@ -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);
+    }
+
 }

+ 16 - 2
Assets/Editor/UI/GenerateLuaTemple.cs

@@ -1,4 +1,4 @@
-using LuaInterface;
+using LuaInterface;
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -826,7 +826,21 @@ public class GenerateLuaTemple
             string varName = string.Empty;
             if (!bTop)
             {
-                sb.Append(string.Format("\tlocal tmp = Root:Find(\"{0}\").gameObject\r\n", name));
+                if (uiNode.IsNewNode)
+                {
+                    sb.Append(string.Format("\tlocal tmp = nil\r\n", name));
+                    sb.Append(string.Format("\tlocal tfm = Root:Find(\"{0}\")\r\n", name));
+                    sb.Append(string.Format("\tif tfm == nil then\r\n", name));
+                    sb.Append(string.Format("\t\treturn\r\n", name));
+                    sb.Append(string.Format("\telse\r\n", name));
+                    sb.Append(string.Format("\t\ttmp = tfm.gameObject\r\n", name));
+                    sb.Append(string.Format("\tend\r\n", name));
+                }
+                else
+                {
+                    sb.Append(string.Format("\tlocal tmp = Root:Find(\"{0}\").gameObject\r\n", name));
+                }
+                
 
                 if (uiNode && uiNode.enabled)
                 {

+ 12 - 0
Assets/Src/Core/DownLoad/FileHelper.cs

@@ -463,6 +463,18 @@ public class FileHelper
         }
     }
 
+
+    public static string CatStringArray(IEnumerable<string> datas)
+    {
+        StringBuilder stringBuilder = new StringBuilder();
+        foreach (var item in datas)
+        {
+            stringBuilder.Append(item);
+        }
+
+        return stringBuilder.ToString();
+    }
+
     //public static string[][] GetCsvDatas(string text)
     //{
     //    using (System.IO.StringReader stringReader = new System.IO.StringReader(text))

+ 3 - 1
Assets/Src/UI/Base/UINode.cs

@@ -1,4 +1,4 @@
-using System;
+using System;
 using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
@@ -23,6 +23,8 @@ public class UINode : MonoBehaviour
 
     public UINode[] depObjs;
 
+    public bool IsNewNode;
+
     public ActiveType activeType = ActiveType.Default;
 
     public bool GetValue(string key, out bool value)

Разница между файлами не показана из-за своего большого размера
+ 351 - 0
Build/NewCfg/ROLanguagePackage_cn.csv


+ 26 - 8
UserSettings/AndroidLogcatSettings.asset

@@ -2,23 +2,41 @@
     "m_SelectedDeviceId": "192.168.0.53:5555",
     "m_SelectedProcess": {
         "deviceId": "192.168.0.53:5555",
-        "name": "com.Runjin.Wonderland.gp",
-        "processId": 2704,
-        "exited": true
+        "name": "com.metasensor.ro.mi",
+        "processId": 4117,
+        "exited": false
     },
     "m_SelectedPriority": 0,
     "m_KnownProcessesForSerialization": [
         {
             "deviceId": "192.168.0.53:5555",
-            "name": "app.lawnchair",
-            "processId": 1600,
-            "exited": false
+            "name": "com.Runjin.Wonderland.gp",
+            "processId": 2704,
+            "exited": true
         },
         {
             "deviceId": "192.168.0.53:5555",
-            "name": "com.Runjin.Wonderland.gp",
-            "processId": 2704,
+            "name": "com.xjro.yy",
+            "processId": 2861,
+            "exited": true
+        },
+        {
+            "deviceId": "192.168.0.53:5555",
+            "name": "com.metasensor.ro.mi",
+            "processId": 2702,
+            "exited": true
+        },
+        {
+            "deviceId": "192.168.0.53:5555",
+            "name": "com.metasensor.ro.mi",
+            "processId": 3428,
             "exited": true
+        },
+        {
+            "deviceId": "192.168.0.53:5555",
+            "name": "com.metasensor.ro.mi",
+            "processId": 4117,
+            "exited": false
         }
     ],
     "m_Tags": {

Некоторые файлы не были показаны из-за большого количества измененных файлов