From 56dfe8fdd32aa7fb03a6965db1849fa558a8734f Mon Sep 17 00:00:00 2001 From: MistEO Date: Tue, 16 May 2023 01:04:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=B9=81=E4=B8=AD?= =?UTF-8?q?=E8=B5=84=E6=BA=90=EF=BC=8C=E5=86=92=E7=83=9F=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=80=E6=9C=89=E5=A4=96=E6=9C=8D=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/global/txwy/resource/tasks.json | 1 + src/Cpp/main.cpp | 26 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/resource/global/txwy/resource/tasks.json b/resource/global/txwy/resource/tasks.json index 4d163418a5..0788d72020 100644 --- a/resource/global/txwy/resource/tasks.json +++ b/resource/global/txwy/resource/tasks.json @@ -1293,6 +1293,7 @@ ] }, "LE-Open": { + "algorithm": "OcrDetect", "text": [ "塵影餘音", "活動", diff --git a/src/Cpp/main.cpp b/src/Cpp/main.cpp index c3cc5ae573..54a57e3202 100644 --- a/src/Cpp/main.cpp +++ b/src/Cpp/main.cpp @@ -14,14 +14,28 @@ int main([[maybe_unused]] int argc, char** argv) // AsstSetUserDir(cur_path.c_str()); // 这里默认读取的是可执行文件同目录下 resource 文件夹里的资源 + bool load_error = false; bool loaded = AsstLoadResource(cur_path.string().c_str()); - - // 增量更新外服的资源 - // const auto oversea_path = cur_path / "resource" / "global" / "YoStarJP"; - // loaded &= AsstLoadResource(oversea_path.string().c_str()); - if (!loaded) { - std::cout << "load resource failed" << std::endl; + load_error = true; + std::cerr << "-------- load resource failed --------" << std::endl; + } + +#ifdef ASST_DEBUG + const auto overseas_dir = cur_path / "resource" / "global"; + for (const auto& client : { "YoStarJP", "YoStarEN", "YoStarKR", "txwy" }) { + const auto overseas_path = overseas_dir / client; + bool loaded = AsstLoadResource(cur_path.string().c_str()); + // 增量更新外服的资源 + loaded &= AsstLoadResource(overseas_path.string().c_str()); + if (!loaded) { + load_error = true; + std::cerr << "-------- load resource failed: " << client << " --------" << std::endl; + } + } +#endif + + if (load_error) { return -1; }