PhotoShaman

Doors OS v1.02

Jul 19th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 29.02 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Threading;
  7.  
  8.  
  9. namespace ConsoleApplication65
  10. {
  11.     class Program
  12.     {
  13.         private static int x, y, timeStart, xBox, yBox, xPBox, yPBox, color;
  14.         private static bool StartOpen, FolderOpen, DrawingOpen, Drawing,  SaveOrLoadOpen, Exit, SaveDrawing,
  15.                             Image1Save = false, Image2Save = false, Image3Save = false, Kitty = false, ToUpDate = true;
  16.         private static int[,] image, AnimationSettins1, AnimationSettins2;
  17.         private static int[,] DrawingSaveMain = new int[18, 52];
  18.         private static int[,] DrawingSave1, DrawingSave2, DrawingSave3 = new int[18, 52];
  19.  
  20.         static void Main()
  21.         {
  22.             Settings();
  23.             LoadingDraw();
  24.             OperatingSystem();
  25.         }
  26.  
  27.         private static void Settings()
  28.         {
  29.             timeStart = TimeCheck();
  30.             StartOpen = false;
  31.             FolderOpen = false;
  32.             DrawingOpen = false;
  33.             Exit = false;
  34.             color = 1;
  35.  
  36.             Console.SetWindowSize(120, 30);
  37.             Console.Title = "Doors OS";
  38.  
  39.             x = 2;
  40.             y = Console.WindowHeight - 5;
  41.  
  42.             ResetDrawingSaveMain();
  43.         }
  44.  
  45.         private static void ResetDrawingSaveMain()
  46.         {
  47.             for (int i = 0; i <= 17; i++)
  48.             {
  49.                 for (int j = 0; j <= 50; j++)
  50.                 {
  51.                     DrawingSaveMain[i, j] = 15;
  52.                 }
  53.                 DrawingSaveMain[i, 51] = 0;
  54.             }
  55.         }
  56.  
  57.         private static int TimeCheck()
  58.         {
  59.             int timeReturn;
  60.             string curTimeShort = DateTime.Now.ToString("mm");
  61.             timeReturn = Convert.ToInt32(curTimeShort);
  62.             return timeReturn;
  63.         }
  64.  
  65.         private static void LoadingAnimationSettings()
  66.         {
  67.             AnimationSettins1 = new int[,]
  68.                 {
  69.                 {1,1,10,5,45,7,0},
  70.                 {0,2,10,5,65,7,0},
  71.                 {0,3,10,5,45,17,0},
  72.                 {0,4,10,5,65,17,200},
  73.                 {1,1,10,5,47,8,0},
  74.                 {0,2,10,5,63,8,0},
  75.                 {0,3,10,5,47,16,0},
  76.                 {0,4,10,5,63,16,300},
  77.                 {1,1,10,5,50,10,0},
  78.                 {0,2,10,5,60,10,0},
  79.                 {0,3,10,5,50,15,0},
  80.                 {0,4,10,5,60,15,300},
  81.                 {1,1,10,10,50,5,0},
  82.                 {0,2,10,10,60,5,0},
  83.                 {0,3,10,10,50,15,0},
  84.                 {0,4,10,10,60,15,300},
  85.                 {1,1,10,10,50,5,0},
  86.                 {0,2,10,10,60,5,0},
  87.                 {0,4,10,10,60,15,0},
  88.                 {0,3,15,15,50,10,200},
  89.                 {1,3,20,20,50,5,200},
  90.                 {0,5,2,1,65,15,0}
  91.                 };
  92.             AnimationSettins2 = new int[,]
  93.                 {
  94.                 {1,34,13,100},
  95.                 {2,46,13,100},
  96.                 {2,56,13,100},
  97.                 {3,66,13,100},
  98.                 {4,76,13,100},
  99.                 {2,88,13,100},
  100.                 {4,98,13,2000}
  101.                 };
  102.         }
  103.  
  104.         private static void LoadingDraw()
  105.         {
  106.             Console.CursorVisible = false;
  107.  
  108.             LoadingAnimationSettings();
  109.  
  110.             for (int p = 0; p <= 21; p++)
  111.             {
  112.                 if (AnimationSettins1[p, 0] == 1)
  113.                 {
  114.                     Console.ResetColor();
  115.                     Console.Clear();
  116.                 }
  117.                 if (AnimationSettins1[p, 1] == 1)
  118.                 {
  119.                     Console.BackgroundColor = ConsoleColor.Red;
  120.                 }
  121.                 if (AnimationSettins1[p, 1] == 2)
  122.                 {
  123.                     Console.BackgroundColor = ConsoleColor.Green;
  124.                 }
  125.                 if (AnimationSettins1[p, 1] == 3)
  126.                 {
  127.                     Console.BackgroundColor = ConsoleColor.Blue;
  128.                 }
  129.                 if (AnimationSettins1[p, 1] == 4)
  130.                 {
  131.                     Console.BackgroundColor = ConsoleColor.Yellow;
  132.                 }
  133.                 if (AnimationSettins1[p, 1] == 5)
  134.                 {
  135.                     Console.BackgroundColor = ConsoleColor.Black;
  136.                 }
  137.                 xBox = AnimationSettins1[p, 2];
  138.                 yBox = AnimationSettins1[p, 3];
  139.                 xPBox = AnimationSettins1[p, 4];
  140.                 yPBox = AnimationSettins1[p, 5];
  141.                 Box(xBox, yBox, xPBox, yPBox);
  142.                 Thread.Sleep(AnimationSettins1[p, 6]);
  143.             }
  144.  
  145.             for (int i = 1; i <= 40; i++)
  146.             {
  147.                 Console.ResetColor();
  148.                 Console.Clear();
  149.                 Console.BackgroundColor = ConsoleColor.Blue;
  150.                 Box(20, 20, (Console.WindowWidth / 2) - 10 - i, (Console.WindowHeight / 2) - 10);
  151.                 Console.BackgroundColor = ConsoleColor.Black;
  152.                 Box(2, 1, (Console.WindowWidth / 2) + 5 - i, Console.WindowHeight / 2);
  153.                 Thread.Sleep(10);
  154.             }
  155.  
  156.             for (int p = 0; p <= 6; p++)
  157.             {
  158.                 ChooseImage(AnimationSettins2[p, 0]);
  159.                 DrawImage(AnimationSettins2[p, 1], AnimationSettins2[p, 2]);
  160.                 Thread.Sleep(AnimationSettins2[p, 3]);
  161.             }
  162.  
  163.             Console.CursorVisible = true;
  164.  
  165.         }
  166.  
  167.         private static void Box(int Width, int Height, int XPos, int YPos)
  168.         {
  169.             for (int i = 0; i < Height; i++)
  170.             {
  171.                 Console.SetCursorPosition(XPos, YPos);
  172.                 Console.Write(" ".PadRight(Width));
  173.                 YPos++;
  174.             }
  175.         }
  176.  
  177.         private static void DrawImage(int m, int n)
  178.         {
  179.             Console.ResetColor();
  180.  
  181.             Console.SetCursorPosition(m, n);
  182.  
  183.             for (int i = 0; i < image.GetLength(0); i++)
  184.             {
  185.                 for (int j = 0; j < image.GetLength(1); j++)
  186.                 {
  187.                     if (image[i, j] == 0)
  188.                     {
  189.                         n++;
  190.                         Console.SetCursorPosition(m, n);
  191.                     }
  192.                     else if (image[i, j] > 0)
  193.                     {
  194.                         ChooseColor(image[i, j]);
  195.                         Console.Write("  ");
  196.                     }
  197.                 }
  198.             }
  199.             Console.SetCursorPosition(0, 0);
  200.         }
  201.  
  202.         private static void ChooseColor(int number)
  203.         {
  204.             if (number == 1)
  205.                 Console.BackgroundColor = ConsoleColor.Black;
  206.             if (number == 2)
  207.                 Console.BackgroundColor = ConsoleColor.Blue;
  208.             if (number == 3)
  209.                 Console.BackgroundColor = ConsoleColor.Cyan;
  210.             if (number == 4)
  211.                 Console.BackgroundColor = ConsoleColor.DarkBlue;
  212.             if (number == 5)
  213.                 Console.BackgroundColor = ConsoleColor.DarkCyan;
  214.             if (number == 6)
  215.                 Console.BackgroundColor = ConsoleColor.DarkGray;
  216.             if (number == 7)
  217.                 Console.BackgroundColor = ConsoleColor.DarkGreen;
  218.             if (number == 8)
  219.                 Console.BackgroundColor = ConsoleColor.DarkMagenta;
  220.             if (number == 9)
  221.                 Console.BackgroundColor = ConsoleColor.DarkRed;
  222.             if (number == 10)
  223.                 Console.BackgroundColor = ConsoleColor.DarkYellow;
  224.             if (number == 11)
  225.                 Console.BackgroundColor = ConsoleColor.Gray;
  226.             if (number == 12)
  227.                 Console.BackgroundColor = ConsoleColor.Green;
  228.             if (number == 13)
  229.                 Console.BackgroundColor = ConsoleColor.Magenta;
  230.             if (number == 14)
  231.                 Console.BackgroundColor = ConsoleColor.Red;
  232.             if (number == 15)
  233.                 Console.BackgroundColor = ConsoleColor.White;
  234.             if (number == 16)
  235.                 Console.BackgroundColor = ConsoleColor.Yellow;
  236.         }
  237.  
  238.         private static void ChooseImage(int i)
  239.         {
  240.             if (i == 0)
  241.             {
  242.                 if (Kitty)
  243.                 {
  244.                     image = new int[,] //Kitty
  245.                     {
  246.                 {2 ,1 ,1 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,1 ,1 ,2 ,2 ,0},
  247.                 {2 ,1 ,11,1 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,1 ,11,11,1 ,2 ,0},
  248.                 {2 ,1 ,11,11,1 ,2 ,2 ,2 ,2 ,2 ,1 ,11,11,11,1 ,2 ,0},
  249.                 {2 ,1 ,11,11,11,1 ,1 ,1 ,1 ,1 ,11,11,11,11,1 ,2 ,0},
  250.                 {1 ,11,11,11,11,11,11,11,11,11,11,11,11,11,1 ,2 ,0},
  251.                 {1 ,11,11,11,11,11,11,11,11,11,11,11,11,11,1 ,2 ,0},
  252.                 {1 ,11,11,11,11,11,11,11,11,11,11,11,11,11,11,1 ,0},
  253.                 {1 ,11,11,11,15,1 ,11,11,11,11,11,15,1 ,11,11,1 ,0},
  254.                 {1 ,11,11,11,1 ,1 ,11,11,11,1 ,11,1 ,1 ,11,11,1 ,0},
  255.                 {1 ,11,9 ,9 ,11,11,11,11,11,11,11,11,11,9 ,9 ,1 ,0},
  256.                 {1 ,11,9 ,9 ,11,1 ,11,11,1 ,11,11,1 ,11,9 ,9 ,1 ,0},
  257.                 {2 ,1 ,11,11,11,11,1 ,1 ,11,1 ,1 ,11,11,11,1 ,2 ,0},
  258.                 {2 ,2 ,1 ,11,11,11,11,11,11,11,11,11,11,1 ,2 ,2 ,0},
  259.                 {2 ,2 ,2 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,2 ,2 ,2 ,0}
  260.                     };
  261.                 }
  262.                 else
  263.                 {
  264.                     image = new int[,] //Mario
  265.             {
  266.                 {2 ,2 ,2 ,14,14,14,14,14,2 ,2 ,2 ,2 ,0},
  267.                 {2 ,2 ,14,14,14,14,14,14,14,14,14,2 ,0},
  268.                 {2 ,2 ,9 ,9 ,9 ,15,15,1 ,15,2 ,2 ,2 ,0},
  269.                 {2 ,9 ,15,9 ,15,15,15,1 ,15,15,15,2 ,0},
  270.                 {2 ,9 ,15,9 ,9 ,15,15,15,9 ,15,15,15,0},
  271.                 {2 ,9 ,9 ,15,15,15,15,9 ,9 ,9 ,9 ,2 ,0},
  272.                 {2 ,2 ,2 ,15,15,15,15,15,15,15,2 ,2 ,0},
  273.                 {2 ,2 ,14,14,4 ,14,14,14,2 ,2 ,2 ,2 ,0},
  274.                 {2 ,14,14,14,4 ,14,14,4 ,14,14,14,2 ,0},
  275.                 {14,14,14,14,4 ,4 ,4 ,4 ,14,14,14,14,0},
  276.                 {15,15,14,4 ,16,4 ,4 ,16,4 ,14,15,15,0},
  277.                 {15,15,15,4 ,4 ,4 ,4 ,4 ,4 ,15,15,15,0},
  278.                 {15,15,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,15,15,0},
  279.                 {2 ,2 ,4 ,4 ,4 ,2 ,2 ,4 ,4 ,4 ,2 ,2 ,0},
  280.                 {2 ,9 ,9 ,9 ,2 ,2 ,2 ,2 ,9 ,9 ,9 ,2 ,0},
  281.                 {9 ,9 ,9 ,9 ,2 ,2 ,2 ,2 ,9 ,9 ,9 ,9 ,0}
  282.             };
  283.                 }
  284.             }
  285.             if (i == 1)
  286.             {
  287.                 image = new int[,]
  288.                 {
  289.                 {15,15,15,15,1 ,0},
  290.                 {15,1 ,1 ,1 ,15,0},
  291.                 {15,1 ,1 ,1 ,15,0},
  292.                 {15,1 ,1 ,1 ,15,0},
  293.                 {15,15,15,15,1 ,0},
  294.                 };
  295.             }
  296.             if (i == 2)
  297.             {
  298.                 image = new int[,]
  299.                 {
  300.                 {15,15,15,15,0},
  301.                 {15,1 ,1 ,15,0},
  302.                 {15,1 ,1 ,15,0},
  303.                 {15,1 ,1 ,15,0},
  304.                 {15,15,15,15,0},
  305.                 };
  306.             }
  307.             if (i == 3)
  308.             {
  309.                 image = new int[,]
  310.                 {
  311.                 {15,15,15,15,0},
  312.                 {15,1 ,1 ,15,0},
  313.                 {15,15,15,15,0},
  314.                 {15,1 ,15,1 ,0},
  315.                 {15,1 ,15,1 ,0},
  316.                 };
  317.             }
  318.             if (i == 4)
  319.             {
  320.                 image = new int[,]
  321.                 {
  322.                 {15,15,15,0},
  323.                 {15,1 ,1 ,0},
  324.                 {15,15,15,0},
  325.                 {1 ,1 ,15,0},
  326.                 {15,15,15,0},
  327.                 };
  328.             }
  329.             if (i == 5)
  330.             {
  331.                 image = new int[,]
  332.                 {
  333.                 {1 ,0},
  334.                 {2 ,0},
  335.                 {3 ,0},
  336.                 {4 ,0},
  337.                 {5 ,0},
  338.                 {6 ,0},
  339.                 {7 ,0},
  340.                 {8 ,0},
  341.                 {9 ,0},
  342.                 {10,0},
  343.                 {11,0},
  344.                 {12,0},
  345.                 {13,0},
  346.                 {14,0},
  347.                 {15,0},
  348.                 {16,0}
  349.                 };
  350.             }
  351.             if(i == 6)
  352.             {
  353.                 image = DrawingSaveMain;
  354.             }
  355.         }
  356.  
  357.         private static void MoveCursor()
  358.         {
  359.             Update();
  360.  
  361.             Console.SetCursorPosition(x, y);
  362.  
  363.             ConsoleKey k = Console.ReadKey(true).Key;
  364.  
  365.             if (k == ConsoleKey.D || k == ConsoleKey.RightArrow)
  366.             {
  367.                 x += 2;
  368.                 if (x > Console.WindowWidth - 3)
  369.                 {
  370.                     x = 2;
  371.                 }
  372.             }
  373.             if (k == ConsoleKey.A || k == ConsoleKey.LeftArrow)
  374.             {
  375.                 x -= 2;
  376.                 if (x < 1)
  377.                 {
  378.                     x = Console.WindowWidth - 4;
  379.                 }
  380.             }
  381.             if (k == ConsoleKey.W || k == ConsoleKey.UpArrow)
  382.             {
  383.                 y -= 1;
  384.                 if (y < 1)
  385.                 {
  386.                     y = Console.WindowHeight - 2;
  387.                 }
  388.             }
  389.             if (k == ConsoleKey.S || k == ConsoleKey.DownArrow)
  390.             {
  391.                 y += 1;
  392.                 if (y > Console.WindowHeight - 2)
  393.                 {
  394.                     y = 1;
  395.                 }
  396.             }
  397.             if (k == ConsoleKey.Enter || k == ConsoleKey.Spacebar)
  398.             {
  399.                 Bottoms();
  400.             }
  401.         }
  402.  
  403.         private static void Time()
  404.         {
  405.             Console.BackgroundColor = ConsoleColor.Green;
  406.             Console.ForegroundColor = ConsoleColor.Black;
  407.             Console.SetCursorPosition(Console.WindowWidth - 28, Console.WindowHeight - 3);
  408.             Console.Write(DateTime.Now.ToString("dd MMMM yyyy | HH:mm:ss"));
  409.             Console.ResetColor();
  410.         }
  411.  
  412.         private static void Bottoms()
  413.         {
  414.             if (x <= 10 && y >= Console.WindowHeight - 4 && !StartOpen)
  415.             {
  416.                 StartOpen = true;
  417.                 StartDraw();
  418.             }
  419.             else if (x <= 10 && y >= Console.WindowHeight - 4 && StartOpen)
  420.             {
  421.                 StartOpen = false;
  422.                 OperatingSystem();
  423.             }
  424.             else if (x <= 26 && (y > Console.WindowHeight - 27) && (y < Console.WindowHeight - 23) && StartOpen)
  425.             {
  426.                 FolderOpen = true;
  427.                 StartOpen = false;
  428.                 OperatingSystem();
  429.             }
  430.             else if (x <= 26 && (y > Console.WindowHeight - 23) && (y < Console.WindowHeight - 19) && StartOpen)
  431.             {
  432.                 DrawingOpen = true;
  433.                 Drawing = true;
  434.                 StartOpen = false;
  435.                 OperatingSystem();
  436.             }
  437.             else if (x == 6 && y >= 7 && y <= 22 && DrawingOpen)
  438.             {
  439.                 for (int i = 7; i <= 22; i++)
  440.                 {
  441.                     if (y == i)
  442.                     {
  443.                         color = i - 6;
  444.                     }
  445.                 }
  446.             }
  447.             else if (x >= 64 && x <= 72 && y == 6 && SaveOrLoadOpen)
  448.             {
  449.                 Drawing = true;
  450.                 SaveOrLoadOpen = false;
  451.                 OperatingSystem();
  452.             }
  453.             else if (x >= 64 && x <= 76 && (y == 8 || y == 10 || y == 12) && SaveOrLoadOpen)
  454.             {
  455.                 if (SaveDrawing)
  456.                 {
  457.                     if (y == 8)
  458.                     {
  459.                         Image1Save = true;
  460.                         Array.Copy(DrawingSaveMain, DrawingSave1 = new int[18, 52], DrawingSaveMain.Length);
  461.                     }
  462.                     if (y == 10)
  463.                     {
  464.                         Image2Save = true;
  465.                         Array.Copy(DrawingSaveMain, DrawingSave2 = new int[18, 52], DrawingSaveMain.Length);
  466.                     }
  467.                     if (y == 12)
  468.                     {
  469.                         Image3Save = true;
  470.                         Array.Copy(DrawingSaveMain, DrawingSave3 = new int[18, 52], DrawingSaveMain.Length);
  471.                     }
  472.                 }
  473.                 else
  474.                 {
  475.                     if (y == 8)
  476.                         if (Image1Save)
  477.                             Array.Copy(DrawingSave1, DrawingSaveMain = new int[18, 52], DrawingSave1.Length);
  478.                     if (y == 10)
  479.                         if (Image2Save)
  480.                             Array.Copy(DrawingSave2, DrawingSaveMain = new int[18, 52], DrawingSave1.Length);
  481.                     if (y == 12)
  482.                         if (Image3Save)
  483.                             Array.Copy(DrawingSave3, DrawingSaveMain = new int[18, 52], DrawingSave1.Length);
  484.                 }
  485.                 Drawing = true;
  486.                 SaveOrLoadOpen = false;
  487.                 OperatingSystem();
  488.             }
  489.             else if (x>= 12 && x <= 30 && y == 4 && DrawingOpen && Drawing)
  490.             {
  491.                 ResetDrawingSaveMain();
  492.                 OperatingSystem();
  493.             }
  494.             else if (x >= 12 && x <= 112 && y >= 6 && y <= 23 && DrawingOpen && Drawing)
  495.             {
  496.                 DrawingSaveMain[y - 6, (x - 12) / 2] = color;
  497.                 ChooseColor(color);
  498.                 Console.Write("  ");
  499.             }
  500.             else if (x >= 40 && x <= 80 && y == 4 && DrawingOpen)
  501.             {
  502.                 SaveOrLoadOpen = true;
  503.                 if (x >= 40 && x <= 53)
  504.                 {
  505.                     Drawing = false;
  506.                     SaveDrawing = true;
  507.                     SaveOrLoadDrawingDraw();
  508.                 }
  509.                 else if (x >= 66 && x <= 78)
  510.                 {
  511.                     Drawing = false;
  512.                     SaveDrawing = false;
  513.                     SaveOrLoadDrawingDraw();
  514.                 }
  515.             }
  516.             else if (x <= 26 && (y > Console.WindowHeight - 8) && (y < Console.WindowHeight - 4) && StartOpen)
  517.             {
  518.                 Exit = true;
  519.                 StartOpen = false;
  520.                 OperatingSystem();
  521.             }
  522.             else if (x >= Console.WindowWidth - 18 && x <= Console.WindowWidth - 6 && y == Console.WindowHeight - 28 && FolderOpen)
  523.             {
  524.                 FolderOpen = false;
  525.                 OperatingSystem();
  526.             }
  527.             else if (x >= Console.WindowWidth - 18 && x <= Console.WindowWidth - 6 && y == 2 && DrawingOpen)
  528.             {
  529.                 SaveOrLoadOpen = false;
  530.                 DrawingOpen = false;
  531.                 OperatingSystem();
  532.             }
  533.             else if (x >= Console.WindowWidth - 74 && x <= Console.WindowWidth - 66 && y >= 16 && y <= Console.WindowHeight - 12 && Exit)
  534.             {
  535.                 Exit = false;
  536.                 OperatingSystem();
  537.             }
  538.             else if (x >= Console.WindowWidth - 56 && x <= Console.WindowWidth - 48 && y >= 16 && y <= Console.WindowHeight - 12 && Exit)
  539.             {
  540.                 System.Environment.Exit(1);
  541.             }
  542.         }
  543.  
  544.         private static void UIDraw()
  545.         {
  546.             Console.BackgroundColor = ConsoleColor.Blue;
  547.             Box(Console.WindowWidth - 4, Console.WindowHeight - 5, 2, 1);
  548.  
  549.             Console.BackgroundColor = ConsoleColor.DarkCyan;
  550.             Box(Console.WindowWidth - 43, 3, 11, (Console.WindowHeight - 4));
  551.  
  552.             for (int i = 1; i <= 3; i++)
  553.             {
  554.                 Console.SetCursorPosition(12, Console.WindowHeight - i - 1);
  555.                 Console.Write("║");
  556.             }
  557.  
  558.             Console.BackgroundColor = ConsoleColor.Green;
  559.             Box(9, 3, 2, (Console.WindowHeight - 4));
  560.  
  561.             Box(30, 3, (Console.WindowWidth - 32), (Console.WindowHeight - 4));
  562.  
  563.             Console.ForegroundColor = ConsoleColor.Black;
  564.             Console.SetCursorPosition(4, Console.WindowHeight - 3);
  565.             Console.Write("Старт");
  566.  
  567.             if (!FolderOpen && !DrawingOpen && !Exit)
  568.             {
  569.                 ChooseImage(0);
  570.  
  571.                 DrawImage((Console.WindowWidth / 2 - 16), (Console.WindowHeight - 18) / 2);
  572.             }
  573.  
  574.             if (StartOpen)
  575.             {
  576.                 StartDraw();
  577.             }
  578.             if (FolderOpen)
  579.             {
  580.                 FolderDraw();
  581.             }
  582.             if (DrawingOpen)
  583.             {
  584.                 DrawingDraw();
  585.             }
  586.             if (Exit)
  587.             {
  588.                 ExitDraw();
  589.             }
  590.             Console.BackgroundColor = ConsoleColor.Black;
  591.         }
  592.  
  593.         private static void StartDraw()
  594.         {
  595.             Console.BackgroundColor = ConsoleColor.Black;
  596.             Box(26, 1, 2, Console.WindowHeight - 23);
  597.  
  598.             Console.ForegroundColor = ConsoleColor.White;
  599.             Console.SetCursorPosition(2, Console.WindowHeight - 28);
  600.             Console.Write("USER PC           DOORS OS");
  601.  
  602.             Console.BackgroundColor = ConsoleColor.White;
  603.             Box(26, Console.WindowHeight - 10, 2, Console.WindowHeight - 27);
  604.  
  605.             Console.BackgroundColor = ConsoleColor.Red;
  606.             Box(26, 3, 2, Console.WindowHeight - 7);
  607.  
  608.             Console.ForegroundColor = ConsoleColor.Black;
  609.             Console.SetCursorPosition(6, Console.WindowHeight - 6);
  610.             Console.Write("Завершение работы");
  611.  
  612.             Console.BackgroundColor = ConsoleColor.Yellow;
  613.             Box(26, 3, 2, Console.WindowHeight - 26);
  614.  
  615.             Console.ForegroundColor = ConsoleColor.Black;
  616.             Console.SetCursorPosition(6, Console.WindowHeight - 25);
  617.             Console.Write("Папка с файлами");
  618.  
  619.             Console.BackgroundColor = ConsoleColor.Cyan;
  620.             Box(26, 3, 2, Console.WindowHeight - 22);
  621.  
  622.             Console.ForegroundColor = ConsoleColor.Black;
  623.             Console.SetCursorPosition(6, Console.WindowHeight - 21);
  624.             Console.Write("Рисовалка");
  625.         }
  626.  
  627.         private static void ExitDraw()
  628.         {
  629.             Console.BackgroundColor = ConsoleColor.Black;
  630.             Box(32, 3, (Console.WindowWidth - 32) / 2, (Console.WindowHeight - 10) / 2);
  631.  
  632.             Console.ForegroundColor = ConsoleColor.White;
  633.             Console.SetCursorPosition((Console.WindowWidth - 20) / 2, (Console.WindowHeight - 8) / 2);
  634.             Console.Write("Выключить Doors OS?");
  635.  
  636.             Console.BackgroundColor = ConsoleColor.Cyan;
  637.             Box(32, 7, (Console.WindowWidth - 32) / 2, Console.WindowHeight - 17);
  638.  
  639.             Console.BackgroundColor = ConsoleColor.Red;
  640.             Box(10, 3, Console.WindowWidth - 74, Console.WindowHeight - 14);
  641.  
  642.             Console.ForegroundColor = ConsoleColor.Black;
  643.             Console.SetCursorPosition(Console.WindowWidth - 71, Console.WindowHeight - 13);
  644.             Console.Write("Нет");
  645.  
  646.             Console.BackgroundColor = ConsoleColor.Green;
  647.             Box(10, 3, Console.WindowWidth - 56, Console.WindowHeight - 14);
  648.  
  649.             Console.SetCursorPosition(Console.WindowWidth - 52, Console.WindowHeight - 13);
  650.             Console.Write("Да");
  651.         }
  652.  
  653.         private static void FolderDraw()
  654.         {
  655.             Console.BackgroundColor = ConsoleColor.Black;
  656.             Box(Console.WindowWidth - 8, 1, 4, Console.WindowHeight - 28);
  657.  
  658.             Console.ForegroundColor = ConsoleColor.White;
  659.             Console.SetCursorPosition(4, Console.WindowHeight - 28);
  660.             Console.Write("Папка с файлами");
  661.  
  662.             Console.BackgroundColor = ConsoleColor.Red;
  663.             Box(14, 1, Console.WindowWidth - 18, Console.WindowHeight - 28);
  664.  
  665.             Console.ForegroundColor = ConsoleColor.Black;
  666.             Console.SetCursorPosition(Console.WindowWidth - 16, Console.WindowHeight - 28);
  667.             Console.Write("Закрыть[X]");
  668.  
  669.             Console.BackgroundColor = ConsoleColor.White;
  670.             Box(Console.WindowWidth - 8, Console.WindowHeight - 8, 4, Console.WindowHeight - 27);
  671.  
  672.             Console.ForegroundColor = ConsoleColor.Black;
  673.             Console.SetCursorPosition(8, Console.WindowHeight - 26);
  674.             Console.Write("Файлов и функционала пока нет, но Вы там держитесь!");
  675.         }
  676.  
  677.         private static void DrawingDraw()
  678.         {
  679.             Console.BackgroundColor = ConsoleColor.Black;
  680.             Console.ForegroundColor = ConsoleColor.Gray;
  681.             Console.SetCursorPosition(4, 2);
  682.             Console.Write("Рисовалка".PadRight(98));
  683.  
  684.             Console.BackgroundColor = ConsoleColor.Red;
  685.             Console.ForegroundColor = ConsoleColor.Black;
  686.             Console.SetCursorPosition(102, 2);
  687.             Console.Write("  Закрыть[X]  ");
  688.  
  689.             Console.BackgroundColor = ConsoleColor.Gray;
  690.             Box(112, 22, 4, 3);
  691.  
  692.             Console.SetCursorPosition(5, 4);
  693.             Console.Write("Цвет:");
  694.  
  695.             Console.SetCursorPosition(5, 6);
  696.             Console.Write("╔══╗");
  697.  
  698.             for (int i = 1; i <= 16; i++)
  699.             {
  700.                 Console.SetCursorPosition(5, 6 + i);
  701.                 Console.Write("║  ║");
  702.             }
  703.  
  704.             Console.SetCursorPosition(5, 23);
  705.             Console.Write("╚══╝");
  706.  
  707.             Console.BackgroundColor = ConsoleColor.Black;
  708.             Console.ForegroundColor = ConsoleColor.White;
  709.  
  710.             Console.SetCursorPosition(12, 4);
  711.             Console.Write("  Очистить полотно  ");
  712.  
  713.             Console.SetCursorPosition(40, 4);
  714.             Console.Write("  Сохранить   ");
  715.  
  716.             Console.SetCursorPosition(66, 4);
  717.             Console.Write("  Загрузить   ");
  718.  
  719.             ChooseImage(5);
  720.             DrawImage(6, 7);
  721.  
  722.             ChooseImage(6);
  723.             DrawImage(12, 6);
  724.  
  725.             if (SaveOrLoadOpen)
  726.             {
  727.                 SaveOrLoadDrawingDraw();
  728.             }
  729.         }
  730.  
  731.         private static void SaveOrLoadDrawingDraw()
  732.         {
  733.             Console.BackgroundColor = ConsoleColor.DarkCyan;
  734.             Box(40,9,40,5);
  735.             string chooseText;
  736.  
  737.             string chooseCell;
  738.             string SaveOrLoad;
  739.  
  740.             if (SaveDrawing)
  741.             {
  742.                 chooseText = "ячейки  ";
  743.                 chooseCell = "ячейка  ";
  744.                 SaveOrLoad = "  Сохранить   ";
  745.             }
  746.             else
  747.             {
  748.                 chooseText = "картинки  ";
  749.                 chooseCell = "картинка  ";
  750.                 SaveOrLoad = "  Загрузить   ";
  751.             }
  752.  
  753.             Console.ForegroundColor = ConsoleColor.White;
  754.             Console.SetCursorPosition(42, 6);
  755.             Console.Write("Выбор {0}", chooseText);
  756.  
  757.             Console.BackgroundColor = ConsoleColor.White;
  758.             Console.ForegroundColor = ConsoleColor.Black;
  759.  
  760.             for (int i = 1; i <= 3; i++)
  761.             {
  762.                 Console.SetCursorPosition(42, 6 + i * 2);
  763.                 Console.Write("{0} {1}", i, chooseCell);
  764.  
  765.                 Console.SetCursorPosition(64, 6 + i * 2);
  766.                 Console.Write(SaveOrLoad);
  767.             }
  768.             Console.SetCursorPosition(64, 6);
  769.             Console.Write("  Отмена  ");
  770.         }
  771.  
  772.         private static void UpdateDraw()
  773.         {
  774.             Console.CursorVisible = false;
  775.  
  776.             Console.BackgroundColor = ConsoleColor.Blue;
  777.             Box(Console.WindowWidth - 4, Console.WindowHeight - 2, 2, 1);
  778.  
  779.             Console.ForegroundColor = ConsoleColor.White;
  780.             string UpdateDoorsOS = "Обновление Doors OS";
  781.             string EverythingIsFine = "Все нормально. Это может занять некоторое время.";
  782.  
  783.             Console.SetCursorPosition((Console.WindowWidth - UpdateDoorsOS.Length) / 2, (Console.WindowHeight / 2) - 10);
  784.             Console.WriteLine(UpdateDoorsOS);
  785.  
  786.             Console.SetCursorPosition((Console.WindowWidth - EverythingIsFine.Length) / 2, (Console.WindowHeight / 2) - 8);
  787.             Console.WriteLine(EverythingIsFine);
  788.  
  789.             int ProgressPersents = 0;
  790.  
  791.             while (ProgressPersents < 100)
  792.             {
  793.                 Random r = new Random();
  794.                 int ProgressPlus = r.Next(0, 6);
  795.  
  796.                 if (ProgressPersents > 95)
  797.                 {
  798.                     ProgressPlus = 100 - ProgressPersents;
  799.                 }
  800.  
  801.                 ProgressPersents += ProgressPlus;
  802.  
  803.                 string Progress = "Выполнено: " + ProgressPersents + " % ";
  804.  
  805.                 Console.SetCursorPosition((Console.WindowWidth - Progress.Length) / 2, (Console.WindowHeight / 2) - 4);
  806.                 Console.WriteLine(Progress);
  807.  
  808.                 Thread.Sleep(400);
  809.                 Console.CursorVisible = true;
  810.             }
  811.         }
  812.  
  813.         private static void Update()
  814.         {
  815.             if ((timeStart + 2) <= TimeCheck() && ToUpDate)
  816.             {
  817.                 Kitty = true;
  818.                 ToUpDate = false;
  819.                 UpdateDraw();
  820.                 Main();
  821.             }
  822.         }
  823.  
  824.         private static void OperatingSystem()
  825.         {
  826.             UIDraw();
  827.             while (true)
  828.             {
  829.                 Time();
  830.                 MoveCursor();
  831.                 Update();
  832.             }
  833.         }
  834.     }
  835. }
Advertisement
Add Comment
Please, Sign In to add comment