Exemplo n.º 1
0
        public void DrawFromLayout(Graphics graphics, CachedImageDrawer imageDrawer, ElementCounts activatedElements,
                                   InnatePower[] innateOptions, IDrawableInnateOption[] innateGroupOptions
                                   )
        {
            if (backgroundCache == null)
            {
                this.imageDrawer   = imageDrawer;
                using var boldFont = layout.BuildBoldFont();
                DrawBackgroundImage(boldFont);
                InitOverlayCache(boldFont);
            }

            // Background Layer
            graphics.DrawImage(backgroundCache, layout.Bounds);

            this.graphics = graphics;
            // Middle Layer - Available
            foreach (WrappingText_InnateOptions wrappintText in layout.Options)
            {
                if (activatedElements.Contains(wrappintText.GroupOption.Elements))
                {
                    graphics.FillRectangle(Brushes.PeachPuff, wrappintText.Bounds);
                }
            }

            // Overlay text / images
            graphics.DrawImage(overlayCache, layout.Bounds);

            // Selected Innate Power
            if (innateOptions.Contains(power))
            {
                using Pen highlightPen = new(Color.Red, 2f);
                graphics.DrawRectangle(highlightPen, layout.Bounds);
            }
            // Selected Innat Option Group
            foreach (var x in layout.Options)
            {
                if (innateGroupOptions.Contains(x.GroupOption))
                {
                    using Pen highlightPen = new(Color.Red, 2f);
                    graphics.DrawRectangle(highlightPen, x.Bounds);
                }
            }
        }
Exemplo n.º 2
0
        public void Paint(Graphics graphics, Track[] clickableTrackOptions, CachedImageDrawer imageDrawer)
        {
            // Set single-thread variables
            this.clickableTrackOptions = clickableTrackOptions;
            this.imageDrawer           = imageDrawer;

            // Bottom Layer - cache it
            if (cachedBackgroundImage == null)
            {
                CalculateBackgroundImage();
            }
            graphics.DrawImage(cachedBackgroundImage, metrics.OutterBounds);

            // Middle Layer - Hotspots
            PaintHighlights(graphics);

            // Top Layer - Presence
            PaintPresence(graphics, presenceColor);
            // Draw current energy
            new IconDrawer(graphics, imageDrawer).DrawTheIcon(new IconDescriptor {
                Text = spirit.Energy.ToString()
            }, metrics.BigCoin);
        }
Exemplo n.º 3
0
        public void Paint(
            Graphics graphics,
            InnatePower[] innateOptions,
            IDrawableInnateOption[] innateGroupOptions,
            GrowthOption[] selectableGrowthOptions,
            GrowthActionFactory[] selectableGrowthActions,
            Track[] clickableTrackOptions
            )
        {
            using var imageDrawer = new CachedImageDrawer();

            DrawSpiritImage(graphics);

            using (new StopWatch("Growth"))
                growthPainter.Paint(graphics, selectableGrowthOptions, selectableGrowthActions);

            using (new StopWatch("Presence"))
                presencePainter.Paint(graphics, clickableTrackOptions, imageDrawer);

            using (new StopWatch("Innates"))
                Draw_Innates(graphics, innateOptions, innateGroupOptions, imageDrawer);

            Draw_Elements(graphics);
        }
Exemplo n.º 4
0
 public IconDrawer(Graphics graphics, CachedImageDrawer imageDrawer)
 {
     this.graphics    = graphics;
     this.imageDrawer = imageDrawer;
 }
Exemplo n.º 5
0
 void Draw_Innates(Graphics graphics, InnatePower[] innateOptions, IDrawableInnateOption[] innateGroupOptions, CachedImageDrawer imageDrawer)
 {
     foreach (var painter in innatePainters)
     {
         painter.DrawFromLayout(graphics, imageDrawer, spirit.Elements, innateOptions, innateGroupOptions);
     }
 }