mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 18:01:26 +08:00
fix: 修复自动战斗未加载更新后json的问题
This commit is contained in:
@@ -115,6 +115,21 @@ namespace MaaWpfGui
|
||||
}
|
||||
}
|
||||
|
||||
private bool _startEnabled = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the start button is enabled.
|
||||
/// </summary>
|
||||
public bool StartEnabled
|
||||
{
|
||||
get => _startEnabled;
|
||||
set
|
||||
{
|
||||
_startEnabled = value;
|
||||
NotifyOfPropertyChange(() => StartEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clears log.
|
||||
/// </summary>
|
||||
@@ -133,15 +148,28 @@ namespace MaaWpfGui
|
||||
get => _filename;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _filename, value);
|
||||
if (value == _filename)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_filename = value;
|
||||
NotifyOfPropertyChange(() => Filename);
|
||||
ClearLog();
|
||||
UpdateFileDoc(_filename);
|
||||
UpdateFilename();
|
||||
}
|
||||
}
|
||||
|
||||
private async void UpdateFilename()
|
||||
{
|
||||
StartEnabled = false;
|
||||
await UpdateFileDoc(_filename);
|
||||
StartEnabled = true;
|
||||
}
|
||||
|
||||
private const string CopilotIdPrefix = "maa://";
|
||||
|
||||
private async void UpdateFileDoc(string filename)
|
||||
private async Task UpdateFileDoc(string filename)
|
||||
{
|
||||
ClearLog();
|
||||
Url = CopilotUiUrl;
|
||||
@@ -196,6 +224,7 @@ namespace MaaWpfGui
|
||||
{
|
||||
ParseJsonAndShowInfo(jsonStr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private async Task<string> RequestCopilotServer(int copilotID)
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
Height="50"
|
||||
Command="{s:Action Start}"
|
||||
Content="{DynamicResource Start}"
|
||||
IsEnabled="{c:Binding StartEnabled}"
|
||||
Visibility="{c:Binding Idle}" />
|
||||
<Button
|
||||
Width="120"
|
||||
|
||||
Reference in New Issue
Block a user