private void DrawAudioArea() { //Remove request if completed if (request != null && request.status == AsyncRequest.Status.Completed) { request = null; } //Draw pending message or dowload progress bar if (request != null && !request.isDone) { if (request.status != AsyncRequest.Status.Downloading) { GUILayout.Space(4); Utils.DrawPendingLabel("Pending..."); GUILayout.Space(-10); Utils.DrawSeparator(); GUILayout.Space(-5); } else { GUILayout.Space(10); Rect rect = GUILayoutUtility.GetRect(Screen.width, 30); float progress = request.downloadProgress; EditorGUI.ProgressBar(rect, progress, "Download : " + Mathf.RoundToInt(progress * 100) + "%"); } } //Draw Audio preview else if (clip.clip != null) { DrawAudioPlayer(); } //Draw commands GUILayout.Space(5); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (request != null) { if (GUILayout.Button("Show pending list")) { Resemble_Window.Open(Resemble_Window.Tab.Pool); } if (clip.clip != null && GUILayout.Button("Select placeholder")) { EditorGUIUtility.PingObject(clip.clip); Selection.activeObject = clip.clip; } } else if (clip.clip != null) { if (GUILayout.Button("Select file")) { EditorGUIUtility.PingObject(clip.clip); Selection.activeObject = clip.clip; } } GUILayout.EndHorizontal(); }
private void DrawOptionsSettingsGUI() { //Update settings GUILayout.Label("Update", Styles.header); bool drawRefreshButton = true; switch (Updates.status) { case Updates.Status.unknown: Updates.CheckStatus(); Utils.DrawPendingLabel("Checking..."); drawRefreshButton = false; break; case Updates.Status.checking: Utils.DrawPendingLabel("Checking..."); drawRefreshButton = false; break; case Updates.Status.error: Utils.BoxWithLink("Unable to check for updates. Check your internet connection or update manually.", "Github page", WebPage.PluginGithub, MessageType.Error); break; case Updates.Status.updated: GUILayout.Label("Your plugin is up to date."); break; case Updates.Status.outdated: GUILayout.Label("Your plugin is out of date."); if (GUILayout.Button("Update")) { Updates.Update(); } EditorGUILayout.HelpBox("An outdated plugin may not work. It is strongly recommended to keep the plugin up to date.", MessageType.Warning); break; default: break; } GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (drawRefreshButton && GUILayout.Button("Refresh")) { Updates.CheckStatus(); } if (Updates.status == Updates.Status.updated && GUILayout.Button("Reimport")) { Updates.Update(); } GUILayout.EndHorizontal(); //Path settings Utils.DrawSeparator(); GUILayout.Space(20); GUILayout.Label(new GUIContent("Paths", "Describe where AudioClips from CharacterSets should be generated."), Styles.header); //Path methode Settings.pathMethode = (Settings.PathMethode)EditorGUILayout.EnumPopup( pathMethode, Settings.pathMethode); //Target folders fields switch (Settings.pathMethode) { case Settings.PathMethode.Absolute: Settings.folderPathA = FolderField("Target folder", Settings.folderPathA); break; case Settings.PathMethode.SamePlace: break; case Settings.PathMethode.MirrorHierarchy: Settings.folderPathB = FolderField("Resemble Speechs root", Settings.folderPathB); Settings.folderPathA = FolderField("AudioClips root", Settings.folderPathA); break; } //Use subFolders Settings.useSubDirectory = EditorGUILayout.Toggle(useSubFolder, Settings.useSubDirectory); //Draw example image Texture image = Resources.instance.pathImages[(int)Settings.pathMethode * 2 + (Settings.useSubDirectory ? 1 : 0)]; Rect rect = GUILayoutUtility.GetAspectRect(image.width / image.height); GUI.Label(rect, image); //Generation settings Utils.DrawSeparator(); GUILayout.Space(20); GUILayout.Label("Generation", Styles.header); Settings.forceGeneration = !EditorGUILayout.Toggle( new GUIContent("Bypass if unchanged", "Bypass the generation if the clip is similar to the api one and just download the existing clip."), !Settings.forceGeneration); GUILayout.Space(10); }