feat: 执行识别任务时屏蔽识别按钮,避免二次开始任务

This commit is contained in:
uye
2023-04-23 19:39:46 +08:00
parent a6193ea5e9
commit ff3b7cc081
2 changed files with 20 additions and 4 deletions

View File

@@ -298,7 +298,7 @@ namespace MaaWpfGui.ViewModels.UI
return true;
}
private bool _depotDone = false;
private bool _depotDone = true;
/// <summary>
/// Gets or sets a value indicating whether depot info is parsed.
@@ -393,6 +393,17 @@ namespace MaaWpfGui.ViewModels.UI
set => SetAndNotify(ref _operBoxResult, value);
}
private bool _operBoxDone = true;
/// <summary>
/// Gets or sets a value indicating whether operBox info is parsed.
/// </summary>
public bool OperBoxDone
{
get => _operBoxDone;
set => SetAndNotify(ref _operBoxDone, value);
}
private string _operBoxExportData = string.Empty;
public bool OperBoxParse(JObject details)
@@ -450,6 +461,7 @@ namespace MaaWpfGui.ViewModels.UI
OperBoxInfo = LocalizationHelper.GetString("IdentificationCompleted") + "\n" + LocalizationHelper.GetString("OperBoxRecognitionTip");
OperBoxResult = string.Format(LocalizationHelper.GetString("OperBoxRecognitionResult"), operNotHave.Count, operNotHaveNames, operHave.Count, operHaveNames);
_operBoxExportData = details["own_opers"].ToString();
OperBoxDone = true;
}
else
{
@@ -462,6 +474,7 @@ namespace MaaWpfGui.ViewModels.UI
public async void StartOperBox()
{
_operBoxExportData = string.Empty;
OperBoxDone = false;
string errMsg = string.Empty;
OperBoxInfo = LocalizationHelper.GetString("ConnectingToEmulator");

View File

@@ -170,7 +170,8 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{s:Action StartDepot}"
Content="{DynamicResource StartToDepotRecognition}" />
Content="{DynamicResource StartToDepotRecognition}"
IsEnabled="{Binding DepotDone}" />
</StackPanel>
</Grid>
</TabItem>
@@ -215,13 +216,15 @@
Height="70"
Margin="30"
Command="{s:Action ExportOperBox}"
Content="{DynamicResource OperBoxCopyToClipboard}" />
Content="{DynamicResource OperBoxCopyToClipboard}"
IsEnabled="{Binding OperBoxDone}" />
<Button
Width="180"
Height="70"
Margin="30"
Command="{s:Action StartOperBox}"
Content="{DynamicResource StartToOperBoxRecognition}" />
Content="{DynamicResource StartToOperBoxRecognition}"
IsEnabled="{Binding OperBoxDone}" />
</StackPanel>
</Grid>
</TabItem>