From d3f19246900a06ee863b220d9c417d249b200ac5 Mon Sep 17 00:00:00 2001 From: GMatrixGames Date: Sun, 18 Jul 2021 08:43:27 -0400 Subject: [PATCH] Better handing of unsupported file types --- FModel/ViewModels/CUE4ParseViewModel.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 0c48d679..4ae677de 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -395,6 +395,16 @@ namespace FModel.ViewModels TabControl.SelectedTab.Highlighter = AvalonExtensions.HighlighterSelector(ext); switch (ext) { + case "uasset": + case "umap": + { + var exports = Provider.LoadObjectExports(fullPath); + TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(exports, Formatting.Indented), bulkSave); + + if (bulkSave || !exports.Any(CheckExport)) + TabControl.SelectedTab.Image = null; + break; + } case "ini": case "txt": case "log": @@ -511,11 +521,8 @@ namespace FModel.ViewModels } default: { - var exports = Provider.LoadObjectExports(fullPath); - TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(exports, Formatting.Indented), bulkSave); - - if (bulkSave || !exports.Any(CheckExport)) - TabControl.SelectedTab.Image = null; + FLogger.AppendWarning(); + FLogger.AppendText($"The file '{fullPath.SubstringAfterLast('/').SubstringBeforeLast('.')}' is an unknown file type. If this is a mistake, we are already working to fix it!", Constants.WHITE, true); break; } }