- 保存宠物差异信息的错误
This commit is contained in:
Hakoyu 2024-04-17 23:33:17 +08:00
parent c307d50674
commit a3c15260b8
2 changed files with 9 additions and 9 deletions

View File

@ -92,24 +92,24 @@ public class ModInfoModel : ObservableObjectX
// 若宠物的值为默认值并且本体同名宠物不为默认值, 则把本体宠物的值作为模组宠物的默认值
if (
petModel.TouchHeadRectangleLocation
== PetModel.Current.TouchHeadRectangleLocation
== PetModel.Default.TouchHeadRectangleLocation
&& petModel.TouchHeadRectangleLocation != mainPet.TouchHeadRectangleLocation
)
petModel.TouchHeadRectangleLocation = mainPet.TouchHeadRectangleLocation;
if (
petModel.TouchBodyRectangleLocation
== PetModel.Current.TouchBodyRectangleLocation
== PetModel.Default.TouchBodyRectangleLocation
&& petModel.TouchBodyRectangleLocation != mainPet.TouchBodyRectangleLocation
)
petModel.TouchBodyRectangleLocation = mainPet.TouchBodyRectangleLocation;
if (
petModel.TouchRaisedRectangleLocation
== PetModel.Current.TouchRaisedRectangleLocation
== PetModel.Default.TouchRaisedRectangleLocation
&& petModel.TouchRaisedRectangleLocation != mainPet.TouchRaisedRectangleLocation
)
petModel.TouchRaisedRectangleLocation = mainPet.TouchRaisedRectangleLocation;
if (
petModel.RaisePoint == PetModel.Current.RaisePoint
petModel.RaisePoint == PetModel.Default.RaisePoint
&& petModel.RaisePoint != mainPet.RaisePoint
)
petModel.RaisePoint = mainPet.RaisePoint;

View File

@ -120,7 +120,7 @@ public class PetModel : ObservableObjectX
Moves.Add(new(move));
}
public static PetModel Current { get; } = null!;
public static PetModel Default { get; } = new() { I18nResource = new() };
#region FromMain
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
@ -477,21 +477,21 @@ public class PetModel : ObservableObjectX
SavePetBasicInfo(lps);
// 如果值不为默认并且不与本体值相同, 则保存
if (
TouchHeadRectangleLocation != Current.TouchHeadRectangleLocation
TouchHeadRectangleLocation != Default.TouchHeadRectangleLocation
&& TouchHeadRectangleLocation != mainPet.TouchHeadRectangleLocation
)
SavePetTouchHeadInfo(lps);
if (
TouchBodyRectangleLocation != Current.TouchBodyRectangleLocation
TouchBodyRectangleLocation != Default.TouchBodyRectangleLocation
&& TouchBodyRectangleLocation != mainPet.TouchBodyRectangleLocation
)
SavePetTouchBodyInfo(lps);
if (
TouchRaisedRectangleLocation != Current.TouchRaisedRectangleLocation
TouchRaisedRectangleLocation != Default.TouchRaisedRectangleLocation
&& TouchRaisedRectangleLocation != mainPet.TouchRaisedRectangleLocation
)
SavePetTouchRaisedInfo(lps);
if (RaisePoint != Current.RaisePoint && RaisePoint != mainPet.RaisePoint)
if (RaisePoint != Default.RaisePoint && RaisePoint != mainPet.RaisePoint)
SavePetRaisePointInfo(lps);
}