Skip to content

Commit 627e2bb

Browse files
committed
allow setting export button name
- should say "convert" when converting to linked prefab
1 parent b187725 commit 627e2bb

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Assets/FbxExporters/Editor/ConvertToPrefabEditorWindow.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ namespace Editor
1212
{
1313
public class ConvertToPrefabEditorWindow : ExportOptionsEditorWindow
1414
{
15-
protected override GUIContent m_windowTitle { get { return new GUIContent ("Convert Options"); }}
15+
protected override GUIContent WindowTitle { get { return new GUIContent ("Convert Options"); }}
1616
protected override float MinWindowHeight { get { return 280; } }
17+
protected override string ExportButtonName { get { return "Convert"; } }
1718
private GameObject[] m_toConvert;
1819
private string m_prefabFileName = "";
1920

@@ -94,7 +95,12 @@ protected override void CreateCustomUI ()
9495
"Filename to save prefab to."),GUILayout.Width(LabelWidth-FieldOffset));
9596

9697
EditorGUI.BeginDisabledGroup (DisableNameSelection());
97-
m_prefabFileName = EditorGUILayout.TextField (m_prefabFileName);
98+
var textFieldStyle = new GUIStyle (EditorStyles.textField);
99+
// increase padding to match filename text field
100+
var padding = textFieldStyle.padding;
101+
padding.left = padding.left + 3;
102+
textFieldStyle.padding = padding;
103+
m_prefabFileName = EditorGUILayout.TextField (m_prefabFileName, textFieldStyle);
98104
m_prefabFileName = ModelExporter.ConvertToValidFilename (m_prefabFileName);
99105
EditorGUI.EndDisabledGroup ();
100106
GUILayout.EndHorizontal ();

Assets/FbxExporters/Editor/ExportModelEditorWindow.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ public abstract class ExportOptionsEditorWindow : EditorWindow
2121
protected const float FbxExtOffset = -7;
2222
protected virtual float MinWindowHeight { get { return 250; } }
2323

24-
protected virtual GUIContent m_windowTitle { get { return new GUIContent (DefaultWindowTitle); } }
24+
protected virtual string ExportButtonName { get { return "Export"; } }
25+
26+
protected virtual GUIContent WindowTitle { get { return new GUIContent (DefaultWindowTitle); } }
2527

2628
protected string m_exportFileName = "";
2729
protected ModelExporter.AnimationExportType m_animExportType = ModelExporter.AnimationExportType.all;
@@ -68,7 +70,7 @@ protected virtual void InitializeWindow(string filename = "", bool singleHierarc
6870
}
6971

7072
private void SetTitle(){
71-
this.titleContent = m_windowTitle;
73+
this.titleContent = WindowTitle;
7274
}
7375

7476
protected void InitializeReceiver(){
@@ -234,7 +236,7 @@ protected void OnGUI ()
234236
this.Close ();
235237
}
236238

237-
if (GUILayout.Button ("Export", GUILayout.Width(ExportButtonWidth))) {
239+
if (GUILayout.Button (ExportButtonName, GUILayout.Width(ExportButtonWidth))) {
238240
Export ();
239241
this.Close ();
240242
}

0 commit comments

Comments
 (0)