Skip to content

Commit e2e0a0b

Browse files
authored
Merge pull request #228 from Unity-Technologies/Uni-31847_prompt_user_for_integration_path
Uni-31847 Prompt user for integrations path
2 parents 7f174c2 + 120595b commit e2e0a0b

File tree

2 files changed

+9
-38
lines changed

2 files changed

+9
-38
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -113,42 +113,6 @@ public override void OnInspectorGUI() {
113113
EditorGUILayout.LabelField("Integration", EditorStyles.boldLabel);
114114
EditorGUI.indentLevel++;
115115

116-
GUILayout.BeginHorizontal ();
117-
EditorGUILayout.LabelField(new GUIContent (
118-
"Integrations Path:",
119-
"Installation path for 3D application integrations."), GUILayout.Width(LabelWidth - FieldOffset));
120-
121-
var IntegrationsPathLabel = ExportSettings.GetIntegrationSavePath();
122-
EditorGUILayout.SelectableLabel(IntegrationsPathLabel,
123-
EditorStyles.textField,
124-
GUILayout.MinWidth(SelectableLabelMinWidth),
125-
GUILayout.Height(EditorGUIUtility.singleLineHeight));
126-
GUILayout.EndHorizontal();
127-
GUILayout.BeginHorizontal();
128-
129-
GUILayout.Space(LabelWidth + BrowseButtonOffset);
130-
131-
if (GUILayout.Button(new GUIContent("...", "Browse to a new installation path for 3D application integrations"), EditorStyles.miniButton, GUILayout.Width(BrowseButtonWidth)))
132-
{
133-
string initialPath = ExportSettings.GetIntegrationSavePath();
134-
135-
string fullPath = EditorUtility.OpenFolderPanel(
136-
"Select Integrations Path", initialPath, null
137-
);
138-
139-
if (!string.IsNullOrEmpty(fullPath))
140-
{
141-
ExportSettings.SetIntegrationSavePath(fullPath);
142-
143-
// Make sure focus is removed from the selectable label
144-
// otherwise it won't update
145-
GUIUtility.hotControl = 0;
146-
GUIUtility.keyboardControl = 0;
147-
}
148-
}
149-
150-
GUILayout.EndHorizontal();
151-
152116
GUILayout.BeginHorizontal ();
153117
EditorGUILayout.LabelField(new GUIContent (
154118
"3D Application:",

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,15 @@ private static bool GetIntegrationFolder(DCCIntegration dcc){
757757

758758
private static bool DecompressIntegrationZipFile(string zipPath, DCCIntegration dcc)
759759
{
760-
string unzipFolder;
761-
unzipFolder = EditorTools.ExportSettings.GetIntegrationSavePath();
760+
// prompt user to enter location to unzip file
761+
var unzipFolder = EditorUtility.OpenFolderPanel(string.Format("Select Location to Save {0} Integration", dcc.DccDisplayName), EditorTools.ExportSettings.GetIntegrationSavePath(), "");
762+
if (string.IsNullOrEmpty(unzipFolder))
763+
{
764+
// user has cancelled, do nothing
765+
return false;
766+
}
767+
768+
EditorTools.ExportSettings.instance.IntegrationSavePath = unzipFolder;
762769

763770
// check that this is a valid location to unzip the file
764771
if (!DirectoryHasWritePermission (unzipFolder)) {

0 commit comments

Comments
 (0)