コード例 #1
0
        // Draw a tab to iterate over the main resource maps and see what resources are currently loaded.
        public void Draw()
        {
            if (!Penumbra.Config.DebugMode)
            {
                return;
            }

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

            // Filter for resources containing the input string.
            ImGui.SetNextItemWidth(-1);
            ImGui.InputTextWithHint("##resourceFilter", "Filter...", ref _resourceManagerFilter, Utf8GamePath.MaxGamePathLength);

            using var child = ImRaii.Child("##ResourceManagerTab", -Vector2.One);
            if (!child)
            {
                return;
            }

            unsafe
            {
                ResourceLoader.IterateGraphs(DrawCategoryContainer);
            }
        }
コード例 #2
0
        public void Draw()
        {
            using var tab = ImRaii.TabItem("Collections");
            if (!tab)
            {
                return;
            }

            DrawCharacterCollectionSelectors();
            DrawMainSelectors();
        }
コード例 #3
0
    private void DrawMaterialChangeTab()
    {
        using var tab = ImRaii.TabItem("Model Materials");
        if (!tab)
        {
            return;
        }

        if (_editor !.ModelFiles.Count == 0)
        {
            ImGui.NewLine();
            ImGui.TextUnformatted("No .mdl files detected.");
        }
コード例 #4
0
ファイル: ModEditWindow.Meta.cs プロジェクト: xivdev/Penumbra
    private void DrawMetaTab()
    {
        using var tab = ImRaii.TabItem("Meta Manipulations");
        if (!tab)
        {
            return;
        }

        DrawOptionSelectHeader();

        var setsEqual = !_editor !.Meta.Changes;
        var tt        = setsEqual ? "No changes staged." : "Apply the currently staged changes to the option.";

        ImGui.NewLine();
        if (ImGuiUtil.DrawDisabledButton("Apply Changes", Vector2.Zero, tt, setsEqual))
        {
            _editor.ApplyManipulations();
        }

        ImGui.SameLine();
        tt = setsEqual ? "No changes staged." : "Revert all currently staged changes.";
        if (ImGuiUtil.DrawDisabledButton("Revert Changes", Vector2.Zero, tt, setsEqual))
        {
            _editor.RevertManipulations();
        }

        ImGui.SameLine();
        AddFromClipboardButton();
        ImGui.SameLine();
        SetFromClipboardButton();
        ImGui.SameLine();
        CopyToClipboardButton("Copy all current manipulations to clipboard.", _iconSize, _editor.Meta.Recombine());

        using var child = ImRaii.Child("##meta", -Vector2.One, true);
        if (!child)
        {
            return;
        }

        DrawEditHeader(_editor.Meta.Eqp, "Equipment Parameter Edits (EQP)###EQP", 5, EqpRow.Draw, EqpRow.DrawNew);
        DrawEditHeader(_editor.Meta.Eqdp, "Racial Model Edits (EQDP)###EQDP", 7, EqdpRow.Draw, EqdpRow.DrawNew);
        DrawEditHeader(_editor.Meta.Imc, "Variant Edits (IMC)###IMC", 9, ImcRow.Draw, ImcRow.DrawNew);
        DrawEditHeader(_editor.Meta.Est, "Extra Skeleton Parameters (EST)###EST", 7, EstRow.Draw, EstRow.DrawNew);
        DrawEditHeader(_editor.Meta.Gmp, "Visor/Gimmick Edits (GMP)###GMP", 7, GmpRow.Draw, GmpRow.DrawNew);
        DrawEditHeader(_editor.Meta.Rsp, "Racial Scaling Edits (RSP)###RSP", 5, RspRow.Draw, RspRow.DrawNew);
    }
コード例 #5
0
        // Draw a tab by given name if it is available, and deal with changing the preferred tab.
        private ImRaii.IEndObject DrawTab(Utf8String name, Tabs flag)
        {
            if (!_availableTabs.HasFlag(flag))
            {
                return(ImRaii.IEndObject.Empty);
            }

            var flags = _preferredTab == flag ? ImGuiTabItemFlags.SetSelected : ImGuiTabItemFlags.None;

            unsafe
            {
                var tab = ImRaii.TabItem(name.Path, flags);
                if (ImGui.IsItemClicked())
                {
                    _preferredTab = flag;
                }

                return(tab);
            }
        }
コード例 #6
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");
        }
    }
コード例 #7
0
        // Draw the effective tab if ShowAdvanced is on.
        public void Draw()
        {
            if (!Penumbra.Config.ShowAdvanced)
            {
                return;
            }

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

            SetupEffectiveSizes();
            DrawFilters();
            using var child = ImRaii.Child("##EffectiveChangesTab", -Vector2.One, false);
            if (!child)
            {
                return;
            }

            var height = ImGui.GetTextLineHeightWithSpacing() + 2 * ImGui.GetStyle().CellPadding.Y;
            var skips  = ImGuiClip.GetNecessarySkips(height);

            using var table = ImRaii.Table("##EffectiveChangesTable", 3, ImGuiTableFlags.RowBg);
            if (!table)
            {
                return;
            }

            ImGui.TableSetupColumn("##gamePath", ImGuiTableColumnFlags.WidthFixed, _effectiveLeftTextLength);
            ImGui.TableSetupColumn(string.Empty, ImGuiTableColumnFlags.WidthFixed, _effectiveArrowLength);
            ImGui.TableSetupColumn("##file", ImGuiTableColumnFlags.WidthFixed, _effectiveRightTextLength);

            DrawEffectiveRows(Penumbra.CollectionManager.Current, skips, height,
                              _effectiveFilePathFilter.Length > 0 || _effectiveGamePathFilter.Length > 0);
        }
コード例 #8
0
        public void Draw()
        {
            if (!Penumbra.Config.DebugMode)
            {
                return;
            }

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

            using var child = ImRaii.Child("##DebugTab", -Vector2.One);
            if (!child)
            {
                return;
            }

            DrawDebugTabGeneral();
            ImGui.NewLine();
            DrawDebugTabReplacedResources();
            ImGui.NewLine();
            DrawPathResolverDebug();
            ImGui.NewLine();
            DrawDebugCharacterUtility();
            ImGui.NewLine();
            DrawDebugResidentResources();
            ImGui.NewLine();
            DrawResourceProblems();
            ImGui.NewLine();
            DrawPlayerModelInfo();
            ImGui.NewLine();
            DrawDebugTabIpc();
            ImGui.NewLine();
        }
コード例 #9
0
        public void Draw()
        {
            using var tab = ImRaii.TabItem("Settings");
            if (!tab)
            {
                return;
            }

            using var child = ImRaii.Child("##SettingsTab", -Vector2.One, false);
            if (!child)
            {
                return;
            }

            DrawEnabledBox();
            DrawShowAdvancedBox();
            Checkbox("Fix Main Window", "Prevent the main window from being resized or moved.", Penumbra.Config.FixMainWindow, v =>
            {
                Penumbra.Config.FixMainWindow = v;
                _window.Flags = v
                    ? _window.Flags | ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize
                    : _window.Flags & ~(ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize);
            });

            ImGui.NewLine();
            DrawRootFolder();
            DrawRediscoverButton();
            ImGui.NewLine();

            DrawModSelectorSettings();
            DrawColorSettings();
            DrawAdvancedSettings();

            _dialogManager.Draw();
            DrawSupportButtons();
        }
コード例 #10
0
    // Draw a simple clipped table containing all changed items.
    private void DrawChangedItemTab()
    {
        // Functions in here for less pollution.
        bool FilterChangedItem(KeyValuePair <string, (SingleArray <IMod>, object?)> item)
        => (_changedItemFilter.IsEmpty ||
            ChangedItemName(item.Key, item.Value.Item2)
            .Contains(_changedItemFilter.Lower, StringComparison.InvariantCultureIgnoreCase)) &&
        (_changedItemModFilter.IsEmpty || item.Value.Item1.Any(m => m.Name.Contains(_changedItemModFilter)));

        void DrawChangedItemColumn(KeyValuePair <string, (SingleArray <IMod>, object?)> item)
        {
            ImGui.TableNextColumn();
            DrawChangedItem(item.Key, item.Value.Item2, false);
            ImGui.TableNextColumn();
            if (item.Value.Item1.Count > 0)
            {
                ImGui.TextUnformatted(item.Value.Item1[0].Name);
                if (item.Value.Item1.Count > 1)
                {
                    ImGuiUtil.HoverTooltip(string.Join("\n", item.Value.Item1.Skip(1).Select(m => m.Name)));
                }
            }

            ImGui.TableNextColumn();
            if (item.Value.Item2 is Item it)
            {
                using var color = ImRaii.PushColor(ImGuiCol.Text, ColorId.ItemId.Value());
                ImGuiUtil.RightAlign($"({( ( Quad )it.ModelMain ).A})");
            }
        }

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

        // Draw filters.
        var varWidth = ImGui.GetContentRegionAvail().X
                       - 400 * ImGuiHelpers.GlobalScale
                       - ImGui.GetStyle().ItemSpacing.X;

        ImGui.SetNextItemWidth(400 * ImGuiHelpers.GlobalScale);
        LowerString.InputWithHint("##changedItemsFilter", "Filter Item...", ref _changedItemFilter, 128);
        ImGui.SameLine();
        ImGui.SetNextItemWidth(varWidth);
        LowerString.InputWithHint("##changedItemsModFilter", "Filter Mods...", ref _changedItemModFilter, 128);

        using var child = ImRaii.Child("##changedItemsChild", -Vector2.One);
        if (!child)
        {
            return;
        }

        // Draw table of changed items.
        var height = ImGui.GetTextLineHeightWithSpacing() + 2 * ImGui.GetStyle().CellPadding.Y;
        var skips  = ImGuiClip.GetNecessarySkips(height);

        using var list = ImRaii.Table("##changedItems", 3, ImGuiTableFlags.RowBg, -Vector2.One);
        if (!list)
        {
            return;
        }

        const ImGuiTableColumnFlags flags = ImGuiTableColumnFlags.NoResize | ImGuiTableColumnFlags.WidthFixed;

        ImGui.TableSetupColumn("items", flags, 400 * ImGuiHelpers.GlobalScale);
        ImGui.TableSetupColumn("mods", flags, varWidth - 100 * ImGuiHelpers.GlobalScale);
        ImGui.TableSetupColumn("id", flags, 100 * ImGuiHelpers.GlobalScale);

        var items = Penumbra.CollectionManager.Current.ChangedItems;
        var rest  = _changedItemFilter.IsEmpty && _changedItemModFilter.IsEmpty
            ? ImGuiClip.ClippedDraw(items, skips, DrawChangedItemColumn, items.Count)
            : ImGuiClip.FilteredClippedDraw(items, skips, FilterChangedItem, DrawChangedItemColumn);

        ImGuiClip.DrawEndDummy(rest, height);
    }