mirror of
https://github.com/LorisYounger/VPet.ModMaker.git
synced 2024-08-30 18:22:21 +00:00
更新
This commit is contained in:
parent
479d995c84
commit
55739b6258
@ -149,11 +149,10 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
|||||||
{
|
{
|
||||||
var petModel = new PetModel(pet);
|
var petModel = new PetModel(pet);
|
||||||
Pets.Add(petModel);
|
Pets.Add(petModel);
|
||||||
ModMakerInfo.MainPets.Add(petModel.Id.Value, new(pet, true));
|
|
||||||
foreach (var p in pet.path)
|
foreach (var p in pet.path)
|
||||||
LoadAnime(petModel, p);
|
LoadAnime(petModel, p);
|
||||||
}
|
}
|
||||||
Pets.Clear();
|
|
||||||
// 插入本体宠物
|
// 插入本体宠物
|
||||||
foreach (var pet in ModMakerInfo.MainPets)
|
foreach (var pet in ModMakerInfo.MainPets)
|
||||||
{
|
{
|
||||||
@ -402,7 +401,8 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
|||||||
Directory.CreateDirectory(petPath);
|
Directory.CreateDirectory(petPath);
|
||||||
foreach (var pet in Pets)
|
foreach (var pet in Pets)
|
||||||
{
|
{
|
||||||
pet.Save(petPath);
|
if (pet.CanSave())
|
||||||
|
pet.Save(petPath);
|
||||||
}
|
}
|
||||||
// 如果没有一个完成保存, 则删除文件夹
|
// 如果没有一个完成保存, 则删除文件夹
|
||||||
if (Directory.EnumerateFiles(petPath).Any() is false)
|
if (Directory.EnumerateFiles(petPath).Any() is false)
|
||||||
|
@ -208,7 +208,13 @@ public class PetModel : I18nModel<I18nPetInfoModel>
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool CanSave()
|
public bool CanSave()
|
||||||
{
|
{
|
||||||
if (FromMain.Value && Works.Count == 0 && Animes.Count == 0 && FoodAnimes.Count == 0)
|
if (
|
||||||
|
FromMain.Value
|
||||||
|
&& Works.Count == 0
|
||||||
|
&& Moves.Count == 0
|
||||||
|
&& Animes.Count == 0
|
||||||
|
&& FoodAnimes.Count == 0
|
||||||
|
)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user