Пример #1
0
        public static unsafe void Apply()
        {
            var s = ImGui.GetStyle();

            //Settings
            s.FrameRounding     = 2;
            s.ScrollbarSize     = 12;
            s.ScrollbarRounding = 3;
            s.FrameBorderSize   = 1f;
            s.Alpha             = 1;

            //Colours
            SetColor(ImGuiCol.WindowBg, RGBA(41, 41, 42, 210));
            SetColor(ImGuiCol.ChildBg, RGBA(0, 0, 0, 0));
            SetColor(ImGuiCol.Border, RGBA(83, 83, 83, 255));
            SetColor(ImGuiCol.BorderShadow, RGBA(0, 0, 0, 0));
            SetColor(ImGuiCol.FrameBg, RGBA(56, 57, 58, 255));
            SetColor(ImGuiCol.PopupBg, RGBA(56, 57, 58, 255));
            SetColor(ImGuiCol.FrameBgHovered, RGBA(66, 133, 190, 255));
            SetColor(ImGuiCol.Header, RGBA(88, 178, 255, 132));
            SetColor(ImGuiCol.HeaderActive, RGBA(88, 178, 255, 164));
            SetColor(ImGuiCol.FrameBgActive, RGBA(95, 97, 98, 255));
            SetColor(ImGuiCol.MenuBarBg, RGBA(66, 67, 69, 255));
            SetColor(ImGuiCol.ScrollbarBg, RGBA(51, 64, 77, 153));
            SetColor(ImGuiCol.Button, RGBA(128, 128, 128, 88));

            SetColor(ImGuiCol.TabActive, RGBA(95, 97, 98, 255));
            SetColor(ImGuiCol.TabHovered, RGBA(66, 133, 190, 255));
            SetColor(ImGuiCol.Tab, RGBA(56, 57, 58, 255));

            using (var stream = typeof(Theme).Assembly.GetManifestResourceStream("LibreLancer.ImUI.icons.png")) {
                iconTexture = Generic.FromStream(stream);
                iconId      = ImGuiHelper.RegisterTexture(iconTexture);
            }
            using (var reader = new StreamReader(typeof(Theme).Assembly.GetManifestResourceStream("LibreLancer.ImUI.icons.txt"))) {
                while (!reader.EndOfStream)
                {
                    var ln = reader.ReadLine().Trim();
                    if (string.IsNullOrEmpty(ln))
                    {
                        continue;
                    }
                    var sp   = ln.Split('=');
                    var n    = sp[0].Trim();
                    var vals = sp[1].Trim().Split(' ').Select(float.Parse).ToArray();
                    var uv0  = new Vector2(vals[0] / iconTexture.Width,
                                           1 - (vals[1] / iconTexture.Height));
                    var uv1 = new Vector2((vals[0] + vals[2]) / iconTexture.Width,
                                          1 - (vals[1] + vals[3]) / iconTexture.Height);
                    icons.Add(n, new TCoordinates()
                    {
                        UV0 = uv0, UV1 = uv1, Size = new Vector2(vals[2], vals[3])
                    });
                }
            }
        }
Пример #2
0
 public static bool Spinner(string label, float radius, int thickness, uint color)
 {
     ImGuiHelper.AnimatingElement();
     return(_Spinner(label, radius, thickness, color));
 }