diff --git a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs
index fc830e9752..5845844839 100644
--- a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs
+++ b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs
@@ -2868,8 +2868,6 @@ namespace MaaWpfGui.ViewModels.UI
SetAndNotify(ref _medicineNumber, value);
- // If the amount of medicine is 0, the stone is not used.
- UseStone = UseStone;
SetFightParams();
ConfigurationHelper.SetValue(ConfigurationKeys.UseMedicineQuantity, MedicineNumber);
}
@@ -2885,18 +2883,15 @@ namespace MaaWpfGui.ViewModels.UI
get => _useStoneWithNull;
set
{
- // If the amount of medicine is 0, the stone is not used.
- if (!int.TryParse(MedicineNumber, out int result) || result == 0)
- {
- value = false;
- }
-
SetAndNotify(ref _useStoneWithNull, value);
if (value != false && !UseMedicine)
{
UseMedicineWithNull = null;
}
+ MedicineNumber = "9999";
+ NotifyOfPropertyChange(nameof(UseStone));
+
SetFightParams();
}
}
@@ -2904,7 +2899,8 @@ namespace MaaWpfGui.ViewModels.UI
///
/// Gets or sets a value indicating whether to use originiums.
///
- private bool UseStone
+ // ReSharper disable once MemberCanBePrivate.Global
+ public bool UseStone
{
get => UseStoneWithNull != false;
set => UseStoneWithNull = value;
diff --git a/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml
index e80aff17c5..ec8cbcd9e2 100644
--- a/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml
+++ b/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml
@@ -38,6 +38,7 @@
VerticalContentAlignment="Center"
Content="{DynamicResource UseSanityPotion}"
IsChecked="{Binding UseMedicineWithNull}"
+ IsEnabled="{c:Binding !UseStone}"
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
Target={x:Type helper:CheckBoxHelper}}"
ToolTip="{DynamicResource CheckBoxesNotSavedAsNull}" />
@@ -70,6 +71,7 @@
HorizontalAlignment="Left"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
+ IsEnabled="{c:Binding !UseStone}"
Maximum="9999"
Minimum="0"
ValueChanged="NumericUpDown_ValueChanged"
@@ -173,7 +175,7 @@
VerticalContentAlignment="Center"
IsHitTestVisible="{c:Binding !FightTaskRunning}"
ItemsSource="{Binding SeriesList}"
- SelectedValue="{Binding Series}"/>
+ SelectedValue="{Binding Series}" />