using DTLib.Filesystem; using System; using System.Collections.Generic; using System.Text; namespace DTLib.ConsoleGUI { // // создание gui из текста в консоли // public class WindowOld { public int WindowWidth { get; private set; } public int WindowHeight { get; private set; } public char[,] Text; public char[,] nowText; public char[,] TextColors; public char[,] nowTextColors; public Container WindowContainer; public WindowOld(int windowWidth, int windowHeight) { WindowWidth=windowWidth; WindowHeight=windowHeight; Text=new char[windowWidth, windowHeight]; TextColors=new char[windowWidth, windowHeight]; nowText=TextColors; nowTextColors=new char[windowWidth, windowHeight]; Console.WindowWidth=WindowWidth+1; Console.WindowHeight=WindowHeight+1; Console.BufferWidth=WindowWidth+1; Console.BufferHeight=WindowHeight+1; Console.OutputEncoding=Encoding.Unicode; Console.InputEncoding=Encoding.Unicode; Console.CursorVisible=false; // заполнение массивов for(sbyte y = 0; y Console.SetCursorPosition(0, WindowHeight); // заменяет символ выведенный, использовать после ShowAll() public void ChangeChar(sbyte x, sbyte y, char ch) { Text[x, y]=ch; nowText[x, y]=ch; Console.SetCursorPosition(x, y); ColoredConsole.Write(TextColors[x, y].ToString(), ch.ToString()); } public void ChangeColor(sbyte x, sbyte y, char color) { TextColors[x, y]=color; nowTextColors[x, y]=color; Console.SetCursorPosition(x, y); ColoredConsole.Write(color.ToString(), Text[x, y].ToString()); } public void ChangeCharAndColor(sbyte x, sbyte y, char color, char ch) { Text[x, y]=ch; nowText[x, y]=ch; TextColors[x, y]=color; nowTextColors[x, y]=color; Console.SetCursorPosition(x, y); ColoredConsole.Write(color.ToString(), ch.ToString()); } public void ChangeLine(sbyte x, sbyte y, char color, string line) { Console.SetCursorPosition(x, y); for(sbyte i = 0; i(); for(sbyte y = 0; y