mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
perf.界面部分按钮异步化
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Stylet;
|
||||
using StyletIoC;
|
||||
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MeoAsstGui
|
||||
{
|
||||
public class MainFunctionViewModel : Screen
|
||||
@@ -264,10 +265,14 @@ namespace MeoAsstGui
|
||||
CreditShoppingCheckBoxIsEnable = true;
|
||||
}
|
||||
|
||||
public void StartSanity()
|
||||
public async void StartSanity()
|
||||
{
|
||||
var asstProxy = _container.Get<AsstProxy>();
|
||||
bool catched = asstProxy.AsstCatchDefault();
|
||||
var asstProxy = _container.Get<AsstProxy>();
|
||||
var task = Task.Run(() =>
|
||||
{
|
||||
return asstProxy.AsstCatchDefault();
|
||||
});
|
||||
bool catched = await task;
|
||||
CatchStatus = "捕获模拟器窗口:" + catched;
|
||||
if (!asstProxy.AsstStartSanity())
|
||||
{
|
||||
@@ -284,10 +289,15 @@ namespace MeoAsstGui
|
||||
}
|
||||
}
|
||||
|
||||
public void Visit()
|
||||
public async void Visit()
|
||||
{
|
||||
var asstProxy = _container.Get<AsstProxy>();
|
||||
bool catched = asstProxy.AsstCatchDefault();
|
||||
var asstProxy = _container.Get<AsstProxy>();
|
||||
var task = Task.Run(() =>
|
||||
{
|
||||
return asstProxy.AsstCatchDefault();
|
||||
});
|
||||
bool catched = await task;
|
||||
|
||||
CatchStatus = "捕获模拟器窗口:" + catched;
|
||||
if (!asstProxy.AsstStartVisit(CreditShopping))
|
||||
{
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using Stylet;
|
||||
using StyletIoC;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MeoAsstGui
|
||||
{
|
||||
public class RecruitViewModel : Screen
|
||||
@@ -98,12 +100,18 @@ namespace MeoAsstGui
|
||||
}
|
||||
}
|
||||
|
||||
public void StartCalc()
|
||||
public async void StartCalc()
|
||||
{
|
||||
var asstProxy = _container.Get<AsstProxy>();
|
||||
if (!asstProxy.AsstCatchDefault())
|
||||
{
|
||||
return;
|
||||
var asstProxy = _container.Get<AsstProxy>();
|
||||
var task = Task.Run(() =>
|
||||
{
|
||||
return asstProxy.AsstCatchDefault();
|
||||
});
|
||||
bool catchd = await task;
|
||||
if (!catchd)
|
||||
{
|
||||
RecruitInfo = "捕获模拟器窗口失败";
|
||||
return;
|
||||
}
|
||||
RecruitInfo = "正在识别……";
|
||||
RecruitResult = "";
|
||||
|
||||
Reference in New Issue
Block a user