From 7d4cf37d217a8841cdeb612b4e93df98d2dc1063 Mon Sep 17 00:00:00 2001 From: uye <2396806385@qq.com> Date: Sat, 18 Feb 2023 17:04:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=85=B3=E5=8D=A1?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E8=BE=93=E5=85=A5=E7=A9=BA=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=8F=98=E4=B8=BA0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Main/TaskQueueViewModel.cs | 36 ++++++++++++++----- .../UserControl/FightSettingsUserControl.xaml | 2 -- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/MaaWpfGui/Main/TaskQueueViewModel.cs b/src/MaaWpfGui/Main/TaskQueueViewModel.cs index a4ef48781c..21a85fff3f 100644 --- a/src/MaaWpfGui/Main/TaskQueueViewModel.cs +++ b/src/MaaWpfGui/Main/TaskQueueViewModel.cs @@ -1468,6 +1468,11 @@ namespace MaaWpfGui get => _stage1; set { + if (_stage1 == value) + { + return; + } + if (CustomStageCode) { value = ToUpperAndCheckStage(value); @@ -1555,9 +1560,12 @@ namespace MaaWpfGui { get { - if (!IsStageOpen(_remainingSanityStage)) + if (!CustomStageCode) { - return string.Empty; + if (!IsStageOpen(_remainingSanityStage)) + { + return string.Empty; + } } return _remainingSanityStage; @@ -1565,6 +1573,11 @@ namespace MaaWpfGui set { + if (_remainingSanityStage == value) + { + return; + } + if (CustomStageCode) { value = ToUpperAndCheckStage(value); @@ -1832,6 +1845,11 @@ namespace MaaWpfGui get => _medicineNumber; set { + if (_medicineNumber == value) + { + return; + } + if (value == "0" || !int.TryParse(value, out _)) { UseStone = false; @@ -1878,6 +1896,11 @@ namespace MaaWpfGui get => _stoneNumber; set { + if (_stoneNumber == value) + { + return; + } + SetAndNotify(ref _stoneNumber, value); SetFightParams(); ViewStatusStorage.Set("MainFunction.UseStone.Quantity", StoneNumber); @@ -1909,9 +1932,9 @@ namespace MaaWpfGui get => _maxTimes; set { - if (string.IsNullOrEmpty(value)) + if (MaxTimes == value) { - value = "0"; + return; } SetAndNotify(ref _maxTimes, value); @@ -2055,11 +2078,6 @@ namespace MaaWpfGui get => _dropsQuantity; set { - if (string.IsNullOrEmpty(value)) - { - value = "0"; - } - SetAndNotify(ref _dropsQuantity, value); SetFightParams(); ViewStatusStorage.Set("MainFunction.Drops.Quantity", DropsQuantity); diff --git a/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml index fae9f04bf6..e1c3100ca9 100644 --- a/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml @@ -199,7 +199,6 @@ Padding="6,0,0,0" VerticalContentAlignment="Center" IsHitTestVisible="{c:Binding !FightTaskRunning}" - LostFocus="FightSettingsTextBoxLostFocus" Text="{Binding Stage1, UpdateSourceTrigger=PropertyChanged}" ToolTip="{DynamicResource CustomStageCodeTip}" Visibility="{c:Binding CustomStageCode}" /> @@ -243,7 +242,6 @@ Padding="6,0,0,0" VerticalContentAlignment="Center" IsHitTestVisible="{c:Binding !FightTaskRunning}" - LostFocus="FightSettingsTextBoxLostFocus" Text="{Binding RemainingSanityStage, UpdateSourceTrigger=PropertyChanged}" ToolTip="{DynamicResource UseRemainingSanityStageTip}" Visibility="{c:Binding UseRemainingSanityStage and CustomStageCode}" />