public void Action(params Album[] array) { switch (Type) { case SAVE_TO_DIR: Npks.SaveToDirectory(Path, array); break; case SAVE_TO_IMG: if (array.Length > 0) { array[0].Save(Path); } break; case SAVE_TO_NPK: Npks.Save(Path, new List <Album>(array)); break; } }
public void Test01() { var prof_list = GetProfession(); foreach (var prof in prof_list) { var dir = $"{SAVE_DIR}/image/{prof}"; if (Directory.Exists(dir)) { Directory.Delete(dir, true); } Directory.CreateDirectory(dir); foreach (var part in part_array) { var file = $"{GAME_DIR}/ImagePacks2/sprite_character_{prof}{(prof.EndsWith("_at") ? "" : "_")}equipment_avatar_{part}.NPK"; var avatars = GetAvatar(prof, part); var list = Npks.Load(file); list = list.Where(item => { var name = item.Name; if (name.Contains("(tn)") || name.Contains("_mask")) { return(false); } var regex = new Regex("\\d+"); var match = regex.Match(name); if (match.Success) { var code = match.Value; return(!avatars.Contains(code)); } return(false); }).ToList(); Npks.Save($"{dir}/{part}.NPK", list); } } }
public void Save(string file) { Npks.Save(file, List); IsSave = true; SendSuccess("SaveFile"); }