mirror of
https://github.com/kwsch/pk3DS.git
synced 2026-10-01 21:36:43 -05:00
Add lzgarc to config fetchables
This commit is contained in:
@@ -28,4 +28,29 @@ public void Save()
|
||||
Console.WriteLine($"Wrote {Reference.Name} to {Reference.Reference}");
|
||||
}
|
||||
}
|
||||
public class lzGARCFile
|
||||
{
|
||||
private readonly GARC.lzGARC GARC;
|
||||
private readonly GARCReference Reference;
|
||||
private readonly string Path;
|
||||
|
||||
public lzGARCFile(GARC.lzGARC g, GARCReference r, string p)
|
||||
{
|
||||
GARC = g;
|
||||
Reference = r;
|
||||
Path = p;
|
||||
}
|
||||
|
||||
public int FileCount => GARC.FileCount;
|
||||
public byte[] this[int file]
|
||||
{
|
||||
get { return GARC[file]; }
|
||||
set { GARC[file] = value; }
|
||||
}
|
||||
public void Save()
|
||||
{
|
||||
File.WriteAllBytes(Path, GARC.Save());
|
||||
Console.WriteLine($"Wrote {Reference.Name} to {Reference.Reference}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +135,12 @@ public void InitializeMoves()
|
||||
break;
|
||||
}
|
||||
}
|
||||
public lzGARCFile getlzGARCData(string file)
|
||||
{
|
||||
var gr = getGARCReference(file);
|
||||
gr = gr.LanguageVariant ? gr.getRelativeGARC(Language, gr.Name) : gr;
|
||||
return new lzGARCFile(getlzGARC(file), gr, getGARCPath(file));
|
||||
}
|
||||
public GARCFile getGARCData(string file)
|
||||
{
|
||||
var gr = getGARCReference(file);
|
||||
@@ -153,6 +159,10 @@ private GARC.MemGARC getMemGARC(string file)
|
||||
{
|
||||
return new GARC.MemGARC(File.ReadAllBytes(getGARCPath(file)));
|
||||
}
|
||||
private GARC.lzGARC getlzGARC(string file)
|
||||
{
|
||||
return new GARC.lzGARC(File.ReadAllBytes(getGARCPath(file)));
|
||||
}
|
||||
|
||||
private string RomFS, ExeFS;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user