Skip to content

Commit b95206e

Browse files
committed
修复多语言bug
1 parent ec3cd16 commit b95206e

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

Assets/Script/Core/Editor/Data/TableDataEditor.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,15 @@ public string OnGUI( string _chooseFileName)
6262
EditorDrawGUIUtil.RichTextSupport = true;
6363
GUILayout.Space(8);
6464
ChooseFile();
65-
GUILayout.Space(5);
66-
if (string.IsNullOrEmpty(chooseFileName))
67-
return chooseFileName;
68-
if (m_currentData == null)
65+
GUILayout.Space(9);
66+
67+
if (!string.IsNullOrEmpty(chooseFileName))
6968
{
70-
LoadData(chooseFileName);
69+
GridTopFunctionGUI();
70+
GUILayout.Space(5);
7171

72-
return chooseFileName;
72+
DrawTableDataGUI();
7373
}
74-
GridTopFunctionGUI();
75-
GUILayout.Space(5);
76-
77-
DrawTableDataGUI();
78-
GUILayout.FlexibleSpace();
79-
8074
return chooseFileName;
8175
}
8276
private string chooseFileName = "";
@@ -85,6 +79,12 @@ void ChooseFile()
8579
{
8680
GUILayout.BeginHorizontal();
8781
chooseFileName = EditorDrawGUIUtil.DrawPopup("选择文件", chooseFileName, configFileNames, LoadData);
82+
83+
if (m_currentData == null)
84+
{
85+
LoadData(chooseFileName);
86+
}
87+
8888
if (!string.IsNullOrEmpty(chooseFileName) && GUILayout.Button("删除", GUILayout.Width(60)))
8989
{
9090
if (EditorUtility.DisplayDialog("警告", "是否删除文件[" + chooseFileName + "]", "确定", "取消"))
@@ -440,7 +440,7 @@ private Vector2 GetCententSize()
440440
private string searchValue = "";
441441
private void GridTopFunctionGUI()
442442
{
443-
GUILayout.Space(4);
443+
444444
GUILayout.BeginHorizontal();
445445
if (GUILayout.Button("添加一行数据", GUILayout.Width(90)))
446446
{

Assets/Script/Core/Language/LanguageManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ public static string GetContentByKey(string fullKeyName, params object[] content
127127
for (int i = 0; i < contentParams.Length; i++)
128128
{
129129
string replaceTmp = "{" + i + "}";
130+
if (contentParams[i] == null)
131+
continue;
130132
content = content.Replace(replaceTmp, contentParams[i].ToString());
131133
}
132134
}

0 commit comments

Comments
 (0)