Fix errors not being shown in the importer status window.

This commit is contained in:
Ottermandias 2022-06-09 12:37:49 +02:00
parent d89c1abc3b
commit d45e98a254

View file

@ -63,7 +63,7 @@ public partial class TexToolsImporter
private void DrawEndState() private void DrawEndState()
{ {
var success = ExtractedMods.Count( t => t.Mod != null ); var success = ExtractedMods.Count( t => t.Error == null );
ImGui.TextUnformatted( $"Successfully extracted {success} / {ExtractedMods.Count} files." ); ImGui.TextUnformatted( $"Successfully extracted {success} / {ExtractedMods.Count} files." );
ImGui.NewLine(); ImGui.NewLine();
@ -78,15 +78,15 @@ public partial class TexToolsImporter
ImGui.TableNextColumn(); ImGui.TableNextColumn();
ImGui.TextUnformatted( file.Name ); ImGui.TextUnformatted( file.Name );
ImGui.TableNextColumn(); ImGui.TableNextColumn();
if( dir != null ) if( ex == null )
{ {
using var color = ImRaii.PushColor( ImGuiCol.Text, ColorId.FolderExpanded.Value() ); using var color = ImRaii.PushColor( ImGuiCol.Text, ColorId.FolderExpanded.Value() );
ImGui.TextUnformatted( dir.FullName[ ( _baseDirectory.FullName.Length + 1 ).. ] ); ImGui.TextUnformatted( dir?.FullName[ ( _baseDirectory.FullName.Length + 1 ).. ] ?? "Unknown Directory" );
} }
else else
{ {
using var color = ImRaii.PushColor( ImGuiCol.Text, ColorId.ConflictingMod.Value() ); using var color = ImRaii.PushColor( ImGuiCol.Text, ColorId.ConflictingMod.Value() );
ImGui.TextUnformatted( ex!.Message ); ImGui.TextUnformatted( ex.Message );
ImGuiUtil.HoverTooltip( ex.ToString() ); ImGuiUtil.HoverTooltip( ex.ToString() );
} }
} }