diff --git a/resource/config.json b/resource/config.json index 702b377cdb..92dbec90cd 100644 --- a/resource/config.json +++ b/resource/config.json @@ -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": { diff --git a/resource/international/US/resource/readme.md b/resource/global/YoStarEN/resource/readme.md similarity index 65% rename from resource/international/US/resource/readme.md rename to resource/global/YoStarEN/resource/readme.md index acb17c3532..2b7bfe9cef 100644 --- a/resource/international/US/resource/readme.md +++ b/resource/global/YoStarEN/resource/readme.md @@ -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 diff --git a/resource/international/US/resource/tasks.json b/resource/global/YoStarEN/resource/tasks.json similarity index 95% rename from resource/international/US/resource/tasks.json rename to resource/global/YoStarEN/resource/tasks.json index d84ead90e4..e2e39304e0 100644 --- a/resource/international/US/resource/tasks.json +++ b/resource/global/YoStarEN/resource/tasks.json @@ -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" ] }, diff --git a/resource/international/US/resource/template/StartButton2.png b/resource/global/YoStarEN/resource/template/StartButton2.png similarity index 100% rename from resource/international/US/resource/template/StartButton2.png rename to resource/global/YoStarEN/resource/template/StartButton2.png diff --git a/resource/international/US/resource/template/UseMedicine.png b/resource/global/YoStarEN/resource/template/UseMedicine.png similarity index 100% rename from resource/international/US/resource/template/UseMedicine.png rename to resource/global/YoStarEN/resource/template/UseMedicine.png diff --git a/resource/international/US/resource/template/UsePrts.png b/resource/global/YoStarEN/resource/template/UsePrts.png similarity index 100% rename from resource/international/US/resource/template/UsePrts.png rename to resource/global/YoStarEN/resource/template/UsePrts.png diff --git a/resource/tasks.json b/resource/tasks.json index 968ba58f81..adb039213b 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -764,6 +764,10 @@ [ "卡湿利安", "卡涅利安" + ], + [ + "研", + "砾" ] ] }, diff --git a/src/MeoAssistant/Resource.cpp b/src/MeoAssistant/Resource.cpp index b1d581128c..e30502d999 100644 --- a/src/MeoAssistant/Resource.cpp +++ b/src/MeoAssistant/Resource.cpp @@ -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; + } } } diff --git a/src/MeoAsstGui/Helper/AsstProxy.cs b/src/MeoAsstGui/Helper/AsstProxy.cs index 2656c0d401..3f7edc8d31 100644 --- a/src/MeoAsstGui/Helper/AsstProxy.cs +++ b/src/MeoAsstGui/Helper/AsstProxy.cs @@ -82,9 +82,37 @@ namespace MeoAsstGui } } + private string _curResource = ""; + + public bool LoadGlobalResource() + { + bool loaded = true; + var settingsModel = _container.Get(); + 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(); if (settings.AdbPath == String.Empty || settings.ConnectAddress == String.Empty) diff --git a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs index 9ef438abe6..dfe49a6b26 100644 --- a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs +++ b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs @@ -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" } }; }