コード例 #1
0
ファイル: Interface.cs プロジェクト: Ottermandias/RezPls
        private void DrawColorPicker(string name, string tooltip, uint value, uint defaultValue, Action <uint> setter)
        {
            const ImGuiColorEditFlags flags = ImGuiColorEditFlags.AlphaPreviewHalf | ImGuiColorEditFlags.NoInputs;

            var tmp = ImGui.ColorConvertU32ToFloat4(value);

            if (ImGui.ColorEdit4($"##{name}", ref tmp, flags))
            {
                ChangeAndSave(ImGui.ColorConvertFloat4ToU32(tmp), value, setter);
            }
            ImGui.SameLine();
            if (ImGui.Button($"Default##{name}"))
            {
                ChangeAndSave(defaultValue, value, setter);
            }
            if (ImGui.IsItemHovered())
            {
                ImGui.SetTooltip(
                    $"Reset to default: #{defaultValue & 0xFF:X2}{(defaultValue >> 8) & 0xFF:X2}{(defaultValue >> 16) & 0xFF:X2}{defaultValue >> 24:X2}");
            }
            ImGui.SameLine();
            ImGui.Text(name);
            if (ImGui.IsItemHovered())
            {
                ImGui.SetTooltip(tooltip);
            }
        }
コード例 #2
0
        public static bool ColorEdit4(string label, ref FColor color, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None)
        {
            var numColor = color.ToNumerics();
            var result   = ImGui.ColorEdit4(label, ref numColor, (flags & ~ImGuiColorEditFlags.DataTypeMask) | ImGuiColorEditFlags.Uint8);

            if (result)
            {
                color = numColor.ToFColor();
            }
            return(result);
        }
コード例 #3
0
        public static bool ColorEdit4(string label, ref IColor color, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None)
        {
            var numColor = color.ToFColor().ToNumerics();
            var result   = ImGui.ColorEdit4(label, ref numColor, (flags & ~ImGuiColorEditFlags.DataTypeMask) | ImGuiColorEditFlags.Uint8);

            if (result)
            {
                color = new IColor((byte)(numColor.X * 255f), (byte)(numColor.Y * 255f), (byte)(numColor.Z * 255f), (byte)(numColor.W * 255f));
            }
            return(result);
        }
コード例 #4
0
        /// <summary>
        /// ColorPicker with palette with color picker options.
        /// </summary>
        /// <param name="id">Id for the color picker.</param>
        /// <param name="description">The description of the color picker.</param>
        /// <param name="originalColor">The current color.</param>
        /// <param name="flags">Flags to customize color picker.</param>
        /// <returns>Selected color.</returns>
        public static Vector4 ColorPickerWithPalette(int id, string description, Vector4 originalColor, ImGuiColorEditFlags flags)
        {
            var existingColor = originalColor;
            var selectedColor = originalColor;
            var colorPalette  = ImGuiHelpers.DefaultColorPalette(36);

            if (ImGui.ColorButton($"{description}###ColorPickerButton{id}", originalColor))
            {
                ImGui.OpenPopup($"###ColorPickerPopup{id}");
            }

            if (ImGui.BeginPopup($"###ColorPickerPopup{id}"))
            {
                if (ImGui.ColorPicker4($"###ColorPicker{id}", ref existingColor, flags))
                {
                    selectedColor = existingColor;
                }

                for (var i = 0; i < 4; i++)
                {
                    ImGui.Spacing();
                    for (var j = i * 9; j < (i * 9) + 9; j++)
                    {
                        if (ImGui.ColorButton($"###ColorPickerSwatch{id}{i}{j}", colorPalette[j]))
                        {
                            selectedColor = colorPalette[j];
                        }

                        ImGui.SameLine();
                    }
                }

                ImGui.EndPopup();
            }

            return(selectedColor);
        }
コード例 #5
0
        /// <summary>
        /// ColorPicker with palette.
        /// </summary>
        /// <param name="id">Id for the color picker.</param>
        /// <param name="description">The description of the color picker.</param>
        /// <param name="originalColor">The current color.</param>
        /// <returns>Selected color.</returns>
        public static Vector4 ColorPickerWithPalette(int id, string description, Vector4 originalColor)
        {
            const ImGuiColorEditFlags flags = ImGuiColorEditFlags.NoSidePreview | ImGuiColorEditFlags.NoSmallPreview;

            return(ColorPickerWithPalette(id, description, originalColor, flags));
        }
コード例 #6
0
 public static bool ColorPicker4(string label, ref ImVec4 col, ImGuiColorEditFlags flags = ImGuiColorEditFlags.NoOptions) => ColorEdit4(label, (float *)Unsafe.AsPointer(ref col.x), flags);
コード例 #7
0
        private void DrawModSymTreeNodes(PlottedGraph plot)
        {
            string LowerFilterText = _activeHighlights.SymFilterText.ToLower();

            foreach (moduleEntry module_modentry in _activeHighlights.displayedModules.Values)
            {
                var  keyslist            = module_modentry.symbols.Keys.ToArray();
                bool hasFilterMatches    = false;
                bool moduleMatchesFilter = false;
                if (_activeHighlights.SymFilterText.Length == 0)
                {
                    hasFilterMatches = true;
                }
                else if (module_modentry.path.ToLower().Contains(LowerFilterText))
                {
                    moduleMatchesFilter = true;
                    hasFilterMatches    = true;
                }
                else
                {
                    foreach (ulong symaddr in keyslist)
                    {
                        symbolInfo syminfo = module_modentry.symbols[symaddr];
                        if (syminfo.name.ToLower().Contains(LowerFilterText))
                        {
                            hasFilterMatches = true;
                            break;
                        }
                    }
                }

                if (hasFilterMatches)
                {
                    if (ImGui.TreeNode($"{module_modentry.path}"))
                    {
                        float cursX = ImGui.GetCursorPosX() + 75;
                        foreach (ulong symaddr in keyslist)
                        {
                            symbolInfo syminfo = module_modentry.symbols[symaddr];

                            if (_activeHighlights.SymFilterText.Length > 0 &&
                                !moduleMatchesFilter &&
                                !syminfo.name.ToLower().Contains(_activeHighlights.SymFilterText.ToLower())
                                )
                            {
                                continue;
                            }

                            ImGui.SetCursorPosX(10);
                            ImGui.BeginGroup();
                            if (ImGui.Selectable($"{syminfo.name}", syminfo.selected))
                            {
                                HandleSelectedSym(plot, module_modentry, syminfo);
                            }
                            if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
                            {
                                ImGui.OpenPopup("HighlightColorPicker");
                            }
                            if (ImGui.BeginPopup("HighlightColorPicker"))
                            {
                                ImGui.PushStyleColor(ImGuiCol.Text, 0xffffffff);
                                ImGui.Text($"Configuring highlight colour for {syminfo.name} (0x{syminfo.address}:x)");
                                ImGuiColorEditFlags flags = ImGuiColorEditFlags.NoInputs;
                                flags |= ImGuiColorEditFlags.AlphaBar;
                                if (ImGui.ColorPicker4("Highlight Colour", ref _activeColorPick1, flags))
                                {
                                    foreach (uint node in syminfo.threadNodes)
                                    {
                                        plot.SetCustomHighlightColour((int)node, _activeColorPick1);
                                    }
                                }
                                ImGui.Text("Highlight active:");
                                ImGui.SameLine();
                                if (SmallWidgets.ToggleButton("NodeActiveHighlightToggle", syminfo.selected, "Node is highlighted"))
                                {
                                    HandleSelectedSym(plot, module_modentry, syminfo);
                                }
                                ImGui.PopStyleColor();
                                ImGui.EndPopup();
                            }

                            ImGui.SameLine(190);
                            ImGui.Text($"0x{syminfo.address:X}");
                            ImGui.SameLine(305);
                            ImGui.Text($"{syminfo.threadNodes.Count}");
                            ImGui.EndGroup();

                            if (!syminfo.selected)
                            {
                                if (ImGui.IsItemHovered(ImGuiHoveredFlags.None))
                                {
                                    if (syminfo.hovered == false)
                                    {
                                        syminfo.hovered = true;
                                        HandleMouseoverSym(plot, module_modentry, syminfo);
                                    }
                                }
                                else
                                {
                                    if (syminfo.hovered == true)
                                    {
                                        syminfo.hovered = false;
                                        HandleMouseoverSym(plot, module_modentry, syminfo);
                                    }
                                }
                            }
                        }

                        ImGui.TreePop();
                    }
                }
            }
        }
コード例 #8
0
        public static void InputTKVector4Color4(string label, object obj, string properyName, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None)
        {
            var input      = obj.GetType().GetProperty(properyName);
            var inputValue = (OpenTK.Vector4)input.GetValue(obj);
            var vec        = new Vector4(inputValue[0], inputValue[1], inputValue[2], inputValue[3]);

            float size = ImGui.GetFontSize();

            if (ImGui.ColorEdit4(label, ref vec, flags))
            {
                input.SetValue(obj, new OpenTK.Vector4(vec.X, vec.Y, vec.Z, vec.W));
            }
        }
コード例 #9
0
 public abstract byte igColorEdit4(byte *label, Vector4 *col, ImGuiColorEditFlags flags);
コード例 #10
0
 public abstract byte igColorPicker3(byte *label, Vector3 *col, ImGuiColorEditFlags flags);
コード例 #11
0
 public abstract void igSetColorEditOptions(ImGuiColorEditFlags flags);
コード例 #12
0
 public abstract byte igColorButton(byte *desc_id, Vector4 col, ImGuiColorEditFlags flags, Vector2 size);
コード例 #13
0
        public static void InputFloatsFromColor4(string label, object obj, string properyName, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None)
        {
            var input      = obj.GetType().GetProperty(properyName);
            var inputValue = (float[])input.GetValue(obj);
            var vec        = new Vector4(inputValue[0], inputValue[1], inputValue[2], inputValue[3]);

            if (ImGui.ColorEdit4(label, ref vec, flags | ImGuiColorEditFlags.HDR | ImGuiColorEditFlags.Float))
            {
                input.SetValue(obj, new float[4] {
                    vec.X, vec.Y, vec.Z, vec.W
                });
            }
        }
コード例 #14
0
        public static void InputFloatsFromColor4Button(string label, object obj, string properyName, ImGuiColorEditFlags flags = ImGuiColorEditFlags.None)
        {
            var input      = obj.GetType().GetProperty(properyName);
            var inputValue = (float[])input.GetValue(obj);
            var vec        = new Vector4(inputValue[0], inputValue[1], inputValue[2], inputValue[3]);

            float size = ImGui.GetFontSize();

            if (ImGui.ColorButton(label, vec, flags, new Vector2(size, size)))
            {
                input.SetValue(obj, new float[4] {
                    vec.X, vec.Y, vec.Z, vec.W
                });
            }
        }
コード例 #15
0
 public abstract byte igColorPicker4(byte *label, Vector4 *col, ImGuiColorEditFlags flags, float *ref_col);
コード例 #16
0
ファイル: StyleEditorWindow.cs プロジェクト: goaaats/Dalamud
    /// <inheritdoc />
    public override void Draw()
    {
        var config = Service <DalamudConfiguration> .Get();

        var renameModalTitle = Loc.Localize("RenameStyleModalTitle", "Rename Style");

        var workStyle = config.SavedStyles[this.currentSel];

        workStyle.BuiltInColors ??= StyleModelV1.DalamudStandard.BuiltInColors;

        var appliedThisFrame = false;

        var styleAry = config.SavedStyles.Select(x => x.Name).ToArray();

        ImGui.Text(Loc.Localize("StyleEditorChooseStyle", "Choose Style:"));
        if (ImGui.Combo("###styleChooserCombo", ref this.currentSel, styleAry, styleAry.Length))
        {
            var newStyle = config.SavedStyles[this.currentSel];
            newStyle.Apply();
            appliedThisFrame = true;
        }

        if (ImGui.Button(Loc.Localize("StyleEditorAddNew", "Add new style")))
        {
            this.SaveStyle();

            var newStyle = StyleModelV1.DalamudStandard;
            newStyle.Name = GetRandomName();
            config.SavedStyles.Add(newStyle);

            this.currentSel = config.SavedStyles.Count - 1;

            newStyle.Apply();
            appliedThisFrame = true;

            config.Save();
        }

        ImGui.SameLine();

        if (ImGuiComponents.IconButton(FontAwesomeIcon.Trash) && this.currentSel != 0)
        {
            this.currentSel--;
            var newStyle = config.SavedStyles[this.currentSel];
            newStyle.Apply();
            appliedThisFrame = true;

            config.SavedStyles.RemoveAt(this.currentSel + 1);

            config.Save();
        }

        if (ImGui.IsItemHovered())
        {
            ImGui.SetTooltip(Loc.Localize("StyleEditorDeleteStyle", "Delete current style"));
        }

        ImGui.SameLine();

        if (ImGuiComponents.IconButton(FontAwesomeIcon.Pen) && this.currentSel != 0)
        {
            var newStyle = config.SavedStyles[this.currentSel];
            this.renameText = newStyle.Name;

            this.renameModalDrawing = true;
            ImGui.OpenPopup(renameModalTitle);
        }

        if (ImGui.IsItemHovered())
        {
            ImGui.SetTooltip(Loc.Localize("StyleEditorRenameStyle", "Rename style"));
        }

        ImGui.SameLine();

        ImGuiHelpers.ScaledDummy(5);
        ImGui.SameLine();

        if (ImGuiComponents.IconButton(FontAwesomeIcon.FileExport))
        {
            var selectedStyle = config.SavedStyles[this.currentSel];
            var newStyle      = StyleModelV1.Get();
            newStyle.Name = selectedStyle.Name;
            ImGui.SetClipboardText(newStyle.Serialize());
        }

        if (ImGui.IsItemHovered())
        {
            ImGui.SetTooltip(Loc.Localize("StyleEditorCopy", "Copy style to clipboard for sharing"));
        }

        ImGui.SameLine();

        if (ImGuiComponents.IconButton(FontAwesomeIcon.FileImport))
        {
            this.SaveStyle();

            var styleJson = ImGui.GetClipboardText();

            try
            {
                var newStyle = StyleModel.Deserialize(styleJson);

                newStyle.Name ??= GetRandomName();

                if (config.SavedStyles.Any(x => x.Name == newStyle.Name))
                {
                    newStyle.Name = $"{newStyle.Name} ({GetRandomName()} Mix)";
                }

                config.SavedStyles.Add(newStyle);
                newStyle.Apply();
                appliedThisFrame = true;

                this.currentSel = config.SavedStyles.Count - 1;

                config.Save();
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Could not import style");
            }
        }

        if (ImGui.IsItemHovered())
        {
            ImGui.SetTooltip(Loc.Localize("StyleEditorImport", "Import style from clipboard"));
        }

        ImGui.Separator();

        ImGui.PushItemWidth(ImGui.GetWindowWidth() * 0.50f);

        if (this.currentSel < 2)
        {
            ImGui.TextColored(ImGuiColors.DalamudRed, Loc.Localize("StyleEditorNotAllowed", "You cannot edit built-in styles. Please add a new style first."));
        }
        else if (appliedThisFrame)
        {
            ImGui.Text(Loc.Localize("StyleEditorApplying", "Applying style..."));
        }
        else if (ImGui.BeginTabBar("StyleEditorTabs"))
        {
            var style = ImGui.GetStyle();

            if (ImGui.BeginTabItem(Loc.Localize("StyleEditorVariables", "Variables")))
            {
                ImGui.BeginChild($"ScrollingVars", ImGuiHelpers.ScaledVector2(0, -32), true, ImGuiWindowFlags.HorizontalScrollbar | ImGuiWindowFlags.NoBackground);

                ImGui.SetCursorPosY(ImGui.GetCursorPosY() - 5);

                ImGui.SliderFloat2("WindowPadding", ref style.WindowPadding, 0.0f, 20.0f, "%.0f");
                ImGui.SliderFloat2("FramePadding", ref style.FramePadding, 0.0f, 20.0f, "%.0f");
                ImGui.SliderFloat2("CellPadding", ref style.CellPadding, 0.0f, 20.0f, "%.0f");
                ImGui.SliderFloat2("ItemSpacing", ref style.ItemSpacing, 0.0f, 20.0f, "%.0f");
                ImGui.SliderFloat2("ItemInnerSpacing", ref style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f");
                ImGui.SliderFloat2("TouchExtraPadding", ref style.TouchExtraPadding, 0.0f, 10.0f, "%.0f");
                ImGui.SliderFloat("IndentSpacing", ref style.IndentSpacing, 0.0f, 30.0f, "%.0f");
                ImGui.SliderFloat("ScrollbarSize", ref style.ScrollbarSize, 1.0f, 20.0f, "%.0f");
                ImGui.SliderFloat("GrabMinSize", ref style.GrabMinSize, 1.0f, 20.0f, "%.0f");
                ImGui.Text("Borders");
                ImGui.SliderFloat("WindowBorderSize", ref style.WindowBorderSize, 0.0f, 1.0f, "%.0f");
                ImGui.SliderFloat("ChildBorderSize", ref style.ChildBorderSize, 0.0f, 1.0f, "%.0f");
                ImGui.SliderFloat("PopupBorderSize", ref style.PopupBorderSize, 0.0f, 1.0f, "%.0f");
                ImGui.SliderFloat("FrameBorderSize", ref style.FrameBorderSize, 0.0f, 1.0f, "%.0f");
                ImGui.SliderFloat("TabBorderSize", ref style.TabBorderSize, 0.0f, 1.0f, "%.0f");
                ImGui.Text("Rounding");
                ImGui.SliderFloat("WindowRounding", ref style.WindowRounding, 0.0f, 12.0f, "%.0f");
                ImGui.SliderFloat("ChildRounding", ref style.ChildRounding, 0.0f, 12.0f, "%.0f");
                ImGui.SliderFloat("FrameRounding", ref style.FrameRounding, 0.0f, 12.0f, "%.0f");
                ImGui.SliderFloat("PopupRounding", ref style.PopupRounding, 0.0f, 12.0f, "%.0f");
                ImGui.SliderFloat("ScrollbarRounding", ref style.ScrollbarRounding, 0.0f, 12.0f, "%.0f");
                ImGui.SliderFloat("GrabRounding", ref style.GrabRounding, 0.0f, 12.0f, "%.0f");
                ImGui.SliderFloat("LogSliderDeadzone", ref style.LogSliderDeadzone, 0.0f, 12.0f, "%.0f");
                ImGui.SliderFloat("TabRounding", ref style.TabRounding, 0.0f, 12.0f, "%.0f");
                ImGui.Text("Alignment");
                ImGui.SliderFloat2("WindowTitleAlign", ref style.WindowTitleAlign, 0.0f, 1.0f, "%.2f");
                var windowMenuButtonPosition = (int)style.WindowMenuButtonPosition + 1;
                if (ImGui.Combo("WindowMenuButtonPosition", ref windowMenuButtonPosition, "None\0Left\0Right\0"))
                {
                    style.WindowMenuButtonPosition = (ImGuiDir)(windowMenuButtonPosition - 1);
                }
                ImGui.SliderFloat2("ButtonTextAlign", ref style.ButtonTextAlign, 0.0f, 1.0f, "%.2f");
                ImGui.SameLine();
                ImGuiComponents.HelpMarker("Alignment applies when a button is larger than its text content.");
                ImGui.SliderFloat2("SelectableTextAlign", ref style.SelectableTextAlign, 0.0f, 1.0f, "%.2f");
                ImGui.SameLine();
                ImGuiComponents.HelpMarker("Alignment applies when a selectable is larger than its text content.");
                ImGui.SliderFloat2("DisplaySafeAreaPadding", ref style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f");
                ImGui.SameLine();
                ImGuiComponents.HelpMarker(
                    "Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured).");
                ImGui.EndTabItem();

                ImGui.EndChild();

                ImGui.EndTabItem();
            }

            if (ImGui.BeginTabItem(Loc.Localize("StyleEditorColors", "Colors")))
            {
                ImGui.BeginChild("ScrollingColors", ImGuiHelpers.ScaledVector2(0, -30), true, ImGuiWindowFlags.HorizontalScrollbar | ImGuiWindowFlags.NoBackground);

                ImGui.SetCursorPosY(ImGui.GetCursorPosY() - 5);

                if (ImGui.RadioButton("Opaque", this.alphaFlags == ImGuiColorEditFlags.None))
                {
                    this.alphaFlags = ImGuiColorEditFlags.None;
                }
                ImGui.SameLine();
                if (ImGui.RadioButton("Alpha", this.alphaFlags == ImGuiColorEditFlags.AlphaPreview))
                {
                    this.alphaFlags = ImGuiColorEditFlags.AlphaPreview;
                }
                ImGui.SameLine();
                if (ImGui.RadioButton("Both", this.alphaFlags == ImGuiColorEditFlags.AlphaPreviewHalf))
                {
                    this.alphaFlags = ImGuiColorEditFlags.AlphaPreviewHalf;
                }
                ImGui.SameLine();

                ImGuiComponents.HelpMarker(
                    "In the color list:\n" +
                    "Left-click on color square to open color picker,\n" +
                    "Right-click to open edit options menu.");

                foreach (var imGuiCol in Enum.GetValues <ImGuiCol>())
                {
                    if (imGuiCol == ImGuiCol.COUNT)
                    {
                        continue;
                    }

                    ImGui.PushID(imGuiCol.ToString());

                    ImGui.ColorEdit4("##color", ref style.Colors[(int)imGuiCol], ImGuiColorEditFlags.AlphaBar | this.alphaFlags);

                    ImGui.SameLine(0.0f, style.ItemInnerSpacing.X);
                    ImGui.TextUnformatted(imGuiCol.ToString());

                    ImGui.PopID();
                }

                ImGui.Separator();

                foreach (var property in typeof(DalamudColors).GetProperties(BindingFlags.Public | BindingFlags.Instance))
                {
                    ImGui.PushID(property.Name);

                    var colorVal = property.GetValue(workStyle.BuiltInColors);
                    if (colorVal == null)
                    {
                        colorVal = property.GetValue(StyleModelV1.DalamudStandard.BuiltInColors);
                        property.SetValue(workStyle.BuiltInColors, colorVal);
                    }

                    var color = (Vector4)colorVal;

                    if (ImGui.ColorEdit4("##color", ref color, ImGuiColorEditFlags.AlphaBar | this.alphaFlags))
                    {
                        property.SetValue(workStyle.BuiltInColors, color);
                        workStyle.BuiltInColors?.Apply();
                    }

                    ImGui.SameLine(0.0f, style.ItemInnerSpacing.X);
                    ImGui.TextUnformatted(property.Name);

                    ImGui.PopID();
                }

                ImGui.EndChild();

                ImGui.EndTabItem();
            }

            ImGui.EndTabBar();
        }

        ImGui.PopItemWidth();

        ImGui.Separator();

        if (ImGui.Button(Loc.Localize("Close", "Close")))
        {
            this.IsOpen = false;
        }

        ImGui.SameLine();

        if (ImGui.Button(Loc.Localize("SaveAndClose", "Save and Close")))
        {
            this.SaveStyle();

            config.ChosenStyle = config.SavedStyles[this.currentSel].Name;
            Log.Verbose("ChosenStyle = {ChosenStyle}", config.ChosenStyle);

            this.didSave = true;

            this.IsOpen = false;
        }

        if (ImGui.BeginPopupModal(renameModalTitle, ref this.renameModalDrawing, ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoScrollbar))
        {
            ImGui.Text(Loc.Localize("StyleEditorEnterName", "Please enter the new name for this style."));
            ImGui.Spacing();

            ImGui.InputText("###renameModalInput", ref this.renameText, 255);

            const float buttonWidth = 120f;
            ImGui.SetCursorPosX((ImGui.GetWindowWidth() - buttonWidth) / 2);

            if (ImGui.Button("OK", new Vector2(buttonWidth, 40)))
            {
                config.SavedStyles[this.currentSel].Name = this.renameText;
                config.Save();

                ImGui.CloseCurrentPopup();
            }

            ImGui.EndPopup();
        }
    }
コード例 #17
0
        /// <summary>
        /// Draw layout.
        /// </summary>
        /// <param name="renderer">Renderer.</param>
        public override void DrawLayout(ImGuiRenderer renderer)
        {
            //Get style.
            var style = ImGui.GetStyle();

            ImGui.PushItemWidth(ImGui.GetWindowWidth() * 0.50f);

            //Theme stuff.
            int ind = Helper.Settings.ThemeIndex;

            if (ImGui.Combo("Current Theme", ref ind, Style.ThemeList, Style.ThemeList.Count()))
            {
                Helper.Settings.ThemeIndex = ind;
            }
            string old = Helper.Settings.Theme;

            if (ImGui.InputText("Theme Name", ref Helper.Settings.Theme, 1000))
            {
                if (!File.Exists("Res/Themes/" + Helper.Settings.Theme + ".ini"))
                {
                    File.Move("Res/Themes/" + old + ".ini", "Res/Themes/" + Helper.Settings.Theme + ".ini", false);
                }
                Style.RefreshThemeList();
            }
            if (ImGui.Button("New Theme"))
            {
                int num = 1;
                while (File.Exists("Res/Themes/New Theme " + num + ".ini"))
                {
                    num++;
                }
                File.Copy("Res/Themes/" + Helper.Settings.Theme + ".ini", "Res/Themes/New Theme " + num + ".ini");
                Helper.Settings.Theme = "New Theme " + num;
                Style.RefreshThemeList();
            }
            if (Style.ThemeList.Length > 1)
            {
                ImGui.SameLine();
            }
            if (Style.ThemeList.Length > 1 && ImGui.Button("Delete Theme"))
            {
                File.Delete("Res/Themes/" + Helper.Settings.Theme + ".ini");
                Style.RefreshThemeList();
                Helper.Settings.ThemeIndex = 0;
            }

            //Save/Revert button
            if (ImGui.Button("Save Changes"))
            {
                Style.SaveToFile(Helper.Settings.Theme);
            }
            ImGui.SameLine();
            if (ImGui.Button("Revert Changes"))
            {
                Style.LoadFromFile(Helper.Settings.Theme);
            }

            //Tabs.
            ImGui.Separator();
            if (ImGui.BeginTabBar("##tabs", ImGuiTabBarFlags.None))
            {
                if (ImGui.BeginTabItem("Sizes"))
                {
                    ImGui.Text("Main");
                    ImGui.SliderFloat2("WindowPadding", ref style.WindowPadding, 0.0f, 20.0f, "%.0f");
                    ImGui.SliderFloat2("FramePadding", ref style.FramePadding, 0.0f, 20.0f, "%.0f");
                    ImGui.SliderFloat2("ItemSpacing", ref style.ItemSpacing, 0.0f, 20.0f, "%.0f");
                    ImGui.SliderFloat2("ItemInnerSpacing", ref style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f");
                    ImGui.SliderFloat2("TouchExtraPadding", ref style.TouchExtraPadding, 0.0f, 10.0f, "%.0f");
                    ImGui.SliderFloat("IndentSpacing", ref style.IndentSpacing, 0.0f, 30.0f, "%.0f");
                    ImGui.SliderFloat("ScrollbarSize", ref style.ScrollbarSize, 1.0f, 20.0f, "%.0f");
                    ImGui.SliderFloat("GrabMinSize", ref style.GrabMinSize, 1.0f, 20.0f, "%.0f");
                    ImGui.Text("Borders");
                    ImGui.SliderFloat("WindowBorderSize", ref style.WindowBorderSize, 0.0f, 1.0f, "%.0f");
                    ImGui.SliderFloat("ChildBorderSize", ref style.ChildBorderSize, 0.0f, 1.0f, "%.0f");
                    ImGui.SliderFloat("PopupBorderSize", ref style.PopupBorderSize, 0.0f, 1.0f, "%.0f");
                    ImGui.SliderFloat("FrameBorderSize", ref style.FrameBorderSize, 0.0f, 1.0f, "%.0f");
                    ImGui.SliderFloat("TabBorderSize", ref style.TabBorderSize, 0.0f, 1.0f, "%.0f");
                    ImGui.Text("Rounding");
                    ImGui.SliderFloat("WindowRounding", ref style.WindowRounding, 0.0f, 12.0f, "%.0f");
                    ImGui.SliderFloat("ChildRounding", ref style.ChildRounding, 0.0f, 12.0f, "%.0f");
                    ImGui.SliderFloat("FrameRounding", ref style.FrameRounding, 0.0f, 12.0f, "%.0f");
                    ImGui.SliderFloat("PopupRounding", ref style.PopupRounding, 0.0f, 12.0f, "%.0f");
                    ImGui.SliderFloat("ScrollbarRounding", ref style.ScrollbarRounding, 0.0f, 12.0f, "%.0f");
                    ImGui.SliderFloat("GrabRounding", ref style.GrabRounding, 0.0f, 12.0f, "%.0f");
                    ImGui.SliderFloat("TabRounding", ref style.TabRounding, 0.0f, 12.0f, "%.0f");
                    ImGui.Text("Alignment");
                    ImGui.SliderFloat2("WindowTitleAlign", ref style.WindowTitleAlign, 0.0f, 1.0f, "%.2f");
                    int window_menu_button_position = (int)style.WindowMenuButtonPosition + 1;
                    if (ImGui.Combo("WindowMenuButtonPosition", ref window_menu_button_position, "None\0Left\0Right\0"))
                    {
                        style.WindowMenuButtonPosition = (ImGuiDir)(window_menu_button_position - 1);
                    }
                    int color_button_position = (int)style.ColorButtonPosition;
                    if (ImGui.Combo("ColorButtonPosition", ref color_button_position, "Left\0Right\0"))
                    {
                        style.ColorButtonPosition = (ImGuiDir)color_button_position;
                    }
                    ImGui.SliderFloat2("ButtonTextAlign", ref style.ButtonTextAlign, 0.0f, 1.0f, "%.2f");
                    ImGui.SliderFloat2("SelectableTextAlign", ref style.SelectableTextAlign, 0.0f, 1.0f, "%.2f");
                    ImGui.Text("Safe Area Padding");
                    ImGui.SliderFloat2("DisplaySafeAreaPadding", ref style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f");
                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem("Colors"))
                {
                    if (ImGui.RadioButton("Opaque", AlphaFlags == ImGuiColorEditFlags.None))
                    {
                        AlphaFlags = ImGuiColorEditFlags.None;
                    }
                    ImGui.SameLine();
                    if (ImGui.RadioButton("Alpha", AlphaFlags == ImGuiColorEditFlags.AlphaPreview))
                    {
                        AlphaFlags = ImGuiColorEditFlags.AlphaPreview;
                    }
                    ImGui.SameLine();
                    if (ImGui.RadioButton("Both", AlphaFlags == ImGuiColorEditFlags.AlphaPreviewHalf))
                    {
                        AlphaFlags = ImGuiColorEditFlags.AlphaPreviewHalf;
                    }
                    ImGui.BeginChild("##colors", new Num.Vector2(0, 0), true, ImGuiWindowFlags.AlwaysVerticalScrollbar | ImGuiWindowFlags.AlwaysHorizontalScrollbar | ImGuiWindowFlags.NavFlattened);
                    ImGui.PushItemWidth(-160);
                    for (int i = 0; i < (int)ImGuiCol.COUNT; i++)
                    {
                        string name = ImGui.GetStyleColorName((ImGuiCol)i);
                        ImGui.PushID(i);
                        ImGui.ColorEdit4("##color", ref style.Colors[i], ImGuiColorEditFlags.AlphaBar | AlphaFlags);
                        ImGui.SameLine(0.0f, style.ItemInnerSpacing.X);
                        ImGui.TextUnformatted(name);
                        ImGui.PopID();
                    }
                    ImGui.PopItemWidth();
                    ImGui.EndChild();

                    ImGui.EndTabItem();
                }

                if (ImGui.BeginTabItem("Font"))
                {
                    ImGui.InputText("Font Name", ref Style.FontRaw, 1000);
                    ImGui.InputFloat("Font Size", ref Style.FontSizeRaw);
                    if (ImGui.Button("Update Font"))
                    {
                        if (!File.Exists("Res/Fonts/" + Style.FontRaw + ".ttf"))
                        {
                            MessageBox.Show("Error:", "The font \"" + Style.FontRaw + "\" does not exist in the Res/Fonts folder.");
                        }
                        else
                        {
                            Style.Font              = Style.FontRaw;
                            Style.FontSize          = Style.FontSizeRaw;
                            Style.FontPtr           = ImGui.GetIO().Fonts.AddFontFromFileTTF("Res/Fonts/" + Style.Font + ".ttf", Style.FontSize);
                            Style.FontRebuildNeeded = true;
                        }
                    }
                }

                ImGui.EndTabBar();
            }

            ImGui.PopItemWidth();
        }