コード例 #1
0
 //location and displayed text
 public Scenario00(Game _game) : base(_game, "Dungeon Cell", "You slowly manage to open up your eyes. Fatigue and hunger have become your greatest enemies in this very cell you dont know how much time you have spent in. However, after a few minutes you manage to sit up crooked on your BED...which is as much ‚BED‘ as your sleep is actual sleep and  you feel like you have not even slept at all. You take a glance at your cell, while, in the background, the GUARDS continue their - almost intentionally you get the impression - loud conversation about how they are going to spend their evenings. Since you have spent a whole lot of time here in this sickeningly lousy place – it could be weeks but it could also be months – and you have lost track of time completely this is the only way to get information about the daytime...or anything about the outside world at all. Your cell is a surprisingly big one with a high ceiling you can move freely in and have some exercise in if you had the strength to do so. You can also fully stand up without problems and there also is a TOILET in here even if it is just a hole in the floor. It serves its purpose. The grey brick walls are wet and mossy and you have already learned better not to touch them if you wanna keep your last bit of hygiene. The scent of sweat and feces lies within the air and although you have become used to the mixture of smells you still feel disgusted and nauseous. You stand up from your BED. Your legs are weak but strong enough to support your scraggy body. Theres a rusty old iron bar DOOR hindering you from escaping.")
 {
     //inititalizing centered screens and item descriptions
     //doorscreen
     info_door = "The door is old and rusty. You are sure you could smash the lock easily with something solid. If you only had something like this and the guards would not be there...";
     csDoor    = new CenteredScreen(_game, GetLocation(), info_door);
 }
コード例 #2
0
ファイル: Settings.cs プロジェクト: JFronny/Lemonade
        public void Configure()
        {
            CenteredScreen settingsScreen = new CenteredScreen(200, 20, ConsoleColor.Black, Color)
            {
                TabPoint = 0,
                Title    = "Lemonade - Settings"
#if DEBUG
                           + "[R to redraw]"
#endif
            };
            Panel scr = settingsScreen.ContentPanel;

            scr.ForeColor = ConsoleColor.DarkGray;

            Label playerLabel = new Label("Players");

            playerLabel.Point = new Point(scr.Size.Width / 2 - playerLabel.Content.Length / 2, 3);
            scr.Controls.Add(playerLabel);

            Slider playerSlider = new Slider {
                MinValue = 1, Value = 2, Size = new Size(100, 1)
            };

            playerSlider.Point = new Point(scr.Size.Width / 2 - playerSlider.Size.Width / 2, 4);
            scr.Controls.Add(playerSlider);

            Label difficultyLabel = new Label("Difficulty");

            difficultyLabel.Point = new Point(scr.Size.Width / 2 - difficultyLabel.Content.Length / 2, 7);
            scr.Controls.Add(difficultyLabel);

            Slider difficulty = new Slider {
                Value = 5, Size = new Size(100, 1)
            };

            difficulty.Point = new Point(scr.Size.Width / 2 - difficulty.Size.Width / 2, 8);
            scr.Controls.Add(difficulty);

            CheckBox colorBox = new CheckBox("Color")
            {
                Checked = true
            };

            colorBox.Point           = new Point(scr.Size.Width / 2 - (colorBox.Content.Length + 4) / 2, 12);
            colorBox.CheckedChanged += (screen, args) => { settingsScreen.Color = colorBox.Checked; };
#if DEBUG
            settingsScreen.Input += (screen, args) =>
            {
                if (args.Info.Key == ConsoleKey.R)
                {
                    DiffDraw.Draw(Color, true);
                }
            };
#endif
            scr.Controls.Add(colorBox);

            Button okButton = new Button("OK");
            okButton.Point = new Point(scr.Size.Width / 2 - okButton.Content.Length / 2, 16);
            scr.Controls.Add(okButton);

            bool visible = true;
            okButton.Click       += (screen, args) => visible = false;
            settingsScreen.Close += (screen, args) => visible = false;

            if (!File.Exists(Settingsfile))
            {
                GenDef();
            }
            try {
                XElement conf = XElement.Parse(File.ReadAllText(Settingsfile));
                playerSlider.Value   = int.Parse(conf.Element("Players").Value);
                difficulty.Value     = int.Parse(conf.Element("Difficulty").Value);
                colorBox.Checked     = bool.Parse(conf.Element("Color").Value);
                settingsScreen.Color = colorBox.Checked;
            } catch { Debug.Fail("Failed to load settings"); }

            settingsScreen.Render();
            while (visible)
            {
                settingsScreen.ReadInput();
                Thread.Sleep(100);
            }
            PlayerCount      = playerSlider.Value;
            DifficultyFactor = difficulty.Value / 10f;
            Color            = colorBox.Checked;
            try
            {
                Gen(PlayerCount, difficulty.Value, Color);
            }
            catch { Debug.Fail("Failed to save settings"); }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: JFronny/CC-Functions
        private static void Main(string[] args)
        {
            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.White;
            Console.Clear();
            CenteredScreen cScreen = new CenteredScreen(40, 20, ConsoleColor.Green);
            Panel          screen  = cScreen.ContentPanel;
            Button         btn1    = new Button("Test")
            {
                Point     = new Point(2, 0),
                BackColor = ConsoleColor.DarkGreen
            };

            screen.Controls.Add(btn1);
            btn1.Click += (screen1, eventArgs) => { DiffDraw.Draw(true, true); };
            Label lab1 = new Label("Meem")
            {
                Point     = new Point(2, 1),
                BackColor = ConsoleColor.Green
            };

            screen.Controls.Add(lab1);
            screen.Controls.Add(new Label("Saas\nSoos")
            {
                Point     = new Point(2, 2),
                BackColor = ConsoleColor.Green
            });
            Button btn2 = new Button("X")
            {
                BackColor = ConsoleColor.Red,
                ForeColor = ConsoleColor.White
            };

            screen.Controls.Add(btn2);

            CheckBox box = new CheckBox("Are u gae?")
            {
                Point     = new Point(2, 3),
                BackColor = ConsoleColor.DarkGreen
            };

            screen.Controls.Add(box);
            box.CheckedChanged += (screen1, eventArgs) => { lab1.Content = box.Checked ? "Sas" : "Meem"; };

            TextBox tbox = new TextBox("Hello\nWorld1\n\nHow are u?")
            {
                Size      = new Size(20, 10),
                Point     = new Point(0, 6),
                BackColor = ConsoleColor.DarkYellow
            };

            screen.Controls.Add(tbox);

            Slider slider = new Slider
            {
                Point     = new Point(2, 4),
                Size      = new Size(16, 2),
                MaxValue  = 75,
                StepSize  = 14,
                MinValue  = -3,
                Value     = 7,
                BackColor = ConsoleColor.Magenta
            };

            screen.Controls.Add(slider);

            bool visible = true;

            btn2.Click         += (screen1, eventArgs) => visible = false;
            cScreen.Close      += (screen1, eventArgs) => visible = false;
            cScreen.TabChanged += (screen1, eventArgs) => btn1.Content = $"Test {cScreen.TabPoint}";
            cScreen.Render();
            while (visible)
            {
                Thread.Sleep(50);
                cScreen.ReadInput();
            }
            Console.ResetColor();
            Console.Clear();
            Console.WriteLine("Test2");
            Thread.Sleep(100);
            DiffDraw.Clear(10, 10);
            DiffDraw.Draw(true, false);
            Console.Clear();
            Console.WriteLine("Bye");
        }