feat: re-support NA server (YoStarEN) with basic function

This commit is contained in:
MistEO
2022-06-13 00:20:44 +08:00
parent c4e5328efb
commit 6ecef06c0b
10 changed files with 67 additions and 27 deletions

View File

@@ -20,7 +20,8 @@
},
"intent": {
"Official": "com.hypergryph.arknights/com.u8.sdk.U8UnityContext",
"Bilibili": "com.hypergryph.arknights.bilibili/com.u8.sdk.SplashActivity"
"Bilibili": "com.hypergryph.arknights.bilibili/com.u8.sdk.SplashActivity",
"YoStarEN": "com.YoStarEN.Arknights/com.u8.sdk.U8UnityContext"
},
"connection": {
"General": {

View File

@@ -8,8 +8,6 @@
- 使用理智药恢复理智
- 使用源石恢复理智
- 指定次数
- 掉落材料识别
- 上传 [企鹅物流数据统计](https://penguin-stats.cn/) 及设置用户 ID
- 公招计算
## US server resource file
@@ -20,6 +18,4 @@ Now supports:
- Restore with potion
- Restore with Originite
- Set the max number of auto battles
- Identify loot
- Upload results to [Penguin Statistics](https://penguin-stats.io/) with your own id
- Recruitment calculate

View File

@@ -6,17 +6,22 @@
],
"preDelay": 500,
"roi": [
800,
400,
480,
320
1000,
600,
280,
120
],
"exceededNext": [
"StageSNReturnFlag",
"Stop"
],
"action": "ClickSelf",
"next": [
"StartButton2",
"UseMedicine",
"UseStone",
"NoStone"
"NoStone",
"OfflineConfirm"
]
},
"PRTS": {
@@ -33,8 +38,8 @@
"action": "DoNothing",
"rearDelay": 5000,
"next": [
"PRTS2",
"PRTS",
"PRTS3",
"EndOfAction",
"PrtsErrorConfirm",
"OfflineConfirm",
@@ -43,15 +48,11 @@
},
"EndOfAction": {
"Doc": "本任务注册了插件 StageDropsTaskPlugin",
"algorithm": "OcrDetect",
"text": [
"Results"
],
"roi": [
0,
440,
440,
280
750,
400,
250,
150
],
"action": "DoNothing",
"next": [
@@ -96,6 +97,7 @@
"action": "ClickSelf",
"next": [
"UsePrts",
"UsePrts-StageSN",
"StartButton1"
]
},

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -764,6 +764,10 @@
[
"卡湿利安",
"卡涅利安"
],
[
"研",
"砾"
]
]
},

View File

@@ -91,13 +91,15 @@ bool asst::Resource::load(const std::string& dir)
// }
//}
for (const auto& entry : std::filesystem::directory_iterator(dir + RoguelikeCfgDirname)) {
if (entry.path().extension() != ".json") {
continue;
}
if (!m_roguelike_cfg_unique_ins.load(entry.path().string())) {
m_last_error = entry.path().string() + " Load failed";
return false;
if (std::filesystem::exists(dir + RoguelikeCfgDirname)) {
for (const auto& entry : std::filesystem::directory_iterator(dir + RoguelikeCfgDirname)) {
if (entry.path().extension() != ".json") {
continue;
}
if (!m_roguelike_cfg_unique_ins.load(entry.path().string())) {
m_last_error = entry.path().string() + " Load failed";
return false;
}
}
}

View File

@@ -82,9 +82,37 @@ namespace MeoAsstGui
}
}
private string _curResource = "";
public bool LoadGlobalResource()
{
bool loaded = true;
var settingsModel = _container.Get<SettingsViewModel>();
if (_curResource.Length == 0
&& settingsModel.ClientType == "YoStarEN"
&& _curResource != settingsModel.ClientType)
{
loaded = AsstLoadResource(System.IO.Directory.GetCurrentDirectory() + "\\resource\\global\\YoStarEN");
_curResource = "YoStarEN";
}
// 这种是手贱看到美服点了一下,又点回官服的
else if (_curResource.Length != 0
&& (settingsModel.ClientType == "Official" || settingsModel.ClientType == "Bilibili" || settingsModel.ClientType == String.Empty))
{
loaded = AsstLoadResource(System.IO.Directory.GetCurrentDirectory());
_curResource = "";
}
return loaded;
}
public void Init()
{
// basic resource for CN client
bool loaded = AsstLoadResource(System.IO.Directory.GetCurrentDirectory());
_curResource = "";
loaded = LoadGlobalResource();
_handle = AsstCreateEx(_callback, IntPtr.Zero);
if (loaded == false || _handle == IntPtr.Zero)
@@ -672,6 +700,12 @@ namespace MeoAsstGui
public bool AsstConnect(ref string error)
{
if (!LoadGlobalResource())
{
error = "Load Global Resource Failed";
return false;
}
var settings = _container.Get<SettingsViewModel>();
if (settings.AdbPath == String.Empty ||
settings.ConnectAddress == String.Empty)

View File

@@ -139,7 +139,8 @@ namespace MeoAsstGui
{
new CombData { Display = "不选择", Value = "" },
new CombData { Display = "官服", Value = "Official" },
new CombData { Display = "Bilibili服", Value = "Bilibili" }
new CombData { Display = "Bilibili服", Value = "Bilibili" },
new CombData { Display = "悠星美服 (YoStarEN)", Value = "YoStarEN" }
};
}