Пример #1
0
        public override void Render(Graphics graphics, MenuSettings settings)
        {
            if (!IsVisible)
            {
                return;
            }
            Color color        = node.Value ? settings.EnabledBoxColor : settings.DisabledBoxColor;
            var   textPosition = new Vector2(Bounds.X - 45 + Bounds.Width / 3, Bounds.Y + Bounds.Height / 2);

            if (key != null)
            {
                graphics.DrawText(string.Concat("[", key, "]"), 12, Bounds.TopRight.Translate(-45, 0), settings.MenuFontColor);
            }
            graphics.DrawText(Name, settings.MenuFontSize, textPosition, settings.MenuFontColor, FontDrawFlags.VerticalCenter | FontDrawFlags.Left);
            graphics.DrawImage("menu-background.png", new RectangleF(Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height), settings.BackgroundColor);
            graphics.DrawImage("menu-slider.png", new RectangleF(Bounds.X + 5, Bounds.Y + 3 * Bounds.Height / 4 + 2, Bounds.Width - 10, 4), color);

            if (Children.Count > 0)
            {
                float width   = (Bounds.Width - 2) * 0.08f;
                float height  = (Bounds.Height - 2) / 2;
                var   imgRect = new RectangleF(Bounds.X + Bounds.Width - 1 - width, Bounds.Y + 1 + height - height / 2, width, height);
                graphics.DrawImage("menu-arrow.png", imgRect);
            }
            Children.ForEach(x => x.Render(graphics, settings));
        }
Пример #2
0
 public override void Render(Graphics graphics, MenuSettings settings)
 {
     if (!IsVisible)
     {
         return;
     }
     float colorSize = DesiredHeight - 6;
     graphics.DrawImage("menu-background.png", new RectangleF(Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height), settings.BackgroundColor);
     var textPosition = new Vector2(Bounds.X - 55 + Bounds.Width / 2 - colorSize, Bounds.Y + Bounds.Height / 2);
     graphics.DrawText(name, settings.MenuFontSize, textPosition, settings.MenuFontColor, FontDrawFlags.VerticalCenter | FontDrawFlags.Left);
     var colorBox = new RectangleF(Bounds.Right - colorSize - 1, Bounds.Top + 3, colorSize, colorSize);
     graphics.DrawImage("menu-colors.png", colorBox, node.Value);
 }
Пример #3
0
 public override void Render(Graphics graphics, MenuSettings settings)
 {
     if (!IsVisible)
     {
         return;
     }
     string text = string.IsNullOrEmpty(path) ? "  Select file" : Path.GetFileName(path);
     float size = DesiredHeight - 2;
     graphics.DrawImage("menu-background.png", new RectangleF(Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height), settings.BackgroundColor);
     var textPosition = new Vector2(Bounds.X + Bounds.Width / 2 - size / 2, Bounds.Y + Bounds.Height / 2);
     graphics.DrawText(text, settings.MenuFontSize, textPosition, settings.MenuFontColor, FontDrawFlags.VerticalCenter | FontDrawFlags.Center);
     var rectangle = new RectangleF(Bounds.Left + 5, Bounds.Top + 3, size, size - 5);
     graphics.DrawImage(string.IsNullOrEmpty(path) ? "openFile.png" : "done.png", rectangle);
 }
Пример #4
0
 public SettingsHub()
 {
     MenuSettings = new MenuSettings();
     DpsMeterSettings = new DpsMeterSettings();
     MapIconsSettings = new MapIconsSettings();
     ItemAlertSettings = new ItemAlertSettings();
     AdvancedTooltipSettings = new AdvancedTooltipSettings();
     MonsterTrackerSettings = new MonsterTrackerSettings();
     PoiTrackerSettings = new PoiTrackerSettings();
     PreloadAlertSettings = new PreloadAlertSettings();
     XpRateSettings = new XpRateSettings();
     HealthBarSettings = new HealthBarSettings();
     InventoryPreviewSettings = new InventoryPreviewSettings();
     KillCounterSettings = new KillCounterSettings();
 }
Пример #5
0
        public override void Render(Graphics graphics, MenuSettings settings)
        {
            if (!IsVisible)
            {
                return;
            }
            float colorSize = DesiredHeight - 6;

            graphics.DrawImage("menu-background.png", new RectangleF(Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height), settings.BackgroundColor);
            var textPosition = new Vector2(Bounds.X - 55 + Bounds.Width / 2 - colorSize, Bounds.Y + Bounds.Height / 2);

            graphics.DrawText(name, settings.MenuFontSize, textPosition, settings.MenuFontColor, FontDrawFlags.VerticalCenter | FontDrawFlags.Left);
            var colorBox = new RectangleF(Bounds.Right - colorSize - 1, Bounds.Top + 3, colorSize, colorSize);

            graphics.DrawImage("menu-colors.png", colorBox, node.Value);
        }
Пример #6
0
        public override void Render(Graphics graphics, MenuSettings settings)
        {
            if (!IsVisible)
            {
                return;
            }
            var textValue    = $"{name} : {node.Value}";
            var textPosition = new Vector2(Bounds.X - 50 + Bounds.Width / 3, Bounds.Y + Bounds.Height / 2);

            graphics.DrawText(textValue, settings.PickerFontSize, textPosition, settings.MenuFontColor, FontDrawFlags.VerticalCenter | FontDrawFlags.Left);
            graphics.DrawImage("menu-background.png", new RectangleF(Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height), settings.BackgroundColor);
            graphics.DrawImage("menu-slider.png", new RectangleF(Bounds.X + 5, Bounds.Y + 3 * Bounds.Height / 4 + 2, Bounds.Width - 10, 3), settings.SliderColor);
            float sliderPosition = (Bounds.Width - 10) * MinusFloat(node.Value, node.Min) / MinusFloat(node.Max, node.Min);

            graphics.DrawImage("menu-picker.png", new RectangleF(Bounds.X + 5 + sliderPosition - 2, Bounds.Y + 3 * Bounds.Height / 4 + 2, 4, 4));
        }
Пример #7
0
        public override void Render(Graphics graphics, MenuSettings settings)
        {
            if (!IsVisible)
            {
                return;
            }
            string text = string.IsNullOrEmpty(path) ? "  Select file" : Path.GetFileName(path);
            float  size = DesiredHeight - 2;

            graphics.DrawImage("menu-background.png", new RectangleF(Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height), settings.BackgroundColor);
            var textPosition = new Vector2(Bounds.X + Bounds.Width / 2 - size / 2, Bounds.Y + Bounds.Height / 2);

            graphics.DrawText(text, settings.MenuFontSize, textPosition, settings.MenuFontColor, FontDrawFlags.VerticalCenter | FontDrawFlags.Center);
            var rectangle = new RectangleF(Bounds.Left + 5, Bounds.Top + 3, size, size - 5);

            graphics.DrawImage(string.IsNullOrEmpty(path) ? "openFile.png" : "done.png", rectangle);
        }
Пример #8
0
        public override void Render(Graphics graphics, MenuSettings settings)
        {
            if (!IsVisible)
            {
                return;
            }
            Color color = node.Value ? settings.EnabledBoxColor : settings.DisabledBoxColor;
            var textPosition = new Vector2(Bounds.X - 45 + Bounds.Width / 3, Bounds.Y + Bounds.Height / 2);
            if (key != null) graphics.DrawText(string.Concat("[", key, "]"), 12, Bounds.TopRight.Translate(-45, 0), settings.MenuFontColor);
            graphics.DrawText(Name, settings.MenuFontSize, textPosition, settings.MenuFontColor, FontDrawFlags.VerticalCenter | FontDrawFlags.Left);
            graphics.DrawImage("menu-background.png", new RectangleF(Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height), settings.BackgroundColor);
            graphics.DrawImage("menu-slider.png", new RectangleF(Bounds.X + 5, Bounds.Y + 3 * Bounds.Height / 4 + 2, Bounds.Width - 10, 4), color);

            if (Children.Count > 0)
            {
                float width = (Bounds.Width - 2) * 0.08f;
                float height = (Bounds.Height - 2) / 2;
                var imgRect = new RectangleF(Bounds.X + Bounds.Width - 1 - width, Bounds.Y + 1 + height - height / 2, width, height);
                graphics.DrawImage("menu-arrow.png", imgRect);
            }
            Children.ForEach(x => x.Render(graphics, settings));
        }
Пример #9
0
 public override void Render(Graphics graphics, MenuSettings settings)
 {
     graphics.DrawText(settings.TitleName, settings.TitleFontSize, Bounds.TopLeft.Translate(25, 12), settings.TitleFontColor, FontDrawFlags.VerticalCenter | FontDrawFlags.Center);
     graphics.DrawImage("menu-background.png", Bounds, settings.BackgroundColor);
     Children.ForEach(x => x.Render(graphics, settings));
 }
Пример #10
0
 public abstract void Render(Graphics graphics, MenuSettings settings);
Пример #11
0
 public abstract void Render(Graphics graphics, MenuSettings settings);
Пример #12
0
 public override void Render(Graphics graphics, MenuSettings settings)
 {
     graphics.DrawText("Menu", settings.TitleFontSize, Bounds.TopLeft.Translate(25, 12), settings.TitleFontColor, FontDrawFlags.VerticalCenter | FontDrawFlags.Center);
     graphics.DrawImage("menu-background.png", Bounds, settings.BackgroundColor);
     Children.ForEach(x => x.Render(graphics, settings));
 }