diff --git a/GRILO.Bootloader/BootApps/BootManager.cs b/GRILO.Bootloader/BootApps/BootManager.cs index ec07273..2a4e905 100644 --- a/GRILO.Bootloader/BootApps/BootManager.cs +++ b/GRILO.Bootloader/BootApps/BootManager.cs @@ -32,6 +32,7 @@ using System.Linq; using GRILO.Bootloader.Diagnostics; using GRILO.Bootloader.Configuration; +using Terminaux.Writer.ConsoleWriters; namespace GRILO.Bootloader.BootApps { @@ -145,7 +146,7 @@ public static void PopulateBootApps() // Either the boot file is invalid or can't be loaded. DiagnosticsWriter.WriteDiag(DiagnosticsLevel.Error, "Can't load boot app. {0}", ex.Message); DiagnosticsWriter.WriteDiag(DiagnosticsLevel.Error, "Stack trace:\n{0}", ex.StackTrace); - throw new GRILOException($"Failed to parse boot file {bootFile}: {ex.Message}", ex); + TextWriterColor.Write($"Failed to parse boot file {bootFile}: {ex.Message}"); } } } @@ -154,7 +155,7 @@ public static void PopulateBootApps() // Boot ID invalid DiagnosticsWriter.WriteDiag(DiagnosticsLevel.Error, "Unknown error when loading boot ID {0}: {1}", bootId, ex.Message); DiagnosticsWriter.WriteDiag(DiagnosticsLevel.Error, "Stack trace:\n{0}", ex.StackTrace); - throw new GRILOException($"Unknown error when parsing boot ID {bootId}: {ex.Message}", ex); + TextWriterColor.Write($"Unknown error when parsing boot ID {bootId}: {ex.Message}"); } } } diff --git a/GRILO.Bootloader/BootStyle/Styles/DefaultBootStyle.cs b/GRILO.Bootloader/BootStyle/Styles/DefaultBootStyle.cs index add6edf..392fe45 100644 --- a/GRILO.Bootloader/BootStyle/Styles/DefaultBootStyle.cs +++ b/GRILO.Bootloader/BootStyle/Styles/DefaultBootStyle.cs @@ -99,10 +99,10 @@ public override void RenderModalDialog(string content) } public override void RenderBootingMessage(string chosenBootName) => - TextWriterColor.Write("Booting {0}...", true, chosenBootName); + TextWriterColor.Write("Booting {0}...", chosenBootName); public override void RenderBootFailedMessage(string content) => - TextWriterColor.Write(content, true); + TextWriterColor.Write(content); public override void RenderSelectTimeout(int timeout) => TextWriterWhereColor.WriteWhere($"{timeout} ", 2, Console.WindowHeight - 2, true, new Color(ConsoleColor.White)); diff --git a/GRILO.Bootloader/BootStyle/Styles/StandardBootStyle.cs b/GRILO.Bootloader/BootStyle/Styles/StandardBootStyle.cs index 558d83f..e8a9dc4 100644 --- a/GRILO.Bootloader/BootStyle/Styles/StandardBootStyle.cs +++ b/GRILO.Bootloader/BootStyle/Styles/StandardBootStyle.cs @@ -50,7 +50,7 @@ public override void Render() { string bootApp = BootManager.GetBootAppNameByIndex(i); bootEntryPositions.Add((Console.CursorLeft, Console.CursorTop)); - TextWriterColor.Write(" [{0}] {1}", true, new Color(bootEntry), i + 1, bootApp); + TextWriterColor.Write(" [{0}] {1}", true, new Color(bootEntry), vars: new object[] { i + 1, bootApp }); } } @@ -61,7 +61,7 @@ public override void RenderHighlight(int chosenBootEntry) // Highlight the chosen entry string bootApp = BootManager.GetBootAppNameByIndex(chosenBootEntry); - TextWriterWhereColor.WriteWhere(" [{0}] {1}", bootEntryPositions[chosenBootEntry].Item1, bootEntryPositions[chosenBootEntry].Item2, new Color(highlightedEntry), chosenBootEntry + 1, bootApp); + TextWriterWhereColor.WriteWhere(" [{0}] {1}", bootEntryPositions[chosenBootEntry].Item1, bootEntryPositions[chosenBootEntry].Item2, new Color(highlightedEntry), vars: new object[] { chosenBootEntry + 1, bootApp }); } public override void RenderModalDialog(string content) @@ -73,7 +73,7 @@ public override void RenderModalDialog(string content) Console.Clear(); } - public override void RenderBootingMessage(string chosenBootName) => TextWriterColor.Write("Booting {0}...", true, chosenBootName); + public override void RenderBootingMessage(string chosenBootName) => TextWriterColor.Write("Booting {0}...", chosenBootName); public override void RenderBootFailedMessage(string content) => RenderModalDialog(content);