示例#1
0
        public override void Draw()
        {
            if (_currentSelectionMenu != null)
            {
                DrawCntrl.SetTransformMatrix(Matrix.CreateTranslation(Vector3.Zero));
                GameConsole.BackgroundColor = GameConsole.BaseBackgroundColor;
                GameConsole.ForegroundColor = GameConsole.BaseForegroundColor;
                GameConsole.DrawRectangle(Dialogue.Pos, Dialogue.Size);
                GameConsole.DrawFrame(Dialogue.Pos - Vector2.One, Dialogue.Size + Vector2.One * 2);

                string desc;

                if (_currentSelectionMenu.SelectedItem >= _currentInventory.Count)
                {
                    desc = Strings.BackTip;
                }
                else
                {
                    desc = _currentInventory.ElementAt(_currentSelectionMenu.SelectedItem).Value.Description;
                }

                GameConsole.DrawText(desc, Dialogue.Pos);
                DrawCntrl.ResetTransformMatrix();
            }
        }
示例#2
0
        public override void Draw()
        {
            GameConsole.ForegroundColor = GameConsole.BaseForegroundColor;
            GameConsole.BackgroundColor = GameConsole.BaseBackgroundColor;

            DrawCntrl.SetTransformMatrix(Matrix.CreateTranslation(Vector3.Zero));

            GameConsole.DrawRectangle(Vector2.Zero, new Vector2(GameConsole.W, GameConsole.H));

            string itemStr;

            for (var i = 0; i < Items.Length; i += 1)
            {
                if (i == SelectedItem)
                {
                    itemStr = "> " + Items[i];
                }
                else
                {
                    itemStr = Items[i];
                }
                GameConsole.DrawText(itemStr, Pos + Vector2.UnitY * i);
            }
            DrawCntrl.ResetTransformMatrix();

            GameConsole.DrawText(Strings.MenuTitle, Pos + Vector2.UnitY * -2);

            GameConsole.DrawText(Strings.MenuControls, new Vector2(1, GameConsole.H - 2));
            GameConsole.DrawText(Strings.MenuCredits1, new Vector2(70, GameConsole.H - 3));
            GameConsole.DrawText(Strings.MenuCredits2, new Vector2(64, GameConsole.H - 2));
        }
示例#3
0
        public override void Draw()
        {
            GameConsole.ForegroundColor = GameConsole.BaseForegroundColor;
            GameConsole.BackgroundColor = GameConsole.BaseBackgroundColor;
            DrawCntrl.SetTransformMatrix(Matrix.CreateTranslation(Vector3.Zero));

            if (DisplayBorders)
            {
                GameConsole.DrawFrame(Pos - Vector2.One, Size + Vector2.One * 2);
                GameConsole.DrawRectangle(Pos, Size);
                GameConsole.DrawText(Name, Pos - Vector2.UnitY);
            }

            string itemStr;

            for (var i = 0; i < Items.Length; i += 1)
            {
                if (i == SelectedItem)
                {
                    itemStr = "> " + Items[i];
                }
                else
                {
                    itemStr = Items[i];
                }
                GameConsole.DrawText(itemStr, Pos + Vector2.UnitY * i);
            }
            DrawCntrl.ResetTransformMatrix();
        }
示例#4
0
        public override void Draw()
        {
            DrawCntrl.SetTransformMatrix(Matrix.CreateTranslation(Vector3.Zero));
            GameConsole.BackgroundColor = GameConsole.BaseBackgroundColor;

            GameConsole.DrawRectangle(0, 0, GameConsole.W, GameConsole.H);
            DrawCntrl.ResetTransformMatrix();
        }
示例#5
0
        public override void DrawEnd()
        {
            if (_drawWhiteScreen)
            {
                DrawCntrl.SetTransformMatrix(Matrix.CreateTranslation(Vector3.Zero));
                GameConsole.ForegroundColor = Color.White;
                GameConsole.BackgroundColor = GameConsole.BaseBackgroundColor;

                GameConsole.DrawRectangle(0, 0, GameConsole.W, GameConsole.H);
                DrawCntrl.ResetTransformMatrix();

                Player player = (Player)Objects.ObjFind <Player>(0);
                GameConsole.DrawChar('@', player.Pos);
            }
        }
示例#6
0
        public override void DrawEnd()
        {
            GameConsole.BackgroundColor = GameConsole.BaseBackgroundColor;
            GameConsole.ForegroundColor = GameConsole.BaseForegroundColor;

            DrawCntrl.SetTransformMatrix(Matrix.CreateTranslation(Vector3.Zero));
            GameConsole.DrawRectangle(Pos, Size);
            if (!Borderless)
            {
                GameConsole.DrawFrame(Pos - Vector2.One, Size + Vector2.One * 2);
            }

            GameConsole.DrawText(_dialogueNames[LineId], Pos + new Vector2(1, -1));
            GameConsole.DrawText(_typedText.ToString(), Pos);
            DrawCntrl.ResetTransformMatrix();
        }
示例#7
0
        public override void DrawEnd()
        {
            base.DrawEnd();

            if (_menu != null)
            {
                DrawCntrl.SetTransformMatrix(Matrix.CreateTranslation(Vector3.Zero));
                Inventory inv = (Inventory)Objects.ObjFind <Inventory>(0);
                GameConsole.ForegroundColor = GameConsole.BaseForegroundColor;
                GameConsole.BackgroundColor = GameConsole.BaseBackgroundColor;
                GameConsole.DrawText("HP: " + inv.Health.ToString().PadLeft(3) + "/" + inv.MaxHealth, _menuPos + Vector2.UnitY * 4);

                GameConsole.ForegroundColor = GameConsole.HealthForegroundColor;
                GameConsole.BackgroundColor = GameConsole.HealthBackgroundColor;
                GameConsole.DrawRectangle((int)_menuPos.X, (int)_menuPos.Y + 5, (int)_menuSize.X, 1);
                GameConsole.DrawProgressBar((int)_menuPos.X, (int)_menuPos.Y + 5, (int)_menuSize.X, ((float)inv.Health) / ((float)inv.MaxHealth));
                DrawCntrl.ResetTransformMatrix();
            }
        }
示例#8
0
        public override void DrawEnd()
        {
            if (CurrentMode == Mode.Objects)
            {
                DrawObjectOverlays();
            }


            DrawCntrl.CurrentColor = UIBgColor;
            DrawCntrl.DrawRectangle(0, 0, Terrain.TileMap.GetLength(0) * GameConsole.CharSize.X, Terrain.TileMap.GetLength(1) * GameConsole.CharSize.Y, true);



            DrawCntrl.SetTransformMatrix(Matrix.CreateTranslation(Vector3.Zero));

            GameConsole.ForegroundColor = UIFgColor;
            GameConsole.BackgroundColor = UIBgColor;
            GameConsole.DrawFrame(0, 0, GameConsole.W, GameConsole.H);

            string mode = "";

            if (CurrentMode == Mode.Tiles)
            {
                mode = "Tile mode";
            }
            if (CurrentMode == Mode.Collision)
            {
                mode = "Collision mode";
            }
            if (CurrentMode == Mode.Objects)
            {
                mode = "Object mode";
            }


            string caption = mode
                             + " | mx:" + TileMousePos.X
                             + " my:" + TileMousePos.Y
                             + " | fps:" + GameCntrl.Fps
                             + " | map w:" + Terrain.TileMap.GetLength(0)
                             + " map h:" + Terrain.TileMap.GetLength(1)
                             + " | ";

            GameConsole.DrawText(caption, 1, 0);

            if (CurrentMode == Mode.Tiles)
            {
                GameConsole.ForegroundColor = Palettes[CurrentPalette][0];
                GameConsole.BackgroundColor = Palettes[CurrentPalette][1];
                GameConsole.DrawText("Char: " + CurrentChar, caption.Length + 1, 0);
            }


            if (CurrentMode == Mode.Objects)
            {
                string className = ObjectTypes[CurrentObjectType].ToString().Split('.').Last();
                GameConsole.DrawText("Obj: " + className, caption.Length + 1, 0);

                if (CurrentObject != null)
                {
                    className = CurrentObject.ToString().Split('.').Last();
                    GameConsole.DrawText("Selected: " + className + " | " + CurrentObject.ArgumentName + ": " + CurrentObject.Argument, 1, GameConsole.H - 1);
                }
            }


            if (SelectionMenuActive)
            {
                if (SelectionMenuMode == 0)
                {
                    DrawPaletteSelectionMenu();
                }
                else
                {
                    DrawCharSelectionMenu();
                }
            }

            if (ObjArgumentMenuActive)
            {
                DrawObjArgumentMenu();
            }

            if (ObjSelectMenuActive)
            {
                DrawObjSelectMenu();
            }



            DrawCntrl.CurrentColor = Color.White;
            DrawCntrl.DrawRectangle(TileScreenMousePos * GameConsole.CharSize, TileScreenMousePos * GameConsole.CharSize + GameConsole.CharSize, true);



            DrawCntrl.ResetTransformMatrix();
        }