Пример #1
0
        public override void Render()
        {
            // These 3 render calls are a hack to get the console data generated and display a message to the user
            // Should add in async calls that let us generate these in the background... That would be cool.
            if (IsVisible)
            {
                if (!initialized)
                {
                    base.Render();
                }

                else if (!initializedStep2)
                {
                    initializedStep2 = true;
                    base.Render();
                }
                else if (!initializedStep3)
                {
                    base.Render();

                    // Generate the content
                    TextSurface = new TextSurface(2000, 2000, Engine.DefaultFont); //500mb ?? why?
                    //Data = new TextSurface(2000, 2000);
                    //DataViewport = new Rectangle(0, 0, 80, 25);
                    TextSurface.RenderArea = new Rectangle(0, 0, 80, 25);

                    // Clear message data and make it transparent so that it acts as a layer
                    messageData.Fill(Color.White, Color.Transparent, 0, null);

                    // We need to set celldata to the big console data so we can use the FillWithRandom method.
                    FillWithRandomGarbage();
                    initializedStep3 = true;
                }

                else
                {
                    // Set message data information about where the viewport is located
                    //messageData.Print(0, 0, $"{ViewArea.X} , {ViewArea.Y}            ", Color.White, Color.Black);

                    // Create a faux layering system.
                    base.Render();

                    //Renderer.Render(messageData.TextSurface, new Point(0, 0));
                }
            }
        }