Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
fix - reg - Fixed major glitches related to Color
Browse files Browse the repository at this point in the history
We've fixed major glitches related to coloring

---

Colors and variables should work perfectly.

---

Type: fix
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Aug 6, 2023
1 parent e43209e commit a6c7b8b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions GRILO.Bootloader/BootApps/BootManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using System.Linq;
using GRILO.Bootloader.Diagnostics;
using GRILO.Bootloader.Configuration;
using Terminaux.Writer.ConsoleWriters;

namespace GRILO.Bootloader.BootApps
{
Expand Down Expand Up @@ -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}");
}
}
}
Expand All @@ -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}");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions GRILO.Bootloader/BootStyle/Styles/DefaultBootStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
6 changes: 3 additions & 3 deletions GRILO.Bootloader/BootStyle/Styles/StandardBootStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
}

Expand All @@ -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)
Expand All @@ -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);

Expand Down

0 comments on commit a6c7b8b

Please sign in to comment.