1
0
mirror of synced 2024-11-28 01:10:51 +01:00

GFPAK procedural anime config hashes

This commit is contained in:
HelloOO7 2021-01-28 19:19:31 +01:00 committed by KillzXGaming
parent 2c43ccfc3f
commit 1340c1a55f

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -570,22 +570,37 @@ namespace FirstPlugin
hashes.Add(hash); hashes.Add(hash);
} }
GenerateHashList();
reader.Seek((long)FileInfoOffset, SeekOrigin.Begin); reader.Seek((long)FileInfoOffset, SeekOrigin.Begin);
for (int i = 0; i < FileCount; i++) for (int i = 0; i < FileCount; i++)
{ {
FileEntry fileEntry = new FileEntry(this); FileEntry fileEntry = new FileEntry(this);
fileEntry.Read(reader);
string Extension = FindMatch(fileEntry.FileData);
if (Extension.EndsWith("gfbanmcfg"))
{
GFBANMCFG cfg = new GFBANMCFG();
cfg.Load(new MemoryStream(fileEntry.FileData));
GenerateAnmCfgStrings(cfg);
}
files.Add(fileEntry);
}
for (int i = 0; i < FileCount; i++)
{
FileEntry fileEntry = files[i];
for (int f = 0; f < FolderFiles.Count; f++) for (int f = 0; f < FolderFiles.Count; f++)
if (FolderFiles[f].Index == i) if (FolderFiles[f].Index == i)
fileEntry.FolderHash = FolderFiles[f]; fileEntry.FolderHash = FolderFiles[f];
var dir = fileEntry.FolderHash.Parent; var dir = fileEntry.FolderHash.Parent;
fileEntry.Read(reader);
fileEntry.FileName = GetString(hashes[i], fileEntry.FolderHash, fileEntry.FileData); fileEntry.FileName = GetString(hashes[i], fileEntry.FolderHash, fileEntry.FileData);
fileEntry.FilePathHash = hashes[i]; fileEntry.FilePathHash = hashes[i];
files.Add(fileEntry);
} }
} }
@ -595,7 +610,6 @@ namespace FirstPlugin
get get
{ {
if (hashList == null) { if (hashList == null) {
hashList = new Dictionary<ulong, string>();
GenerateHashList(); GenerateHashList();
} }
return hashList; return hashList;
@ -604,6 +618,8 @@ namespace FirstPlugin
private void GenerateHashList() private void GenerateHashList()
{ {
hashList = new Dictionary<ulong, string>();
foreach (string hashStr in Properties.Resources.Pkmn.Split('\n')) foreach (string hashStr in Properties.Resources.Pkmn.Split('\n'))
{ {
string HashString = hashStr.TrimEnd(); string HashString = hashStr.TrimEnd();
@ -629,6 +645,14 @@ namespace FirstPlugin
} }
} }
private void GenerateAnmCfgStrings(GFBANMCFG cfg)
{
foreach (GFBANMCFG.Animation a in cfg.Config.Animations)
{
hashList.Add(FNV64A1.Calculate(a.FileName), a.FileName);
}
}
private void GeneratePokeStrings(string hashStr) private void GeneratePokeStrings(string hashStr)
{ {
//Also check file name just in case //Also check file name just in case