Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="buttonPosition"></param>
        /// <param name="buttonText"></param>
        /// <param name="buttonClicked"></param>
        /// <returns></returns>
        private MogwaiButton MenuButton(int buttonPosition, string buttonText, Action <string> buttonClicked)
        {
            var xBtn     = 0;
            var xSpBtn   = 1;
            var mBtnSize = 7;

            var button = new MogwaiButton(mBtnSize, 1)
            {
                Position = new Point(xBtn + buttonPosition * (mBtnSize + xSpBtn), 0),
                Text     = buttonText
            };

            button.Click += (btn, args) => { buttonClicked(((Button)btn).Text); };
            _command1.Add(button);
            _command1.SetGlyph(xBtn + mBtnSize + buttonPosition * (mBtnSize + xSpBtn), 0, 186, Color.DarkCyan);
            _command1.BorderSurface.SetGlyph(xBtn + mBtnSize + 1 + buttonPosition * (mBtnSize + xSpBtn), 0, 203, Color.DarkCyan);
            for (var i = 0; i < mBtnSize; i++)
            {
                _command1.BorderSurface.SetGlyph(xBtn + i + 1 + buttonPosition * (mBtnSize + xSpBtn), 2, 205, Color.DarkCyan);
            }

            _command1.BorderSurface.SetGlyph(xBtn + mBtnSize + 1 + buttonPosition * (mBtnSize + xSpBtn), 2, 202, Color.DarkCyan);

            return(button);
        }
        public void Init()
        {
            _consoleList.Add(CreateChoice(0, 0, "Hollow Mountain", "Hollow Mountain is the largest peak on Rivenrake Island, which lies at " +
                                          "the northwestern edge of the Varisian Gulf", "icon2s.png", AdventureType.TestRoom));
            _consoleList.Add(CreateChoice(1, 0, "The Manstone Caverns", "The underground complex, a network of caverns accessible only via " +
                                          "the Darklands or through well-defended chambers connected to hideouts " +
                                          "above.", "icon1s.png", AdventureType.Chamber));
            _consoleList.Add(CreateChoice(2, 0, "Gallowspire", "Located in the Hungry Mountains in southwestern Ustalav, the tower of Gallowspire " +
                                          "stands as a crumbling testament to the power of the immortal lich Tar-Baphon.", "icon3s.png", AdventureType.Dungeon));
            _consoleList.Add(CreateChoice(0, 1, "The Pyramid of Kamaria", "Kamaria, which dominates the southern skyline of the Osirian " +
                                          "city of An. Dedicated to the only ruler of the ancient kingdom.", "icon4s.png", AdventureType.Battle));
            _consoleList.Add(CreateChoice(1, 1, "The King Karamoss", "A thousand years ago, the city of Absalom faced one of its most exotic foes. " +
                                          "The mysterious wizard Karamoss.", "icon5s.png", AdventureType.Quest));

            _travelControl = new ControlsConsole(43, 7)
            {
                Position = new Point(47, 14)
            };
            _travelControl.Fill(Color.Transparent, new Color(05, 05, 05, 255), null);
            Children.Add(_travelControl);

            _travelControl.Print(1, 1, "Adventure: ", Color.Gainsboro);
            _travelControl.Print(1, 2, "Difficulty:", Color.Gainsboro);
            _travelControl.Print(1, 4, "Cost:", Color.Gainsboro);

            var button = new MogwaiButton(10, 1)
            {
                Position = new Point(33, 6),
                Text     = "TRAVEL"
            };

            button.Click += (btn, args) => { DoAdventure(); };
            _travelControl.Add(button);

            var bDec = new MogwaiButton(3, 1)
            {
                Position = new Point(34, 2),
                Text     = "-"
            };

            bDec.Click += (btn, args) => { DoDifficulty(false); };
            _travelControl.Add(bDec);

            var bInc = new MogwaiButton(3, 1)
            {
                Position = new Point(38, 2),
                Text     = "+"
            };

            bInc.Click += (btn, args) => { DoDifficulty(true); };
            _travelControl.Add(bInc);

            DoDifficulty(false);
            DoAction(_currentAdventureType);
        }
Пример #3
0
        private void AddButton(int index, string text, Action <string> buttonClicked)
        {
            SetGlyph(10 + index * 11, TrailerPosition, 203, Color.DarkCyan);
            _controlsConsole.SetGlyph(10 + index * 11, 0, 186, Color.DarkCyan);
            _borderSurface.SetGlyph(11 + index * 11, TrailerPosition + 3, 202, Color.DarkCyan);
            var txt    = text;
            var button = new MogwaiButton(8, 1)
            {
                Position = new Point(1 + index * 11, 0),
                Text     = txt
            };

            button.Click += (btn, args) =>
            {
                buttonClicked(((MogwaiButton)btn).Text);
            };
            _controlsConsole.Add(button);
        }
Пример #4
0
        public void Init()
        {
            IsVisible = true;
            if (_controller.CurrentMogwai != null)
            {
                _controller.RefreshCurrent(1);
            }

            _command1.BorderSurface.SetGlyph(0, 0, 204, Color.DarkCyan);
            _command1.BorderSurface.SetGlyph(0, 1, 186, Color.DarkCyan);
            _command1.BorderSurface.SetGlyph(0, 2, 200, Color.DarkCyan);

            _playScreenButtons.Add("level", MenuButton(0, "level", DoAction));
            _playScreenButtons.Add("inven", MenuButton(1, "inven", DoAction));
            _playScreenButtons.Add("adven", MenuButton(2, "adven", DoAction));
            _playScreenButtons.Add("heal", MenuButton(3, "heal", DoAction));
            _playScreenButtons.Add("modif", MenuButton(4, "modif", DoAction));
            _playScreenButtons.Add("breed", MenuButton(5, "breed", DoAction));
            _playScreenButtons.Add("shop", MenuButton(6, "shop", DoAction));

            _btnEvolve = new MogwaiButton(8, 1)
            {
                Position = new Point(0, 0),
                Text     = "evolve"
            };
            _btnEvolve.Click += (btn, args) => { DoAction(((Button)btn).Text); };
            _command2.Add(_btnEvolve);

            _btnFast = new MogwaiButton(8, 1)
            {
                Position = new Point(0, 1),
                Text     = "evol++"
            };
            _btnFast.Click += (btn, args) => { DoAction(((Button)btn).Text); };
            _command2.Add(_btnFast);
        }