mirror of
https://github.com/FalloutCollaborationProject/FCP-Mod-Updater.git
synced 2026-07-27 17:04:05 -07:00
Change update notice rendering
This commit is contained in:
@@ -9,12 +9,22 @@ public static class AppUpdateNoticeRenderer
|
|||||||
public static void Render(UpdateCheckResult updateResult)
|
public static void Render(UpdateCheckResult updateResult)
|
||||||
{
|
{
|
||||||
var label = updateResult.IsPrerelease ? "Pre-release available" : "Update available";
|
var label = updateResult.IsPrerelease ? "Pre-release available" : "Update available";
|
||||||
|
var updateCommand = GetUpdateCommand();
|
||||||
|
var content = new Rows(
|
||||||
|
new Markup(
|
||||||
|
$"[yellow bold]{label}: v{Markup.Escape(updateResult.LatestVersion)}[/] [Grey66](current: [/][Grey66 dim bold]{Markup.Escape(updateResult.CurrentVersion)}[/][Grey66])[/]"),
|
||||||
|
new Markup($"[Grey66]Close this app before updating and run:[/] [underline]{Markup.Escape(updateCommand)}[/]"),
|
||||||
|
new Markup($"[Grey66]Manual download:[/] [link]{Markup.Escape(updateResult.ReleaseUrl)}[/]"));
|
||||||
|
|
||||||
AnsiConsole.MarkupLine(
|
var panel = new Panel(content)
|
||||||
$"[yellow bold]{label}: v{updateResult.LatestVersion}[/] [grey](current: {updateResult.CurrentVersion})[/]");
|
{
|
||||||
AnsiConsole.MarkupLine("[grey]Close this app before updating.[/]");
|
Border = BoxBorder.Square,
|
||||||
AnsiConsole.MarkupLine($"[grey]Run: {GetUpdateCommand()}[/]");
|
BorderStyle = new Style(Color.Grey, null, Decoration.Dim)
|
||||||
AnsiConsole.MarkupLine($"[grey]Manual download: {updateResult.ReleaseUrl}[/]");
|
};
|
||||||
|
panel.Padding = new Padding(1, 0, 1, 0);
|
||||||
|
panel.Expand = false;
|
||||||
|
|
||||||
|
AnsiConsole.Write(panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetUpdateCommand()
|
private static string GetUpdateCommand()
|
||||||
|
|||||||
Reference in New Issue
Block a user