mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 17:57:01 +08:00
chore: 通过TryParse判断数量而不是字符串
This commit is contained in:
@@ -1850,12 +1850,10 @@ namespace MaaWpfGui
|
||||
return;
|
||||
}
|
||||
|
||||
if (value == "0" || !int.TryParse(value, out _))
|
||||
{
|
||||
UseStone = false;
|
||||
}
|
||||
|
||||
SetAndNotify(ref _medicineNumber, value);
|
||||
|
||||
// If the amount of medicine is 0, the stone is not used.
|
||||
UseStone = UseStone;
|
||||
SetFightParams();
|
||||
ViewStatusStorage.Set("MainFunction.UseMedicine.Quantity", MedicineNumber);
|
||||
}
|
||||
@@ -1871,7 +1869,8 @@ namespace MaaWpfGui
|
||||
get => _useStone;
|
||||
set
|
||||
{
|
||||
if (MedicineNumber == "0")
|
||||
// If the amount of medicine is 0, the stone is not used.
|
||||
if (!int.TryParse(MedicineNumber, out int result) || result == 0)
|
||||
{
|
||||
value = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user