diff --git a/HousingCheck/Config.cs b/HousingCheck/Config.cs index ecdd6d9..740cfad 100644 --- a/HousingCheck/Config.cs +++ b/HousingCheck/Config.cs @@ -51,10 +51,7 @@ public class Config /// /// 启用ML房通知提醒 /// - /// - /// 为防止错过提示,此选项永远为True - /// - public bool EnableNotifyHouseML => true; + public bool EnableNotifyHouseML { get; set; } /// /// 忽略穹顶皓天 @@ -132,7 +129,7 @@ public void LoadSettings() EnableUploadSnapshot = bool.Parse(head?.SelectSingleNode("UploadSnapshot")?.InnerText ?? "true"); EnableTTS = bool.Parse(head?.SelectSingleNode("TTSNotify")?.InnerText ?? "false"); EnableNotification = bool.Parse(head?.SelectSingleNode("ShellNotify")?.InnerText ?? "false"); - // EnableNotifyHouseML = true; + EnableNotifyHouseML = bool.Parse(head?.SelectSingleNode("NotifyHouseML")?.InnerText ?? "true"); EnableNotifyHouseS = bool.Parse(head?.SelectSingleNode("NotifyHouseS")?.InnerText ?? "false"); IgnoreEmpyreum = bool.Parse(head?.SelectSingleNode("IgnoreEmpyreum")?.InnerText ?? "true"); EnableNotifyCheck = bool.Parse(head?.SelectSingleNode("NotifyCheck")?.InnerText ?? "false"); @@ -169,6 +166,7 @@ public void SaveSettings() xWriter.WriteElementString("TTSNotify", EnableTTS.ToString()); xWriter.WriteElementString("ShellNotify", EnableNotification.ToString()); xWriter.WriteElementString("NotifyHouseS", EnableNotifyHouseS.ToString()); + xWriter.WriteElementString("NotifyHouseML", EnableNotifyHouseML.ToString()); xWriter.WriteElementString("IgnoreEmpyreum", IgnoreEmpyreum.ToString()); xWriter.WriteElementString("NotifyCheck", EnableNotifyCheck.ToString()); xWriter.WriteElementString("NotifyCheckAhead", CheckNotifyAheadTime.ToString()); diff --git a/HousingCheck/HousingCheck.cs b/HousingCheck/HousingCheck.cs index 1b13f18..3d55469 100644 --- a/HousingCheck/HousingCheck.cs +++ b/HousingCheck/HousingCheck.cs @@ -244,7 +244,6 @@ void NotifyEmptyHouse(HousingOnSaleItem onSaleItem, bool exists) if (onSaleItem.Area == HouseArea.穹顶皓天 && config.IgnoreEmpyreum) return; - bool fallback = true; if (config.EnableNotification) { var title = string.Format("{0} 第{1}区 {2}号 {3}房", @@ -257,7 +256,6 @@ void NotifyEmptyHouse(HousingOnSaleItem onSaleItem, bool exists) .AddText("新空房") .AddText(title) .Show(); - fallback = false; } if (config.EnableTTS) { @@ -269,20 +267,7 @@ void NotifyEmptyHouse(HousingOnSaleItem onSaleItem, bool exists) onSaleItem.SizeStr ) ); - fallback = false; } - if (fallback) - { - PlayAlert(); - } - } - - /// - /// 播放提示音 - /// - void PlayAlert() - { - Console.Beep(3000, 1000); } void WriteActLog(string message) diff --git a/HousingCheck/HousingCheck.csproj b/HousingCheck/HousingCheck.csproj index 75b59b6..73f8ad6 100644 --- a/HousingCheck/HousingCheck.csproj +++ b/HousingCheck/HousingCheck.csproj @@ -3,7 +3,7 @@ HousingCheck HousingCheck net472 - 1.6.6 + 1.6.7 Copyright ©2021 Bluefissure, Hyperzlib. Copyright ©2021-2022 Lotlab false diff --git a/HousingCheck/PluginControlViewModel.cs b/HousingCheck/PluginControlViewModel.cs index 5af0245..dd8e95b 100644 --- a/HousingCheck/PluginControlViewModel.cs +++ b/HousingCheck/PluginControlViewModel.cs @@ -38,6 +38,7 @@ public int UploadApiVersion public bool EnableTTS { get => config.EnableTTS; set { config.EnableTTS = value; OnPropertyChanged(); } } public bool EnableNotification { get => config.EnableNotification; set { config.EnableNotification = value; OnPropertyChanged(); } } public bool EnableNotifyHouseS { get => config.EnableNotifyHouseS; set { config.EnableNotifyHouseS = value; OnPropertyChanged(); } } + public bool EnableNotifyHouseML { get => config.EnableNotifyHouseML; set { config.EnableNotifyHouseML = value; OnPropertyChanged(); } } public bool IgnoreEmpyreum { get => config.IgnoreEmpyreum; set { config.IgnoreEmpyreum = value; OnPropertyChanged(); } } public bool EnableNotifyCheck { get => config.EnableNotifyCheck; set { config.EnableNotifyCheck = value; OnPropertyChanged(); } } public string CheckNotifyAheadTime { get => config.CheckNotifyAheadTime.ToString(); set { config.CheckNotifyAheadTime = int.Parse(value); OnPropertyChanged(); } } diff --git a/HousingCheck/PluginControlWpf.xaml b/HousingCheck/PluginControlWpf.xaml index d0e18e9..0cb7960 100644 --- a/HousingCheck/PluginControlWpf.xaml +++ b/HousingCheck/PluginControlWpf.xaml @@ -62,7 +62,7 @@ S房 - M/L房 + M/L房 忽略穹顶皓天