public TaeEditAnimList(TaeEditorScreen mainScreen) { MainScreen = mainScreen; //if (MainScreen.FileContainer.StandardTAE != null) //{ // foreach (var kvp in MainScreen.FileContainer.StandardTAE) // { // var taeSection = new TaeEditAnimListTaeSection(); // taeSection.Collapsed = MainScreen.Config.AutoCollapseAllTaeSections; // taeSection.Tae = kvp.Value; // taeSection.SectionName = System.IO.Path.GetFileName(kvp.Value.FilePath ?? kvp.Value.VirtualUri); // foreach (var anim in kvp.Value.Animations) // { // var animID_Lower = anim.ID % 10000; // var animID_Upper = anim.ID / 10000; // var info = new TaeEditAnimInfo() // { // GetName = () => $"a{(kvp.Key + animID_Upper):D2}_{animID_Lower:D4}", // Ref = anim, // VerticalOffset = taeSection.HeightOfAllAnims, // TaePrefix = kvp.Key, // }; // taeSection.InfoMap.Add(anim, info); // taeSection.HeightOfAllAnims += AnimHeight; // } // AnimTaeSections.Add(taeSection); // } //} //if (MainScreen.FileContainer.PlayerTAE != null) //{ // foreach (var kvp in MainScreen.FileContainer.PlayerTAE) // { // var taeSection = new TaeEditAnimListTaeSection(); // taeSection.Collapsed = MainScreen.Config.AutoCollapseAllTaeSections; // taeSection.Tae = kvp.Value; // taeSection.SectionName = System.IO.Path.GetFileName(kvp.Value.FilePath ?? kvp.Value.VirtualUri); // foreach (var anim in kvp.Value.Animations) // { // var animID_Lower = anim.ID % 10000; // var animID_Upper = anim.ID / 10000; // var info = new TaeEditAnimInfo() // { // GetName = () => $"a{(kvp.Key + animID_Upper):D2}_{animID_Lower:D4}", // Ref = anim, // VerticalOffset = taeSection.HeightOfAllAnims, // TaePrefix = kvp.Key, // }; // taeSection.InfoMap.Add(anim, info); // taeSection.HeightOfAllAnims += AnimHeight; // } // AnimTaeSections.Add(taeSection); // } //} foreach (var kvp in MainScreen.FileContainer.AllTAEDict) { var tae = kvp.Value; var taeSection = new TaeEditAnimListTaeSection(); taeSection.Collapsed = MainScreen.Config.AutoCollapseAllTaeSections; taeSection.Tae = tae; taeSection.SectionName = System.IO.Path.GetFileName(kvp.Key); foreach (var anim in tae.Animations) { var animID_Lower = MainScreen.FileContainer.ContainerType == TaeFileContainer.TaeFileContainerType.BND4 ? (anim.ID % 1000000) : (anim.ID % 10000); var animID_Upper = MainScreen.FileContainer.ContainerType == TaeFileContainer.TaeFileContainerType.BND4 ? (anim.ID / 1000000) : (anim.ID / 10000); var info = new TaeEditAnimInfo() { GetName = () => MainScreen.FileContainer.ContainerType == TaeFileContainer.TaeFileContainerType.BND4 ? $"a{(animID_Upper):D3}_{animID_Lower:D6}" : $"a{(animID_Upper):D2}_{animID_Lower:D4}", Ref = anim, VerticalOffset = taeSection.HeightOfAllAnims, TaePrefix = animID_Upper, }; taeSection.InfoMap.Add(anim, info); taeSection.HeightOfAllAnims += AnimHeight; } AnimTaeSections.Add(taeSection); } ScrollViewer = new TaeScrollViewer(); }
public TaeEditAnimList(TaeEditorScreen mainScreen) { MainScreen = mainScreen; if (MainScreen.FileContainer.StandardTAE != null) { foreach (var kvp in MainScreen.FileContainer.StandardTAE) { var taeSection = new TaeEditAnimListTaeSection(); taeSection.Collapsed = MainScreen.Config.AutoCollapseAllTaeSections; taeSection.Tae = kvp.Value; taeSection.SectionName = System.IO.Path.GetFileName(kvp.Value.FilePath ?? kvp.Value.VirtualUri); foreach (var anim in kvp.Value.Animations) { var animID_Lower = anim.ID % 10000; var animID_Upper = anim.ID / 10000; var info = new TaeEditAnimInfo() { GetName = () => $"a{(kvp.Key + animID_Upper):D2}_{animID_Lower:D4}", Ref = anim, VerticalOffset = taeSection.HeightOfAllAnims, TaePrefix = kvp.Key, }; taeSection.InfoMap.Add(anim, info); taeSection.HeightOfAllAnims += AnimHeight; } AnimTaeSections.Add(taeSection); } } if (MainScreen.FileContainer.PlayerTAE != null) { foreach (var kvp in MainScreen.FileContainer.PlayerTAE) { var taeSection = new TaeEditAnimListTaeSection(); taeSection.Collapsed = MainScreen.Config.AutoCollapseAllTaeSections; taeSection.Tae = kvp.Value; taeSection.SectionName = System.IO.Path.GetFileName(kvp.Value.FilePath ?? kvp.Value.VirtualUri); foreach (var anim in kvp.Value.Animations) { var animID_Lower = anim.ID % 10000; var animID_Upper = anim.ID / 10000; var info = new TaeEditAnimInfo() { GetName = () => $"a{(kvp.Key + animID_Upper):D2}_{animID_Lower:D4}", Ref = anim, VerticalOffset = taeSection.HeightOfAllAnims, TaePrefix = kvp.Key, }; taeSection.InfoMap.Add(anim, info); taeSection.HeightOfAllAnims += AnimHeight; } AnimTaeSections.Add(taeSection); } } if (AnimTaeSections.Count == 0) { foreach (var tae in MainScreen.FileContainer.AllTAE) { var taeSection = new TaeEditAnimListTaeSection(); taeSection.Collapsed = MainScreen.Config.AutoCollapseAllTaeSections; taeSection.Tae = tae; taeSection.SectionName = System.IO.Path.GetFileName(tae.FilePath ?? tae.VirtualUri); foreach (var anim in tae.Animations) { var animID_Lower = anim.ID % 10000; var animID_Upper = anim.ID / 10000; var info = new TaeEditAnimInfo() { GetName = () => $"a{(animID_Upper):D2}_{animID_Lower:D4}", Ref = anim, VerticalOffset = taeSection.HeightOfAllAnims, TaePrefix = animID_Upper, }; taeSection.InfoMap.Add(anim, info); taeSection.HeightOfAllAnims += AnimHeight; } AnimTaeSections.Add(taeSection); } } ScrollViewer = new TaeScrollViewer(); }