private static void TreeWindow(CharaListEntry entry) { GUILayout.BeginVertical(); { entry.FolderTreeView.DrawDirectoryTree(); GUILayout.BeginVertical(GUI.skin.box, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(false)); { if (GUILayout.Button("Refresh characters")) { entry.InitCharaList(true); entry.FolderTreeView.ResetTreeCache(); entry.FolderTreeView.CurrentFolderChanged.Invoke(); } GUILayout.Space(1); if (GUILayout.Button("Current folder")) { Utils.OpenDirInExplorer(entry.CurrentFolder); } if (GUILayout.Button("Screenshot folder")) { Utils.OpenDirInExplorer(Path.Combine(AI_BrowserFolders.UserDataPath, "cap")); } if (GUILayout.Button("Main game folder")) { Utils.OpenDirInExplorer(Paths.GameRootPath); } } GUILayout.EndVertical(); } GUILayout.EndVertical(); }
public void OnGui() { var entry = _charaListEntries.Values.SingleOrDefault(x => x.isActiveAndEnabled); if (_lastEntry != null && _lastEntry != entry) { _lastEntry.FolderTreeView?.StopMonitoringFiles(); _lastEntry = null; } if (entry == null) { return; } _lastEntry = entry; var windowRect = new Rect((int)(Screen.width * 0.06f), (int)(Screen.height * 0.32f), (int)(Screen.width * 0.13f), (int)(Screen.height * 0.4f)); IMGUIUtils.DrawSolidBox(windowRect); GUILayout.Window(363, windowRect, id => TreeWindow(entry), "Select folder with cards to view"); IMGUIUtils.EatInputInRect(windowRect); }
private static void TreeWindow(CharaListEntry entry) { GUILayout.BeginVertical(); { entry.FolderTreeView.DrawDirectoryTree(); GUILayout.BeginVertical(GUI.skin.box, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(false)); { if (Overlord.DrawDefaultCardsToggle()) { entry.InitCharaList(true); } if (GUILayout.Button("Refresh characters")) { entry.InitCharaList(true); entry.FolderTreeView.ResetTreeCache(); entry.FolderTreeView.CurrentFolderChanged.Invoke(); } GUILayout.Space(1); if (GUILayout.Button("Current folder")) { Utils.OpenDirInExplorer(entry.CurrentFolder); } if (GUILayout.Button("Screenshot folder")) { Utils.OpenDirInExplorer(Path.Combine(Utils.NormalizePath(UserData.Path), "cap")); } if (GUILayout.Button("Main game folder")) { Utils.OpenDirInExplorer(Path.GetDirectoryName(Utils.NormalizePath(UserData.Path))); } } GUILayout.EndVertical(); } GUILayout.EndVertical(); }