From 8b7474e1d0bdcd8d31626bc965d421a1b515071d Mon Sep 17 00:00:00 2001 From: dexy Date: Tue, 28 Jan 2020 01:21:53 +1100 Subject: [PATCH] Made progress action optional for RpfFile.Defragment --- CodeWalker.Core/GameFiles/RpfFile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeWalker.Core/GameFiles/RpfFile.cs b/CodeWalker.Core/GameFiles/RpfFile.cs index a7fdcca..cdb7d7f 100644 --- a/CodeWalker.Core/GameFiles/RpfFile.cs +++ b/CodeWalker.Core/GameFiles/RpfFile.cs @@ -1900,7 +1900,7 @@ namespace CodeWalker.GameFiles } - public static void Defragment(RpfFile file, Action progress) + public static void Defragment(RpfFile file, Action progress = null) { if (file?.AllEntries == null) return; @@ -1928,7 +1928,7 @@ namespace CodeWalker.GameFiles var entry = allfiles[i]; float prog = (float)i / allfiles.Count; string txt = "Relocating " + entry.Name + "..."; - progress(txt, prog); + progress?.Invoke(txt, prog); var sourceblock = entry.FileOffset; var blockcount = GetBlockCount(entry.GetFileSize());