Skip to content

Commit

Permalink
Merge pull request #418 from BUTR/code-formatting/fix-codeformatting
Browse files Browse the repository at this point in the history
Automated PR to fix formatting errors
  • Loading branch information
Aragas authored Oct 5, 2024
2 parents 7e540cf + 3e3ca16 commit 7acb549
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ internal static bool Disable(Harmony harmony)

private static readonly Patch[] Patches =
[
new PrefixPatch(nameof(AddBasicTypeDefinitionPrefix), TargetTypeMethod("AddBasicTypeDefinition")),
new PrefixPatch(nameof(AddClassDefinitionPrefix), TargetTypeMethod("AddClassDefinition")),
new PrefixPatch(nameof(AddContainerDefinitionPrefix), TargetTypeMethod("AddContainerDefinition")),
new PrefixPatch(nameof(AddEnumDefinitionPrefix), TargetTypeMethod("AddEnumDefinition")),
new PrefixPatch(nameof(AddGenericClassDefinitionPrefix), TargetTypeMethod("AddGenericClassDefinition")),
new PrefixPatch(nameof(AddBasicTypeDefinitionPrefix), TargetTypeMethod("AddBasicTypeDefinition")),
new PrefixPatch(nameof(AddClassDefinitionPrefix), TargetTypeMethod("AddClassDefinition")),
new PrefixPatch(nameof(AddContainerDefinitionPrefix), TargetTypeMethod("AddContainerDefinition")),
new PrefixPatch(nameof(AddEnumDefinitionPrefix), TargetTypeMethod("AddEnumDefinition")),
new PrefixPatch(nameof(AddGenericClassDefinitionPrefix), TargetTypeMethod("AddGenericClassDefinition")),
new PrefixPatch(nameof(AddGenericStructDefinitionPrefix), TargetTypeMethod("AddGenericStructDefinition")),
new PrefixPatch(nameof(AddInterfaceDefinitionPrefix), TargetTypeMethod("AddInterfaceDefinition")),
new PrefixPatch(nameof(AddRootClassDefinitionPrefix), TargetTypeMethod("AddRootClassDefinition")),
new PrefixPatch(nameof(AddStructDefinitionPrefix), TargetTypeMethod("AddStructDefinition")),
new PrefixPatch(nameof(AddInterfaceDefinitionPrefix), TargetTypeMethod("AddInterfaceDefinition")),
new PrefixPatch(nameof(AddRootClassDefinitionPrefix), TargetTypeMethod("AddRootClassDefinition")),
new PrefixPatch(nameof(AddStructDefinitionPrefix), TargetTypeMethod("AddStructDefinition")),
new ConstructContainerDefinitionPrefixPatch()
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
using HarmonyLib;
using HarmonyLib.BUTR.Extensions;

using JetBrains.Annotations;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Security;
using JetBrains.Annotations;

namespace Bannerlord.ButterLib.ExceptionHandler;

Expand Down
32 changes: 16 additions & 16 deletions src/Bannerlord.ButterLib/ExceptionHandler/ExceptionReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,29 @@ public static void Show(Exception exception)
var harmonyProvider = new HarmonyProvider();
var crashReportRendererUtilities = new CrashReportRendererUtilities();

var crashReport = CrashReportInfo.Create(exception, metadata, filter, helper, helper, helper, harmonyProvider);
var crashReportModel = CrashReportInfo.ToModel(crashReport, helper, helper, helper, helper, helper, helper);
var logSources = GetLogSources().ToArray();
var crashReport = CrashReportInfo.Create(exception, metadata, filter, helper, helper, helper, harmonyProvider);
var crashReportModel = CrashReportInfo.ToModel(crashReport, helper, helper, helper, helper, helper, helper);
var logSources = GetLogSources().ToArray();
try
{
CrashReportImGui.ShowAndWait(crashReportModel, logSources, crashReportRendererUtilities);
}
catch (Exception ex)
{
try
{
CrashReportImGui.ShowAndWait(crashReportModel, logSources, crashReportRendererUtilities);
}
catch (Exception ex)
{
try
{
#if NET472 || (NET6_0 && WINDOWS)

var forms = new CrashReportWinForms(crashReportModel, logSources, crashReportRendererUtilities);
forms.ShowDialog();
var forms = new CrashReportWinForms(crashReportModel, logSources, crashReportRendererUtilities);
forms.ShowDialog();
#endif
}
catch (Exception ex2)
{
throw new AggregateException(ex, ex2);
}
}
catch (Exception ex2)
{
throw new AggregateException(ex, ex2);
}
}
}

private static IEnumerable<LogSource> GetLogSources()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using BUTR.CrashReport.Models;
using BUTR.CrashReport.Models;
using BUTR.CrashReport.Renderer.Zip;

using Newtonsoft.Json;
Expand Down
8 changes: 4 additions & 4 deletions src/Bannerlord.ButterLib/ExceptionHandler/Utils/MiniDump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public enum MINIDUMP_CALLBACK_TYPE
ReadMemoryFailureCallback,
SecondaryFlagsCallback
}

public struct VS_FIXEDFILEINFO
{
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
Expand Down Expand Up @@ -194,7 +194,7 @@ public struct MINIDUMP_INCLUDE_MODULE_CALLBACK
public ulong BaseOfImage;
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
}

public struct MINIDUMP_IO_CALLBACK
{
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
Expand All @@ -204,7 +204,7 @@ public struct MINIDUMP_IO_CALLBACK
public uint BufferBytes;
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value
}

public struct MINIDUMP_CALLBACK_INPUT
{
[StructLayout(LayoutKind.Explicit)]
Expand All @@ -225,7 +225,7 @@ public struct UNION
[FieldOffset(0)]
public MINIDUMP_IO_CALLBACK Io;
}

#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
public uint ProcessId;
public IntPtr ProcessHandle;
Expand Down

0 comments on commit 7acb549

Please sign in to comment.