From 4bc57731bfacb2ce2d363389d5ff13aa7d711a8a Mon Sep 17 00:00:00 2001 From: Venomalia <87765258+Venomalia@users.noreply.github.com> Date: Fri, 2 Feb 2024 18:05:59 +0100 Subject: [PATCH] update supported formats in console header --- TextureExtraction tool/Program.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/TextureExtraction tool/Program.cs b/TextureExtraction tool/Program.cs index 79ea026..72a1ff3 100644 --- a/TextureExtraction tool/Program.cs +++ b/TextureExtraction tool/Program.cs @@ -525,9 +525,22 @@ static void PrintHeader() #else Console.WriteLine($"{System.Diagnostics.Process.GetCurrentProcess().ProcessName} v{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version} {IntPtr.Size * 8}bit\t\t{DateTime.Now.ToString()}"); #endif - List formats = new(AuroraLib.Common.Reflection.FileAccess.GetReadable().Select(x => x.Name)) { "BDL4", "BMD3", "TEX1" }; - formats.Sort(); - Console.WriteLine($"Supported formats: {string.Join(", ", formats)}.".LineBreak(20)); + ConsoleEx.WriteLineColoured(StringEx.Divider(), ConsoleColor.Blue); + IEnumerable formats = FormatDictionary.Master.Where(x => x.CanRead && x.Class != null).DistinctBy(x => x.Class); + List fileSystems = formats.Where(x => x.Typ == FormatType.Iso).Select(x => x.Class.Name).ToList(); + List archives = formats.Where(x => x.Typ == FormatType.Archive).Select(x => x.Class.Name).ToList(); + List textures = formats.Where(x => x.Typ == FormatType.Texture).Select(x => x.Class.Name).ToList(); + textures.Sort(); + archives.Sort(); + //List formats = new(AuroraLib.Common.Reflection.FileAccess.GetReadable().Select(x => x.Name)) { "BDL4", "BMD3", "TEX1" }; + //formats.Sort(); + ConsoleEx.WriteLineColoured($"Supported formats:", ConsoleColor.Cyan); + ConsoleEx.WriteColoured($"Disk images:\t", ConsoleColor.Cyan); + Console.WriteLine(string.Join(", ", fileSystems)); + ConsoleEx.WriteColoured($"Archives:\t", ConsoleColor.Cyan); + Console.WriteLine(string.Join(", ", archives).LineBreak(17)); + ConsoleEx.WriteColoured($"Textures:\t", ConsoleColor.Cyan); + Console.WriteLine(string.Join(", ", textures).LineBreak(17)); ConsoleEx.WriteLineColoured(StringEx.Divider(), ConsoleColor.Blue); ConsoleEx.WriteColoured("INFO:", ConsoleColor.Red);