/// <summary> /// /// </summary> public void Save() { if (Loaded) { File.TrimData(); File.Save(FilePath); } }
/// <summary> /// /// </summary> /// <param name="ftdat"></param> /// <param name="ajdat"></param> /// <param name="editAnim"></param> public static void EditFighterAnimations(string ftdat, string ajdat, EditAnimation editAnim) { FighterAJManager manager = new FighterAJManager(File.ReadAllBytes(ajdat)); foreach (var symbol in manager.GetAnimationSymbols()) { if (symbol.Contains("Taro")) { continue; } var ftFile = new HSDRawFile(manager.GetAnimationData(symbol)); if (ftFile[symbol] != null) { var ft = ftFile[symbol].Data as HSD_FigaTree; editAnim(ft, symbol); ftFile[symbol].Data = ft; using (MemoryStream stream = new MemoryStream()) { ftFile.Save(stream); manager.SetAnimation(symbol, stream.ToArray()); } } } var newAJFile = manager.RebuildAJFile(manager.GetAnimationSymbols().ToArray(), true); HSDRawFile ftfile = new HSDRawFile(ftdat); if (ftfile.Roots[0].Data is SBM_FighterData data) { var sa = data.FighterActionTable.Commands; foreach (var action in sa) { if (action.SymbolName != null && !string.IsNullOrEmpty(action.SymbolName.Value)) { var sizeOffset = manager.GetOffsetSize(action.SymbolName.Value); action.AnimationOffset = sizeOffset.Item1; action.AnimationSize = sizeOffset.Item2; } } data.FighterActionTable.Commands = sa; ftfile.TrimData(); ftfile.Save(ftdat); File.WriteAllBytes(ajdat, newAJFile); } }
/// <summary> /// /// </summary> /// <param name="ftdat"></param> /// <param name="ajdat"></param> /// <param name="editAnim"></param> public static void EditFighterActions(string ftdat, EditSubaction editAction) { HSDRawFile ftfile = new HSDRawFile(ftdat); if (ftfile.Roots[0].Data is SBM_FighterData data) { var sa = data.FighterActionTable.Commands; foreach (var action in sa) { editAction(action); } data.FighterActionTable.Commands = sa; ftfile.TrimData(); ftfile.Save(ftdat); } }
/// <summary> /// /// </summary> public static void GenerateStockNode(string ifallPath) { var file = new HSDRawFile(ifallPath); var path = ifallPath; var stockSymbol = file.Roots.Find(e => e.Name.Equals("Stc_icns")); if (stockSymbol == null) { var stockModel = file.Roots.Find(e => e.Name.Equals("Stc_scemdls")).Data as HSDNullPointerArrayAccessor <HSD_JOBJDesc>; var texanim = stockModel[0].MaterialAnimations[0].Child.MaterialAnimation.TextureAnimation; file.Roots.Add(new HSDRootNode() { Name = "Stc_icns", Data = GenerateStockIconNodeFromVanilla(texanim) }); } file.TrimData(); file.Save(path + "_new.dat"); }