|
@@ -24,7 +24,7 @@ namespace COM3D2.CacheEditMenu
|
|
|
|
|
|
public static class Hooks
|
|
public static class Hooks
|
|
{
|
|
{
|
|
- private const int CACHE_VERSION = 1000;
|
|
|
|
|
|
+ private const int CACHE_VERSION = 1011;
|
|
|
|
|
|
private static readonly Dictionary<string, MenuInfo> infoCache = new Dictionary<string, MenuInfo>();
|
|
private static readonly Dictionary<string, MenuInfo> infoCache = new Dictionary<string, MenuInfo>();
|
|
private static BinaryWriter cacheWriter;
|
|
private static BinaryWriter cacheWriter;
|
|
@@ -149,7 +149,7 @@ namespace COM3D2.CacheEditMenu
|
|
mi = mi,
|
|
mi = mi,
|
|
key = menuFileName
|
|
key = menuFileName
|
|
};
|
|
};
|
|
- if (!getTexFileIDDic().TryGetValue(mi.m_nMenuFileRID, out menuInfo.texName) && texFileName != null)
|
|
|
|
|
|
+ if (texFileName != null)
|
|
menuInfo.texName = texFileName;
|
|
menuInfo.texName = texFileName;
|
|
infoCache[menuFileName] = menuInfo;
|
|
infoCache[menuFileName] = menuInfo;
|
|
|
|
|
|
@@ -186,7 +186,13 @@ namespace COM3D2.CacheEditMenu
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- if (br.ReadInt32() == CACHE_VERSION)
|
|
|
|
|
|
+ int cacheVer = br.ReadInt32();
|
|
|
|
+ int menuFilesCount = br.ReadInt32();
|
|
|
|
+ int modMenuFilesCount = br.ReadInt32();
|
|
|
|
+
|
|
|
|
+ if (cacheVer == CACHE_VERSION &&
|
|
|
|
+ menuFilesCount == GameUty.MenuFiles.Length &&
|
|
|
|
+ modMenuFilesCount == GameUty.ModOnlysMenuFiles.Length)
|
|
{
|
|
{
|
|
while (true)
|
|
while (true)
|
|
{
|
|
{
|
|
@@ -218,6 +224,9 @@ namespace COM3D2.CacheEditMenu
|
|
if (rebuildCache)
|
|
if (rebuildCache)
|
|
{
|
|
{
|
|
cacheWriter.Write(CACHE_VERSION);
|
|
cacheWriter.Write(CACHE_VERSION);
|
|
|
|
+ cacheWriter.Write(GameUty.MenuFiles.Length);
|
|
|
|
+ cacheWriter.Write(GameUty.ModOnlysMenuFiles.Length);
|
|
|
|
+
|
|
foreach (var keyValuePair in infoCache)
|
|
foreach (var keyValuePair in infoCache)
|
|
keyValuePair.Value.Serialize(cacheWriter);
|
|
keyValuePair.Value.Serialize(cacheWriter);
|
|
cacheWriter.Flush();
|
|
cacheWriter.Flush();
|