diff --git a/VPet.ModMaker/Models/ModMakerHistory.cs b/VPet.ModMaker/Models/ModMakerHistory.cs index 7466060..76c8942 100644 --- a/VPet.ModMaker/Models/ModMakerHistory.cs +++ b/VPet.ModMaker/Models/ModMakerHistory.cs @@ -31,8 +31,6 @@ public class ModMakerHistory } } - public string LastTimeString => LastTime.ToString("yyyy/MM/dd HH:mm:ss"); - public string InfoFile => Path.Combine(SourcePath, "info.lps"); [Line(ignoreCase: true)] diff --git a/VPet.ModMaker/Models/ModModel/FoodModel.cs b/VPet.ModMaker/Models/ModModel/FoodModel.cs index a0e7a27..7acc812 100644 --- a/VPet.ModMaker/Models/ModModel/FoodModel.cs +++ b/VPet.ModMaker/Models/ModModel/FoodModel.cs @@ -94,7 +94,7 @@ public class FoodModel : I18nModel Health = Health.Value, Likability = Likability.Value, Price = Price.Value, - ImageSource = Image.Value, + Exp = Exp.Value, }; } diff --git a/VPet.ModMaker/ViewModels/ModMakerWindowVM.cs b/VPet.ModMaker/ViewModels/ModMakerWindowVM.cs index 7a8f400..158e7c5 100644 --- a/VPet.ModMaker/ViewModels/ModMakerWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModMakerWindowVM.cs @@ -34,6 +34,7 @@ public class ModMakerWindowVM public ObservableCommand CreateNewModCommand { get; } = new(); public ObservableCommand LoadModFromFileCommand { get; } = new(); public ObservableCommand ClearHistoriesCommand { get; } = new(); + public ObservableCommand RemoveHistoryCommand { get; } = new(); #endregion public ModMakerWindowVM() { } @@ -45,9 +46,16 @@ public class ModMakerWindowVM CreateNewModCommand.ExecuteEvent += CreateNewMod; LoadModFromFileCommand.ExecuteEvent += LoadModFromFile; ClearHistoriesCommand.ExecuteEvent += ClearHistories; + RemoveHistoryCommand.ExecuteEvent += RemoveHistory; HistoriesSearchText.ValueChanged += ModSearchText_ValueChanged; } + private void RemoveHistory(ModMakerHistory value) + { + Histories.Remove(value); + SaveHistories(); + } + private void LoadHistories() { if (File.Exists(ModMakerInfo.HistoryFile) is false) @@ -73,7 +81,7 @@ public class ModMakerWindowVM { new Sub("Id", history.Id), new Sub("SourcePath", history.SourcePath), - new Sub("LastTime", history.LastTimeString) + new Sub("LastTime", history.LastTime.ToString("yyyy/MM/dd HH:mm")) } ); File.WriteAllText(ModMakerInfo.HistoryFile, lps.ToString()); diff --git a/VPet.ModMaker/Views/ModMakerWindow.xaml b/VPet.ModMaker/Views/ModMakerWindow.xaml index 8218cf4..d8aece2 100644 --- a/VPet.ModMaker/Views/ModMakerWindow.xaml +++ b/VPet.ModMaker/Views/ModMakerWindow.xaml @@ -55,7 +55,16 @@ + + + + +