/// <summary> /// Loads and decompiles the ANM animation script entry and returns the script as a string. /// </summary> /// <param name="entry">The entry to extract from.</param> /// <param name="kifintStream">The stream to the open KIFINT archive.</param> /// <returns>The decompiled script.</returns> /// /// <exception cref="ArgumentNullException"> /// <paramref name="entry"/> or <paramref name="kifintStream"/> is null. /// </exception> public static string DecompileAnimation(this KifintEntry entry, KifintStream kifintStream) { if (entry == null) { throw new ArgumentNullException(nameof(entry)); } using (var stream = entry.ExtractToStream(kifintStream)) return(AnmAnimation.Decompile(stream, entry.FileName)); }
/// <summary> /// Loads and decompiles the ANM animation script entry and outputs it to the specified file. /// </summary> /// <param name="entry">The entry to extract from.</param> /// <param name="outFile">The output file to write the decompiled script to.</param> /// <param name="encoding">The output encoding, <see cref="CatUtils.ShiftJIS"/> if null.</param> /// /// <exception cref="ArgumentNullException"> /// <paramref name="entry"/> or <paramref name="outFile"/> is null. /// </exception> public static void DecompileAnimationToFile(this KifintEntry entry, string outFile, Encoding encoding = null) { if (entry == null) { throw new ArgumentNullException(nameof(entry)); } using (var stream = entry.ExtractToStream()) AnmAnimation.DecompileToFile(stream, entry.FileName, outFile, encoding); }
/// <summary> /// Loads and decompiles the FES screen script entry and outputs it to the specified stream. /// </summary> /// <param name="entry">The entry to extract from.</param> /// <param name="kifintStream">The stream to the open KIFINT archive.</param> /// <param name="outStream">The output stream to write the decompiled script to.</param> /// <param name="encoding">The output encoding, <see cref="CatUtils.ShiftJIS"/> if null.</param> /// /// <exception cref="ArgumentNullException"> /// <paramref name="entry"/>, <paramref name="kifintStream"/>, or <paramref name="outStream"/> is null. /// </exception> public static void DecompileScreenToStream(this KifintEntry entry, KifintStream kifintStream, Stream outStream, Encoding encoding = null) { if (entry == null) { throw new ArgumentNullException(nameof(entry)); } using (var stream = entry.ExtractToStream(kifintStream)) FesScreen.DecompileToStream(stream, entry.FileName, outStream, encoding); }
/// <summary> /// Loads and decompiles the CST scene script entry and outputs it to the specified human readable stream. /// </summary> /// <param name="entry">The entry to extract from.</param> /// <param name="outStream">The output stream to write the human readable script to.</param> /// <param name="kifintStream">The stream to the open KIFINT archive.</param> /// /// <exception cref="ArgumentNullException"> /// <paramref name="entry"/>, <paramref name="kifintStream"/>, or <paramref name="outStream"/> is null. /// </exception> public static void HumanReadableSceneToStream(this KifintEntry entry, KifintStream kifintStream, Stream outStream) { if (entry == null) { throw new ArgumentNullException(nameof(entry)); } using (var stream = entry.ExtractToStream(kifintStream)) CstScene.HumanReadableToStream(stream, entry.FileName, outStream); }
/// <summary> /// Loads and decompiles the CST scene script entry and outputs it to the specified file. /// </summary> /// <param name="entry">The entry to extract from.</param> /// <param name="kifintStream">The stream to the open KIFINT archive.</param> /// <param name="outFile">The output file to write the decompiled script to.</param> /// <param name="encoding">The output encoding, <see cref="CatUtils.ShiftJIS"/> if null.</param> /// /// <exception cref="ArgumentNullException"> /// <paramref name="entry"/>, <paramref name="kifintStream"/>, or <paramref name="outFile"/> is null. /// </exception> public static void DecompileSceneToFile(this KifintEntry entry, KifintStream kifintStream, string outFile, Encoding encoding = null) { if (entry == null) { throw new ArgumentNullException(nameof(entry)); } using (var stream = entry.ExtractToStream(kifintStream)) CstScene.DecompileToFile(stream, entry.FileName, outFile, encoding); }