diff --git a/CUE4Parse b/CUE4Parse index 0a91f0da..92d575d4 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 0a91f0da6103d2f8c35f5a586b0aac6b40f9bd0b +Subproject commit 92d575d4eac879cca8cfeed6fa8401ede1913750 diff --git a/FModel/Constants.cs b/FModel/Constants.cs index 6cb078ac..182f68a0 100644 --- a/FModel/Constants.cs +++ b/FModel/Constants.cs @@ -10,17 +10,18 @@ public static class Constants public static readonly FGuid ZERO_GUID = new(0U); public const string WHITE = "#DAE5F2"; + public const string GRAY = "#BBBBBB"; public const string RED = "#E06C75"; public const string GREEN = "#98C379"; public const string YELLOW = "#E5C07B"; public const string BLUE = "#528BCC"; public const string ISSUE_LINK = "https://github.com/iAmAsval/FModel/issues/new/choose"; - public const string DONATE_LINK = "https://fmodel.app/donate"; - public const string DISCORD_LINK = "https://fmodel.app/discord"; + public const string DONATE_LINK = "https://fmodel.app/donate?utm_source=fmodel&utm_medium=app&utm_campaign=donations"; + public const string DISCORD_LINK = "https://fmodel.app/discord?utm_source=fmodel&utm_medium=app&utm_campaign=discord-server"; public const string _FN_LIVE_TRIGGER = "fortnite-live.manifest"; public const string _VAL_LIVE_TRIGGER = "valorant-live.manifest"; public const string _NO_PRESET_TRIGGER = "Hand Made"; -} \ No newline at end of file +} diff --git a/FModel/ViewModels/ThreadWorkerViewModel.cs b/FModel/ViewModels/ThreadWorkerViewModel.cs index 05f9cfb0..4de3421c 100644 --- a/FModel/ViewModels/ThreadWorkerViewModel.cs +++ b/FModel/ViewModels/ThreadWorkerViewModel.cs @@ -1,7 +1,7 @@ using System; +using System.Text; using System.Threading; using System.Threading.Tasks; -using FModel.Extensions; using FModel.Framework; using FModel.Services; using FModel.Views.Resources.Controls; @@ -41,6 +41,10 @@ public CancellationTokenSource CurrentCancellationTokenSource private ApplicationViewModel _applicationView => ApplicationService.ApplicationView; private readonly AsyncQueue> _jobs; + private const string _at = " at "; + private const char _dot = '.'; + private const char _colon = ':'; + private const string _gray = "#999"; public ThreadWorkerViewModel() { @@ -99,8 +103,32 @@ private async Task ProcessQueues() Log.Error("{Exception}", e); FLogger.AppendError(); - FLogger.AppendText(e.Message, Constants.WHITE, true); - FLogger.AppendText(" " + e.StackTrace.SubstringBefore('\n').Trim(), Constants.WHITE, true); + if ((e.InnerException ?? e) is { TargetSite.DeclaringType: not null } exception) + { + if (exception.TargetSite.ToString() == "CUE4Parse.FileProvider.GameFile get_Item(System.String)") + { + FLogger.AppendText(e.Message, Constants.WHITE, true); + } + else + { + var t = exception.GetType(); + FLogger.AppendText(t.Namespace + _dot, Constants.GRAY); + FLogger.AppendText(t.Name, Constants.WHITE); + FLogger.AppendText(_colon + " ", Constants.GRAY); + FLogger.AppendText(exception.Message, Constants.RED, true); + + FLogger.AppendText(_at, _gray); + FLogger.AppendText(exception.TargetSite.DeclaringType.FullName + _dot, Constants.GRAY); + FLogger.AppendText(exception.TargetSite.Name, Constants.YELLOW); + + var parameters = new StringBuilder(); + foreach (var parameter in exception.TargetSite.GetParameters()) + { + parameters.Append(parameter.ParameterType.Name + " " + parameter.Name); + } + FLogger.AppendText("(" + string.Join(", ", parameters) + ")", Constants.GRAY, true); + } + } return; } } @@ -115,4 +143,4 @@ public void SignalOperationInProgress() StatusChangeAttempted = true; StatusChangeAttempted = false; } -} \ No newline at end of file +}