mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
# VPet.Solution
修复清除失效模组功能异常的问题 修复关闭模组后,保存错误的问题
This commit is contained in:
parent
470c0d4361
commit
9b3d39690e
@ -1,7 +1,7 @@
|
||||
using LinePutScript;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
using LinePutScript;
|
||||
using LinePutScript.Localization.WPF;
|
||||
|
||||
namespace VPet.Solution.Models.SettingEditor;
|
||||
|
||||
@ -94,10 +94,10 @@ public class ModSettingModel : ObservableClass<ModSettingModel>
|
||||
setting.Remove(ModLineName);
|
||||
setting.Remove(PassModLineName);
|
||||
setting.Remove(MsgModLineName);
|
||||
if (Mods.Any() is false)
|
||||
return;
|
||||
foreach (var mod in Mods)
|
||||
{
|
||||
if (mod.IsEnabled is false)
|
||||
continue;
|
||||
setting[ModLineName].Add(new Sub(mod.ID.ToLower()));
|
||||
setting[MsgModLineName].Add(new Sub(mod.ID, "True"));
|
||||
if (mod.IsPass)
|
||||
|
@ -1,5 +1,5 @@
|
||||
using LinePutScript.Localization.WPF;
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using VPet.Solution.Models.SettingEditor;
|
||||
|
||||
namespace VPet.Solution.ViewModels.SettingEditor;
|
||||
@ -37,16 +37,16 @@ public class ModSettingPageVM : ObservableClass<ModSettingPageVM>
|
||||
#endregion
|
||||
|
||||
#region CurrentModMoel
|
||||
private ModModel _currentModModel;
|
||||
public ModModel CurrentModMoel
|
||||
private ModModel _currentModModel = null!;
|
||||
public ModModel CurrentModModel
|
||||
{
|
||||
get => _currentModModel;
|
||||
set
|
||||
{
|
||||
if (_currentModModel is not null)
|
||||
_currentModModel.PropertyChangingX -= CurrentModModel_PropertyChangingX;
|
||||
SetProperty(ref _currentModModel, value);
|
||||
if (value is not null)
|
||||
SetProperty(ref _currentModModel!, value);
|
||||
if (_currentModModel is not null)
|
||||
_currentModModel.PropertyChangingX += CurrentModModel_PropertyChangingX;
|
||||
}
|
||||
}
|
||||
@ -117,7 +117,7 @@ public class ModSettingPageVM : ObservableClass<ModSettingPageVM>
|
||||
for (var i = 0; i < ModSetting.Mods.Count; i++)
|
||||
{
|
||||
if (ModSetting.Mods[i].IsEnabled is null)
|
||||
ModSetting.Mods.RemoveAt(i);
|
||||
ModSetting.Mods.RemoveAt(i--);
|
||||
}
|
||||
SearchMod = string.Empty;
|
||||
}
|
||||
@ -158,8 +158,8 @@ public class ModSettingPageVM : ObservableClass<ModSettingPageVM>
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
ShowMods = ModSetting.Mods;
|
||||
else
|
||||
ShowMods = ModSetting.Mods.Where(
|
||||
s => s.Name.Contains(SearchMod, StringComparison.OrdinalIgnoreCase)
|
||||
ShowMods = ModSetting.Mods.Where(s =>
|
||||
s.Name.Contains(SearchMod, StringComparison.OrdinalIgnoreCase)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
ItemsSource="{Binding ShowMods}"
|
||||
SelectedItem="{Binding CurrentModMoel}">
|
||||
SelectedItem="{Binding CurrentModModel}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding Name}"
|
||||
|
@ -10,8 +10,8 @@
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:vm="clr-namespace:VPet.Solution.ViewModels.SettingEditor"
|
||||
Title="{ll:Str 'VPET 设置编辑器'}"
|
||||
Width="800"
|
||||
Height="450"
|
||||
Width="1000"
|
||||
Height="600"
|
||||
MinWidth="400"
|
||||
MinHeight="200"
|
||||
d:DataContext="{d:DesignInstance Type=vm:SettingWindowVM}"
|
||||
|
Loading…
Reference in New Issue
Block a user