예제 #1
0
        // Draw the text input for the mod directory,
        // as well as the directory picker button and the enter warning.
        private void DrawRootFolder()
        {
            _newModDirectory ??= Penumbra.Config.ModDirectory;

            var spacing = 3 * ImGuiHelpers.GlobalScale;

            using var group = ImRaii.Group();
            ImGui.SetNextItemWidth(_window._inputTextWidth.X - spacing - _window._iconButtonSize.X);
            var save = ImGui.InputText("##rootDirectory", ref _newModDirectory, 64, ImGuiInputTextFlags.EnterReturnsTrue);

            using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(spacing, 0));
            ImGui.SameLine();
            DrawDirectoryPickerButton();
            style.Pop();
            ImGui.SameLine();
            ImGuiUtil.LabeledHelpMarker("Root Directory", "This is where Penumbra will store your extracted mod files.\n"
                                        + "TTMP files are not copied, just extracted.\n"
                                        + "This directory needs to be accessible and you need write access here.\n"
                                        + "It is recommended that this directory is placed on a fast hard drive, preferably an SSD.\n"
                                        + "It should also be placed near the root of a logical drive - the shorter the total path to this folder, the better.\n"
                                        + "Definitely do not place it in your Dalamud directory or any sub-directory thereof.");
            group.Dispose();
            ImGui.SameLine();
            var pos = ImGui.GetCursorPosX();

            ImGui.NewLine();

            if (Penumbra.Config.ModDirectory != _newModDirectory &&
                _newModDirectory.Length != 0 &&
                DrawPressEnterWarning(_newModDirectory, Penumbra.Config.ModDirectory, pos, save))
            {
                Penumbra.ModManager.DiscoverMods(_newModDirectory);
            }
        }
예제 #2
0
    private void DrawModsTab()
    {
        if (!Penumbra.ModManager.Valid)
        {
            return;
        }

        try
        {
            using var tab = ImRaii.TabItem("Mods");
            if (!tab)
            {
                return;
            }

            _selector.Draw(GetModSelectorSize());
            ImGui.SameLine();
            using var group = ImRaii.Group();
            DrawHeaderLine();

            using var child = ImRaii.Child("##ModsTabMod", -Vector2.One, true, ImGuiWindowFlags.HorizontalScrollbar);
            if (child)
            {
                _modPanel.Draw(_selector);
            }
        }
        catch (Exception e)
        {
            PluginLog.Error($"Exception thrown during ModPanel Render:\n{e}");
            PluginLog.Error($"{Penumbra.ModManager.Count} Mods\n"
                            + $"{Penumbra.CollectionManager.Current.Name} Current Collection\n"
                            + $"{Penumbra.CollectionManager.Current.Settings.Count} Settings\n"
                            + $"{_selector.SortMode} Sort Mode\n"
                            + $"{_selector.SelectedLeaf?.Name ?? "NULL"} Selected Leaf\n"
                            + $"{_selector.Selected?.Name     ?? "NULL"} Selected Mod\n"
                            + $"{string.Join( ", ", Penumbra.CollectionManager.Current.Inheritance )} Inheritances\n"
                            + $"{_selector.SelectedSettingCollection.Name} Collection\n");
        }
    }