Exemple #1
0
        private void DrawSelectableMenu(SelectableMenu selectable)
        {
            var scale = screen.Width / 320;

            for (var i = 0; i < selectable.Name.Count; i++)
            {
                if (selectable.HeadersAsText)
                {
                    screen.DrawTextB(selectable.Name[i], scale * selectable.TitleX[i], scale * selectable.TitleY[i], scale);
                }
                else
                {
                    DrawMenuPatch(
                        selectable.Name[i],
                        selectable.TitleX[i],
                        selectable.TitleY[i]);
                }
            }

            foreach (var item in selectable.Items)
            {
                DrawMenuItem(selectable.Menu, item);
            }

            var choice = selectable.Choice;
            var arrow  = selectable.Menu.Tics / 8 % 2 == 0 ? "M_SLCTR1" : "M_SLCTR2";

            DrawMenuPatch(arrow, choice.SkullX, choice.SkullY);
        }
Exemple #2
0
        private void RenderCast(Finale finale)
        {
            DrawPatch("BOSSBACK", 0, 0);

            var frame = finale.CastState.Frame & 0x7fff;
            var patch = sprites[finale.CastState.Sprite].Frames[frame].Patches[0];

            if (sprites[finale.CastState.Sprite].Frames[frame].Flip[0])
            {
                screen.DrawPatchFlip(
                    patch,
                    screen.Width / 2,
                    screen.Height - scale * 30,
                    scale);
            }
            else
            {
                screen.DrawPatch(
                    patch,
                    screen.Width / 2,
                    screen.Height - scale * 30,
                    scale);
            }

            var width = screen.MeasureText(finale.CastName, scale);

            screen.DrawTextB(
                finale.CastName,
                (screen.Width - width) / 2,
                screen.Height - scale * 13,
                scale);
        }
Exemple #3
0
        public void RenderGame(DoomGame game)
        {
            if (game.State == GameState.Level)
            {
                var consolePlayer = game.World.ConsolePlayer;
                var displayPlayer = game.World.DisplayPlayer;

                if (game.World.AutoMap.Visible)
                {
                    autoMap.Render(consolePlayer);
                    statusBar.Render(consolePlayer, true);
                }
                else
                {
                    threeD.Render(displayPlayer);
                    //* if (threeD.WindowSize < 8)
                    // {
                    //     statusBar.Render(consolePlayer, true);
                    // }
                    // else if (threeD.WindowSize == ThreeDRenderer.MaxScreenSize)
                    // {
                    //    statusBar.Render(consolePlayer, false);
                    //}
                }

                if (config.video_displaymessage || ReferenceEquals(consolePlayer.Message, (string)DoomInfo.Strings.MSGOFF))
                {
                    if (consolePlayer.MessageTime > 0)
                    {
                        var scale = screen.Width / 320;
                        screen.DrawTextB(consolePlayer.Message, 0, 7 * scale, scale);
                    }
                }
            }
            else if (game.State == GameState.Intermission)
            {
                intermission.Render(game.Intermission);
            }
            else if (game.State == GameState.Finale)
            {
                finale.Render(game.Finale);
            }
        }