mirror of
https://github.com/4sval/FModel.git
synced 2026-03-21 17:24:26 -05:00
mapping fallback
This commit is contained in:
parent
3659d2dfd8
commit
ed63dc9d07
|
|
@ -1,6 +1,7 @@
|
|||
using FModel.Utils;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using UsmapNET.Classes;
|
||||
|
||||
|
|
@ -39,6 +40,16 @@ namespace FModel.Grabber.Mappings
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
var latestUsmaps = new DirectoryInfo(Path.Combine(Properties.Settings.Default.OutputPath, "PakChunks")).GetFiles("*.usmap");
|
||||
if (Globals.Usmap == null && latestUsmaps.Length > 0)
|
||||
{
|
||||
var latestUsmapInfo = latestUsmaps.OrderBy(f => f.LastWriteTime).Last();
|
||||
byte[] mappingsData = await File.ReadAllBytesAsync(latestUsmapInfo.FullName);
|
||||
FConsole.AppendText($"Mappings pulled from {latestUsmapInfo.Name}", FColors.Yellow, true);
|
||||
Globals.Usmap = new Usmap(mappingsData);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user