Skip to content

Commit

Permalink
Fixed HTML renderer
Browse files Browse the repository at this point in the history
Added OS info to ImGUI
  • Loading branch information
Aragas committed Sep 27, 2024
1 parent 99e70c6 commit b9a14c7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/BUTR.CrashReport.Renderer.Html/CrashReportHtml.Html.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Most likely this error was caused by a custom installed module.
If you were in the middle of something, the progress might be lost.
<br />
<br />
Operating System: {{crashReport.Metadata.OperatingSystemType}} ({{crashReport.Metadata.OperatingSystemVersion}})
Operating System: {{crashReport.Metadata.OperatingSystemType.ToString()}} ({{crashReport.Metadata.OperatingSystemVersion}})
Launcher: {{crashReport.Metadata.LauncherType}} ({{crashReport.Metadata.LauncherVersion}})
<br />
Runtime: {{crashReport.Metadata.Runtime}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

partial class ImGuiRenderer
{
private static readonly byte[][] _operatingSystemTypeNames =
[
"Unknown"u8.ToArray(), // Unknown
"Windows"u8.ToArray(), // Windows
"Linux"u8.ToArray(), // Linux
"MacOS"u8.ToArray(), // MacOS
];

private bool _addScreenshots;
private bool _addLatestSave;
private bool _addMiniDump;
Expand Down Expand Up @@ -67,6 +75,12 @@ private void RenderSummary()
_imgui.Text("If you were in the middle of something, the progress might be lost.\0"u8);

_imgui.NewLine();

_imgui.TextSameLine("Operating System: \0"u8);
_imgui.TextSameLine(_operatingSystemTypeNames[(int) _crashReport.Metadata.OperatingSystemType]);
_imgui.TextSameLine(" (\0"u8);
_imgui.TextSameLine(_crashReport.Metadata.OperatingSystemVersion ?? string.Empty);
_imgui.Text(")\0"u8);

_imgui.TextSameLine("Launcher: \0"u8);
_imgui.TextSameLine(_crashReport.Metadata.LauncherType ?? string.Empty);
Expand Down

0 comments on commit b9a14c7

Please sign in to comment.