# VPet.Solution

## 修复
- `设置编辑器-mod设置-清除失效模组`卡死的问题
This commit is contained in:
Hakoyu 2024-02-18 17:37:16 +08:00
parent b4c9501f7f
commit eb3fba97d0
4 changed files with 4 additions and 10 deletions

View File

@ -117,7 +117,6 @@
<Compile Include="ViewModels\SaveViewer\SaveWindowVM.cs" /> <Compile Include="ViewModels\SaveViewer\SaveWindowVM.cs" />
<Compile Include="ViewModels\SettingEditor\CustomizedSettingPageVM.cs" /> <Compile Include="ViewModels\SettingEditor\CustomizedSettingPageVM.cs" />
<Compile Include="ViewModels\SettingEditor\DiagnosticSettingPageVM.cs" /> <Compile Include="ViewModels\SettingEditor\DiagnosticSettingPageVM.cs" />
<Compile Include="ViewModels\SettingEditor\ModSettingModelModel.cs" />
<Compile Include="ViewModels\SettingEditor\ModSettingPageVM.cs" /> <Compile Include="ViewModels\SettingEditor\ModSettingPageVM.cs" />
<Compile Include="Models\SettingEditor\SettingModel.cs" /> <Compile Include="Models\SettingEditor\SettingModel.cs" />
<Compile Include="ViewModels\SettingEditor\SystemSettingPageVM.cs" /> <Compile Include="ViewModels\SettingEditor\SystemSettingPageVM.cs" />

View File

@ -1,5 +0,0 @@
namespace VPet.Solution.ViewModels.SettingEditor;
internal class ModSettingModelModel
{
}

View File

@ -120,10 +120,10 @@ public class ModSettingPageVM : ObservableClass<ModSettingPageVM>
is not MessageBoxResult.Yes is not MessageBoxResult.Yes
) )
return; return;
foreach (var mod in ModSetting.Mods.AsEnumerable()) for (var i = 0; i < ModSetting.Mods.Count; i++)
{ {
if (mod.IsEnabled is null) if (ModSetting.Mods[i].IsEnabled is null)
ModSetting.Mods.Remove(mod); ModSetting.Mods.RemoveAt(i);
} }
SearchMod = string.Empty; SearchMod = string.Empty;
} }

View File

@ -1,7 +1,7 @@
using HKW.HKWUtils.Observable; using HKW.HKWUtils.Observable;
using LinePutScript; using LinePutScript;
using LinePutScript.Localization.WPF; using LinePutScript.Localization.WPF;
using Panuon.WPF.UI; using Panuon.WPF;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;