示例#1
0
        private static void RefreshCurrentWindow()
        {
            var visibleWindow = IsVisible();

            _lastVisibleWindow = visibleWindow;
            var resetTree = false;

            if (visibleWindow == VisibleWindow.Load)
            {
                if (_charaLoad != null)
                {
                    _charaLoad.charaLists.Clear();
                    // can we pass _charaLoad.charaLists directly rather than allocating new list and assigning?
                    var list = new List <GameCharaFileInfo>();
                    GameCharaFileInfoAssist.AddList(list, _folderTreeView.CurrentFolder, 0, (byte)1, true, true, false,
                                                    false, true, false);
                    _charaLoad.charaLists = list;

                    _charaLoad.ReDrawListView();

                    resetTree = true;
                }
            }

            if (resetTree)
            {
                _folderTreeView.ResetTreeCache();
            }
        }
示例#2
0
        private static void RefreshCurrentWindow()
        {
            var visibleWindow = IsVisible();

            _lastRefreshed = visibleWindow;
            var resetTree = false;

            switch (visibleWindow)
            {
            case VisibleWindow.Load:
                if (_charaLoad != null)
                {
                    _charaLoad.UpdateClothesList();
                    resetTree = true;
                }
                break;

            case VisibleWindow.Save:
                if (_charaSave != null)
                {
                    _charaSave.UpdateClothesList();
                    resetTree = true;
                }
                break;
            }

            // clear tree cache
            if (resetTree)
            {
                _folderTreeView.ResetTreeCache();
            }
        }
示例#3
0
        private static void TreeWindow(int id)
        {
            GUILayout.BeginVertical();
            {
                _folderTreeView.DrawDirectoryTree();

                GUILayout.BeginVertical(GUI.skin.box, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(false));
                {
                    if (GUILayout.Button("Refresh thumbnails"))
                    {
                        _folderTreeView?.ResetTreeCache();
                        RefreshCurrentWindow();
                    }

                    GUILayout.Space(1);

                    if (GUILayout.Button("Current folder"))
                    {
                        Utils.OpenDirInExplorer(_folderTreeView.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();
        }
示例#4
0
        private static void TreeWindow(int id)
        {
            GUILayout.BeginHorizontal();
            {
                _folderTreeView.DrawDirectoryTree();

                GUILayout.BeginVertical(GUI.skin.box, GUILayout.Width(200));
                {
                    if (GUILayout.Button("Refresh scene thumbnails"))
                    {
                        _folderTreeView?.ResetTreeCache();
                        OnFolderChanged();
                    }

                    GUILayout.FlexibleSpace();

                    if (GUILayout.Button("Open current folder in explorer"))
                    {
                        Utils.OpenDirInExplorer(_folderTreeView.CurrentFolder);
                    }
                    if (GUILayout.Button("Open screenshot folder in explorer"))
                    {
                        Utils.OpenDirInExplorer(Path.Combine(AI_BrowserFolders.UserDataPath, "cap"));
                    }
                    if (GUILayout.Button("Open character folder in explorer"))
                    {
                        Utils.OpenDirInExplorer(Path.Combine(AI_BrowserFolders.UserDataPath, "chara"));
                    }
                    if (GUILayout.Button("Open main game folder in explorer"))
                    {
                        Utils.OpenDirInExplorer(Paths.GameRootPath);
                    }
                }
                GUILayout.EndVertical();
            }
            GUILayout.EndHorizontal();
        }