public ATDTX(IPluginHost pluginHost, int id) { InitializeComponent(); this.pluginHost = pluginHost;; this.id = id; imgs_ = LINK.Unpack(pluginHost.Search_File(id)).files.ToArray(); imgs = new string[imgs_.Length]; numFile.Maximum = imgs_.Length - 1; label3.Text = numFile.Maximum.ToString(); palettes_ = LINK.Unpack(pluginHost.Search_File(0x1DC)).files.ToArray(); palettes = new string[palettes_.Length]; numFile_ValueChanged(null, null); }
public sFolder Unpack(sFile file) { System.IO.BinaryReader br = new System.IO.BinaryReader(System.IO.File.OpenRead(file.path)); byte[] header = br.ReadBytes(4); string ext = new String(Encoding.ASCII.GetChars(header)); uint exti = BitConverter.ToUInt32(header, 0); if (ext == "LINK") { return(LINK.Unpack(file.path)); } else if (exti == 0x0040E3C4 || exti == 0x0040E3BC) { return(PAC.Unpack(file.path)); } return(new sFolder()); }