Exemple #1
0
        //---------------------------------------------- Hotkeys ----------------------------------------------
        void AddHotkeysBar()
        {
            byte oneLength = (byte)(System.Math.Round(screen.screenSize.x / 10.0 - 6));

            System.Collections.Generic.List <OutputObj> obj = new List <OutputObj>(screen.screenSize.x);

            for (byte i = 0; i < 10; ++i)
            {
                string descript = GetHelpDescription(i);
                if (descript.Length < oneLength)
                {
                    descript += new string(' ', oneLength - descript.Length);
                }
                else if (descript.Length > oneLength)
                {
                    descript = descript.Substring(0, oneLength);
                }
                foreach (var o in FormatHotkey("F" + (i + 1).ToString(), descript))
                {
                    obj.Add(o);
                }
            }

            for (ushort i = (ushort)(obj.Count); i < obj.Capacity; ++i)
            {
                obj.Add(new OutputObj(' ', new DColor(ConsoleColor.Black, ConsoleColor.Gray)));
            }

            Element text = new ElementEternalText(obj.ToArray(), new Support.Coord((short)0, screen.screenSize.y - 1), 0);

            downDirector.AddElement(text);
        }
Exemple #2
0
        void CreateBackGround()
        {
            ushort i = 0;

            OutputObj[] obj;
            ElementText text;

            //head nav
            obj = new OutputObj[screen.screenSize.x - 10];
            for (i = 0; i < obj.Length; ++i)
            {
                obj[i] = new OutputObj(' ', new DColor(ConsoleColor.Black, ConsoleColor.Gray));
            }
            text = new ElementEternalText(obj, new Support.Coord(0, 0), 0);
            headDirector.AddElement(text);

            //Time
            obj = new OutputObj[10];
            for (i = 0; i < obj.Length; ++i)
            {
                obj[i] = new OutputObj(' ', new DColor(ConsoleColor.Green, ConsoleColor.Black));
            }
            text = new ElementTextFromFunc(obj, new Support.Coord(screen.screenSize.x - 10, 0), 0, () => ' ' + DateTime.Now.ToLongTimeString());
            headDirector.AddElement(text);


            //Hotkeys
            try {
                AddHotkeysBar();
            }
            catch (Exception) {
            }

            //Console
            obj = new OutputObj[screen.screenSize.x];
            for (i = 0; i < obj.Length; ++i)
            {
                obj[i] = new OutputObj(' ', new DColor(ConsoleColor.White, ConsoleColor.Black));
            }
            i = 0;
            foreach (char c in @"C:\>")
            {
                obj[i++].sym = c;
            }
            text = new ElementEternalText(obj, new Support.Coord((short)0, screen.screenSize.y - 2), 0);
            downDirector.AddElement(text);


            //frame
            obj = new OutputObj[screen.screenSize.x / 2];
            for (i = 0; i < obj.Length; ++i)
            {
                obj[i] = new OutputObj('═', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray));
            }
            obj[0].sym = '╔';
            obj[obj.Length - 1].sym = '╗';
            text = new ElementEternalText(obj, new Support.Coord(0, 1), 0);
            leftDirector.AddElement(text);

            text = new ElementEternalText(obj, new Support.Coord(screen.screenSize.x / 2, 1), 0);
            rightDirector.AddElement(text);

            obj = new OutputObj[screen.screenSize.x / 2];
            for (i = 0; i < obj.Length; ++i)
            {
                obj[i] = new OutputObj('═', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray));
            }
            obj[0].sym = '╚';
            obj[obj.Length - 1].sym = '╝';
            text = new ElementEternalText(obj, new Support.Coord(0, screen.screenSize.y - 3), 0);
            leftDirector.AddElement(text);

            text = new ElementEternalText(obj, new Support.Coord(screen.screenSize.x / 2, screen.screenSize.y - 3), 0);
            rightDirector.AddElement(text);

            leftDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 5), new OutputObj('║', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord(0, 2), 0));
            leftDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 5), new OutputObj('║', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord(obj.Length - 1, 2), 0));

            rightDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 5), new OutputObj('║', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((int)(screen.screenSize.x / 2), 2), 0));
            rightDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 5), new OutputObj('║', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((int)(obj.Length - 1 + screen.screenSize.x / 2), 2), 0));

            leftDirector.AddElement(new ElemenEternaltHLine((short)(screen.screenSize.x / 2 - 2), new OutputObj('─', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord(1, screen.screenSize.y - 7), 0));
            rightDirector.AddElement(new ElemenEternaltHLine((short)(screen.screenSize.x / 2 - 2), new OutputObj('─', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((short)(1 + screen.screenSize.x / 2), screen.screenSize.y - 7), 0));

            leftDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 9), new OutputObj('│', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((int)(screen.screenSize.x / 6), 2), 0));
            leftDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 9), new OutputObj('│', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((int)(screen.screenSize.x / 3), 2), 0));

            rightDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 9), new OutputObj('│', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((int)(screen.screenSize.x / 6 + screen.screenSize.x / 2), 2), 0));
            rightDirector.AddElement(new ElementEternalVLine((short)(screen.screenSize.y - 9), new OutputObj('│', new DColor(ConsoleColor.Cyan, ConsoleColor.DarkGray)), new Support.Coord((int)(screen.screenSize.x / 3 + screen.screenSize.x / 2), 2), 0));
        }