diff --git a/private/Nitrocid.Analyzers.Test/ConsoleBase/ConsoleTitleUsageAnalyzerUnitTests.cs b/private/Nitrocid.Analyzers.Test/ConsoleBase/ConsoleTitleUsageAnalyzerUnitTests.cs index ddd4ec22cb..aa50fef40f 100644 --- a/private/Nitrocid.Analyzers.Test/ConsoleBase/ConsoleTitleUsageAnalyzerUnitTests.cs +++ b/private/Nitrocid.Analyzers.Test/ConsoleBase/ConsoleTitleUsageAnalyzerUnitTests.cs @@ -101,7 +101,7 @@ class MyMod { public static void Main() { - ConsoleExtensions.SetTitle("thing"); + ConsoleMisc.SetTitle("thing"); } } } diff --git a/private/Nitrocid.LocaleCheck/Nitrocid.LocaleCheck.csproj b/private/Nitrocid.LocaleCheck/Nitrocid.LocaleCheck.csproj index d2ecbdf89f..f184a965b0 100644 --- a/private/Nitrocid.LocaleCheck/Nitrocid.LocaleCheck.csproj +++ b/private/Nitrocid.LocaleCheck/Nitrocid.LocaleCheck.csproj @@ -23,7 +23,7 @@ true - + diff --git a/private/Nitrocid.LocaleClean/Nitrocid.LocaleClean.csproj b/private/Nitrocid.LocaleClean/Nitrocid.LocaleClean.csproj index 7bf4738b50..9b2bab846a 100644 --- a/private/Nitrocid.LocaleClean/Nitrocid.LocaleClean.csproj +++ b/private/Nitrocid.LocaleClean/Nitrocid.LocaleClean.csproj @@ -23,7 +23,7 @@ true - + diff --git a/private/Nitrocid.LocaleTrim/Nitrocid.LocaleTrim.csproj b/private/Nitrocid.LocaleTrim/Nitrocid.LocaleTrim.csproj index 0501f78241..bd534e085b 100644 --- a/private/Nitrocid.LocaleTrim/Nitrocid.LocaleTrim.csproj +++ b/private/Nitrocid.LocaleTrim/Nitrocid.LocaleTrim.csproj @@ -23,7 +23,7 @@ true - + diff --git a/private/Nitrocid.Tests/ConsoleBase/ColorQueryingTests.cs b/private/Nitrocid.Tests/ConsoleBase/ColorQueryingTests.cs index 2dbf13227d..b6fdf6643e 100644 --- a/private/Nitrocid.Tests/ConsoleBase/ColorQueryingTests.cs +++ b/private/Nitrocid.Tests/ConsoleBase/ColorQueryingTests.cs @@ -142,7 +142,7 @@ public void TestPopulateColorsEmpty() [Description("Querying")] public void TestGetGrayLight() { - var expected = new Color(ConsoleColors.Gray); + var expected = new Color(ConsoleColors.Silver); Should.NotThrow(() => KernelColorTools.SetColor(KernelColorType.Background, new Color(255, 255, 255))); var color = ColorTools.GetGray(); color.ShouldBe(expected); @@ -155,7 +155,7 @@ public void TestGetGrayLight() [Description("Querying")] public void TestGetGrayDark() { - var expected = new Color(ConsoleColors.Gray); + var expected = new Color(ConsoleColors.Silver); Should.NotThrow(() => KernelColorTools.SetColor(KernelColorType.Background, new Color(0, 0, 0))); var color = ColorTools.GetGray(); color.ShouldBe(expected); @@ -189,7 +189,7 @@ public void TestGetRandomColor() Should.NotThrow(() => color = ColorTools.GetRandomColor(type)); type = color.PlainSequence.Contains(';') ? ColorType.TrueColor : color.ColorId.ColorId >= 16 ? - ColorType._255Color : ColorType._16Color; + ColorType.EightBitColor : ColorType.FourBitColor; color.ShouldNotBeNull(); color.Type.ShouldBe(type); } diff --git a/private/Nitrocid.Tests/ConsoleBase/ConsoleQueryingTests.cs b/private/Nitrocid.Tests/ConsoleBase/ConsoleQueryingTests.cs index d1a412d62c..1d747dd0f6 100644 --- a/private/Nitrocid.Tests/ConsoleBase/ConsoleQueryingTests.cs +++ b/private/Nitrocid.Tests/ConsoleBase/ConsoleQueryingTests.cs @@ -21,6 +21,7 @@ using Shouldly; using System; using Terminaux.Base; +using Terminaux.Base.Extensions; using Textify.General; namespace Nitrocid.Tests.ConsoleBase @@ -39,8 +40,8 @@ public void TestFilterVTSequences() { char BellChar = Convert.ToChar(7); char EscapeChar = CharManager.GetEsc(); - ConsoleExtensions.FilterVTSequences($"Hello!{EscapeChar}[38;5;43m").ShouldBe("Hello!"); - ConsoleExtensions.FilterVTSequences($"{EscapeChar}]0;This is the title{BellChar}Hello!").ShouldBe("Hello!"); + ConsoleMisc.FilterVTSequences($"Hello!{EscapeChar}[38;5;43m").ShouldBe("Hello!"); + ConsoleMisc.FilterVTSequences($"{EscapeChar}]0;This is the title{BellChar}Hello!").ShouldBe("Hello!"); } } diff --git a/private/Nitrocid.Tests/Misc/Interactive/Interactives/MyCustomInteractiveTui.cs b/private/Nitrocid.Tests/Misc/Interactive/Interactives/MyCustomInteractiveTui.cs index d8b4fcbdbb..72b25131dc 100644 --- a/private/Nitrocid.Tests/Misc/Interactive/Interactives/MyCustomInteractiveTui.cs +++ b/private/Nitrocid.Tests/Misc/Interactive/Interactives/MyCustomInteractiveTui.cs @@ -23,11 +23,11 @@ namespace Nitrocid.Tests.Misc.Interactive.Interactives { - internal class MyCustomInteractiveTui : BaseInteractiveTui, IInteractiveTui + internal class MyCustomInteractiveTui : BaseInteractiveTui, IInteractiveTui { - public override List Bindings => new() - { + public override List Bindings => + [ new InteractiveTuiBinding("Test", ConsoleKey.F1, (_, idx) => Console.WriteLine(idx)) - }; + ]; } } diff --git a/private/Nitrocid.Tests/Misc/Text/TextToolsTest.cs b/private/Nitrocid.Tests/Misc/Text/TextToolsTest.cs index d8bf82e74f..13bfe89cf7 100644 --- a/private/Nitrocid.Tests/Misc/Text/TextToolsTest.cs +++ b/private/Nitrocid.Tests/Misc/Text/TextToolsTest.cs @@ -20,6 +20,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Shouldly; using System.Linq; +using Terminaux.Base.Extensions; using Textify.General; namespace Nitrocid.Tests.Misc.Text diff --git a/private/Nitrocid.Tests/Nitrocid.Tests.csproj b/private/Nitrocid.Tests/Nitrocid.Tests.csproj index de9a9f6083..abb7ce6b42 100644 --- a/private/Nitrocid.Tests/Nitrocid.Tests.csproj +++ b/private/Nitrocid.Tests/Nitrocid.Tests.csproj @@ -69,7 +69,7 @@ - + diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/BackRace.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/BackRace.cs index 4768caf894..3afb610283 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/BackRace.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/BackRace.cs @@ -32,6 +32,7 @@ using Terminaux.Inputs; using Terminaux.Base; using Terminaux.Colors.Data; +using Terminaux.Reader; namespace Nitrocid.Extras.Amusements.Amusements.Games { @@ -153,7 +154,7 @@ void ResetAll() // Wait for the input winner = 0; - var input = Input.DetectKeypress().Key; + var input = TermReader.ReadKey().Key; switch (input) { case ConsoleKey.UpArrow: diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/Hangman.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/Hangman.cs index 0e9c273994..9fb8e78e67 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/Hangman.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/Hangman.cs @@ -29,6 +29,7 @@ using Terminaux.Colors; using Textify.Words; using Terminaux.Base; +using Terminaux.Reader; namespace Nitrocid.Extras.Amusements.Amusements.Games { @@ -167,7 +168,7 @@ public static void InitializeHangman(HangmanDifficulty difficulty) else { // Wait for character - var input = Input.DetectKeypress(); + var input = TermReader.ReadKey(); var inputChar = input.KeyChar; if (RandomWord.Contains(inputChar)) { diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/MeteorShooter.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/MeteorShooter.cs index 77c7f40d2c..5299c7cc18 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/MeteorShooter.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/MeteorShooter.cs @@ -31,6 +31,7 @@ using Terminaux.Base; using Terminaux.Colors.Data; using Nitrocid.Kernel.Debugging; +using Terminaux.Reader; namespace Nitrocid.Extras.Amusements.Amusements.Games { @@ -103,7 +104,7 @@ public static void InitializeMeteor(bool simulation = false, bool dodge = false) if (ConsoleWrapper.KeyAvailable) { // Read the key and handle it - Keypress = Input.DetectKeypress(); + Keypress = TermReader.ReadKey(); HandleKeypress(Keypress.Key, dodge); } } @@ -177,21 +178,21 @@ private static void DrawGame(bool dodge) if (y != SpaceshipHeight) buffer.Append( new Color(ConsoleColors.Black).VTSequenceBackground + - TextWriterWhereColor.RenderWherePlain(" ", 0, y) + TextWriterWhereColor.RenderWhere(" ", 0, y) ); } // Show the score buffer.Append( new Color(ConsoleColors.Green).VTSequenceForeground + - TextWriterWhereColor.RenderWherePlain($"{score}", ConsoleWrapper.WindowWidth - $"{score}".Length, 0) + TextWriterWhereColor.RenderWhere($"{score}", ConsoleWrapper.WindowWidth - $"{score}".Length, 0) ); // Move the meteors left for (int Meteor = 0; Meteor <= Meteors.Count - 1; Meteor++) { buffer.Append(new Color(ConsoleColors.Black).VTSequenceBackground); - buffer.Append(TextWriterWhereColor.RenderWherePlain(" ", Meteors[Meteor].Item1, Meteors[Meteor].Item2)); + buffer.Append(TextWriterWhereColor.RenderWhere(" ", Meteors[Meteor].Item1, Meteors[Meteor].Item2)); int MeteorX = Meteors[Meteor].Item1 - 1; int MeteorY = Meteors[Meteor].Item2; Meteors[Meteor] = (MeteorX, MeteorY); @@ -201,7 +202,7 @@ private static void DrawGame(bool dodge) for (int Bullet = 0; Bullet <= Bullets.Count - 1; Bullet++) { buffer.Append(new Color(ConsoleColors.Black).VTSequenceBackground); - buffer.Append(TextWriterWhereColor.RenderWherePlain(" ", Bullets[Bullet].Item1, Bullets[Bullet].Item2)); + buffer.Append(TextWriterWhereColor.RenderWhere(" ", Bullets[Bullet].Item1, Bullets[Bullet].Item2)); int BulletX = Bullets[Bullet].Item1 + 1; int BulletY = Bullets[Bullet].Item2; Bullets[Bullet] = (BulletX, BulletY); @@ -278,8 +279,8 @@ private static void DrawGame(bool dodge) { // The meteor crashed! Remove both the bullet and the meteor buffer.Append(new Color(ConsoleColors.Black).VTSequenceBackground); - buffer.Append(TextWriterWhereColor.RenderWherePlain(" ", Meteor.Item1, Meteor.Item2)); - buffer.Append(TextWriterWhereColor.RenderWherePlain(" ", Bullet.Item1, Bullet.Item2)); + buffer.Append(TextWriterWhereColor.RenderWhere(" ", Meteor.Item1, Meteor.Item2)); + buffer.Append(TextWriterWhereColor.RenderWhere(" ", Bullet.Item1, Bullet.Item2)); Bullets.RemoveAt(BulletIndex); Meteors.RemoveAt(MeteorIndex); score++; @@ -288,7 +289,7 @@ private static void DrawGame(bool dodge) } // Wait for a few milliseconds - TextWriterColor.WritePlain(buffer.ToString(), false); + TextWriterRaw.WritePlain(buffer.ToString(), false); ThreadManager.SleepNoBlock(MeteorSpeed, MeteorDrawThread); } } @@ -350,7 +351,7 @@ private static string DrawMeteor(int MeteorX, int MeteorY) private static string DrawBullet(int BulletX, int BulletY) { char BulletSymbol = '-'; - return TextWriterWhereColor.RenderWhere(Convert.ToString(BulletSymbol), BulletX, BulletY, false, ConsoleColors.Cyan, ConsoleColors.Black); + return TextWriterWhereColor.RenderWhere(Convert.ToString(BulletSymbol), BulletX, BulletY, false, ConsoleColors.Aqua, ConsoleColors.Black); } } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/ShipDuet.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/ShipDuet.cs index 67147c4782..d31d519961 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/ShipDuet.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/ShipDuet.cs @@ -31,6 +31,7 @@ using Terminaux.Base; using Terminaux.Colors.Data; using Nitrocid.Kernel.Debugging; +using Terminaux.Reader; namespace Nitrocid.Extras.Amusements.Amusements.Games { @@ -103,7 +104,7 @@ public static void InitializeShipDuet(bool simulation = false) if (ConsoleWrapper.KeyAvailable) { // Read the key and handle it - Keypress = Input.DetectKeypress(); + Keypress = TermReader.ReadKey(); HandleKeypress(Keypress.Key); } } @@ -193,12 +194,12 @@ private static void DrawGame() if (y != SpaceshipHeightPlayer1) buffer.Append( new Color(ConsoleColors.Black).VTSequenceBackground + - TextWriterWhereColor.RenderWherePlain(" ", 0, y) + TextWriterWhereColor.RenderWhere(" ", 0, y) ); if (y != SpaceshipHeightPlayer2) buffer.Append( new Color(ConsoleColors.Black).VTSequenceBackground + - TextWriterWhereColor.RenderWherePlain(" ", ConsoleWrapper.WindowWidth - 1, y) + TextWriterWhereColor.RenderWhere(" ", ConsoleWrapper.WindowWidth - 1, y) ); } @@ -207,7 +208,7 @@ private static void DrawGame() { buffer.Append( new Color(ConsoleColors.Black).VTSequenceBackground + - TextWriterWhereColor.RenderWherePlain(" ", BulletsPlayer1[Bullet].Item1, BulletsPlayer1[Bullet].Item2) + TextWriterWhereColor.RenderWhere(" ", BulletsPlayer1[Bullet].Item1, BulletsPlayer1[Bullet].Item2) ); int BulletX = BulletsPlayer1[Bullet].Item1 + 1; int BulletY = BulletsPlayer1[Bullet].Item2; @@ -219,7 +220,7 @@ private static void DrawGame() { buffer.Append( new Color(ConsoleColors.Black).VTSequenceBackground + - TextWriterWhereColor.RenderWherePlain(" ", BulletsPlayer2[Bullet].Item1, BulletsPlayer2[Bullet].Item2) + TextWriterWhereColor.RenderWhere(" ", BulletsPlayer2[Bullet].Item1, BulletsPlayer2[Bullet].Item2) ); int BulletX = BulletsPlayer2[Bullet].Item1 - 1; int BulletY = BulletsPlayer2[Bullet].Item2; @@ -231,7 +232,7 @@ private static void DrawGame() { buffer.Append( new Color(ConsoleColors.Black).VTSequenceBackground + - TextWriterWhereColor.RenderWherePlain(" ", Stars[Star].Item1, Stars[Star].Item2) + TextWriterWhereColor.RenderWhere(" ", Stars[Star].Item1, Stars[Star].Item2) ); int StarX = Stars[Star].Item1 - 1; int StarY = Stars[Star].Item2; @@ -322,7 +323,7 @@ private static void DrawGame() } // Wait for a few milliseconds - TextWriterColor.WritePlain(buffer.ToString(), false); + TextWriterRaw.WritePlain(buffer.ToString(), false); ThreadManager.SleepNoBlock(ShipDuetSpeed, ShipDuetDrawThread); } } @@ -388,7 +389,7 @@ private static string DrawSpaceships() private static string DrawBullet(int BulletX, int BulletY) { char BulletSymbol = '-'; - return TextWriterWhereColor.RenderWhere(Convert.ToString(BulletSymbol), BulletX, BulletY, false, ConsoleColors.Cyan, ConsoleColors.Black); + return TextWriterWhereColor.RenderWhere(Convert.ToString(BulletSymbol), BulletX, BulletY, false, ConsoleColors.Aqua, ConsoleColors.Black); } } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/Snaker.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/Snaker.cs index 50d334b78d..c3741add6a 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/Snaker.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/Snaker.cs @@ -29,6 +29,8 @@ using Terminaux.Inputs; using Terminaux.Base; using Terminaux.Colors.Data; +using Terminaux.Reader; +using Terminaux.Colors.Transformation.Contrast; namespace Nitrocid.Extras.Amusements.Amusements.Games { @@ -243,7 +245,7 @@ public static void InitializeSnaker(bool Simulation) // User pressed the arrow button to move the snake if (ConsoleWrapper.KeyAvailable) { - var Pressed = Input.DetectKeypress().Key; + var Pressed = TermReader.ReadKey().Key; switch (Pressed) { case ConsoleKey.DownArrow: diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/SpeedPress.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/SpeedPress.cs index a518962419..51c295cbec 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/SpeedPress.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/SpeedPress.cs @@ -24,6 +24,7 @@ using Terminaux.Writer.ConsoleWriters; using Nitrocid.Languages; using Textify.General; +using Terminaux.Reader; namespace Nitrocid.Extras.Amusements.Amusements.Games { @@ -140,9 +141,9 @@ public static void InitializeSpeedPress(SpeedPressDifficulty Difficulty, int Cus // Prompt user for character TextWriterColor.Write(Translate.DoTranslation("Current character:") + " {0}", SelectedChar); TextWriters.Write("> ", false, KernelColorType.Input); - var (result, provided) = Input.ReadKeyTimeout(false, TimeSpan.FromMilliseconds(SpeedTimeout)); + var (result, provided) = TermReader.ReadKeyTimeout(false, TimeSpan.FromMilliseconds(SpeedTimeout)); WrittenChar = result; - TextWriterColor.Write(); + TextWriterRaw.Write(); // Check to see if the user has pressed the correct character if (provided) @@ -158,7 +159,7 @@ public static void InitializeSpeedPress(SpeedPressDifficulty Difficulty, int Cus } else { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(Translate.DoTranslation("Character not pressed on time."), true, KernelColorType.Warning); } } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/Wordle.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/Wordle.cs index e8aa26de9d..a4d098d948 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/Wordle.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Amusements/Games/Wordle.cs @@ -28,6 +28,7 @@ using Terminaux.Writer.FancyWriters; using Terminaux.Base; using Terminaux.Colors.Data; +using Terminaux.Reader; namespace Nitrocid.Extras.Amusements.Amusements.Games { @@ -52,7 +53,7 @@ public static void InitializeWordle(bool orig = false) RenderBoxes(RandomWord, maxGuesses, currentTries); // Let the user decide the character - var pressedChar = Input.DetectKeypress(); + var pressedChar = TermReader.ReadKey(); switch (pressedChar.Key) { case ConsoleKey.Escape: @@ -98,7 +99,7 @@ public static void InitializeWordle(bool orig = false) private static void RenderBoxes(string RandomWord, int maxGuesses, char[,] currentTries) { - var boxColorNeutral = new Color(ConsoleColors.Gray); + var boxColorNeutral = new Color(ConsoleColors.Silver); var boxColorRightChar = new Color(ConsoleColors.Green); var boxColorMatchingChar = new Color(ConsoleColors.DarkOrange); diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Commands/Anniversary.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Commands/Anniversary.cs index e5b086e974..4ae1c98273 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Commands/Anniversary.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Commands/Anniversary.cs @@ -71,7 +71,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal [ Translate.DoTranslation("This version now refines the kernel to the point that it no longer behaves like the old versions.") + " " + Translate.DoTranslation("Because the new groundbreaking features got released, we decided to name this kernel...") + " \n\n" + - new Color(ConsoleColors.Green3_00d700).VTSequenceForeground + "Nitrocid KS 0.1.0!\n\n" + KernelColorTools.GetColor(KernelColorType.NeutralText).VTSequenceForeground + + new Color(ConsoleColors.Green3Alt).VTSequenceForeground + "Nitrocid KS 0.1.0!\n\n" + KernelColorTools.GetColor(KernelColorType.NeutralText).VTSequenceForeground + "< " + Translate.DoTranslation("Happy 5-year anniversary!") + " >\n\n" + "-- Aptivi" ] diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Nitrocid.Extras.Amusements.csproj b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Nitrocid.Extras.Amusements.csproj index d522b0fc05..6dba1e95ca 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Nitrocid.Extras.Amusements.csproj +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Nitrocid.Extras.Amusements.csproj @@ -49,7 +49,7 @@ - + true diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Splashes/Quote.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Splashes/Quote.cs index 65f10c73bc..a3e80306d5 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Splashes/Quote.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Amusements/Splashes/Quote.cs @@ -70,7 +70,7 @@ public override string Display(SplashContext context) string str = quoteSplit[i]; builder.Append( _quoteColor.VTSequenceForeground + - TextWriterWhereColor.RenderWherePlain(str, quotePosX, currentY) + TextWriterWhereColor.RenderWhere(str, quotePosX, currentY) ); } } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.ArchiveShell/Archive/Shell/Commands/List.cs b/public/Nitrocid.Addons/Nitrocid.Extras.ArchiveShell/Archive/Shell/Commands/List.cs index 0825718227..4d0721d0f1 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.ArchiveShell/Archive/Shell/Commands/List.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.ArchiveShell/Archive/Shell/Commands/List.cs @@ -59,7 +59,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal } else { - TextWriterColor.Write(); + TextWriterRaw.Write(); } } return 0; diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Animations/Lyrics/Lyrics.cs b/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Animations/Lyrics/Lyrics.cs index 80f3041ccc..de3b962b0e 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Animations/Lyrics/Lyrics.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Animations/Lyrics/Lyrics.cs @@ -39,6 +39,7 @@ using Textify.General; using Terminaux.Colors; using Terminaux.Base; +using Terminaux.Base.Extensions; namespace Nitrocid.Extras.BassBoom.Animations.Lyrics { diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Commands/PlaySound.cs b/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Commands/PlaySound.cs index bd1831fec6..55715d2103 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Commands/PlaySound.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Commands/PlaySound.cs @@ -32,6 +32,7 @@ using System.IO; using System.Threading; using Terminaux.Base; +using Terminaux.Reader; namespace Nitrocid.Extras.BassBoom.Commands { @@ -105,7 +106,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal { if (ConsoleWrapper.KeyAvailable) { - var key = Input.DetectKeypress(); + var key = TermReader.ReadKey(); if (key.Key == ConsoleKey.Q) PlaybackTools.Stop(); } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Nitrocid.Extras.BassBoom.csproj b/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Nitrocid.Extras.BassBoom.csproj index 875f30d149..d4196ac9ab 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Nitrocid.Extras.BassBoom.csproj +++ b/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Nitrocid.Extras.BassBoom.csproj @@ -48,7 +48,7 @@ - + diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Player/PlayerTui.cs b/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Player/PlayerTui.cs index 20a4ecbaba..707c7f2c3e 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Player/PlayerTui.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.BassBoom/Player/PlayerTui.cs @@ -48,7 +48,7 @@ using System.Text; using System.Threading; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Inputs.Styles.Infobox; using Terminaux.Writer.ConsoleWriters; using Nitrocid.ConsoleBase.Colors; @@ -60,6 +60,8 @@ using Textify.General; using Terminaux.Base; using Terminaux.Colors.Data; +using Terminaux.Base.Extensions; +using Terminaux.Reader; namespace Nitrocid.Extras.BassBoom.Player { @@ -150,7 +152,7 @@ public static void PlayerLoop() { var buffer = new StringBuilder(); buffer.Append( - TextWriterWhereColor.RenderWhere(ConsoleExtensions.GetClearLineToRightSequence(), 0, ConsoleWrapper.WindowHeight - 10, KernelColorTools.GetColor(KernelColorType.NeutralText), KernelColorTools.GetColor(KernelColorType.Background)) + + TextWriterWhereColor.RenderWhere(ConsoleClearing.GetClearLineToRightSequence(), 0, ConsoleWrapper.WindowHeight - 10, KernelColorTools.GetColor(KernelColorType.NeutralText), KernelColorTools.GetColor(KernelColorType.Background)) + CenteredTextColor.RenderCentered(ConsoleWrapper.WindowHeight - 10, lyricInstance.GetLastLineCurrent(), KernelColorTools.GetColor(KernelColorType.NeutralText), KernelColorTools.GetColor(KernelColorType.Background)) ); return buffer.ToString(); @@ -167,7 +169,7 @@ public static void PlayerLoop() { var buffer = new StringBuilder(); buffer.Append( - TextWriterWhereColor.RenderWhere(ConsoleExtensions.GetClearLineToRightSequence(), 0, ConsoleWrapper.WindowHeight - 10, KernelColorTools.GetColor(KernelColorType.NeutralText), KernelColorTools.GetColor(KernelColorType.Background)) + TextWriterWhereColor.RenderWhere(ConsoleClearing.GetClearLineToRightSequence(), 0, ConsoleWrapper.WindowHeight - 10, KernelColorTools.GetColor(KernelColorType.NeutralText), KernelColorTools.GetColor(KernelColorType.Background)) ); return buffer.ToString(); }); @@ -180,7 +182,7 @@ public static void PlayerLoop() // Handle the keystroke if (ConsoleWrapper.KeyAvailable) { - var keystroke = Input.DetectKeypress(); + var keystroke = TermReader.ReadKey(); if (PlaybackTools.Playing) HandleKeypressPlayMode(keystroke); else @@ -351,7 +353,7 @@ private static void HandlePlay() populate = true; currentSong = musicFiles.IndexOf(musicFile) + 1; PlayerControls.PopulateMusicFileInfo(musicFile); - TextWriterColor.WritePlain(PlayerControls.RenderSongName(musicFile), false); + TextWriterRaw.WritePlain(PlayerControls.RenderSongName(musicFile), false); if (paused) { paused = false; @@ -392,7 +394,7 @@ private static string HandleDraw() drawn.Append(CenteredTextColor.RenderCentered(ConsoleWrapper.WindowHeight - 4, separator)); // Write powered by... - drawn.Append(TextWriterWhereColor.RenderWherePlain($"[ {Translate.DoTranslation("Powered by BassBoom")} ]", 2, ConsoleWrapper.WindowHeight - 4)); + drawn.Append(TextWriterWhereColor.RenderWhere($"[ {Translate.DoTranslation("Powered by BassBoom")} ]", 2, ConsoleWrapper.WindowHeight - 4)); // In case we have no songs in the playlist... if (musicFiles.Count == 0) @@ -431,7 +433,7 @@ private static string HandleDraw() } // Render an entry - var finalForeColor = finalIndex == currentSong - 1 ? new Color(ConsoleColors.Green) : new Color(ConsoleColors.Gray); + var finalForeColor = finalIndex == currentSong - 1 ? new Color(ConsoleColors.Green) : new Color(ConsoleColors.Silver); int top = startPos + finalIndex - startIndex; playlist.Append( $"{CsiSequences.GenerateCsiCursorPosition(1, top + 1)}" + diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Calendar/Calendar/CalendarPrint.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Calendar/Calendar/CalendarPrint.cs index 6483c4589d..c8199c5fc5 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Calendar/Calendar/CalendarPrint.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Calendar/Calendar/CalendarPrint.cs @@ -71,7 +71,7 @@ public static void PrintCalendar(int Year, int Month, CalendarTypes calendar = C // Populate the calendar data TextWriters.WriteWhere(CalendarTitle, (int)Math.Round((ConsoleWrapper.WindowWidth - CalendarTitle.Length) / 2d), ConsoleWrapper.CursorTop, true, KernelColorType.TableTitle); - TextWriterColor.Write(); + TextWriterRaw.Write(); for (int CurrentDay = 1; CurrentDay <= DateTo.Day; CurrentDay++) { var CurrentDate = new DateTime(year, month, CurrentDay); diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Calendar/Calendar/CalendarTui.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Calendar/Calendar/CalendarTui.cs index e9c330f154..8c54673e0a 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Calendar/Calendar/CalendarTui.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Calendar/Calendar/CalendarTui.cs @@ -22,8 +22,8 @@ using System; using System.Linq; using System.Text; -using Textify.Sequences.Builder.Types; -using Textify.Sequences.Tools; +using Terminaux.Sequences.Builder.Types; +using Terminaux.Sequences; using Nitrocid.Kernel.Debugging; using Nitrocid.Kernel.Time.Calendars; using Terminaux.Inputs.Styles.Infobox; @@ -39,6 +39,8 @@ using Textify.General; using Terminaux.Colors; using Terminaux.Base; +using Terminaux.Reader; +using Terminaux.Base.Extensions; namespace Nitrocid.Extras.Calendar.Calendar { @@ -100,7 +102,7 @@ internal static void OpenInteractive(int Year, int Month, int Day, CalendarTypes // Wait for a keypress ScreenTools.Render(screen); - var keypress = Input.DetectKeypress(); + var keypress = TermReader.ReadKey(); HandleKeypress(keypress, ref state); // Reset, in case selection changed @@ -173,7 +175,7 @@ private static void RenderStatus(ref Screen screen) builder.Append( $"{InteractiveTuiStatus.ForegroundColor.VTSequenceForeground}" + $"{KernelColorTools.GetColor(KernelColorType.Background).VTSequenceBackground}" + - $"{TextWriterWhereColor.RenderWherePlain(status + ConsoleExtensions.GetClearLineToRightSequence(), 0, 0)}" + $"{TextWriterWhereColor.RenderWhere(status + ConsoleClearing.GetClearLineToRightSequence(), 0, 0)}" ); return builder.ToString(); }); diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Contacts/Contacts/Interactives/ContactsManagerCli.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Contacts/Contacts/Interactives/ContactsManagerCli.cs index bb7e98388a..b6013186e7 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Contacts/Contacts/Interactives/ContactsManagerCli.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Contacts/Contacts/Interactives/ContactsManagerCli.cs @@ -35,7 +35,7 @@ namespace Nitrocid.Extras.Contacts.Contacts.Interactives /// /// Contacts manager class /// - public class ContactsManagerCli : BaseInteractiveTui, IInteractiveTui + public class ContactsManagerCli : BaseInteractiveTui, IInteractiveTui { /// /// Contact manager bindings @@ -56,7 +56,7 @@ public class ContactsManagerCli : BaseInteractiveTui, IInteractiveTui ]; /// - public override IEnumerable PrimaryDataSource => + public override IEnumerable PrimaryDataSource => ContactsManager.GetContacts(); /// @@ -64,10 +64,10 @@ public class ContactsManagerCli : BaseInteractiveTui, IInteractiveTui true; /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(Card item) { // Get some info from the contact - Card selectedContact = (Card)item; + Card selectedContact = item; if (selectedContact is null) return Translate.DoTranslation("There is no contact. If you'd like to import contacts, please use the import options using the keystrokes defined at the bottom of the screen."); @@ -91,10 +91,10 @@ public override string GetInfoFromItem(object item) } /// - public override void RenderStatus(object item) + public override void RenderStatus(Card item) { // Get some info from the contact - Card selectedContact = (Card)item; + Card selectedContact = item; if (selectedContact is null) return; @@ -106,9 +106,9 @@ public override void RenderStatus(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(Card item) { - Card contact = (Card)item; + Card contact = item; if (contact is null) return ""; return contact.ContactFullName; diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Contacts/Nitrocid.Extras.Contacts.csproj b/public/Nitrocid.Addons/Nitrocid.Extras.Contacts/Nitrocid.Extras.Contacts.csproj index bc88d5b7b8..f838f08d75 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Contacts/Nitrocid.Extras.Contacts.csproj +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Contacts/Nitrocid.Extras.Contacts.csproj @@ -48,7 +48,7 @@ - + diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Diagnostics/Commands/ThreadsBt.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Diagnostics/Commands/ThreadsBt.cs index 30714c27cb..8420877bd0 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Diagnostics/Commands/ThreadsBt.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Diagnostics/Commands/ThreadsBt.cs @@ -56,7 +56,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal string[] threadTrace = trace.Value; TextWriters.Write(Translate.DoTranslation("Thread stack trace information for {0}") + "\n", true, KernelColorType.ListTitle, threadAddress); ListWriterColor.WriteList(threadTrace); - TextWriterColor.Write(); + TextWriterRaw.Write(); } return 0; } @@ -79,7 +79,7 @@ public override int ExecuteDumb(CommandParameters parameters, ref string variabl TextWriters.Write(Translate.DoTranslation("Thread stack trace information for {0}") + "\n", true, KernelColorType.ListTitle, threadAddress); foreach (string threadTraceStr in threadTrace) TextWriterColor.Write(threadTraceStr); - TextWriterColor.Write(); + TextWriterRaw.Write(); } return 0; } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Docking/Dock/Docks/DigitalClock.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Docking/Dock/Docks/DigitalClock.cs index 6de9f2f0db..8084385c92 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Docking/Dock/Docks/DigitalClock.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Docking/Dock/Docks/DigitalClock.cs @@ -34,11 +34,12 @@ using System.Text; using Terminaux.Colors; using Textify.General; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; using Nitrocid.Users.Login.Motd; using Nitrocid.Network.Types.RSS; using Nitrocid.Kernel.Configuration; +using Terminaux.Reader; namespace Nitrocid.Extras.Docking.Dock.Docks { @@ -171,7 +172,7 @@ static string UpdateHeadline() ThreadManager.SleepNoBlock(1); } if (ConsoleWrapper.KeyAvailable) - Input.DetectKeypress(); + TermReader.ReadKey(); ScreenTools.UnsetCurrent(screen); } } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/Get.cs b/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/Get.cs index 486795b30e..6276b443fc 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/Get.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/Get.cs @@ -44,13 +44,13 @@ public override int Execute(CommandParameters parameters, ref string variableVal bool Result = !string.IsNullOrWhiteSpace(LocalFile) ? FTPTransfer.FTPGetFile(RemoteFile, LocalFile) : FTPTransfer.FTPGetFile(RemoteFile); if (Result) { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(Translate.DoTranslation("Downloaded file {0}."), true, KernelColorType.Success, RemoteFile); return 0; } else { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(Translate.DoTranslation("Download failed for file {0}."), true, KernelColorType.Error, RemoteFile); return KernelExceptionTools.GetErrorCode(KernelExceptionType.FTPNetwork); } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/GetFolder.cs b/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/GetFolder.cs index f11a4f1f4b..406d5c425d 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/GetFolder.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/GetFolder.cs @@ -44,13 +44,13 @@ public override int Execute(CommandParameters parameters, ref string variableVal bool Result = !string.IsNullOrWhiteSpace(LocalFolder) ? FTPTransfer.FTPGetFolder(RemoteFolder, LocalFolder) : FTPTransfer.FTPGetFolder(RemoteFolder); if (Result) { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(Translate.DoTranslation("Downloaded folder {0}."), true, KernelColorType.Success, RemoteFolder); return 0; } else { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(Translate.DoTranslation("Download failed for folder {0}."), true, KernelColorType.Error, RemoteFolder); return KernelExceptionTools.GetErrorCode(KernelExceptionType.FTPNetwork); } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/Put.cs b/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/Put.cs index d0c9c842d0..150ef98bc1 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/Put.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/Put.cs @@ -48,13 +48,13 @@ public override int Execute(CommandParameters parameters, ref string variableVal bool Result = !string.IsNullOrWhiteSpace(LocalFile) ? FTPTransfer.FTPUploadFile(RemoteFile, LocalFile) : FTPTransfer.FTPUploadFile(RemoteFile); if (Result) { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(Translate.DoTranslation("Uploaded file {0}"), true, KernelColorType.Success, LocalFile); return 0; } else { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(Translate.DoTranslation("Failed to upload {0}"), true, KernelColorType.Error, LocalFile); return KernelExceptionTools.GetErrorCode(KernelExceptionType.FTPFilesystem); } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/PutFolder.cs b/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/PutFolder.cs index eda4078910..0f1602bc9f 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/PutFolder.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/FTP/Commands/PutFolder.cs @@ -49,13 +49,13 @@ public override int Execute(CommandParameters parameters, ref string variableVal bool Result = !string.IsNullOrWhiteSpace(LocalFolder) ? FTPTransfer.FTPUploadFolder(RemoteFolder, LocalFolder) : FTPTransfer.FTPUploadFolder(RemoteFolder); if (Result) { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(CharManager.NewLine + Translate.DoTranslation("Uploaded folder {0}"), true, KernelColorType.Success, parameters.ArgumentsList[0]); return 0; } else { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(CharManager.NewLine + Translate.DoTranslation("Failed to upload {0}"), true, KernelColorType.Error, parameters.ArgumentsList[0]); return KernelExceptionTools.GetErrorCode(KernelExceptionType.FTPFilesystem); } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/Tools/FTPTools.cs b/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/Tools/FTPTools.cs index 6db54db641..9c5dfcb8dc 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/Tools/FTPTools.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/Tools/FTPTools.cs @@ -35,6 +35,7 @@ using Terminaux.Colors; using Nitrocid.ConsoleBase.Inputs; using Nitrocid.Network.Connections; +using Terminaux.Reader; namespace Nitrocid.Extras.FtpShell.Tools { @@ -283,8 +284,8 @@ public static void TryToValidate(BaseFtpClient control, FtpSslValidationEventArg { TextWriters.Write(Translate.DoTranslation("Are you sure that you want to connect?") + " (y/n) ", false, KernelColorType.Question); ColorTools.SetConsoleColor(KernelColorTools.GetColor(KernelColorType.Input)); - Answer = Convert.ToString(Input.DetectKeypress().KeyChar); - TextWriterColor.Write(); + Answer = Convert.ToString(TermReader.ReadKey().KeyChar); + TextWriterRaw.Write(); DebugWriter.WriteDebug(DebugLevel.I, $"Answer is {Answer}"); if (Answer.Equals("y", StringComparison.OrdinalIgnoreCase)) { diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/Tools/Transfer/FTPTransferProgress.cs b/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/Tools/Transfer/FTPTransferProgress.cs index 5bd405edbb..356cb45794 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/Tools/Transfer/FTPTransferProgress.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.FtpShell/Tools/Transfer/FTPTransferProgress.cs @@ -22,6 +22,7 @@ using Nitrocid.ConsoleBase.Colors; using Nitrocid.ConsoleBase.Writers; using Terminaux.Base; +using Terminaux.Base.Extensions; namespace Nitrocid.Extras.FtpShell.Tools.Transfer { @@ -57,7 +58,7 @@ private static void FileProgressHandler(FtpProgress Percentage) if (FTPTransfer.progressFlag & Percentage.Progress != 100d) { TextWriters.Write(" {0}% (ETA: {1}d {2}:{3}:{4} @ {5})", false, KernelColorType.Progress, Percentage.Progress.ToString("N2"), Percentage.ETA.Days, Percentage.ETA.Hours, Percentage.ETA.Minutes, Percentage.ETA.Seconds, Percentage.TransferSpeedToString()); - ConsoleExtensions.ClearLineToRight(); + ConsoleClearing.ClearLineToRight(); } ConsoleWrapper.SetCursorPosition(FTPTransfer.ConsoleOriginalPositionLeft, FTPTransfer.ConsoleOriginalPositionTop); } @@ -81,7 +82,7 @@ private static void MultipleProgressHandler(FtpProgress Percentage) { TextWriters.Write("- [{0}/{1}] {2}: ", false, KernelColorType.ListEntry, Percentage.FileIndex + 1, Percentage.FileCount, Percentage.RemotePath); TextWriters.Write("{0}% (ETA: {1}d {2}:{3}:{4} @ {5})", false, KernelColorType.Progress, Percentage.Progress.ToString("N2"), Percentage.ETA.Days, Percentage.ETA.Hours, Percentage.ETA.Minutes, Percentage.ETA.Seconds, Percentage.TransferSpeedToString()); - ConsoleExtensions.ClearLineToRight(); + ConsoleClearing.ClearLineToRight(); } ConsoleWrapper.SetCursorPosition(FTPTransfer.ConsoleOriginalPositionLeft, FTPTransfer.ConsoleOriginalPositionTop); } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.GitShell/Git/Commands/Blame.cs b/public/Nitrocid.Addons/Nitrocid.Extras.GitShell/Git/Commands/Blame.cs index 327400e995..81a3ed99bb 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.GitShell/Git/Commands/Blame.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.GitShell/Git/Commands/Blame.cs @@ -72,7 +72,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal TextWriters.Write($"{initialStart}", true, KernelColorType.ListValue); TextWriters.Write("- " + Translate.DoTranslation("Final line number") + ": ", false, KernelColorType.ListEntry); TextWriters.Write($"{finalStart}", true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); // Initial commit info TextWriters.Write("- " + Translate.DoTranslation("Initial commit"), true, KernelColorType.ListEntry); @@ -86,7 +86,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal TextWriters.Write($"{initialCommit.Committer.Name} <{initialCommit.Committer.Email}>", true, KernelColorType.ListValue); TextWriters.Write(" - " + Translate.DoTranslation("Number of parents") + ": ", false, KernelColorType.ListEntry); TextWriters.Write($"{initialCommit.Parents.Count()}", true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); // Final commit info TextWriters.Write("- " + Translate.DoTranslation("Final commit"), true, KernelColorType.ListEntry); @@ -100,7 +100,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal TextWriters.Write($"{finalCommit.Committer.Name} <{finalCommit.Committer.Email}>", true, KernelColorType.ListValue); TextWriters.Write(" - " + Translate.DoTranslation("Number of parents") + ": ", false, KernelColorType.ListEntry); TextWriters.Write($"{finalCommit.Parents.Count()}", true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); // Increment the hunk number for display hunkNum++; diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.GitShell/Git/Commands/Diff.cs b/public/Nitrocid.Addons/Nitrocid.Extras.GitShell/Git/Commands/Diff.cs index 7c2c24d369..52ac91ea22 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.GitShell/Git/Commands/Diff.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.GitShell/Git/Commands/Diff.cs @@ -76,7 +76,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal foreach (var change in renamed) TextWriters.Write($"[R] / {change.OldPath} -> {change.Path}", KernelColorType.ListEntry); } - TextWriterColor.Write(); + TextWriterRaw.Write(); if (doPatch) { diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.GitShell/Git/Commands/Status.cs b/public/Nitrocid.Addons/Nitrocid.Extras.GitShell/Git/Commands/Status.cs index 9aace7bd28..e7c1a26cb4 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.GitShell/Git/Commands/Status.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.GitShell/Git/Commands/Status.cs @@ -57,7 +57,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal } else TextWriters.Write(Translate.DoTranslation("No untracked files."), true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); // ...added... TextWriters.Write(Translate.DoTranslation("Added files") + ":", true, KernelColorType.ListEntry); @@ -68,7 +68,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal } else TextWriters.Write(Translate.DoTranslation("No added files."), true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); // ...modified... TextWriters.Write(Translate.DoTranslation("Modified files") + ":", true, KernelColorType.ListEntry); @@ -79,7 +79,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal } else TextWriters.Write(Translate.DoTranslation("No modified files."), true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); // ...removed... TextWriters.Write(Translate.DoTranslation("Removed files") + ":", true, KernelColorType.ListEntry); @@ -90,7 +90,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal } else TextWriters.Write(Translate.DoTranslation("No removed files."), true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); // ...staged... TextWriters.Write(Translate.DoTranslation("Staged files") + ":", true, KernelColorType.ListEntry); @@ -101,7 +101,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal } else TextWriters.Write(Translate.DoTranslation("No staged files."), true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); // ...renamed... TextWriters.Write(Translate.DoTranslation("Renamed staged files") + ":", true, KernelColorType.ListEntry); @@ -112,7 +112,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal } else TextWriters.Write(Translate.DoTranslation("No renamed staged files."), true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); // ...renamed unstaged... TextWriters.Write(Translate.DoTranslation("Renamed files") + ":", true, KernelColorType.ListEntry); @@ -123,7 +123,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal } else TextWriters.Write(Translate.DoTranslation("No renamed files."), true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); // ...and missing TextWriters.Write(Translate.DoTranslation("Missing files") + ":", true, KernelColorType.ListEntry); @@ -134,7 +134,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal } else TextWriters.Write(Translate.DoTranslation("No missing files."), true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); return 0; } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.JsonShell/Json/Commands/JsonInfo.cs b/public/Nitrocid.Addons/Nitrocid.Extras.JsonShell/Json/Commands/JsonInfo.cs index 1c0629dcee..8c77a81113 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.JsonShell/Json/Commands/JsonInfo.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.JsonShell/Json/Commands/JsonInfo.cs @@ -40,7 +40,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal TextWriterColor.Write(Translate.DoTranslation("Base has values") + ": {0}", true, false, JsonShellCommon.FileToken.HasValues); TextWriterColor.Write(Translate.DoTranslation("Children token count") + ": {0}", JsonShellCommon.FileToken.Count()); TextWriterColor.Write(Translate.DoTranslation("Base path") + ": {0}", JsonShellCommon.FileToken.Path); - TextWriterColor.Write(); + TextWriterRaw.Write(); // Individual properties if (!parameters.SwitchesList.Contains("-simplified")) @@ -54,7 +54,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal TextWriterColor.Write(Translate.DoTranslation("Token path") + ": {0}", token.Path); if (parameters.SwitchesList.Contains("-showvals")) TextWriterColor.Write(Translate.DoTranslation("Token value") + ": {0}", token); - TextWriterColor.Write(); + TextWriterRaw.Write(); // Check to see if the token is a property if (token.Type == JTokenType.Property) @@ -66,7 +66,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal TextWriterColor.Write(Translate.DoTranslation("Property path") + ": {0}", ((JProperty)token).Path); if (parameters.SwitchesList.Contains("-showvals")) TextWriterColor.Write(Translate.DoTranslation("Property value") + ": {0}", ((JProperty)token).Value); - TextWriterColor.Write(); + TextWriterRaw.Write(); } } } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.LanguageStudio/Studio/LanguageStudioApp.cs b/public/Nitrocid.Addons/Nitrocid.Extras.LanguageStudio/Studio/LanguageStudioApp.cs index b8501e05e3..cbbd837692 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.LanguageStudio/Studio/LanguageStudioApp.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.LanguageStudio/Studio/LanguageStudioApp.cs @@ -145,7 +145,7 @@ public static void StartLanguageStudio(string pathToTranslations) [ new InputChoiceInfo($"{englishLines.Count + 1}", Translate.DoTranslation("Go Back...")), ]; - int selectedStringNum = SelectionStyle.PromptSelection("- " + finalTitle + " " + new string('-', ConsoleWrapper.WindowWidth - ("- " + finalTitle + " ").Length) + CharManager.NewLine + CharManager.NewLine + Translate.DoTranslation("Select a string to translate:"), choices, altChoices); + int selectedStringNum = SelectionStyle.PromptSelection("- " + finalTitle + " " + new string('-', ConsoleWrapper.WindowWidth - ("- " + finalTitle + " ").Length) + CharManager.NewLine + CharManager.NewLine + Translate.DoTranslation("Select a string to translate:"), [.. choices], [.. altChoices]); // Check the answer if (selectedStringNum == englishLines.Count + 1) @@ -160,7 +160,7 @@ public static void StartLanguageStudio(string pathToTranslations) { // User chose to remove a string. finalTitle = Translate.DoTranslation("Remove string"); - int selectedRemovedStringNum = SelectionStyle.PromptSelection("- " + finalTitle + " " + new string('-', ConsoleWrapper.WindowWidth - ("- " + finalTitle + " ").Length) + CharManager.NewLine + CharManager.NewLine + Translate.DoTranslation("Select a string to remove:"), choices, altChoicesRemove); + int selectedRemovedStringNum = SelectionStyle.PromptSelection("- " + finalTitle + " " + new string('-', ConsoleWrapper.WindowWidth - ("- " + finalTitle + " ").Length) + CharManager.NewLine + CharManager.NewLine + Translate.DoTranslation("Select a string to remove:"), [.. choices], [.. altChoicesRemove]); if (selectedRemovedStringNum == englishLines.Count + 1 || selectedRemovedStringNum == -1) continue; else @@ -216,7 +216,7 @@ private static void HandleStringTranslation(List strings, int index, str new InputChoiceInfo($"{targetLanguages.Length + 1}", Translate.DoTranslation("Go Back...")), ]; string finalTitle = Translate.DoTranslation("Select language"); - int selectedLangNum = SelectionStyle.PromptSelection("- " + finalTitle + " " + new string('-', ConsoleWrapper.WindowWidth - ("- " + finalTitle + " ").Length) + CharManager.NewLine + CharManager.NewLine + Translate.DoTranslation("Select a language to translate this string to:"), choices, altChoices); + int selectedLangNum = SelectionStyle.PromptSelection("- " + finalTitle + " " + new string('-', ConsoleWrapper.WindowWidth - ("- " + finalTitle + " ").Length) + CharManager.NewLine + CharManager.NewLine + Translate.DoTranslation("Select a language to translate this string to:"), [.. choices], [.. altChoices]); if (selectedLangNum == targetLanguages.Length + 1 || selectedLangNum == -1) return; diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.MailShell/Tools/Directory/MailManager.cs b/public/Nitrocid.Addons/Nitrocid.Extras.MailShell/Tools/Directory/MailManager.cs index 35fc9fd44b..af11f73fa6 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.MailShell/Tools/Directory/MailManager.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.MailShell/Tools/Directory/MailManager.cs @@ -31,6 +31,7 @@ using Nitrocid.Kernel.Exceptions; using Nitrocid.Languages; using Textify.General; +using Terminaux.Base.Extensions; namespace Nitrocid.Extras.MailShell.Tools.Directory { diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.MailShell/Tools/Transfer/MailTransfer.cs b/public/Nitrocid.Addons/Nitrocid.Extras.MailShell/Tools/Transfer/MailTransfer.cs index c30c269414..18427058d3 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.MailShell/Tools/Transfer/MailTransfer.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.MailShell/Tools/Transfer/MailTransfer.cs @@ -87,7 +87,7 @@ public static void MailPrintMessage(int MessageNum, bool Decrypt = false) } // Prepare view - TextWriterColor.Write(); + TextWriterRaw.Write(); // Print all the addresses that sent the mail DebugWriter.WriteDebug(DebugLevel.I, "{0} senders.", Msg.From.Count); @@ -110,7 +110,7 @@ public static void MailPrintMessage(int MessageNum, bool Decrypt = false) TextWriters.Write(Translate.DoTranslation("- Sent at {0} in {1}"), true, KernelColorType.ListEntry, TimeDateRenderers.RenderTime(Msg.Date.DateTime), TimeDateRenderers.RenderDate(Msg.Date.DateTime)); // Prepare subject - TextWriterColor.Write(); + TextWriterRaw.Write(); DebugWriter.WriteDebug(DebugLevel.I, "Subject length: {0}, {1}", Msg.Subject.Length, Msg.Subject); TextWriters.Write($"- {Msg.Subject}", false, KernelColorType.ListEntry); @@ -122,11 +122,11 @@ public static void MailPrintMessage(int MessageNum, bool Decrypt = false) } else { - TextWriterColor.Write(); + TextWriterRaw.Write(); } // Prepare body - TextWriterColor.Write(); + TextWriterRaw.Write(); DebugWriter.WriteDebug(DebugLevel.I, "Displaying body..."); var DecryptedMessage = default(Dictionary); DebugWriter.WriteDebug(DebugLevel.I, "To decrypt: {0}", Decrypt); @@ -174,7 +174,7 @@ public static void MailPrintMessage(int MessageNum, bool Decrypt = false) { TextWriters.Write(Msg.GetTextBody(MailShellCommon.TextFormat), true, KernelColorType.ListValue); } - TextWriterColor.Write(); + TextWriterRaw.Write(); // Populate attachments if (Msg.Attachments.Any()) diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.MailShell/Tools/Transfer/MailTransferProgress.cs b/public/Nitrocid.Addons/Nitrocid.Extras.MailShell/Tools/Transfer/MailTransferProgress.cs index b5b88521e2..8c7632367a 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.MailShell/Tools/Transfer/MailTransferProgress.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.MailShell/Tools/Transfer/MailTransferProgress.cs @@ -25,6 +25,7 @@ using Nitrocid.Misc.Reflection; using Nitrocid.Misc.Text.Probers.Placeholder; using Terminaux.Base; +using Terminaux.Base.Extensions; namespace Nitrocid.Extras.MailShell.Tools.Transfer { @@ -41,11 +42,11 @@ public void Report(long bytesTransferred, long totalSize) { if (!string.IsNullOrWhiteSpace(MailShellCommon.ProgressStyle)) { - TextWriters.WriteWhere(PlaceParse.ProbePlaces(MailShellCommon.ProgressStyle) + $"{ConsoleExtensions.GetClearLineToRightSequence()}", 0, ConsoleWrapper.CursorTop, true, KernelColorType.Progress, bytesTransferred.SizeString(), totalSize.SizeString()); + TextWriters.WriteWhere(PlaceParse.ProbePlaces(MailShellCommon.ProgressStyle) + $"{ConsoleClearing.GetClearLineToRightSequence()}", 0, ConsoleWrapper.CursorTop, true, KernelColorType.Progress, bytesTransferred.SizeString(), totalSize.SizeString()); } else { - TextWriters.WriteWhere("{0}/{1} " + Translate.DoTranslation("of mail transferred...") + $"{ConsoleExtensions.GetClearLineToRightSequence()}", 0, ConsoleWrapper.CursorTop, true, KernelColorType.Progress, bytesTransferred.SizeString(), totalSize.SizeString()); + TextWriters.WriteWhere("{0}/{1} " + Translate.DoTranslation("of mail transferred...") + $"{ConsoleClearing.GetClearLineToRightSequence()}", 0, ConsoleWrapper.CursorTop, true, KernelColorType.Progress, bytesTransferred.SizeString(), totalSize.SizeString()); } } } @@ -57,11 +58,11 @@ public void Report(long bytesTransferred) { if (!string.IsNullOrWhiteSpace(MailShellCommon.ProgressStyleSingle)) { - TextWriters.WriteWhere(PlaceParse.ProbePlaces(MailShellCommon.ProgressStyleSingle) + $"{ConsoleExtensions.GetClearLineToRightSequence()}", 0, ConsoleWrapper.CursorTop, true, KernelColorType.Progress, bytesTransferred.SizeString()); + TextWriters.WriteWhere(PlaceParse.ProbePlaces(MailShellCommon.ProgressStyleSingle) + $"{ConsoleClearing.GetClearLineToRightSequence()}", 0, ConsoleWrapper.CursorTop, true, KernelColorType.Progress, bytesTransferred.SizeString()); } else { - TextWriters.WriteWhere("{0} " + Translate.DoTranslation("of mail transferred...") + $"{ConsoleExtensions.GetClearLineToRightSequence()}", 0, ConsoleWrapper.CursorTop, true, KernelColorType.Progress, bytesTransferred.SizeString()); + TextWriters.WriteWhere("{0} " + Translate.DoTranslation("of mail transferred...") + $"{ConsoleClearing.GetClearLineToRightSequence()}", 0, ConsoleWrapper.CursorTop, true, KernelColorType.Progress, bytesTransferred.SizeString()); } } } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.NameGen/Nitrocid.Extras.NameGen.csproj b/public/Nitrocid.Addons/Nitrocid.Extras.NameGen/Nitrocid.Extras.NameGen.csproj index bcc6ad08a1..2aebd43ba3 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.NameGen/Nitrocid.Extras.NameGen.csproj +++ b/public/Nitrocid.Addons/Nitrocid.Extras.NameGen/Nitrocid.Extras.NameGen.csproj @@ -65,7 +65,7 @@ - + true diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Notes/Interactive/NoteViewerCli.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Notes/Interactive/NoteViewerCli.cs index 55e5b02094..c330545c4d 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Notes/Interactive/NoteViewerCli.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Notes/Interactive/NoteViewerCli.cs @@ -20,24 +20,24 @@ using Terminaux.Inputs.Interactive; using Nitrocid.Extras.Notes.Management; using Nitrocid.Languages; -using System.Collections; +using System.Collections.Generic; namespace Nitrocid.Extras.Notes.Interactive { /// /// Notes viewer class /// - public class NoteViewerCli : BaseInteractiveTui, IInteractiveTui + public class NoteViewerCli : BaseInteractiveTui, IInteractiveTui { /// - public override IEnumerable PrimaryDataSource => + public override IEnumerable PrimaryDataSource => NoteManagement.ListNotes(); /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(string item) { // Get some info from the note - string noteInstance = (string)item; + string noteInstance = item; bool noteEmpty = string.IsNullOrEmpty(noteInstance); // Generate the rendered text @@ -50,10 +50,10 @@ public override string GetInfoFromItem(object item) } /// - public override void RenderStatus(object item) + public override void RenderStatus(string item) { // Get some info from the note - string noteInstance = (string)item; + string noteInstance = item; bool noteEmpty = string.IsNullOrEmpty(noteInstance); // Generate the rendered text @@ -66,10 +66,10 @@ public override void RenderStatus(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(string item) { // Get some info from the note - string noteInstance = (string)item; + string noteInstance = item; bool noteEmpty = string.IsNullOrEmpty(noteInstance); // Generate the rendered text diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.RssShell/RSS/Commands/List.cs b/public/Nitrocid.Addons/Nitrocid.Extras.RssShell/RSS/Commands/List.cs index 5d08b4099b..4b8569496b 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.RssShell/RSS/Commands/List.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.RssShell/RSS/Commands/List.cs @@ -23,6 +23,7 @@ using Terminaux.Writer.ConsoleWriters; using Nitrocid.Shell.ShellBase.Commands; using Textify.General; +using Terminaux.Base.Extensions; namespace Nitrocid.Extras.RssShell.RSS.Commands { diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.RssShell/RSS/Commands/Search.cs b/public/Nitrocid.Addons/Nitrocid.Extras.RssShell/RSS/Commands/Search.cs index e86fd6a50b..1e96463409 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.RssShell/RSS/Commands/Search.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.RssShell/RSS/Commands/Search.cs @@ -25,6 +25,7 @@ using Terminaux.Writer.ConsoleWriters; using Nitrocid.ConsoleBase.Colors; using Textify.General; +using Terminaux.Base.Extensions; namespace Nitrocid.Extras.RssShell.RSS.Commands { diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.RssShell/RSS/Interactive/RssReaderCli.cs b/public/Nitrocid.Addons/Nitrocid.Extras.RssShell/RSS/Interactive/RssReaderCli.cs index 786e37f0c1..e71a0cf3c0 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.RssShell/RSS/Interactive/RssReaderCli.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.RssShell/RSS/Interactive/RssReaderCli.cs @@ -36,7 +36,7 @@ namespace Nitrocid.Extras.RssShell.RSS.Interactive /// /// RSS Reader TUI class /// - public class RssReaderCli : BaseInteractiveTui, IInteractiveTui + public class RssReaderCli : BaseInteractiveTui, IInteractiveTui { internal static NetworkConnection rssConnection; @@ -62,14 +62,14 @@ private static RSSFeed Feed ]; /// - public override IEnumerable PrimaryDataSource => + public override IEnumerable PrimaryDataSource => Feed.FeedArticles; /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(RSSArticle item) { // Get some info from the article - RSSArticle selectedArticle = (RSSArticle)item; + RSSArticle selectedArticle = item; bool hasTitle = !string.IsNullOrEmpty(selectedArticle.ArticleTitle); bool hasDescription = !string.IsNullOrEmpty(selectedArticle.ArticleDescription); @@ -92,16 +92,16 @@ public override string GetInfoFromItem(object item) } /// - public override void RenderStatus(object item) + public override void RenderStatus(RSSArticle item) { - RSSArticle article = (RSSArticle)item; + RSSArticle article = item; InteractiveTuiStatus.Status = article.ArticleTitle; } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(RSSArticle item) { - RSSArticle article = (RSSArticle)item; + RSSArticle article = item; return article.ArticleTitle; } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.SftpShell/SFTP/Commands/Get.cs b/public/Nitrocid.Addons/Nitrocid.Extras.SftpShell/SFTP/Commands/Get.cs index f71940a307..36f740c305 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.SftpShell/SFTP/Commands/Get.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.SftpShell/SFTP/Commands/Get.cs @@ -41,13 +41,13 @@ public override int Execute(CommandParameters parameters, ref string variableVal TextWriters.Write(Translate.DoTranslation("Downloading file {0}..."), false, KernelColorType.Progress, parameters.ArgumentsList[0]); if (SFTPTransfer.SFTPGetFile(parameters.ArgumentsList[0])) { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(Translate.DoTranslation("Downloaded file {0}."), true, KernelColorType.Success, parameters.ArgumentsList[0]); return 0; } else { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(Translate.DoTranslation("Download failed for file {0}."), true, KernelColorType.Error, parameters.ArgumentsList[0]); return KernelExceptionTools.GetErrorCode(KernelExceptionType.SFTPFilesystem); } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.SftpShell/SFTP/Commands/Put.cs b/public/Nitrocid.Addons/Nitrocid.Extras.SftpShell/SFTP/Commands/Put.cs index f4cac681bd..85bd2296ed 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.SftpShell/SFTP/Commands/Put.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.SftpShell/SFTP/Commands/Put.cs @@ -48,13 +48,13 @@ public override int Execute(CommandParameters parameters, ref string variableVal // Begin the uploading process if (SFTPTransfer.SFTPUploadFile(parameters.ArgumentsList[0])) { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(CharManager.NewLine + Translate.DoTranslation("Uploaded file {0}"), true, KernelColorType.Success, parameters.ArgumentsList[0]); return 0; } else { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriters.Write(CharManager.NewLine + Translate.DoTranslation("Failed to upload {0}"), true, KernelColorType.Error, parameters.ArgumentsList[0]); return KernelExceptionTools.GetErrorCode(KernelExceptionType.SFTPFilesystem); } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.SftpShell/SSH/SSHTools.cs b/public/Nitrocid.Addons/Nitrocid.Extras.SftpShell/SSH/SSHTools.cs index bb972faa5d..dd8ab30f45 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.SftpShell/SSH/SSHTools.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.SftpShell/SSH/SSHTools.cs @@ -38,6 +38,7 @@ using Terminaux.Base; using Nitrocid.ConsoleBase.Inputs; using Nitrocid.Network.Connections; +using Terminaux.Reader; namespace Nitrocid.Extras.SftpShell.SSH { @@ -105,7 +106,7 @@ public static ConnectionInfo PromptConnectionInfo(string Address, int Port, stri DebugWriter.WriteDebug(DebugLevel.W, "Option is not valid. Returning..."); TextWriters.Write(Translate.DoTranslation("Specified option {0} is invalid."), true, KernelColorType.Error, Answer); TextWriters.Write(Translate.DoTranslation("Press any key to go back."), true, KernelColorType.Error); - Input.DetectKeypress(); + TermReader.ReadKey(); break; } @@ -117,7 +118,7 @@ public static ConnectionInfo PromptConnectionInfo(string Address, int Port, stri DebugWriter.WriteDebug(DebugLevel.W, "Answer is not numeric."); TextWriters.Write(Translate.DoTranslation("The answer must be numeric."), true, KernelColorType.Error); TextWriters.Write(Translate.DoTranslation("Press any key to go back."), true, KernelColorType.Error); - Input.DetectKeypress(); + TermReader.ReadKey(); } } diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.SqlShell/Nitrocid.Extras.SqlShell.csproj b/public/Nitrocid.Addons/Nitrocid.Extras.SqlShell/Nitrocid.Extras.SqlShell.csproj index c87dd730d8..7f6b26a6f4 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.SqlShell/Nitrocid.Extras.SqlShell.csproj +++ b/public/Nitrocid.Addons/Nitrocid.Extras.SqlShell/Nitrocid.Extras.SqlShell.csproj @@ -62,7 +62,7 @@ - + diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.ThemeStudio/Studio/ThemeStudioApp.cs b/public/Nitrocid.Addons/Nitrocid.Extras.ThemeStudio/Studio/ThemeStudioApp.cs index c132bd26a4..0ffbe88722 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.ThemeStudio/Studio/ThemeStudioApp.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.ThemeStudio/Studio/ThemeStudioApp.cs @@ -30,10 +30,10 @@ using Nitrocid.Kernel.Events; using Nitrocid.Languages; using Terminaux.Colors; -using Terminaux.Colors.Selector; using Textify.General; using Terminaux.Base; using Nitrocid.ConsoleBase.Inputs; +using Terminaux.Inputs.Styles; namespace Nitrocid.Extras.ThemeStudio.Studio { @@ -83,7 +83,7 @@ public static void StartThemeStudio(string ThemeName) TextWriterColor.Write(Translate.DoTranslation("Making a new theme \"{0}\".") + CharManager.NewLine, ThemeName); // Prompt user - int response = SelectionStyle.PromptSelection(TextTools.FormatString(Translate.DoTranslation("Making a new theme \"{0}\"."), ThemeName), choices, altChoices, true); + int response = SelectionStyle.PromptSelection(TextTools.FormatString(Translate.DoTranslation("Making a new theme \"{0}\"."), ThemeName), [.. choices], [.. altChoices], true); DebugWriter.WriteDebug(DebugLevel.I, "Got response: {0}", response); // Check for response integrity diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Timers/Timers/StopwatchScreen.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Timers/Timers/StopwatchScreen.cs index e36170bf59..551de1ebc8 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Timers/Timers/StopwatchScreen.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Timers/Timers/StopwatchScreen.cs @@ -28,6 +28,8 @@ using Terminaux.Inputs; using Terminaux.Base.Buffered; using Terminaux.Base; +using Terminaux.Base.Extensions; +using Terminaux.Reader; namespace Nitrocid.Extras.Timers.Timers { @@ -98,7 +100,7 @@ public static void OpenStopwatch() // Print informational messages builder.Append( TextWriterWhereColor.RenderWhere(status, 1, 0, false, KernelColorTools.GetColor(KernelColorType.NeutralText), KernelColorTools.GetColor(KernelColorType.Background)) + - ConsoleExtensions.GetClearLineToRightSequence() + ConsoleClearing.GetClearLineToRightSequence() ); // Print the laps list @@ -134,12 +136,12 @@ public static void OpenStopwatch() { // Wait for a keypress if (ConsoleWrapper.KeyAvailable) - KeysKeypress = Input.DetectKeypress().Key; + KeysKeypress = TermReader.ReadKey().Key; } else { // Wait for a keypress - KeysKeypress = Input.DetectKeypress().Key; + KeysKeypress = TermReader.ReadKey().Key; } // Check for a keypress diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.Timers/Timers/TimerScreen.cs b/public/Nitrocid.Addons/Nitrocid.Extras.Timers/Timers/TimerScreen.cs index 9c147b7005..72554c81a1 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.Timers/Timers/TimerScreen.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.Timers/Timers/TimerScreen.cs @@ -33,6 +33,7 @@ using Terminaux.Writer.FancyWriters; using Terminaux.Colors; using Terminaux.Base; +using Terminaux.Reader; namespace Nitrocid.Extras.Timers.Timers { @@ -177,12 +178,12 @@ public static void OpenTimer() { // Wait for a keypress if (ConsoleWrapper.KeyAvailable) - KeysKeypress = Input.DetectKeypress().Key; + KeysKeypress = TermReader.ReadKey().Key; } else { // Wait for a keypress - KeysKeypress = Input.DetectKeypress().Key; + KeysKeypress = TermReader.ReadKey().Key; } // Check for a keypress diff --git a/public/Nitrocid.Addons/Nitrocid.Extras.UnitConv/Interactives/UnitConverterCli.cs b/public/Nitrocid.Addons/Nitrocid.Extras.UnitConv/Interactives/UnitConverterCli.cs index d52766c2f6..28c731feb6 100644 --- a/public/Nitrocid.Addons/Nitrocid.Extras.UnitConv/Interactives/UnitConverterCli.cs +++ b/public/Nitrocid.Addons/Nitrocid.Extras.UnitConv/Interactives/UnitConverterCli.cs @@ -33,7 +33,7 @@ namespace Nitrocid.Extras.UnitConv.Interactives /// /// Unit converter TUI class /// - public class UnitConverterCli : BaseInteractiveTui, IInteractiveTui + public class UnitConverterCli : BaseInteractiveTui, IInteractiveTui { /// /// Contact manager bindings @@ -49,12 +49,12 @@ public class UnitConverterCli : BaseInteractiveTui, IInteractiveTui true; /// - public override IEnumerable PrimaryDataSource => - GetUnitTypeNames(); + public override IEnumerable PrimaryDataSource => + GetUnitTypeNames().OfType(); /// - public override IEnumerable SecondaryDataSource => - GetUnits(); + public override IEnumerable SecondaryDataSource => + GetUnits().OfType(); /// public override void RenderStatus(object item) => diff --git a/public/Nitrocid.Addons/Nitrocid.Legacy.HddUncleaner/HddUncleaner2015.cs b/public/Nitrocid.Addons/Nitrocid.Legacy.HddUncleaner/HddUncleaner2015.cs index 8a5ef4f584..b5d8b8f603 100644 --- a/public/Nitrocid.Addons/Nitrocid.Legacy.HddUncleaner/HddUncleaner2015.cs +++ b/public/Nitrocid.Addons/Nitrocid.Legacy.HddUncleaner/HddUncleaner2015.cs @@ -24,6 +24,8 @@ using Nitrocid.Languages; using Terminaux.Base; using Nitrocid.ConsoleBase.Inputs; +using Terminaux.Base.Extensions; +using Terminaux.Reader; namespace Nitrocid.Legacy.HddUncleaner { @@ -43,7 +45,7 @@ internal static void EntryPoint() { // Disclaimer TextWriters.Write(Translate.DoTranslation("This \"mock app\" mocks \"HDD Cleaner 2.1,\" which was released on November 24th, 2015. We'll call it \"HDD Uncleaner 2015.\" It'll basically do nothing except display messages to the console using the Nitrocid KS API. It'll try to simulate how this archived program looks like. Please don't take this too literally as it's just a joke program intended to amuse you. It also doesn't simulate extraneous features, like the \"AutoRecovery\" routine. Please note that we don't intend to localize this. Press any key to start."), true, KernelColorType.Warning); - Input.DetectKeypress(); + TermReader.ReadKey(); while (!exiting) TagMain(); @@ -56,13 +58,13 @@ internal static void EntryPoint() private static void TagMain() { // :main (line 138) - ConsoleExtensions.SetTitle("-----==++==----- Hard Disk Cleaner -----==++==-----"); + ConsoleMisc.SetTitle("-----==++==----- Hard Disk Cleaner -----==++==-----"); ConsoleWrapper.Clear(); - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriterColor.Write("+---------------------------------------------------------+"); TextWriterColor.Write(": Hard Disk Cleaner -----==+==----- Choice 8 for exit :"); TextWriterColor.Write("+---------------------------------------------------------+"); - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriterColor.Write(" +-----------------------------+"); TextWriterColor.Write(" -----=:=----- Select Options -----=:=-----"); TextWriterColor.Write(" +-----------------------------+"); @@ -76,7 +78,7 @@ private static void TagMain() TextWriterColor.Write(" : :7. Hibernate : saves more: :"); TextWriterColor.Write(" : +-------------------------+ :"); TextWriterColor.Write(" +---End support of HC 1.0.0---+"); - TextWriterColor.Write(); + TextWriterRaw.Write(); string option = InputTools.ReadLine(" Your option:"); // :main - Checking for option (line 165) @@ -86,48 +88,48 @@ private static void TagMain() case "1": // User selected the Defrag option. Translate this to the :defrag tag // :defrag (line 182) - ConsoleExtensions.SetTitle("-----==++==----- Defrag -----==++==-----"); + ConsoleMisc.SetTitle("-----==++==----- Defrag -----==++==-----"); OsSelect(); break; case "2": // User selected the Cleanup option. Translate this to the :cleans tag // :cleans (line 205) - ConsoleExtensions.SetTitle("-----==++==----- Clean Disk -----==++==-----"); + ConsoleMisc.SetTitle("-----==++==----- Clean Disk -----==++==-----"); OsSelect(); break; case "3": // User selected the Manual option. Translate this to the :explor tag // :explor (line 228) - ConsoleExtensions.SetTitle("-----==++==----- Explorer -----==++==-----"); - Input.DetectKeypress(); + ConsoleMisc.SetTitle("-----==++==----- Explorer -----==++==-----"); + TermReader.ReadKey(); break; case "4": // User selected the Reinstall option. Translate this to the :format tag // :format (line 236) - ConsoleExtensions.SetTitle("-----==++==----- WARNING!! -----==++==-----"); - TextWriterColor.Write(); + ConsoleMisc.SetTitle("-----==++==----- WARNING!! -----==++==-----"); + TextWriterRaw.Write(); TextWriterColor.Write("IMPORTANT, YOU MUST BACKUP FILES TO FLOPPY, USB OR EXTERNAL HDD OTHERWISE YOU'LL LOSE YOUR IMPORTANT FILES, APPS AND GAMES!"); - Input.DetectKeypress(); + TermReader.ReadKey(); ConsoleWrapper.Clear(); OsSelect(); break; case "5": // User selected the Programs option. Translate this to the :progra tag // :progra (line 333) - ConsoleExtensions.SetTitle("-----==++==----- Add or remove programs -----==++==-----"); - Input.DetectKeypress(); + ConsoleMisc.SetTitle("-----==++==----- Add or remove programs -----==++==-----"); + TermReader.ReadKey(); break; case "6": // User selected the SysRestore option. Translate this to the :sysres tag // :sysres (line 341) - ConsoleExtensions.SetTitle("-----==++==----- System Restore Turnoff -----==++==-----"); + ConsoleMisc.SetTitle("-----==++==----- System Restore Turnoff -----==++==-----"); OsSelect(); break; case "7": // User selected the Hibernate option. Translate this to the :hibern tag // :hibern (line 384) - ConsoleExtensions.SetTitle("-----==++==----- Hibernation system off -----==++==-----"); - TextWriterColor.Write(); + ConsoleMisc.SetTitle("-----==++==----- Hibernation system off -----==++==-----"); + TextWriterRaw.Write(); TextWriterColor.Write("1. Click on \"Hibernate\" tab"); TextWriterColor.Write("2. Clear the check box \"Enable Hibernation\""); TextWriterColor.Write("3. Click on OK or Apply button"); @@ -136,16 +138,16 @@ private static void TagMain() case "8": // User selected the exit option. Translate this to the :exihdc tag // :exihdc (line 607) - ConsoleExtensions.SetTitle("-----==++==----- Deleting cache... -----==++==-----"); + ConsoleMisc.SetTitle("-----==++==----- Deleting cache... -----==++==-----"); exiting = true; break; default: // User selected the invalid option. // :main (line 175) - ConsoleExtensions.SetTitle("-----==++==----- Wrong Parameter! -----==++==-----"); - TextWriterColor.Write(); + ConsoleMisc.SetTitle("-----==++==----- Wrong Parameter! -----==++==-----"); + TextWriterRaw.Write(); TextWriterColor.Write($"The option {option} is not found, We will add soon."); - Input.DetectKeypress(); + TermReader.ReadKey(); break; } } @@ -153,12 +155,12 @@ private static void TagMain() private static void OsSelect() { // Of course, this is not VMware Workstation. - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriterColor.Write("Which OS do you run?"); - TextWriterColor.Write(); + TextWriterRaw.Write(); TextWriterColor.Write("1. Windows XP"); TextWriterColor.Write("2. Windows 7"); - TextWriterColor.Write(); + TextWriterRaw.Write(); // Prompt for option. "HDD Cleaner" didn't check for option validity. InputTools.ReadLine(" Your option:"); diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/BaseBSOD.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/BaseBSOD.cs index 6b6431df12..4785f7d716 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/BaseBSOD.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/BaseBSOD.cs @@ -29,7 +29,7 @@ public virtual void Simulate() { ColorTools.LoadBackDry(new Color(ConsoleColors.Black)); ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); - TextWriterColor.WritePlain("No operating system found.", true); + TextWriterRaw.WritePlain("No operating system found.", true); } } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/BeOs5Error.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/BeOs5Error.cs index 817a1256fc..f0ed5d0147 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/BeOs5Error.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/BeOs5Error.cs @@ -32,7 +32,7 @@ public override void Simulate() ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Simulate a BeOS 5.0 load failure - TextWriterColor.WritePlain( + TextWriterRaw.WritePlain( "PANIC: no shell!\n" + "kernel debugger: Welcome to Kernel Debugging Land...\n" + $" eax {RandomDriver.Random():x8} ebp {RandomDriver.Random():x8} cs {RandomDriver.Random():x4} | area {RandomDriver.Random():x8} (kernel_intel_text)\n" + diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/BootMgrFatalError.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/BootMgrFatalError.cs index e09a68c132..864130a0c8 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/BootMgrFatalError.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/BootMgrFatalError.cs @@ -45,15 +45,15 @@ public override void Simulate() switch (excVariant) { case Variant.Missing: - TextWriterColor.WritePlain("BOOTMGR is missing.", true); - TextWriterColor.WritePlain("Press Ctrl+Alt+Del to restart...", true); + TextWriterRaw.WritePlain("BOOTMGR is missing.", true); + TextWriterRaw.WritePlain("Press Ctrl+Alt+Del to restart...", true); break; case Variant.Compressed: - TextWriterColor.WritePlain("BOOTMGR is compressed.", true); - TextWriterColor.WritePlain("Press Ctrl+Alt+Del to restart...", true); + TextWriterRaw.WritePlain("BOOTMGR is compressed.", true); + TextWriterRaw.WritePlain("Press Ctrl+Alt+Del to restart...", true); break; case Variant.Corrupted: - TextWriterColor.WritePlain("BOOTMGR image is corrupt. The system cannot boot.", true); + TextWriterRaw.WritePlain("BOOTMGR image is corrupt. The system cannot boot.", true); break; } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/FreeBsdBoot.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/FreeBsdBoot.cs index f6a3ab9108..bc8337d8b2 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/FreeBsdBoot.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/FreeBsdBoot.cs @@ -32,7 +32,7 @@ public override void Simulate() ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Simulate a FreeBSD boot failure - TextWriterColor.WritePlain( + TextWriterRaw.WritePlain( "FreeBSD/x86 boot\n" + "\n" + $"int={RandomDriver.Random():x8} err={RandomDriver.Random():x8} efl={RandomDriver.Random():x8} eip={RandomDriver.Random():x8}\n" + diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/FreeBsdPanic.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/FreeBsdPanic.cs index cba066d002..27786f5c91 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/FreeBsdPanic.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/FreeBsdPanic.cs @@ -32,7 +32,7 @@ public override void Simulate() ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Simulate a FreeBSD kernel panic - TextWriterColor.WritePlain( + TextWriterRaw.WritePlain( "Fatal trap 9: general protection fault while in kernel mode\n" + "cpuid = 4; apic id = 14\n" + $"instruction pointer = 0x{RandomDriver.Random():x2}:0x{RandomDriver.Random():x16}\n" + diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/GrubError.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/GrubError.cs index 0e0438658d..a8eb94d36c 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/GrubError.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/GrubError.cs @@ -32,9 +32,9 @@ public override void Simulate() ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Simulate a Haiku bootloader failure - TextWriterColor.WritePlain("error: unknown filesystem.", true); - TextWriterColor.WritePlain("Entering rescue mode...", true); - TextWriterColor.WritePlain("grub rescue> ", false); + TextWriterRaw.WritePlain("error: unknown filesystem.", true); + TextWriterRaw.WritePlain("Entering rescue mode...", true); + TextWriterRaw.WritePlain("grub rescue> ", false); ConsoleWrapper.CursorVisible = true; } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/HaikuBootloader.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/HaikuBootloader.cs index 067da24e8a..92bb0ce9c9 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/HaikuBootloader.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/HaikuBootloader.cs @@ -31,7 +31,7 @@ public override void Simulate() ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Simulate a Haiku bootloader failure - TextWriterColor.WritePlain("bios_ia32 stage1: Failed to load OS. Press any key to reboot...", true); + TextWriterRaw.WritePlain("bios_ia32 stage1: Failed to load OS. Press any key to reboot...", true); } } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Linux.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Linux.cs index 90fc9c264c..c9ea370bf3 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Linux.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Linux.cs @@ -32,7 +32,7 @@ public override void Simulate() ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Simulate a null pointer dereference - TextWriterColor.WritePlain( + TextWriterRaw.WritePlain( $"Unable to handle kernel NULL pointer dereference at virtual address {RandomDriver.Random():X8}\n" + " printing eip:\n" + "*pde = 00000000\n" + diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Linux2.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Linux2.cs index f3a033b736..b2c7b2eb02 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Linux2.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Linux2.cs @@ -31,7 +31,7 @@ public override void Simulate() ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Simulate a null pointer dereference - TextWriterColor.WritePlain( + TextWriterRaw.WritePlain( "IP Protocols: IGMP, ICMP, UDP, TCP\n" + "VFS: Diskquotas version dquot_5.6.0 initialized\n" + "Checking 386/387 coupling... Ok, fpu using exception 16 reporting.\n" + diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/MacPpcPanic.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/MacPpcPanic.cs index 21c388e04e..803a71a028 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/MacPpcPanic.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/MacPpcPanic.cs @@ -32,7 +32,7 @@ public override void Simulate() ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Simulate a Mac OS X 10.0 PowerPC kernel panic on boot - TextWriterColor.WritePlain( + TextWriterRaw.WritePlain( "panic (cpu 0): Couldn't register lo modules\n\n" + $"backtrace: 0x{RandomDriver.Random():x8} 0x{RandomDriver.Random():x8} 0x{RandomDriver.Random():x8} 0x{RandomDriver.Random():x8} 0x{RandomDriver.Random():x8} 0x{RandomDriver.Random():x8} 0x{RandomDriver.Random():x8} 0x{RandomDriver.Random():x8}\n\n" + "No debugger configured - dumping debug information\n\n" + diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/OS2Warp.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/OS2Warp.cs index 4e9072c383..eedf16d30c 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/OS2Warp.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/OS2Warp.cs @@ -32,23 +32,23 @@ public override void Simulate() ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Simulate an OS/2 kernel failure - TextWriterColor.WritePlain("Exception in module: OS2KRNL", true); - TextWriterColor.WritePlain("TRAP 000d ERRCD=00c0 ERACC=**** ERLIM=********", true); - TextWriterColor.WritePlain("EAX=00000008 EBX=0000fdf0 ECX=00001616 EDX=00000000", true); - TextWriterColor.WritePlain($"ESI={RandomDriver.Random():x8} EDI={RandomDriver.Random():x8} EBP={RandomDriver.Random():x8} FLG={RandomDriver.Random():x8}", true); - TextWriterColor.WritePlain($"CS:EIP=0140:{RandomDriver.Random():x8} CSACC=009b CSLIM={RandomDriver.Random():x8}", true); - TextWriterColor.WritePlain($"SS:ESP=0030:{RandomDriver.Random():x8} SSACC=009b SSLIM={RandomDriver.Random():x8}", true); - TextWriterColor.WritePlain($"DS=0a00 DSACC=00f3 DSLIM={RandomDriver.Random():x8} CR0={RandomDriver.Random():x8}", true); - TextWriterColor.WritePlain($"ES=0a00 ESACC=00f3 ESLIM={RandomDriver.Random():x8} CR2={RandomDriver.Random():x8}", true); - TextWriterColor.WritePlain($"FS=0000 FSACC=**** FSLIM=********", true); - TextWriterColor.WritePlain($"GS=0000 GSACC=**** GSLIM=********\n", true); - TextWriterColor.WritePlain("The system detected an internal processing error at", true); - TextWriterColor.WritePlain($"location ##0168:{RandomDriver.Random():x8} - 000e:cb1c", true); - TextWriterColor.WritePlain("60000, 9084\n", true); - TextWriterColor.WritePlain($"{RandomDriver.Random():x8}", true); - TextWriterColor.WritePlain("Internal revision 14.086_W4\n", true); - TextWriterColor.WritePlain("The system is stopped. Record all of the above information and", true); - TextWriterColor.WritePlain("contact your service representative.", true); + TextWriterRaw.WritePlain("Exception in module: OS2KRNL", true); + TextWriterRaw.WritePlain("TRAP 000d ERRCD=00c0 ERACC=**** ERLIM=********", true); + TextWriterRaw.WritePlain("EAX=00000008 EBX=0000fdf0 ECX=00001616 EDX=00000000", true); + TextWriterRaw.WritePlain($"ESI={RandomDriver.Random():x8} EDI={RandomDriver.Random():x8} EBP={RandomDriver.Random():x8} FLG={RandomDriver.Random():x8}", true); + TextWriterRaw.WritePlain($"CS:EIP=0140:{RandomDriver.Random():x8} CSACC=009b CSLIM={RandomDriver.Random():x8}", true); + TextWriterRaw.WritePlain($"SS:ESP=0030:{RandomDriver.Random():x8} SSACC=009b SSLIM={RandomDriver.Random():x8}", true); + TextWriterRaw.WritePlain($"DS=0a00 DSACC=00f3 DSLIM={RandomDriver.Random():x8} CR0={RandomDriver.Random():x8}", true); + TextWriterRaw.WritePlain($"ES=0a00 ESACC=00f3 ESLIM={RandomDriver.Random():x8} CR2={RandomDriver.Random():x8}", true); + TextWriterRaw.WritePlain($"FS=0000 FSACC=**** FSLIM=********", true); + TextWriterRaw.WritePlain($"GS=0000 GSACC=**** GSLIM=********\n", true); + TextWriterRaw.WritePlain("The system detected an internal processing error at", true); + TextWriterRaw.WritePlain($"location ##0168:{RandomDriver.Random():x8} - 000e:cb1c", true); + TextWriterRaw.WritePlain("60000, 9084\n", true); + TextWriterRaw.WritePlain($"{RandomDriver.Random():x8}", true); + TextWriterRaw.WritePlain("Internal revision 14.086_W4\n", true); + TextWriterRaw.WritePlain("The system is stopped. Record all of the above information and", true); + TextWriterRaw.WritePlain("contact your service representative.", true); } } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/OS2WarpPreBoot.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/OS2WarpPreBoot.cs index 18a57f1bbb..d07455199e 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/OS2WarpPreBoot.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/OS2WarpPreBoot.cs @@ -31,8 +31,8 @@ public override void Simulate() ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Simulate a Haiku bootloader failure - TextWriterColor.WritePlain("OS/2 !! SYS02025", true); - TextWriterColor.WritePlain("OS/2 !! SYS02027", true); + TextWriterRaw.WritePlain("OS/2 !! SYS02025", true); + TextWriterRaw.WritePlain("OS/2 !! SYS02027", true); } } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Windows2K.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Windows2K.cs index e1471ec7a1..2365dbc14d 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Windows2K.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Windows2K.cs @@ -28,26 +28,26 @@ internal class Windows2K : BaseBSOD { public override void Simulate() { - ColorTools.LoadBackDry(new Color(ConsoleColors.DarkBlue_000087)); + ColorTools.LoadBackDry(new Color(ConsoleColors.DarkBlue)); ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Display technical information - TextWriterColor.WritePlain($"\n*** STOP: 0x0000007B (0x{RandomDriver.Random():X8}, 0x{RandomDriver.Random():X8}, 0x{RandomDriver.Random():X8}, 0x{RandomDriver.Random():X8})\n", true); + TextWriterRaw.WritePlain($"\n*** STOP: 0x0000007B (0x{RandomDriver.Random():X8}, 0x{RandomDriver.Random():X8}, 0x{RandomDriver.Random():X8}, 0x{RandomDriver.Random():X8})\n", true); // If this is the first time... - TextWriterColor.WritePlain("If this is the first time you've seen this Stop error screen,\n" + + TextWriterRaw.WritePlain("If this is the first time you've seen this Stop error screen,\n" + "restart your computer. If this screen appears again, follow\n" + "these steps:\n", true); // Display some steps - TextWriterColor.WritePlain("Check for viruses on your computer. Remove any newly installed.\n" + + TextWriterRaw.WritePlain("Check for viruses on your computer. Remove any newly installed.\n" + "hard drives or hard drive controllers. Check your hard drive\n" + "to make sure it is properly configured and terminated.\n" + "Run CHKDSK /F to check for hard drive corruption, and then\n" + "restart your computer.\n", true); // Getting Started manual reference - TextWriterColor.WritePlain("Refer to your Getting Started manual for more information on\n" + + TextWriterRaw.WritePlain("Refer to your Getting Started manual for more information on\n" + "troubleshooting Stop errors.", true); } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Windows98.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Windows98.cs index 854d3f8b8f..9f15168ac1 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Windows98.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/Windows98.cs @@ -28,14 +28,14 @@ internal class Windows98 : BaseBSOD { public override void Simulate() { - ColorTools.LoadBackDry(new Color(ConsoleColors.DarkBlue_000087)); + ColorTools.LoadBackDry(new Color(ConsoleColors.DarkBlue)); ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Windows header string headerText = " Windows "; int headerStartLeft = ConsoleWrapper.WindowWidth / 2 - headerText.Length / 2; int headerStartTop = ConsoleWrapper.WindowHeight / 2 - 5; - TextWriterWhereColor.WriteWhereColorBack(headerText, headerStartLeft, headerStartTop, new Color(ConsoleColors.DarkBlue_000087), new Color(ConsoleColors.White)); + TextWriterWhereColor.WriteWhereColorBack(headerText, headerStartLeft, headerStartTop, new Color(ConsoleColors.DarkBlue), new Color(ConsoleColors.White)); // Write error int errorLeft = ConsoleWrapper.WindowWidth / 2 - 35; @@ -45,7 +45,7 @@ public override void Simulate() "* Press CTRL+ALT+DEL again to restart your computer. You will\n" + " lose any unsaved information in all applications.\n\n" + " Press any key to continue", - errorLeft, headerStartTop + 2, new Color(ConsoleColors.White), new Color(ConsoleColors.DarkBlue_000087)); + errorLeft, headerStartTop + 2, new Color(ConsoleColors.White), new Color(ConsoleColors.DarkBlue)); } } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/WindowsNt.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/WindowsNt.cs index 8963eaecfb..c781176b39 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/WindowsNt.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/WindowsNt.cs @@ -28,33 +28,33 @@ internal class WindowsNt : BaseBSOD { public override void Simulate() { - ColorTools.LoadBackDry(new Color(ConsoleColors.DarkBlue_000087)); + ColorTools.LoadBackDry(new Color(ConsoleColors.DarkBlue)); ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Display technical information - TextWriterColor.WritePlain($"\n*** STOP: 0x0000007B (0x{RandomDriver.Random():X8},0x{RandomDriver.Random():X8},0x{RandomDriver.Random():X8},0x{RandomDriver.Random():X8})", true); - TextWriterColor.WritePlain($"PROCESS1_INITIALIZATION_FAILED\n", true); - TextWriterColor.WritePlain($"CPUID:GenuineIntel 7.2.5 irql:0 SYSVER 0xf000069b\n", true); + TextWriterRaw.WritePlain($"\n*** STOP: 0x0000007B (0x{RandomDriver.Random():X8},0x{RandomDriver.Random():X8},0x{RandomDriver.Random():X8},0x{RandomDriver.Random():X8})", true); + TextWriterRaw.WritePlain($"PROCESS1_INITIALIZATION_FAILED\n", true); + TextWriterRaw.WritePlain($"CPUID:GenuineIntel 7.2.5 irql:0 SYSVER 0xf000069b\n", true); // Display DLL bases - TextWriterColor.WritePlain($"Dll base DateStmp - Name Dll base DateStmp - Name", true); - TextWriterColor.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} - ntoskrnl.exe {RandomDriver.Random():X8} {RandomDriver.Random():X8} - hal.dll", true); - TextWriterColor.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} - setupdd.sys {RandomDriver.Random():X8} {RandomDriver.Random():X8} - pcmcia.sys", true); - TextWriterColor.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} - SCSIPORT.SYS {RandomDriver.Random():X8} {RandomDriver.Random():X8} - vga.sys", true); - TextWriterColor.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} - VIDEOPRT.SYS {RandomDriver.Random():X8} {RandomDriver.Random():X8} - floppy.sys", true); - TextWriterColor.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} - i8042prt.sys {RandomDriver.Random():X8} {RandomDriver.Random():X8} - kbdclass.sys", true); - TextWriterColor.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} - fastfat.sys\n", true); + TextWriterRaw.WritePlain($"Dll base DateStmp - Name Dll base DateStmp - Name", true); + TextWriterRaw.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} - ntoskrnl.exe {RandomDriver.Random():X8} {RandomDriver.Random():X8} - hal.dll", true); + TextWriterRaw.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} - setupdd.sys {RandomDriver.Random():X8} {RandomDriver.Random():X8} - pcmcia.sys", true); + TextWriterRaw.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} - SCSIPORT.SYS {RandomDriver.Random():X8} {RandomDriver.Random():X8} - vga.sys", true); + TextWriterRaw.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} - VIDEOPRT.SYS {RandomDriver.Random():X8} {RandomDriver.Random():X8} - floppy.sys", true); + TextWriterRaw.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} - i8042prt.sys {RandomDriver.Random():X8} {RandomDriver.Random():X8} - kbdclass.sys", true); + TextWriterRaw.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} - fastfat.sys\n", true); // Display addresses - TextWriterColor.WritePlain($"Address dword dump Build [1057] - Name", true); + TextWriterRaw.WritePlain($"Address dword dump Build [1057] - Name", true); for (int i = 0; i < RandomDriver.Random(5, 20); i++) - TextWriterColor.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} {RandomDriver.Random():X8} {RandomDriver.Random():X8} {RandomDriver.Random():X8} {RandomDriver.Random():X8} {RandomDriver.Random():X8} - ntoskrnl.exe", true); - TextWriterColor.WritePlain("", true); + TextWriterRaw.WritePlain($"{RandomDriver.Random():X8} {RandomDriver.Random():X8} {RandomDriver.Random():X8} {RandomDriver.Random():X8} {RandomDriver.Random():X8} {RandomDriver.Random():X8} {RandomDriver.Random():X8} - ntoskrnl.exe", true); + TextWriterRaw.WritePlain("", true); // Display outro - TextWriterColor.WritePlain("Restart and set the recovery options in the system control panel", true); - TextWriterColor.WritePlain("or the /CRASHDEBUG system start option. If this message reappears,", true); - TextWriterColor.WritePlain("contact your system administrator or technical support group.", true); + TextWriterRaw.WritePlain("Restart and set the recovery options in the system control panel", true); + TextWriterRaw.WritePlain("or the /CRASHDEBUG system start option. If this message reappears,", true); + TextWriterRaw.WritePlain("contact your system administrator or technical support group.", true); } } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/WindowsXP.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/WindowsXP.cs index 16017a6c71..d7b98c65f6 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/WindowsXP.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/WindowsXP.cs @@ -306,11 +306,11 @@ public void DisplayBugCheck(BugCheckCodes BugCheckCode) { // Windows 7's BSOD is the same as Windows XP's and Windows Vista's BSOD. var bugParams = BugChecks[BugCheckCode]; - ColorTools.LoadBackDry(new Color(ConsoleColors.DarkBlue_000087)); + ColorTools.LoadBackDry(new Color(ConsoleColors.DarkBlue)); ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // First, write the introduction - TextWriterColor.WritePlain("\nA problem has been detected and Windows has been shut down to prevent damage\n" + + TextWriterRaw.WritePlain("\nA problem has been detected and Windows has been shut down to prevent damage\n" + "to your computer.\n", true); // Then, get the message @@ -319,36 +319,36 @@ public void DisplayBugCheck(BugCheckCodes BugCheckCode) // We're not displaying message, but display code if Russian Roulette returned true. displayCodeName ? BugCheckCode.ToString() : ""; if (!string.IsNullOrEmpty(bugCheckMessage)) - TextWriterColor.WritePlain($"{bugCheckMessage}\n", true); + TextWriterRaw.WritePlain($"{bugCheckMessage}\n", true); // If this is the first time... - TextWriterColor.WritePlain("If this is the first time you've seen this Stop error screen,\n" + + TextWriterRaw.WritePlain("If this is the first time you've seen this Stop error screen,\n" + "restart your computer. If this screen appears again, follow\n" + "these steps:\n", true); // Display some steps as to how to update your software and hardware drivers through Windows Update - TextWriterColor.WritePlain("Check to make sure any new hardware or software is properly installed.\n" + + TextWriterRaw.WritePlain("Check to make sure any new hardware or software is properly installed.\n" + "If this is a new installation, ask your hardware or software manufacturer\n" + "for any Windows updates you might need.\n", true); // Display an unhelpful step that only applies to 2001-era computers or older - TextWriterColor.WritePlain("If problems continue, disable or remove any newly installed hardware\n" + + TextWriterRaw.WritePlain("If problems continue, disable or remove any newly installed hardware\n" + "or software. Disable BIOS memory options such as caching or shadowing.", true); // Safe mode... - TextWriterColor.WritePlain("If you need to use Safe Mode to remove or disable components, restart\n" + + TextWriterRaw.WritePlain("If you need to use Safe Mode to remove or disable components, restart\n" + "your computer, press F8 to select Advanced Startup Options, and then\n" + "select Safe Mode.\n", true); // Display technical information - TextWriterColor.WritePlain("Technical information:\n\n" + + TextWriterRaw.WritePlain("Technical information:\n\n" + $"*** STOP: 0x{bugParams.WindowsBugCheckCode:X8} (0x{RandomDriver.Random():X8}, 0x{RandomDriver.Random():X8}, 0x{RandomDriver.Random():X8}, 0x{RandomDriver.Random():X8})\n", true); // Display dumping message and stop here - TextWriterColor.WritePlain("Collecting data for crash dump...\n" + + TextWriterRaw.WritePlain("Collecting data for crash dump...\n" + "Initializing disk for crash dump...\n" + "Beginning dump of physical memory.", true); - TextWriterColor.WritePlain("Dumping physical memory to disk: ", false); + TextWriterRaw.WritePlain("Dumping physical memory to disk: ", false); } } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/YabootLinux.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/YabootLinux.cs index 8e8d75e045..adef1ef722 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/YabootLinux.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Animations/BSOD/Simulations/YabootLinux.cs @@ -22,6 +22,7 @@ using Terminaux.Colors; using Terminaux.Base; using Terminaux.Colors.Data; +using Terminaux.Writer.DynamicWriters; namespace Nitrocid.ScreensaverPacks.Animations.BSOD.Simulations { @@ -33,17 +34,17 @@ public override void Simulate() ColorTools.SetConsoleColor(new Color(ConsoleColors.White)); // Simulate a Yaboot failure - TextWriterColor.WritePlain("Welcome to yaboot version 1.3.17", true); - TextWriterColor.WritePlain("Enter \"help\" to get some basic usage information", true); - TextWriterColor.WritePlain("boot: ", false); + TextWriterRaw.WritePlain("Welcome to yaboot version 1.3.17", true); + TextWriterRaw.WritePlain("Enter \"help\" to get some basic usage information", true); + TextWriterRaw.WritePlain("boot: ", false); ConsoleWrapper.CursorVisible = true; Thread.Sleep(3000); TextWriterSlowColor.WriteSlowlyPlain("Linux", true, 140); ConsoleWrapper.CursorVisible = false; - TextWriterColor.WritePlain("Please wait, loading kernel...", true); + TextWriterRaw.WritePlain("Please wait, loading kernel...", true); Thread.Sleep(60); - TextWriterColor.WritePlain("/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:4,/boot/kernel/genkernel-ppc-3.12.21-gentoo-r1: Unknown or corrupt filesystem", true); - TextWriterColor.WritePlain("boot: ", false); + TextWriterRaw.WritePlain("/pci@f2000000/mac-io@17/ata-4@1f000/disk@0:4,/boot/kernel/genkernel-ppc-3.12.21-gentoo-r1: Unknown or corrupt filesystem", true); + TextWriterRaw.WritePlain("boot: ", false); ConsoleWrapper.CursorVisible = true; } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Nitrocid.ScreensaverPacks.csproj b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Nitrocid.ScreensaverPacks.csproj index d189522811..ff0ae806f8 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Nitrocid.ScreensaverPacks.csproj +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Nitrocid.ScreensaverPacks.csproj @@ -64,7 +64,7 @@ - + true diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ColorBleed.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ColorBleed.cs index 68296811ee..40d106fcf3 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ColorBleed.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ColorBleed.cs @@ -26,7 +26,7 @@ using Nitrocid.Kernel.Threading; using Nitrocid.Misc.Screensaver; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; namespace Nitrocid.ScreensaverPacks.Screensavers @@ -317,7 +317,7 @@ public override void ScreensaverLogic() // Draw and clean the buffer string buffer = BleedState.bleedBuffer.ToString(); BleedState.bleedBuffer.Clear(); - TextWriterColor.WritePlain(buffer); + TextWriterRaw.WritePlain(buffer); // Reset resize sync ConsoleResizeHandler.WasResized(); diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ColorMix.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ColorMix.cs index 4f4603ec0b..a83e0878de 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ColorMix.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ColorMix.cs @@ -278,7 +278,7 @@ public override void ScreensaverLogic() { ColorTools.SetConsoleColorDry(Color.Empty); ColorTools.SetConsoleColorDry(colorStorage, true); - TextWriterColor.WritePlain(" ", false); + TextWriterRaw.WritePlain(" ", false); } else { diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Diamond.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Diamond.cs index 28f8173c53..43ca5c9a0b 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Diamond.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Diamond.cs @@ -140,7 +140,7 @@ public override void ScreensaverLogic() } // Now, write the diamond buffer - TextWriterColor.WritePlain(buffer.ToString(), false); + TextWriterRaw.WritePlain(buffer.ToString(), false); buffer.Clear(); seen = true; } @@ -225,7 +225,7 @@ public override void ScreensaverLogic() ); // Now, write the diamond buffer - TextWriterColor.WritePlain(buffer.ToString(), false); + TextWriterRaw.WritePlain(buffer.ToString(), false); buffer.Clear(); // Sleep @@ -273,7 +273,7 @@ public override void ScreensaverLogic() ); // Now, write the diamond buffer - TextWriterColor.WritePlain(buffer.ToString(), false); + TextWriterRaw.WritePlain(buffer.ToString(), false); buffer.Clear(); // Sleep diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Dissolve.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Dissolve.cs index 8ad7dd2114..c0f9a271dc 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Dissolve.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Dissolve.cs @@ -284,7 +284,7 @@ public override void ScreensaverLogic() { ColorTools.SetConsoleColorDry(Color.Empty); ColorTools.SetConsoleColorDry(colorStorage, true); - TextWriterColor.WritePlain(" ", false); + TextWriterRaw.WritePlain(" ", false); DebugWriter.WriteDebugConditional(ScreensaverManager.ScreensaverDebug, DebugLevel.I, "We're now dissolving... L: {0} = {1} | T: {2} = {3}", ConsoleWrapper.CursorLeft, EndLeft, ConsoleWrapper.CursorTop, EndTop); ColorFilled = true; } @@ -292,7 +292,7 @@ public override void ScreensaverLogic() { ColorTools.SetConsoleColorDry(Color.Empty); ColorTools.SetConsoleColorDry(colorStorage, true); - TextWriterColor.WritePlain(" ", false); + TextWriterRaw.WritePlain(" ", false); } } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/FallingLine.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/FallingLine.cs index 6b399b45d1..0f083ab91c 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/FallingLine.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/FallingLine.cs @@ -26,7 +26,7 @@ using Nitrocid.Kernel.Threading; using Nitrocid.Misc.Screensaver; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; namespace Nitrocid.ScreensaverPacks.Screensavers diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/FillFade.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/FillFade.cs index 9b10651adb..1b8c333c87 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/FillFade.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/FillFade.cs @@ -251,14 +251,14 @@ public override void ScreensaverLogic() if (ConsoleWrapper.CursorLeft >= EndLeft && ConsoleWrapper.CursorTop >= EndTop) { ColorTools.SetConsoleColorDry(currentColor, true); - TextWriterColor.WritePlain(" ", false); + TextWriterRaw.WritePlain(" ", false); DebugWriter.WriteDebugConditional(ScreensaverManager.ScreensaverDebug, DebugLevel.I, "We're now dissolving... L: {0} = {1} | T: {2} = {3}", ConsoleWrapper.CursorLeft, EndLeft, ConsoleWrapper.CursorTop, EndTop); ColorFilled = true; } else { ColorTools.SetConsoleColorDry(currentColor, true); - TextWriterColor.WritePlain(" ", false); + TextWriterRaw.WritePlain(" ", false); } } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Gradient.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Gradient.cs index 54c754132c..ec9a85025b 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Gradient.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Gradient.cs @@ -25,7 +25,7 @@ using Nitrocid.Kernel.Threading; using Nitrocid.Misc.Screensaver; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; namespace Nitrocid.ScreensaverPacks.Screensavers @@ -328,7 +328,7 @@ public override void ScreensaverLogic() RotCurrentColorBlue -= RotColorBlueSteps; DebugWriter.WriteDebugConditional(ScreensaverManager.ScreensaverDebug, DebugLevel.I, "Got new current colors (R;G;B: {0};{1};{2}) subtracting from {3};{4};{5}", RotCurrentColorRed, RotCurrentColorGreen, RotCurrentColorBlue, RotColorRedSteps, RotColorGreenSteps, RotColorBlueSteps); } - TextWriterColor.WritePlain(gradientBuilder.ToString(), false); + TextWriterRaw.WritePlain(gradientBuilder.ToString(), false); // Reset resize sync ThreadManager.SleepNoBlock(GradientSettings.GradientNextRotDelay, ScreensaverDisplayer.ScreensaverDisplayerThread); diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/GradientBloom.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/GradientBloom.cs index fc8f55b348..3206c5ef9b 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/GradientBloom.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/GradientBloom.cs @@ -22,7 +22,7 @@ using Nitrocid.Misc.Screensaver; using System.Text; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; namespace Nitrocid.ScreensaverPacks.Screensavers diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/HueBackGradient.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/HueBackGradient.cs index 6bf53e4b6e..aa4e2e3dab 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/HueBackGradient.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/HueBackGradient.cs @@ -25,7 +25,7 @@ using System.Text; using Terminaux.Colors; using Terminaux.Colors.Models.Conversion; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; namespace Nitrocid.ScreensaverPacks.Screensavers @@ -147,7 +147,7 @@ public override void ScreensaverLogic() RampCurrentColorBlue -= RampColorBlueSteps; DebugWriter.WriteDebugConditional(ScreensaverManager.ScreensaverDebug, DebugLevel.I, "Got new current colors (R;G;B: {0};{1};{2}) subtracting from {3};{4};{5}", RampCurrentColorRed, RampCurrentColorGreen, RampCurrentColorBlue, RampColorRedSteps, RampColorGreenSteps, RampColorBlueSteps); } - TextWriterColor.WritePlain(gradientBuilder.ToString(), false); + TextWriterRaw.WritePlain(gradientBuilder.ToString(), false); // Set the hue angle ThreadManager.SleepNoBlock(HueBackGradientSettings.HueBackGradientDelay, ScreensaverDisplayer.ScreensaverDisplayerThread); diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/KSX.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/KSX.cs index 92a00b3755..0d1b790598 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/KSX.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/KSX.cs @@ -35,6 +35,7 @@ using Nitrocid.Drivers.RNG; using Nitrocid.Languages; using Terminaux.Base; +using Terminaux.Base.Extensions; namespace Nitrocid.ScreensaverPacks.Screensavers { @@ -198,7 +199,7 @@ public override void ScreensaverLogic() // Write the current character TextWriterColor.WriteColorBack(sample[currentIdx].ToString(), false, darkGreen, black); - TextWriterColor.Write(); + TextWriterRaw.Write(); } } } @@ -334,7 +335,7 @@ public override void ScreensaverLogic() long travelledTickFromCurrent = currentTick - travelledTicks; DateTime travelled = new(travelledTickFromCurrent); string timeWarpCurrentDate = $"Travelled: {TimeDateRenderers.RenderDate(travelled)}"; - TextWriterWhereColor.WriteWhereColorBack(timeWarpCurrentDate + $"{$"{ConsoleExtensions.GetClearLineToRightSequence()}"}", progPosX, textTravelledPosY, black, darkGreen); + TextWriterWhereColor.WriteWhereColorBack(timeWarpCurrentDate + ConsoleClearing.GetClearLineToRightSequence(), progPosX, textTravelledPosY, black, darkGreen); // Now, do the glitch bool isGlitch = RandomDriver.RandomChance(currentProg); diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/KSX3.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/KSX3.cs index 20fc7409a1..fdb072fb15 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/KSX3.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/KSX3.cs @@ -549,7 +549,7 @@ public override void ScreensaverLogic() // Write the current character TextWriterColor.WriteColorBack(sample[currentIdx].ToString(), false, selectedColor, black); - TextWriterColor.Write(); + TextWriterRaw.Write(); } } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/LaserBeams.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/LaserBeams.cs index d422ea39d1..e14cdefd06 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/LaserBeams.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/LaserBeams.cs @@ -25,7 +25,7 @@ using Nitrocid.Kernel.Threading; using Nitrocid.Misc.Screensaver; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; using Terminaux.Colors.Data; @@ -334,7 +334,7 @@ public override void ScreensaverLogic() laserBeamsBuilder.Append($"{new Color(ConsoleColors.White).VTSequenceBackground}{CsiSequences.GenerateCsiCursorPosition(ConsoleWrapper.WindowWidth + 1, ConsoleWrapper.WindowHeight + 1)} "); // Write the result - TextWriterColor.WritePlain(laserBeamsBuilder.ToString(), false); + TextWriterRaw.WritePlain(laserBeamsBuilder.ToString(), false); // Reset resize sync laserEnds.Clear(); diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Lightning.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Lightning.cs index 467d65bce7..2b7ea36e4a 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Lightning.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Lightning.cs @@ -24,7 +24,7 @@ using System; using System.Text; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; using Terminaux.Colors.Data; @@ -120,7 +120,7 @@ public override void ScreensaverLogic() var strike = new StringBuilder(); // Draw the flashes first - strike.Append(new Color(ConsoleColors.Yellow3_d7d700).VTSequenceBackground); + strike.Append(new Color(ConsoleColors.Yellow3Alt).VTSequenceBackground); for (int y = 0; y < boltFirstHalfEndY; y++) { int x = (int)Math.Round(boltTopEdgeX + boltFromTopToFirstHalfX * y, MidpointRounding.ToZero); @@ -206,7 +206,7 @@ public override void ScreensaverLogic() } // Write the rendered strike - TextWriterColor.WritePlain(strike.ToString(), false); + TextWriterRaw.WritePlain(strike.ToString(), false); ThreadManager.SleepNoBlock(LightningSettings.LightningDelay, ScreensaverDisplayer.ScreensaverDisplayerThread); } else diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Marquee.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Marquee.cs index eefe5d1b7a..0bfdd699aa 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Marquee.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Marquee.cs @@ -23,6 +23,7 @@ using Nitrocid.Kernel.Threading; using Nitrocid.Misc.Screensaver; using Terminaux.Base; +using Terminaux.Base.Extensions; using Terminaux.Colors; using Textify.General; @@ -317,7 +318,7 @@ public override void ScreensaverLogic() } DebugWriter.WriteDebugConditional(ScreensaverManager.ScreensaverDebug, DebugLevel.I, "Written result: {0}", MarqueeWritten); if (!MarqueeSettings.MarqueeUseConsoleAPI) - MarqueeWritten += $"{ConsoleExtensions.GetClearLineToRightSequence()}"; + MarqueeWritten += $"{ConsoleClearing.GetClearLineToRightSequence()}"; // Set the appropriate cursor position and write the results ConsoleWrapper.SetCursorPosition(CurrentLeft, TopPrinted); diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Matrix.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Matrix.cs index 8876e7593a..798219bb10 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Matrix.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Matrix.cs @@ -25,7 +25,7 @@ using Nitrocid.Kernel.Debugging; using Nitrocid.Kernel.Threading; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; using Nitrocid.Misc.Screensaver; diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Noise.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Noise.cs index a12f2870ef..f824eaadfd 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Noise.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Noise.cs @@ -86,7 +86,7 @@ public override void ScreensaverLogic() double NoiseDense = (NoiseSettings.NoiseDensity > 100 ? 100 : NoiseSettings.NoiseDensity) / 100d; ConsoleWrapper.CursorVisible = false; - ColorTools.LoadBackDry(new Color(ConsoleColors.DarkGray)); + ColorTools.LoadBackDry(new Color(ConsoleColors.Grey)); ConsoleWrapper.Clear(); ColorTools.SetConsoleColorDry(ConsoleColors.Black, true); diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Particles.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Particles.cs index b7f0e8c8f9..473a16ac18 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Particles.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Particles.cs @@ -24,7 +24,7 @@ using Nitrocid.Misc.Screensaver; using System.Text; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; namespace Nitrocid.ScreensaverPacks.Screensavers @@ -276,7 +276,7 @@ public override void ScreensaverLogic() particlesBuffer.Append(CsiSequences.GenerateCsiCursorPosition(Left + 1, Top + 1)); particlesBuffer.Append(' '); } - TextWriterColor.WritePlain(particlesBuffer.ToString(), false); + TextWriterRaw.WritePlain(particlesBuffer.ToString(), false); // Reset resize sync ConsoleResizeHandler.WasResized(); diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ProgressClock.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ProgressClock.cs index 2b11f35b36..eae54082df 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ProgressClock.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ProgressClock.cs @@ -30,6 +30,7 @@ using Nitrocid.Kernel.Time.Renderers; using Nitrocid.Kernel.Threading; using Terminaux.Base; +using Terminaux.Base.Extensions; namespace Nitrocid.ScreensaverPacks.Screensavers { @@ -859,7 +860,7 @@ public override void ScreensaverLogic() DebugWriter.WriteDebugConditional(ScreensaverManager.ScreensaverDebug, DebugLevel.I, "Cycling colors..."); if (CurrentTicks >= ProgressClockSettings.ProgressClockCycleColorsTicks) { - var type = ProgressClockSettings.ProgressClockTrueColor ? ColorType.TrueColor : ColorType._255Color; + var type = ProgressClockSettings.ProgressClockTrueColor ? ColorType.TrueColor : ColorType.EightBitColor; DebugWriter.WriteDebugConditional(ScreensaverManager.ScreensaverDebug, DebugLevel.I, "Current tick equals the maximum ticks to change color."); ColorStorageHours = ColorTools.GetRandomColor(type, ProgressClockSettings.ProgressClockMinimumColorLevelHours, ProgressClockSettings.ProgressClockMaximumColorLevelHours, @@ -939,17 +940,17 @@ public override void ScreensaverLogic() if (TimeDateTools.KernelDateTime.Hour != 0) { TextWriters.WriteWhere(new string(' ', ConsoleWrapper.WindowWidth - 10), 5, ProgressFillPositionHours, true, KernelColorType.NeutralText, KernelColorType.Background); - TextWriterWhereColor.WriteWhereColorBack(new string(' ', ConsoleExtensions.PercentRepeat(TimeDateTools.KernelDateTime.Hour, 24, 10)), 5, ProgressFillPositionHours, true, Color.Empty, ColorStorageHours); + TextWriterWhereColor.WriteWhereColorBack(new string(' ', ConsoleMisc.PercentRepeat(TimeDateTools.KernelDateTime.Hour, 24, 10)), 5, ProgressFillPositionHours, true, Color.Empty, ColorStorageHours); } if (TimeDateTools.KernelDateTime.Minute != 0) { TextWriters.WriteWhere(new string(' ', ConsoleWrapper.WindowWidth - 10), 5, ProgressFillPositionMinutes, true, KernelColorType.NeutralText, KernelColorType.Background); - TextWriterWhereColor.WriteWhereColorBack(new string(' ', ConsoleExtensions.PercentRepeat(TimeDateTools.KernelDateTime.Minute, 60, 10)), 5, ProgressFillPositionMinutes, true, Color.Empty, ColorStorageMinutes); + TextWriterWhereColor.WriteWhereColorBack(new string(' ', ConsoleMisc.PercentRepeat(TimeDateTools.KernelDateTime.Minute, 60, 10)), 5, ProgressFillPositionMinutes, true, Color.Empty, ColorStorageMinutes); } if (TimeDateTools.KernelDateTime.Second != 0) { TextWriters.WriteWhere(new string(' ', ConsoleWrapper.WindowWidth - 10), 5, ProgressFillPositionSeconds, true, KernelColorType.NeutralText, KernelColorType.Background); - TextWriterWhereColor.WriteWhereColorBack(new string(' ', ConsoleExtensions.PercentRepeat(TimeDateTools.KernelDateTime.Second, 60, 10)), 5, ProgressFillPositionSeconds, true, Color.Empty, ColorStorageSeconds); + TextWriterWhereColor.WriteWhereColorBack(new string(' ', ConsoleMisc.PercentRepeat(TimeDateTools.KernelDateTime.Second, 60, 10)), 5, ProgressFillPositionSeconds, true, Color.Empty, ColorStorageSeconds); } // Print information diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Spray.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Spray.cs index 4481e62b5a..74e172213e 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Spray.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Spray.cs @@ -135,7 +135,7 @@ public override void ScreensaverLogic() Stars.Clear(); } else - TextWriterColor.WritePlain(starsBuffer.ToString(), false); + TextWriterRaw.WritePlain(starsBuffer.ToString(), false); // Reset resize sync ConsoleResizeHandler.WasResized(); diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Starfield.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Starfield.cs index 9e0b52b825..96ab6aa570 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Starfield.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/Starfield.cs @@ -125,7 +125,7 @@ public override void ScreensaverLogic() Stars.Clear(); } else - TextWriterColor.WritePlain(starsBuffer.ToString(), false); + TextWriterRaw.WritePlain(starsBuffer.ToString(), false); // Reset resize sync ConsoleResizeHandler.WasResized(); diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/StarfieldWarp.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/StarfieldWarp.cs index d2beb6bb7a..7cf03ef0bb 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/StarfieldWarp.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/StarfieldWarp.cs @@ -174,7 +174,7 @@ public override void ScreensaverLogic() Stars.Clear(); } else - TextWriterColor.WritePlain(starsBuffer.ToString(), false); + TextWriterRaw.WritePlain(starsBuffer.ToString(), false); // Reset resize sync ConsoleResizeHandler.WasResized(); diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/TwoSpins.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/TwoSpins.cs index 0c210f4b43..c649214f89 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/TwoSpins.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/TwoSpins.cs @@ -26,7 +26,7 @@ using System.Collections.Generic; using System.Text; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; using Terminaux.Colors.Data; @@ -428,7 +428,7 @@ public override void ScreensaverLogic() } // Write the spin buffer - TextWriterColor.WritePlain(spinBuffer.ToString(), false); + TextWriterRaw.WritePlain(spinBuffer.ToString(), false); // Reset resize sync ConsoleResizeHandler.WasResized(); @@ -454,7 +454,7 @@ public override void ScreensaverLogic() " " ); } - TextWriterColor.WritePlain(clearBuffer.ToString(), false); + TextWriterRaw.WritePlain(clearBuffer.ToString(), false); } } diff --git a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ZebraShift.cs b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ZebraShift.cs index d7c0809d6d..1d157b6d47 100644 --- a/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ZebraShift.cs +++ b/public/Nitrocid.Addons/Nitrocid.ScreensaverPacks/Screensavers/ZebraShift.cs @@ -24,7 +24,7 @@ using Nitrocid.Misc.Screensaver; using System.Text; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; using Terminaux.Colors.Data; @@ -296,7 +296,7 @@ public override void ScreensaverLogic() inverse = !inverse; // Write the shift buffer - TextWriterColor.WritePlain(zebraBuffer.ToString(), false); + TextWriterRaw.WritePlain(zebraBuffer.ToString(), false); // Reset resize sync ConsoleResizeHandler.WasResized(); diff --git a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/BeatEdgePulse.cs b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/BeatEdgePulse.cs index c850ac9a44..d8bcb0d275 100644 --- a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/BeatEdgePulse.cs +++ b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/BeatEdgePulse.cs @@ -27,7 +27,7 @@ using Terminaux.Base; using Terminaux.Colors; using Terminaux.Colors.Data; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; namespace Nitrocid.SplashPacks.Splashes { diff --git a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Dots.cs b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Dots.cs index 4b21ef3c21..48c8c13646 100644 --- a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Dots.cs +++ b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Dots.cs @@ -19,7 +19,7 @@ using System.Threading; using Terminaux.Colors; -using Textify.Sequences.Tools; +using Terminaux.Sequences; using System.Text; using Nitrocid.Kernel.Debugging; using Nitrocid.Misc.Splash; @@ -27,6 +27,7 @@ using Terminaux.Base; using Nitrocid.ConsoleBase.Colors; using Terminaux.Colors.Data; +using Terminaux.Colors.Transformation.Contrast; namespace Nitrocid.SplashPacks.Splashes { @@ -70,7 +71,7 @@ public override string Display(SplashContext context) $"{fifthDotColor.VTSequenceForeground}*"; int dotsPosX = ConsoleWrapper.WindowWidth / 2 - VtSequenceTools.FilterVTSequences(dots).Length / 2; int dotsPosY = ConsoleWrapper.WindowHeight - 2; - builder.Append(TextWriterWhereColor.RenderWherePlain(dots, dotsPosX, dotsPosY)); + builder.Append(TextWriterWhereColor.RenderWhere(dots, dotsPosX, dotsPosY)); if (!noAppend) { dotStep++; diff --git a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/EdgePulse.cs b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/EdgePulse.cs index c1f48d8400..4b9f5e3761 100644 --- a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/EdgePulse.cs +++ b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/EdgePulse.cs @@ -26,7 +26,7 @@ using Nitrocid.Misc.Splash; using Terminaux.Base; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; namespace Nitrocid.SplashPacks.Splashes { diff --git a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Fader.cs b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Fader.cs index 9fdcb076be..6c1bcac4ac 100644 --- a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Fader.cs +++ b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Fader.cs @@ -109,7 +109,7 @@ public override string Display(SplashContext context) var color = new Color($"{CurrentColorRedOut};{CurrentColorGreenOut};{CurrentColorBlueOut}"); builder.Append( color.VTSequenceForeground + - TextWriterWhereColor.RenderWherePlain(_faderWrite, _left, _top, true) + TextWriterWhereColor.RenderWhere(_faderWrite, _left, _top, true) ); _currentStep++; if (_currentStep > _faderMaxSteps) @@ -133,7 +133,7 @@ public override string Display(SplashContext context) var color = new Color($"{CurrentColorRedIn};{CurrentColorGreenIn};{CurrentColorBlueIn}"); builder.Append( color.VTSequenceForeground + - TextWriterWhereColor.RenderWherePlain(_faderWrite, _left, _top, true) + TextWriterWhereColor.RenderWhere(_faderWrite, _left, _top, true) ); _currentStep++; if (_currentStep > _faderMaxSteps) diff --git a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/FigProgress.cs b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/FigProgress.cs index a910689725..b8b23e8f70 100644 --- a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/FigProgress.cs +++ b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/FigProgress.cs @@ -19,7 +19,7 @@ using System.Threading; using Terminaux.Colors; -using Textify.Sequences.Tools; +using Terminaux.Sequences; using Figletize; using System; using System.Text; @@ -33,6 +33,8 @@ using Terminaux.Base; using Terminaux.Colors.Data; using Nitrocid.Kernel.Configuration; +using Terminaux.Colors.Transformation.Contrast; +using Terminaux.Base.Extensions; namespace Nitrocid.SplashPacks.Splashes { @@ -68,7 +70,7 @@ public override string Opening(SplashContext context) consoleY = ConsoleWrapper.WindowHeight / 2; builder.Append( col.VTSequenceForeground + - TextWriterWhereColor.RenderWherePlain(text, consoleX, consoleY, true) + TextWriterWhereColor.RenderWhere(text, consoleX, consoleY, true) ); } else @@ -117,7 +119,7 @@ public override string Display(SplashContext context) $"{fifthDotColor.VTSequenceForeground}*"; int dotsPosX = (ConsoleWrapper.WindowWidth / 2) - (VtSequenceTools.FilterVTSequences(dots).Length / 2); int dotsPosY = ConsoleWrapper.WindowHeight - 2; - builder.Append(TextWriterWhereColor.RenderWherePlain(dots, dotsPosX, dotsPosY)); + builder.Append(TextWriterWhereColor.RenderWhere(dots, dotsPosX, dotsPosY)); dotStep++; if (dotStep > 5) dotStep = 0; @@ -172,7 +174,7 @@ public override string Closing(SplashContext context, out bool delayRequired) consoleY = height / 2; builder.Append( col.VTSequenceForeground + - TextWriterWhereColor.RenderWherePlain(text, consoleX, consoleY, true) + TextWriterWhereColor.RenderWhere(text, consoleX, consoleY, true) ); } else @@ -223,10 +225,10 @@ private string ReportProgress(int Progress, string ProgressReport, KernelColorTy col.VTSequenceForeground ); for (int i = consoleY; i <= consoleY + figHeight; i++) - builder.Append(TextWriterWhereColor.RenderWherePlain(ConsoleExtensions.GetClearLineToRightSequence(), 0, i, true)); + builder.Append(TextWriterWhereColor.RenderWhere(ConsoleClearing.GetClearLineToRightSequence(), 0, i, true)); builder.Append( CenteredFigletTextColor.RenderCenteredFiglet(consoleY, figFont, text, Vars) + - TextWriterWhereColor.RenderWherePlain(ConsoleExtensions.GetClearLineToRightSequence(), 0, consoleY - 2, true) + + TextWriterWhereColor.RenderWhere(ConsoleClearing.GetClearLineToRightSequence(), 0, consoleY - 2, true) + CenteredTextColor.RenderCenteredOneLine(consoleY - 2, ProgressReport, Vars) ); return builder.ToString(); diff --git a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/PowerLineProgress.cs b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/PowerLineProgress.cs index 0210b6d0ba..16a0b240d0 100644 --- a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/PowerLineProgress.cs +++ b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/PowerLineProgress.cs @@ -29,6 +29,7 @@ using Terminaux.Writer.FancyWriters; using Textify.General; using Terminaux.Base; +using Terminaux.Base.Extensions; namespace Nitrocid.SplashPacks.Splashes { @@ -121,8 +122,8 @@ public string UpdateProgressReport(int Progress, bool ProgressErrored, bool Prog // Display the text and percentage builder.Append( KernelColorTools.GetColor(KernelColorType.Progress).VTSequenceForeground + - TextWriterWhereColor.RenderWherePlain(PresetStringBuilder.ToString(), 0, ProgressWritePositionY, false, KernelColorType.Progress, Vars) + - ConsoleExtensions.GetClearLineToRightSequence() + TextWriterWhereColor.RenderWhere(PresetStringBuilder.ToString(), 0, ProgressWritePositionY, false, KernelColorType.Progress, Vars) + + ConsoleClearing.GetClearLineToRightSequence() ); // Display the progress bar diff --git a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Progress.cs b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Progress.cs index 6b21c8a195..59fafe024b 100644 --- a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Progress.cs +++ b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Progress.cs @@ -29,6 +29,7 @@ using Terminaux.Writer.FancyWriters; using Textify.General; using Terminaux.Base; +using Terminaux.Base.Extensions; namespace Nitrocid.SplashPacks.Splashes { @@ -108,10 +109,10 @@ public string UpdateProgressReport(int Progress, bool ProgressErrored, bool Prog string RenderedText = ProgressReport.Truncate(ConsoleWrapper.WindowWidth - ProgressReportWritePositionX - ProgressWritePositionX - 3); PresetStringBuilder.Append( KernelColorTools.GetColor(KernelColorType.Progress).VTSequenceForeground + - TextWriterWhereColor.RenderWherePlain("{0:000}%", ProgressWritePositionX, ProgressWritePositionY, true, vars: Progress) + + TextWriterWhereColor.RenderWhere("{0:000}%", ProgressWritePositionX, ProgressWritePositionY, true, vars: Progress) + finalColor.VTSequenceForeground + - TextWriterWhereColor.RenderWherePlain($"{indicator}{RenderedText}", ProgressReportWritePositionX, ProgressReportWritePositionY, false, Vars) + - ConsoleExtensions.GetClearLineToRightSequence() + TextWriterWhereColor.RenderWhere($"{indicator}{RenderedText}", ProgressReportWritePositionX, ProgressReportWritePositionY, false, Vars) + + ConsoleClearing.GetClearLineToRightSequence() ); // Display the progress bar diff --git a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Simple.cs b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Simple.cs index a56da818f3..369c4d214e 100644 --- a/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Simple.cs +++ b/public/Nitrocid.Addons/Nitrocid.SplashPacks/Splashes/Simple.cs @@ -27,6 +27,7 @@ using Nitrocid.Misc.Text; using Textify.General; using Terminaux.Base; +using Terminaux.Base.Extensions; namespace Nitrocid.SplashPacks.Splashes { @@ -104,10 +105,10 @@ public string UpdateProgressReport(int Progress, bool ProgressErrored, bool Prog string RenderedText = ProgressReport.Truncate(ConsoleWrapper.WindowWidth - ProgressReportWritePositionX - ProgressWritePositionX - 3); rendered.Append( KernelColorTools.GetColor(KernelColorType.Progress).VTSequenceForeground + - TextWriterWhereColor.RenderWherePlain("{0:000}%", ProgressWritePositionX, ProgressWritePositionY, true, vars: Progress) + + TextWriterWhereColor.RenderWhere("{0:000}%", ProgressWritePositionX, ProgressWritePositionY, true, vars: Progress) + finalColor.VTSequenceForeground + - TextWriterWhereColor.RenderWherePlain($"{indicator}{RenderedText}", ProgressReportWritePositionX, ProgressReportWritePositionY, false, Vars) + - ConsoleExtensions.GetClearLineToRightSequence() + TextWriterWhereColor.RenderWhere($"{indicator}{RenderedText}", ProgressReportWritePositionX, ProgressReportWritePositionY, false, Vars) + + ConsoleClearing.GetClearLineToRightSequence() ); return rendered.ToString(); } diff --git a/public/Nitrocid.Analyzers/Nitrocid.StandaloneAnalyzer/Nitrocid.StandaloneAnalyzer.csproj b/public/Nitrocid.Analyzers/Nitrocid.StandaloneAnalyzer/Nitrocid.StandaloneAnalyzer.csproj index a68baf5a4b..0a9d6f1c07 100644 --- a/public/Nitrocid.Analyzers/Nitrocid.StandaloneAnalyzer/Nitrocid.StandaloneAnalyzer.csproj +++ b/public/Nitrocid.Analyzers/Nitrocid.StandaloneAnalyzer/Nitrocid.StandaloneAnalyzer.csproj @@ -45,7 +45,7 @@ - + diff --git a/public/Nitrocid.LocaleGen/Nitrocid.LocaleGen.csproj b/public/Nitrocid.LocaleGen/Nitrocid.LocaleGen.csproj index 57640aa383..d46aa2cabb 100644 --- a/public/Nitrocid.LocaleGen/Nitrocid.LocaleGen.csproj +++ b/public/Nitrocid.LocaleGen/Nitrocid.LocaleGen.csproj @@ -160,7 +160,7 @@ - + diff --git a/public/Nitrocid/Arguments/Help/ArgumentHelpPrintTools.cs b/public/Nitrocid/Arguments/Help/ArgumentHelpPrintTools.cs index 0cf7dc5e2b..43e82c6ecf 100644 --- a/public/Nitrocid/Arguments/Help/ArgumentHelpPrintTools.cs +++ b/public/Nitrocid/Arguments/Help/ArgumentHelpPrintTools.cs @@ -114,7 +114,7 @@ internal static void ShowHelpUsage(string argument) DebugWriter.WriteDebug(DebugLevel.I, "Rendered argument: {0}", renderedArgument); TextWriters.Write(renderedArgument, false, KernelColorType.ListEntry); } - TextWriterColor.Write(); + TextWriterRaw.Write(); } else TextWriters.Write(Translate.DoTranslation("Usage:") + $" {argument}", true, KernelColorType.ListEntry); diff --git a/public/Nitrocid/ConsoleBase/ConsoleTools.cs b/public/Nitrocid/ConsoleBase/ConsoleTools.cs index 9fb0dfef1a..e51303a3c0 100644 --- a/public/Nitrocid/ConsoleBase/ConsoleTools.cs +++ b/public/Nitrocid/ConsoleBase/ConsoleTools.cs @@ -29,10 +29,11 @@ using System; using Textify.General; using Terminaux.Base.Buffered; -using Textify.Sequences.Builder; +using Terminaux.Sequences.Builder; using Nitrocid.Languages; using Terminaux.Inputs; using Terminaux.Writer.FancyWriters; +using Terminaux.Reader; namespace Nitrocid.ConsoleBase { @@ -94,7 +95,7 @@ public static void ResetBackground(bool useKernelColors = false) if (useKernelColors) KernelColorTools.SetConsoleColor(KernelColorType.Background, Background: true); else - ConsoleExtensions.ResetBackground(); + ColorTools.ResetBackground(); } /// @@ -106,7 +107,7 @@ public static void ResetForeground(bool useKernelColors = false) if (useKernelColors) KernelColorTools.SetConsoleColor(KernelColorType.NeutralText); else - ConsoleExtensions.ResetForeground(); + ColorTools.ResetForeground(); } internal static void PreviewMainBuffer() @@ -215,7 +216,7 @@ internal static void ShowColorRampAndSet() band.Append($"{new Color($"hsl:{Convert.ToInt32(h * hueThreshold)};100;50").VTSequenceBackground} "); band.AppendLine(); band.Append(CharManager.GetEsc() + $"[49m"); - return TextWriterWhereColor.RenderWherePlain(TextTools.FormatString(band.ToString(), KernelPlatform.GetTerminalType(), KernelPlatform.GetTerminalEmulator()), 3, 3); + return TextWriterWhereColor.RenderWhere(TextTools.FormatString(band.ToString(), KernelPlatform.GetTerminalType(), KernelPlatform.GetTerminalEmulator()), 3, 3); }); // Tell the user to select either Y or N @@ -229,7 +230,7 @@ internal static void ShowColorRampAndSet() ConsoleKey answer = ConsoleKey.None; ScreenTools.Render(); while (answer != ConsoleKey.N && answer != ConsoleKey.Y) - answer = Input.DetectKeypress().Key; + answer = TermReader.ReadKey().Key; // Set the appropriate config bool supports256Color = answer == ConsoleKey.Y; diff --git a/public/Nitrocid/ConsoleBase/Themes/ThemePreviewTools.cs b/public/Nitrocid/ConsoleBase/Themes/ThemePreviewTools.cs index 936d3380a7..1787ff346b 100644 --- a/public/Nitrocid/ConsoleBase/Themes/ThemePreviewTools.cs +++ b/public/Nitrocid/ConsoleBase/Themes/ThemePreviewTools.cs @@ -29,6 +29,8 @@ using Terminaux.Base; using Terminaux.Inputs; using Terminaux.Inputs.Styles.Selection; +using Terminaux.Base.Extensions; +using Terminaux.Reader; namespace Nitrocid.ConsoleBase.Themes { @@ -81,7 +83,7 @@ internal static void PreviewThemeSimple(Dictionary color // Give a prompt for theme preview while (true) { - int prev = SelectionStyle.PromptSelection(Translate.DoTranslation("Here's how your theme will look like:"), choices, altChoices, true); + int prev = SelectionStyle.PromptSelection(Translate.DoTranslation("Here's how your theme will look like:"), [.. choices], [.. altChoices], true); if (prev == choices.Count + 1) break; } @@ -139,7 +141,7 @@ internal static void PreviewTheme(Dictionary colors, The // Render the type name and some info int typeY = ConsoleWrapper.WindowHeight - 6; - TextWriterWhereColor.WriteWhere(ConsoleExtensions.GetClearLineToRightSequence(), 0, typeY); + TextWriterWhereColor.WriteWhere(ConsoleClearing.GetClearLineToRightSequence(), 0, typeY); CenteredTextColor.WriteCentered(typeY, $"{colorType} - {colorInstance.PlainSequence} [{colorInstance.PlainSequenceTrueColor}]"); // Render the color box @@ -153,7 +155,7 @@ internal static void PreviewTheme(Dictionary colors, The BoxColor.WriteBox(startExteriorX + 1, startExteriorY, diffInteriorX, diffInteriorY, colorInstance); // Wait for input - var input = Input.DetectKeypress(); + var input = TermReader.ReadKey(); switch (input.Key) { case ConsoleKey.Enter: diff --git a/public/Nitrocid/ConsoleBase/Themes/ThemeTools.cs b/public/Nitrocid/ConsoleBase/Themes/ThemeTools.cs index 4b20a9cc79..71d98e6907 100644 --- a/public/Nitrocid/ConsoleBase/Themes/ThemeTools.cs +++ b/public/Nitrocid/ConsoleBase/Themes/ThemeTools.cs @@ -279,7 +279,7 @@ public static bool Is255ColorsRequired(Dictionary colors // Now, check for 255-color requirement for (int key = 0; key < colors.Count; key++) - if (colors.Values.ElementAt(key).Type == ColorType._255Color) + if (colors.Values.ElementAt(key).Type == ColorType.EightBitColor) return true; // Else, 255 color support is not required diff --git a/public/Nitrocid/ConsoleBase/Writers/TextDynamicWriters.cs b/public/Nitrocid/ConsoleBase/Writers/TextDynamicWriters.cs index dc004d7491..2649c617df 100644 --- a/public/Nitrocid/ConsoleBase/Writers/TextDynamicWriters.cs +++ b/public/Nitrocid/ConsoleBase/Writers/TextDynamicWriters.cs @@ -24,6 +24,7 @@ using System; using System.Threading; using Terminaux.Writer.ConsoleWriters; +using Terminaux.Writer.DynamicWriters; namespace Nitrocid.ConsoleBase.Writers { diff --git a/public/Nitrocid/ConsoleBase/Writers/TextFancyWriters.cs b/public/Nitrocid/ConsoleBase/Writers/TextFancyWriters.cs index 55568b3b79..84135045bb 100644 --- a/public/Nitrocid/ConsoleBase/Writers/TextFancyWriters.cs +++ b/public/Nitrocid/ConsoleBase/Writers/TextFancyWriters.cs @@ -569,7 +569,7 @@ public static void WriteFiglet(string Text, FigletizeFont FigletFont, KernelColo { try { - TextWriterColor.WritePlain(FigletColor.RenderFigletPlain(Text, FigletFont, KernelColorTools.GetColor(ColTypes), KernelColorTools.GetColor(KernelColorType.Background), Vars), false); + TextWriterRaw.WritePlain(FigletColor.RenderFigletPlain(Text, FigletFont, KernelColorTools.GetColor(ColTypes), KernelColorTools.GetColor(KernelColorType.Background), Vars), false); } catch (Exception ex) when (ex.GetType().Name != nameof(ThreadInterruptedException)) { @@ -590,7 +590,7 @@ public static void WriteFiglet(string Text, FigletizeFont FigletFont, KernelColo { try { - TextWriterColor.WritePlain(FigletColor.RenderFigletPlain(Text, FigletFont, KernelColorTools.GetColor(colorTypeForeground), KernelColorTools.GetColor(colorTypeBackground), Vars), false); + TextWriterRaw.WritePlain(FigletColor.RenderFigletPlain(Text, FigletFont, KernelColorTools.GetColor(colorTypeForeground), KernelColorTools.GetColor(colorTypeBackground), Vars), false); } catch (Exception ex) when (ex.GetType().Name != nameof(ThreadInterruptedException)) { @@ -791,7 +791,7 @@ public static void WriteProgress(double Progress, int Left, int Top, int LeftWid { try { - TextWriterColor.WritePlain(ProgressBarColor.RenderProgress(Progress, Left, Top, LeftWidthOffset, RightWidthOffset, KernelColorTools.GetColor(ProgressColor), KernelColorTools.GetColor(FrameColor), KernelColorTools.GetColor(BackgroundColor), DrawBorder, Targeted)); + TextWriterRaw.WritePlain(ProgressBarColor.RenderProgress(Progress, Left, Top, LeftWidthOffset, RightWidthOffset, KernelColorTools.GetColor(ProgressColor), KernelColorTools.GetColor(FrameColor), KernelColorTools.GetColor(BackgroundColor), DrawBorder, Targeted)); } catch (Exception ex) when (ex.GetType().Name != nameof(ThreadInterruptedException)) { @@ -876,7 +876,7 @@ public static void WriteVerticalProgress(double Progress, int Left, int Top, int { try { - TextWriterColor.WritePlain(ProgressBarVerticalColor.RenderVerticalProgress(Progress, Left, Top, TopHeightOffset, BottomHeightOffset, KernelColorTools.GetColor(ProgressColor), KernelColorTools.GetColor(FrameColor), DrawBorder)); + TextWriterRaw.WritePlain(ProgressBarVerticalColor.RenderVerticalProgress(Progress, Left, Top, TopHeightOffset, BottomHeightOffset, KernelColorTools.GetColor(ProgressColor), KernelColorTools.GetColor(FrameColor), DrawBorder)); } catch (Exception ex) when (ex.GetType().Name != nameof(ThreadInterruptedException)) { diff --git a/public/Nitrocid/ConsoleBase/Writers/TextWriters.cs b/public/Nitrocid/ConsoleBase/Writers/TextWriters.cs index 58369e5660..92639424e7 100644 --- a/public/Nitrocid/ConsoleBase/Writers/TextWriters.cs +++ b/public/Nitrocid/ConsoleBase/Writers/TextWriters.cs @@ -123,14 +123,14 @@ public static void Write(string Text, bool Line, bool Highlight, KernelColorType // Write the text to console if (Highlight) { - TextWriterColor.WritePlain(Text, false, vars); + TextWriterRaw.WritePlain(Text, false, vars); KernelColorTools.SetConsoleColorDry(colorType); KernelColorTools.SetConsoleColorDry(KernelColorType.Background, true); - TextWriterColor.WritePlain("", Line); + TextWriterRaw.WritePlain("", Line); } else { - TextWriterColor.WritePlain(Text, Line, vars); + TextWriterRaw.WritePlain(Text, Line, vars); } } catch (Exception ex) when (ex.GetType().Name != nameof(ThreadInterruptedException)) @@ -184,14 +184,14 @@ public static void Write(string Text, bool Line, bool Highlight, KernelColorType // Write the text to console if (Highlight) { - TextWriterColor.WritePlain(Text, false, vars); + TextWriterRaw.WritePlain(Text, false, vars); KernelColorTools.SetConsoleColorDry(colorTypeForeground); KernelColorTools.SetConsoleColorDry(colorTypeBackground, true); - TextWriterColor.WritePlain("", Line); + TextWriterRaw.WritePlain("", Line); } else { - TextWriterColor.WritePlain(Text, Line, vars); + TextWriterRaw.WritePlain(Text, Line, vars); } } catch (Exception ex) when (ex.GetType().Name != nameof(ThreadInterruptedException)) diff --git a/public/Nitrocid/Drivers/Console/BaseConsoleDriver.cs b/public/Nitrocid/Drivers/Console/BaseConsoleDriver.cs index f05b379a88..a64d61dd08 100644 --- a/public/Nitrocid/Drivers/Console/BaseConsoleDriver.cs +++ b/public/Nitrocid/Drivers/Console/BaseConsoleDriver.cs @@ -22,13 +22,14 @@ using System.Threading; using SystemConsole = System.Console; using TextEncoding = System.Text.Encoding; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Nitrocid.Kernel; using Nitrocid.Kernel.Debugging; using Nitrocid.Languages; using Terminaux.Writer.ConsoleWriters; using Terminaux.Colors; using System.Runtime.Serialization; +using Terminaux.Writer.DynamicWriters; namespace Nitrocid.Drivers.Console { @@ -408,7 +409,7 @@ public virtual void WritePlain(string Text, bool Line, params object[] vars) /// public virtual void WritePlain() => - TextWriterColor.Write(); + TextWriterRaw.Write(); /// public virtual void WriteSlowlyPlain(string msg, bool Line, double MsEachLetter, params object[] vars) => @@ -428,15 +429,15 @@ public virtual void WriteWherePlain(string msg, int Left, int Top, bool Return, /// public virtual string RenderWherePlain(string msg, int Left, int Top, params object[] vars) => - TextWriterWhereColor.RenderWherePlain(msg, Left, Top, false, 0, vars); + TextWriterWhereColor.RenderWhere(msg, Left, Top, false, 0, vars); /// public virtual string RenderWherePlain(string msg, int Left, int Top, bool Return, params object[] vars) => - TextWriterWhereColor.RenderWherePlain(msg, Left, Top, Return, 0, vars); + TextWriterWhereColor.RenderWhere(msg, Left, Top, Return, 0, vars); /// public virtual string RenderWherePlain(string msg, int Left, int Top, bool Return, int RightMargin, params object[] vars) => - TextWriterWhereColor.RenderWherePlain(msg, Left, Top, Return, RightMargin, vars); + TextWriterWhereColor.RenderWhere(msg, Left, Top, Return, RightMargin, vars); /// public virtual void WriteWhereSlowlyPlain(string msg, bool Line, int Left, int Top, double MsEachLetter, params object[] vars) => diff --git a/public/Nitrocid/Drivers/Console/Bases/File.cs b/public/Nitrocid/Drivers/Console/Bases/File.cs index caa4150879..de8e2a5213 100644 --- a/public/Nitrocid/Drivers/Console/Bases/File.cs +++ b/public/Nitrocid/Drivers/Console/Bases/File.cs @@ -21,7 +21,7 @@ using System.IO; using System.Linq; using System.Threading; -using Textify.Sequences.Tools; +using Terminaux.Sequences; using TextEncoding = System.Text.Encoding; using Nitrocid.Kernel.Debugging; using Nitrocid.Files.Operations; diff --git a/public/Nitrocid/Drivers/Console/Bases/FileSequence.cs b/public/Nitrocid/Drivers/Console/Bases/FileSequence.cs index 2b94ece9e8..e49af3a109 100644 --- a/public/Nitrocid/Drivers/Console/Bases/FileSequence.cs +++ b/public/Nitrocid/Drivers/Console/Bases/FileSequence.cs @@ -21,7 +21,7 @@ using System.IO; using System.Linq; using System.Threading; -using Textify.Sequences.Tools; +using Terminaux.Sequences; using TextEncoding = System.Text.Encoding; using Nitrocid.Kernel.Debugging; using Nitrocid.Files.Operations; diff --git a/public/Nitrocid/Drivers/Console/Bases/TerminalDebug.cs b/public/Nitrocid/Drivers/Console/Bases/TerminalDebug.cs index 4427e24e17..1cb4fad7e2 100644 --- a/public/Nitrocid/Drivers/Console/Bases/TerminalDebug.cs +++ b/public/Nitrocid/Drivers/Console/Bases/TerminalDebug.cs @@ -18,7 +18,7 @@ // using Nitrocid.Kernel.Debugging; -using Textify.Sequences.Tools; +using Terminaux.Sequences; namespace Nitrocid.Drivers.Console.Bases { diff --git a/public/Nitrocid/Drivers/Console/Bases/TerminalMonoCompat.cs b/public/Nitrocid/Drivers/Console/Bases/TerminalMonoCompat.cs index cfe267e328..2e172856be 100644 --- a/public/Nitrocid/Drivers/Console/Bases/TerminalMonoCompat.cs +++ b/public/Nitrocid/Drivers/Console/Bases/TerminalMonoCompat.cs @@ -22,6 +22,7 @@ using System; using System.Threading; using Terminaux.Base; +using Terminaux.Base.Extensions; namespace Nitrocid.Drivers.Console.Bases { @@ -41,7 +42,7 @@ public override void WritePlain(string Text, bool Line, params object[] vars) { // Get the filtered positions first. int FilteredLeft = default, FilteredTop = default; - var pos = ConsoleExtensions.GetFilteredPositions(Text, Line, vars); + var pos = ConsolePositioning.GetFilteredPositions(Text, Line, vars); FilteredLeft = pos.Item1; FilteredTop = pos.Item2; diff --git a/public/Nitrocid/Drivers/Filesystem/BaseFilesystemDriver.cs b/public/Nitrocid/Drivers/Filesystem/BaseFilesystemDriver.cs index 677b692293..5b34eace66 100644 --- a/public/Nitrocid/Drivers/Filesystem/BaseFilesystemDriver.cs +++ b/public/Nitrocid/Drivers/Filesystem/BaseFilesystemDriver.cs @@ -491,7 +491,7 @@ public virtual void DisplayInHex(byte ByteContent, bool HighlightResults, long S ByteNumberEachSixteen = 1; } } - TextWriterColor.Write(); + TextWriterRaw.Write(); } else if (StartByte > FileByte.LongLength) { @@ -1397,7 +1397,7 @@ public virtual void PrintDirectoryInfo(FileSystemEntry DirectoryInfo, bool ShowD TextWriters.Write(": ", false, KernelColorType.ListEntry); TextWriters.Write(Translate.DoTranslation("{0}, Created in {1} {2}, Modified in {3} {4}"), false, KernelColorType.ListValue, TotalSize.SizeString(), finalDirInfo.CreationTime.ToShortDateString(), finalDirInfo.CreationTime.ToShortTimeString(), finalDirInfo.LastWriteTime.ToShortDateString(), finalDirInfo.LastWriteTime.ToShortTimeString()); } - TextWriterColor.Write(); + TextWriterRaw.Write(); } } else @@ -1435,7 +1435,7 @@ public virtual void PrintFileInfo(FileSystemEntry FileInfo, bool ShowFileDetails { TextWriters.Write(Translate.DoTranslation("{0}, Created in {1} {2}, Modified in {3} {4}"), false, KernelColorType.ListValue, ((FileInfo)FileInfo.BaseEntry).Length.SizeString(), FileInfo.BaseEntry.CreationTime.ToShortDateString(), FileInfo.BaseEntry.CreationTime.ToShortTimeString(), FileInfo.BaseEntry.LastWriteTime.ToShortDateString(), FileInfo.BaseEntry.LastWriteTime.ToShortTimeString()); } - TextWriterColor.Write(); + TextWriterRaw.Write(); } } else diff --git a/public/Nitrocid/Drivers/Network/BaseNetworkDriver.cs b/public/Nitrocid/Drivers/Network/BaseNetworkDriver.cs index 975f1c7ac9..bf1516dc0d 100644 --- a/public/Nitrocid/Drivers/Network/BaseNetworkDriver.cs +++ b/public/Nitrocid/Drivers/Network/BaseNetworkDriver.cs @@ -153,7 +153,7 @@ public virtual bool DownloadFile(string URL, bool ShowProgress, string FileName) // We're done downloading. Check to see if it's actually an error NetworkTools.TransferFinished = false; if (ShowProgress & !NetworkTransfer.SuppressDownloadMessage) - TextWriterColor.Write(); + TextWriterRaw.Write(); NetworkTransfer.SuppressDownloadMessage = false; if (NetworkTransfer.IsError) { @@ -252,7 +252,7 @@ public virtual string DownloadString(string URL, bool ShowProgress) // We're done downloading. Check to see if it's actually an error NetworkTools.TransferFinished = false; if (ShowProgress & !NetworkTransfer.SuppressDownloadMessage) - TextWriterColor.Write(); + TextWriterRaw.Write(); NetworkTransfer.SuppressDownloadMessage = false; if (NetworkTransfer.IsError) { @@ -325,7 +325,7 @@ public virtual bool UploadFile(string FileName, string URL, bool ShowProgress) // We're done uploading. Check to see if it's actually an error NetworkTools.TransferFinished = false; if (ShowProgress & !NetworkTransfer.SuppressUploadMessage) - TextWriterColor.Write(); + TextWriterRaw.Write(); NetworkTransfer.SuppressUploadMessage = false; if (NetworkTransfer.IsError) { @@ -392,7 +392,7 @@ public virtual bool UploadString(string URL, string Data, bool ShowProgress) // We're done uploading. Check to see if it's actually an error NetworkTools.TransferFinished = false; if (ShowProgress & !NetworkTransfer.SuppressUploadMessage) - TextWriterColor.Write(); + TextWriterRaw.Write(); NetworkTransfer.SuppressUploadMessage = false; if (NetworkTransfer.IsError) { diff --git a/public/Nitrocid/Files/Editors/HexEdit/HexEditInteractive.cs b/public/Nitrocid/Files/Editors/HexEdit/HexEditInteractive.cs index 324e30f233..d995d8474f 100644 --- a/public/Nitrocid/Files/Editors/HexEdit/HexEditInteractive.cs +++ b/public/Nitrocid/Files/Editors/HexEdit/HexEditInteractive.cs @@ -21,8 +21,8 @@ using System.Globalization; using System.Linq; using System.Text; -using Textify.Sequences.Builder.Types; -using Textify.Sequences.Tools; +using Terminaux.Sequences.Builder.Types; +using Terminaux.Sequences; using Nitrocid.Kernel.Debugging; using Nitrocid.Shell.Shells.Hex; using Nitrocid.Files.Operations; @@ -40,6 +40,8 @@ using Terminaux.Colors; using Terminaux.Base; using Terminaux.Inputs; +using Terminaux.Reader; +using Terminaux.Base.Extensions; namespace Nitrocid.Files.Editors.HexEdit { @@ -112,7 +114,7 @@ internal static void OpenInteractive(string file, ref byte[] bytes) // Wait for a keypress ScreenTools.Render(screen); - var keypress = Input.DetectKeypress(); + var keypress = TermReader.ReadKey(); HandleKeypress(keypress, ref bytes); // Reset, in case selection changed @@ -155,7 +157,7 @@ private static void RenderKeybindings(ref Screen screen) $"{InteractiveTuiStatus.OptionForegroundColor.VTSequenceForeground}" + $"{InteractiveTuiStatus.BackgroundColor.VTSequenceBackground}" + $" {(binding._localizable ? Translate.DoTranslation(binding.Name) : binding.Name)} " + - ConsoleExtensions.GetClearLineToRightSequence() + ConsoleClearing.GetClearLineToRightSequence() ); } else @@ -167,7 +169,7 @@ private static void RenderKeybindings(ref Screen screen) $"{InteractiveTuiStatus.KeyBindingOptionColor.VTSequenceForeground}" + $"{InteractiveTuiStatus.OptionBackgroundColor.VTSequenceBackground}" + " K " + - ConsoleExtensions.GetClearLineToRightSequence() + ConsoleClearing.GetClearLineToRightSequence() ); break; } @@ -187,7 +189,7 @@ private static void RenderStatus(ref Screen screen) builder.Append( $"{InteractiveTuiStatus.ForegroundColor.VTSequenceForeground}" + $"{InteractiveTuiStatus.BackgroundColor.VTSequenceBackground}" + - $"{TextWriterWhereColor.RenderWherePlain(status + ConsoleExtensions.GetClearLineToRightSequence(), 0, 0)}" + $"{TextWriterWhereColor.RenderWhere(status + ConsoleClearing.GetClearLineToRightSequence(), 0, 0)}" ); return builder.ToString(); }); @@ -245,7 +247,7 @@ private static void RenderContentsInHexWithSelection(int byteIdx, ref Screen scr builder.Append( $"{InteractiveTuiStatus.ForegroundColor.VTSequenceForeground}" + $"{InteractiveTuiStatus.BackgroundColor.VTSequenceBackground}" + - $"{TextWriterWhereColor.RenderWherePlain(rendered, 1, 2)}" + $"{TextWriterWhereColor.RenderWhere(rendered, 1, 2)}" ); return builder.ToString(); }); diff --git a/public/Nitrocid/Files/Editors/TextEdit/TextEditInteractive.cs b/public/Nitrocid/Files/Editors/TextEdit/TextEditInteractive.cs index 41e459930f..b690fa9659 100644 --- a/public/Nitrocid/Files/Editors/TextEdit/TextEditInteractive.cs +++ b/public/Nitrocid/Files/Editors/TextEdit/TextEditInteractive.cs @@ -20,8 +20,8 @@ using System; using System.Linq; using System.Text; -using Textify.Sequences.Tools; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences; +using Terminaux.Sequences.Builder.Types; using System.Collections.Generic; using Nitrocid.Shell.Shells.Text; using Nitrocid.Kernel.Debugging; @@ -38,6 +38,8 @@ using Terminaux.Colors; using Terminaux.Base; using Terminaux.Inputs; +using Terminaux.Reader; +using Terminaux.Base.Extensions; namespace Nitrocid.Files.Editors.TextEdit { @@ -115,7 +117,7 @@ internal static void OpenInteractive(string file, ref List lines) // Wait for a keypress ScreenTools.Render(screen); - var keypress = Input.DetectKeypress(); + var keypress = TermReader.ReadKey(); HandleKeypress(keypress, ref lines); // Reset, in case selection changed @@ -159,7 +161,7 @@ private static void RenderKeybindings(ref Screen screen) $"{InteractiveTuiStatus.OptionForegroundColor.VTSequenceForeground}" + $"{InteractiveTuiStatus.BackgroundColor.VTSequenceBackground}" + $" {(binding._localizable ? Translate.DoTranslation(binding.Name) : binding.Name)} " + - ConsoleExtensions.GetClearLineToRightSequence() + ConsoleClearing.GetClearLineToRightSequence() ); } else @@ -171,7 +173,7 @@ private static void RenderKeybindings(ref Screen screen) $"{InteractiveTuiStatus.KeyBindingOptionColor.VTSequenceForeground}" + $"{InteractiveTuiStatus.OptionBackgroundColor.VTSequenceBackground}" + " K " + - ConsoleExtensions.GetClearLineToRightSequence() + ConsoleClearing.GetClearLineToRightSequence() ); break; } @@ -191,7 +193,7 @@ private static void RenderStatus(ref Screen screen) builder.Append( $"{InteractiveTuiStatus.ForegroundColor.VTSequenceForeground}" + $"{InteractiveTuiStatus.BackgroundColor.VTSequenceBackground}" + - $"{TextWriterWhereColor.RenderWherePlain(status + ConsoleExtensions.GetClearLineToRightSequence(), 0, 0)}" + $"{TextWriterWhereColor.RenderWhere(status + ConsoleClearing.GetClearLineToRightSequence(), 0, 0)}" ); return builder.ToString(); }); diff --git a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/CharSettingsKeyInput.cs b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/CharSettingsKeyInput.cs index dd1ec47da5..b9a0c0eb8d 100644 --- a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/CharSettingsKeyInput.cs +++ b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/CharSettingsKeyInput.cs @@ -26,6 +26,7 @@ using Textify.General; using Terminaux.Base; using Terminaux.Inputs; +using Terminaux.Reader; namespace Nitrocid.Kernel.Configuration.Settings.KeyInputs { @@ -44,7 +45,7 @@ public object PromptForSet(SettingsKey key, object KeyDefaultValue, out bool bai // Write the prompt TextWriters.Write($"{Translate.DoTranslation("Press any letter on your keyboard to set it to that character.")}\n", KernelColorType.Tip); TextWriters.Write("[{0}] ", false, KernelColorType.Input, KeyDefaultValue); - var keypressTerm = Input.DetectKeypress(); + var keypressTerm = TermReader.ReadKey(); var keypress = keypressTerm.KeyChar; keypress = CharManager.IsControlChar(keypress) ? '\0' : diff --git a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/ColorSettingsKeyInput.cs b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/ColorSettingsKeyInput.cs index 58e76cfec8..2f52469f76 100644 --- a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/ColorSettingsKeyInput.cs +++ b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/ColorSettingsKeyInput.cs @@ -24,7 +24,7 @@ using System.Linq; using Terminaux.Colors; using Terminaux.Colors.Data; -using Terminaux.Colors.Selector; +using Terminaux.Inputs.Styles; namespace Nitrocid.Kernel.Configuration.Settings.KeyInputs { diff --git a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/DoubleSettingsKeyInput.cs b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/DoubleSettingsKeyInput.cs index da9c1d5407..e9643b23d4 100644 --- a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/DoubleSettingsKeyInput.cs +++ b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/DoubleSettingsKeyInput.cs @@ -25,6 +25,7 @@ using Terminaux.Base; using Terminaux.Inputs; using Terminaux.Inputs.Styles.Infobox; +using Terminaux.Reader; namespace Nitrocid.Kernel.Configuration.Settings.KeyInputs { @@ -86,7 +87,7 @@ public void SetValue(SettingsKey key, object value, BaseKernelConfig configType) DebugWriter.WriteDebug(DebugLevel.W, "Negative values are disallowed."); TextWriters.Write(Translate.DoTranslation("The answer may not be negative."), true, KernelColorType.Error); TextWriters.Write(Translate.DoTranslation("Press any key to go back."), true, KernelColorType.Error); - Input.DetectKeypress(); + TermReader.ReadKey(); } } diff --git a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/IntSettingsKeyInput.cs b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/IntSettingsKeyInput.cs index aa5e08289a..2b792801c6 100644 --- a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/IntSettingsKeyInput.cs +++ b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/IntSettingsKeyInput.cs @@ -25,6 +25,7 @@ using Terminaux.Base; using Terminaux.Inputs; using Terminaux.Inputs.Styles.Infobox; +using Terminaux.Reader; namespace Nitrocid.Kernel.Configuration.Settings.KeyInputs { @@ -86,7 +87,7 @@ public void SetValue(SettingsKey key, object value, BaseKernelConfig configType) DebugWriter.WriteDebug(DebugLevel.W, "Negative values are disallowed."); TextWriters.Write(Translate.DoTranslation("The answer may not be negative."), true, KernelColorType.Error); TextWriters.Write(Translate.DoTranslation("Press any key to go back."), true, KernelColorType.Error); - Input.DetectKeypress(); + TermReader.ReadKey(); } } diff --git a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/IntSliderSettingsKeyInput.cs b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/IntSliderSettingsKeyInput.cs index ef65af4979..61b0d810a7 100644 --- a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/IntSliderSettingsKeyInput.cs +++ b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/IntSliderSettingsKeyInput.cs @@ -26,6 +26,7 @@ using System; using Terminaux.Base; using Terminaux.Inputs; +using Terminaux.Reader; namespace Nitrocid.Kernel.Configuration.Settings.KeyInputs { @@ -50,7 +51,7 @@ public object PromptForSet(SettingsKey key, object KeyDefaultValue, out bool bai InfoBoxProgressColor.WriteInfoBoxProgress(key.Name, slider, Translate.DoTranslation("Current value:") + " {0} / {1} - {2}", CurrentValue, key.MinimumValue, key.MaximumValue); // Parse the user input - PressedKey = Input.DetectKeypress(); + PressedKey = TermReader.ReadKey(); switch (PressedKey.Key) { case ConsoleKey.Home: diff --git a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/ListSettingsKeyInput.cs b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/ListSettingsKeyInput.cs index 9448d02f1e..9ede404e9d 100644 --- a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/ListSettingsKeyInput.cs +++ b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/ListSettingsKeyInput.cs @@ -66,7 +66,7 @@ public object PromptForSet(SettingsKey key, object KeyDefaultValue, out bool bai ]; // Wait for an answer and handle it - int selectionAnswer = SelectionStyle.PromptSelection(finalSection, choices, altChoices, true); + int selectionAnswer = SelectionStyle.PromptSelection(finalSection, [.. choices], [.. altChoices], true); if (selectionAnswer == choices.Count + 1) promptBail = true; else diff --git a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/SelectionSettingsKeyInput.cs b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/SelectionSettingsKeyInput.cs index 777101cd42..2e8bc7b65a 100644 --- a/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/SelectionSettingsKeyInput.cs +++ b/public/Nitrocid/Kernel/Configuration/Settings/KeyInputs/SelectionSettingsKeyInput.cs @@ -30,6 +30,7 @@ using System.Linq; using System.Reflection; using Terminaux.Inputs; +using Terminaux.Reader; namespace Nitrocid.Kernel.Configuration.Settings.KeyInputs { @@ -147,7 +148,7 @@ public void SetValue(SettingsKey key, object value, BaseKernelConfig configType) DebugWriter.WriteDebug(DebugLevel.W, "Answer is not valid."); TextWriters.Write(Translate.DoTranslation("The answer may not exceed the entries shown."), true, KernelColorType.Error); TextWriters.Write(Translate.DoTranslation("Press any key to go back."), true, KernelColorType.Error); - Input.DetectKeypress(); + TermReader.ReadKey(); } } else if (AnswerInt == 0 & !SelectionEnumZeroBased) @@ -155,14 +156,14 @@ public void SetValue(SettingsKey key, object value, BaseKernelConfig configType) DebugWriter.WriteDebug(DebugLevel.W, "Zero is not allowed."); TextWriters.Write(Translate.DoTranslation("The answer may not be zero."), true, KernelColorType.Error); TextWriters.Write(Translate.DoTranslation("Press any key to go back."), true, KernelColorType.Error); - Input.DetectKeypress(); + TermReader.ReadKey(); } else { DebugWriter.WriteDebug(DebugLevel.W, "Negative values are disallowed."); TextWriters.Write(Translate.DoTranslation("The answer may not be negative."), true, KernelColorType.Error); TextWriters.Write(Translate.DoTranslation("Press any key to go back."), true, KernelColorType.Error); - Input.DetectKeypress(); + TermReader.ReadKey(); } } diff --git a/public/Nitrocid/Kernel/Configuration/Settings/SettingsApp.cs b/public/Nitrocid/Kernel/Configuration/Settings/SettingsApp.cs index 60da20d542..8715e95f71 100644 --- a/public/Nitrocid/Kernel/Configuration/Settings/SettingsApp.cs +++ b/public/Nitrocid/Kernel/Configuration/Settings/SettingsApp.cs @@ -33,6 +33,7 @@ using Textify.General; using Terminaux.Base; using Terminaux.Inputs; +using Terminaux.Reader; namespace Nitrocid.Kernel.Configuration.Settings { @@ -209,7 +210,7 @@ public static void OpenSection(string Section, SettingsEntry SettingsSection, Ba // Prompt user and check for input string finalSection = SectionTranslateName ? Translate.DoTranslation(SectionDisplayName) : SectionDisplayName; int Answer = SelectionStyle.PromptSelection(RenderHeader(finalSection, Translate.DoTranslation(SectionDescription), Notes), - sections, altSections); + [.. sections], [.. altSections]); // We need to check for exit early if (Answer == -1) @@ -240,7 +241,7 @@ public static void OpenSection(string Section, SettingsEntry SettingsSection, Ba DebugWriter.WriteDebug(DebugLevel.W, "Option is not valid. Returning..."); TextWriters.Write(Translate.DoTranslation("Specified option {0} is invalid."), true, KernelColorType.Error, Answer); TextWriters.Write(Translate.DoTranslation("Press any key to go back."), true, KernelColorType.Error); - Input.DetectKeypress(); + TermReader.ReadKey(); } } } @@ -328,7 +329,7 @@ public static void VariableFinder(BaseKernelConfig configType) while (sel != Results.Count + 1) { // Prompt for setting - sel = SelectionStyle.PromptSelection(Translate.DoTranslation("These settings are found. Please select one."), Results, Back); + sel = SelectionStyle.PromptSelection(Translate.DoTranslation("These settings are found. Please select one."), [.. Results], [.. Back]); // If pressed back, bail if (sel == Results.Count + 1 || sel == -1) diff --git a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliDoublePaneSlowTestData.cs b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliDoublePaneSlowTestData.cs index 2f0b1b422a..e6e53fc35c 100644 --- a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliDoublePaneSlowTestData.cs +++ b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliDoublePaneSlowTestData.cs @@ -25,7 +25,7 @@ namespace Nitrocid.Kernel.Debugging.Testing.Facades.FacadeData { - internal class CliDoublePaneSlowTestData : BaseInteractiveTui, IInteractiveTui + internal class CliDoublePaneSlowTestData : BaseInteractiveTui, IInteractiveTui { internal static List strings = []; internal static List strings2 = []; @@ -38,11 +38,11 @@ internal class CliDoublePaneSlowTestData : BaseInteractiveTui, IInteractiveTui ]; /// - public override IEnumerable PrimaryDataSource => + public override IEnumerable PrimaryDataSource => strings; /// - public override IEnumerable SecondaryDataSource => + public override IEnumerable SecondaryDataSource => strings2; /// @@ -54,9 +54,9 @@ internal class CliDoublePaneSlowTestData : BaseInteractiveTui, IInteractiveTui true; /// - public override void RenderStatus(object item) + public override void RenderStatus(string item) { - string selected = (string)item; + string selected = item; // Check to see if we're given the test info if (string.IsNullOrEmpty(selected)) @@ -66,9 +66,9 @@ public override void RenderStatus(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(string item) { - string selected = (string)item; + string selected = item; return selected; } diff --git a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliDoublePaneTestData.cs b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliDoublePaneTestData.cs index 739d7e45c7..0dd8461c34 100644 --- a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliDoublePaneTestData.cs +++ b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliDoublePaneTestData.cs @@ -25,7 +25,7 @@ namespace Nitrocid.Kernel.Debugging.Testing.Facades.FacadeData { - internal class CliDoublePaneTestData : BaseInteractiveTui, IInteractiveTui + internal class CliDoublePaneTestData : BaseInteractiveTui, IInteractiveTui { internal static List strings = []; internal static List strings2 = []; @@ -38,11 +38,11 @@ internal class CliDoublePaneTestData : BaseInteractiveTui, IInteractiveTui ]; /// - public override IEnumerable PrimaryDataSource => + public override IEnumerable PrimaryDataSource => strings; /// - public override IEnumerable SecondaryDataSource => + public override IEnumerable SecondaryDataSource => strings2; public override bool SecondPaneInteractable => @@ -53,9 +53,9 @@ internal class CliDoublePaneTestData : BaseInteractiveTui, IInteractiveTui true; /// - public override void RenderStatus(object item) + public override void RenderStatus(string item) { - string selected = (string)item; + string selected = item; // Check to see if we're given the test info if (string.IsNullOrEmpty(selected)) @@ -65,9 +65,9 @@ public override void RenderStatus(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(string item) { - string selected = (string)item; + string selected = item; return selected; } diff --git a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneSlowTestData.cs b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneSlowTestData.cs index e978d6fd34..c7205e8121 100644 --- a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneSlowTestData.cs +++ b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneSlowTestData.cs @@ -25,7 +25,7 @@ namespace Nitrocid.Kernel.Debugging.Testing.Facades.FacadeData { - internal class CliInfoPaneSlowTestData : BaseInteractiveTui, IInteractiveTui + internal class CliInfoPaneSlowTestData : BaseInteractiveTui, IInteractiveTui { internal static List strings = []; @@ -37,7 +37,7 @@ internal class CliInfoPaneSlowTestData : BaseInteractiveTui, IInteractiveTui ]; /// - public override IEnumerable PrimaryDataSource => + public override IEnumerable PrimaryDataSource => strings; /// @@ -45,9 +45,9 @@ internal class CliInfoPaneSlowTestData : BaseInteractiveTui, IInteractiveTui true; /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(string item) { - string selected = (string)item; + string selected = item; // Check to see if we're given the test info if (string.IsNullOrEmpty(selected)) @@ -60,9 +60,9 @@ public override string GetInfoFromItem(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(string item) { - string selected = (string)item; + string selected = item; return selected; } } diff --git a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneSlowTestRefreshingData.cs b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneSlowTestRefreshingData.cs index a47d3c5fd3..56a51928b1 100644 --- a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneSlowTestRefreshingData.cs +++ b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneSlowTestRefreshingData.cs @@ -25,7 +25,7 @@ namespace Nitrocid.Kernel.Debugging.Testing.Facades.FacadeData { - internal class CliInfoPaneSlowTestRefreshingData : BaseInteractiveTui, IInteractiveTui + internal class CliInfoPaneSlowTestRefreshingData : BaseInteractiveTui, IInteractiveTui { internal static List strings = []; private static int timesRendered = 0; @@ -42,7 +42,7 @@ internal class CliInfoPaneSlowTestRefreshingData : BaseInteractiveTui, IInteract 3000; /// - public override IEnumerable PrimaryDataSource => + public override IEnumerable PrimaryDataSource => strings; /// @@ -50,10 +50,10 @@ internal class CliInfoPaneSlowTestRefreshingData : BaseInteractiveTui, IInteract true; /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(string item) { // Some variables - string selected = (string)item; + string selected = item; timesRendered++; // Check to see if we're given the test info @@ -67,9 +67,9 @@ public override string GetInfoFromItem(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(string item) { - string selected = (string)item; + string selected = item; return selected; } } diff --git a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneTestData.cs b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneTestData.cs index 3c313ab97f..c8e6d8b6f0 100644 --- a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneTestData.cs +++ b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneTestData.cs @@ -25,7 +25,7 @@ namespace Nitrocid.Kernel.Debugging.Testing.Facades.FacadeData { - internal class CliInfoPaneTestData : BaseInteractiveTui, IInteractiveTui + internal class CliInfoPaneTestData : BaseInteractiveTui, IInteractiveTui { internal static List strings = []; @@ -37,7 +37,7 @@ internal class CliInfoPaneTestData : BaseInteractiveTui, IInteractiveTui ]; /// - public override IEnumerable PrimaryDataSource => + public override IEnumerable PrimaryDataSource => strings; /// @@ -45,9 +45,9 @@ internal class CliInfoPaneTestData : BaseInteractiveTui, IInteractiveTui true; /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(string item) { - string selected = (string)item; + string selected = item; // Check to see if we're given the test info if (string.IsNullOrEmpty(selected)) @@ -60,9 +60,9 @@ public override string GetInfoFromItem(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(string item) { - string selected = (string)item; + string selected = item; return selected; } diff --git a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneTestRefreshingData.cs b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneTestRefreshingData.cs index 2dc2c40cdf..c566c1fcde 100644 --- a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneTestRefreshingData.cs +++ b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/CliInfoPaneTestRefreshingData.cs @@ -25,7 +25,7 @@ namespace Nitrocid.Kernel.Debugging.Testing.Facades.FacadeData { - internal class CliInfoPaneTestRefreshingData : BaseInteractiveTui, IInteractiveTui + internal class CliInfoPaneTestRefreshingData : BaseInteractiveTui, IInteractiveTui { internal static List strings = []; private static int timesRendered = 0; @@ -42,7 +42,7 @@ internal class CliInfoPaneTestRefreshingData : BaseInteractiveTui, IInteractiveT 3000; /// - public override IEnumerable PrimaryDataSource => + public override IEnumerable PrimaryDataSource => strings; /// @@ -50,10 +50,10 @@ internal class CliInfoPaneTestRefreshingData : BaseInteractiveTui, IInteractiveT true; /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(string item) { // Some variables - string selected = (string)item; + string selected = item; timesRendered++; // Check to see if we're given the test info @@ -67,9 +67,9 @@ public override string GetInfoFromItem(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(string item) { - string selected = (string)item; + string selected = item; return selected; } diff --git a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/PresentationDebugInt.cs b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/PresentationDebugInt.cs index 6a6b4273bd..16fbafe35b 100644 --- a/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/PresentationDebugInt.cs +++ b/public/Nitrocid/Kernel/Debugging/Testing/Facades/FacadeData/PresentationDebugInt.cs @@ -63,7 +63,7 @@ internal static class PresentationDebugInt { Arguments = [ "Enjoying yet? {0}Color treat!", - new Color(ConsoleColors.Purple4_5f00af).VTSequenceForeground + new Color(ConsoleColors.Purple4Alt).VTSequenceForeground ] } ] diff --git a/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputMultiSelection.cs b/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputMultiSelection.cs index cb23e0890c..798165fa5d 100644 --- a/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputMultiSelection.cs +++ b/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputMultiSelection.cs @@ -43,7 +43,7 @@ public override void Run(params string[] args) new("lunar", "23.04 (Lunar Lobster)", "Ubuntu 23.04 Lunar Lobster is an interim release, released 20 April 2023."), new("mantic", "23.10 (Mantic Minotaur)", "Ubuntu 23.10 Mantic Minotaur is an interim release, scheduled 12 October 2023."), }; - var answers = SelectionMultipleStyle.PromptMultipleSelection("Which Ubuntu version would you like to run?", choices, altChoices); + var answers = SelectionMultipleStyle.PromptMultipleSelection("Which Ubuntu version would you like to run?", [.. choices], [.. altChoices]); TextWriterColor.Write(string.Join(", ", answers)); } } diff --git a/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputSelection.cs b/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputSelection.cs index 24dfd6eb5f..9cc6e3caae 100644 --- a/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputSelection.cs +++ b/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputSelection.cs @@ -42,7 +42,7 @@ public override void Run(params string[] args) new("lunar", "23.04 (Lunar Lobster)", "Ubuntu 23.04 Lunar Lobster is an interim release, released 20 April 2023."), new("mantic", "23.10 (Mantic Minotaur)", "Ubuntu 23.10 Mantic Minotaur is an interim release, scheduled 12 October 2023."), }; - SelectionStyle.PromptSelection("Which Ubuntu version would you like to run?", choices, altChoices); + SelectionStyle.PromptSelection("Which Ubuntu version would you like to run?", [.. choices], [.. altChoices]); } } } diff --git a/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputSelectionLarge.cs b/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputSelectionLarge.cs index 98fbc3b339..2794bbdd74 100644 --- a/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputSelectionLarge.cs +++ b/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputSelectionLarge.cs @@ -33,7 +33,7 @@ public override void Run(params string[] args) var choices = new List(); for (int i = 0; i < 1000; i++) choices.Add(new InputChoiceInfo($"{i + 1}", $"Number #{i + 1}")); - SelectionStyle.PromptSelection("Select a choice.", choices); + SelectionStyle.PromptSelection("Select a choice.", [.. choices]); } } } diff --git a/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputSelectionLargeMultiple.cs b/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputSelectionLargeMultiple.cs index f3167dcbf9..7969ccc96a 100644 --- a/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputSelectionLargeMultiple.cs +++ b/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestInputSelectionLargeMultiple.cs @@ -34,7 +34,7 @@ public override void Run(params string[] args) var choices = new List(); for (int i = 0; i < 1000; i++) choices.Add(new InputChoiceInfo($"{i + 1}", $"Number #{i + 1}")); - var answers = SelectionMultipleStyle.PromptMultipleSelection("Select a choice.", choices); + var answers = SelectionMultipleStyle.PromptMultipleSelection("Select a choice.", [.. choices]); TextWriterColor.Write(string.Join(", ", answers)); } } diff --git a/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestScreen.cs b/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestScreen.cs index f65c3f0eab..a98801d2c0 100644 --- a/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestScreen.cs +++ b/public/Nitrocid/Kernel/Debugging/Testing/Facades/TestScreen.cs @@ -24,10 +24,11 @@ using System; using System.Text; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; using Terminaux.Colors.Data; using Terminaux.Inputs; +using Terminaux.Reader; namespace Nitrocid.Kernel.Debugging.Testing.Facades { @@ -43,7 +44,7 @@ public override void Run(params string[] args) { var stickScreenPart = new ScreenPart(); stickScreenPart.Position(0, 1); - stickScreenPart.BackgroundColor(new Color(ConsoleColors.Gray)); + stickScreenPart.BackgroundColor(new Color(ConsoleColors.Silver)); stickScreenPart.AddDynamicText(GenerateWidthStick); stickScreenPart.AddDynamicText(GenerateHeightStick); stickScreenPart.AddDynamicText(() => KernelColorTools.GetColor(KernelColorType.NeutralText).VTSequenceForeground); @@ -51,7 +52,7 @@ public override void Run(params string[] args) stickScreen.AddBufferedPart("Test", stickScreenPart); ScreenTools.SetCurrent(stickScreen); ScreenTools.Render(); - Input.DetectKeypress(); + TermReader.ReadKey(); } catch (Exception ex) { diff --git a/public/Nitrocid/Kernel/Exceptions/KernelPanic.cs b/public/Nitrocid/Kernel/Exceptions/KernelPanic.cs index 0e7e18d80e..b7da38f6a3 100644 --- a/public/Nitrocid/Kernel/Exceptions/KernelPanic.cs +++ b/public/Nitrocid/Kernel/Exceptions/KernelPanic.cs @@ -41,6 +41,7 @@ using System.Threading; using Textify.General; using Terminaux.Inputs; +using Terminaux.Reader; namespace Nitrocid.Kernel.Exceptions { @@ -152,7 +153,7 @@ internal static void KernelError(KernelErrorLevel ErrorType, bool Reboot, long R SplashReport.ReportProgressError(Translate.DoTranslation("[{0}] panic: {1} -- Press any key to shutdown."), Exc, ErrorType, Description); if (ShowStackTraceOnKernelError & Exc is not null) SplashReport.ReportProgressError(Exc.StackTrace); - Input.DetectKeypress(); + TermReader.ReadKey(); PowerManager.PowerManage(PowerMode.Shutdown); } } diff --git a/public/Nitrocid/Kernel/KernelEntry.cs b/public/Nitrocid/Kernel/KernelEntry.cs index 1a55bf8574..6784c8f0b8 100644 --- a/public/Nitrocid/Kernel/KernelEntry.cs +++ b/public/Nitrocid/Kernel/KernelEntry.cs @@ -89,7 +89,7 @@ internal static void EntryPoint(string[] args) SplashManager.CloseSplash(SplashContext.StartingUp); SplashReport._KernelBooted = true; if (!SplashManager.EnableSplash) - TextWriterColor.Write(); + TextWriterRaw.Write(); // If this is the first time, run the first run presentation if (FirstTime) @@ -150,7 +150,7 @@ private static void MainLoop() if (TimeDateTools.ShowCurrentTimeBeforeLogin) { TimeDateMiscRenderers.ShowCurrentTimes(); - TextWriterColor.Write(); + TextWriterRaw.Write(); } // Show the tip diff --git a/public/Nitrocid/Kernel/KernelFirstRun.cs b/public/Nitrocid/Kernel/KernelFirstRun.cs index 8446d2e197..0aba201fb5 100644 --- a/public/Nitrocid/Kernel/KernelFirstRun.cs +++ b/public/Nitrocid/Kernel/KernelFirstRun.cs @@ -30,6 +30,7 @@ using Textify.General; using Terminaux.Base; using Terminaux.Inputs; +using Terminaux.Reader; namespace Nitrocid.Kernel { @@ -354,7 +355,7 @@ internal static void PresentFirstRun() ConsoleWrapper.Clear(); TextWriterColor.Write(Translate.DoTranslation("We apologize for your inconvenience, but the out-of-box experience has crashed. If you're sure that this is a defect in the experience, please report the crash to us with debugging logs.") + " {0}", ex.Message); TextWriterColor.Write(Translate.DoTranslation("Press any key to start the shell anyways, but please note that you may have to create your new user manually.")); - Input.DetectKeypress(); + TermReader.ReadKey(); } } diff --git a/public/Nitrocid/Kernel/KernelMain.cs b/public/Nitrocid/Kernel/KernelMain.cs index 3317cfa48e..10c2d554e0 100644 --- a/public/Nitrocid/Kernel/KernelMain.cs +++ b/public/Nitrocid/Kernel/KernelMain.cs @@ -37,6 +37,7 @@ using Nitrocid.Kernel.Power; using Terminaux.Colors; using Terminaux.Base; +using Terminaux.Base.Extensions; namespace Nitrocid.Kernel { @@ -152,7 +153,7 @@ internal static void Main(string[] Args) // Reset colors and clear the console if (!PowerManager.hardShutdown) - ConsoleExtensions.ResetAll(); + ConsoleClearing.ResetAll(); else ConsoleTools.ResetColors(); diff --git a/public/Nitrocid/Kernel/Starting/KernelInitializers.cs b/public/Nitrocid/Kernel/Starting/KernelInitializers.cs index 22cf2446ba..38bf9b6df8 100644 --- a/public/Nitrocid/Kernel/Starting/KernelInitializers.cs +++ b/public/Nitrocid/Kernel/Starting/KernelInitializers.cs @@ -60,6 +60,7 @@ using Nitrocid.Network.Types.RPC; using Nitrocid.Network.SpeedDial; using Nitrocid.Network.Connections; +using Terminaux.Base.Extensions; namespace Nitrocid.Kernel.Starting { @@ -75,7 +76,7 @@ internal static void InitializeCritical() // Initialize crucial things if (!KernelPlatform.IsOnUnix()) { - if (!ConsoleExtensions.InitializeSequences()) + if (!ConsolePositioning.InitializeSequences()) { TextWriterColor.Write(Translate.DoTranslation("Can not initialize VT sequences for your Windows terminal. Make sure that you're running Windows 10 or later.")); InputTools.DetectKeypress(); @@ -123,7 +124,7 @@ internal static void InitializeEssential() } // A title - ConsoleExtensions.SetTitle(KernelReleaseInfo.ConsoleTitle); + ConsoleMisc.SetTitle(KernelReleaseInfo.ConsoleTitle); // Initialize pre-boot splash (if enabled) if (KernelEntry.PrebootSplash) diff --git a/public/Nitrocid/Kernel/Starting/KernelStageTools.cs b/public/Nitrocid/Kernel/Starting/KernelStageTools.cs index 224659003f..287f196d67 100644 --- a/public/Nitrocid/Kernel/Starting/KernelStageTools.cs +++ b/public/Nitrocid/Kernel/Starting/KernelStageTools.cs @@ -97,7 +97,7 @@ internal static void ReportNewStage(int StageNumber, string StageText) if (StageNumber > Stages.Count) { StageTimer.Reset(); - TextWriterColor.Write(); + TextWriterRaw.Write(); } else StageTimer.Restart(); @@ -108,7 +108,7 @@ internal static void ReportNewStage(int StageNumber, string StageText) { if (!SplashManager.EnableSplash & !KernelEntry.QuietKernel) { - TextWriterColor.Write(); + TextWriterRaw.Write(); TextFancyWriters.WriteSeparator(StageText, false, KernelColorType.Stage); } DebugWriter.WriteDebug(DebugLevel.I, $"- Kernel stage {StageNumber} | Text: {StageText}"); diff --git a/public/Nitrocid/Misc/Interactives/FileManagerCli.cs b/public/Nitrocid/Misc/Interactives/FileManagerCli.cs index 4eff8237e3..8702303309 100644 --- a/public/Nitrocid/Misc/Interactives/FileManagerCli.cs +++ b/public/Nitrocid/Misc/Interactives/FileManagerCli.cs @@ -24,7 +24,7 @@ using System.Text; using System.Collections; using System.Reflection; -using Textify.Sequences.Tools; +using Terminaux.Sequences; using Nitrocid.Kernel.Configuration; using Nitrocid.Kernel.Debugging; using Nitrocid.Files; @@ -51,7 +51,7 @@ namespace Nitrocid.Misc.Interactives /// /// File manager class relating to the interactive file manager planned back in 2018 /// - public class FileManagerCli : BaseInteractiveTui, IInteractiveTui + public class FileManagerCli : BaseInteractiveTui, IInteractiveTui { internal string firstPanePath = PathsManagement.HomePath; internal string secondPanePath = PathsManagement.HomePath; @@ -103,7 +103,7 @@ public class FileManagerCli : BaseInteractiveTui, IInteractiveTui true; /// - public override IEnumerable PrimaryDataSource + public override IEnumerable PrimaryDataSource { get { @@ -126,7 +126,7 @@ public override IEnumerable PrimaryDataSource } /// - public override IEnumerable SecondaryDataSource + public override IEnumerable SecondaryDataSource { get { @@ -153,9 +153,9 @@ public override IEnumerable SecondaryDataSource true; /// - public override void RenderStatus(object item) + public override void RenderStatus(FileSystemEntry item) { - FileSystemEntry FileInfoCurrentPane = (FileSystemEntry)item; + FileSystemEntry FileInfoCurrentPane = item; // Check to see if we're given the file system info if (FileInfoCurrentPane == null) @@ -189,11 +189,11 @@ public override void RenderStatus(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(FileSystemEntry item) { try { - FileSystemEntry file = (FileSystemEntry)item; + FileSystemEntry file = item; bool isDirectory = file.Type == FileSystemEntryType.Directory; return $" [{(isDirectory ? "/" : "*")}] {file.BaseEntry.Name}"; } diff --git a/public/Nitrocid/Misc/Interactives/FileSelectorCli.cs b/public/Nitrocid/Misc/Interactives/FileSelectorCli.cs index 7d32d3451a..37da85a584 100644 --- a/public/Nitrocid/Misc/Interactives/FileSelectorCli.cs +++ b/public/Nitrocid/Misc/Interactives/FileSelectorCli.cs @@ -24,7 +24,7 @@ using System.Text; using System.Collections; using System.Reflection; -using Textify.Sequences.Tools; +using Terminaux.Sequences; using Nitrocid.Kernel.Configuration; using Nitrocid.Kernel.Debugging; using Nitrocid.Files; @@ -50,7 +50,7 @@ namespace Nitrocid.Misc.Interactives /// /// File selector class, a descendant of the file manager /// - public class FileSelectorCli : BaseInteractiveTui, IInteractiveTui + public class FileSelectorCli : BaseInteractiveTui, IInteractiveTui { internal string selectedFile = ""; internal string firstPanePath = PathsManagement.HomePath; @@ -90,7 +90,7 @@ public class FileSelectorCli : BaseInteractiveTui, IInteractiveTui ]; /// - public override IEnumerable PrimaryDataSource + public override IEnumerable PrimaryDataSource { get { @@ -117,9 +117,9 @@ public override IEnumerable PrimaryDataSource true; /// - public override void RenderStatus(object item) + public override void RenderStatus(FileSystemEntry item) { - FileSystemEntry FileInfoCurrentPane = (FileSystemEntry)item; + FileSystemEntry FileInfoCurrentPane = item; // Check to see if we're given the file system info if (FileInfoCurrentPane == null) @@ -155,11 +155,11 @@ public override void RenderStatus(object item) } /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(FileSystemEntry item) { try { - FileSystemEntry file = (FileSystemEntry)item; + FileSystemEntry file = item; bool isDirectory = file.Type == FileSystemEntryType.Directory; bool isSelected = SelectedFile == file.FilePath; var size = file.FileSize; @@ -186,11 +186,11 @@ public override string GetInfoFromItem(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(FileSystemEntry item) { try { - FileSystemEntry file = (FileSystemEntry)item; + FileSystemEntry file = item; bool isDirectory = file.Type == FileSystemEntryType.Directory; bool isSelected = SelectedFile == file.FilePath; return $" [{(isDirectory ? "/" : "*")}] [{(isSelected ? "+" : " ")}] {file.BaseEntry.Name}"; diff --git a/public/Nitrocid/Misc/Interactives/FilesSelectorCli.cs b/public/Nitrocid/Misc/Interactives/FilesSelectorCli.cs index dbf99845e5..9ae583147b 100644 --- a/public/Nitrocid/Misc/Interactives/FilesSelectorCli.cs +++ b/public/Nitrocid/Misc/Interactives/FilesSelectorCli.cs @@ -24,7 +24,7 @@ using System.Text; using System.Collections; using System.Reflection; -using Textify.Sequences.Tools; +using Terminaux.Sequences; using Nitrocid.Kernel.Configuration; using Nitrocid.Kernel.Debugging; using Nitrocid.Files; @@ -50,7 +50,7 @@ namespace Nitrocid.Misc.Interactives /// /// Files selector class, a descendant of the file manager /// - public class FilesSelectorCli : BaseInteractiveTui, IInteractiveTui + public class FilesSelectorCli : BaseInteractiveTui, IInteractiveTui { internal List selectedFiles = []; internal string firstPanePath = PathsManagement.HomePath; @@ -92,7 +92,7 @@ public class FilesSelectorCli : BaseInteractiveTui, IInteractiveTui ]; /// - public override IEnumerable PrimaryDataSource + public override IEnumerable PrimaryDataSource { get { @@ -119,9 +119,9 @@ public override IEnumerable PrimaryDataSource true; /// - public override void RenderStatus(object item) + public override void RenderStatus(FileSystemEntry item) { - FileSystemEntry FileInfoCurrentPane = (FileSystemEntry)item; + FileSystemEntry FileInfoCurrentPane = item; // Check to see if we're given the file system info if (FileInfoCurrentPane == null) @@ -157,11 +157,11 @@ public override void RenderStatus(object item) } /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(FileSystemEntry item) { try { - FileSystemEntry file = (FileSystemEntry)item; + FileSystemEntry file = item; bool isDirectory = file.Type == FileSystemEntryType.Directory; bool isSelected = SelectedFiles.Contains(file.FilePath); var size = file.FileSize; @@ -188,11 +188,11 @@ public override string GetInfoFromItem(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(FileSystemEntry item) { try { - FileSystemEntry file = (FileSystemEntry)item; + FileSystemEntry file = item; bool isDirectory = file.Type == FileSystemEntryType.Directory; bool isSelected = SelectedFiles.Contains(file.FilePath); return $" [{(isDirectory ? "/" : "*")}] [{(isSelected ? "+" : " ")}] {file.BaseEntry.Name}"; diff --git a/public/Nitrocid/Misc/Interactives/FolderSelectorCli.cs b/public/Nitrocid/Misc/Interactives/FolderSelectorCli.cs index bf16264aac..a290243879 100644 --- a/public/Nitrocid/Misc/Interactives/FolderSelectorCli.cs +++ b/public/Nitrocid/Misc/Interactives/FolderSelectorCli.cs @@ -24,7 +24,7 @@ using System.Text; using System.Collections; using System.Reflection; -using Textify.Sequences.Tools; +using Terminaux.Sequences; using Nitrocid.Kernel.Configuration; using Nitrocid.Kernel.Debugging; using Nitrocid.Files; @@ -50,7 +50,7 @@ namespace Nitrocid.Misc.Interactives /// /// Folder selector class, a descendant of the file manager /// - public class FolderSelectorCli : BaseInteractiveTui, IInteractiveTui + public class FolderSelectorCli : BaseInteractiveTui, IInteractiveTui { internal string selectedFolder = ""; internal string firstPanePath = PathsManagement.HomePath; @@ -92,7 +92,7 @@ public class FolderSelectorCli : BaseInteractiveTui, IInteractiveTui ]; /// - public override IEnumerable PrimaryDataSource + public override IEnumerable PrimaryDataSource { get { @@ -119,9 +119,9 @@ public override IEnumerable PrimaryDataSource true; /// - public override void RenderStatus(object item) + public override void RenderStatus(FileSystemEntry item) { - FileSystemEntry FileInfoCurrentPane = (FileSystemEntry)item; + FileSystemEntry FileInfoCurrentPane = item; // Check to see if we're given the file system info if (FileInfoCurrentPane == null) @@ -156,11 +156,11 @@ public override void RenderStatus(object item) } /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(FileSystemEntry item) { try { - FileSystemEntry file = (FileSystemEntry)item; + FileSystemEntry file = item; bool isDirectory = file.Type == FileSystemEntryType.Directory; bool isSelected = SelectedFolder == file.FilePath; var size = file.FileSize; @@ -187,11 +187,11 @@ public override string GetInfoFromItem(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(FileSystemEntry item) { try { - FileSystemEntry file = (FileSystemEntry)item; + FileSystemEntry file = item; bool isDirectory = file.Type == FileSystemEntryType.Directory; bool isSelected = SelectedFolder == file.FilePath; return $" [{(isDirectory ? "/" : "*")}] [{(isSelected ? "+" : " ")}] {file.BaseEntry.Name}"; diff --git a/public/Nitrocid/Misc/Interactives/FoldersSelectorCli.cs b/public/Nitrocid/Misc/Interactives/FoldersSelectorCli.cs index a3fe6a393d..0a22b6367e 100644 --- a/public/Nitrocid/Misc/Interactives/FoldersSelectorCli.cs +++ b/public/Nitrocid/Misc/Interactives/FoldersSelectorCli.cs @@ -24,7 +24,7 @@ using System.Text; using System.Collections; using System.Reflection; -using Textify.Sequences.Tools; +using Terminaux.Sequences; using Nitrocid.Kernel.Configuration; using Nitrocid.Kernel.Debugging; using Nitrocid.Files; @@ -50,7 +50,7 @@ namespace Nitrocid.Misc.Interactives /// /// Folders selector class, a descendant of the file manager /// - public class FoldersSelectorCli : BaseInteractiveTui, IInteractiveTui + public class FoldersSelectorCli : BaseInteractiveTui, IInteractiveTui { internal List selectedFolders = []; internal string firstPanePath = PathsManagement.HomePath; @@ -94,7 +94,7 @@ public class FoldersSelectorCli : BaseInteractiveTui, IInteractiveTui ]; /// - public override IEnumerable PrimaryDataSource + public override IEnumerable PrimaryDataSource { get { @@ -121,9 +121,9 @@ public override IEnumerable PrimaryDataSource true; /// - public override void RenderStatus(object item) + public override void RenderStatus(FileSystemEntry item) { - FileSystemEntry FileInfoCurrentPane = (FileSystemEntry)item; + FileSystemEntry FileInfoCurrentPane = item; // Check to see if we're given the file system info if (FileInfoCurrentPane == null) @@ -159,11 +159,11 @@ public override void RenderStatus(object item) } /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(FileSystemEntry item) { try { - FileSystemEntry file = (FileSystemEntry)item; + FileSystemEntry file = item; bool isDirectory = file.Type == FileSystemEntryType.Directory; bool isSelected = SelectedFolders.Contains(file.FilePath); var size = file.FileSize; @@ -190,11 +190,11 @@ public override string GetInfoFromItem(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(FileSystemEntry item) { try { - FileSystemEntry file = (FileSystemEntry)item; + FileSystemEntry file = item; bool isDirectory = file.Type == FileSystemEntryType.Directory; bool isSelected = SelectedFolders.Contains(file.FilePath); return $" [{(isDirectory ? "/" : "*")}] [{(isSelected ? "+" : " ")}] {file.BaseEntry.Name}"; diff --git a/public/Nitrocid/Misc/Interactives/ManualViewerCli.cs b/public/Nitrocid/Misc/Interactives/ManualViewerCli.cs index 169e230d8d..0a8e3bebf5 100644 --- a/public/Nitrocid/Misc/Interactives/ManualViewerCli.cs +++ b/public/Nitrocid/Misc/Interactives/ManualViewerCli.cs @@ -32,7 +32,7 @@ namespace Nitrocid.Misc.Interactives /// /// Manual viewer class /// - public class ManualViewerCli : BaseInteractiveTui, IInteractiveTui + public class ManualViewerCli : BaseInteractiveTui, IInteractiveTui { internal string modName = ""; @@ -43,18 +43,18 @@ public class ManualViewerCli : BaseInteractiveTui, IInteractiveTui [ // Operations new InteractiveTuiBinding("Info", ConsoleKey.F1, - (manual, _) => ShowManualInfo(manual)) + (manual, _) => ShowManualInfo((Manual)manual)) ]; /// - public override IEnumerable PrimaryDataSource => + public override IEnumerable PrimaryDataSource => PageManager.ListAllPagesByMod(modName); /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(Manual item) { // Get some info from the manual - Manual selectedManual = (Manual)item; + Manual selectedManual = item; bool hasTitle = !string.IsNullOrEmpty(selectedManual.Title); bool hasBody = !string.IsNullOrEmpty(selectedManual.Body.ToString()); @@ -76,10 +76,10 @@ public override string GetInfoFromItem(object item) } /// - public override void RenderStatus(object item) + public override void RenderStatus(Manual item) { // Get some info from the manual - Manual selectedManual = (Manual)item; + Manual selectedManual = item; bool hasTitle = !string.IsNullOrEmpty(selectedManual.Title); // Generate the rendered text @@ -92,17 +92,17 @@ public override void RenderStatus(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(Manual item) { - Manual manual = (Manual)item; + Manual manual = item; return manual.Name; } - private static void ShowManualInfo(object item) + private static void ShowManualInfo(Manual item) { // Render the final information string var finalInfoRendered = new StringBuilder(); - Manual manual = (Manual)item; + Manual manual = item; bool hasTitle = !string.IsNullOrEmpty(manual.Title); bool hasBody = !string.IsNullOrEmpty(manual.Body.ToString()); diff --git a/public/Nitrocid/Misc/Interactives/TaskManagerCli.cs b/public/Nitrocid/Misc/Interactives/TaskManagerCli.cs index 2b05337251..9a32640c5a 100644 --- a/public/Nitrocid/Misc/Interactives/TaskManagerCli.cs +++ b/public/Nitrocid/Misc/Interactives/TaskManagerCli.cs @@ -31,7 +31,7 @@ namespace Nitrocid.Misc.Interactives /// /// Task manager class /// - public class TaskManagerCli : BaseInteractiveTui, IInteractiveTui + public class TaskManagerCli : BaseInteractiveTui, IInteractiveTui { private static string taskStatus = ""; @@ -50,8 +50,17 @@ public class TaskManagerCli : BaseInteractiveTui, IInteractiveTui ]; /// - public override IEnumerable PrimaryDataSource => - osThreadMode ? ThreadManager.OperatingSystemThreads : ThreadManager.KernelThreads; + public override IEnumerable PrimaryDataSource + { + get + { + IEnumerable objects = osThreadMode ? ThreadManager.OperatingSystemThreads : ThreadManager.KernelThreads; + List result = []; + foreach (object obj in objects) + result.Add(obj); + return result; + } + } /// public override int RefreshInterval => diff --git a/public/Nitrocid/Misc/Interactives/TimeZoneShowCli.cs b/public/Nitrocid/Misc/Interactives/TimeZoneShowCli.cs index 03dee68e12..2ca2f4c3b5 100644 --- a/public/Nitrocid/Misc/Interactives/TimeZoneShowCli.cs +++ b/public/Nitrocid/Misc/Interactives/TimeZoneShowCli.cs @@ -29,7 +29,7 @@ namespace Nitrocid.Misc.Interactives /// /// Time zone showing class /// - public class TimeZoneShowCli : BaseInteractiveTui, IInteractiveTui + public class TimeZoneShowCli : BaseInteractiveTui, IInteractiveTui { private static readonly string[] zones = TimeZones.GetTimeZoneNames(); @@ -40,7 +40,7 @@ public class TimeZoneShowCli : BaseInteractiveTui, IInteractiveTui public override List Bindings { get; set; } = []; /// - public override IEnumerable PrimaryDataSource => + public override IEnumerable PrimaryDataSource => zones; /// @@ -48,7 +48,7 @@ public class TimeZoneShowCli : BaseInteractiveTui, IInteractiveTui 1000; /// - public override string GetInfoFromItem(object item) + public override string GetInfoFromItem(string item) { string selectedZone = (string)item; var time = TimeZones.GetTimeZoneTimes()[selectedZone]; @@ -61,7 +61,7 @@ public override string GetInfoFromItem(object item) } /// - public override void RenderStatus(object item) + public override void RenderStatus(string item) { string selectedZone = (string)item; var time = TimeZones.GetTimeZoneTimes()[selectedZone]; @@ -69,7 +69,7 @@ public override void RenderStatus(object item) } /// - public override string GetEntryFromItem(object item) + public override string GetEntryFromItem(string item) { string selectedZone = (string)item; return selectedZone; diff --git a/public/Nitrocid/Misc/Notifications/NotificationManager.cs b/public/Nitrocid/Misc/Notifications/NotificationManager.cs index e1de2a7595..69bf5e6127 100644 --- a/public/Nitrocid/Misc/Notifications/NotificationManager.cs +++ b/public/Nitrocid/Misc/Notifications/NotificationManager.cs @@ -42,6 +42,7 @@ using Nitrocid.Kernel.Power; using Textify.General; using Terminaux.Base; +using Terminaux.Base.Extensions; namespace Nitrocid.Misc.Notifications { @@ -295,7 +296,7 @@ private static void NotifListen() } // Go to the original position and print - TextWriterColor.WritePlain(printBuffer.ToString(), false); + TextWriterRaw.WritePlain(printBuffer.ToString(), false); printBuffer.Clear(); ConsoleWrapper.SetCursorPosition(x, y); @@ -341,7 +342,7 @@ private static void NotifListen() Thread.Sleep(indeterminate ? 250 : 1); // Print the buffer - TextWriterColor.WritePlain(printBuffer.ToString(), false); + TextWriterRaw.WritePlain(printBuffer.ToString(), false); printBuffer.Clear(); ConsoleWrapper.SetCursorPosition(x, y); } @@ -353,7 +354,7 @@ private static void NotifListen() printBuffer.Append(TextWriterWhereColor.RenderWhere(renderedProgressTitleSuccess, notifLeftAgnostic, notifTitleTop, NotifyProgressSuccessColor, background)); // Print the buffer - TextWriterColor.WritePlain(printBuffer.ToString(), false); + TextWriterRaw.WritePlain(printBuffer.ToString(), false); printBuffer.Clear(); ConsoleWrapper.SetCursorPosition(x, y); } @@ -390,7 +391,7 @@ private static void NotifListen() ); // Render it - TextWriterColor.WritePlain(printBuffer.ToString(), false); + TextWriterRaw.WritePlain(printBuffer.ToString(), false); printBuffer.Clear(); ConsoleWrapper.SetCursorPosition(x, y); } diff --git a/public/Nitrocid/Misc/Screensaver/Displays/MatrixBleed.cs b/public/Nitrocid/Misc/Screensaver/Displays/MatrixBleed.cs index 4c18abc0c5..55780c4900 100644 --- a/public/Nitrocid/Misc/Screensaver/Displays/MatrixBleed.cs +++ b/public/Nitrocid/Misc/Screensaver/Displays/MatrixBleed.cs @@ -26,7 +26,7 @@ using Nitrocid.Kernel.Debugging; using Nitrocid.Kernel.Threading; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Terminaux.Base; namespace Nitrocid.Misc.Screensaver.Displays @@ -156,7 +156,7 @@ public override void ScreensaverLogic() // Draw and clean the buffer string buffer = MatrixBleedState.bleedBuffer.ToString(); MatrixBleedState.bleedBuffer.Clear(); - TextWriterColor.WritePlain(buffer); + TextWriterRaw.WritePlain(buffer); // Reset resize sync ConsoleResizeHandler.WasResized(); diff --git a/public/Nitrocid/Misc/Splash/BaseSplash.cs b/public/Nitrocid/Misc/Splash/BaseSplash.cs index bcb0caeda8..6d66e03623 100644 --- a/public/Nitrocid/Misc/Splash/BaseSplash.cs +++ b/public/Nitrocid/Misc/Splash/BaseSplash.cs @@ -23,7 +23,7 @@ using Nitrocid.ConsoleBase.Colors; using Nitrocid.Kernel.Debugging; using Terminaux.Colors; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; namespace Nitrocid.Misc.Splash { diff --git a/public/Nitrocid/Misc/Splash/SplashManager.cs b/public/Nitrocid/Misc/Splash/SplashManager.cs index e1afc1495b..27aaf8d03a 100644 --- a/public/Nitrocid/Misc/Splash/SplashManager.cs +++ b/public/Nitrocid/Misc/Splash/SplashManager.cs @@ -31,6 +31,7 @@ using Nitrocid.Languages; using Nitrocid.Misc.Splash.Splashes; using Terminaux.Base; +using Terminaux.Colors; namespace Nitrocid.Misc.Splash { @@ -204,7 +205,8 @@ public static void OpenSplash(ISplash splash, SplashContext context) ScreenTools.SetCurrent(splashScreen); // Finally, render it - ScreenTools.Render(true); + ColorTools.LoadBack(); + ScreenTools.Render(); // Render the display SplashThread.Stop(); diff --git a/public/Nitrocid/Misc/Splash/Splashes/Welcome.cs b/public/Nitrocid/Misc/Splash/Splashes/Welcome.cs index 90c0e94eee..c6a3500cf7 100644 --- a/public/Nitrocid/Misc/Splash/Splashes/Welcome.cs +++ b/public/Nitrocid/Misc/Splash/Splashes/Welcome.cs @@ -19,7 +19,7 @@ using System.Threading; using Terminaux.Colors; -using Textify.Sequences.Tools; +using Terminaux.Sequences; using Figletize; using System; using System.Text; @@ -33,6 +33,8 @@ using Terminaux.Base; using Terminaux.Colors.Data; using Nitrocid.Kernel.Configuration; +using Terminaux.Colors.Transformation.Contrast; +using Terminaux.Base.Extensions; namespace Nitrocid.Misc.Splash.Splashes { @@ -121,7 +123,7 @@ public override string Display(SplashContext context) $"{fifthDotColor.VTSequenceForeground}*"; int dotsPosX = ConsoleWrapper.WindowWidth / 2 - VtSequenceTools.FilterVTSequences(dots).Length / 2; int dotsPosY = ConsoleWrapper.WindowHeight - 2; - builder.Append(TextWriterWhereColor.RenderWherePlain(dots, dotsPosX, dotsPosY)); + builder.Append(TextWriterWhereColor.RenderWhere(dots, dotsPosX, dotsPosY)); if (!noAppend) { dotStep++; @@ -199,7 +201,7 @@ private string ReportProgress(int Progress, string ProgressReport, KernelColorTy int consoleY = ConsoleWrapper.WindowHeight / 2 - figHeight; builder.Append( col.VTSequenceForeground + - TextWriterWhereColor.RenderWherePlain(ConsoleExtensions.GetClearLineToRightSequence(), 0, consoleY - 2, true, Vars) + + TextWriterWhereColor.RenderWhere(ConsoleClearing.GetClearLineToRightSequence(), 0, consoleY - 2, true, Vars) + CenteredTextColor.RenderCenteredOneLine(consoleY - 2, $"{Progress}% - {ProgressReport}", Vars) ); return builder.ToString(); diff --git a/public/Nitrocid/Network/Connections/NetworkConnectionSelector.cs b/public/Nitrocid/Network/Connections/NetworkConnectionSelector.cs index a136c2fab1..2fd347ef93 100644 --- a/public/Nitrocid/Network/Connections/NetworkConnectionSelector.cs +++ b/public/Nitrocid/Network/Connections/NetworkConnectionSelector.cs @@ -45,7 +45,7 @@ internal static int ConnectionSelector(string connectionType) } return SelectionStyle.PromptSelection(Translate.DoTranslation("Select a connection. If you have no connections, you'll have to create a new connection. Additionally, you can use the speed dial feature to quickly connect to servers."), - connectionsChoiceList, [ + [.. connectionsChoiceList], [ new InputChoiceInfo($"{connectionNames.Length + 1}", Translate.DoTranslation("Create a new connection")), new InputChoiceInfo($"{connectionNames.Length + 2}", Translate.DoTranslation("Use speed dial")), ] diff --git a/public/Nitrocid/Network/Connections/NetworkConnectionTools.cs b/public/Nitrocid/Network/Connections/NetworkConnectionTools.cs index ad4f7093a3..abdece9a21 100644 --- a/public/Nitrocid/Network/Connections/NetworkConnectionTools.cs +++ b/public/Nitrocid/Network/Connections/NetworkConnectionTools.cs @@ -444,7 +444,7 @@ public static void OpenConnectionForShell(string shellType, Func - - + + - + - - - - - + + + + + diff --git a/public/Nitrocid/Shell/ShellBase/Commands/CancellationHandlers.cs b/public/Nitrocid/Shell/ShellBase/Commands/CancellationHandlers.cs index 5f541826e2..9aeec21ff1 100644 --- a/public/Nitrocid/Shell/ShellBase/Commands/CancellationHandlers.cs +++ b/public/Nitrocid/Shell/ShellBase/Commands/CancellationHandlers.cs @@ -78,7 +78,7 @@ internal static void CancelCommand(object sender, ConsoleCancelEventArgs e) { DebugWriter.WriteDebug(DebugLevel.I, "Locking to cancel..."); CancelRequested = true; - TextWriterColor.Write(); + TextWriterRaw.Write(); DriverHandler.SetDriver("Null"); cts.Cancel(); ProcessStartCommandThread.Stop(); diff --git a/public/Nitrocid/Shell/ShellBase/Shells/ShellManager.cs b/public/Nitrocid/Shell/ShellBase/Shells/ShellManager.cs index d2667cc626..0890964007 100644 --- a/public/Nitrocid/Shell/ShellBase/Shells/ShellManager.cs +++ b/public/Nitrocid/Shell/ShellBase/Shells/ShellManager.cs @@ -63,6 +63,7 @@ using Textify.General; using Terminaux.Base; using Nitrocid.ConsoleBase.Inputs; +using Terminaux.Base.Extensions; namespace Nitrocid.Shell.ShellBase.Shells { @@ -455,7 +456,7 @@ public static void GetLine(string FullCommand, string OutputPath = "", string Sh { // Set title if (Config.MainConfig.SetTitleOnCommandExecution) - ConsoleExtensions.SetTitle($"{KernelReleaseInfo.ConsoleTitle} - {Command}"); + ConsoleMisc.SetTitle($"{KernelReleaseInfo.ConsoleTitle} - {Command}"); // Check the command bool exists = Commands.Any((ci) => ci.Command == commandName || ci.Aliases.Any((ai) => ai.Alias == commandName)); @@ -617,7 +618,7 @@ public static void GetLine(string FullCommand, string OutputPath = "", string Sh } // Restore title and cancel possibility state - ConsoleExtensions.SetTitle(KernelReleaseInfo.ConsoleTitle); + ConsoleMisc.SetTitle(KernelReleaseInfo.ConsoleTitle); CancellationHandlers.InhibitCancel(); lastCommand = FullCommand; } @@ -871,7 +872,7 @@ internal static void StartShellInternal(string ShellType, params object[] ShellA histories.Add(ShellType, []); // Reset title in case we're going to another shell - ConsoleExtensions.SetTitle(KernelReleaseInfo.ConsoleTitle); + ConsoleMisc.SetTitle(KernelReleaseInfo.ConsoleTitle); ShellExecute.InitializeShell(ShellArgs); } catch (Exception ex) diff --git a/public/Nitrocid/Shell/Shells/Admin/Commands/UserInfo.cs b/public/Nitrocid/Shell/Shells/Admin/Commands/UserInfo.cs index b747b72190..7df6e374fe 100644 --- a/public/Nitrocid/Shell/Shells/Admin/Commands/UserInfo.cs +++ b/public/Nitrocid/Shell/Shells/Admin/Commands/UserInfo.cs @@ -54,13 +54,13 @@ public override int Execute(CommandParameters parameters, ref string variableVal TextWriters.Write(user.PreferredLanguage, true, KernelColorType.ListValue); TextWriters.Write(Translate.DoTranslation("Flags") + ": ", false, KernelColorType.ListEntry); TextWriters.Write(string.Join(", ", user.Flags), true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); // Now, the permissions. TextFancyWriters.WriteSeparator(Translate.DoTranslation("Permissions"), true, KernelColorType.ListTitle); foreach (string perm in user.Permissions) TextWriters.Write($" - {perm}", true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); // Now, the groups. TextFancyWriters.WriteSeparator(Translate.DoTranslation("Groups"), true, KernelColorType.ListTitle); diff --git a/public/Nitrocid/Shell/Shells/Debug/Commands/KeyInfo.cs b/public/Nitrocid/Shell/Shells/Debug/Commands/KeyInfo.cs index ac38cc355b..6a8b248412 100644 --- a/public/Nitrocid/Shell/Shells/Debug/Commands/KeyInfo.cs +++ b/public/Nitrocid/Shell/Shells/Debug/Commands/KeyInfo.cs @@ -24,6 +24,7 @@ using Nitrocid.ConsoleBase.Colors; using Terminaux.Writer.ConsoleWriters; using Terminaux.Inputs; +using Terminaux.Reader; namespace Nitrocid.Shell.Shells.Debug.Commands { @@ -39,7 +40,7 @@ class KeyInfoCommand : BaseCommand, ICommand public override int Execute(CommandParameters parameters, ref string variableValue) { TextWriterColor.Write(Translate.DoTranslation("Enter a key or a combination of keys to display its information.")); - var KeyPress = Input.DetectKeypress(); + var KeyPress = TermReader.ReadKey(); // Pressed key TextWriters.Write("- " + Translate.DoTranslation("Pressed key") + ": ", false, KernelColorType.ListEntry); diff --git a/public/Nitrocid/Shell/Shells/Text/Commands/QueryChar.cs b/public/Nitrocid/Shell/Shells/Text/Commands/QueryChar.cs index 2dcfd301e1..8d45d0fbe8 100644 --- a/public/Nitrocid/Shell/Shells/Text/Commands/QueryChar.cs +++ b/public/Nitrocid/Shell/Shells/Text/Commands/QueryChar.cs @@ -59,7 +59,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal char Character = text[charIndex]; TextWriters.Write($"{(QueriedChars.Contains(charIndex) ? KernelColorTools.GetColor(KernelColorType.Success).VTSequenceForeground : "")}{Character}", false, KernelColorType.ListValue); } - TextWriterColor.Write(); + TextWriterRaw.Write(); return 0; } else @@ -84,7 +84,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal char Character = text[charIndex]; TextWriters.Write($"{(queried.Contains(charIndex) ? KernelColorTools.GetColor(KernelColorType.Success).VTSequenceForeground : "")}{Character}", false, KernelColorType.ListValue); } - TextWriterColor.Write(); + TextWriterRaw.Write(); } return 0; } @@ -111,7 +111,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal char Character = text[charIndex]; TextWriters.Write($"{(QueriedChars.Contains(charIndex) ? KernelColorTools.GetColor(KernelColorType.Success).VTSequenceForeground : "")}{Character}", false, KernelColorType.ListValue); } - TextWriterColor.Write(); + TextWriterRaw.Write(); } return 0; } diff --git a/public/Nitrocid/Shell/Shells/Text/Commands/QueryWord.cs b/public/Nitrocid/Shell/Shells/Text/Commands/QueryWord.cs index ee091020e2..b9578a840a 100644 --- a/public/Nitrocid/Shell/Shells/Text/Commands/QueryWord.cs +++ b/public/Nitrocid/Shell/Shells/Text/Commands/QueryWord.cs @@ -59,7 +59,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal string word = Words[wordIndex]; TextWriters.Write($"{(QueriedChars.Contains(wordIndex) ? KernelColorTools.GetColor(KernelColorType.Success).VTSequenceForeground : "")}{word} ", false, KernelColorType.ListValue); } - TextWriterColor.Write(); + TextWriterRaw.Write(); return 0; } else @@ -85,7 +85,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal string word = Words[wordIndex]; TextWriters.Write($"{(QueriedChars.Contains(wordIndex) ? KernelColorTools.GetColor(KernelColorType.Success).VTSequenceForeground : "")}{word} ", false, KernelColorType.ListValue); } - TextWriterColor.Write(); + TextWriterRaw.Write(); } return 0; } @@ -113,7 +113,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal string word = Words[wordIndex]; TextWriters.Write($"{(QueriedChars.Contains(wordIndex) ? KernelColorTools.GetColor(KernelColorType.Success).VTSequenceForeground : "")}{word} ", false, KernelColorType.ListValue); } - TextWriterColor.Write(); + TextWriterRaw.Write(); } return 0; } diff --git a/public/Nitrocid/Shell/Shells/Text/Commands/QueryWordRegex.cs b/public/Nitrocid/Shell/Shells/Text/Commands/QueryWordRegex.cs index be36eb5763..93491e1619 100644 --- a/public/Nitrocid/Shell/Shells/Text/Commands/QueryWordRegex.cs +++ b/public/Nitrocid/Shell/Shells/Text/Commands/QueryWordRegex.cs @@ -59,7 +59,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal string word = Words[wordIndex]; TextWriters.Write($"{(QueriedChars.Contains(wordIndex) ? KernelColorTools.GetColor(KernelColorType.Success).VTSequenceForeground : "")}{word} ", false, KernelColorType.ListValue); } - TextWriterColor.Write(); + TextWriterRaw.Write(); return 0; } else @@ -85,7 +85,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal string word = Words[wordIndex]; TextWriters.Write($"{(QueriedChars.Contains(wordIndex) ? KernelColorTools.GetColor(KernelColorType.Success).VTSequenceForeground : "")}{word} ", false, KernelColorType.ListValue); } - TextWriterColor.Write(); + TextWriterRaw.Write(); } return 0; } @@ -113,7 +113,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal string word = Words[wordIndex]; TextWriters.Write($"{(QueriedChars.Contains(wordIndex) ? KernelColorTools.GetColor(KernelColorType.Success).VTSequenceForeground : "")}{word} ", false, KernelColorType.ListValue); } - TextWriterColor.Write(); + TextWriterRaw.Write(); } return 0; } diff --git a/public/Nitrocid/Shell/Shells/UESH/Commands/FileInfo.cs b/public/Nitrocid/Shell/Shells/UESH/Commands/FileInfo.cs index 68a6faab45..8569193f12 100644 --- a/public/Nitrocid/Shell/Shells/UESH/Commands/FileInfo.cs +++ b/public/Nitrocid/Shell/Shells/UESH/Commands/FileInfo.cs @@ -71,7 +71,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal var Style = LineEndingsTools.GetLineEndingFromFile(FilePath); TextWriterColor.Write(Translate.DoTranslation("Newline style:") + " {0}", Style.ToString()); } - TextWriterColor.Write(); + TextWriterRaw.Write(); // .NET managed info SeparatorWriterColor.WriteSeparator(Translate.DoTranslation(".NET assembly info"), true); @@ -87,7 +87,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal { TextWriterColor.Write(Translate.DoTranslation("File is not a valid .NET assembly.")); } - TextWriterColor.Write(); + TextWriterRaw.Write(); // Other info handled by the extension handler SeparatorWriterColor.WriteSeparator(Translate.DoTranslation("Extra info"), true); diff --git a/public/Nitrocid/Shell/Shells/UESH/Commands/Input.cs b/public/Nitrocid/Shell/Shells/UESH/Commands/Input.cs index 69964bef08..d0440576ed 100644 --- a/public/Nitrocid/Shell/Shells/UESH/Commands/Input.cs +++ b/public/Nitrocid/Shell/Shells/UESH/Commands/Input.cs @@ -19,6 +19,7 @@ using Terminaux.Inputs.Styles; using Nitrocid.Shell.ShellBase.Commands; +using Terminaux.Reader; namespace Nitrocid.Shell.Shells.UESH.Commands { @@ -33,7 +34,7 @@ class InputCommand : BaseCommand, ICommand public override int Execute(CommandParameters parameters, ref string variableValue) { - string Answer = InputStyle.PromptInput(parameters.ArgumentsList[0]); + string Answer = TermReader.Read(parameters.ArgumentsList[0]); variableValue = Answer; return 0; } diff --git a/public/Nitrocid/Shell/Shells/UESH/Commands/InputPass.cs b/public/Nitrocid/Shell/Shells/UESH/Commands/InputPass.cs index d08aa82db7..e5faed680d 100644 --- a/public/Nitrocid/Shell/Shells/UESH/Commands/InputPass.cs +++ b/public/Nitrocid/Shell/Shells/UESH/Commands/InputPass.cs @@ -19,6 +19,7 @@ using Terminaux.Inputs.Styles; using Nitrocid.Shell.ShellBase.Commands; +using Terminaux.Reader; namespace Nitrocid.Shell.Shells.UESH.Commands { @@ -33,7 +34,7 @@ class InputPassCommand : BaseCommand, ICommand public override int Execute(CommandParameters parameters, ref string variableValue) { - string Answer = InputStyle.PromptInputPassword(parameters.ArgumentsList[0]); + string Answer = TermReader.ReadPassword(parameters.ArgumentsList[0]); variableValue = Answer; return 0; } diff --git a/public/Nitrocid/Shell/Shells/UESH/Commands/SaveScreen.cs b/public/Nitrocid/Shell/Shells/UESH/Commands/SaveScreen.cs index abc6353458..c22aa4fb11 100644 --- a/public/Nitrocid/Shell/Shells/UESH/Commands/SaveScreen.cs +++ b/public/Nitrocid/Shell/Shells/UESH/Commands/SaveScreen.cs @@ -25,6 +25,7 @@ using Nitrocid.Shell.ShellBase.Switches; using System.Linq; using Terminaux.Inputs; +using Terminaux.Reader; namespace Nitrocid.Shell.Shells.UESH.Commands { @@ -86,7 +87,7 @@ private void PressAndBailHelper() { if (ScreensaverManager.inSaver) { - Input.DetectKeypress(); + TermReader.ReadKey(); ScreensaverDisplayer.BailFromScreensaver(); } } diff --git a/public/Nitrocid/Shell/Shells/UESH/Commands/ShowNotifs.cs b/public/Nitrocid/Shell/Shells/UESH/Commands/ShowNotifs.cs index 7afde79bf0..aacee29196 100644 --- a/public/Nitrocid/Shell/Shells/UESH/Commands/ShowNotifs.cs +++ b/public/Nitrocid/Shell/Shells/UESH/Commands/ShowNotifs.cs @@ -48,7 +48,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal { TextWriters.Write($" ({Notif.Progress}%)", false, Notif.ProgressState == NotificationProgressState.Failure ? KernelColorType.Error : KernelColorType.Success); } - TextWriterColor.Write(); + TextWriterRaw.Write(); Count += 1; } } diff --git a/public/Nitrocid/Shell/Shells/UESH/Commands/SumFiles.cs b/public/Nitrocid/Shell/Shells/UESH/Commands/SumFiles.cs index 43c7e2b2ff..52ad4377f9 100644 --- a/public/Nitrocid/Shell/Shells/UESH/Commands/SumFiles.cs +++ b/public/Nitrocid/Shell/Shells/UESH/Commands/SumFiles.cs @@ -105,7 +105,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal TextWriters.Write(Translate.DoTranslation("Invalid encryption algorithm."), true, KernelColorType.Error); return KernelExceptionTools.GetErrorCode(KernelExceptionType.Encryption); } - TextWriterColor.Write(); + TextWriterRaw.Write(); } if (!string.IsNullOrEmpty(@out)) { diff --git a/public/Nitrocid/Shell/Shells/UESH/Commands/SysInfo.cs b/public/Nitrocid/Shell/Shells/UESH/Commands/SysInfo.cs index d36e521402..67f362e52a 100644 --- a/public/Nitrocid/Shell/Shells/UESH/Commands/SysInfo.cs +++ b/public/Nitrocid/Shell/Shells/UESH/Commands/SysInfo.cs @@ -79,7 +79,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal TextWriters.Write(KernelPlatform.IsOnUsualEnvironment().ToString(), true, KernelColorType.ListValue); TextWriters.Write(Translate.DoTranslation("Safe Mode:") + " ", false, KernelColorType.ListEntry); TextWriters.Write(KernelEntry.SafeMode.ToString(), true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); } if (ShowHardwareInfo) @@ -92,7 +92,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal TextWriters.Write(Translate.DoTranslation("You'll need to restart the kernel as elevated in order to be able to show hardware information."), true, KernelColorType.Error); else TextWriters.Write(Translate.DoTranslation("Use \"hwinfo\" for extended information about hardware."), true, KernelColorType.Tip); - TextWriterColor.Write(); + TextWriterRaw.Write(); } if (ShowUserInfo) @@ -105,7 +105,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal TextWriters.Write(NetworkTools.HostName, true, KernelColorType.ListValue); TextWriters.Write(Translate.DoTranslation("Available usernames:") + " ", false, KernelColorType.ListEntry); TextWriters.Write(string.Join(", ", UserManagement.ListAllUsers()), true, KernelColorType.ListValue); - TextWriterColor.Write(); + TextWriterRaw.Write(); } if (ShowMessageOfTheDay) @@ -113,7 +113,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal // Show MOTD TextFancyWriters.WriteSeparator("MOTD", true, KernelColorType.Separator); TextWriters.Write(PlaceParse.ProbePlaces(MotdParse.MotdMessage), true, KernelColorType.NeutralText); - TextWriterColor.Write(); + TextWriterRaw.Write(); } if (ShowMal) diff --git a/public/Nitrocid/Shell/Shells/UESH/Commands/ThemePrev.cs b/public/Nitrocid/Shell/Shells/UESH/Commands/ThemePrev.cs index c0afa8629d..aa4100461e 100644 --- a/public/Nitrocid/Shell/Shells/UESH/Commands/ThemePrev.cs +++ b/public/Nitrocid/Shell/Shells/UESH/Commands/ThemePrev.cs @@ -67,7 +67,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal ); themeCategoryChoices.Add(ici); } - int categoryIndex = SelectionStyle.PromptSelection(Translate.DoTranslation("Select a category"), themeCategoryChoices, themeCategoryAltChoices) - 1; + int categoryIndex = SelectionStyle.PromptSelection(Translate.DoTranslation("Select a category"), [.. themeCategoryChoices], [.. themeCategoryAltChoices]) - 1; // If the color index is -2, exit. PromptSelection returns -1 if ESC is pressed to cancel selecting. However, the index just decreases to -2 // even if that PromptSelection returned the abovementioned value, so bail if index is -2 @@ -96,7 +96,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal ); themeChoices.Add(ici); } - int colorIndex = SelectionStyle.PromptSelection(Translate.DoTranslation("Select a theme"), themeChoices, themeAltChoices) - 1; + int colorIndex = SelectionStyle.PromptSelection(Translate.DoTranslation("Select a theme"), [.. themeChoices], [.. themeAltChoices]) - 1; // If the color index is -2, exit. PromptSelection returns -1 if ESC is pressed to cancel selecting. However, the index just decreases to -2 // even if that PromptSelection returned the abovementioned value, so bail if index is -2 diff --git a/public/Nitrocid/Shell/Shells/UESH/Commands/ThemeSet.cs b/public/Nitrocid/Shell/Shells/UESH/Commands/ThemeSet.cs index 41c7a62ba1..54dd5d4a79 100644 --- a/public/Nitrocid/Shell/Shells/UESH/Commands/ThemeSet.cs +++ b/public/Nitrocid/Shell/Shells/UESH/Commands/ThemeSet.cs @@ -75,7 +75,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal ); themeCategoryChoices.Add(ici); } - int categoryIndex = SelectionStyle.PromptSelection(Translate.DoTranslation("Select a category"), themeCategoryChoices, themeCategoryAltChoices) - 1; + int categoryIndex = SelectionStyle.PromptSelection(Translate.DoTranslation("Select a category"), [.. themeCategoryChoices], [.. themeCategoryAltChoices]) - 1; // If the color index is -2, exit. PromptSelection returns -1 if ESC is pressed to cancel selecting. However, the index just decreases to -2 // even if that PromptSelection returned the abovementioned value, so bail if index is -2 @@ -104,7 +104,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal ); themeChoices.Add(ici); } - int colorIndex = SelectionStyle.PromptSelection(Translate.DoTranslation("Select a theme"), themeChoices, themeAltChoices) - 1; + int colorIndex = SelectionStyle.PromptSelection(Translate.DoTranslation("Select a theme"), [.. themeChoices], [.. themeAltChoices]) - 1; // If the color index is -2, exit. PromptSelection returns -1 if ESC is pressed to cancel selecting. However, the index just decreases to -2 // even if that PromptSelection returned the abovementioned value, so bail if index is -2 @@ -136,7 +136,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal // Now, preview the theme ThemePreviewTools.PreviewThemeSimple(Theme); - TextWriterColor.Write(); + TextWriterRaw.Write(); // Pause until a key is pressed answer = ChoiceStyle.PromptChoice( diff --git a/public/Nitrocid/Users/Login/Handlers/Logins/ModernLogin.cs b/public/Nitrocid/Users/Login/Handlers/Logins/ModernLogin.cs index 87a2d25066..2fcf9bf253 100644 --- a/public/Nitrocid/Users/Login/Handlers/Logins/ModernLogin.cs +++ b/public/Nitrocid/Users/Login/Handlers/Logins/ModernLogin.cs @@ -31,6 +31,7 @@ using Terminaux.Inputs; using System; using Nitrocid.Kernel.Power; +using Terminaux.Reader; namespace Nitrocid.Users.Login.Handlers.Logins { @@ -50,7 +51,7 @@ public override bool LoginScreen() DebugWriter.WriteDebug(DebugLevel.I, "Rendering..."); SpinWait.SpinUntil(() => ModernLogonScreen.renderedFully); DebugWriter.WriteDebug(DebugLevel.I, "Rendered fully!"); - var key = Input.DetectKeypress().Key; + var key = TermReader.ReadKey().Key; // Stop the thread ModernLogonScreen.DateTimeUpdateThread.Stop(); diff --git a/public/Nitrocid/Users/Login/ModernLogonScreen.cs b/public/Nitrocid/Users/Login/ModernLogonScreen.cs index 6cde0506b9..db1745cd4d 100644 --- a/public/Nitrocid/Users/Login/ModernLogonScreen.cs +++ b/public/Nitrocid/Users/Login/ModernLogonScreen.cs @@ -21,7 +21,7 @@ using System; using Figletize; using System.Text; -using Textify.Sequences.Builder.Types; +using Terminaux.Sequences.Builder.Types; using Nitrocid.Kernel.Configuration; using Nitrocid.Kernel.Time; using Nitrocid.Kernel.Debugging;