Beispiel #1
0
        /// <summary>
        /// Get a <see cref="StyleModel"/> instance via ImGui.
        /// </summary>
        /// <returns>The newly created <see cref="StyleModel"/> instance.</returns>
        public static StyleModelV1 Get()
        {
            var model = new StyleModelV1();
            var style = ImGui.GetStyle();

            model.Alpha                    = style.Alpha;
            model.WindowPadding            = style.WindowPadding;
            model.WindowRounding           = style.WindowRounding;
            model.WindowBorderSize         = style.WindowBorderSize;
            model.WindowTitleAlign         = style.WindowTitleAlign;
            model.WindowMenuButtonPosition = style.WindowMenuButtonPosition;
            model.ChildRounding            = style.ChildRounding;
            model.ChildBorderSize          = style.ChildBorderSize;
            model.PopupRounding            = style.PopupRounding;
            model.PopupBorderSize          = style.PopupBorderSize;
            model.FramePadding             = style.FramePadding;
            model.FrameRounding            = style.FrameRounding;
            model.FrameBorderSize          = style.FrameBorderSize;
            model.ItemSpacing              = style.ItemSpacing;
            model.ItemInnerSpacing         = style.ItemInnerSpacing;
            model.CellPadding              = style.CellPadding;
            model.TouchExtraPadding        = style.TouchExtraPadding;
            model.IndentSpacing            = style.IndentSpacing;
            model.ScrollbarSize            = style.ScrollbarSize;
            model.ScrollbarRounding        = style.ScrollbarRounding;
            model.GrabMinSize              = style.GrabMinSize;
            model.GrabRounding             = style.GrabRounding;
            model.LogSliderDeadzone        = style.LogSliderDeadzone;
            model.TabRounding              = style.TabRounding;
            model.TabBorderSize            = style.TabBorderSize;
            model.ButtonTextAlign          = style.ButtonTextAlign;
            model.SelectableTextAlign      = style.SelectableTextAlign;
            model.DisplaySafeAreaPadding   = style.DisplaySafeAreaPadding;

            model.Colors = new Dictionary <string, Vector4>();

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

                model.Colors[imGuiCol.ToString()] = style.Colors[(int)imGuiCol];
            }

            model.BuiltInColors = new DalamudColors
            {
                DalamudRed    = ImGuiColors.DalamudRed,
                DalamudGrey   = ImGuiColors.DalamudGrey,
                DalamudGrey2  = ImGuiColors.DalamudGrey2,
                DalamudGrey3  = ImGuiColors.DalamudGrey3,
                DalamudWhite  = ImGuiColors.DalamudWhite,
                DalamudWhite2 = ImGuiColors.DalamudWhite2,
                DalamudOrange = ImGuiColors.DalamudOrange,
                TankBlue      = ImGuiColors.TankBlue,
                HealerGreen   = ImGuiColors.HealerGreen,
                DPSRed        = ImGuiColors.DPSRed,
            };

            return(model);
        }
Beispiel #2
0
 /// <summary>
 /// Get a StyleModel based on the current Dalamud style, with the current version.
 /// </summary>
 /// <returns>The current style.</returns>
 public static StyleModel GetFromCurrent() => StyleModelV1.Get();