diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index e5c849c212..29af19d4d9 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -24,3 +24,6 @@ c9b5aa638a97397ab8666031ea646904527afc09 4b3b84df8f487be0ac86506c28dbebc4635f1282 91abbb7f175b93a58368a136acf3799666f770d2 49b3aba96b2dfe1cb187b193d38c436e96e33901 +bae271c09bb79e5cc2a7f8491ce882d276ac97b4 +3d83b80dd67d996a5f4f1732fe1eb36cacc7605e +21617270bcef2456cb7f89e54560ca6788450711 diff --git a/.github/workflows/dev-build-linux.yml b/.github/workflows/dev-build-linux.yml new file mode 100644 index 0000000000..a7f18c2e74 --- /dev/null +++ b/.github/workflows/dev-build-linux.yml @@ -0,0 +1,68 @@ +name: dev-build-linux + +on: + push: + branches-ignore: + - master + paths: + - 'src/MeoAssistant/**' + - '3rdparty/**' + - 'include/**' + - 'resource/**' + - 'cmake/**' + - CMakeLists.txt + pull_request: + branches: + - dev + paths: + - 'src/MeoAssistant/**' + - '3rdparty/**' + - 'include/**' + - 'resource/**' + - 'cmake/**' + - CMakeLists.txt + +jobs: + linux-latest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Install GCC-12 + run: | + sudo apt update + sudo apt upgrade + sudo apt install gcc-12 g++-12 + + - name: Setup ccache + uses: Chocobo1/setup-ccache-action@v1 + with: + remove_stale_cache: false + + - name: Build MAA + env: + CC: ccache gcc-12 + CXX: ccache g++-12 + run: | + mkdir -p build + cmake -B build \ + -DINSTALL_THIRD_LIBS=ON + # -DFASTDEPLOY_DIRECTORY=~/fastdeploy \ + # -DOPENCV_DIRECTORY=~/opencv/lib/cmake/opencv4 \ + cmake --build build + + mkdir -p install + cmake --install build --prefix install + + - name: tar files + run: | + mkdir -p release + cd install + tar czvf $GITHUB_WORKSPACE/release/MaaAssistantArknights.tar.gz . + + - uses: actions/upload-artifact@v3 + with: + name: MAA-linux + path: release/*.tar.gz diff --git a/.github/workflows/dev-build-mac.yml b/.github/workflows/dev-build-mac.yml index bfb5fac60a..3f08857d5f 100644 --- a/.github/workflows/dev-build-mac.yml +++ b/.github/workflows/dev-build-mac.yml @@ -5,23 +5,23 @@ on: branches-ignore: - master paths: - - 'src/MeoAssistant/**' - - 'src/MeoAsstGui/**' - - 'src/MeoAsstMac/**' + - 'src/MaaCore/**' + - 'src/MaaMacGui/**' - '3rdparty/**' - 'include/**' - 'resource/**' + - 'cmake/**' - CMakeLists.txt pull_request: branches: - dev paths: - - 'src/MeoAssistant/**' - - 'src/MeoAsstGui/**' - - 'src/MeoAsstMac/**' + - 'src/MaaCore/**' + - 'src/MaaMacGui/**' - '3rdparty/**' - 'include/**' - 'resource/**' + - 'cmake/**' - CMakeLists.txt jobs: @@ -41,16 +41,16 @@ jobs: run: | brew update --preinstall brew install ninja range-v3 - - name: Configure MeoAssistant + - name: Configure MaaCore run: | mkdir build && cd build cmake .. -GNinja -DBUILD_XCFRAMEWORK=ON -DBUILD_UNIVERSAL=ON - - name: Build libMeoAssistant + - name: Build libMaaCore run: cmake --build build - - name: Build MeoAsstMac - working-directory: src/MeoAsstMac - run: xcodebuild ARCHS="arm64 x86_64" CODE_SIGN_IDENTITY="-" DEVELOPMENT_TEAM="-" ONLY_ACTIVE_ARCH=NO -derivedDataPath DerivedData -project MeoAsstMac.xcodeproj -scheme MeoAsstMac + - name: Build MAA + working-directory: src/MaaMacGui + run: xcodebuild ARCHS="arm64 x86_64" CODE_SIGN_IDENTITY="-" DEVELOPMENT_TEAM="-" ONLY_ACTIVE_ARCH=NO -derivedDataPath DerivedData -project MeoAsstMac.xcodeproj -scheme MAA - uses: actions/upload-artifact@v3 with: name: MAA-macos - path: src/MeoAsstMac/DerivedData/Build/Products/Debug + path: src/MaaMacGui/DerivedData/Build/Products/Debug diff --git a/.github/workflows/dev-build-win.yml b/.github/workflows/dev-build-win.yml index f057e92f16..134aae8fbe 100644 --- a/.github/workflows/dev-build-win.yml +++ b/.github/workflows/dev-build-win.yml @@ -21,26 +21,26 @@ on: branches-ignore: - master paths: - - 'src/MeoAssistant/**' - - 'src/MeoAsstGui/**' + - 'src/MaaCore/**' + - 'src/MaaWpfGui/**' - '3rdparty/**' - 'tools/MaaBuilder/**' - tools/MaaBuilder.sln - 'include/**' - 'resource/**' - - MeoAssistantArknights.sln + - MAA.sln pull_request: branches: - dev paths: - - 'src/MeoAssistant/**' - - 'src/MeoAsstGui/**' + - 'src/MaaCore/**' + - 'src/MaaWpfGui/**' - '3rdparty/**' - 'tools/MaaBuilder/**' - tools/MaaBuilder.sln - 'include/**' - 'resource/**' - - MeoAssistantArknights.sln + - MAA.sln workflow_dispatch: inputs: Reason: diff --git a/.github/workflows/release-maa-linux.yml b/.github/workflows/release-maa-linux.yml new file mode 100644 index 0000000000..6460223ac9 --- /dev/null +++ b/.github/workflows/release-maa-linux.yml @@ -0,0 +1,61 @@ +name: dev-build-linux + +on: + release: + types: [published] + +jobs: + linux-latest: + runs-on: ubuntu-latest + steps: + - name: Setup tag info + run: | + GIT_TAG=${GITHUB_REF#refs/*/} + echo "GIT_TAG=${GIT_TAG}" >> $GITHUB_ENV + + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Install GCC-12 + run: | + sudo apt update + sudo apt upgrade + sudo apt install gcc-12 g++-12 + + - name: Setup ccache + uses: Chocobo1/setup-ccache-action@v1 + with: + remove_stale_cache: false + + - name: Build MAA + env: + CC: ccache gcc-12 + CXX: ccache g++-12 + run: | + mkdir -p build + cmake -B build \ + -DINSTALL_THIRD_LIBS=ON \ + -DINSTALL_RESOURCE=ON \ + -DINSTALL_PYTHON=ON + # -DFASTDEPLOY_DIRECTORY=~/fastdeploy \ + # -DOPENCV_DIRECTORY=~/opencv/lib/cmake/opencv4 \ + cmake --build build + + mkdir -p install + cmake --install build --prefix install + + - name: tar files + run: | + mkdir -p release + cd install + tar czvf $GITHUB_WORKSPACE/release/MAA-${{ env.GIT_TAG }}-linux.tar.gz . + + - name: Upload image to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: 'release/*.tar.gz' + file_glob: true + tag: ${{ env.GIT_TAG }} + overwrite: true diff --git a/.github/workflows/release-maa-mac.yml b/.github/workflows/release-maa-mac.yml index 7504760c36..dfcf59744a 100644 --- a/.github/workflows/release-maa-mac.yml +++ b/.github/workflows/release-maa-mac.yml @@ -26,31 +26,31 @@ jobs: run: | brew update --preinstall brew install ninja range-v3 create-dmg - - name: Configure MeoAssistant + - name: Configure MaaCore run: | mkdir build && cd build cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_XCFRAMEWORK=ON -DBUILD_UNIVERSAL=ON - - name: Build libMeoAssistant + - name: Build libMaaCore run: cmake --build build - - name: Build MeoAsstMac - working-directory: src/MeoAsstMac - run: xcodebuild -project MeoAsstMac.xcodeproj -scheme MeoAsstMac archive -archivePath MeoAsstMac.xcarchive -configuration Release - - name: Export MeoAsstMac - working-directory: src/MeoAsstMac - run: xcodebuild -exportArchive -archivePath MeoAsstMac.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath Export + - name: Build MAA + working-directory: src/MaaMacGui + run: xcodebuild -project MeoAsstMac.xcodeproj -scheme MAA archive -archivePath MAA.xcarchive -configuration Release + - name: Export MAA + working-directory: src/MaaMacGui + run: xcodebuild -exportArchive -archivePath MAA.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath Export - name: Create disk image - working-directory: src/MeoAsstMac - run: create-dmg --background dmg-bkg.png --window-size 500 300 --icon-size 128 --icon MeoAsstMac.app 0 120 --hide-extension MeoAsstMac.app --app-drop-link 270 120 MeoAsstMac.dmg Export/MeoAsstMac.app + working-directory: src/MaaMacGui + run: create-dmg --background dmg-bkg.png --window-size 500 300 --icon-size 128 --icon MAA.app 0 120 --hide-extension MAA.app --app-drop-link 270 120 MAA.dmg Export/MAA.app - name: Archive debug symbols - working-directory: src/MeoAsstMac/MeoAsstMac.xcarchive/dSYMs - run: ditto -c -k --keepParent MeoAsstMac.app.dSYM MeoAsstMac.app.dSYM.zip + working-directory: src/MaaMacGui/MAA.xcarchive/dSYMs + run: ditto -c -k --keepParent MAA.app.dSYM MAA.app.dSYM.zip - name: Upload products uses: actions/upload-artifact@v3 with: name: MAA-macos path: | - src/MeoAsstMac/MeoAsstMac.dmg - src/MeoAsstMac/MeoAsstMac.xcarchive/dSYMs/MeoAsstMac.app.dSYM.zip + src/MaaMacGui/MAA.dmg + src/MaaMacGui/MAA.xcarchive/dSYMs/MAA.app.dSYM.zip macos-release: name: macos-release @@ -69,8 +69,8 @@ jobs: name: MAA-macos - name: 'Verify image' run: | - mv MeoAsstMac.dmg $APP_DMG - mv MeoAsstMac.xcarchive/dSYMs/MeoAsstMac.app.dSYM.zip $APP_SYM + mv MAA.dmg $APP_DMG + mv MAA.xcarchive/dSYMs/MAA.app.dSYM.zip $APP_SYM hdiutil verify $APP_DMG - name: 'Notarize image' env: diff --git a/.github/workflows/release-nightly-ota.yml b/.github/workflows/release-nightly-ota.yml index c5cfa4ce77..b673495694 100644 --- a/.github/workflows/release-nightly-ota.yml +++ b/.github/workflows/release-nightly-ota.yml @@ -19,6 +19,9 @@ on: tag_name: description: 'Tag name to release' required: false + release_body: + type: string + required: false jobs: build-win-nightly: @@ -103,7 +106,7 @@ jobs: mkdir -pv build-ota && cd build-ota cd ${{ needs.build-win-nightly.outputs.tag }} mkdir -pv content - unzip -q *.zip -x '*.lib' -x '*.pdb' -x '*.config' -x '*.xml' -d content + unzip -q *.zip -x '*.lib' -x '*.pdb' -x '*.exp' -x '*.config' -x '*.xml' -d content cd .. gh release list --repo 'MaaAssistantArknights/MaaAssistantArknights' --limit ${{ inputs.limit || 30 }} | tee ./release_maa.txt @@ -146,6 +149,7 @@ jobs: tag: ${{ env.release_tag }} prerelease: true overwrite: true + body: ${{ inputs.release_body || '' }} - name: "Upload to server" uses: appleboy/scp-action@master with: diff --git a/.github/workflows/release-ota.yml b/.github/workflows/release-ota.yml index d41a9d9d54..b48ea46a97 100644 --- a/.github/workflows/release-ota.yml +++ b/.github/workflows/release-ota.yml @@ -35,7 +35,7 @@ jobs: run: | mkdir -pv build-ota && cd build-ota gh release list --repo 'MaaAssistantArknights/MaaAssistantArknights' --limit ${{ inputs.limit || 31 }} | tee ./release_maa.txt - gh release list --repo "${{ github.repository_owner }}/MaaRelease" --limit ${{ inputs.limit_2 || 30 }} | tee ./release_mr.txt + gh release list --repo "MaaAssistantArknights/MaaRelease" --limit ${{ inputs.limit_2 || 30 }} | tee ./release_mr.txt head -n 1 ./release_maa.txt | awk '{ print $1 }' > ./config tail -n +1 ./release_maa.txt | awk '{ print $1 }' > ./tags_maa.txt @@ -63,7 +63,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cd build-ota - $GITHUB_WORKSPACE/MaaAssistantArknights/tools/OTAPacker/build.sh 'MaaAssistantArknights/MaaAssistantArknights' ./config + $GITHUB_WORKSPACE/MaaAssistantArknights/tools/OTAPacker/build.sh 'MaaAssistantArknights/MaaAssistantArknights' ./config 'MaaAssistantArknights/MaaRelease' - name: "Commit and setup tag" run: | cd MaaRelease diff --git a/.gitmodules b/.gitmodules index 198c4a26ee..5379e7a573 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "test"] path = test url = https://github.com/MaaAssistantArknights/MaaTestSet.git -[submodule "src/MeoAsstMac"] - path = src/MeoAsstMac - url = https://github.com/MaaAssistantArknights/MeoAsstMac.git +[submodule "src/MaaMacGui"] + path = src/MaaMacGui + url = https://github.com/MaaAssistantArknights/MaaMacGui.git diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index cf6e421897..e3e3be2b7d 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -82,7 +82,8 @@ "UseRsVersion", "UseTagVersion", "WithCompileCoreRelease", - "WithCompileWpfRelease" + "WithCompileWpfRelease", + "WithSyncRes" ] } }, @@ -110,7 +111,8 @@ "UseRsVersion", "UseTagVersion", "WithCompileCoreRelease", - "WithCompileWpfRelease" + "WithCompileWpfRelease", + "WithSyncRes" ] } }, diff --git a/3rdparty/bin/onnxruntime_providers_shared.dll b/3rdparty/bin/onnxruntime_providers_shared.dll deleted file mode 100644 index 0891d54e9a..0000000000 Binary files a/3rdparty/bin/onnxruntime_providers_shared.dll and /dev/null differ diff --git a/3rdparty/include/Arknights-Tile-Pos/TileCalc.hpp b/3rdparty/include/Arknights-Tile-Pos/TileCalc.hpp index 5ea2056436..a07813cc11 100644 --- a/3rdparty/include/Arknights-Tile-Pos/TileCalc.hpp +++ b/3rdparty/include/Arknights-Tile-Pos/TileCalc.hpp @@ -40,6 +40,10 @@ namespace Map { public: TileCalc(int width, int height, const std::filesystem::path& dir); + + bool contains(const std::string& any_key); + bool contains(const LevelKey& key); + bool run(const std::string& any_key, bool side, std::vector>& out_pos, std::vector>& out_tiles) const; bool run(const LevelKey& key, bool side, std::vector>& out_pos, @@ -148,6 +152,20 @@ namespace Map return true; } + inline bool TileCalc::contains(const std::string& any_key) + { + auto iter = std::find_if(levels.cbegin(), levels.cend(), + [&any_key](const Level& level) -> bool { return level.key == any_key; }); + return iter != levels.cend(); + } + + bool TileCalc::contains(const LevelKey& key) + { + auto iter = std::find_if(levels.cbegin(), levels.cend(), + [&key](const Level& level) -> bool { return level.key == key; }); + return iter != levels.cend(); + } + inline bool TileCalc::run(const std::string& any_key, bool side, std::vector>& out_pos, std::vector>& out_tiles) const { @@ -158,6 +176,7 @@ namespace Map } return run(*iter, side, out_pos, out_tiles); } + inline bool TileCalc::run(const LevelKey& key, bool side, std::vector>& out_pos, std::vector>& out_tiles) const { diff --git a/3rdparty/include/Arknights-Tile-Pos/TileDef.hpp b/3rdparty/include/Arknights-Tile-Pos/TileDef.hpp index 6fef59d842..921dc39b4b 100644 --- a/3rdparty/include/Arknights-Tile-Pos/TileDef.hpp +++ b/3rdparty/include/Arknights-Tile-Pos/TileDef.hpp @@ -18,12 +18,15 @@ namespace Map bool operator==(const LevelKey& other) const noexcept { return empty_or_equal(stageId, other.stageId) && empty_or_equal(code, other.code) && - empty_or_equal(levelId, other.levelId) && empty_or_equal(name, other.name); + empty_or_equal(levelId, other.levelId) && empty_or_equal(name, other.name); } bool operator==(const std::string& any_key) const noexcept { + if (any_key.empty()) { + return false; + } return empty_or_equal(stageId, any_key) || empty_or_equal(code, any_key) || - empty_or_equal(levelId, any_key) || empty_or_equal(name, any_key); + empty_or_equal(levelId, any_key) || empty_or_equal(name, any_key); } }; } diff --git a/3rdparty/include/fastdeploy/backends/backend.h b/3rdparty/include/fastdeploy/backends/backend.h index 652d94cb88..02c94875d2 100644 --- a/3rdparty/include/fastdeploy/backends/backend.h +++ b/3rdparty/include/fastdeploy/backends/backend.h @@ -62,8 +62,11 @@ class BaseBackend { virtual TensorInfo GetOutputInfo(int index) = 0; virtual std::vector GetInputInfos() = 0; virtual std::vector GetOutputInfos() = 0; + // if copy_to_fd is true, copy memory data to FDTensor + // else share memory to FDTensor(only Paddle、ORT、TRT、OpenVINO support it) virtual bool Infer(std::vector& inputs, - std::vector* outputs) = 0; + std::vector* outputs, + bool copy_to_fd = true) = 0; virtual std::unique_ptr Clone(void *stream = nullptr, int device_id = -1) { FDERROR << "Clone no support" << std::endl; diff --git a/3rdparty/include/fastdeploy/backends/ort/ops/adaptive_pool2d.h b/3rdparty/include/fastdeploy/backends/ort/ops/adaptive_pool2d.h new file mode 100644 index 0000000000..556ca033b5 --- /dev/null +++ b/3rdparty/include/fastdeploy/backends/ort/ops/adaptive_pool2d.h @@ -0,0 +1,89 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include +#include +#include "fastdeploy/core/fd_tensor.h" +#include "fastdeploy/utils/utils.h" + +#ifndef NON_64_PLATFORM +#include "onnxruntime_cxx_api.h" // NOLINT + +#ifdef WITH_GPU +#include "fastdeploy/backends/op_cuda_kernels/adaptive_pool2d_kernel.h" +#endif + +namespace fastdeploy { +struct AdaptivePool2dKernel { + protected: + std::string pooling_type_ = "avg"; + std::vector output_size_ = {}; + Ort::CustomOpApi ort_; + void* compute_stream_; + const char* provider_; + + public: + AdaptivePool2dKernel(Ort::CustomOpApi ort, + const OrtKernelInfo* info, + const char* provider) + : ort_(ort) { + GetAttribute(info); + provider_ = provider; + } + + void GetAttribute(const OrtKernelInfo* info); + + void Compute(OrtKernelContext* context); + + void CpuAdaptivePool(const std::vector& input_size, + const std::vector& output_size, + const float* input_data, + float* output_data); +}; + +struct AdaptivePool2dOp + : Ort::CustomOpBase { + explicit AdaptivePool2dOp(const char* provider) : provider_(provider) {} + void* CreateKernel(Ort::CustomOpApi api, const OrtKernelInfo* info) const { + return new AdaptivePool2dKernel(api, info, provider_); + } + + const char* GetName() const { return "AdaptivePool2d"; } + + size_t GetInputTypeCount() const { return 1; } + + ONNXTensorElementDataType GetInputType(size_t index) const { + return ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT; + } + + size_t GetOutputTypeCount() const { return 1; } + + ONNXTensorElementDataType GetOutputType(size_t index) const { + return ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT; + } + + const char* GetExecutionProviderType() const { + return provider_; + } + private: + const char* provider_; +}; + +} // namespace fastdeploy + +#endif diff --git a/3rdparty/include/fastdeploy/backends/ort/ort_backend.h b/3rdparty/include/fastdeploy/backends/ort/ort_backend.h index 31c7698240..ab5f38e612 100644 --- a/3rdparty/include/fastdeploy/backends/ort/ort_backend.h +++ b/3rdparty/include/fastdeploy/backends/ort/ort_backend.h @@ -68,7 +68,8 @@ class OrtBackend : public BaseBackend { bool from_memory_buffer = false); bool Infer(std::vector& inputs, - std::vector* outputs) override; + std::vector* outputs, + bool copy_to_fd = true) override; int NumInputs() const override { return inputs_desc_.size(); } @@ -92,7 +93,7 @@ class OrtBackend : public BaseBackend { Ort::CustomOpDomain custom_op_domain_ = Ort::CustomOpDomain("Paddle"); #endif OrtBackendOption option_; - void CopyToCpu(const Ort::Value& value, FDTensor* tensor, - const std::string& name); + void OrtValueToFDTensor(const Ort::Value& value, FDTensor* tensor, + const std::string& name, bool copy_to_fd); }; } // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/backends/rknpu/rknpu2/rknpu2_backend.h b/3rdparty/include/fastdeploy/backends/rknpu/rknpu2/rknpu2_backend.h index 1aba24ec3b..af28fdddfb 100644 --- a/3rdparty/include/fastdeploy/backends/rknpu/rknpu2/rknpu2_backend.h +++ b/3rdparty/include/fastdeploy/backends/rknpu/rknpu2/rknpu2_backend.h @@ -72,7 +72,8 @@ class RKNPU2Backend : public BaseBackend { std::vector GetInputInfos() override; std::vector GetOutputInfos() override; bool Infer(std::vector& inputs, - std::vector* outputs) override; + std::vector* outputs, + bool copy_to_fd = true) override; private: // The object of rknn context. diff --git a/3rdparty/include/fastdeploy/core/fd_scalar.h b/3rdparty/include/fastdeploy/core/fd_scalar.h new file mode 100644 index 0000000000..1c390f68bb --- /dev/null +++ b/3rdparty/include/fastdeploy/core/fd_scalar.h @@ -0,0 +1,121 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#pragma once + +#include +#include + +#include "fastdeploy/core/fd_type.h" +#include "fastdeploy/core/float16.h" + +namespace fastdeploy { + +class Scalar { + public: + // Constructor support implicit + Scalar() : Scalar(0) {} + Scalar(double val) : dtype_(FDDataType::FP64) { // NOLINT + data_.f64 = val; + } + + Scalar(float val) : dtype_(FDDataType::FP32) { // NOLINT + data_.f32 = val; + } + + Scalar(float16 val) : dtype_(FDDataType::FP16) { // NOLINT + data_.f16 = val; + } + + Scalar(int64_t val) : dtype_(FDDataType::INT64) { // NOLINT + data_.i64 = val; + } + + Scalar(int32_t val) : dtype_(FDDataType::INT32) { // NOLINT + data_.i32 = val; + } + + Scalar(int16_t val) : dtype_(FDDataType::INT16) { // NOLINT + data_.i16 = val; + } + + Scalar(int8_t val) : dtype_(FDDataType::INT8) { // NOLINT + data_.i8 = val; + } + + Scalar(uint8_t val) : dtype_(FDDataType::UINT8) { // NOLINT + data_.ui8 = val; + } + + Scalar(bool val) : dtype_(FDDataType::BOOL) { // NOLINT + data_.b = val; + } + + // The compatible method for fliud operators, + // and it will be removed in the future. + explicit Scalar(const std::string& str_value) : dtype_(FDDataType::FP64) { + if (str_value == "inf") { + data_.f64 = std::numeric_limits::infinity(); + } else if (str_value == "-inf") { + data_.f64 = -std::numeric_limits::infinity(); + } else if (str_value == "nan") { + data_.f64 = std::numeric_limits::quiet_NaN(); + } else { + data_.f64 = std::stod(str_value); + } + } + + template inline RT to() const { + switch (dtype_) { + case FDDataType::FP32: + return static_cast(data_.f32); + case FDDataType::FP64: + return static_cast(data_.f64); + case FDDataType::FP16: + return static_cast(data_.f16); + case FDDataType::INT32: + return static_cast(data_.i32); + case FDDataType::INT64: + return static_cast(data_.i64); + case FDDataType::INT16: + return static_cast(data_.i16); + case FDDataType::INT8: + return static_cast(data_.i8); + case FDDataType::UINT8: + return static_cast(data_.ui8); + case FDDataType::BOOL: + return static_cast(data_.b); + default: + FDASSERT(false, "Invalid enum scalar data type `%s`.", + Str(dtype_).c_str()); + } + } + + FDDataType dtype() const { return dtype_; } + + private: + FDDataType dtype_; + union data { + bool b; + int8_t i8; + int16_t i16; + int32_t i32; + int64_t i64; + uint8_t ui8; + float16 f16; + float f32; + double f64; + } data_; +}; + +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/core/fd_tensor.h b/3rdparty/include/fastdeploy/core/fd_tensor.h index 6a86bba1b7..3c79b0c88c 100644 --- a/3rdparty/include/fastdeploy/core/fd_tensor.h +++ b/3rdparty/include/fastdeploy/core/fd_tensor.h @@ -19,6 +19,7 @@ #include #include "fastdeploy/core/allocate.h" +#include "fastdeploy/core/fd_scalar.h" #include "fastdeploy/core/fd_type.h" namespace fastdeploy { @@ -76,7 +77,8 @@ struct FASTDEPLOY_DECL FDTensor { // So take care with the user buffer void SetExternalData(const std::vector& new_shape, const FDDataType& data_type, void* data_buffer, - const Device& new_device = Device::CPU); + const Device& new_device = Device::CPU, + int new_device_id = -1); // Expand the shape of a Tensor. Insert a new axis that will appear // at the `axis` position in the expanded Tensor shape. @@ -126,6 +128,8 @@ struct FASTDEPLOY_DECL FDTensor { FDTensor() {} explicit FDTensor(const std::string& tensor_name); + explicit FDTensor(const char* tensor_name); + // Deep copy FDTensor(const FDTensor& other); // Move constructor @@ -136,6 +140,9 @@ struct FASTDEPLOY_DECL FDTensor { // Move assignment FDTensor& operator=(FDTensor&& other); + // Scalar to FDTensor + explicit FDTensor(const Scalar& scalar); + ~FDTensor() { FreeFn(); } static void CopyBuffer(void* dst, const void* src, size_t nbytes, diff --git a/3rdparty/include/fastdeploy/function/cast.h b/3rdparty/include/fastdeploy/function/cast.h new file mode 100644 index 0000000000..43ea17da26 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/cast.h @@ -0,0 +1,31 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** Cast x to output data type element-wise. Only for float type FDTensor + @param x The input tensor. + @param out The output tensor which stores the result. + @param output_dtype The type of output tensor. +*/ +FASTDEPLOY_DECL void Cast(const FDTensor& x, FDTensor* out, + FDDataType output_dtype); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/clip.h b/3rdparty/include/fastdeploy/function/clip.h new file mode 100644 index 0000000000..fce6aa67e8 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/clip.h @@ -0,0 +1,32 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** This operator clip all elements in input into the range [ min, max ]. Support float32, float64, int32, int64 + @param x The input tensor. + @param min The lower bound + @param max The uppper bound + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Clip(const FDTensor& x, double min, double max, + FDTensor* out); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/concat.h b/3rdparty/include/fastdeploy/function/concat.h index 2a89300bc8..ccda073a44 100644 --- a/3rdparty/include/fastdeploy/function/concat.h +++ b/3rdparty/include/fastdeploy/function/concat.h @@ -22,7 +22,7 @@ namespace function { /** Excute the concatenate operation for input FDTensor along given axis. @param x The input tensor. @param out The output tensor which stores the result. - @param axisi Axis which will be concatenated. + @param axis Axis which will be concatenated. */ FASTDEPLOY_DECL void Concat(const std::vector& x, FDTensor* out, diff --git a/3rdparty/include/fastdeploy/function/cumprod.h b/3rdparty/include/fastdeploy/function/cumprod.h new file mode 100644 index 0000000000..fd73e0a43c --- /dev/null +++ b/3rdparty/include/fastdeploy/function/cumprod.h @@ -0,0 +1,31 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** Excute the concatenate operation for input FDTensor along given axis. + @param x The input tensor. + @param out The output tensor which stores the result. + @param axisi Axis which will be concatenated. +*/ + +FASTDEPLOY_DECL void Cumprod(const FDTensor& x, FDTensor* out, int axis = 0); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/elementwise.h b/3rdparty/include/fastdeploy/function/elementwise.h new file mode 100644 index 0000000000..53d34da6e5 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/elementwise.h @@ -0,0 +1,105 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_scalar.h" +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { + +namespace function { + +/** Excute the add operation for input FDTensors. *out = x + y. + @param x The input tensor. + @param y The input tensor. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Add(const FDTensor& x, const FDTensor& y, FDTensor* out); + +/** Excute the subtract operation for input FDTensors. *out = x - y. + @param x The input tensor. + @param y The input tensor. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Subtract(const FDTensor& x, const FDTensor& y, + FDTensor* out); + +/** Excute the multiply operation for input FDTensors. *out = x * y. + @param x The input tensor. + @param y The input tensor. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Multiply(const FDTensor& x, const FDTensor& y, + FDTensor* out); + +/** Excute the divide operation for input FDTensors. *out = x / y. + @param x The input tensor. + @param y The input tensor. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Divide(const FDTensor& x, const FDTensor& y, + FDTensor* out); + +/** Excute the maximum operation for input FDTensors. *out = max(x, y). + @param x The input tensor. + @param y The input tensor. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Maximum(const FDTensor& x, const FDTensor& y, + FDTensor* out); + +} // namespace function + +FASTDEPLOY_DECL FDTensor operator+(const FDTensor& x, const FDTensor& y); + +template FDTensor operator+(const FDTensor& x, T y) { + return x + FDTensor(Scalar(y)); +} + +template FDTensor operator+(T x, const FDTensor& y) { + return FDTensor(Scalar(x)) + y; +} + +FASTDEPLOY_DECL FDTensor operator-(const FDTensor& x, const FDTensor& y); + +template FDTensor operator-(const FDTensor& x, T y) { + return x - FDTensor(Scalar(y)); +} + +template FDTensor operator-(T x, const FDTensor& y) { + return FDTensor(Scalar(x)) - y; +} + +FASTDEPLOY_DECL FDTensor operator*(const FDTensor& x, const FDTensor& y); + +template FDTensor operator*(const FDTensor& x, T y) { + return x * FDTensor(Scalar(y)); +} + +template FDTensor operator*(T x, const FDTensor& y) { + return FDTensor(Scalar(x)) * y; +} + +FASTDEPLOY_DECL FDTensor operator/(const FDTensor& x, const FDTensor& y); + +template FDTensor operator/(const FDTensor& x, T y) { + return x / FDTensor(Scalar(y)); +} + +template FDTensor operator/(T x, const FDTensor& y) { + return FDTensor(Scalar(x)) / y; +} + +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/elementwise_base.h b/3rdparty/include/fastdeploy/function/elementwise_base.h new file mode 100644 index 0000000000..7ce1a694d2 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/elementwise_base.h @@ -0,0 +1,265 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include + +#include "fastdeploy/core/fd_tensor.h" +#include "fastdeploy/function/eigen.h" + +namespace fastdeploy { +namespace function { + +#define DEFINE_ELEMENTWISE_OP(name) \ + template struct name##RawKernel { \ + void operator()(const FDTensor& x, const FDTensor& y, int axis, \ + FDTensor* out) { \ + if (x.Shape() == y.Shape()) { \ + SameDimsElementwiseCompute>()(x, y, out); \ + } else { \ + auto x_dims = x.Shape(); \ + auto y_dims = y.Shape(); \ + if (x_dims.size() >= y_dims.size()) { \ + ElementwiseCompute, T>(x, y, axis, \ + name##Functor(), out); \ + } else { \ + ElementwiseCompute, T>( \ + x, y, axis, Inverse##name##Functor(), out); \ + } \ + } \ + } \ + } + +inline void GetMidDims(const std::vector& x_dims, + const std::vector& y_dims, const int axis, + int* pre, int* n, int* post, + int* is_run_common_broadcast) { + *pre = 1; + *n = 1; + *post = 1; + *is_run_common_broadcast = 0; + for (int i = 0; i < axis; ++i) { + (*pre) *= x_dims[i]; + } + for (int i = 0; i < y_dims.size(); ++i) { + if (x_dims[i + axis] != y_dims[i]) { + FDASSERT(y_dims[i] == 1 || x_dims[i + axis] == 1, + "Broadcast dimension mismatch. Operands " + "could not be broadcast together with the shape of " + "X = [%s] and the shape of Y = [%s]. Received [%d] " + "in X is not equal to [%d] in Y.", + Str(x_dims).c_str(), Str(y_dims).c_str(), x_dims[i + axis], + y_dims[i]); + *is_run_common_broadcast = 1; + return; + } + (*n) *= y_dims[i]; + } + for (int i = axis + y_dims.size(); i < x_dims.size(); ++i) { + (*post) *= x_dims[i]; + } +} + +inline std::vector +TrimTrailingSingularDims(const std::vector& dims) { + // Remove trailing dimensions of size 1 for y + auto actual_dims_size = dims.size(); + for (; actual_dims_size != 0; --actual_dims_size) { + if (dims[actual_dims_size - 1] != 1) + break; + } + if (actual_dims_size == dims.size()) + return dims; + std::vector trim_dims; + trim_dims.resize(actual_dims_size); + for (int i = 0; i < actual_dims_size; ++i) { + trim_dims[i] = dims[i]; + } + return trim_dims; +} + +inline int GetElementwiseIndex(const int64_t* x_dims_array, const int max_dim, + const int64_t* index_array) { + int index_ = 0; + for (int i = 0; i < max_dim; i++) { + if (x_dims_array[i] > 1) { + index_ = index_ * x_dims_array[i] + index_array[i]; + } + } + return index_; +} + +inline void UpdateElementwiseIndexArray(const int64_t* out_dims_array, + const int max_dim, + int64_t* index_array) { + for (int i = max_dim - 1; i >= 0; --i) { + ++index_array[i]; + if (index_array[i] >= out_dims_array[i]) { + index_array[i] -= out_dims_array[i]; + } else { + break; + } + } +} + +inline void GetBroadcastDimsArrays(const std::vector& x_dims, + const std::vector& y_dims, + int64_t* x_dims_array, int64_t* y_dims_array, + int64_t* out_dims_array, const int max_dim, + const int axis) { + FDASSERT(axis >= 0, + "Axis should be great than or equal to 0, but received axis is %d.", + axis); + FDASSERT(axis < max_dim, + "Axis should be less than %d, but received axis is %d.", max_dim, + axis); + if (x_dims.size() > y_dims.size()) { + std::fill(y_dims_array, y_dims_array + axis, 1); + if (axis + y_dims.size() < max_dim) { + std::fill(y_dims_array + axis + y_dims.size(), y_dims_array + max_dim, 1); + } + std::copy(x_dims.data(), x_dims.data() + x_dims.size(), x_dims_array); + std::copy(y_dims.data(), y_dims.data() + y_dims.size(), + y_dims_array + axis); + } else { + std::fill(x_dims_array, x_dims_array + axis, 1); + if (axis + x_dims.size() < max_dim) { + std::fill(x_dims_array + axis + x_dims.size(), x_dims_array + max_dim, 1); + } + std::copy(x_dims.data(), x_dims.data() + x_dims.size(), + x_dims_array + axis); + std::copy(y_dims.data(), y_dims.data() + y_dims.size(), y_dims_array); + } + + for (int i = 0; i < max_dim; i++) { + FDASSERT(x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || + y_dims_array[i] <= 1, + "Broadcast dimension mismatch. Operands " + "could not be broadcast together with the shape of " + "X = [%s] and the shape of Y = [%s]. Received [%d] " + "in X is not equal to [%d] in Y.", + Str(x_dims).c_str(), Str(y_dims).c_str(), x_dims[i + axis], + y_dims[i]); + if ((x_dims_array[i] > 1 || y_dims_array[i] > 1) || + (x_dims_array[i] == 1 && y_dims_array[i] == 1)) { + out_dims_array[i] = (std::max)(x_dims_array[i], y_dims_array[i]); + } else { + out_dims_array[i] = -1; + } + } +} + +template +void CommonForwardBroadcastCPU(const FDTensor& x, const FDTensor& y, + FDTensor* z, int64_t* x_dims_array, + int64_t* y_dims_array, int64_t* out_dims_array, + int max_dim, Functor func, + const bool is_xsize_larger = true) { + std::vector index_array(max_dim, 0); + const T* x_data = reinterpret_cast(x.Data()); + const T* y_data = reinterpret_cast(y.Data()); + FDASSERT(x_data != nullptr, "The input X should not be empty."); + FDASSERT(y_data != nullptr, "The input X should not be empty."); + OutType* out_data = reinterpret_cast(z->Data()); + + const int out_size = std::accumulate(out_dims_array, out_dims_array + max_dim, + 1, std::multiplies()); + int x_index, y_index; + for (int out_index = 0; out_index < out_size; ++out_index) { + x_index = GetElementwiseIndex(x_dims_array, max_dim, index_array.data()); + y_index = GetElementwiseIndex(y_dims_array, max_dim, index_array.data()); + if (is_xsize_larger) { + out_data[out_index] = func(x_data[x_index], y_data[y_index]); + } else { + out_data[out_index] = func(y_data[y_index], x_data[x_index]); + } + + UpdateElementwiseIndexArray(out_dims_array, max_dim, index_array.data()); + } +} + +template +void CommonElementwiseBroadcastForward(const FDTensor& x, const FDTensor& y, + FDTensor* z, + const std::vector& x_dims, + const std::vector& y_dims, + Functor func, int axis, + const bool is_xsize_larger = true) { + int x_dims_size = x_dims.size(); + int y_dims_size = y_dims.size(); + int max_dim = (std::max)(x_dims_size, y_dims_size); + axis = (axis == -1 ? std::abs(x_dims_size - y_dims_size) : axis); + FDASSERT(axis >= 0, + "Axis should be great than or equal to 0, but received axis is %d.", + axis); + FDASSERT(axis < max_dim, + "Axis should be less than %d, but received axis is %d.", max_dim, + axis); + std::vector x_dims_array(max_dim); + std::vector y_dims_array(max_dim); + std::vector out_dims_array(max_dim); + GetBroadcastDimsArrays(x_dims, y_dims, x_dims_array.data(), + y_dims_array.data(), out_dims_array.data(), max_dim, + axis); + FDTensor tmp; + tmp.Allocate(out_dims_array, TypeToDataType::dtype); + CommonForwardBroadcastCPU( + x, y, &tmp, x_dims_array.data(), y_dims_array.data(), + out_dims_array.data(), max_dim, func, is_xsize_larger); + *z = std::move(tmp); +} + +template +void ElementwiseCompute(const FDTensor& x, const FDTensor& y, int axis, + Functor func, FDTensor* z) { + auto x_dims = x.Shape(); + auto y_dims = y.Shape(); + bool is_xsize_larger = true; + int max_dim = x_dims.size(); + if (x_dims.size() < y_dims.size()) { + is_xsize_larger = false; + max_dim = y_dims.size(); + } + + int diff_size = x_dims.size() - y_dims.size(); + axis = (axis == -1 ? std::abs(diff_size) : axis); + FDASSERT(axis >= 0, + "Axis should be great than or equal to 0, but received axis is %d.", + axis); + FDASSERT(axis < max_dim, + "Axis should be less than %d, but received axis is %d.", max_dim, + axis); + + int pre, n, post, is_run_common_broadcast, axis_trim = 0; + if (is_xsize_larger) { + auto y_dims_trimed = TrimTrailingSingularDims(y_dims); + axis_trim = (y_dims_trimed.size() == 0) ? x_dims.size() : axis; + GetMidDims(x_dims, y_dims_trimed, axis_trim, &pre, &n, &post, + &is_run_common_broadcast); + } else { + auto x_dims_trimed = TrimTrailingSingularDims(x_dims); + axis_trim = (x_dims_trimed.size() == 0) ? y_dims.size() : axis; + GetMidDims(y_dims, x_dims_trimed, axis_trim, &pre, &n, &post, + &is_run_common_broadcast); + } + // special case for common implementation. + // case 1: x=[2,3,1,5], y=[2,1,4,1] + // case 2: x=[2,3,4], y=[1,1,4] + CommonElementwiseBroadcastForward( + x, y, z, x_dims, y_dims, func, axis, is_xsize_larger); +} + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/elementwise_functor.h b/3rdparty/include/fastdeploy/function/elementwise_functor.h new file mode 100644 index 0000000000..1d60ab8a0f --- /dev/null +++ b/3rdparty/include/fastdeploy/function/elementwise_functor.h @@ -0,0 +1,131 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/function/eigen.h" +#include "fastdeploy/function/elementwise.h" +#include "fastdeploy/function/elementwise_base.h" +#include + +namespace fastdeploy { +namespace function { + +template struct SameDimsElementwiseCompute { + void operator()(const FDTensor& x, const FDTensor& y, FDTensor* z) { + z->Allocate(x.Shape(), x.Dtype()); + Functor()(x, y, z); + } +}; + +template struct SameDimsAddFunctor { + void operator()(const FDTensor& x, const FDTensor& y, FDTensor* z) { + const auto& dev = *EigenDeviceWrapper::GetInstance()->GetDevice(); + auto eigen_x = EigenVector::Flatten(x); + auto eigen_y = EigenVector::Flatten(y); + auto eigen_z = EigenVector::Flatten(*z); + eigen_z.device(dev) = eigen_x + eigen_y; + } +}; + +template struct SameDimsSubtractFunctor { + void operator()(const FDTensor& x, const FDTensor& y, FDTensor* z) { + const auto& dev = *EigenDeviceWrapper::GetInstance()->GetDevice(); + auto eigen_x = EigenVector::Flatten(x); + auto eigen_y = EigenVector::Flatten(y); + auto eigen_z = EigenVector::Flatten(*z); + eigen_z.device(dev) = eigen_x - eigen_y; + } +}; + +template struct SameDimsMultiplyFunctor { + void operator()(const FDTensor& x, const FDTensor& y, FDTensor* z) { + const auto& dev = *EigenDeviceWrapper::GetInstance()->GetDevice(); + auto eigen_x = EigenVector::Flatten(x); + auto eigen_y = EigenVector::Flatten(y); + auto eigen_z = EigenVector::Flatten(*z); + eigen_z.device(dev) = eigen_x * eigen_y; + } +}; + +template struct SameDimsDivideFunctor { + void operator()(const FDTensor& x, const FDTensor& y, FDTensor* z) { + const auto& dev = *EigenDeviceWrapper::GetInstance()->GetDevice(); + auto eigen_x = EigenVector::Flatten(x); + auto eigen_y = EigenVector::Flatten(y); + auto eigen_z = EigenVector::Flatten(*z); + eigen_z.device(dev) = eigen_x / eigen_y; + } +}; + +// Add +template struct AddFunctor { + inline T operator()(const T a, const T b) const { return a + b; } +}; +template struct InverseAddFunctor { + inline T operator()(const T a, const T b) const { return b + a; } +}; + +// Subtract +template struct SubtractFunctor { + inline T operator()(const T a, const T b) const { return a - b; } +}; +template struct InverseSubtractFunctor { + inline T operator()(const T a, const T b) const { return b - a; } +}; + +// Multiply +template struct MultiplyFunctor { + inline T operator()(const T a, const T b) const { return a * b; } +}; +template <> struct MultiplyFunctor { + inline bool operator()(const bool a, const bool b) const { return a && b; } +}; +template struct InverseMultiplyFunctor { + inline T operator()(const T a, const T b) const { return b * a; } +}; +template <> struct InverseMultiplyFunctor { + inline bool operator()(const bool a, const bool b) const { return b && a; } +}; + +// Divide +#define DIV_ERROR_INFO \ + "InvalidArgumentError: Integer division by zero encountered in " \ + "(floor) divide. Please check the input value." + +template struct DivideFunctor { + inline T operator()(const T a, const T b) const { return a / b; } +}; + +template +struct DivideFunctor< + T, typename std::enable_if::value>::type> { + inline T operator()(const T a, const T b) const { + // For int32/int64, need to check whether the divison is zero. + FDASSERT(b != 0, DIV_ERROR_INFO); + return a / b; + } +}; + +template struct InverseDivideFunctor { + inline T operator()(const T a, const T b) const { return b / a; } +}; + +// Maximum +template struct MaximumFunctor { + inline T operator()(const T a, const T b) const { return a > b ? a : b; } +}; + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/full.h b/3rdparty/include/fastdeploy/function/full.h new file mode 100644 index 0000000000..6e7dd58b10 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/full.h @@ -0,0 +1,44 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_scalar.h" +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** Fill the value to tensor + @param value The value to be filled in tensor + @param shape The shape of output tensor. + @param out The output tensor which stores the result. + @param dtype The data type of output tensor. Default to float32 +*/ +FASTDEPLOY_DECL void Full(const Scalar& value, + const std::vector& shape, FDTensor* out, + FDDataType dtype = FDDataType::FP32); + +/** Fill the value to tensor + @param x The input tensor. + @param value The value to be filled in tensor + @param out The output tensor which stores the result. + @param dtype The data type of output tensor. Default to float32 +*/ +FASTDEPLOY_DECL void FullLike(const FDTensor& x, const Scalar& value, + FDTensor* out, + FDDataType dtype = FDDataType::FP32); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/functions.h b/3rdparty/include/fastdeploy/function/functions.h new file mode 100644 index 0000000000..a43407839f --- /dev/null +++ b/3rdparty/include/fastdeploy/function/functions.h @@ -0,0 +1,36 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/function/cast.h" +#include "fastdeploy/function/clip.h" +#include "fastdeploy/function/concat.h" +#include "fastdeploy/function/cumprod.h" +#include "fastdeploy/function/elementwise.h" +#include "fastdeploy/function/full.h" +#include "fastdeploy/function/gather_scatter_along_axis.h" +#include "fastdeploy/function/gaussian_random.h" +#include "fastdeploy/function/isfinite.h" +#include "fastdeploy/function/linspace.h" +#include "fastdeploy/function/math.h" +#include "fastdeploy/function/pad.h" +#include "fastdeploy/function/quantile.h" +#include "fastdeploy/function/reduce.h" +#include "fastdeploy/function/slice.h" +#include "fastdeploy/function/softmax.h" +#include "fastdeploy/function/sort.h" +#include "fastdeploy/function/split.h" +#include "fastdeploy/function/tile.h" +#include "fastdeploy/function/transpose.h" diff --git a/3rdparty/include/fastdeploy/function/gather_scatter_along_axis.h b/3rdparty/include/fastdeploy/function/gather_scatter_along_axis.h new file mode 100644 index 0000000000..bd1093af17 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/gather_scatter_along_axis.h @@ -0,0 +1,33 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** Output is obtained by gathering entries of axis of x indexed by index and + * concatenate them together. + @param x The input tensor. + @param index The index of a tensor to gather. + @param out The output tensor which stores the result. + @param axis Axis which will be gathered. +*/ +void GatherAlongAxis(const FDTensor& x, const FDTensor& index, FDTensor* result, + int axis); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/gaussian_random.h b/3rdparty/include/fastdeploy/function/gaussian_random.h new file mode 100644 index 0000000000..85a4ff8a63 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/gaussian_random.h @@ -0,0 +1,36 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** Output is obtained by gathering entries of axis of x indexed by index and + * concatenate them together. + @param shape The output tensor shape. + @param out the output tensor. + @param mean mean value of gaussian random + @param std standard value of gaussian random + @param seed The seed of random generator. + @param dtype The data type of the output Tensor. +*/ +void GaussianRandom(const std::vector& shape, FDTensor* out, + FDDataType dtype = FDDataType::FP32, float mean = 0.0f, + float std = 1.0f, int seed = 0); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/isfinite.h b/3rdparty/include/fastdeploy/function/isfinite.h new file mode 100644 index 0000000000..7450a99425 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/isfinite.h @@ -0,0 +1,47 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** Return whether every element of input tensor is NaN or not. + @param x The input tensor. + @param out The output tensor which stores the result. + @param dtype The output data type +*/ +FASTDEPLOY_DECL void IsNan(const FDTensor& x, FDTensor* out, + FDDataType dtype = FDDataType::BOOL); + +/** Return whether every element of input tensor is Inf or not. + @param x The input tensor. + @param out The output tensor which stores the result. + @param dtype The output data type +*/ +FASTDEPLOY_DECL void IsInf(const FDTensor& x, FDTensor* out, + FDDataType dtype = FDDataType::BOOL); + +/** Return whether every element of input tensor is finite or not. + @param x The input tensor. + @param out The output tensor which stores the result. + @param dtype The output data type +*/ +FASTDEPLOY_DECL void IsFinite(const FDTensor& x, FDTensor* out, + FDDataType dtype = FDDataType::BOOL); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/linspace.h b/3rdparty/include/fastdeploy/function/linspace.h new file mode 100644 index 0000000000..c3b6ac8a5d --- /dev/null +++ b/3rdparty/include/fastdeploy/function/linspace.h @@ -0,0 +1,33 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** Return fixed number of evenly spaced values within a given interval. + @param start The input start is start variable of range. + @param end The input stop is start variable of range. + @param num The input num is given num of the sequence. + @param out The output tensor which stores the result. + @param dtype The data type of output tensor, default to float32. +*/ +FASTDEPLOY_DECL void Linspace(double start, double end, int num, FDTensor* out, + FDDataType dtype = FDDataType::FP32); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/math.h b/3rdparty/include/fastdeploy/function/math.h new file mode 100644 index 0000000000..7b2a0332dd --- /dev/null +++ b/3rdparty/include/fastdeploy/function/math.h @@ -0,0 +1,65 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** Calculates the sqrt of the given input Tensor, element-wise. Only for float type FDTensor + @param x The input tensor. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Sqrt(const FDTensor& x, FDTensor* out); + +/** Calculates the natural log of the given input Tensor, element-wise. Only for float type FDTensor + @param x The input tensor. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Log(const FDTensor& x, FDTensor* out); + +/** Rounds the values in the input to the nearest integer value, element-wise. Only for float type FDTensor + @param x The input tensor. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Round(const FDTensor& x, FDTensor* out); + +/** Computes exp of x element-wise with a natural number e as the base, element-wise. Only for float type FDTensor + @param x The input tensor. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Exp(const FDTensor& x, FDTensor* out); + +/** This operator is used to perform elementwise abs for input X. Only for float type FDTensor + @param x The input tensor. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Abs(const FDTensor& x, FDTensor* out); + +/** Computes ceil of x element-wise. Only for float type FDTensor + @param x The input tensor. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Ceil(const FDTensor& x, FDTensor* out); + +/** Computes floor of x element-wise. Only for float type FDTensor + @param x The input tensor. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Floor(const FDTensor& x, FDTensor* out); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/math_functor.h b/3rdparty/include/fastdeploy/function/math_functor.h new file mode 100644 index 0000000000..4ef85b961c --- /dev/null +++ b/3rdparty/include/fastdeploy/function/math_functor.h @@ -0,0 +1,81 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/function/eigen.h" + +namespace fastdeploy { +namespace function { + +// log(x) = natural logarithm of x +template struct LogFunctor { + template + void operator()(Device d, X x, Out out) const { + out.device(d) = x.log(); + } +}; + +// exp functor +// exp(x) = e^x +template struct ExpFunctor { + template + void operator()(Device d, X x, Out out) const { + out.device(d) = x.exp(); + } +}; + +// round(x) = [x] +template struct RoundFunctor { + template + void operator()(Device d, X x, Out out) const { + out.device(d) = x.round(); + } +}; + +// sqrt(x) = x^(1/2) +template struct SqrtFunctor { + template + void operator()(Device d, X x, Out out) const { + out.device(d) = x.sqrt(); + } +}; + +// abs(x) = x if x > 0 else -x +template struct AbsFunctor { + template + void operator()(Device d, X x, Out out) const { + out.device(d) = + x.unaryExpr([](T v) { return v > static_cast(0) ? v : -v; }); + } +}; + +// ceil(x) = ceiling(x) +template struct CeilFunctor { + template + void operator()(Device d, X x, Out out) const { + out.device(d) = x.ceil(); + } +}; + +// floor(x) = flooring(x) +template struct FloorFunctor { + template + void operator()(Device d, X x, Out out) const { + out.device(d) = x.floor(); + } +}; + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/quantile.h b/3rdparty/include/fastdeploy/function/quantile.h new file mode 100644 index 0000000000..bcde603939 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/quantile.h @@ -0,0 +1,34 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** Compute the quantile of the input along the specified axis. If any values + ** in a reduced row are NaN, then the quantiles for that reduction will be NaN. + @param x The input tensor. + @param q The q for calculate quantile, which should be in range [0, 1]. + @param axis The axis along which to calculate quantile. axis should be int + or list of int. + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Quantile(const FDTensor& x, const std::vector& q, + const std::vector& axis, FDTensor* out); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/slice.h b/3rdparty/include/fastdeploy/function/slice.h new file mode 100644 index 0000000000..e35ee57627 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/slice.h @@ -0,0 +1,44 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** This operator produces a slice of input along multiple axes. + @param x The input tensor. + @param axes Axes that starts and ends apply to. + @param starts If starts is a list or tuple, the elements of it should be + integers or Tensors with shape [1]. If starts is an Tensor, it should + be an 1-D Tensor. It represents starting indices of corresponding axis + in axes + @param ends If ends is a list or tuple, the elements of it should be + integers or Tensors with shape [1]. If ends is an Tensor, it should + be an 1-D Tensor . It represents ending indices of corresponding axis + in axes. + @param out The output tensor which stores the result. +*/ + +FASTDEPLOY_DECL void Slice(const FDTensor& x, const std::vector& axes, + const std::vector& starts, + const std::vector& ends, FDTensor* out); + +FASTDEPLOY_DECL void Slice(const FDTensor& x, const std::vector& axes, + const std::vector& index, FDTensor* out); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/sort.h b/3rdparty/include/fastdeploy/function/sort.h new file mode 100644 index 0000000000..2de51511b7 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/sort.h @@ -0,0 +1,47 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** + * @brief Performs sorting on the input tensor along the given axis and outputs + * two tensors, Output(Out) and Output(Indices). They reserve the same + * shape with Input(X), and Output(Out) represents the sorted tensor + * while Output(Indices) gives the sorted order along the given axis + * Attr(axis). + * @param x The input of sort + * @param out The sorted tensor of sort op, with the same shape as + * x + * @param indices The indices of a tensor giving the sorted order, with + * the same shape as x + * @param axis The axis along which to sort the tensor. + * When axis < 0, the actual axis will be the |axis|'th + * counting backwards + * @param descending The descending attribute is a flag to tell + * algorithm how to sort the input data. + * If descending is true, will sort by descending order, + * else if false, sort by ascending order + * @param indices_type The data type of indices, default to int64 + */ +FASTDEPLOY_DECL void Sort(const FDTensor& x, FDTensor* out, FDTensor* indices, + int axis = 0, bool descending = false, + FDDataType indices_type = FDDataType::INT64); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/split.h b/3rdparty/include/fastdeploy/function/split.h new file mode 100644 index 0000000000..162845d0d6 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/split.h @@ -0,0 +1,36 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** Split the input tensor into multiple sub-Tensors. + @param x The input tensor. + @param num_or_sections f num_or_sections is an int, then num_or_sections + indicates the number of equal sized sub-Tensors that the x will + be divided into. + @param out The output vector tensor which stores the result. + @param axis Axis which will be splitted. +*/ + +FASTDEPLOY_DECL void Split(const FDTensor& x, + const std::vector& num_or_sections, + std::vector* out, int axis = 0); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/function/tile.h b/3rdparty/include/fastdeploy/function/tile.h new file mode 100644 index 0000000000..26d6abd760 --- /dev/null +++ b/3rdparty/include/fastdeploy/function/tile.h @@ -0,0 +1,36 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include "fastdeploy/core/fd_tensor.h" + +namespace fastdeploy { +namespace function { + +/** Construct a new Tensor by repeating x the number of times given by + ** repeat_times. After tiling, the value of the i’th dimension of the + ** output is equal to x.shape[i]*repeat_times[i]. Both the number of + ** dimensions of x and the number of elements in repeat_times should + ** be less than or equal to 6.Support all data types. + @param x The input tensor. + @param repeat_times The lower bound + @param out The output tensor which stores the result. +*/ +FASTDEPLOY_DECL void Tile(const FDTensor& x, + const std::vector& repeat_times, + FDTensor* out); + +} // namespace function +} // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/runtime.h b/3rdparty/include/fastdeploy/runtime.h index 6ea5840268..e53c7ca1ed 100644 --- a/3rdparty/include/fastdeploy/runtime.h +++ b/3rdparty/include/fastdeploy/runtime.h @@ -24,9 +24,9 @@ #include #include +#include "backends/rknpu/rknpu2/rknpu2_config.h" #include "fastdeploy/backends/backend.h" #include "fastdeploy/utils/perf.h" -#include "backends/rknpu/rknpu2/rknpu2_config.h" /** \brief All C++ FastDeploy APIs are defined inside this namespace * @@ -35,14 +35,14 @@ namespace fastdeploy { /*! Inference backend supported in FastDeploy */ enum Backend { - UNKNOWN, ///< Unknown inference backend - ORT, ///< ONNX Runtime, support Paddle/ONNX format model, CPU / Nvidia GPU - TRT, ///< TensorRT, support Paddle/ONNX format model, Nvidia GPU only + UNKNOWN, ///< Unknown inference backend + ORT, ///< ONNX Runtime, support Paddle/ONNX format model, CPU / Nvidia GPU + TRT, ///< TensorRT, support Paddle/ONNX format model, Nvidia GPU only PDINFER, ///< Paddle Inference, support Paddle format model, CPU / Nvidia GPU POROS, ///< Poros, support TorchScript format model, CPU / Nvidia GPU OPENVINO, ///< Intel OpenVINO, support Paddle/ONNX format, CPU only - LITE, ///< Paddle Lite, support Paddle format model, ARM CPU only - RKNPU2, ///< RKNPU2, support RKNN format model, Rockchip NPU only + LITE, ///< Paddle Lite, support Paddle format model, ARM CPU only + RKNPU2, ///< RKNPU2, support RKNN format model, Rockchip NPU only }; FASTDEPLOY_DECL std::ostream& operator<<(std::ostream& out, @@ -94,10 +94,10 @@ struct FASTDEPLOY_DECL RuntimeOption { /// Use Nvidia GPU to inference void UseGpu(int gpu_id = 0); - void UseRKNPU2(fastdeploy::rknpu2::CpuName rknpu2_name - = fastdeploy::rknpu2::CpuName::RK3588, - fastdeploy::rknpu2::CoreMask rknpu2_core - = fastdeploy::rknpu2::CoreMask::RKNN_NPU_CORE_0); + void UseRKNPU2(fastdeploy::rknpu2::CpuName rknpu2_name = + fastdeploy::rknpu2::CpuName::RK3588, + fastdeploy::rknpu2::CoreMask rknpu2_core = + fastdeploy::rknpu2::CoreMask::RKNN_NPU_CORE_0); /// Use TimVX to inference void UseTimVX(); @@ -116,9 +116,7 @@ struct FASTDEPLOY_DECL RuntimeOption { void UsePaddleBackend(); /// Wrapper function of UsePaddleBackend() - void UsePaddleInferBackend() { - return UsePaddleBackend(); - } + void UsePaddleInferBackend() { return UsePaddleBackend(); } /// Set ONNX Runtime as inference backend, support CPU/GPU void UseOrtBackend(); @@ -136,9 +134,7 @@ struct FASTDEPLOY_DECL RuntimeOption { void UseLiteBackend(); /// Wrapper function of UseLiteBackend() - void UsePaddleLiteBackend() { - return UseLiteBackend(); - } + void UsePaddleLiteBackend() { return UseLiteBackend(); } /// Set mkldnn switch while using Paddle Inference as inference backend void SetPaddleMKLDNN(bool pd_mkldnn = true); @@ -177,7 +173,7 @@ struct FASTDEPLOY_DECL RuntimeOption { * @brief Set shape info for OpenVINO */ void SetOpenVINOShapeInfo( - const std::map>& shape_info) { + const std::map>& shape_info) { ov_shape_infos = shape_info; } @@ -197,7 +193,7 @@ struct FASTDEPLOY_DECL RuntimeOption { * @brief Set nnadapter subgraph partition path for Paddle Lite backend. */ void SetLiteSubgraphPartitionPath( - const std::string& nnadapter_subgraph_partition_config_path); + const std::string& nnadapter_subgraph_partition_config_path); /** * @brief enable half precision while use paddle lite backend @@ -275,6 +271,11 @@ struct FASTDEPLOY_DECL RuntimeOption { */ void DisablePaddleTrtCollectShape(); + /** + * @brief Prevent ops running in paddle trt backend + */ + void DisablePaddleTrtOPs(const std::vector& ops); + /* * @brief Set number of streams by the OpenVINO backends */ @@ -363,6 +364,8 @@ struct FASTDEPLOY_DECL RuntimeOption { bool trt_enable_int8 = false; size_t trt_max_batch_size = 32; size_t trt_max_workspace_size = 1 << 30; + // ======Only for PaddleTrt Backend======= + std::vector trt_disabled_ops_{}; // ======Only for Poros Backend======= bool is_dynamic = false; @@ -378,12 +381,12 @@ struct FASTDEPLOY_DECL RuntimeOption { std::vector ov_cpu_operators; // ======Only for RKNPU2 Backend======= - fastdeploy::rknpu2::CpuName rknpu2_cpu_name_ - = fastdeploy::rknpu2::CpuName::RK3588; - fastdeploy::rknpu2::CoreMask rknpu2_core_mask_ - = fastdeploy::rknpu2::CoreMask::RKNN_NPU_CORE_AUTO; + fastdeploy::rknpu2::CpuName rknpu2_cpu_name_ = + fastdeploy::rknpu2::CpuName::RK3588; + fastdeploy::rknpu2::CoreMask rknpu2_core_mask_ = + fastdeploy::rknpu2::CoreMask::RKNN_NPU_CORE_AUTO; - std::string model_file = ""; // Path of model file + std::string model_file = ""; // Path of model file std::string params_file = ""; // Path of parameters file, can be empty // format of input model ModelFormat model_format = ModelFormat::AUTOREC; @@ -405,6 +408,12 @@ struct FASTDEPLOY_DECL Runtime { bool Infer(std::vector& input_tensors, std::vector* output_tensors); + /** \brief No params inference the model. + * + * the input and output data need to pass through the BindInputTensor and GetOutputTensor interfaces. + */ + bool Infer(); + /** \brief Compile TorchScript Module, only for Poros backend * * \param[in] prewarm_tensors Prewarm datas for compile @@ -432,14 +441,19 @@ struct FASTDEPLOY_DECL Runtime { /** \brief Get all the output information */ std::vector GetOutputInfos(); + /** \brief Bind FDTensor by name, no copy and share input memory + */ + void BindInputTensor(const std::string& name, FDTensor& input); + /** \brief Get output FDTensor by name, no copy and share backend output memory + */ + FDTensor* GetOutputTensor(const std::string& name); /** \brief Clone new Runtime when multiple instances of the same model are created * * \param[in] stream CUDA Stream, defualt param is nullptr * \return new Runtime* by this clone */ - Runtime* Clone(void* stream = nullptr, - int device_id = -1); + Runtime* Clone(void* stream = nullptr, int device_id = -1); RuntimeOption option; @@ -451,5 +465,7 @@ struct FASTDEPLOY_DECL Runtime { void CreateLiteBackend(); void CreateRKNPU2Backend(); std::unique_ptr backend_; + std::vector input_tensors_; + std::vector output_tensors_; }; } // namespace fastdeploy diff --git a/3rdparty/include/fastdeploy/utils/utils.h b/3rdparty/include/fastdeploy/utils/utils.h index 9e41c6e250..0dff28f8be 100644 --- a/3rdparty/include/fastdeploy/utils/utils.h +++ b/3rdparty/include/fastdeploy/utils/utils.h @@ -66,7 +66,8 @@ class FASTDEPLOY_DECL FDLogger { if (!verbose_ && line_ != "") { std::cout << line_ << std::endl; #ifdef __ANDROID__ - __android_log_print(ANDROID_LOG_INFO, prefix_.c_str(), "%s", line_.c_str()); + __android_log_print(ANDROID_LOG_INFO, prefix_.c_str(), "%s", + line_.c_str()); #endif } } @@ -122,6 +123,8 @@ FASTDEPLOY_DECL bool ReadBinaryFromFile(const std::string& file, [&] { \ const auto& __dtype__ = TYPE; \ switch (__dtype__) { \ + FD_PRIVATE_CASE_TYPE(NAME, ::fastdeploy::FDDataType::UINT8, uint8_t, \ + __VA_ARGS__) \ FD_PRIVATE_CASE_TYPE(NAME, ::fastdeploy::FDDataType::BOOL, bool, \ __VA_ARGS__) \ FD_PRIVATE_CASE_TYPE(NAME, ::fastdeploy::FDDataType::INT32, int32_t, \ @@ -153,10 +156,12 @@ FASTDEPLOY_DECL bool ReadBinaryFromFile(const std::string& file, __VA_ARGS__) \ FD_PRIVATE_CASE_TYPE(NAME, ::fastdeploy::FDDataType::FP64, double, \ __VA_ARGS__) \ + FD_PRIVATE_CASE_TYPE(NAME, ::fastdeploy::FDDataType::UINT8, uint8_t, \ + __VA_ARGS__) \ default: \ FDASSERT(false, \ "Invalid enum data type. Expect to accept data type INT32, " \ - "INT64, FP32, FP64, but receive type %s.", \ + "INT64, FP32, FP64, UINT8 but receive type %s.", \ Str(__dtype__).c_str()); \ } \ }() @@ -185,10 +190,12 @@ FASTDEPLOY_DECL bool ReadBinaryFromFile(const std::string& file, __VA_ARGS__) \ FD_PRIVATE_CASE_TYPE(NAME, ::fastdeploy::FDDataType::INT64, int64_t, \ __VA_ARGS__) \ + FD_PRIVATE_CASE_TYPE(NAME, ::fastdeploy::FDDataType::UINT8, uint8_t, \ + __VA_ARGS__) \ default: \ FDASSERT(false, \ "Invalid enum data type. Expect to accept data type INT32, " \ - "INT64, but receive type %s.", \ + "INT64, UINT8 but receive type %s.", \ Str(__dtype__).c_str()); \ } \ }() diff --git a/3rdparty/include/fastdeploy/vision/common/processors/mat.h b/3rdparty/include/fastdeploy/vision/common/processors/mat.h index 8c19080301..dc13c823b4 100644 --- a/3rdparty/include/fastdeploy/vision/common/processors/mat.h +++ b/3rdparty/include/fastdeploy/vision/common/processors/mat.h @@ -22,8 +22,8 @@ namespace vision { enum Layout { HWC, CHW }; - struct FASTDEPLOY_DECL Mat { + Mat() = default; explicit Mat(const cv::Mat& mat) { cpu_mat = mat; layout = Layout::HWC; @@ -45,8 +45,12 @@ struct FASTDEPLOY_DECL Mat { #endif Mat(const Mat& mat) = default; + // Move assignment Mat& operator=(const Mat& mat) = default; + // Move constructor + Mat(Mat&& other) = default; + // Careful if you use this interface // this only used if you don't want to write // the original data, and write to a new cv::Mat diff --git a/3rdparty/include/fastdeploy/vision/common/result.h b/3rdparty/include/fastdeploy/vision/common/result.h index 2fd3d72dd9..b6ff1fbf77 100644 --- a/3rdparty/include/fastdeploy/vision/common/result.h +++ b/3rdparty/include/fastdeploy/vision/common/result.h @@ -247,6 +247,7 @@ struct FASTDEPLOY_DECL FaceAlignmentResult : public BaseResult { /*! @brief Segmentation result structure for all the segmentation models */ struct FASTDEPLOY_DECL SegmentationResult : public BaseResult { + SegmentationResult() = default; /** \brief * `label_map` stores the pixel-level category labels for input image. the number of pixels is equal to label_map.size() */ @@ -257,12 +258,21 @@ struct FASTDEPLOY_DECL SegmentationResult : public BaseResult { std::vector score_map; /// The output shape, means [H, W] std::vector shape; + /// SegmentationResult whether containing score_map bool contain_score_map = false; + /// Copy constructor + SegmentationResult(const SegmentationResult& other) = default; + /// Move assignment + SegmentationResult& operator=(SegmentationResult&& other); + ResultType type = ResultType::SEGMENTATION; - /// Clear detection result + /// Clear Segmentation result void Clear(); + /// Clear Segmentation result and free the memory + void Free(); + void Reserve(int size); void Resize(int size); diff --git a/3rdparty/include/fastdeploy/vision/ocr/ppocr/classifier.h b/3rdparty/include/fastdeploy/vision/ocr/ppocr/classifier.h index d3430e4e02..5a4ed02a0a 100644 --- a/3rdparty/include/fastdeploy/vision/ocr/ppocr/classifier.h +++ b/3rdparty/include/fastdeploy/vision/ocr/ppocr/classifier.h @@ -43,7 +43,7 @@ class FASTDEPLOY_DECL Classifier : public FastDeployModel { const ModelFormat& model_format = ModelFormat::PADDLE); /// Get model's name std::string ModelName() const { return "ppocr/ocr_cls"; } - + virtual bool Predict(const cv::Mat& img, int32_t* cls_label, float* cls_score); /** \brief BatchPredict the input image and get OCR classification model cls_result. * * \param[in] images The list of input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format. @@ -53,6 +53,10 @@ class FASTDEPLOY_DECL Classifier : public FastDeployModel { virtual bool BatchPredict(const std::vector& images, std::vector* cls_labels, std::vector* cls_scores); + virtual bool BatchPredict(const std::vector& images, + std::vector* cls_labels, + std::vector* cls_scores, + size_t start_index, size_t end_index); ClassifierPreprocessor preprocessor_; ClassifierPostprocessor postprocessor_; diff --git a/3rdparty/include/fastdeploy/vision/ocr/ppocr/cls_postprocessor.h b/3rdparty/include/fastdeploy/vision/ocr/ppocr/cls_postprocessor.h index 15bf098c70..a755e12948 100644 --- a/3rdparty/include/fastdeploy/vision/ocr/ppocr/cls_postprocessor.h +++ b/3rdparty/include/fastdeploy/vision/ocr/ppocr/cls_postprocessor.h @@ -25,11 +25,6 @@ namespace ocr { */ class FASTDEPLOY_DECL ClassifierPostprocessor { public: - /** \brief Create a postprocessor instance for Classifier serials model - * - */ - ClassifierPostprocessor(); - /** \brief Process the result of runtime and fill to ClassifyResult structure * * \param[in] tensors The inference result from runtime @@ -40,10 +35,11 @@ class FASTDEPLOY_DECL ClassifierPostprocessor { bool Run(const std::vector& tensors, std::vector* cls_labels, std::vector* cls_scores); - float cls_thresh_ = 0.9; + bool Run(const std::vector& tensors, + std::vector* cls_labels, std::vector* cls_scores, + size_t start_index, size_t total_size); - private: - bool initialized_ = false; + float cls_thresh_ = 0.9; }; } // namespace ocr diff --git a/3rdparty/include/fastdeploy/vision/ocr/ppocr/cls_preprocessor.h b/3rdparty/include/fastdeploy/vision/ocr/ppocr/cls_preprocessor.h index a701e7e3ae..ed75d55b28 100644 --- a/3rdparty/include/fastdeploy/vision/ocr/ppocr/cls_preprocessor.h +++ b/3rdparty/include/fastdeploy/vision/ocr/ppocr/cls_preprocessor.h @@ -24,11 +24,6 @@ namespace ocr { */ class FASTDEPLOY_DECL ClassifierPreprocessor { public: - /** \brief Create a preprocessor instance for Classifier serials model - * - */ - ClassifierPreprocessor(); - /** \brief Process the input image and prepare input tensors for runtime * * \param[in] images The input image data list, all the elements are returned by cv::imread() @@ -36,14 +31,13 @@ class FASTDEPLOY_DECL ClassifierPreprocessor { * \return true if the preprocess successed, otherwise false */ bool Run(std::vector* images, std::vector* outputs); + bool Run(std::vector* images, std::vector* outputs, + size_t start_index, size_t end_index); std::vector mean_ = {0.5f, 0.5f, 0.5f}; std::vector scale_ = {0.5f, 0.5f, 0.5f}; bool is_scale_ = true; std::vector cls_image_shape_ = {3, 48, 192}; - - private: - bool initialized_ = false; }; } // namespace ocr diff --git a/3rdparty/include/fastdeploy/vision/ocr/ppocr/dbdetector.h b/3rdparty/include/fastdeploy/vision/ocr/ppocr/dbdetector.h index d3b99d598f..d2305abd7c 100644 --- a/3rdparty/include/fastdeploy/vision/ocr/ppocr/dbdetector.h +++ b/3rdparty/include/fastdeploy/vision/ocr/ppocr/dbdetector.h @@ -44,14 +44,6 @@ class FASTDEPLOY_DECL DBDetector : public FastDeployModel { const ModelFormat& model_format = ModelFormat::PADDLE); /// Get model's name std::string ModelName() const { return "ppocr/ocr_det"; } - /** \brief Predict the input image and get OCR detection model result. - * - * \param[in] img The input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format. - * \param[in] boxes_result The output of OCR detection model result will be writen to this structure. - * \return true if the prediction is successed, otherwise false. - */ - virtual bool Predict(cv::Mat* img, - std::vector>* boxes_result); /** \brief Predict the input image and get OCR detection model result. * * \param[in] img The input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format. diff --git a/3rdparty/include/fastdeploy/vision/ocr/ppocr/det_postprocessor.h b/3rdparty/include/fastdeploy/vision/ocr/ppocr/det_postprocessor.h index f98b89b028..1152288439 100644 --- a/3rdparty/include/fastdeploy/vision/ocr/ppocr/det_postprocessor.h +++ b/3rdparty/include/fastdeploy/vision/ocr/ppocr/det_postprocessor.h @@ -25,11 +25,6 @@ namespace ocr { */ class FASTDEPLOY_DECL DBDetectorPostprocessor { public: - /** \brief Create a postprocessor instance for DBDetector serials model - * - */ - DBDetectorPostprocessor(); - /** \brief Process the result of runtime and fill to results structure * * \param[in] tensors The inference result from runtime @@ -48,8 +43,7 @@ class FASTDEPLOY_DECL DBDetectorPostprocessor { bool use_dilation_ = false; private: - bool initialized_ = false; - PostProcessor post_processor_; + PostProcessor util_post_processor_; bool SingleBatchPostprocessor(const float* out_data, int n2, int n3, diff --git a/3rdparty/include/fastdeploy/vision/ocr/ppocr/det_preprocessor.h b/3rdparty/include/fastdeploy/vision/ocr/ppocr/det_preprocessor.h index 39c48691d7..d66e785d38 100644 --- a/3rdparty/include/fastdeploy/vision/ocr/ppocr/det_preprocessor.h +++ b/3rdparty/include/fastdeploy/vision/ocr/ppocr/det_preprocessor.h @@ -24,11 +24,6 @@ namespace ocr { */ class FASTDEPLOY_DECL DBDetectorPreprocessor { public: - /** \brief Create a preprocessor instance for DBDetector serials model - * - */ - DBDetectorPreprocessor(); - /** \brief Process the input image and prepare input tensors for runtime * * \param[in] images The input image data list, all the elements are returned by cv::imread() @@ -44,9 +39,6 @@ class FASTDEPLOY_DECL DBDetectorPreprocessor { std::vector mean_ = {0.485f, 0.456f, 0.406f}; std::vector scale_ = {0.229f, 0.224f, 0.225f}; bool is_scale_ = true; - - private: - bool initialized_ = false; }; } // namespace ocr diff --git a/3rdparty/include/fastdeploy/vision/ocr/ppocr/ppocr_v2.h b/3rdparty/include/fastdeploy/vision/ocr/ppocr/ppocr_v2.h index d021d6c32d..f603a45f9a 100644 --- a/3rdparty/include/fastdeploy/vision/ocr/ppocr/ppocr_v2.h +++ b/3rdparty/include/fastdeploy/vision/ocr/ppocr/ppocr_v2.h @@ -59,6 +59,7 @@ class FASTDEPLOY_DECL PPOCRv2 : public FastDeployModel { * \return true if the prediction successed, otherwise false. */ virtual bool Predict(cv::Mat* img, fastdeploy::vision::OCRResult* result); + virtual bool Predict(const cv::Mat& img, fastdeploy::vision::OCRResult* result); /** \brief BatchPredict the input image and get OCR result. * * \param[in] images The list of input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format. @@ -68,11 +69,19 @@ class FASTDEPLOY_DECL PPOCRv2 : public FastDeployModel { virtual bool BatchPredict(const std::vector& images, std::vector* batch_result); bool Initialized() const override; + bool SetClsBatchSize(int cls_batch_size); + int GetClsBatchSize(); + bool SetRecBatchSize(int rec_batch_size); + int GetRecBatchSize(); protected: fastdeploy::vision::ocr::DBDetector* detector_ = nullptr; fastdeploy::vision::ocr::Classifier* classifier_ = nullptr; fastdeploy::vision::ocr::Recognizer* recognizer_ = nullptr; + + private: + int cls_batch_size_ = 1; + int rec_batch_size_ = 6; /// Launch the detection process in OCR. }; diff --git a/3rdparty/include/fastdeploy/vision/ocr/ppocr/rec_postprocessor.h b/3rdparty/include/fastdeploy/vision/ocr/ppocr/rec_postprocessor.h index d1aa0124b4..711ae3a014 100644 --- a/3rdparty/include/fastdeploy/vision/ocr/ppocr/rec_postprocessor.h +++ b/3rdparty/include/fastdeploy/vision/ocr/ppocr/rec_postprocessor.h @@ -32,7 +32,7 @@ class FASTDEPLOY_DECL RecognizerPostprocessor { */ explicit RecognizerPostprocessor(const std::string& label_path); - /** \brief Process the result of runtime and fill to ClassifyResult structure + /** \brief Process the result of runtime and fill to RecognizerResult * * \param[in] tensors The inference result from runtime * \param[in] texts The output result of recognizer @@ -42,6 +42,11 @@ class FASTDEPLOY_DECL RecognizerPostprocessor { bool Run(const std::vector& tensors, std::vector* texts, std::vector* rec_scores); + bool Run(const std::vector& tensors, + std::vector* texts, std::vector* rec_scores, + size_t start_index, size_t total_size, + const std::vector& indices); + private: bool SingleBatchPostprocessor(const float* out_data, const std::vector& output_shape, diff --git a/3rdparty/include/fastdeploy/vision/ocr/ppocr/rec_preprocessor.h b/3rdparty/include/fastdeploy/vision/ocr/ppocr/rec_preprocessor.h index 3e5c7de824..1dad75870b 100644 --- a/3rdparty/include/fastdeploy/vision/ocr/ppocr/rec_preprocessor.h +++ b/3rdparty/include/fastdeploy/vision/ocr/ppocr/rec_preprocessor.h @@ -24,12 +24,6 @@ namespace ocr { */ class FASTDEPLOY_DECL RecognizerPreprocessor { public: - /** \brief Create a preprocessor instance for PaddleClas serials model - * - * \param[in] config_file Path of configuration file for deployment, e.g resnet/infer_cfg.yml - */ - RecognizerPreprocessor(); - /** \brief Process the input image and prepare input tensors for runtime * * \param[in] images The input image data list, all the elements are returned by cv::imread() @@ -37,14 +31,14 @@ class FASTDEPLOY_DECL RecognizerPreprocessor { * \return true if the preprocess successed, otherwise false */ bool Run(std::vector* images, std::vector* outputs); + bool Run(std::vector* images, std::vector* outputs, + size_t start_index, size_t end_index, + const std::vector& indices); std::vector rec_image_shape_ = {3, 48, 320}; std::vector mean_ = {0.5f, 0.5f, 0.5f}; std::vector scale_ = {0.5f, 0.5f, 0.5f}; bool is_scale_ = true; - - private: - bool initialized_ = false; }; } // namespace ocr diff --git a/3rdparty/include/fastdeploy/vision/ocr/ppocr/recognizer.h b/3rdparty/include/fastdeploy/vision/ocr/ppocr/recognizer.h index 1cd841eb45..8a5f5bc70c 100644 --- a/3rdparty/include/fastdeploy/vision/ocr/ppocr/recognizer.h +++ b/3rdparty/include/fastdeploy/vision/ocr/ppocr/recognizer.h @@ -45,6 +45,7 @@ class FASTDEPLOY_DECL Recognizer : public FastDeployModel { const ModelFormat& model_format = ModelFormat::PADDLE); /// Get model's name std::string ModelName() const { return "ppocr/ocr_rec"; } + virtual bool Predict(const cv::Mat& img, std::string* text, float* rec_score); /** \brief BatchPredict the input image and get OCR recognition model result. * * \param[in] images The list of input image data, comes from cv::imread(), is a 3-D array with layout HWC, BGR format. @@ -53,6 +54,10 @@ class FASTDEPLOY_DECL Recognizer : public FastDeployModel { */ virtual bool BatchPredict(const std::vector& images, std::vector* texts, std::vector* rec_scores); + virtual bool BatchPredict(const std::vector& images, + std::vector* texts, std::vector* rec_scores, + size_t start_index, size_t end_index, + const std::vector& indices); RecognizerPreprocessor preprocessor_; RecognizerPostprocessor postprocessor_; diff --git a/3rdparty/include/fastdeploy/vision/ocr/ppocr/utils/ocr_utils.h b/3rdparty/include/fastdeploy/vision/ocr/ppocr/utils/ocr_utils.h index 0e5c040eb8..f12f40f71f 100644 --- a/3rdparty/include/fastdeploy/vision/ocr/ppocr/utils/ocr_utils.h +++ b/3rdparty/include/fastdeploy/vision/ocr/ppocr/utils/ocr_utils.h @@ -33,6 +33,8 @@ FASTDEPLOY_DECL cv::Mat GetRotateCropImage(const cv::Mat& srcimage, FASTDEPLOY_DECL void SortBoxes(std::vector>* boxes); +FASTDEPLOY_DECL std::vector ArgSort(const std::vector &array); + } // namespace ocr } // namespace vision } // namespace fastdeploy diff --git a/3rdparty/resource/PaddleCharOCR/ppocr_keys_v1.txt b/3rdparty/resource/PaddleCharOCR/keys.txt similarity index 100% rename from 3rdparty/resource/PaddleCharOCR/ppocr_keys_v1.txt rename to 3rdparty/resource/PaddleCharOCR/keys.txt diff --git a/3rdparty/resource/PaddleOCR/ppocr_keys_v1.txt b/3rdparty/resource/PaddleOCR/keys.txt similarity index 96% rename from 3rdparty/resource/PaddleOCR/ppocr_keys_v1.txt rename to 3rdparty/resource/PaddleOCR/keys.txt index 84b885d835..3c368897a6 100644 --- a/3rdparty/resource/PaddleOCR/ppocr_keys_v1.txt +++ b/3rdparty/resource/PaddleOCR/keys.txt @@ -6620,4 +6620,221 @@ j 緖 續 紹 -懮 \ No newline at end of file +懮 +唞 +冇 +踽 +∀ +牝 +л +栞 +噫 +薨 +舐 +佢 +怼 +揶 +褛 +喺 +祇 +γ +グ +揾 +瀬 +蛩 +м +М +啲 +捱 +е +お +锃 +湎 +歃 +铳 +♪ +嘅 +酹 +笞 +Ⅰ +い +诹 +啭 +н +隈 +ド +Ⅵ +Ⅷ +鸮 +揄 +哋 +洇 +竜 +️ +Ⅹ +孱 +窣 +馑 +咲 +゙ +呣 +  +馐 +嚟 +琄 +玹 +殄 +呯 +忾 +廻 +遑 +刽 +涼 +嗱 +圄 +觥 +欸 +岬 +悭 +Æ +缱 +ち +谲 +嘭 +金 +鸰 +咗 +豢 +Р +褴 +槭 +嗰 +诨 +埜 +誊 +з +Ⅸ +痍 +塚 +吽 +缛 +粝 +た +皛 +蹩 +嚯 +р +蟊 +畀 +李 +カ +伥 +ば +к +趄 +哣 +・ +恫 +柢 +Г +む +啷 +吔 +Ⅴ +㗎 +燏 +掼 +а +闩 +о +せ +ł +蟥 +剜 +鼷 +轟 +阋 +祂 +疴 +у +诳 +赧 +遽 +媸 +恵 +冧 +谂 +邙 +笥 +с +ヌ +搡 +篠 +焮 +犄 +́ +揆 +辎 +僭 +啐 +攰 +齁 +れ +槊 +ノ +訇 +ー +聒 +ё +え +逡 +摎 +噉 +臜 +叡 +诌 +嗥 +齑 +哂 +呿 +嘁 +聩 +ル +螭 +奁 +咁 +酽 +懑 +蚺 +鮨 +喑 +。 +梶 +呲 +愠 +渕 +т +и +忤 +薙 +佻 +趔 +Ⅶ +硎 +睥 +犒 +ん +叵 +洌 +硌 +つ +抔 +㖞 +酩 +菈 +チ +ア +ワ +篾 +窸 +洢 diff --git a/3rdparty/resource/PaddleOCR/rec/version.txt b/3rdparty/resource/PaddleOCR/rec/version.txt index d0adf1a0e8..e0cfba5a51 100644 --- a/3rdparty/resource/PaddleOCR/rec/version.txt +++ b/3rdparty/resource/PaddleOCR/rec/version.txt @@ -1 +1,3 @@ -ch_PP-OCRv3_rec_infer +2022/12/11 基于 ch_PP-OCRv3_rec_infer 预训练模型 +8000 干员名截图 + 10000 GameData 中文生成数据 +https://github.com/MaaAssistantArknights/ArknightsTrainingData/commit/de26605fda8d95556078de0907aa34a3a903d929 diff --git a/3rdparty/resource/global/YoStarEN/resource/PaddleOCR/keys.txt b/3rdparty/resource/global/YoStarEN/resource/PaddleOCR/keys.txt new file mode 100644 index 0000000000..7677d31b9d --- /dev/null +++ b/3rdparty/resource/global/YoStarEN/resource/PaddleOCR/keys.txt @@ -0,0 +1,95 @@ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ + diff --git a/3rdparty/resource/global/YoStarEN/resource/PaddleOCR/rec/version.txt b/3rdparty/resource/global/YoStarEN/resource/PaddleOCR/rec/version.txt new file mode 100644 index 0000000000..5ef569e1f8 --- /dev/null +++ b/3rdparty/resource/global/YoStarEN/resource/PaddleOCR/rec/version.txt @@ -0,0 +1 @@ +en_PP-OCRv3_rec_infer diff --git a/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/det/version.txt b/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/det/version.txt deleted file mode 100644 index 2632971586..0000000000 --- a/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/det/version.txt +++ /dev/null @@ -1 +0,0 @@ -Multilingual_PP-OCRv3_det_infer diff --git a/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/dict_version.txt b/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/dict_version.txt deleted file mode 100644 index cb815180fa..0000000000 --- a/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/dict_version.txt +++ /dev/null @@ -1 +0,0 @@ -japan_dict.txt diff --git a/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/ppocr_keys_v1.txt b/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/keys.txt similarity index 92% rename from 3rdparty/resource/global/YoStarJP/resource/PaddleOCR/ppocr_keys_v1.txt rename to 3rdparty/resource/global/YoStarJP/resource/PaddleOCR/keys.txt index 339d4b89e5..a9e14cb910 100644 --- a/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/ppocr_keys_v1.txt +++ b/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/keys.txt @@ -1,4 +1,4 @@ -! + " # $ @@ -4397,3 +4397,342 @@ z ~ ・ +梯 +蜿 +翳 +姑 +佇 +з +窺 +种 +呵 +琪 +风 +舵 +眩 +擢 +憫 +謂 +仄 +· +貶 +躓 +} +囮 +摹 +憊 +莉 +栞 +艱 +沁 +喑 +★ +拱 +恃 +辿 +剝 +犀 +溌 +咆 +嗄 +Æ +僻 +佻 +繭 +嬲 +霹 +桎 +涜 +磋 +罅 +晰 +枷 +訝 +霆 +^ +Ⅵ +垠 +乖 +  +緞 +掠 +軛 +效 +莢 +慟 +爛 +礱 +渺 +淬 +【 +磊 +弩 +殲 +凄 +从 +訣 +焉 +蜒 +猜 +冽 +悸 +羸 +徘 +马 +捷 +儚 +俱 +灼 +| +棍 +攫 +拔 +悶 +晨 +Ⅸ +欒 +蹙 +湃 +< +恰 +‐ +炸 +獺 +! +恍 +儂 +酣 +訊 +愕 +茫 +疚 +炬 +卷 +崢 +嚥 +Ⅶ +云 +嚇 +γ +闊 +凜 +\ +♪ +髑 +甦 +懦 +痍 +睥 +慚 +瑕 +穹 +嗤 +潑 +抒 +撓 +瞥 +鬃 +※ +Ⅴ +飆 +睛 +栓 +梳 +黑 +飞 +峙 +悖 +詭 +攀 +悄 +㎝ +躱 +н +穿 +轅 +霄 +縷 +橙 +敲 +誂 +Ⅱ +Ⅲ +Р +擒 +匕 +М +搔 +囁 +~ +徜 +魍 +擋 +> +擲 +陋 +濛 +м +孕 +攪 +埜 +屁 +◯ +僅 +挫 +е +仞 +吴 +瘤 +醇 +躾 +綻 +繚 +и +Ⅳ +梃 +。 +拮 +邏 +】 +袂 +档 +徉 +嗟 +惻 +捌 +佞 +眸 +慙 +婷 +Ⅰ +冴 +弭 +儘 +鏢 +吱 +滓 +隕 +И +燦 +縋 +謐 +棉 +捲 +峭 +朦 +茉 +絆 +舐 +溟 +迸 +㎠ +β +﨑 +喊 +聳 +沛 +З +堡 +魑 +玻 +誹 +毯 +喉 +謁 +菲 +狽 +靂 +駁 +涎 +皛 +、 +靡 +愁 +疊 +拗 +刘 +勁 +馥 +哮 +黯 +咽 +辜 +髏 +燐 +抉 +渇 +碍 +徊 +忖 +呻 +瓏 +雯 +斡 +兔 +偲 +瑟 +捏 +Ⅷ +蹂 +鹵 +魎 +Ⅹ +撻 +晚 +噪 +吶 +瞠 +呟 +疵 +從 +遽 +个 +舷 +諂 +蠟 +絨 +龟 +黎 +巓 +滲 +拌 +慄 +辣 +漓 +顰 +燼 +頷 +啜 +嶸 +у +訃 +踝 +@ +蚤 +憚 +{ +蟥 +隙 +梏 +摯 +彿 +滾 +沫 +眈 +́ +絢 +觴 +愧 +匪 +咎 +拷 +噓 +渣 +逡 +熔 +幀 +ぅ +к +颯 +鉗 +謳 diff --git a/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/rec/version.txt b/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/rec/version.txt index 285f820414..5d37018274 100644 --- a/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/rec/version.txt +++ b/3rdparty/resource/global/YoStarJP/resource/PaddleOCR/rec/version.txt @@ -1 +1 @@ -japan_PP-OCRv3_rec_infer +2022/12/12 14:58:07] ppocr INFO: best metric, acc: 0.9811424564920256, is_float16: False, norm_edit_dis: 0.996124223500862, fps: 3437.9212558936433, best_epoch: 350 diff --git a/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/det/version.txt b/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/det/version.txt deleted file mode 100644 index 2632971586..0000000000 --- a/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/det/version.txt +++ /dev/null @@ -1 +0,0 @@ -Multilingual_PP-OCRv3_det_infer diff --git a/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/dict_version.txt b/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/dict_version.txt deleted file mode 100644 index c426dcde71..0000000000 --- a/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/dict_version.txt +++ /dev/null @@ -1 +0,0 @@ -korean_dict.txt diff --git a/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/ppocr_keys_v1.txt b/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/keys.txt similarity index 96% rename from 3rdparty/resource/global/YoStarKR/resource/PaddleOCR/ppocr_keys_v1.txt rename to 3rdparty/resource/global/YoStarKR/resource/PaddleOCR/keys.txt index a13899f14d..c4f70775b8 100644 --- a/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/ppocr_keys_v1.txt +++ b/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/keys.txt @@ -3686,3 +3686,147 @@ z 切 宅 +Ⅱ +: +ル +~ +웩 +쉿 +. +벋 +シ +쉔 +念 +• +힛 +퍄 +》 +И +? +釜 +息 +큭 +ん +ワ +잌 +푀 +쭤 +멨 +м +쥠 +ド +퉤 +읏 +Ⅷ +マ +ヌ +轟 +냠 +将 +쬘 +い +슌 +) +た +Ⅳ +Ⅶ +— +ば +웻 +н +섀 +※ +希 +Р +埜 +좔 +텼 +죗 +쁩 +γ +竜 +崎 +꺅 +体 +ち +랖 +, +е +Ⅵ +М +) +来 +з +훙 +툽 +@ +풉 +β +뼛 +묠 +· +Ⅸ +잼 +れ +々 +★ +♪ +つ +и +삣 +( +к +兔 +《 +、 +꼰 +& +■ +无 +号 +‘ +쐴 +チ +V +у +믄 +Ⅲ +뵌 +껜 +훠 +́ +  +® +Ⅹ +봬 +섥 +介 +晚 +Ⅴ +숏 +― +뿟 +… +킁 +멉 +鑄 +셩 +쫌 +渣 +お +黎 +え +З +。 +ー +™ +餐 +Æ +当 +쉈 +윕 +Ⅰ +⋯ +, +熊 +졘 diff --git a/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/rec/version.txt b/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/rec/version.txt index 890c989721..0748289435 100644 --- a/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/rec/version.txt +++ b/3rdparty/resource/global/YoStarKR/resource/PaddleOCR/rec/version.txt @@ -1 +1 @@ -korean_PP-OCRv3_rec_infer +[2022/12/12 22:24:51] ppocr INFO: best metric, acc: 0.9786768721215384, is_float16: False, norm_edit_dis: 0.9951933614067948, fps: 2609.4666770032863, best_epoch: 238, start_epoch: 56 diff --git a/3rdparty/resource/global/txwy/resource/PaddleOCR/det/version.txt b/3rdparty/resource/global/txwy/resource/PaddleOCR/det/version.txt deleted file mode 100644 index 2632971586..0000000000 --- a/3rdparty/resource/global/txwy/resource/PaddleOCR/det/version.txt +++ /dev/null @@ -1 +0,0 @@ -Multilingual_PP-OCRv3_det_infer diff --git a/3rdparty/resource/global/txwy/resource/PaddleOCR/dict_version.txt b/3rdparty/resource/global/txwy/resource/PaddleOCR/dict_version.txt deleted file mode 100644 index b052ce74b7..0000000000 --- a/3rdparty/resource/global/txwy/resource/PaddleOCR/dict_version.txt +++ /dev/null @@ -1 +0,0 @@ -chinese_cht_dict.txt diff --git a/3rdparty/resource/global/txwy/resource/PaddleOCR/ppocr_keys_v1.txt b/3rdparty/resource/global/txwy/resource/PaddleOCR/keys.txt similarity index 98% rename from 3rdparty/resource/global/txwy/resource/PaddleOCR/ppocr_keys_v1.txt rename to 3rdparty/resource/global/txwy/resource/PaddleOCR/keys.txt index cc1aa4724b..ce8dee8374 100644 --- a/3rdparty/resource/global/txwy/resource/PaddleOCR/ppocr_keys_v1.txt +++ b/3rdparty/resource/global/txwy/resource/PaddleOCR/keys.txt @@ -8419,3 +8419,178 @@ z ¥ 𣇉 +坂 +奥 +塚 +諢 +グ +头 +覷 +Ⅰ +у +犄 +动 +т +瞇 +Ⅴ +怔 +ば +杈 +咦 +兢 +呯 +嗤 +々 +睏 +お +驀 +カ +́ +殫 +聵 +撂 +遝 +駡 +ル +眈 +于 +裏 +注 +恒 +号 +е +抔 +氳 +跚 +娓 +譎 +а +灶 +ヌ +潦 +γ +釅 +н +篾 +。 +忤 +奸 +綵 +臥 +嘁 +懊 +犒 +с +л +ち +・ +噎 +繈 +舐 +Æ +囈 +氤 +种 +攆 +躥 +♪ +閡 +チ +噫 +攙 +惻 +倀 +嫋 +孱 +れ +咣 +呻 +踽 +ワ +个 +絀 +揶 +ー +嚯 +酹 +淒 +躡 +Ⅵ +肓 +跺 +呿 +晌 +无 +蹩 +Ⅹ +и +咐 +仆 +挽 +い +м +捅 +о +癔 +ん +从 +倏 +齏 +М +糲 +僥 +゙ +搧 +歃 +吭 +僂 +Р +狽 +汙 +ノ +揣 +囔 +睬 +嘈 +蹣 +∀ +吽 +Ⅸ +柢 +踵 +呣 +洶 +兇 +ア +亙 +縟 +  +з +え +瘉 +た +窸 +呆 +觥 +实 +р +つ +硎 +ド +饈 +攥 +週 +鐐 +杆 +遑 +蔫 +擄 +靦 +Г +搡 +嗷 +к +媸 +Ⅶ +嘖 +Ⅷ diff --git a/3rdparty/resource/global/txwy/resource/PaddleOCR/rec/version.txt b/3rdparty/resource/global/txwy/resource/PaddleOCR/rec/version.txt index 488fd48d9e..0748289435 100644 --- a/3rdparty/resource/global/txwy/resource/PaddleOCR/rec/version.txt +++ b/3rdparty/resource/global/txwy/resource/PaddleOCR/rec/version.txt @@ -1 +1 @@ -chinese_cht_PP-OCRv3_rec_infer +[2022/12/12 22:24:51] ppocr INFO: best metric, acc: 0.9786768721215384, is_float16: False, norm_edit_dis: 0.9951933614067948, fps: 2609.4666770032863, best_epoch: 238, start_epoch: 56 diff --git a/3rdparty/resource/minitouch/maatouch/minitouch b/3rdparty/resource/minitouch/maatouch/minitouch new file mode 100644 index 0000000000..3673f3ff0a Binary files /dev/null and b/3rdparty/resource/minitouch/maatouch/minitouch differ diff --git a/CHANGELOG.md b/CHANGELOG.md index 1daafdcf9b..eeb96ee7aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,58 +1,91 @@ -## v4.7.2 +## v4.8.0-beta.4 -- 修复 刷理智 掉落识别 在极端情况下疯狂上传的问题 @MistEO -- 修复 刷理智 时间缓存不生效的问题 @MistEO -- 修复 夜神模拟器 偶现截图黑屏的问题 @MistEO -- 优化 水月肉鸽 部分地图部署策略 @WWPXX233 -- 更新 文档 @ntgmc +- 优化 所有语言的 OCR Rec 模型,提升识别率 @MistEO @zhangchi0104 @mole828 @WWPXX233 +- 修复 主线关卡导航 @ABA2396 +- 修复 OTA 打包错误 @horror-proton +- 优化 界面 @ABA2396 @MistEO -### For Overseas clients +### For overseas -- Fix OCR error for ZH_TW client @horror-proton +- Fix OCR detection error of overseas client @MistEO +- Fix wake-up error in JP client @liuyifan-eric +- Organize overseas service profiles @liuyifan-eric -## v4.7.1 +### For developers -- 修复 强制替换 ADB 进程被占用时失败的问题 @MistEO -- 修复 macOS 启动卡住的问题 @hguandl -- 修复 干员名识别错误 @cenfusheng -- 新增 界面 触控相关提示,~~再问紫砂!~~ @MistEO -- 新增 检查更新 镜像 API @tangge233 +- Add Linux CI @horror-proton @aa889788 @hguandl +- Add checksums for download libs @aa889788 -### For Overseas clients +## v4.8.0-beta.3 -- Fix the stuck in the encounter in IS @MistEO -- Update documentation @wallsman +- 重构 项目工程、目录结构,重命名 部分文件 @MistEO @horror-proton @hguandl +- 重新支持 macOS 打包,并集成新接口 @hguandl @horror-proton +- 新增 支持 暂停部署干员 @MistEO + _目前仅 MaaTouch 效果较好,minitouch 在性能较差的电脑上会一直暂停着不动,adb input 不支持该功能_ +- 新增 启动时 删除 `.old` 文件 @MistEO +- 优化 界面 设置布局 @MistEO @ABA2396 +- 修复 干员 识别错误 @nightofknife @MistEO +- 更新 文档 @MistEO @Mr-Milk @ChildeRolando -## v4.7.0 +### For overseas -- 新增并全面启用 minitouch,大幅优化所有操作速度 @MistEO @zzyyyl @horror-proton @hguandl -- 新增 兼容触控模式,请进入设置 - 连接设置中启用。不推荐开启,仅建议在 minitouch 无法工作时使用 @MistEO -- 新增 自动战斗 `ButtleTime`, `costs` 字段 @MistEO -- 新增 自定义基建 `description_post` 字段,整理内置作业格式 @MistEO -- 更新 危机合约、IS-S 关卡 地图数据 @MistEO -- 优化 水月肉鸽 安全屋选项,支持安全屋再利用 @txtxj @zzyyyl -- 优化 自定义基建 内置 243 3 换作业 @Black1312 -- 优化 macOS 截图操作,新增支持 nc 转发,并禁用可能造成内存泄漏的 gzip 方式 @hguandl -- 优化 文字识别器 参数结构 @zzyyyl @MistEO -- 修复 活动关卡导航 @ABA2396 -- 修复 肉鸽 关卡识别错误时狂吃内存的问题 @zzyyyl -- 修复 基建 制造/贸易站 偶尔点漏一个房间的问题 @MistEO -- 修复 基建 干员 `霜叶` 识别错误 @Black1312 -- 修复 macOS 繁中肉鸽 文字识别错误 @hguandl -- 修复 macOS 信用商店 设置错误 @hguandl -- 修复 POSIX 下 socket 超时时间过长的问题 @aa889788 -- 修复 下载 镜像站地址,修复 内测版 打包策略 及 CHANGELOG 生成 @horror-proton @zzyyyl @MistEO -- 修复 界面 基建设置心情阈值显示错误的问题 @ABA2396 -- 修复 界面 不支持通知时崩溃的问题,使用兼容版通知 @zzyyyl -- 修复 Java 接口路径错误 @CaoMeiYouRen -- 清理 代码 等 @MistEO @zzyyyl -- 新增 调试后门,在启动前新建 `DEBUG.txt`,将会在每次运行时都重新读取资源文件 @MistEO -- 新增 Issue Bot mac 标签 @zzyyyl -- 更新 文档 @MistEO @DavidWang19 +- Fix some resources of KR client and update the documentation @178619 +- Fix the bug of IS stuck in JP client @MistEO -### For Overseas clients +### For developers -- Support Base function for the JP client @ajk946009123 -- Support Annihilation Combat for the JP and EN clients @MistEO @wallsman -- Fix StartUp and Daily error for the JP client @liuyifan-eric -- Fix a dead loop when recruiting opers in the auto-IS function of the EN client @MistEO +- Explicitly C APIs return value and parameter type, should be compatible with the original interface, but may also need to modify some integration code @MistEO +- Update Rust APIs for the above changes @horror-proton + +## v4.8.0-beta.2 + +- 修复 `风雪过境` 关卡名识别错误 @MistEO +- 优化 `风雪过境` 关卡导航 @ABA2396 +- 修复 肉鸽 不期而遇 放弃的问题 @MistEO +- 修复 adb 断开重连后,不使用 minitouch 的问题 @MistEO +- 修复 更新包 下载完成后崩溃的问题 @MistEO + +## v4.8.0-beta.1 + +- 更新 `风雪过境` 关卡数据 @MistEO +- 修复 `风雪过境` 关卡导航 @ABA2396 +- 修复 基建、自动编队 干员名识别错误 @MistEO +- 修复 信用战斗 部分卡住的问题 @Hydrogina @MistEO +- 优化 肉鸽 艾妮莉 技能 @WWPXX233 +- 修复 打包错误 @MistEO + +### For Overseas + +- Fixed visiting and added more ocrReplaces to KR @178619 + +## v4.8.0-alpha.1 + +- 启用 ONNX Runtime 进行 OCR,大幅降低内存占用、提高推理速度、减小文件体积,并不再区分 NoAVX 版本 @MistEO @horror-proton @hguandl @aa889788 + ~~终于踢了 PPOCR,但目前识别准确率有轻微下降,待后续版本优化。且目前暂未支持 Linux, macOS 版本~~ +- 新增 借助战打一局赚 30 信用功能,请进入设置开启~ @Hydrogina +- 新增 `MaaTouch` 连接配置 项。推荐在 minitouch 无法使用、但又不想用 `兼容触控模式` 时开启 @aa889788 @MistEO +- 新增 自定义导航 难度选择,请在关卡名后加入 `Hard` / `Normal` 使用 @ABA2396 @MistEO +- 合并 `访问好友` 和 `信用购物` 功能 @MistEO +- 重构 内部回调体系、重构实例继承体系、重构文件结构树 @MistEO +- 修复 水月肉鸽 不期而遇关卡直接放弃的问题 @MistEO +- 修复 minitouch 路径错误无法使用的问题 @MistEO +- 修复 自动公招 时间识别错误导致反复点击某个槽位的问题 @horror-proton +- 修复 OF 关卡导航识别问题 @ABA2396 +- 修复 自动战斗 编队偶尔失败的问题 @MistEO +- 修复 自动战斗 偶尔不跳过剧情的问题 @MistEO +- 优化 界面布局及描述 @ABA2396 +- 更新 文档 @ABA2396 @MistEO + +### For Overseas + +- Support Login, Base, Recruiting, Combat, Friends visiting, Store shopping, Daliy, Auto I.S. for the KR client @178619 +- Fix drops recognition errors for the JP client @MistEO +- Update the translations and documentations for the JP client @wallsman +- Add the translations and documentations for the KR client @178619 + +### For Developers + +**The `master` branch cannot be built on Linux and macOS because the ONNX Runtime adaptation is not finished yet, so please use `stable` branch for now. Feel free to join us in this work!** + +- Deprecate `Visit` task and merge it into `Mall` task @MistEO +- Add `async_connect`, `async_click`, `async_screencap` API, plz refer to `AsstCaller.h` to use @MistEO diff --git a/CMakeLists.txt b/CMakeLists.txt index e090ed5376..0a813413a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,9 +8,17 @@ endif () option(BUILD_TEST "build a demo" OFF) option(BUILD_XCFRAMEWORK "build xcframework for macOS app" OFF) option(BUILD_UNIVERSAL "build both arm64 and x86_64 on macOS" OFF) +option(INSTALL_PYTHON "install python ffi" OFF) +option(INSTALL_RESOURCE "install resource" OFF) +option(INSTALL_THIRD_LIBS "install third party libraries" ON) +option(MAA_DEPS_PATH "path to maa dependencies" "") -if (BUILD_UNIVERSAL) - set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") +set(CMAKE_INSTALL_RPATH "$ORIGIN/") +set(THIRD_PARTY_PATH ${CMAKE_CURRENT_BINARY_DIR}/third_libs) +include(${PROJECT_SOURCE_DIR}/cmake/utils.cmake) + +if (APPLE) + include("${PROJECT_SOURCE_DIR}/cmake/macos.cmake") endif () set(CMAKE_CXX_STANDARD 20) @@ -35,60 +43,69 @@ if (MSVC) endif () include_directories(include) -include_directories(src/MeoAssistant) +include_directories(src/MaaCore) -file(GLOB_RECURSE maa_src src/MeoAssistant/*.cpp) +file(GLOB_RECURSE maa_src src/MaaCore/*.cpp) -add_library(MeoAssistant SHARED ${maa_src}) +add_library(MaaCore SHARED ${maa_src}) if (MSVC) find_library(FastDeploy_LIB NAMES fastdeploy PATHS 3rdparty/lib) find_library(OpenCV NAMES opencv_world453 PATHS 3rdparty/lib) find_library(ZLIB NAMES zlibstatic PATHS 3rdparty/lib) - target_link_libraries(MeoAssistant ws2_32 ${OpenCV} ${FastDeploy_LIB} ${ZLIB}) - target_include_directories(MeoAssistant PRIVATE 3rdparty/include) + target_link_libraries(MaaCore ws2_32 ${OpenCV} ${FastDeploy_LIB} ${ZLIB}) + target_include_directories(MaaCore PRIVATE 3rdparty/include) else () find_package(ZLIB REQUIRED) - target_include_directories(MeoAssistant PRIVATE ${ZLIB_INCLUDE_DIRS}) - target_link_libraries(MeoAssistant ${ZLIB_LIBRARY}) + target_include_directories(MaaCore PRIVATE ${ZLIB_INCLUDE_DIRS}) + target_link_libraries(MaaCore ${ZLIB_LIBRARY}) if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") find_package(range-v3 REQUIRED) - target_link_libraries(MeoAssistant range-v3::range-v3) + target_link_libraries(MaaCore range-v3::range-v3) endif () if (APPLE) set(CMAKE_OSX_DEPLOYMENT_TARGET 12.0) - add_subdirectory(3rdparty/VisionOCR) - target_link_libraries(MeoAssistant - vnocr - "-framework Accelerate" - ) + message(STATUS "MAA_DEPS_PATH: ${MAA_DEPS_PATH}") + find_package(OpenCV REQUIRED PATHS ${MAA_DEPS_PATH}) + target_link_libraries(MaaCore ${OpenCV_LIBS} ${FastDeploy_LIBS}) else () - find_package(OpenCV REQUIRED) - target_include_directories(MeoAssistant PRIVATE ${OpenCV_INCLUDE_DIRS}) - target_link_libraries(MeoAssistant ${OpenCV_LIBS}) + include(${PROJECT_SOURCE_DIR}/cmake/opencv.cmake) + include(${PROJECT_SOURCE_DIR}/cmake/fastdeploy.cmake) + target_link_libraries(MaaCore ${DEPEND_LIBS}) - target_link_libraries(MeoAssistant ppocr paddle_inference protobuf cryptopp gflags glog utf8proc xxhash iomp5 mkldnn mklml_intel) + install(TARGETS MaaCore DESTINATION .) + if (INSTALL_PYTHON) + install(DIRECTORY src/Python DESTINATION .) + endif (INSTALL_PYTHON) + if (INSTALL_RESOURCE) + install(DIRECTORY resource DESTINATION .) + endif (INSTALL_RESOURCE) endif (APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -idirafter ${PROJECT_SOURCE_DIR}/3rdparty/include") endif () if (BUILD_TEST) - add_executable(test tools/TestCaller/main.cpp) - target_link_libraries(test MeoAssistant) + add_executable(test src/Cpp/main.cpp) + target_link_libraries(test MaaCore) endif (BUILD_TEST) if (BUILD_XCFRAMEWORK) - add_custom_command(OUTPUT MeoAssistant.xcframework - COMMAND rm -rf MeoAssistant.xcframework - COMMAND xcodebuild -create-xcframework -library libMeoAssistant.dylib -headers ${PROJECT_SOURCE_DIR}/include -output MeoAssistant.xcframework - DEPENDS MeoAssistant + add_custom_command(OUTPUT MaaCore.xcframework + COMMAND rm -rf MaaCore.xcframework + COMMAND xcodebuild -create-xcframework -library libMaaCore.dylib -headers ${PROJECT_SOURCE_DIR}/include -output MaaCore.xcframework + DEPENDS MaaCore + ) + + add_custom_command(OUTPUT Paddle2ONNX.xcframework + COMMAND rm -rf Paddle2ONNX.xcframework + COMMAND xcodebuild -create-xcframework -library ${MAA_DEPS_PATH}/lib/libpaddle2onnx.1.0.4.dylib -output Paddle2ONNX.xcframework ) add_custom_target(MaaXCFramework ALL - DEPENDS MeoAssistant MeoAssistant.xcframework + DEPENDS MaaCore Paddle2ONNX.xcframework MaaCore.xcframework ) endif (BUILD_XCFRAMEWORK) diff --git a/MeoAssistantArknights.sln.DotSettings b/MAA.DotSettings similarity index 100% rename from MeoAssistantArknights.sln.DotSettings rename to MAA.DotSettings diff --git a/MeoAssistantArknights.sln b/MAA.sln similarity index 63% rename from MeoAssistantArknights.sln rename to MAA.sln index 77093099e8..8d63c45c25 100644 --- a/MeoAssistantArknights.sln +++ b/MAA.sln @@ -1,76 +1,67 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.2.32616.157 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{6C4B8D52-51D1-45F8-AAEC-808035443FD6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCaller", "tools\TestCaller\TestCaller.vcxproj", "{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}" - ProjectSection(ProjectDependencies) = postProject - {362D1E30-F5AE-4279-9985-65C27B3BA300} = {362D1E30-F5AE-4279-9985-65C27B3BA300} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeoAsstGui", "src\MeoAsstGui\MeoAsstGui.csproj", "{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}" - ProjectSection(ProjectDependencies) = postProject - {362D1E30-F5AE-4279-9985-65C27B3BA300} = {362D1E30-F5AE-4279-9985-65C27B3BA300} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeoAssistant", "src\MeoAssistant\MeoAssistant.vcxproj", "{362D1E30-F5AE-4279-9985-65C27B3BA300}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{11F02235-5785-408B-9651-8A4B41FF36F4}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResourceUpdater", "tools\ResourceUpdater\ResourceUpdater.vcxproj", "{C9EA2837-0A4B-488F-A289-643B9D0BFCEB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Release|x64 = Release|x64 - Release|x86 = Release|x86 - RelWithDebInfo|x64 = RelWithDebInfo|x64 - RelWithDebInfo|x86 = RelWithDebInfo|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x64.ActiveCfg = Release|x64 - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x64.Build.0 = Release|x64 - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x86.ActiveCfg = Release|x64 - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x86.Build.0 = Release|x64 - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x64 - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.ActiveCfg = Release|x64 - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.Build.0 = Release|x64 - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x86.ActiveCfg = Release|Any CPU - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x86.Build.0 = Release|Any CPU - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x64.ActiveCfg = Release|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x64.Build.0 = Release|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x86.ActiveCfg = Release|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x86.Build.0 = Release|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x64 - {C9EA2837-0A4B-488F-A289-643B9D0BFCEB}.Release|x64.ActiveCfg = Release|x64 - {C9EA2837-0A4B-488F-A289-643B9D0BFCEB}.Release|x64.Build.0 = Release|x64 - {C9EA2837-0A4B-488F-A289-643B9D0BFCEB}.Release|x86.ActiveCfg = Release|x64 - {C9EA2837-0A4B-488F-A289-643B9D0BFCEB}.RelWithDebInfo|x64.ActiveCfg = Release|x64 - {C9EA2837-0A4B-488F-A289-643B9D0BFCEB}.RelWithDebInfo|x64.Build.0 = Release|x64 - {C9EA2837-0A4B-488F-A289-643B9D0BFCEB}.RelWithDebInfo|x86.ActiveCfg = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64} = {6C4B8D52-51D1-45F8-AAEC-808035443FD6} - {C9EA2837-0A4B-488F-A289-643B9D0BFCEB} = {6C4B8D52-51D1-45F8-AAEC-808035443FD6} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {4F2C0E4B-4FE9-47C6-A878-6BD2FAD8B9B2} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32616.157 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{6C4B8D52-51D1-45F8-AAEC-808035443FD6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaaWpfGui", "src\MaaWpfGui\MaaWpfGui.csproj", "{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}" + ProjectSection(ProjectDependencies) = postProject + {362D1E30-F5AE-4279-9985-65C27B3BA300} = {362D1E30-F5AE-4279-9985-65C27B3BA300} + {F860C043-4D86-41B6-A97E-4A75C9A6C4EC} = {F860C043-4D86-41B6-A97E-4A75C9A6C4EC} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MaaCore", "src\MaaCore\MaaCore.vcxproj", "{362D1E30-F5AE-4279-9985-65C27B3BA300}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{11F02235-5785-408B-9651-8A4B41FF36F4}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ResourceUpdater", "tools\ResourceUpdater\ResourceUpdater.vcxproj", "{C9EA2837-0A4B-488F-A289-643B9D0BFCEB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SyncRes", "src\SyncRes\SyncRes.vcxproj", "{F860C043-4D86-41B6-A97E-4A75C9A6C4EC}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sample", "src\Cpp\Sample.vcxproj", "{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}" + ProjectSection(ProjectDependencies) = postProject + {362D1E30-F5AE-4279-9985-65C27B3BA300} = {362D1E30-F5AE-4279-9985-65C27B3BA300} + {F860C043-4D86-41B6-A97E-4A75C9A6C4EC} = {F860C043-4D86-41B6-A97E-4A75C9A6C4EC} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Release|x64 = Release|x64 + RelWithDebInfo|x64 = RelWithDebInfo|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.ActiveCfg = Release|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.Build.0 = Release|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x64.ActiveCfg = Release|x64 + {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x64.Build.0 = Release|x64 + {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {C9EA2837-0A4B-488F-A289-643B9D0BFCEB}.Release|x64.ActiveCfg = Release|x64 + {C9EA2837-0A4B-488F-A289-643B9D0BFCEB}.Release|x64.Build.0 = Release|x64 + {C9EA2837-0A4B-488F-A289-643B9D0BFCEB}.RelWithDebInfo|x64.ActiveCfg = Release|x64 + {C9EA2837-0A4B-488F-A289-643B9D0BFCEB}.RelWithDebInfo|x64.Build.0 = Release|x64 + {F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.Release|x64.ActiveCfg = Release|x64 + {F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.Release|x64.Build.0 = Release|x64 + {F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {F860C043-4D86-41B6-A97E-4A75C9A6C4EC}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x64.ActiveCfg = Release|x64 + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x64.Build.0 = Release|x64 + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {C9EA2837-0A4B-488F-A289-643B9D0BFCEB} = {6C4B8D52-51D1-45F8-AAEC-808035443FD6} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4F2C0E4B-4FE9-47C6-A878-6BD2FAD8B9B2} + EndGlobalSection +EndGlobal diff --git a/README.md b/README.md index aede2b7ff8..137278741e 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@
-[简体中文](README.md) | [繁體中文](README_zh-TW.md) | [English](README_en-US.md) | [日本語](README_ja-JP.md) +[简体中文](README.md) | [繁體中文](README_zh-TW.md) | [English](README_en-US.md) | [日本語](README_ja-JP.md) | [한국어](README_ko-KR.md) MAA 的意思是 MAA Assistant Arknights @@ -33,12 +33,13 @@ MAA 的意思是 MAA Assistant Arknights ## 亮点功能 - 刷理智,掉落识别及上传 [企鹅物流](https://penguin-stats.cn/) -- 智能基建换班,自动计算干员效率,单设施内最优解;同时也支持 [自定义排班](docs/3.6-%E5%9F%BA%E5%BB%BA%E6%8E%92%E7%8F%AD%E5%8D%8F%E8%AE%AE.md) (测试功能) +- 智能基建换班,自动计算干员效率,单设施内最优解;同时也支持 [自定义排班](docs/3.6-基建排班协议.md) - 自动公招,可选使用加急许可,一次全部刷完!公招数据上传 [企鹅物流](https://penguin-stats.cn/result/stage/recruit/recruit),[一图流](https://yituliu.site/maarecruitdata) - 访问好友、收取信用及购物、领取日常奖励等。一键全日常自动长草! - 肉鸽全自动刷源石锭和蜡烛,自动识别干员及练度 -- 导入作业 JSON 文件,自动抄作业! [视频演示](https://www.bilibili.com/video/BV1H841177Fk/) -- 新功能:仓库识别!支持导出至 [企鹅物流刷图规划器](https://penguin-stats.cn/planner), [明日方舟工具箱](https://arkn.lolicon.app/#/material), [ARK-NIGHTS 干员培养表](https://ark-nights.com/settings) +- 选择作业 JSON 文件,自动抄作业! [视频演示](https://www.bilibili.com/video/BV1H841177Fk/) +- 仓库识别并支持导出至 [企鹅物流刷图规划器](https://penguin-stats.cn/planner), [明日方舟工具箱](https://arkn.lolicon.app/#/material), [ARK-NIGHTS 干员培养表](https://ark-nights.com/settings) +- 支持 C, Python, Java, Rust, Golang, Java HTTP, Rust HTTP 等多种接口,方便集成调用,自定义你的 MAA! 话不多说,看图! @@ -80,7 +81,7 @@ MAA 的意思是 MAA Assistant Arknights - 日服 支持基本的刷理智、自动基建、信用购物、自动公招、访问好友、领取奖励、自动肉鸽(测试版本)、公招识别,请参考 [说明](resource/global/YoStarJP/readme.md) - 韩服 - 支持基本的刷理智功能,请参考 [说明](resource/global/YoStarKR/readme.md) + 支持基本的刷理智、信用购物、访问好友、领取奖励、自动肉鸽(测试版本)、公招识别,请参考 [说明](resource/global/YoStarKR/readme.md) - 繁中服 支持基本的刷理智、自动公招、自动肉鸽、领取日常、公招识别功能,请参考 [说明](resource/global/txwy/readme.md) @@ -100,8 +101,8 @@ MAA 的意思是 MAA Assistant Arknights - 图像识别库:[opencv](https://github.com/opencv/opencv.git) - ~~文字识别库:[chineseocr_lite](https://github.com/DayBreak-u/chineseocr_lite.git)~~ - 文字识别库:[PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) -- 深度学习快速部署工具集: [FastDeploy](https://github.com/PaddlePaddle/FastDeploy) -- 机器学习推理和训练加速器: [onnxruntime](https://github.com/microsoft/onnxruntime) +- 深度学习部署库:[FastDeploy](https://github.com/PaddlePaddle/FastDeploy) +- 机器学习加速器:[onnxruntime](https://github.com/microsoft/onnxruntime) - ~~关卡掉落识别:[企鹅物流识别](https://github.com/penguin-statistics/recognizer)~~ - 地图格子识别:[Arknights-Tile-Pos](https://github.com/yuanyan3060/Arknights-Tile-Pos) - C++ JSON库:[meojson](https://github.com/MistEO/meojson.git) @@ -110,7 +111,8 @@ MAA 的意思是 MAA Assistant Arknights - C++ 解压压缩库:[zlib](https://github.com/madler/zlib) - C++ Gzip封装:[gzip-hpp](https://github.com/mapbox/gzip-hpp) - 安卓触控事件器:[minitouch](https://github.com/openstf/minitouch) -- WPF MVVW框架:[Stylet](https://github.com/canton7/Stylet) +- 安卓触控事件器:[MaaTouch](https://github.com/MaaAssistantArknights/MaaTouch) +- WPF MVVM框架:[Stylet](https://github.com/canton7/Stylet) - WPF控件库:[HandyControl](https://github.com/HandyOrg/HandyControl) - C# JSON库:[Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) - 下载器:[aria2](https://github.com/aria2/aria2) @@ -133,7 +135,7 @@ MAA 的意思是 MAA Assistant Arknights ### Windows -- 直接使用 Visual Studio 2022 打开 `MeoAssistantArknights.sln` 即可,所有环境都是配置好的 +- 直接使用 Visual Studio 2022 打开 `MAA.sln` 即可,所有环境都是配置好的 - 建议启用 clang-format 支持,详细内容可以参考 [在 Visual Studio 中启用 clang-format](docs/2.2-开发相关.md#在-visual-studio-中启用-clang-format) ### Linux | macOS @@ -142,13 +144,14 @@ MAA 的意思是 MAA Assistant Arknights ### API -- [C 接口](include/AsstCaller.h):[集成示例](tools/TestCaller/main.cpp) +- [C 接口](include/AsstCaller.h):[集成示例](src/CppSample/main.cpp) - [Python 接口](src/Python/asst.py):[集成示例](src/Python/sample.py) -- [Golang 接口](src/Golang/MaaAssistantArknights/):[集成示例](src/Golang/MaaAssistantArknights/maa/maa.go) +- [Golang 接口](src/Golang/):[集成示例](src/Golang/maa/maa.go) - [Dart 接口](src/dart/) -- [Java 接口](src/Java/Maaj/src/main/java/com/iguigui/maaj/easySample/MeoAssistant.java):[集成示例](src/Java/Maaj/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java) -- [Java HTTP 接口](src/Java/Maaj/Readme.md) +- [Java 接口](src/Java/src/main/java/com/iguigui/maaj/easySample/MaaCore.java):[集成示例](src/Java/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java) +- [Java HTTP 接口](src/Java/Readme.md) - [Rust 接口](src/Rust/src/maa_sys/):[HTTP 接口](src/Rust) +- [TypeScript 接口](https://github.com/MaaAssistantArknights/MaaAsstElectronUI/tree/main/packages/main/coreLoader) - [集成文档](docs/3.1-集成文档.md) - [回调消息协议](docs/3.2-回调消息协议.md) - [任务流程协议](docs/3.4-任务流程协议.md) @@ -176,6 +179,6 @@ MAA 的意思是 MAA Assistant Arknights 自动战斗 JSON 作业分享:[prts.plus](https://prts.plus) 或 [抄作业.com](http://抄作业.com) [Bilibili 直播间](https://live.bilibili.com/2808861):每晚直播敲代码,近期很长一段时间应该都是在写本软件~ [舟无关技术交流 & 吹水群(QQ 群)](https://jq.qq.com/?_wv=1027&k=ypbzXcA2):内卷地狱! -[开发者群(QQ 群)](https://jq.qq.com/?_wv=1027&k=JM9oCk3C) +[开发者群(QQ 群)](https://jq.qq.com/?_wv=1027&k=JM9oCk3C) 如果觉得软件对你有帮助,帮忙点个 Star 吧!~(网页最上方右上角的小星星),这就是对我们最大的支持了! diff --git a/README_en-US.md b/README_en-US.md index a622206e0f..726c2daead 100644 --- a/README_en-US.md +++ b/README_en-US.md @@ -18,7 +18,7 @@
-[简体中文](README.md) | [繁體中文](README_zh-TW.md) | [English](README_en-US.md) | [日本語](README_ja-JP.md) +[简体中文](README.md) | [繁體中文](README_zh-TW.md) | [English](README_en-US.md) | [日本語](README_ja-JP.md) | [한국어](README_ko-KR.md) MAA means MAA Assistant Arknights @@ -38,7 +38,8 @@ Development in progress ✿✿ヽ(°▽°)ノ✿ - Visiting friends, collecting credits and purchasing items, collecting daily rewards, completing daily quests in one click! - Auto-battle for Integrated Strategy (I.S.) for collecting originium ingots and candles. - Importing JSON task file for auto-battle! [Video](https://www.bilibili.com/video/BV1H841177Fk/) -- New feature: Depot recognition! Supports exporting to [Penguin Stats Planner](https://penguin-stats.cn/planner), [Arknight Tools](https://arkn.lolicon.app/#/material), and [ARK-NIGHTS Operator Builds](https://ark-nights.com/settings) +- Depot recognition and upports exporting to [Penguin Stats Planner](https://penguin-stats.cn/planner), [Arknight Tools](https://arkn.lolicon.app/#/material), and [ARK-NIGHTS Operator Builds](https://ark-nights.com/settings) +- Support C, Python, Java, Rust, Golang, Java HTTP, Rust HTTP and other interfaces, easy to integrate and call, customize your MAA! Talk is cheap. Show me the pictures! @@ -75,11 +76,11 @@ Please refer to: [FAQ](docs/en-us/1.2-FAQ.md) ## Supports for overseas clients - Global(EN) Client - Supports basic features like Combat, Credit Shopping, Visiting, Collocting, Auto Roguelike(beta), Recruitment calculate, etc. See also [README](resource/global/YoStarEN/readme.md) + Supports basic features like Combat, Credit Shopping, Visiting, Collecting, Auto Roguelike(beta), Recruitment calculate, etc. See also [README](resource/global/YoStarEN/readme.md) - JP Client - Supports basic features like Combat, Auto Base shift, Credit Shopping, Auto Recruiting, Visiting, Collocting, Auto Roguelike(beta), Recruitment calculate, etc. See also [README](resource/global/YoStarJP/readme.md) + Supports basic features like Combat, Auto Base shift, Credit Shopping, Auto Recruiting, Visiting, Collecting, Auto Roguelike(beta), Recruitment calculate, etc. See also [README](resource/global/YoStarJP/readme.md) - KR Client - Supports basic features like Combat, etc. See also [README](resource/global/YoStarKR/readme.md) + Supports basic features like Combat, Credit Shopping, Visiting, Collecting, Auto Roguelike(beta), Recruitment calculate, etc. See also [README](resource/global/YoStarKR/readme.md) - ZH_CHT Client Supports basic features like Combat, Auto Recruiting, Auto Roguelike(beta), Recruitment calculate, etc. See also [README](resource/global/txwy/readme.md) @@ -99,8 +100,8 @@ Due to the small number of overseas clients users and the lack of project manpow - Image recognition: [opencv](https://github.com/opencv/opencv.git) - ~~OCR: [chineseocr_lite](https://github.com/DayBreak-u/chineseocr_lite.git)~~ - OCR: [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) -- Deep Learning Model Deployment Toolkit: [FastDeploy](https://github.com/PaddlePaddle/FastDeploy) -- ML inferencing and training accelerator: [onnxruntime](https://github.com/microsoft/onnxruntime) +- ML Deployment: [FastDeploy](https://github.com/PaddlePaddle/FastDeploy) +- ML accelerator: [onnxruntime](https://github.com/microsoft/onnxruntime) - ~~Item drop recognition: [Penguin Stats recognizer](https://github.com/penguin-statistics/recognizer)~~ - Map tile recognition: [Arknights-Tile-Pos](https://github.com/yuanyan3060/Arknights-Tile-Pos) - C++ JSON library: [meojson](https://github.com/MistEO/meojson.git) @@ -109,7 +110,8 @@ Due to the small number of overseas clients users and the lack of project manpow - C++ ZIP library: [zlib](https://github.com/madler/zlib) - C++ Gzip library: [gzip-hpp](https://github.com/mapbox/gzip-hpp) - Touch event producer for Android: [minitouch](https://github.com/openstf/minitouch) -- WPF MVVW framework: [Stylet](https://github.com/canton7/Stylet) +- Touch event producer for Android: [MaaTouch](https://github.com/MaaAssistantArknights/MaaTouch) +- WPF MVVM framework: [Stylet](https://github.com/canton7/Stylet) - WPF control library: [HandyControl](https://github.com/HandyOrg/HandyControl) - C# JSON library: [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) - Downloader: [aria2](https://github.com/aria2/aria2) @@ -132,8 +134,8 @@ Thanks to all friends who contribute to development/testing for making MAA bette ### Windows -- Open `MeoAssistantArknights.sln` with Visual Studio 2022. All settings have been configured properly. -- Switch on the feature of clang-format. Please refer to [Using clang-format in Visual Studio](docs/en-us/2.2-CONTRIBUTING.md#using-clang-format-in-visual-studio). +- Open `MAA.sln` with Visual Studio 2022. All settings have been configured properly. +- Switch on the feature of clang-format. Please refer to [Using clang-format in Visual Studio](docs/en-us/2.2-DEVELOPMENT.md#using-clang-format-in-visual-studio). ### Linux/MacOS @@ -141,13 +143,14 @@ Please refer to [Linux Tutorial](docs/en-us/2.1-LINUX_TUTORIAL.md) ### API -- [C interface](include/AsstCaller.h): [Integration Example](tools/TestCaller/main.cpp) +- [C interface](include/AsstCaller.h): [Integration Example](src/CppSample/main.cpp) - [Python interface](src/Python/asst.py): [Integration Example](src/Python/sample.py) -- [Golang interface](src/Golang/MaaAssistantArknights/): [Integration Example](src/Golang/MaaAssistantArknights/maa/maa.go) +- [Golang interface](src/Golang/): [Integration Example](src/Golang/maa/maa.go) - [Dart interface](src/dart/) -- [Java interface](src/Java/Maaj): [Integration Example](src/Java/Maaj/src/main/java/com/iguigui/maaj/MaaJavaSample.java) -- [Rust interface](src/Rust/src/maa_sys/): [HTTP api](src/Rust) -- [HTTP interface](src/Java/Maaj/Readme.md) +- [Java interface](src/Java): [Integration Example](src/Java/src/main/java/com/iguigui/maaj/MaaJavaSample.java) +- [Rust interface](src/Rust/src/maa_sys/): [HTTP API](src/Rust) +- [HTTP interface](src/Java/Readme.md) +- [TypeScript interface](https://github.com/MaaAssistantArknights/MaaAsstElectronUI/tree/main/packages/main/coreLoader) - [Integration Documentation](docs/en-us/3.1-INTEGRATION.md) - [Callback Schema](docs/en-us/3.2-CALLBACK_SCHEMA.md) - [Task Schema](docs/en-us/3.4-TASK_SCHEMA.md) @@ -171,8 +174,8 @@ Please refer to [Issue Bot Usage](docs/en-us/2.3-ISSUE_BOT_USAGE.md) for more de ## Advertisement -[User Group (Telegram)](https://t.me/+Mgc2Zngr-hs3ZjU1) -Copilot JSON Sharing: , [QQ Group 1(full)](https://jq.qq.com/?_wv=1027&k=1giyMpPb), [QQ Group 2(full)](https://jq.qq.com/?_wv=1027&k=R3oleoKc), [QQ Group 3(full)](https://jq.qq.com/?_wv=1027&k=mKdOnhWV), [QQ Group 4(full)](https://jq.qq.com/?_wv=1027&k=ABkU8mCR), [QQ Group 5(full)](https://jq.qq.com/?_wv=1027&k=To6b6H6m), [QQ Group 6(full)](https://jq.qq.com/?_wv=1027&k=PYoCP2lS), [QQ Group 7](https://jq.qq.com/?_wv=1027&k=xDT9vHvB) +[User Group (Telegram)](https://t.me/+Mgc2Zngr-hs3ZjU1), [QQ Group 1(full)](https://jq.qq.com/?_wv=1027&k=1giyMpPb), [QQ Group 2(full)](https://jq.qq.com/?_wv=1027&k=R3oleoKc), [QQ Group 3(full)](https://jq.qq.com/?_wv=1027&k=mKdOnhWV), [QQ Group 4(full)](https://jq.qq.com/?_wv=1027&k=ABkU8mCR), [QQ Group 5(full)](https://jq.qq.com/?_wv=1027&k=To6b6H6m), [QQ Group 6(full)](https://jq.qq.com/?_wv=1027&k=PYoCP2lS), [QQ Group 7(full)](https://jq.qq.com/?_wv=1027&k=xDT9vHvB), [QQ Group 8](https://jq.qq.com/?_wv=1027&k=PzvqFhOr) +[Copilot JSON Sharing](https://prts.plus) [Bilibili Live](https://live.bilibili.com/2808861): live coding on this program [Technical Discussion & Talk(QQ Group)](https://jq.qq.com/?_wv=1027&k=ypbzXcA2) [Dev Group(QQ Group)](https://jq.qq.com/?_wv=1027&k=JM9oCk3C) diff --git a/README_ja-JP.md b/README_ja-JP.md index 6c46b20182..cbe7104896 100644 --- a/README_ja-JP.md +++ b/README_ja-JP.md @@ -18,7 +18,7 @@
-[简体中文](README.md) | [繁體中文](README_zh-TW.md) | [English](README_en-US.md) | [日本語](README_ja-JP.md) +[简体中文](README.md) | [繁體中文](README_zh-TW.md) | [English](README_en-US.md) | [日本語](README_ja-JP.md) | [한국어](README_ko-KR.md) MAAは、MAA Assistant Arknightsです。 @@ -79,7 +79,7 @@ UIを見れば使い方もすぐ分かる! 作戦、自動基地、自動公開求人、戦友訪問、FP交換所、レワード収集、統合戦略(ベータ版)、公開求人認識の機能がサポートされている。 サポート内容については[README](resource/global/YoStarJP/readme.md)を参照してください。 - 韓国サーバー - 基本的な作戦機能のみサポートされている。 + 作戦、戦友訪問、FP交換所、レワード収集、統合戦略(ベータ版)、公開求人認識の機能がサポートされている。 サポート内容については[README](resource/global/YoStarKR/readme.md)を参照してください。 - TXWYサーバー 基本的な作戦、自動公開求人、統合戦略(ベータ版)、公開求人認識の機能がサポートされている。 @@ -101,8 +101,8 @@ UIを見れば使い方もすぐ分かる! - 画像認識ライブラリ:[opencv](https://github.com/opencv/opencv.git) - ~~テキスト認識ライブラリ:[chineseocr_lite](https://github.com/DayBreak-u/chineseocr_lite.git)~~ - テキスト認識ライブラリ:[PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) -- Deep Learning Model Deployment Toolkit: [FastDeploy](https://github.com/PaddlePaddle/FastDeploy) -- ML inferencing and training accelerator: [onnxruntime](https://github.com/microsoft/onnxruntime) +- ML Deployment: [FastDeploy](https://github.com/PaddlePaddle/FastDeploy) +- ML accelerator: [onnxruntime](https://github.com/microsoft/onnxruntime) - ~~ステージドロップ認識:[PenguinStats認識](https://github.com/penguin-statistics/recognizer)~~ - マップタイル認識:[Arknights-Tile-Pos](https://github.com/yuanyan3060/Arknights-Tile-Pos) - C++ JSONライブラリ:[meojson](https://github.com/MistEO/meojson.git) @@ -111,6 +111,7 @@ UIを見れば使い方もすぐ分かる! - C++ 圧縮・解凍ライブラリ:[zlib](https://github.com/madler/zlib) - C++ Gzipカプセル化ライブラリ:[gzip-hpp](https://github.com/mapbox/gzip-hpp) - Android タッチ イベント: [minitouch](https://github.com/openstf/minitouch) +- Android タッチ イベント: [MaaTouch](https://github.com/MaaAssistantArknights/MaaTouch) - WPF MVVWフレームワーク:[Stylet](https://github.com/canton7/Stylet) - WPFコントロールライブラリ:[HandyControl](https://github.com/HandyOrg/HandyControl) - C# JSONライブラリ:[Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) @@ -134,7 +135,7 @@ MAAをより良くするために開発・テストに貢献してくれたす ### Windows -- Visual Studio 2022で `MeoAssistantArknights.sln` を開きます。環境がすでに構成されています。 +- Visual Studio 2022で `MAA.sln` を開きます。環境がすでに構成されています。 - clang-formatのサポートを有効にすることをお勧めします。詳細については、[Visual Studioでclang-formatを有効にする](docs/ja-jp/2.2-プルリクエスト.md)を参照してください。 ### Linux | macOS @@ -143,13 +144,14 @@ MAAをより良くするために開発・テストに貢献してくれたす ### API -- [Cインターフェース](include/AsstCaller.h):[統合例](tools/TestCaller/main.cpp) +- [Cインターフェース](include/AsstCaller.h):[統合例](src/CppSample/main.cpp) - [Pythonインターフェース](src/Python/asst.py):[統合例](src/Python/sample.py) -- [Golangインターフェース](src/Golang/MaaAssistantArknights/):[統合例](src/Golang/MaaAssistantArknights/maa/maa.go) +- [Golangインターフェース](src/Golang/):[統合例](src/Golang/maa/maa.go) - [Dartインターフェース](src/dart/) -- [Javaインターフェース](src/Java/Maaj/src/main/java/com/iguigui/maaj/easySample/MeoAssistant.java):[統合例](src/Java/Maaj/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java) +- [Javaインターフェース](src/Java/src/main/java/com/iguigui/maaj/easySample/MaaCore.java):[統合例](src/Java/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java) - [Rustインターフェース](src/Rust/src/maa_sys/):[HTTPインターフェース](src/Rust) -- [HTTPインターフェース](src/Java/Maaj/Readme.md) +- [HTTPインターフェース](src/Java/Readme.md) +- [TypeScriptインターフェース](https://github.com/MaaAssistantArknights/MaaAsstElectronUI/tree/main/packages/main/coreLoader) - [統合ドキュメント](docs/ja-jp/3.1-統合ドキュメント.md) - [コールバックAPI](docs/ja-jp/3.2-コールバックAPI.md) - [タスクAPI](docs/ja-jp/3.4-タスクAPI.md) @@ -173,10 +175,10 @@ MAAをより良くするために開発・テストに貢献してくれたす ## 広告 -[ユーザー研究グループ(Telegram)](https://t.me/+Mgc2Zngr-hs3ZjU1) -自動作戦JSON作業シェア:、[QQグループ1(満員)](https://jq.qq.com/?_wv=1027&k=ig786LJZ)、[QQグループ2(満員)](https://jq.qq.com/?_wv=1027&k=R3oleoKc)、[QQグループ3(満員)](https://jq.qq.com/?_wv=1027&k=mKdOnhWV)、[QQグループ4(満員)](https://jq.qq.com/?_wv=1027&k=ABkU8mCR)、[QQグループ5(満員)](https://jq.qq.com/?_wv=1027&k=To6b6H6m)、[QQグループ6(満員)](https://jq.qq.com/?_wv=1027&k=PYoCP2lS)、[QQグループ7](https://jq.qq.com/?_wv=1027&k=xDT9vHvB) -[ビリビリ生放送](https://live.bilibili.com/2808861):毎晩ライブでコーディングします、最近はずっとこのソフトウェアのプログラミングをしていることが多いです。 +[ユーザー研究グループ(Telegram)](https://t.me/+Mgc2Zngr-hs3ZjU1)、[QQグループ1(満員)](https://jq.qq.com/?_wv=1027&k=ig786LJZ)、[QQグループ2(満員)](https://jq.qq.com/?_wv=1027&k=R3oleoKc)、[QQグループ3(満員)](https://jq.qq.com/?_wv=1027&k=mKdOnhWV)、[QQグループ4(満員)](https://jq.qq.com/?_wv=1027&k=ABkU8mCR)、[QQグループ5(満員)](https://jq.qq.com/?_wv=1027&k=To6b6H6m)、[QQグループ6(満員)](https://jq.qq.com/?_wv=1027&k=PYoCP2lS)、[QQグループ7(満員)](https://jq.qq.com/?_wv=1027&k=xDT9vHvB)、[QQグループ8](https://jq.qq.com/?_wv=1027&k=PzvqFhOr) +[自動作戦JSON作業シェア](https://prts.plus) +[ビリビリ生放送](https://live.bilibili.com/2808861):毎晩ライブでコーディングします、最近はずっとこのソフトウェアのプログラミングをしていることが多いです。 [アークナイツ無関係技術研究 & チャットグループ(QQ)](https://jq.qq.com/?_wv=1027&k=ypbzXcA2):インボリューション・ヘル! -[開発者グループ(QQ)](https://jq.qq.com/?_wv=1027&k=JM9oCk3C) +[開発者グループ(QQ)](https://jq.qq.com/?_wv=1027&k=JM9oCk3C) ソフトウェアが役立つと思うなら、Star(ページの右上隅にある星)をクリックしてください。私たちにとって最高のサポートです! diff --git a/README_ko-KR.md b/README_ko-KR.md new file mode 100644 index 0000000000..ae4767bc00 --- /dev/null +++ b/README_ko-KR.md @@ -0,0 +1,186 @@ +
+ +LOGO + +# MaaAssistantArknights + +
+
+ C++ +
+
+ platform +
+
+ license + commit + stars +
+
+ +[简体中文](README.md) | [繁體中文](README_zh-TW.md) | [English](README_en-US.md) | [日本語](README_ja-JP.md) | [한국어](README_ko-KR.md) + +MAA는 MAA Assistant Arknights를 의미합니다 + +명일방주 어시스턴트 + +이미지 인식을 기반으로, 한 번의 클릭만으로 그날의 모든 작업을 끝내드립니다! + +개발 진행 중입니다 ✿✿ヽ(°▽°)ノ✿ + +
+ +## 개요 + +- 자동 전투, 아이템 드랍 인식, [펭귄 물류](https://penguin-stats.io/)로의 자동 업로드 +- 기반시설 자동 배치, 오퍼레이터 효율과 시설 내 최적 배치방안 자동 계산 +- 자동 공개모집과 선택적 즉시 모집, [펭귄 물류](https://penguin-stats.io/result/stage/recruit/recruit)와 [Yituliu](https://yituliu.site/maarecruitdata)로의 자동 업로드 +- 친구 방문, 크레딧 획득과 아이템 구매, 일일 임무와 보상까지 한 번에! +- 통합전략에서의 오리지늄각뿔과 양초 획득을 위한 자동 전투, 오퍼레이터와 레벨의 자동 인식 +- 전투 JSON 파일을 통한 자동 전투용 전략 복사! [영상 데모](https://www.bilibili.com/video/BV1H841177Fk/) +- 새로운 기능: 창고 인식! [펭귄 물류 ArkPlanner](https://penguin-stats.cn/planner), [arkn.lolicon.app](https://arkn.lolicon.app/#/material)과 [ark-nights.com](https://ark-nights.com/settings)로의 내보내기 지원 + +말로만 설명하기보다는 사진으로 보여드리겠습니다! + +![image](https://user-images.githubusercontent.com/18511905/198692842-1ad89bd0-f943-4763-bdd1-c212e09dc832.png) +![image](https://user-images.githubusercontent.com/99072975/181417869-bb312d7e-f867-45c6-84b9-d18c583232d5.png) +![image](https://user-images.githubusercontent.com/18511905/198689839-612f3bfc-c308-4d62-969d-8544764e794d.png) + +## 다운로드 + +[안정 버전](https://github.com/MaaAssistantArknights/MaaAssistantArknights/releases/latest) +[베타 버전](https://github.com/MaaAssistantArknights/MaaAssistantArknights/releases) + +## 사용 방법 + +### 기본 설정 + +1. [에뮬레이터 지원](docs/ko-kr/1.3-에뮬레이터_지원.md) 문서를 참고하여 에뮬레이터/기기를 설정해 주세요. +2. 에뮬레이터/기기의 해상도를 `1280 × 720` 또는 그 이상의 `16:9` 비율인 해상도로 맞춰주세요. +3. 어시스턴트 시작! + +자세한 내용은 [사용자 설명서](docs/ko-kr/1.1-사용자_설명서.md)를 참조해 주세요. + +## FAQ + +- 프로그램이 실행하자마자 곧바로 튕겨요 +- 연결 오류가 발생해요/ADB 경로를 어떻게 작성해야 하는지 모르겠어요 +- 연결은 성공했는데, 그대로 멈춰 버렸어요 +- 연결 설정(포트 등)을 바꾸고 싶어요 +- 다운로드 속도가 너무 느려요/미러 사이트가 접속이 안 돼요 +- 다운로드 도중에 “로그인”이나 “인증”이라는 메시지가 떠요 + +[FAQ](docs/ko-kr/1.2-FAQ.md) 문서를 참조해 주세요. + +## 해외 서버 지원 + +- 글로벌 서버 + 작전, 크레딧 상점, 친구 방문, 임무 보상 수령, 자동 통합전략(베타), 공개모집 계산 등을 지원합니다. + 자세한 내용은 [문서](resource/global/YoStarEN/readme.md)를 참조해 주세요. +- 일본 서버 + 작전, 기반시설 관리, 크레딧 상점, 친구 방문, 임무 보상 수령, 자동 통합전략(베타), 공개모집 계산 등을 지원합니다. + 자세한 내용은 [문서](resource/global/YoStarJP/readme.md)를 참조해 주세요. +- 한국 서버 + 작전, 크레딧 상점, 친구 방문, 임무 보상 수령, 자동 통합전략(베타), 공개모집 계산 등을 지원합니다. + 자세한 내용은 [문서](resource/global/YoStarKR/readme.md)를 참조해 주세요. +- 중국어 번체 서버 + 작전, 공개모집, 자동 통합전략(베타), 공개모집 계산 등을 지원합니다. + 자세한 내용은 [문서](resource/global/txwy/readme.md)를 참조해 주세요. + +해외 서버의 플레이어가 적고 프로젝트의 인력이 부족하기 때문에 해외 서버들의 경우에는 기본적인 기능만이 갖추어져 있습니다. 필요한 것이 있다면 [토의](https://github.com/MaaAssistantArknights/MaaAssistantArknights/discussions)에 참가하거나 직접 MAA의 개선에 함께해주세요! + +## 관련 프로젝트 + +- 새 GUI: [MaaAsstElectronUI](https://github.com/MaaAssistantArknights/MaaAsstElectronUI) (현재 개발 중입니다. 도움은 환영합니다!) +- 업데이트 서버: [MaaDownloadServer](https://github.com/MaaAssistantArknights/MaaDownloadServer) +- 공식 웹사이트 [maa.plus](https://maa.plus): [maa-website](https://github.com/MaaAssistantArknights/maa-website) +- 전략 파일 저장소 [prts.plus](https://prts.plus): [프론트엔드](https://github.com/MaaAssistantArknights/maa-copilot-frontend), [백엔드](https://github.com/MaaAssistantArknights/MaaCopilotServer) + +## 감사의 말 + +### 오픈소스 라이브러리 + +- 이미지 인식: [opencv](https://github.com/opencv/opencv.git) +- ~~글자 인식: [chineseocr_lite](https://github.com/DayBreak-u/chineseocr_lite.git)~~ +- 글자 인식: [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) +- ML Deployment: [FastDeploy](https://github.com/PaddlePaddle/FastDeploy) +- ML accelerator: [onnxruntime](https://github.com/microsoft/onnxruntime) +- ~~아이템 드랍 인식: [Penguin Stats recognizer](https://github.com/penguin-statistics/recognizer)~~ +- 맵 타일 인식: [Arknights-Tile-Pos](https://github.com/yuanyan3060/Arknights-Tile-Pos) +- C++ JSON 라이브러리: [meojson](https://github.com/MistEO/meojson.git) +- C++ 오퍼레이터 파서: [calculator](https://github.com/kimwalisch/calculator) +- ~~C++ Base64 인코딩/디코딩: [cpp-base64](https://github.com/ReneNyffenegger/cpp-base64)~~ +- C++ ZIP 라이브러리: [zlib](https://github.com/madler/zlib) +- C++ Gzip 라이브러리: [gzip-hpp](https://github.com/mapbox/gzip-hpp) +- 안드로이드 터치 이벤트 구현: [minitouch](https://github.com/openstf/minitouch) +- 안드로이드 터치 이벤트 구현: [MaaTouch](https://github.com/MaaAssistantArknights/MaaTouch) +- WPF MVVM 프레임워크: [Stylet](https://github.com/canton7/Stylet) +- WPF 조작 라이브러리: [HandyControl](https://github.com/HandyOrg/HandyControl) +- C# JSON 라이브러리: [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) +- 다운로더: [aria2](https://github.com/aria2/aria2) + +### 데이터 소스 + +- ~~공개모집 데이터: [ArkTools](https://www.bigfun.cn/tools/aktools/hr)~~ +- 오퍼레이터/기반시설 데이터: [PRTS Arknights Wiki (Chinese)](http://prts.wiki/) +- 스테이지 데이터: [Penguin Stats](https://penguin-stats.io/) +- 게임 데이터/리소스: [Arknights Bot Resource](https://github.com/yuanyan3060/Arknights-Bot-Resource) +- 게임 데이터: [Arknights Game Data](https://github.com/Kengxxiao/ArknightsGameData) + +### 기여자 + +MAA의 개선을 위한 개발/테스트에 기여해준 모든 친구들에게 감사드립니다! (\*´▽`)ノノ + +[![Contributors](https://contributors-img.web.app/image?repo=MaaAssistantArknights/MaaAssistantArknights)](https://github.com/MaaAssistantArknights/MaaAssistantArknights/graphs/contributors) + +## 개발 관련 정보 + +### Windows + +- `MAA.sln`를 Visual Studio 2022로 열어주세요. 모든 설정이 제대로 구성되어 있습니다. +- clang-format 기능을 활성화해 주세요. 자세한 내용은 [개발](docs/ko-kr/2.2-개발.md) 문서의 [Visual Studio에서 clang-format 활성화](docs/ko-kr/2.2-개발.md#visual-studio에서-clang-format-활성화) 문단을 참조해 주세요. + +### Linux/MacOS + +[Linux_튜토리얼](docs/ko-kr/2.1-Linux_튜토리얼.md) 문서를 참조해 주세요. + +### API + +- [C 인터페이스](include/AsstCaller.h): [통합 예시](src/CppSample/main.cpp) +- [Python 인터페이스](src/Python/asst.py): [통합 예시](src/Python/sample.py) +- [Golang 인터페이스](src/Golang/): [통합 예시](src/Golang/maa/maa.go) +- [Dart 인터페이스](src/dart/) +- [Java 인터페이스](src/Java): [통합 예시](src/Java/src/main/java/com/iguigui/maaj/MaaJavaSample.java) +- [Rust 인터페이스](src/Rust/src/maa_sys/): [HTTP 인터페이스](src/Rust) +- [HTTP 인터페이스](src/Java/Readme.md) +- [TypeScript 인터페이스](https://github.com/MaaAssistantArknights/MaaAsstElectronUI/tree/main/packages/main/coreLoader) +- [통합](docs/ko-kr/3.1-통합.md) +- [콜백 형식](docs/ko-kr/3.2-콜백_형식.md) +- [임무 형식](docs/ko-kr/3.4-임무_형식.md) +- [전략 형식](docs/ko-kr/3.3-전략_형식.md) + +### Issue Bot + +- `Add {LABEL_NAME}`로 레이블을 추가하고, `Remove {LABEL_NAME}`로 제거하세요. +- 커밋에서 `close #{ISSUE_NUMBER}` 또는 `fix #{ISSUE_NUMBER}`로 `fixed` 태그를 이슈에 추가하세요. + +자세한 내용은 [Issue Bot 사용방법](docs/ko-kr/2.3-IssueBot사용방법.md)을 참조해 주세요. + +### GitHub에 익숙치 않은 사용자용 가이드 + +[개발](docs/ko-kr/2.2-개발.md) 문서의 [GitHub Pull Request에 대한 설명](docs/ko-kr/2.2-개발.md#github-pull-request에-대한-설명) 문단을 참조해 주세요. + +## 주의사항 + +- 이 프로그램의 로고는 AGPL 3.0 라이센스의 적용 대상이 아닙니다. [耗毛](https://weibo.com/u/3251357314)와 Vie 두 명의 아티스트와 프로그램의 개발자들이 모든 권리를 가집니다. 프로젝트가 AGPL 3.0 라이센스 하에 있다고 하더라도 프로그램의 로고는 동의 없이 사용되어서는 안 되며, 동의 없는 상업적 이용 또한 금지됩니다. +- 이 프로그램이 오픈소스이자 무료이며 학습 및 커뮤니케이션 전용입니다. 이 프로그램을 이용해 장비값이나 시간당 수수료 등을 대가로 서비스를 제공하는 판매자로 인해 발생하는 문제와 결과는 프로그램의 개발자들에게는 책임이 없습니다. + +## 광고 + +[사용자 그룹 (Telegram)](https://t.me/+Mgc2Zngr-hs3ZjU1), [QQ 그룹 1 (만원)](https://jq.qq.com/?_wv=1027&k=1giyMpPb), [QQ 그룹 2 (만원)](https://jq.qq.com/?_wv=1027&k=R3oleoKc), [QQ 그룹 3 (만원)](https://jq.qq.com/?_wv=1027&k=mKdOnhWV), [QQ 그룹 4 (만원)](https://jq.qq.com/?_wv=1027&k=ABkU8mCR), [QQ 그룹 5 (만원)](https://jq.qq.com/?_wv=1027&k=To6b6H6m), [QQ 그룹 6 (만원)](https://jq.qq.com/?_wv=1027&k=PYoCP2lS), [QQ 그룹 7(만원)](https://jq.qq.com/?_wv=1027&k=xDT9vHvB), [QQ 그룹 8](https://jq.qq.com/?_wv=1027&k=PzvqFhOr) +[전략 JSON 공유](https://prts.plus) +[빌리빌리 라이브](https://live.bilibili.com/2808861): 코딩 과정을 밤마다 방송하고 있습니다. 이 프로그램에 대부분의 시간을 할애하고 있습니다. +[명일방주 무관 기술 공유 & 만담 (QQ 그룹)](https://jq.qq.com/?_wv=1027&k=ypbzXcA2): 지옥 같아요! +[개발자 그룹 (QQ 그룹)](https://jq.qq.com/?_wv=1027&k=JM9oCk3C) + +프로그램이 도움이 된다고 생각하시면 Star를 눌러주세요! (페이지 우측 상단의 작은 별) 저희에게 가장 큰 도움이 됩니다! diff --git a/README_zh-TW.md b/README_zh-TW.md index fe1669db3e..19d3fd3ad9 100644 --- a/README_zh-TW.md +++ b/README_zh-TW.md @@ -18,7 +18,7 @@
-[简体中文](README.md) | [繁體中文](README_zh-TW.md) | [English](README_en-US.md) | [日本語](README_ja-JP.md) +[简体中文](README.md) | [繁體中文](README_zh-TW.md) | [English](README_en-US.md) | [日本語](README_ja-JP.md) | [한국어](README_ko-KR.md) MAA 的意思是 MAA Assistant Arknights @@ -79,7 +79,7 @@ MAA 的意思是 MAA Assistant Arknights - 日服 支援基本的刷理智、自動基建、信用購物、自動公招、訪問好友、領取獎勵、自動肉鴿(測試版本)、公招辨識,請參考 [說明](resource/global/YoStarJP/readme.md) - 韓服 - 支援基本的刷理智功能,請參考 [說明](resource/global/YoStarKR/readme.md) + 支援基本的刷理智、信用購物、訪問好友、領取獎勵、自動肉鴿(測試版本)、公招辨識,請參考 [說明](resource/global/YoStarKR/readme.md) - 繁中服 支援基本的刷理智、自動公招、自動肉鴿、領取日常、公招辨識功能,請參考 [說明](resource/global/txwy/readme.md) @@ -99,8 +99,8 @@ MAA 的意思是 MAA Assistant Arknights - 圖像辨識庫:[opencv](https://github.com/opencv/opencv.git) - ~~字元辨識庫:[chineseocr_lite](https://github.com/DayBreak-u/chineseocr_lite.git)~~ - 字元辨識庫:[PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) -- Deep Learning Model Deployment Toolkit: [FastDeploy](https://github.com/PaddlePaddle/FastDeploy) -- ML inferencing and training accelerator: [onnxruntime](https://github.com/microsoft/onnxruntime) +- 深度學習部署庫:[FastDeploy](https://github.com/PaddlePaddle/FastDeploy) +- 機器學習加速器:[onnxruntime](https://github.com/microsoft/onnxruntime) - ~~關卡掉落辨識:[企鵝物流辨識](https://github.com/penguin-statistics/recognizer)~~ - 地圖格子辨識:[Arknights-Tile-Pos](https://github.com/yuanyan3060/Arknights-Tile-Pos) - C++ JSON庫:[meojson](https://github.com/MistEO/meojson.git) @@ -109,7 +109,8 @@ MAA 的意思是 MAA Assistant Arknights - C++ 解壓壓縮庫:[zlib](https://github.com/madler/zlib) - C++ Gzip封裝:[gzip-hpp](https://github.com/mapbox/gzip-hpp) - 安卓觸控事件器:[minitouch](https://github.com/openstf/minitouch) -- WPF MVVW框架:[Stylet](https://github.com/canton7/Stylet) +- 安卓觸控事件器:[MaaTouch](https://github.com/MaaAssistantArknights/MaaTouch) +- WPF MVVM框架:[Stylet](https://github.com/canton7/Stylet) - WPF部件庫:[HandyControl](https://github.com/HandyOrg/HandyControl) - C# JSON庫:[Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) - 下載器:[aria2](https://github.com/aria2/aria2) @@ -132,7 +133,7 @@ MAA 的意思是 MAA Assistant Arknights ### Windows -- 直接使用 Visual Studio 2022 打開 `MeoAssistantArknights.sln` 即可,所有環境都是配置好的 +- 直接使用 Visual Studio 2022 打開 `MAA.sln` 即可,所有環境都是配置好的 - 建議啟用 clang-format 支援,詳細內容可以參考 [在 Visual Studio 中啟用 clang-format](docs/2.2-开发相关.md#在-visual-studio-中启用-clang-format) ### Linux | macOS @@ -141,13 +142,14 @@ MAA 的意思是 MAA Assistant Arknights ### API -- [C 介面](include/AsstCaller.h):[整合示例](tools/TestCaller/main.cpp) +- [C 介面](include/AsstCaller.h):[整合示例](src/CppSample/main.cpp) - [Python 介面](src/Python/asst.py):[整合示例](src/Python/sample.py) -- [Golang 介面](src/Golang/MaaAssistantArknights/):[整合示例](src/Golang/MaaAssistantArknights/maa/maa.go) +- [Golang 介面](src/Golang/):[整合示例](src/Golang/maa/maa.go) - [Dart 介面](src/dart/) -- [Java 介面](src/Java/Maaj/src/main/java/com/iguigui/maaj/easySample/MeoAssistant.java):[整合示例](src/Java/Maaj/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java) +- [Java 介面](src/Java/src/main/java/com/iguigui/maaj/easySample/MaaCore.java):[整合示例](src/Java/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java) - [Rust 介面](src/Rust/src/maa_sys/):[HTTP 介面](src/Rust) -- [HTTP 介面](src/Java/Maaj/Readme.md) +- [HTTP 介面](src/Java/Readme.md) +- [TypeScript 介面](https://github.com/MaaAssistantArknights/MaaAsstElectronUI/tree/main/packages/main/coreLoader) - [整合文件](docs/zh-tw/3.1-集成文件.md) - [回呼訊息協定](docs/zh-tw/3.2-回呼訊息協定.md) - [任務流程協定](docs/zh-tw/3.4-任務流程協定.md) @@ -171,10 +173,10 @@ MAA 的意思是 MAA Assistant Arknights ## 廣告 -[用戶交流群(Telegram 群)](https://t.me/+Mgc2Zngr-hs3ZjU1) -自動戰鬥 JSON 作業分享: , [QQ 一群(已滿)](https://jq.qq.com/?_wv=1027&k=ig786LJZ),[QQ 二群(已滿)](https://jq.qq.com/?_wv=1027&k=R3oleoKc),[QQ 三群(已滿)](https://jq.qq.com/?_wv=1027&k=mKdOnhWV),[QQ 四群(已滿)](https://jq.qq.com/?_wv=1027&k=ABkU8mCR),[QQ 五群(已滿)](https://jq.qq.com/?_wv=1027&k=To6b6H6m),[QQ 六群(已滿)](https://jq.qq.com/?_wv=1027&k=PYoCP2lS),[QQ 七群](https://jq.qq.com/?_wv=1027&k=xDT9vHvB) +[用戶交流群(Telegram 群)](https://t.me/+Mgc2Zngr-hs3ZjU1),[QQ 一群(已滿)](https://jq.qq.com/?_wv=1027&k=ig786LJZ),[QQ 二群(已滿)](https://jq.qq.com/?_wv=1027&k=R3oleoKc),[QQ 三群(已滿)](https://jq.qq.com/?_wv=1027&k=mKdOnhWV),[QQ 四群(已滿)](https://jq.qq.com/?_wv=1027&k=ABkU8mCR),[QQ 五群(已滿)](https://jq.qq.com/?_wv=1027&k=To6b6H6m),[QQ 六群(已滿)](https://jq.qq.com/?_wv=1027&k=PYoCP2lS),[QQ 七群(已滿)](https://jq.qq.com/?_wv=1027&k=xDT9vHvB),[QQ 八群](https://jq.qq.com/?_wv=1027&k=PzvqFhOr) +[自動戰鬥 JSON 作業分享](https://prts.plus) [Bilibili 直播間](https://live.bilibili.com/2808861):每晚直播敲代碼,近期很長一段時間應該都是在寫本軟體~ [舟無關技術交流 & 吹水群(QQ 群)](https://jq.qq.com/?_wv=1027&k=ypbzXcA2):內捲地獄! -[開發者群(QQ 群)](https://jq.qq.com/?_wv=1027&k=JM9oCk3C) +[開發者群(QQ 群)](https://jq.qq.com/?_wv=1027&k=JM9oCk3C) 如果覺得軟體對你有幫助,幫忙點個 Star 吧!~(網頁最上方右上角的小星星),這就是對我們最大的支持了! diff --git a/cmake/fastdeploy.cmake b/cmake/fastdeploy.cmake new file mode 100644 index 0000000000..0c1ce0ffe2 --- /dev/null +++ b/cmake/fastdeploy.cmake @@ -0,0 +1,45 @@ + + +set(FASTDEPLOY_URL_PREFIX "https://github.com/MaaAssistantArknights/build-fastdeploy/releases/download") + +set(FASTDEPLOY_TAG "g22325d23") + +set(COMPRESSED_SUFFIX ".tar.gz") + +if(UNIX) + set(FASTDEPLOY_FILENAME "FastDeploy-Linux") + set(FASTDEPLOY_CHECKSUM "5e1dedc72714f6f11fb1dfbc720d675203525152b777bd2711ba26f2a95e5f99") +elseif(WIN32) + set(FASTDEPLOY_FILENAME "FastDeploy-Windows") + set(FASTDEPLOY_CHECKSUM "0ea6064921a0af50ba8a1593fe1652a11379acad53f15e100731f02c3c9edfd1") +elseif(APPLE) + set(FASTDEPLOY_FILENAME "FastDeploy-macOS") + set(FASTDEPLOY_CHECKSUM "80188fb70c5632ba5b93338d5c6d323619430dcad77043250399dce8fb480d8d") +endif(UNIX) + +set(FASTDEPLOY_URL ${FASTDEPLOY_URL_PREFIX}/${FASTDEPLOY_TAG}/${FASTDEPLOY_FILENAME}${COMPRESSED_SUFFIX}) + +if (FASTDEPLOY_DIRECTORY) + set(FastDeploy_DIR ${FASTDEPLOY_DIRECTORY}) + find_package(FastDeploy REQUIRED PATHS ${FastDeploy_DIR}) + include_directories(${FastDeploy_INCLUDE_DIRS}) + list(APPEND DEPEND_LIBS ${FastDeploy_LIBS}) +else () + download_and_decompress(${FASTDEPLOY_URL} + ${CMAKE_CURRENT_BINARY_DIR}/${FASTDEPLOY_FILENAME}${COMPRESSED_SUFFIX} + ${FASTDEPLOY_CHECKSUM} + ${THIRD_PARTY_PATH}/install/) + set(FASTDEPLOY_FILENAME fastdeploy) + set(FastDeploy_DIR ${THIRD_PARTY_PATH}/install/${FASTDEPLOY_FILENAME}) + + find_package(FastDeploy REQUIRED PATHS ${FastDeploy_DIR} NO_DEFAULT_PATH) + include_directories(${FastDeploy_INCLUDE_DIRS}) + list(APPEND DEPEND_LIBS ${FastDeploy_LIBS}) +endif (FASTDEPLOY_DIRECTORY) + +if (INSTALL_THIRD_LIBS) + install(DIRECTORY ${FastDeploy_DIR}/lib/ DESTINATION . USE_SOURCE_PERMISSIONS) + install(DIRECTORY ${ORT_LIB_PATH}/ DESTINATION . USE_SOURCE_PERMISSIONS) + install(DIRECTORY ${FastDeploy_DIR}/third_libs/install/paddle2onnx/lib/ + DESTINATION . USE_SOURCE_PERMISSIONS) +endif (INSTALL_THIRD_LIBS) diff --git a/cmake/macos.cmake b/cmake/macos.cmake new file mode 100644 index 0000000000..bf5d596bd4 --- /dev/null +++ b/cmake/macos.cmake @@ -0,0 +1,47 @@ +set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0) + +if (BUILD_UNIVERSAL) + set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") +endif () + +if (MAA_DEPS_PATH AND EXISTS ${MAA_DEPS_PATH}) + message(STATUS "Using MAA_DEPS_PATH: ${MAA_DEPS_PATH}") +else () + message(STATUS "MAA_DEPS_PATH not set, using default") + + include(FetchContent) + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") + cmake_policy(SET CMP0135 NEW) + endif() + FetchContent_Declare( + MAA_DEPS + URL https://github.com/hguandl/maa-deps/releases/download/v20221204/maa-deps-macos-v20221204.tar.xz + URL_HASH SHA256=5e193f80a74d1591531bf7de5afccc21b8579fb3363a0b089198cb75fbf89df2) + FetchContent_MakeAvailable(MAA_DEPS) + + set(MAA_DEPS_PATH ${maa_deps_SOURCE_DIR} CACHE PATH "Path to maa-deps" FORCE) +endif () + +set(FastDeploy_LIBS + "${MAA_DEPS_PATH}/lib/libfastdeploy.a" + "${MAA_DEPS_PATH}/lib/libonnxruntime_common.a" + "${MAA_DEPS_PATH}/lib/libonnxruntime_flatbuffers.a" + "${MAA_DEPS_PATH}/lib/libonnxruntime_framework.a" + "${MAA_DEPS_PATH}/lib/libonnxruntime_graph.a" + "${MAA_DEPS_PATH}/lib/libonnxruntime_mlas.a" + "${MAA_DEPS_PATH}/lib/libonnxruntime_optimizer.a" + "${MAA_DEPS_PATH}/lib/libonnxruntime_providers.a" + "${MAA_DEPS_PATH}/lib/libonnxruntime_session.a" + "${MAA_DEPS_PATH}/lib/libonnxruntime_util.a" + "${MAA_DEPS_PATH}/lib/libpaddle2onnx.1.0.4.dylib" + "${MAA_DEPS_PATH}/lib/libprotobuf.a" + "${MAA_DEPS_PATH}/lib/onnxruntime/external/libabsl_city.a" + "${MAA_DEPS_PATH}/lib/onnxruntime/external/libabsl_hash.a" + "${MAA_DEPS_PATH}/lib/onnxruntime/external/libabsl_low_level_hash.a" + "${MAA_DEPS_PATH}/lib/onnxruntime/external/libabsl_raw_hash_set.a" + "${MAA_DEPS_PATH}/lib/onnxruntime/external/libabsl_throw_delegate.a" + "${MAA_DEPS_PATH}/lib/onnxruntime/external/libnsync_cpp.a" + "${MAA_DEPS_PATH}/lib/onnxruntime/external/libonnx.a" + "${MAA_DEPS_PATH}/lib/onnxruntime/external/libonnx_proto.a" + "${MAA_DEPS_PATH}/lib/onnxruntime/external/libre2.a" +) diff --git a/cmake/opencv.cmake b/cmake/opencv.cmake new file mode 100644 index 0000000000..9e3069653c --- /dev/null +++ b/cmake/opencv.cmake @@ -0,0 +1,49 @@ + + +set(OPENCV_URL_PREFIX "https://github.com/MaaAssistantArknights/build-opencv/releases/download") + +set(OPENCV_TAG "4.5.3") + +set(COMPRESSED_SUFFIX ".tar.gz") + +if(UNIX) + set(OPENCV_FILENAME "OpenCV-Linux") + set(OPENCV_CHECKSUM "ab41d96f64d8aada3c06584f88bcc5c94eab9f8a4c1a6fbe2e20d83d5509f1c3") +elseif(WIN32) + set(OPENCV_FILENAME "OpenCV-Windows") + set(OPENCV_CHECKSUM "92213f8615d5ca74bf6a8a3681abaac1f5981f9da6b5a1808759909329bb5ea2") +elseif(APPLE) + set(OPENCV_FILENAME "OpenCV-macOS") + set(OPENCV_CHECKSUM "44d6308696ee0b38d1ba40b8b16ee0cb1da4a0f9f72b6916afc5b18b99a9089e") +endif(UNIX) + +set(OPENCV_URL ${OPENCV_URL_PREFIX}/${OPENCV_TAG}/${OPENCV_FILENAME}${COMPRESSED_SUFFIX}) + +if(OPENCV_DIRECTORY) + set(OpenCV_DIR ${OPENCV_DIRECTORY}) + find_package(OpenCV REQUIRED PATHS ${OpenCV_DIR}) + include_directories(${OpenCV_INCLUDE_DIRS}) + list(APPEND DEPEND_LIBS ${OpenCV_LIBS}) +else() + download_and_decompress(${OPENCV_URL} + ${CMAKE_CURRENT_BINARY_DIR}/${OPENCV_FILENAME}${COMPRESSED_SUFFIX} + ${OPENCV_CHECKSUM} + ${THIRD_PARTY_PATH}/install/) + set(OPENCV_FILENAME opencv) + set(OpenCV_DIR ${THIRD_PARTY_PATH}/install/${OPENCV_FILENAME}) + set(OPENCV_DIRECTORY ${OpenCV_DIR}) + if (WIN32) + set(OpenCV_DIR ${OpenCV_DIR}/lib) + endif() + find_package(OpenCV REQUIRED PATHS ${OpenCV_DIR} NO_DEFAULT_PATH) + include_directories(${OpenCV_INCLUDE_DIRS}) + list(APPEND DEPEND_LIBS ${OpenCV_LIBS}) +endif(OPENCV_DIRECTORY) + +if (INSTALL_THIRD_LIBS) + if (OpenCV_SHARED) + install(DIRECTORY ${OpenCV_INSTALL_PATH}/lib/ + DESTINATION . + USE_SOURCE_PERMISSIONS PATTERN "cmake" EXCLUDE) + endif (OpenCV_SHARED) +endif (INSTALL_THIRD_LIBS) diff --git a/cmake/utils.cmake b/cmake/utils.cmake new file mode 100644 index 0000000000..349aa4f517 --- /dev/null +++ b/cmake/utils.cmake @@ -0,0 +1,15 @@ +function(download_and_decompress url filename sha256_checksum decompress_dir) + if(EXISTS ${filename}) + file(SHA256 ${filename} CHECKSUM_VARIABLE) + endif() + if(NOT EXISTS ${filename} OR NOT CHECKSUM_VARIABLE STREQUAL sha256_checksum) + message("Downloading file from ${url} to ${filename} ...") + file(DOWNLOAD ${url} "${filename}.tmp" SHOW_PROGRESS EXPECTED_HASH SHA256=${sha256_checksum}) + file(RENAME "${filename}.tmp" ${filename}) + endif() + if(NOT EXISTS ${decompress_dir}) + file(MAKE_DIRECTORY ${decompress_dir}) + endif() + message("Decompress file ${filename} ...") + execute_process(COMMAND ${CMAKE_COMMAND} -E tar -xf ${filename} WORKING_DIRECTORY ${decompress_dir}) +endfunction() diff --git a/docs/1.1-详细介绍.md b/docs/1.1-详细介绍.md index b9af05d748..89ca5d57e0 100644 --- a/docs/1.1-详细介绍.md +++ b/docs/1.1-详细介绍.md @@ -121,8 +121,6 @@ - 底层算法纯 C++ 开发,并设计了多重的缓存技术,最大限度降低 CPU 和内存占用。 - 软件支持自动更新 ✿✿ヽ(°▽°)ノ✿ 推荐非杠精的同学使用测试版,一般来说更新快且 bug 少(什么 MIUI (╯‵□′)╯︵┻━┻ - 如果新版本自动下载失败,可手动下载后,直接把压缩包放到同目录下,会自动更新的。 -- 我们还提供了 GPU 版本 ~~图一乐版本~~ ,最少需要 6G 显存的 N 卡(建议 8G 或更高),实测 CPU 占用大幅下降,但内存会占用 3G 以上,显存占用 4G 以上。有兴趣的朋友可自行体验:[下载地址](https://115.com/s/sw6qxpd3hu0?password=j2f1&#),下载后替换到 MAA 中即可,若链接不可用也可以去 QQ 群文件获取~ - ## 其他功能 diff --git a/docs/1.3-模拟器支持.md b/docs/1.3-模拟器支持.md index 81abcb7127..8177060e57 100644 --- a/docs/1.3-模拟器支持.md +++ b/docs/1.3-模拟器支持.md @@ -16,7 +16,7 @@ - 由于蓝叠 Hyper-V 的端口号在不断变动,所以留了个专用的小后门: 1. 在蓝叠模拟器的数据目录下找到 `bluestacks.conf` 这个文件(默认路径为 `C:\ProgramData\BlueStacks_nxt\bluestacks.conf`) - 2. 如果是第一次使用,请开启一次 MAA,会在同目录下生成 `gui.json` + 2. 如果是第一次使用,请开启一次 MAA,会在 MAA 目录下生成 `gui.json` 3. **先关闭** MAA,**然后** 打开 `gui.json`,新增一个字段 `Bluestacks.Config.Path`,填入 `bluestacks.conf` 的完整路径(注意斜杠要用转义 `\\`) 示例:(以 `C:\ProgramData\BlueStacks_nxt\bluestacks.conf` 为例) diff --git a/docs/2.1-Linux编译教程.md b/docs/2.1-Linux编译教程.md index 84c480a199..e121adaf0e 100644 --- a/docs/2.1-Linux编译教程.md +++ b/docs/2.1-Linux编译教程.md @@ -27,12 +27,12 @@ sudo ldconfig 其他发行版若源中没有 zlib, 也可尝试通过 [源码](https://github.com/madler/zlib) 编译 -## MeoAssistant +## MaaCore 1. 直接拷贝上面编译的第三方库到 `3rdparty/lib` 或者 手动修改 `CMakeLists.txt` 指定第三方库路径 2. `3rdparty/include/opencv` 中的头文件是 `4.5.3` 版本的,若是使用其他版本,请注意头文件冲突问题(直接将你的 `opencv` 头文件覆盖过去就好) 3. 安装 `adb` -4. 复制资源文件到 `libMeoAssistant.so` 同一目录下 +4. 复制资源文件到 `libMaaCore.so` 同一目录下 ```sh cd tools @@ -44,7 +44,7 @@ sudo ldconfig ## 集成文档 -[~~或许算不上文档~~](https://github.com/MistEO/MeoAssistantArknights/wiki) +[~~或许算不上文档~~](https://github.com/MistEO/MaaCoreArknights/wiki) ### Python @@ -52,8 +52,8 @@ sudo ldconfig ### C -可参考 [TestCaller](../tools/TestCaller/main.cpp) 中的实现 +可参考 [CppSample](../src/CppSample/main.cpp) 中的实现 ### C sharp -可参考 [MeoAsstGui](../src/MeoAsstGui/Helper/AsstProxy.cs) 中的实现 +可参考 [MaaWpfGui](../src/MaaWpfGui/Helper/AsstProxy.cs) 中的实现 diff --git a/docs/2.2-开发相关.md b/docs/2.2-开发相关.md index 41d15a89e9..726b26ee32 100644 --- a/docs/2.2-开发相关.md +++ b/docs/2.2-开发相关.md @@ -20,8 +20,8 @@ 1. 下载并安装 `Visual Studio 2022 community`, 安装的时候需要选中 `基于c++的桌面开发` 和 `.NET桌面开发` -5. 双击打开 `MeoAssistantArknights.sln` 文件。Visual Studio 会自动加载整个项目。 -6. 测试一下是否成功搭建编程环境,选择参数 `Release`, `x64`, 右键 `MeoAsstGui` 设为启动项目;点击启动,选择继续调试。如果成功打开了 GUI,就说明成功搭建了环境。如果求稳,可以继续连接模拟器跑一下 MAA +5. 双击打开 `MAA.sln` 文件。Visual Studio 会自动加载整个项目。 +6. 测试一下是否成功搭建编程环境,选择参数 `Release`, `x64`, 右键 `MaaWpfGui` 设为启动项目;点击启动,选择继续调试。如果成功打开了 GUI,就说明成功搭建了环境。如果求稳,可以继续连接模拟器跑一下 MAA 7. 到这里,你就可以愉快地 ~~瞎 JB 改~~ 发电了 8. 开发过程中,每一定数量,记得提交一个 commit, 别忘了写上 message 假如你不熟悉 git 的使用,你可能想要新建一个分支进行更改,而不是直接提交在 `dev` 上 @@ -81,4 +81,4 @@ 你也可以使用 `tools\ClangFormatter\clang-formatter.py` 来直接调用你的 clang-format 来进行格式化,只需要在项目根目录下执行: -- `python tools\ClangFormatter\clang-formatter.py --clang-format=PATH\TO\YOUR\clang-format.exe --input=src\MeoAssistant` +- `python tools\ClangFormatter\clang-formatter.py --clang-format=PATH\TO\YOUR\clang-format.exe --input=src\MaaCore` diff --git a/docs/3.1-集成文档.md b/docs/3.1-集成文档.md index 3898576bdd..0947e0e106 100644 --- a/docs/3.1-集成文档.md +++ b/docs/3.1-集成文档.md @@ -254,12 +254,12 @@ bool ASSTAPI AsstSetTaskParams(AsstHandle handle, AsstTaskId id, const char* par 任务参数,json string,与 `AsstAppendTask` 接口相同。 未标注“不支持运行中设置”的字段都支持实时修改;否则若当前任务正在运行,会忽略对应的字段 -### `AsstSetProcessOption` +### `AsstSetStaticOption` #### 接口原型 ```c++ -bool ASSTAPI AsstSetProcessOption(AsstProcessOptionKey key, const char* value); +bool ASSTAPI AsstSetStaticOption(AsstStaticOptionKey key, const char* value); ``` #### 接口说明 @@ -273,7 +273,7 @@ bool ASSTAPI AsstSetProcessOption(AsstProcessOptionKey key, const char* value); #### 参数说明 -- `AsstProcessOptionKey key` +- `AsstStaticOptionKey key` 键 - `const char* value` 值 @@ -282,7 +282,7 @@ bool ASSTAPI AsstSetProcessOption(AsstProcessOptionKey key, const char* value); 暂无 -### `AsstSetProcessOption` +### `AsstSetInstanceOption` #### 接口原型 @@ -314,8 +314,12 @@ bool ASSTAPI AsstSetInstanceOption(AsstHandle handle, AsstInstanceOptionKey key, enum InstanceOptionKey { Invalid = 0, - MinitouchEnabled = 1, // 是否启用 minitouch + // 已弃用 // MinitouchEnabled = 1, // 是否启用 minitouch // 开了也不代表就一定能用,有可能设备不支持等 // "1" 开,"0" 关 + TouchMode = 2, // 触控模式设置,默认 minitouch + // minitouch | maatouch | adb + DeploymentWithPause = 3, // 是否暂停下干员,同时影响抄作业、肉鸽、保全 + // "1" | "0" }; ``` diff --git a/docs/3.2-回调消息协议.md b/docs/3.2-回调消息协议.md index 13283a271b..28ba67d8c1 100644 --- a/docs/3.2-回调消息协议.md +++ b/docs/3.2-回调消息协议.md @@ -19,7 +19,8 @@ typedef void(ASST_CALL* AsstCallback)(int msg, const char* details, void* custom InitFailed = 1, // 初始化失败 ConnectionInfo = 2, // 连接相关信息 AllTasksCompleted = 3, // 全部任务完成 - + AsyncCallInfo = 4, // 外部异步调用信息 + /* TaskChain Info */ TaskChainError = 10000, // 任务链执行/识别错误 TaskChainStart = 10001, // 任务链开始 @@ -57,7 +58,7 @@ Todo } ``` -## ConnectionInfo +### ConnectionInfo ```jsonc { @@ -93,6 +94,22 @@ Todo 连接断开(adb / 模拟器 炸了),并重试失败 - `ScreencapFailed` 截图失败(adb / 模拟器 炸了),并重试失败 +- `TouchModeNotAvaiable` + 不支持设置的触控模式 + +### AsyncCallInfo + +```jsonc +{ + "uuid": string, // 设备唯一码 + "what": string, // 回调类型,"Connect" | "Click" | "Screencap" | ... + "async_call_id": int, // 异步请求 id,即调用 AsstAsyncXXX 时的返回值 + "details": { + "ret": bool, // 实际调用的返回值 + "cost": int64, // 耗时,单位毫秒 + } +} +``` ### AllTasksCompleted diff --git a/docs/3.3-战斗流程协议.md b/docs/3.3-战斗流程协议.md index 56fc529aeb..fd930716c4 100644 --- a/docs/3.3-战斗流程协议.md +++ b/docs/3.3-战斗流程协议.md @@ -142,5 +142,4 @@ ## 举例 -[Sample](../resource/copilot/test.json) -[GA-EX8 突袭作业](../resource/copilot/GA-EX8-raid.json) +[OF-1](../resource/copilot/OF-1_credit_fight.json) diff --git a/docs/3.4-任务流程协议.md b/docs/3.4-任务流程协议.md index cb45556f45..06d2600304 100644 --- a/docs/3.4-任务流程协议.md +++ b/docs/3.4-任务流程协议.md @@ -8,6 +8,8 @@ { "TaskName" : { // 任务名 + "baseTask": "xxx" // 以xxx任务为模板生成任务,详细见下方特殊任务类型中的Base Task + "algorithm": "MatchTemplate", // 可选项,表示识别算法的类型 // 不填写时默认为 MatchTemplate // - JustReturn: 不进行识别,直接执行 action @@ -117,7 +119,6 @@ } ``` - ## 特殊任务类型 ### Template Task(`@` 型任务) @@ -127,6 +128,7 @@ Template task 与 base task 合称**模板任务**。 允许把某个任务 "A" 当作模板,然后 "B@A" 表示由 "A" 生成的任务。 - 如果 `tasks.json` 中未显式定义任务 "B@A",则在 `sub`, `next`, `onErrorNext`, `exceededNext`, `reduceOtherTimes` 字段中增加 `B@` 前缀(如遇任务名开头为 `#` 则增加 `B` 前缀),其余参数与 "A" 任务相同。就是说如果任务 "A" 有以下参数: + ```jsonc "A": { "template": "A.png", @@ -134,7 +136,9 @@ Template task 与 base task 合称**模板任务**。 "next": [ "N1", "N2" ] } ``` + 就相当于同时定义了 + ```jsonc "B@A": { "template": "A.png", @@ -142,12 +146,12 @@ Template task 与 base task 合称**模板任务**。 "next": [ "B@N1", "B@N2" ] } ``` + - 如果 `tasks.json` 中定义了任务 "B@A",则: 1. 如果 "B@A" 与 "A" 的 `algorithm` 字段不同,则派生类参数不继承(只继承 `TaskInfo` 定义的参数) 2. 如果是图像匹配任务,`template` 若未显式定义则为 `B@A.png`(而不是继承"A"的 `template` 名),其余情况任何派生类参数若未显式定义,直接继承 "A" 任务的参数 3. 对于 `TaskInfo` 基类中定义的参数(任何类型任务都有的参数,例如 `algorithm`, `roi`, `next` 等),若没有在 "B@A" 内显式定义,则除了上面提到的 `sub` 等五个字段在继承时会增加 "B@" 前缀外,其余参数直接继承 "A" 任务的参数 - ### Base Task Base task 与 template task 合称**模板任务**。 @@ -161,8 +165,8 @@ Base task 与 template task 合称**模板任务**。 - 外服 `tasks.json` 中定义的同名任务直接继承国服 `tasks.json` 的参数,相当于 `"A": { "baseTask": "国服的A" }` - 如果国服 `tasks.json` 中定义了任务 "B@A",外服 `tasks.json` 中也定义了 "B@A",那么 1. 如果外服 "B@A" 有字段 `"baseTask": ""`,则不继承国服 "B@A" - - 若有定义任务 "A",则以 template task 的逻辑处理 "B@A" - - 若未定义任务 "A",则以普通任务的逻辑处理 "B@A" + - 若有定义任务 "A",则以 template task 的逻辑处理 "B@A" + - 若未定义任务 "A",则以普通任务的逻辑处理 "B@A" 2. 如果外服 "B@A" 没有 `baseTask`,则直接继承国服 "B@A" 参数 ### Virtual Task(虚任务) @@ -194,7 +198,9 @@ _Note1: `"XXX#self"` 与 `"#self"` 含义相同。_ } } ``` + 可以得到: + ```cpp Task.get("C")->next = { "B@N1", "B@N2" }; @@ -207,7 +213,6 @@ Task.get_raw("B@Loading")->next = { "B#self", "B#next", "B#back" }; - 当几个任务有 `"next": [ "#back" ]` 时,`"Task1@Task2@Task3"` 代表依次执行 `Task3`, `Task2`, `Task1`。 - #### 其它相关 ```json @@ -217,8 +222,8 @@ Task.get_raw("B@Loading")->next = { "B#self", "B#next", "B#back" }; "C@A": { "next": [ "N1" ] } } ``` -以上这种情况, `"C@B" -> next`(即 `C@A#next`)为 `[ "N1" ]` 而不是 `[ "C@N0" ]`. +以上这种情况, `"C@B" -> next`(即 `C@A#next`)为 `[ "N1" ]` 而不是 `[ "C@N0" ]`. ## Schema 检验 @@ -226,7 +231,7 @@ Task.get_raw("B@Loading")->next = { "B#self", "B#next", "B#back" }; ### Visual Studio -在 `MeoAssistant.vcxporj` 中已对其进行配置,开箱即用。提示效果较为晦涩,且有部分信息缺失。 +在 `MaaCore.vcxporj` 中已对其进行配置,开箱即用。提示效果较为晦涩,且有部分信息缺失。 ### Visual Studio Code diff --git a/docs/3.6-基建排班协议.md b/docs/3.6-基建排班协议.md index b7e2f1052b..92b30f7646 100644 --- a/docs/3.6-基建排班协议.md +++ b/docs/3.6-基建排班协议.md @@ -1,6 +1,9 @@ # 基建排班协议 -`resource/custom_infrast/*.json` 的使用方法及各字段说明。**因 json 不支持注释,使用下方示例时需将注释删除** +`resource/custom_infrast/*.json` 的使用方法及各字段说明 +**因 json 不支持注释,使用下方示例时需将注释删除** + +[可视化排班生成工具](https://yituliu.site/riicCal/) ## 完整字段一览 diff --git a/docs/en-us/2.1-LINUX_TUTORIAL.md b/docs/en-us/2.1-LINUX_TUTORIAL.md index a22443888e..a4c158b9b3 100644 --- a/docs/en-us/2.1-LINUX_TUTORIAL.md +++ b/docs/en-us/2.1-LINUX_TUTORIAL.md @@ -27,12 +27,12 @@ sudo ldconfig If zlib does not exist in other distribution, you can try compiling from [source](https://github.com/madler/zlib). -## MeoAssistant +## MaaCore 1. Copy the compiled 3rd-party library to `3rdparty/lib` or change `CMakeLists.txt` to indicate 3rd-party library path manually. 2. The header files in `3rdparty/include/opencv` is version `4.5.3`. If you are using other versions, please notice there may be conflicts in header files (you can simply replace them with your `opencv` header files). 3. Install `adb` -4. Copy resource files to the same folder of `libMeoAssistant.so`. +4. Copy resource files to the same folder of `libMaaCore.so`. ```sh cd tools @@ -44,7 +44,7 @@ If zlib does not exist in other distribution, you can try compiling from [source ## Integration Documentation -[~~Maybe not a doc~~](https://github.com/MistEO/MeoAssistantArknights/wiki) +[~~Maybe not a doc~~](https://github.com/MistEO/MaaCoreArknights/wiki) ### Python @@ -52,8 +52,8 @@ Refer to the implementation of `__main__` in [Python demo](../src/Python/sample. ### C -Refer to the implementation of [TestCaller](../tools/TestCaller/main.cpp) +Refer to the implementation of [CppSample](../src/CppSample/main.cpp) ### C sharp -Refer to the implementation of [MeoAsstGui](../src/MeoAsstGui/Helper/AsstProxy.cs) +Refer to the implementation of [MaaWpfGui](../src/MaaWpfGui/Helper/AsstProxy.cs) diff --git a/docs/en-us/2.2-DEVELOPMENT.md b/docs/en-us/2.2-DEVELOPMENT.md index 5e6cd5f020..f1fb20c2c6 100644 --- a/docs/en-us/2.2-DEVELOPMENT.md +++ b/docs/en-us/2.2-DEVELOPMENT.md @@ -14,8 +14,8 @@ 1. Download and install `Visual Studio 2022 Community`. Select `Desktop development with C++` and `.NET Desktop Development`. -5. Double-click to open the file `MeoAssistantArknights.sln`. Visual Studio will load the project automatically. -6. Run a build to test whether the development environment has been configured correctly. Chosse `Release` & `x64`, right-click `MeoAsstGui` to set it as the startup project, and run it. If the build is successful, the `MeoAsstGui` window will appear. You can connect to the emulator in order to confirm again that the development environment has been configured correctly. +5. Double-click to open the file `MAA.sln`. Visual Studio will load the project automatically. +6. Run a build to test whether the development environment has been configured correctly. Chosse `Release` & `x64`, right-click `MaaWpfGui` to set it as the startup project, and run it. If the build is successful, the `MaaWpfGui` window will appear. You can connect to the emulator in order to confirm again that the development environment has been configured correctly. 7. Now you are free to contribute to MAA. 8. Remember to commit once you have proper number of changes. Don't forget to write a commit message. If you are a beginner of git, you might want to make changes on a newly created branch instead of committing to `dev` directly @@ -75,4 +75,4 @@ You are all set with the clang-format integrated in Visual Studio supporting c++ You can also format with `tools\ClangFormatter\clang-formatter.py` directly, by executing in the root folder of the project: -- `python tools\ClangFormatter\clang-formatter.py --clang-format=PATH\TO\YOUR\clang-format.exe --input=src\MeoAssistant` +- `python tools\ClangFormatter\clang-formatter.py --clang-format=PATH\TO\YOUR\clang-format.exe --input=src\MaaCore` diff --git a/docs/en-us/3.1-INTEGRATION.md b/docs/en-us/3.1-INTEGRATION.md index d873bd65c8..087bf813c1 100644 --- a/docs/en-us/3.1-INTEGRATION.md +++ b/docs/en-us/3.1-INTEGRATION.md @@ -242,12 +242,12 @@ Set task parameters Task parameter in JSON, same as `AsstAppendTask` For those fields that do not mention "Editing in run-time is not supported" can be changed during run-time. Otherwise these changes will be ignored when the task is running. -### `AsstSetProcessOption` +### `AsstSetStaticOption` #### Prototype ```c++ -bool ASSTAPI AsstSetProcessOption(AsstProcessOptionKey key, const char* value); +bool ASSTAPI AsstSetStaticOption(AsstStaticOptionKey key, const char* value); ``` #### Description @@ -261,7 +261,7 @@ Set process-level parameters #### Parameter Description -- `AsstProcessOptionKey key` +- `AsstStaticOptionKey key` key - `const char* value` value @@ -270,7 +270,7 @@ Set process-level parameters None -### `AsstSetProcessOption` +### `AsstSetInstanceOption` #### Prototype @@ -302,8 +302,12 @@ Set instance-level parameters enum InstanceOptionKey { Invalid = 0, - MinitouchEnabled = 1, // Is minitouch enabled + // Deprecated // MinitouchEnabled = 1, // Is minitouch enabled // If you can't use minitouch, it's useless to turn it on. // "1" - on,"0" - off + TouchMode = 2, // Touch mode, minitouch by default + // minitouch | maatouch | adb + DeploymentWithPause = 3, // Deployment with Pause (Works for IS, Copilot and 保全派驻) + // "1" | "0" }; ``` diff --git a/docs/en-us/3.2-CALLBACK_SCHEMA.md b/docs/en-us/3.2-CALLBACK_SCHEMA.md index 2234154205..094594ff7b 100644 --- a/docs/en-us/3.2-CALLBACK_SCHEMA.md +++ b/docs/en-us/3.2-CALLBACK_SCHEMA.md @@ -55,7 +55,7 @@ Todo } ``` -## ConnectionInfo +### ConnectionInfo ```jsonc { @@ -91,6 +91,22 @@ Todo Disconnected (adb/emulator crashed), and failed to reconnect - `ScreencapFailed` Screencap Failed (adb/emulator crashed), and failed to reconnect +- `TouchModeNotAvaiable` + Touch Mode is not avaiable + +### AsyncCallInfo + +```jsonc +{ + "uuid": string, // UUID + "what": string, // Call type, "Connect" | "Click" | "Screencap" | ... + "async_call_id": int, // Async call id, is the return value when the AsstAsyncXXX API is called + "details": { + "ret": bool, // Result + "cost": int64, // Time spent in ms + } +} +``` ### AllTasksCompleted diff --git a/docs/en-us/3.3-COPILOT_SCHEMA.md b/docs/en-us/3.3-COPILOT_SCHEMA.md index 2fe99520a0..23ac6206ca 100644 --- a/docs/en-us/3.3-COPILOT_SCHEMA.md +++ b/docs/en-us/3.3-COPILOT_SCHEMA.md @@ -136,5 +136,4 @@ Usage of `resource/copilot/*.json` and field description. ## Example -[Sample](../resource/copilot/test.json) -[GA-EX8 Raid](../resource/copilot/GA-EX8-raid.json) +[OF-1](../resource/copilot/OF-1_credit_fight.json) diff --git a/docs/en-us/3.4-TASK_SCHEMA.md b/docs/en-us/3.4-TASK_SCHEMA.md index 66cd2e1150..7dedeffd3f 100644 --- a/docs/en-us/3.4-TASK_SCHEMA.md +++ b/docs/en-us/3.4-TASK_SCHEMA.md @@ -155,7 +155,7 @@ This project provides JSON schema check for `tasks.json`. The schema file can be ### Visual Studio -Visual Studio has been configured with `MeoAssistant.vcxporj`. Developers should be able to use it directly after loading the project. +Visual Studio has been configured with `MaaCore.vcxporj`. Developers should be able to use it directly after loading the project. ### Visual Studio Code diff --git a/docs/glossary/items.md b/docs/glossary/items.md index bb24bbff2d..30245962f0 100644 --- a/docs/glossary/items.md +++ b/docs/glossary/items.md @@ -1,67 +1,67 @@ 中文|English|日本語|한국어 ---|---|---|--- -基础作战记录|Drill Battle Record|入門作戦記録|기초 작전 기록 -初级作战记录|Frontline Battle Record|初級作戦記録|초급 작전 기록 -中级作战记录|Tactical Battle Record|中級作戦記録|중급 작전 기록 -高级作战记录|Strategic Battle Record|上級作戦記録|고급 작전 기록 +基础作战记录|Drill Battle Record|入門作戦記録|기초작전기록 +初级作战记录|Frontline Battle Record|初級作戦記録|초급작전기록 +中级作战记录|Tactical Battle Record|中級作戦記録|중급작전기록 +高级作战记录|Strategic Battle Record|上級作戦記録|고급작전기록 中文|English|日本語|한국어 ---|---|---|--- 源岩|Orirock|源岩鉱|원암 异铁碎片|Oriron Shard|異鉄の欠片|이철 조각 -双酮|Diketon|アケトン試剤|다이케톤 -代糖|Sugar Substitute|ブドウ糖|감미료 -酯原料|Ester|エステル原料|에스테르 -破损装置|Damaged Device|破損装置|파손장치 -固源岩|Orirock Cube|初級源岩|고원암 +双酮|Diketon|アケトン試剤|디케톤 +代糖|Sugar Substitute|ブドウ糖|대체당 +酯原料|Ester|エステル原料|에스테르 원료 +破损装置|Damaged Device|破損装置|파손된 장치 +固源岩|Orirock Cube|初級源岩|원암 큐브 异铁|Oriron|初級異鉄|이철 -酮凝集|Polyketon|初級アケトン|케톤 앰플 -糖|Sugar|初級糖原|설탕 +酮凝集|Polyketon|初級アケトン|아케톤 응집체 +糖|Sugar|初級糖原|포도당 聚酸酯|Polyester|初級エステル|폴리에스테르 装置|Device|初級装置|장치 -固源岩组|Orirock Cluster|中級源岩|고원암 더미 -异铁组|Oriron Cluster|中級異鉄|이철 결정 -酮凝集组|Aketon|中級アケトン|케톤 세트 -糖组|Sugar Pack|中級糖原|설탕 봉지 -聚酸酯组|Polyester Pack|中級エステル|폴리에스테르 세트 -全新装置|Integrated Device|中級装置|개조장치 -扭转醇|Loxic Kohl|合成コール|레조에틸렌 -轻锰矿|Manganese Ore|マンガン|망간 +固源岩组|Orirock Cluster|中級源岩|원암 번들 +异铁组|Oriron Cluster|中級異鉄|이철 번들 +酮凝集组|Aketon|中級アケトン|아케톤 응집체 번들 +糖组|Sugar Pack|中級糖原|포도당 번들 +聚酸酯组|Polyester Pack|中級エステル|폴리에스테르 번들 +全新装置|Integrated Device|中級装置|리뉴얼 장치 +扭转醇|Loxic Kohl|合成コール|로식 콜 +轻锰矿|Manganese Ore|マンガン|망간 광석 研磨石|Grindstone|砥石|연마석 RMA70-12|RMA70-12|RMA70-12|RMA70-12 凝胶|Coagulating Gel|人工ゲル|젤 炽合金|Incandescent Alloy|熾合金|열합금 -晶体元件|Crystalline Component|素子結晶|크리스탈 소자 +晶体元件|Crystalline Component|素子結晶|결정 부품 化合切削液|Compound Cutting Fluid|切削液|중합 절삭유 半自然溶剂|Semi-Synthetic Solvent|半自然溶剤|반합성 용제 -提纯源岩|Orirock Concentration|上級源岩|정제원암 -异铁块|Oriron Block|上級異鉄|이철 덩어리 -酮阵列|Keton Colloid|上級アケトン|케톤 진열장 -糖聚块|Sugar Lump|上級糖原|설탕 박스 -聚酸酯块|Polyester Lump|上級エステル|폴리에스테르 박스 -改量装置|Optimized Device|上級装置|개량장치 -白马醇|White Horse Kohl|上級合成コール|에틸렌바이마 -三水锰矿|Manganese Trihydrate|上級マンガン|깁사이트 -五水研磨石|Grindstone Pentahydrate|上級砥石|오수연마석 +提纯源岩|Orirock Concentration|上級源岩|정제 원암 +异铁块|Oriron Block|上級異鉄|이철 팩 +酮阵列|Keton Colloid|上級アケトン|아케톤 팩 +糖聚块|Sugar Lump|上級糖原|포도당 팩 +聚酸酯块|Polyester Lump|上級エステル|폴리에스테르 팩 +改量装置|Optimized Device|上級装置|개량 장치 +白马醇|White Horse Kohl|上級合成コール|화이트 호스 콜 +三水锰矿|Manganese Trihydrate|上級マンガン|망간 중합체 +五水研磨石|Grindstone Pentahydrate|上級砥石|고급연마석 RMA70-24|RMA70-24|RMA70-24|RMA70-24 聚合凝胶|Polymerized Gel|融合ゲル|중합젤 -炽合金块|Incandescent Alloy Block|上級熾合金|열합금 덩어리 -晶体电路|Crystalline Circuit|結晶回路|크리스탈 회로 +炽合金块|Incandescent Alloy Block|上級熾合金|열합금 팩 +晶体电路|Crystalline Circuit|結晶回路|결정 회로 切削原液|Cutting Fluid Solution|上級切削液|절삭유 원액 -精炼溶剂|Refined Solvent|精錬溶剤| -聚合剂|Polymerization Preparation|融合剤| +精炼溶剂|Refined Solvent|精錬溶剤|정제된 용제 +聚合剂|Polymerization Preparation|融合剤|중합제 双极纳米片|Bipolar Nanoflake|ナノフレーク|바이폴라 나노칩 D32钢|D32 Steel|D32鋼|D32강 -晶体电子单元|Crystalline Electronic Unit|結晶制御装置|크리스탈 전자 유닛 +晶体电子单元|Crystalline Electronic Unit|結晶制御装置|결정 전자 장치 中文|English|日本語|한국어 ---|---|---|--- -基础加固建材|Light Building Material|初級補強材|기초 건축 자제 -进阶加固建材|Concrete Building Material|中級補強材|강화 건축 자제 -高级加固建材|Reinforced Building Material|上級補強材|고급 건축 자제 -碳|Carbon Stick|初級炭素材|탄소 막대 -碳素|Carbon Brick|中級炭素材|탄소 막대 묶음 -碳素组|Carbon Pack|上級炭素材|탄소 막대 세트 +基础加固建材|Light Building Material|初級補強材|초급건설자재 +进阶加固建材|Concrete Building Material|中級補強材|중급건설자재 +高级加固建材|Reinforced Building Material|上級補強材|고급건설자재 +碳|Carbon Stick|初級炭素材|카본 +碳素|Carbon Brick|中級炭素材|카본 번들 +碳素组|Carbon Pack|上級炭素材|카본 팩 龙骨|Keel|竜骨|용골 中文|English|日本語|한국어 @@ -74,17 +74,17 @@ D32钢|D32 Steel|D32鋼|D32강 ---|---|---|--- 芯片|Chip|初級SoC|칩 芯片组|Chip Pack|中級SoC|칩셋 -双芯片|Dualchip|上級SoC|듀얼칩 +双芯片|Dualchip|上級SoC|듀얼 칩 芯片助剂|Chip Catalyst|SoC強化剤|칩 첨가제 中文|English|日本語|한국어 ---|---|---|--- -信物复制品|Replicated Token|★1○○の印| -信物原件|Original Token|★2○○の印|OOO 증표 원본 -信物藏品|Antique Token|★3○○の印|OOO 앤틱 증표 -传承信物|Rare Token|★4○○の印|OOO 레어 증표 -遗产信物|Epic Token|★5○○の印|OOO 에픽 증표 -皇家信物|Royal Token|★6○○の印|OOO 로열 증표 +信物复制品|Replicated Token|★1○○の印|증표 복제품 +信物原件|Original Token|★2○○の印|증표 원본 +信物藏品|Antique Token|★3○○の印|앤틱 증표 +传承信物|Rare Token|★4○○の印|레어 증표 +遗产信物|Epic Token|★5○○の印|에픽 증표 +皇家信物|Royal Token|★6○○の印|로열 증표 中文|English|日本語|한국어 ---|---|---|--- @@ -100,9 +100,9 @@ D32钢|D32 Steel|D32鋼|D32강 至纯源石|Originite Prime|純正源石|오리지늄 源石碎片|Originium Shard|源石の欠片|오리지늄 조각 寻访参数模型|Headhunting Parametric Model|特別引換証|헤드헌팅 파라미터 모델 -寻访数据契约|Headhunting Data Contract|限定契約証| +寻访数据契约|Headhunting Data Contract|限定契約証|헤드헌팅 데이터 계약 事相碎片|Information Fragment|事象の欠片|기록 조각 -事相结晶|Event Crystal|事象の結晶| +事相结晶|Event Crystal|事象の結晶|기록 결정 中文|English|日本語|한국어 ---|---|---|--- @@ -125,7 +125,7 @@ D32钢|D32 Steel|D32鋼|D32강 资深干员特训邀请函|Senior Operator Training Invitation Letter|★5特訓招待状|특별 채용 훈련 초대장 资深干员调用凭证|Senior Operator Transfer Permit|★5招聘指名券|특별 채용 조달 허가증 高级干员调用凭证|Top Operator Transfer Permit|★6招聘指名券|고급 오퍼레이터 조달 허가증 -庆典干员凭证|Thank-You Celebration Headhunting Permit|感謝祭記念★6招聘指名券| +庆典干员凭证|Thank-You Celebration Headhunting Permit|感謝祭記念★6招聘指名券|감사 축제 헤드헌팅 10회 허가증 火神因陀罗招募券|Vulcan and Indra Recruitment Voucher|公開求人★5特別指名券|벌컨/인드라 모집권 时装自选凭证|Outfit Voucher|コーデ引換券|컬렉션 자유 선택권 @@ -136,5 +136,5 @@ ID信息更新卡|ID Info Update Card|ID情報更新カード|ID 정보 갱신 模组数据块|Module Data Block|モジュールデータ|모듈 데이터 칩 理智|Sanity|理性|이성 声望|EXP|名声|경험치 -演习券|Drill Plan|演習券| +演习券|Drill Plan|演習券|연습권 无人机|Drone|ドローン|드론 diff --git a/docs/glossary/operators.md b/docs/glossary/operators.md index 3606b1ce80..888873d22a 100644 --- a/docs/glossary/operators.md +++ b/docs/glossary/operators.md @@ -88,7 +88,7 @@ THRM-EX|THRM-EX|THRM-EX|THRM-EX 深靛|Indigo|インディゴ|인디고 罗比菈塔|Roberta|ロベルタ|로베르타 布丁|Pudding|プリン|푸딩 -褐果|Chestnut|チェストナット| +褐果|Chestnut|チェストナット|체스트넛 中文|English|日本語|한국어 ---|---|---|--- @@ -169,7 +169,7 @@ THRM-EX|THRM-EX|THRM-EX|THRM-EX 羽毛笔|La Pluma|ラ・プルマ|라 플루마 极光|Aurora|オーロラ|오로라 灰毫|Ashlock|アッシュロック|애쉬락 -掠风||ウインドフリット| +掠风|Windflit|ウインドフリット|윈드플릿 絮雨|Whisperain|ウィスパーレイン|위스퍼레인 蜜莓|Honeyberry|ハニーベリー|허니베리 罗宾|Robin|ロビン|로빈 @@ -179,11 +179,11 @@ THRM-EX|THRM-EX|THRM-EX|THRM-EX 战车|Tachanka|Tachanka|Tachanka 桑葚|Mulberry|マルベリー|멀베리 赤冬|Akafuyu|アカフユ|아카후유 -夜半|Blacknight|ブラックナイト| +夜半|Blacknight|ブラックナイト|블랙나이트 绮良|Kirara|キララ|키라라 龙舌兰|Tequila|テキーラ|테킬라 蚀清|Corroserum|コロセラム|코로세럼 -夏栎|Quercus|クエルクス| +夏栎|Quercus|クエルクス|퀘르쿠스 野鬃|Wild Mane|ワイルドメイン|와일드메인 Sharp|Sharp|Sharp|Sharp Pith|Pith|Pith|Pith @@ -191,18 +191,18 @@ Touch|Touch|Touch|Touch Stormeye|Stormeye|Stormeye|Stormeye 暮落|Shalem|シャレム|샬렘 炎狱炎熔|Lava the Purgatory|炎獄ラヴァ|라바 더 퍼거토리 -寒芒克洛丝|Kroos the keen Glint|寒芒クルース| -濯尘芙蓉||| -承曦格雷伊||| +寒芒克洛丝|Kroos the keen Glint|寒芒クルース|크루스 더 킨 글린트 +濯尘芙蓉|Hibiscus the Purifier||히비스커스 더 퓨리파이어 +承曦格雷伊|Greyy the Lightningbearer||그레이 더 라이트닝베어러 耶拉|Kjera|イェラ|쉐라 -风丸|Kazemaru|カゼマル| +风丸|Kazemaru|カゼマル|카제마루 九色鹿|Nine-Colored Deer|九色鹿|나인컬러드 디어 暮落|Shalem|シャレム|샬렘 -见行者|Enforcer|エンフォーサー| -洛洛|Rockrock|ロックロック| -埃拉托||| -海蒂|Heidi|ハイディ| -车尔尼||| +见行者|Enforcer|エンフォーサー|인포서 +洛洛|Rockrock|ロックロック|락락 +埃拉托|Erato||에라토 +海蒂|Heidi|ハイディ|하이디 +车尔尼|Czerny||체르니 中文|English|日本語|한국어 ---|---|---|--- @@ -231,15 +231,15 @@ W|W|W|W 山|Mountain|マウンテン|마운틴 安洁莉娜|Angelina|アンジェリーナ|안젤리나 棘刺|Thorns|ソーンズ|쏜즈 -菲亚梅塔|Fiammetta|フィアメッタ| +菲亚梅塔|Fiammetta|フィアメッタ|피아메타 泥岩|Mudrock|マドロック|머드락 -老鲤|Lee|リー| +老鲤|Lee|リー|리 空弦|Archetto|アルケット|아르케토 黑|Schwarz|シュヴァルツ|슈바르츠 史尔特尔|Surtr|スルト|수르트 铃兰|Suzuran|スズラン|스즈란 嵯峨|Saga|サガ|사가 -澄闪|Goldenglow|ゴールデングロー| +澄闪|Goldenglow|ゴールデングロー|골든글로우 迷迭香|Rosmontis|ロスモンティス|로즈몬티스 温蒂|Weedy|ウィーディ|위디 森蚺|Eunectes|ユーネクテス|유넥티스 @@ -256,14 +256,14 @@ W|W|W|W 浊心斯卡蒂|Skadi the Corrupting Heart|濁心スカジ|스카디 더 커럽팅 하트 假日威龙陈|Ch'en the Holungday|遊龍チェン|첸 더 홀룽데이 耀骑士临光|Nearl the Radiant Knight|耀騎士ニアール|니어 더 래디언트 나이트 -归溟幽灵鲨||帰溟スペクター| +归溟幽灵鲨|Specter the Unchained|帰溟スペクター|스펙터 디 언체인드 刻俄柏|Ceobe|ケオベ|케오베 年|Nian|ニェン|니엔 夕|Dusk|シー|시 -令|Ling|リィン| -艾丽妮||アイリーニ| -号角|Horn|ホルン| -流明||ルーメン| -黑键||| -多萝西||| +令|Ling|リィン|링 +艾丽妮|Irene|アイリーニ|아이린 +号角|Horn|ホルン|혼 +流明|Lumen|ルーメン|루멘 +黑键|Ebenholz||에벤홀츠 +多萝西|Dorothy||도로시 diff --git a/docs/ja-jp/2.2-プルリクエスト.md b/docs/ja-jp/2.2-プルリクエスト.md index 30a3c6c57f..9a75a682ba 100644 --- a/docs/ja-jp/2.2-プルリクエスト.md +++ b/docs/ja-jp/2.2-プルリクエスト.md @@ -14,8 +14,8 @@ 1. `Visual Studio 2022 community` をダウンロードしてインストールします。インストール時に `C++ベースのデスクトップ開発` と `.NETデスクトップ開発` を選択する必要があります。 -5. ダブルクリックして `MeoAssistantArknights.sln` ファイルを開きます。 Visual Studioは、プロジェクト全体を自動的に読み込みます。 -6. プログラミング環境が正常に構築されているかどうかをテストし、パラメーター `Release`、`x64` を選択し、スタートアッププロジェクトとして `MeoAsstGui` を右クリックして設定してから、`開始` をクリックして、`デバッグを続行` を選択します。 GUIが正常に開かれれば、環境が正常に構築されたことを意味します。もっと安定したい場合は、引き続きシミュレーターに接続してMAAを実行してみます。 +5. ダブルクリックして `MAA.sln` ファイルを開きます。 Visual Studioは、プロジェクト全体を自動的に読み込みます。 +6. プログラミング環境が正常に構築されているかどうかをテストし、パラメーター `Release`、`x64` を選択し、スタートアッププロジェクトとして `MaaWpfGui` を右クリックして設定してから、`開始` をクリックして、`デバッグを続行` を選択します。 GUIが正常に開かれれば、環境が正常に構築されたことを意味します。もっと安定したい場合は、引き続きシミュレーターに接続してMAAを実行してみます。 7. ここまで楽しくコードを変更できます~ 8. 開発中は、一定量修正するたびにcommitを忘れず、コメントを書くことを忘れないでください。 9. 開発が完了したら、ローカルブランチを(自分の)リモートリポジトリにプッシュします。 @@ -60,6 +60,6 @@ `tools\ClangFormatter\clang-formatter.py` を使用して、clang-formatを直接呼び出して書式設定することもできます。プロジェクトのルートディレクトリで -- `python tools\ClangFormatter\clang-formatter.py --clang-format=PATH\TO\YOUR\clang-format.exe --input=src\MeoAssistant` +- `python tools\ClangFormatter\clang-formatter.py --clang-format=PATH\TO\YOUR\clang-format.exe --input=src\MaaCore` を実行するだけです。 diff --git a/docs/ja-jp/3.1-統合ドキュメント.md b/docs/ja-jp/3.1-統合ドキュメント.md index de940bf4e0..646a27d27f 100644 --- a/docs/ja-jp/3.1-統合ドキュメント.md +++ b/docs/ja-jp/3.1-統合ドキュメント.md @@ -240,3 +240,73 @@ Set task parameters - `const char* params` JSONのタスクパラメーター, `AsstAppendTask` と同じ "動作中に変更はできません" と記載されていないフィールドはランタイム中に変更することができます. そうでなければ、タスクの実行中にこれらの変更は無視される. + +### `AsstSetStaticOption` + +#### Prototype + +```c++ +bool ASSTAPI AsstSetStaticOption(AsstStaticOptionKey key, const char* value); +``` + +#### Description + +Set process-level parameters + +#### Return Value + +- `bool` + Is the setup successful + +#### Parameter Description + +- `AsstStaticOptionKey key` + key +- `const char* value` + value + +##### List of Key and value + +None + +### `AsstInstanceOptionKey` + +#### Prototype + +```c++ +bool ASSTAPI AsstSetInstanceOption(AsstHandle handle, AsstInstanceOptionKey key, const char* value); +``` + +#### Description + +Set instance-level parameters + +#### Return Value + +- `bool` + Is the setup successful + +#### Parameter Description + +- `AsstHandle handle` + handle +- `AsstInstanceOptionKey key` + key +- `const char* value` + value + +##### List of Key and value + +```jsonc + enum InstanceOptionKey + { + Invalid = 0, + // Deprecated // MinitouchEnabled = 1, // Is minitouch enabled + // If you can't use minitouch, it's useless to turn it on. + // "1" - on,"0" - off + TouchMode = 2, // Touch mode, minitouch by default + // minitouch | maatouch | adb + DeploymentWithPause = 3, // Deployment with Pause (Works for IS, Copilot and 保全派驻) + // "1" | "0" + }; +``` diff --git a/docs/ja-jp/3.2-コールバックAPI.md b/docs/ja-jp/3.2-コールバックAPI.md index 759122d552..1f0ebdefe6 100644 --- a/docs/ja-jp/3.2-コールバックAPI.md +++ b/docs/ja-jp/3.2-コールバックAPI.md @@ -55,7 +55,7 @@ Todo } ``` -## ConnectionInfo +### ConnectionInfo ```jsonc { @@ -91,6 +91,8 @@ Todo 切断 (adb/emulator クラッシュ), 再接続失敗 - `ScreencapFailed` 画面取得失敗 (adb/emulator クラッシュ), 再接続失敗 +- `TouchModeNotAvaiable` + Touch Mode is not avaiable ### AllTasksCompleted diff --git a/docs/ja-jp/3.3-自動作戦API.md b/docs/ja-jp/3.3-自動作戦API.md index ae8bbbd221..69490b73c4 100644 --- a/docs/ja-jp/3.3-自動作戦API.md +++ b/docs/ja-jp/3.3-自動作戦API.md @@ -132,5 +132,4 @@ ## 実例 -[Sample](../resource/copilot/test.json) -[GA-EX8 Raid](../resource/copilot/GA-EX8-raid.json) +[OF-1](../resource/copilot/OF-1_credit_fight.json) diff --git a/docs/ko-kr/1.1-사용자_설명서.md b/docs/ko-kr/1.1-사용자_설명서.md new file mode 100644 index 0000000000..ee2d99d65d --- /dev/null +++ b/docs/ko-kr/1.1-사용자_설명서.md @@ -0,0 +1,121 @@ +# MAA 사용자 설명서 + +## 기능 + +### 원클릭 이성 활용 + +- 스테이지 자동 선택이 필요 없다면 MAA에서 `현재/최근`을 선택하고 게임에서 수동으로 스테이지를 찾아 **작전개시** 버튼과 **대리지휘** 버튼이 표시되는 화면으로 이동해 주세요. + - 해당 화면이 아닐 경우 `현재/최근`은 게임의 “지난 전투”를 선택하게 됩니다. (작전 메인 페이지의 우측 하단에 있는 기록에 따라 다름) + - `설정`-`UI 설정`에서 `스테이지 코드 수동 입력`을 활성화해 드롭다운 목록에서 스테이지를 선택하는 대신 코드를 직접 입력할 수도 있습니다. (예시: `1-7`, `S3-2`, `CE-6` 등) +
예시 보기 + +![예시 보기](https://user-images.githubusercontent.com/5153875/196309375-73a93b83-e59b-441c-913f-122d4a9fc46c.png) + +
+ +- `이성 회복제`, `순오리지늄`, `횟수 제한`, `드롭 제한` 네 가지의 스위치가 있습니다. 이 중 하나에 도달하면 작업이 완료된 것으로 처리되며 작전이 중지됩니다. + - 其中: + - `이성 회복제` 이성 회복제 사용의 **빈도** (일반적으로는 1개씩 사용하지만, 회복제 샘플과 같이 회복량이 적은 경우도 있기 때문에 어느 정도 갯수를 파악해둘 필요가 있습니다.) + - `순오리지늄` 사용 횟수 (1회당 1개) + - `횟수 제한` 스테이지를 플레이할 횟수를 지정합니다. (예시: 15회 플레이 후 중지) + - `드롭 제한` 지정된 재료의 드롭 수를 지정합니다. (예시: 5개의 원암 드롭 후 중지) + +| 예 | 회복제 | 오리지늄 | 횟수 제한 | 드롭 제한 | 설명果 | +|:--:|:--------:|:------:|:--------:|:---------:|-----------------------------------------------------------------------------------------------------------------------------------------------| +| A | 999 | 10 | 1 | ✖ | 이성 회복제/순오리지늄을 **1회** 이상 사용하고 `횟수 제한:1`이 충족되면 즉시 종료됩니다. 이성, 이성 회복제, 순오리지늄이 전부 부족하다면 바로 종료됩니다.| +| B | ✖ | ✖ | 100 | ✖ | 100회 시행하는 것으로 되어 있지만, 현재 가지고 있는 이성을 전부 소모하면 `이성 회복제`나 `순오리지늄`을 사용할 수 없어 이성이 부족해 종료됩니다.| +| C | 1 | ✖ | 100 | ✖ | 100회 시행하는 것으로 되어 있지만, 이성 회복제를 1번 사용한 후에는 현재 가지고 있는 이성을 전부 소모하면 `이성 회복제: 1`과 `순오리지늄: 0`에 도달했으므로 종료됩니다.| +| D | 999 | ✖ | 100 | 3원암 큐브 | 100회 시행하며 최대 999개의 이성 회복제를 사용하는 것으로 되어 있지만, 시행 중 3개의 원암 큐브를 얻으면 `드롭 제한:원암 큐브 3개`에 도달했으므로 종료됩니다.| +- `드롭 제한`과 `스테이지 선택`은 연관되어 있지 않습니다. + - `드롭 제한`은 재료의 개수를 기준으로 작업을 종료하는 스위치일 뿐 재료를 지정한다고 해서 스테이지를 자동으로 설정해주는 것은 아닙니다. +- `대리지휘`를 체크하는 것을 깜빡해 벌어지는 참사가 일어나지 않도록 자동으로 체크해 드립니다~ +- 재료 드롭을 식별하고 표시하며, [펭귄 물류](https://penguin-stats.io/)에 자동으로 업로드하고 사용자 ID를 설정할 수 있습니다. +- 연결이 끊겨도 자동으로 재접속해 기존 작업을 계속 수행합니다. 새벽 4시가 지나 새로고침되는 경우에도 마찬가지입니다. +- 전권 위임을 통한 섬멸 작전 자동화를 지원합니다. +- 대리 지휘가 실패할 경우 자동으로 작전을 포기하고 메인 화면으로 돌아갑니다. +- 이성 완전 소모를 지원합니다. + - 주 작업을 완료한 이후, 자동으로 지정된 스테이지로 이동해 남은 '잉여' 이성을 소모합니다. (예시: 1-7에서의 남은 이성 소모) + - 남은 이성이 지정된 스테이지를 클리어하기에 부족한 경우(예시: 1-7이 지정되어 있으나 이성이 6보다 적은 경우), 작업은 즉시 종료됩니다. + +### 원클릭 기반시설 + +#### 오퍼레이터 교대 전략 + +**단일 시설 내에서의 최적의 방안**을 자동으로 계산해 골라냅니다. 모든 일반/특수 스킬 조합을 지원합니다. 서로 다른 오퍼레이터들의 작전기록, 순금, 오리지늄 조각, 칩 등을 인식합니다. + +#### 기반시설 컨디션 한계치 + +컨디션의 비율을 감지합니다. 컨디션이 일정 수치 이하로 떨어질 경우, 오퍼레이터를 숙소로 이동시킵니다. + +#### 주의사항 + +- 교대 전략은 다중 시설이 아닌 단일 시설 내에서의 최적의 방안을 바탕으로 합니다. 단일 시설 내의 `샤마르-테킬라` 조합, `버메일-씬` 조합 등은 제대로 인식되지만 `로즈몬티스`나 `피누스 실베스트리스` 등의 다중 시설간 조합은 아직 지원되지 않습니다. +- `드론 사용처`가 `무역소-용문폐`로 지정되어 있을 경우, `샤마르`를 인식하고 드론을 아껴둘 것입니다. +- 응접실에서 단 한 종류의 단서가 부족하다면 해당 진영의 오퍼레이터가 선택됩니다. 그렇지 않은 경우 일반적인 오퍼레이터가 선택됩니다. +- 응접실이 꽉 차 있을 때만 단서를 내보낼 것입니다. 최대 3개의 단서가 전달됩니다. `resource/tasks.json`에서 `SelectClue`-`maxTimes` 필드를 수정해 단서의 전달 개수를 조절할 수 있습니다. +- `아이린`이나 다른 오퍼레이터가 당장 업무 중이 아니라는 이유로 숙소로 보내지는 것을 원치 않는다면, `이미 배치된 오퍼레이터를 숙소에 넣지 않기` 옵션을 활성화할 수 있습니다. 단, 컨디션이 0이 아닌 한 어떤 오퍼레이터도 숙소로 들어오지 못하게 되는 문제를 불러올 수도 있습니다. +- 제어 센터의 복잡성으로 인해서, `아미야`, `스와이어`, `켈시`, `레인보우 팀`과 기타 시간당 컨디션 +0.05 오퍼레이터만이 고려됩니다. 미래에 개선될 예정입니다. +- 몇몇 이격 오퍼레이터로 인한 충돌이 발생할 수 있습니다. UI에 오퍼레이터 충돌 경고가 있는지 확인하시고, 경고가 있다면 기반시설의 상태를 수동으로 확인하여 적절하게 배치해 주세요. (예시: 특정 시설이 완전히 비어 있을 수 있음) + +### 공개모집 인식 + +- 자동 공개모집과 공개모집 인식은 서로 다른 기능입니다! +- 자동 공개모집의 경우 `즉시 완료 허가증` 사용을 통한 완전 자동화를 지원합니다! 설정에서 변경 가능합니다. +- ★5/★6 오퍼레이터가 모집되면 팝업 알림이 뜹니다. +- 자동 공개모집 중 공개모집 데이터를 [펭귄 물류](https://penguin-stats.io/)와 [Yituliu](https://yituliu.site/)로 자동으로 전송합니다. + +### 통합전략 지원 + +- MAA 설정에서 `팬텀/미즈키` 테마를 선택하고, 해당 테마를 게임 내에서 "고정시켜" 주세요. 그렇지 않으면 최신 테마가 표시되어 문제가 발생할 수 있습니다. + - 고정시키지 않는 경우 기능 가동 전에 해당 테마의 메인 화면(탐색 시작/탐색 계속 버튼 표시)인지 확인해 주세요. + - 설정과 다른 테마의 진행 중인 탐험이 있을 경우 수동으로 종료하고 진행해 주세요. +
고정 방법 + +![고정 방법](https://user-images.githubusercontent.com/5153875/196175536-4df46097-dde7-48e2-9c8d-ca4b5c12a3ee.png) + +
+ +- 설정에서 분대, 조합, 고정 오퍼레이터 등을 선택할 수 있습니다. +- 오퍼레이터와 레벨을 인식하고 오퍼레이터와 스킬의 최적의 조합을 찾습니다. +- 상점 아이템을 인식하고 가장 가치 있는 아이템을 구매합니다. +- 연결 끊김 이후의 자동 재연결과 오전 4시 이후의 리플레이를 지원합니다. +- 5분이 지나도 작전이 끝나지 않으면 모든 지상 오퍼레이터를 퇴각시킵니다. 6분이 지나면 작전을 포기하여 무한 루프의 가능성을 방지합니다. +- 버그에 영향을 받을 경우 탐험을 포기하고 재도전합니다. 특정 위치에서 반복적으로 이러한 현상이 발생하여 효율에 심각한 영향을 끼칠 경우, 이슈를 제출해 주세요. + +### 전략 공유 + +[prts.plus](https://www.prts.plus)에서 전략을 공유할 수 있습니다! + +#### 전략 불러오기 + +- `작전 개시` 버튼이 있는 화면에서 실행해 주세요. +- 지원 오퍼레이터 등이 필요하다면, `자동 편성`을 비활성화하고 직접 편성해 주세요. +- 유용한 전략에는 좋아요를 눌러주세요! + +![image](https://user-images.githubusercontent.com/18511905/189662951-5f9d6d88-3c23-49b3-a58f-c35388b2d5d7.png) + +#### 전략 생성 + +- 전략 생성 툴은 MAA 폴더 내에 제공되어 있습니다. [전략 형식](3.3-전략_형식.md) 문서를 참조하세요. +- 맵 좌표를 확인하고 싶다면 `stage_name`를 입력하고 시작하면 폴더 내에 `map.png`가 생성될 것입니다. 또는 [PRTS.map](https://map.ark-nights.com/)에서 좌표 설정을 `MAA` 모드로 하고 확인하는 방법도 있습니다. +- 테스트를 위해서는 연습권 사용을 추천합니다. +- [prts.plus](https://www.prts.plus)에서 전략을 공유할 수 있습니다! +- 이름, 영상 링크, 그 외 도움이 될 만한 정보들을 설명에 적어주시는 것을 권장드립니다. + +### 창고 인식(테스트 기능) + +`육성 재료`를 선택한 후 인식을 시작해 주세요. 현재로서는 몇몇 데이터 웹사이트들로의 내보내기만이 지원됩니다. 더 많은 기능이 미래에 추가될 예정입니다. +다른 데이터 사이트를 운용 중이신 분이라면 해당 사이트의 JSON 형식을 적용할 수 있도록 연락해주셔도 좋습니다. + +### 기타 + +- 작업 순서는 UI에서 드래그로 변경 가능합니다. 기반시설의 교체 순서도 그렇습니다. +- 대부분의 설정 변경사항은 자동으로 저장되나, *표가 붙은 설정은 제외입니다. +- 모든 클릭 이벤트는 푸아송 분포를 따라서 일정 범위 내 무작위로 시행됩니다. (중앙일수록 확률이 높고, 바깥일수록 낮습니다) +- 기본 알고리즘은 C++만을 이용해 개발되었으며, 다층 캐시 구조로 CPU와 메모리 사용량을 최소화하도록 설계되었습니다. +- 이 프로그램은 자동 업데이트가 지원됩니다 ✿✿ヽ(°▽°)ノ✿ 잦은 업데이트에 개의치 않는다면 베타 버전 사용을 추천드립니다. 업데이트가 빠르고 버그가 더 적습니다. +- 자동 업데이트가 실패한다면 파일을 직접 다운로드해서 ZIP 파일을 같은 폴더에 넣어주세요. 업데이트가 자동으로 시작될 것입니다. + +## 다른 기능 + +만약 여러 개의 에뮬레이터를 동시에 활용하고자 한다면, MAA 폴더의 사본을 만든 다음, **같은 ADB 경로**와 **다른 ADB 주소**를 사용해 작업을 진행해 주세요. diff --git a/docs/ko-kr/1.2-FAQ.md b/docs/ko-kr/1.2-FAQ.md new file mode 100644 index 0000000000..8381717046 --- /dev/null +++ b/docs/ko-kr/1.2-FAQ.md @@ -0,0 +1,68 @@ +# 자주 묻는 질문 + +## 프로그램이 실행하자마자 곧바로 튕겨요 + +### 추정 원인 0: 불완전한 파일 다운로드 + +- 이 소프트웨어를 처음 사용하신다면, `OTA`가 파일 이름에 포함된 파일을 받지 말아주세요. 추가 업데이트를 위한 파일으로, 단독으로 사용하는 것이 아닙니다. +- 이 프로그램이 자동 업데이트 이후 제대로 작동하지 않는다면, 자동 업데이트의 버그일 수 있으며, 전체 파일을 수동으로 다운받아 다시 시도해볼 수 있습니다. + +### 추정 원인 1: 실행 라이브러리 없음 + + [Microsoft Visual C++ 재배포 가능 패키지](https://learn.microsoft.com/ko-kr/cpp/windows/latest-supported-vc-redist?view=msvc-160#visual-studio-2015-2017-2019-and-2022)와 [.NET Framework 4.8](https://dotnet.microsoft.com/download/dotnet-framework/net48)을 설치 후 시스템을 재시작하고 나서 시도해 보세요. + +### 추정 원인 2: 다른 실행 라이브러리 문제 + +윈도우 서버나 다른 경량화 버전을 사용 중이시라면, [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) 설치로 완전한 개발 환경을 갖출 수 있습니다. (.NET과 C++ 환경만 있으면 됩니다) + +**이 작업은 약 10GB의 저장공간을 필요로 할 수 있습니다. 빈 공간이 충분한지 먼저 확인하세요.** + +## 연결 오류가 발생해요 + +팁: [지원되는 에뮬레이터 목록](1.3-에뮬레이터_지원.md)을 확인해 에뮬레이터를 맞게 사용하고 있는지 확인하세요. BlueStacks를 사용 중이시라면 설정에서 `Android Debug Bridge`를 활성화해 주세요. + +게임 가속기 등의 소프트웨어를 사용 중이시라면, 해당 소프트웨어를 닫고 시스템을 재시작한 후 다시 시도해 주세요. + +### 해결 방법 1: ADB 경로와 주소가 정확한지 확인하세요 + +- MAA `설정` - `연결 설정` - `adb 경로`가 자동으로 채워져 있는지 확인하세요. 채워져 있다면 다음 단계로 넘어가세요. 그렇지 않다면: + - 선택지 1: 에뮬레이터의 설치 경로에 들어가 `adb.exe`라는 이름의 파일을 찾으세요. (또는 `nox_adb.exe`, `HD-adb.exe`, `adb_server.exe` 같이 `adb`가 들어간 비슷한 exe 파일을 찾으세요) MAA 설정에서 해당 파일을 선택하세요. + - 선택지 2: [adb](https://dl.google.com/android/repository/platform-tools-latest-windows.zip)를 다운로드받아 압축을 푸세요. `adb.exe` 파일을 선택하세요. + +- 연결 주소가 정확히 입력되어 있는지 확인하세요. ADB 주소는 일반적으로 `127.0.0.1:5555`같은 형태입니다. (LD Player 제외) + +### 해결 방법 2: 에뮬레이터 변경 + +[BlueStacks](https://www.bluestacks.com/download.html) Nougat 64 bit같은 다른 에뮬레이터로 시도하세요. + +_BlueStacks 설치 후 설정에서 `Android Debug Bridge`를 활성화해야 합니다._ + +### 해결 방법 3: 컴퓨터 재시작 + +컴퓨터를 재시작해 보세요. + +## 연결은 성공했는데, 그대로 멈춰 버렸어요 + +일부 에뮬레이터의 버전은 너무 오래되어 minitouch를 지원하지 않을 수 있습니다. MAA를 관리자 권한으로 실행해 `설정`-`연결 설정`에서 `ADB 강제 교체`를 실행하세요. (진행 전 에뮬레이터를 닫고 MAA를 재시작하는 것을 권장합니다. 그렇지 않으면 제대로 교체되지 않을 수 있습니다) + +그래도 작동하지 않는다면, `터치 호환 모드`를 활성화해 주세요. + +## 연결에 성공했고, 몇 번 동작하기는 했는데, 그 뒤에는 멈추거나 오류가 떠요 + +- 자동 전투는 `작전개시` 버튼이 나오는 화면에서 진행되는 것을 필요로 합니다. 문제가 없는지 확인해 주세요. +- CN 클라이언트가 아니라면 `설정`-`시작 설정`에서 클라이언트 버전을 선택해 주세요. 또한 CN 클라이언트 외의 경우에는 모든 기능이 지원되지는 않습니다. [문서](../../README_ko-KR.md#해외-서버-지원)를 참조해 주세요. +- 통합전략 기능을 사용 중이시라면, 원하는 테마가 게임 내에서 선택되어 있도록 하고, `설정`-`통합전략`에서 테마를 설정해 주세요. + +## 수동 연결 + +- [adb](https://dl.google.com/android/repository/platform-tools-latest-windows.zip)를 다운로드해 압축을 풀어주세요. +- `설정`-`연결 설정`에서 ADB 경로를 선택하고, ADB의 주소를 채우고, (IP+포트 형식으로, 예시: `127.0.0.1:5555`) 에뮬레이터의 종류를 선택해 주세요. + +## 다운로드 속도가 느리고 미러 사이트는 접속이 불가능해요 + +1. [다운로드](../../README_ko-KR.md#다운로드)에서 원하는 버전을 선택합니다. +2. 다운로드해야 하는 파일에 대한 링크를 찾습니다. +3. 오른쪽 클릭 후 `링크 복사`를 선택하세요. +4. 브라우저에 링크를 붙여 넣으세요. +5. `github.com`을 `download.fastgit.org`로 교체하세요. +6. `Enter` 키를 눌러 다운로드하세요. \ No newline at end of file diff --git a/docs/ko-kr/1.3-에뮬레이터_지원.md b/docs/ko-kr/1.3-에뮬레이터_지원.md new file mode 100644 index 0000000000..036327e8f5 --- /dev/null +++ b/docs/ko-kr/1.3-에뮬레이터_지원.md @@ -0,0 +1,152 @@ +# 에뮬레이터 지원 + +## ✅ [Bluestacks-CN](https://www.bluestacks.cn/) + +완벽히 지원됩니다. `Settings`-`Engine Settings`에서 `Allow ADB connection`을 켜야 합니다. + +## ✅ [Bluestacks](https://www.bluestacks.com/) (권장👍) + +완벽히 지원됩니다. `Settings`-`Advanced`에서 `Android Debug Bridge`를 켜야 합니다. + +## ✅ [Bluestacks Hyper-V 버전](https://support.bluestacks.com/hc/ko-kr/articles/4415238471053-System-requirements-for-BlueStacks-5-on-Hyper-V-enabled-Windows-10-and-11-) + +지원됩니다. + +- `Settings`-`Advanced`에서 `Android Debug Bridge`를 켜 주세요. +- Bluestack Hyper-V 포트는 수시로 변경됩니다. 간단한 해법을 알려드립니다. + + 1. 에뮬레이터의 데이터 경로에서 `bluestacks.conf` 파일을 찾으세요. (기본값: `C:\ProgramData\BlueStacks_nxt\bluestacks.conf`) + 2. MAA를 최초로 사용하신다면, 실행하실 때 `gui.json` 파일이 생성됩니다. + 3. MAA를 **종료하고 나서**, `gui.json` 파일을 열고, `Bluestacks.Config.Path` 필드를 추가하세요. 값은 `bluestacks.conf`의 절대 경로로 설정합니다. (백슬래시는 `\\`와 같이 이스케이프되어야 합니다). + 예시: (파일이 `C:\ProgramData\BlueStacks_nxt\bluestacks.conf`에 위치해 있음을 가정함) + + ```jsonc + "Bluestacks.Config.Path":"C:\\ProgramData\\BlueStacks_nxt\\bluestacks.conf", + ``` + + 4. LinkStart! + +- 여러 에뮬레이터를 구동해야 하는 경우 (해당되지 않으면 이 단계는 넘어가주세요), MAA의 키워드를 변경해서 구성 파일을 감지할 수 있습니다. + `Bluestacks.Config.Keyword` 필드를 추가로 입력해주세요 + 예시: + + ```jsonc + "Bluestacks.Config.Keyword":"bst.instance.Nougat64.status.adb_port", + ``` + +## ✅ [Nox](https://kr.bignox.com/) + +완벽히 지원됩니다. + +## ✅ [Nox Android 9](https://kr.bignox.com/) + +완벽히 지원됩니다. + +## ⚠️ [MuMu](https://www.mumuglobal.com/) + +지원됩니다. 단, + +- MAA가 ADB 경로와 주소를 얻기 위해 관리자 권한으로 실행되어야 합니다. (MuMu가 관리자 권한으로 실행되기 때문입니다) +- 관리자 권한으로 실행하고 싶지 않다면 ADB 경로와 주소를 직접 입력할 수도 있습니다. +- MAA가 메인 화면에서 멈추고 작업에 실패했다는 메시지를 띄울 수 있습니다. MuMu의 렌더링 방식과 연관되어 있는 것으로 보입니다. 다른 에뮬레이터 사용을 권장드립니다. +- MuMu는 여러 개를 열어도 하나의 adb 포트를 사용하므로, 여러 개의 클라이언트를 지원하지는 못합니다. + +## 🚫 MuMu Mobile Game Assistant + +지원되지 않습니다. ADB 포트가 닫혀 있습니다. + +## 🚫 MuMu Android 9 + +지원되지 않습니다. ADB 스크린샷이 검은 화면으로 나옵니다. + +## 🚫 MuMu Android X + +지원되지 않습니다. ADB 스크린샷이 투명한 화면으로 나옵니다. + +## 🚫 LD Player + +지원되기는 하지만 작동 가능성은 낮습니다. +LD Player는 연결 실패를 유발하는 포트 변경이나 게임 충돌, 검은 스크린샷, 화면 뒤바뀜 등의 여러 문제점들을 갖고 있습니다. +저희는 MAA가 LD Player를 지원할 수 있게 하기 위해 많은 시간을 들였습니다만 새롭고 어려운 문제들이 지속적으로 발생했습니다. 결국 저희는 LD Player에 대한 지원을 중단하기로 했습니다. +만약에 어떻게든 사용이 가능하시다면 축하드립니다만, 그렇지 않을 경우 에뮬레이터를 바꾸시거나 문제를 직접 해결하셔야 합니다. 저희는 LD Player에 관한 문제에 대한 피드백은 받지 않습니다 (다만, Pull Request를 통한 도움은 여전히 환영입니다) + +## ⚠️ [Memu](https://www.memuplay.com/ko/) + +지원되지만, 테스트 수가 적으며 알려지지 않은 오류가 있을 수 있습니다. + +## 🚫 Tencent Mobile Game Assistant + +지원되지 않습니다. ADB 포트가 닫혀 있습니다. + +## ⚠️ [Windows Subsystem for Android](https://learn.microsoft.com/ko-kr/windows/android/wsa/) + +부분적으로 지원됩니다. + +- [수동 연결](#%EF%B8%8F-수동-연결)을 사용해야 합니다. +- WSA 2204 이상 버전의 경우 '일반 모드'를 시도해 보세요. +- WSA 2203 이하 버전의 경우 'WSA 레거시 버전'을 시도해 보세요. +- WSA는 해상도 변경을 지원하지 않으므로, 수동으로 720p 이상의 `16:9` 비율의 해상도가 되도록 창의 크기를 조절해주세요. (16:9 모니터를 사용하고 있다면 `F11`을 눌러 전체화면으로 전환하는 것으로도 가능합니다) +- 에뮬레이터의 창이 활성화된 상태(가장 위에 있는 상태)를 유지하고 다른 안드로이드 앱이 실행되고 있지 않게 해 주세요. 그렇지 않을 경우 게임이 일시정지되거나 인식에 실패할 수 있습니다. +- 가끔은 WSA의 스크린샷이 비어 있어 인식 실패를 유발합니다. WSA 사용은 권장되지 않습니다. + +## ✅ [Android Virtual Device](https://developer.android.com/studio/run/managing-avds) + +지원됩니다. + +## ⚙️ 수동 연결 + +1. [adb](https://dl.google.com/android/repository/platform-tools-latest-windows.zip)를 다운로드해 압축을 풀어주세요. +2. `설정`-`연결 설정`에서 ADB 경로와 주소를 설정해 주세요. (IP와 포트는 필수입니다. 예시: `127.0.0.1:5555`) + +### ⚙️ 디스플레이가 `16:9` 비율이 아닌 기기에서의 사용 + +MAA가 `16:9` 비율만 지원하므로 해상도를 수동으로 변경해야 할 수 있습니다. + +1. USB 디버깅 모드를 켜고 USB 케이블로 기기를 컴퓨터에 연결하거나 원격으로 접속하세요. +2. `명령 프롬프트(CMD)`를 열고, 기기 주소를 확인 후 연결하세요. + + - USB 케이블을 사용하는 경우, 다음의 명령어로 기기 ID를 확인하세요: + + ```bash + adb devices # 현재 기기들의 연결 상태를 확인합니다. 제1열이 기기 ID입니다. + ``` + + 연결이 성공적으로 되었다면, 다음과 같은 메시지를 볼 수 있습니다: + + ```bash + C:\Users\username>adb devices + List of devices attached + VFNDU1682100xxxx device # "device" 앞의 문자열이 기기 ID입니다 + ``` + + - 원격으로 접속하려는 경우: `Settings -> WLAN -> View`에서 IP 주소를 확인할 수 있으며, 포트는 주로 5555 또는 5037입니다. + + ```bash + adb connect # 예시: 192.168.0.10:5555 + ``` + + - `'adb'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다.`라는 문구가 출력되는 경우는 환경 변수가 제대로 구성되지 않았기 때문입니다. 이 경우 ADB의 전체 경로를 입력해야 합니다. + + ```bash + D:\adb_unzip_path\adb.exe devices # 또는 간단하게 adb.exe를 명령 프롬프트 창에 드래그하고 스페이스 바를 누른 후 devices를 입력할 수도 있습니다. + ``` + + ADB를 자주 사용할 필요가 있다면 환경 변수를 구성하는 것이 좋습니다. 구성 방법에 대해서는 인터넷의 문서들을 찾아보세요. + +3. 다음의 명령어를 입력해 진행합니다 + + ```bash + adb -s shell # 기기의 터미널 창에 진입합니다 + wm size # 기기의 해상도를 확인합니다 + wm size 720x1280 # 해상도를 720p로 변경합니다 + ``` + +4. MAA에 ADB 경로와 기기의 주소(ID 또는 IP + 포트)를 채워넣으세요 +5. 게임 설정에서 UI 위치 조절을 0(꺼짐)으로 조정해주세요. + 그렇지 않으면 나중에 ADB로 해상도를 바꿀 때 터치 입력의 위치가 어긋날 수 있습니다. +6. MAA를 사용하세요 (≧∇≦)ノ +7. MAA를 나가기 전, 기기의 해상도를 초기화하세요. + + ```bash + wm size reset # 해상도를 초기화합니다 + ``` diff --git a/docs/zh-tw/2.1-Linux編譯教程.md b/docs/zh-tw/2.1-Linux編譯教程.md index a0ff84e48c..69dee4f8a9 100644 --- a/docs/zh-tw/2.1-Linux編譯教程.md +++ b/docs/zh-tw/2.1-Linux編譯教程.md @@ -27,12 +27,12 @@ sudo ldconfig 其他發行版若源中沒有 zlib, 也可嘗試透過 [原始碼](https://github.com/madler/zlib) 編譯 -## MeoAssistant +## MaaCore 1. 直接拷貝上面編譯的第三方庫到 `3rdparty/lib` 或者 手動修改 `CMakeLists.txt` 指定第三方庫路徑 2. `3rdparty/include/opencv` 中的標頭檔是 `4.5.3` 版本的,若是使用其他版本,請注意標頭檔衝突問題(直接將你的 `opencv` 標頭檔覆蓋過去就好) 3. 安裝 `adb` -4. 複製資源檔案到 `libMeoAssistant.so` 同一目錄下 +4. 複製資源檔案到 `libMaaCore.so` 同一目錄下 ```sh cd tools @@ -44,7 +44,7 @@ sudo ldconfig ## 集成文件 -[~~或許算不上文件~~](https://github.com/MistEO/MeoAssistantArknights/wiki) +[~~或許算不上文件~~](https://github.com/MistEO/MaaCoreArknights/wiki) ### Python @@ -52,8 +52,8 @@ sudo ldconfig ### C -可參考 [TestCaller](../tools/TestCaller/main.cpp) 中的實現 +可參考 [CppSample](../src/CppSample/main.cpp) 中的實現 ### C sharp -可參考 [MeoAsstGui](../src/MeoAsstGui/Helper/AsstProxy.cs) 中的實現 +可參考 [MaaWpfGui](../src/MaaWpfGui/Helper/AsstProxy.cs) 中的實現 diff --git a/docs/zh-tw/2.2-開發相關.md b/docs/zh-tw/2.2-開發相關.md index 35f0d29356..41f76070c5 100644 --- a/docs/zh-tw/2.2-開發相關.md +++ b/docs/zh-tw/2.2-開發相關.md @@ -14,8 +14,8 @@ 1. 下載並安裝 `Visual Studio 2022 community`, 安裝的時候需要選中 `基於c++的桌面開發` 和 `.NET桌面開發` -5. 雙擊打開 `MeoAssistantArknights.sln` 檔案。 Visual Studio 會自動加載整個項目。 -6. 測試一下是否成功搭建編程環境,選擇參數 `Release`, `x64`, 右鍵 `MeoAsstGui` 設為啟動項目;點擊啟動,選擇繼續調試。如果成功打開了 GUI,就說明成功搭建了環境。如果求穩,可以繼續連接模擬器跑一下 MAA +5. 雙擊打開 `MAA.sln` 檔案。 Visual Studio 會自動加載整個項目。 +6. 測試一下是否成功搭建編程環境,選擇參數 `Release`, `x64`, 右鍵 `MaaWpfGui` 設為啟動項目;點擊啟動,選擇繼續調試。如果成功打開了 GUI,就說明成功搭建了環境。如果求穩,可以繼續連接模擬器跑一下 MAA 7. 到這裡,你就可以愉快地 ~~瞎 ㄐㄅ 改~~ 發電了 8. 開發過程中,每一定數量,記得提交一個 commit, 別忘了寫上 message 假如你不熟悉 git 的使用,你可能想要新增一个分支,而不是直接提交在 `dev` 上 @@ -75,4 +75,4 @@ 你也可以使用 `tools\ClangFormatter\clang-formatter.py` 來直接執行你的 clang-format 來進行格式化,只需要在項目根目錄下執行: -- `python tools\ClangFormatter\clang-formatter.py --clang-format=PATH\TO\YOUR\clang-format.exe --input=src\MeoAssistant` +- `python tools\ClangFormatter\clang-formatter.py --clang-format=PATH\TO\YOUR\clang-format.exe --input=src\MaaCore` diff --git a/docs/zh-tw/3.1-集成文件.md b/docs/zh-tw/3.1-集成文件.md index d971e579c2..b70c11f54e 100644 --- a/docs/zh-tw/3.1-集成文件.md +++ b/docs/zh-tw/3.1-集成文件.md @@ -240,3 +240,73 @@ bool ASSTAPI AsstSetTaskParams(AsstHandle handle, TaskId id, const char* params) - `const char* params` 任務參數,json string,與 `AsstAppendTask` 介面相同。 未標註“不支援執行時設置”的欄位都支援實時修改;否則若當前任務正在運行,會忽略對應的欄位 + +### `AsstSetStaticOption` + +#### Prototype + +```c++ +bool ASSTAPI AsstSetStaticOption(AsstStaticOptionKey key, const char* value); +``` + +#### Description + +Set process-level parameters + +#### Return Value + +- `bool` + Is the setup successful + +#### Parameter Description + +- `AsstStaticOptionKey key` + key +- `const char* value` + value + +##### List of Key and value + +None + +### `AsstSetInstanceOption` + +#### Prototype + +```c++ +bool ASSTAPI AsstSetInstanceOption(AsstHandle handle, AsstInstanceOptionKey key, const char* value); +``` + +#### Description + +Set instance-level parameters + +#### Return Value + +- `bool` + Is the setup successful + +#### Parameter Description + +- `AsstHandle handle` + handle +- `AsstInstanceOptionKey key` + key +- `const char* value` + value + +##### List of Key and value + +```jsonc + enum InstanceOptionKey + { + Invalid = 0, + // Deprecated // MinitouchEnabled = 1, // Is minitouch enabled + // If you can't use minitouch, it's useless to turn it on. + // "1" - on,"0" - off + TouchMode = 2, // Touch mode, minitouch by default + // minitouch | maatouch | adb + DeploymentWithPause = 3, // Deployment with Pause (Works for IS, Copilot and 保全派驻) + // "1" | "0" + }; +``` diff --git a/docs/zh-tw/3.2-回呼訊息協定.md b/docs/zh-tw/3.2-回呼訊息協定.md index 634f57f798..40a4756bf7 100644 --- a/docs/zh-tw/3.2-回呼訊息協定.md +++ b/docs/zh-tw/3.2-回呼訊息協定.md @@ -55,7 +55,7 @@ Todo } ``` -## ConnectionInfo +### ConnectionInfo ```jsonc { @@ -91,6 +91,8 @@ Todo 連接斷開(adb / 模擬器 炸了),並重試失敗 - `ScreencapFailed` 截圖失敗(adb / 模擬器 炸了),並重試失敗 +- `TouchModeNotAvaiable` + Touch Mode is not avaiable ### AllTasksCompleted diff --git a/docs/zh-tw/3.3-戰鬥流程協定.md b/docs/zh-tw/3.3-戰鬥流程協定.md index 87dc13fcfa..c8ec72b5e7 100644 --- a/docs/zh-tw/3.3-戰鬥流程協定.md +++ b/docs/zh-tw/3.3-戰鬥流程協定.md @@ -132,5 +132,4 @@ ## 舉例 -[Sample](../resource/copilot/test.json) -[GA-EX8 突襲作業](../resource/copilot/GA-EX8-raid.json) +[OF-1](../resource/copilot/OF-1_credit_fight.json) diff --git a/docs/zh-tw/3.4-任務流程協定.md b/docs/zh-tw/3.4-任務流程協定.md index 3e87bca48a..7761841b8b 100644 --- a/docs/zh-tw/3.4-任務流程協定.md +++ b/docs/zh-tw/3.4-任務流程協定.md @@ -155,7 +155,7 @@ ### Visual Studio -在 `MeoAssistant.vcxporj` 中已對其進行配置,開箱即用。提示效果較為晦澀,且有部分資訊缺失。 +在 `MaaCore.vcxporj` 中已對其進行配置,開箱即用。提示效果較為晦澀,且有部分資訊缺失。 ### Visual Studio Code diff --git a/include/AsstCaller.h b/include/AsstCaller.h index 2b4ddcf71a..aaae22e68d 100644 --- a/include/AsstCaller.h +++ b/include/AsstCaller.h @@ -1,53 +1,50 @@ #pragma once #include "AsstPort.h" +#include -#ifndef __cplusplus -#include -#endif +struct AsstExtAPI; +typedef struct AsstExtAPI* AsstHandle; -#ifdef __cplusplus -namespace asst -{ - class Assistant; -} -#endif +typedef uint8_t AsstBool; +typedef uint64_t AsstSize; +typedef int32_t AsstMsgId; +typedef int32_t AsstTaskId; +typedef int32_t AsstAsyncCallId; +typedef int32_t AsstStaticOptionKey; +typedef int32_t AsstInstanceOptionKey; + +typedef void(ASST_CALL* AsstApiCallback)(AsstMsgId msg, const char* details_json, void* custom_arg); #ifdef __cplusplus extern "C" { #endif -#ifdef __cplusplus - typedef asst::Assistant* AsstHandle; -#else -typedef void* AsstHandle; -#endif - typedef int AsstTaskId; - typedef int AsstProcessOptionKey; - typedef int AsstInstanceOptionKey; - typedef unsigned long long AsstSize; - - typedef void(ASST_CALL* AsstApiCallback)(int msg, const char* detail_json, void* custom_arg); - - bool ASSTAPI AsstSetUserDir(const char* path); - bool ASSTAPI AsstLoadResource(const char* path); - bool ASSTAPI AsstSetProcessOption(AsstProcessOptionKey key, const char* value); + AsstBool ASSTAPI AsstSetUserDir(const char* path); + AsstBool ASSTAPI AsstLoadResource(const char* path); + AsstBool ASSTAPI AsstSetStaticOption(AsstStaticOptionKey key, const char* value); AsstHandle ASSTAPI AsstCreate(); AsstHandle ASSTAPI AsstCreateEx(AsstApiCallback callback, void* custom_arg); void ASSTAPI AsstDestroy(AsstHandle handle); - bool ASSTAPI AsstSetInstanceOption(AsstHandle handle, AsstInstanceOptionKey key, const char* value); - bool ASSTAPI AsstConnect(AsstHandle handle, const char* adb_path, const char* address, const char* config); + AsstBool ASSTAPI AsstSetInstanceOption(AsstHandle handle, AsstInstanceOptionKey key, const char* value); + /* deprecated */ AsstBool ASSTAPI AsstConnect(AsstHandle handle, const char* adb_path, const char* address, + const char* config); AsstTaskId ASSTAPI AsstAppendTask(AsstHandle handle, const char* type, const char* params); - bool ASSTAPI AsstSetTaskParams(AsstHandle handle, AsstTaskId id, const char* params); + AsstBool ASSTAPI AsstSetTaskParams(AsstHandle handle, AsstTaskId id, const char* params); - bool ASSTAPI AsstStart(AsstHandle handle); - bool ASSTAPI AsstStop(AsstHandle handle); - bool ASSTAPI AsstRunning(AsstHandle handle); + AsstBool ASSTAPI AsstStart(AsstHandle handle); + AsstBool ASSTAPI AsstStop(AsstHandle handle); + AsstBool ASSTAPI AsstRunning(AsstHandle handle); + + /* Aysnc with AsstMsg::AsyncCallInfo Callback*/ + AsstAsyncCallId ASSTAPI AsstAsyncConnect(AsstHandle handle, const char* adb_path, const char* address, + const char* config, AsstBool block); + AsstAsyncCallId ASSTAPI AsstAsyncClick(AsstHandle handle, int32_t x, int32_t y, AsstBool block); + AsstAsyncCallId ASSTAPI AsstAsyncScreencap(AsstHandle handle, AsstBool block); - bool ASSTAPI AsstClick(AsstHandle handle, int x, int y); AsstSize ASSTAPI AsstGetImage(AsstHandle handle, void* buff, AsstSize buff_size); AsstSize ASSTAPI AsstGetUUID(AsstHandle handle, char* buff, AsstSize buff_size); AsstSize ASSTAPI AsstGetTasksList(AsstHandle handle, AsstTaskId* buff, AsstSize buff_size); diff --git a/include/module.modulemap b/include/module.modulemap index 0fe3104227..c05880a298 100644 --- a/include/module.modulemap +++ b/include/module.modulemap @@ -1,4 +1,4 @@ -module MeoAssistant { +module MaaCore { umbrella header "AsstCaller.h" export * link framework "Accelerate" diff --git a/package-definition.json b/package-definition.json index fc1f2cad11..52bf073d5c 100644 --- a/package-definition.json +++ b/package-definition.json @@ -8,32 +8,12 @@ ] } }, - { - "name_template": "MAAComponent-OTA-{VERSION}-win-x64", - "type": "MaaBundleOta", - "configuration": { - "include": [ - "resource/**", - "MeoAssistant.dll", - "MeoAsstGui.exe", - "ON.dll", - "onnxruntime.dll", - "onnxruntime_providers_shared.dll", - "paddle2onnx.dll", - "yaml-cpp.dll" - ], - "exclude": [ - "**/PaddleOCR/**", - "**/PaddleCharOCR/**" - ] - } - }, { "name_template": "MAAComponent-Core-{VERSION}-win-x64", "type": "MaaCore", "configuration": { "include": [ - "MeoAssistant.dll" + "MaaCore.dll" ] } }, @@ -42,11 +22,9 @@ "type": "MaaDependency", "configuration": { "include": [ - "ON.dll", + "fastdeploy.dll", "onnxruntime.dll", - "onnxruntime_providers_shared.dll", "paddle2onnx.dll", - "yaml-cpp.dll", "opencv_world453.dll", "**/PaddleOCR/**", "**/PaddleCharOCR/**" diff --git a/resource/config.json b/resource/config.json index 419eb8e101..754f8f9077 100644 --- a/resource/config.json +++ b/resource/config.json @@ -16,6 +16,15 @@ "adbSwipeDurationMultiplier_Doc": "adb 滑动延迟倍数", "minitouchExtraSwipeDist": 100, "minitouchExtraSwipeDuration": 200, + "minitouchProgramsOrder": [ + "x86_64", + "x86", + "arm64-v8a", + "armeabi-v7a", + "armeabi" + ], + "swipeWithPauseRequiredDistance": 20, + "swipeWithPauseRequiredDistance_Doc": "暂停下干员滑动多远距离后开始按暂停", "penguinReport": { "Doc": "企鹅物流汇报: https://penguin-stats.cn/", "cmdFormat": "curl -H \"Content-Type: application/json\" -s -S -m 10 -i -d \"[body]\" \"https://penguin-stats.io/PenguinStats/api/v2/report\" --ssl-no-revoke [extra]", @@ -40,14 +49,16 @@ "YoStarKR": "com.YoStarKR.Arknights/com.u8.sdk.U8UnityContext", "txwy": "tw.txwy.and.arknights/com.u8.sdk.U8UnityContext" }, - "connection": { - "General": { + "connection": [ + { + "configName": "General", "devices": "[Adb] devices", "addressRegex": "(.+)\tdevice", "connect": "[Adb] connect [AdbSerial]", "uuid": "[Adb] -s [AdbSerial] shell settings get secure android_id", "click": "[Adb] -s [AdbSerial] shell input tap [x] [y]", "swipe": "[Adb] -s [AdbSerial] shell input swipe [x1] [y1] [x2] [y2] [duration]", + "pressEsc": "[Adb] -s [AdbSerial] shell input keyevent 111", "display": "[Adb] -s [AdbSerial] shell dumpsys window displays | grep -o -E cur=+[^\\ ]+ | grep -o -E [0-9]+", "displayFormat": "%d%d", "screencapRawByNC": "[Adb] -s [AdbSerial] exec-out \"screencap | nc -w 3 [NcAddress] [NcPort]\"", @@ -58,196 +69,58 @@ "release": "[Adb] kill-server", "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", + "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", - "callMinitouch": "[Adb] -s [AdbSerial] shell \"/data/local/tmp/[minitouchWorkingFile]\" -i" + "callMinitouch": "[Adb] -s [AdbSerial] shell \"/data/local/tmp/[minitouchWorkingFile]\" -i", + "callMaatouch": "[Adb] -s [AdbSerial] shell \"export CLASSPATH=/data/local/tmp/[minitouchWorkingFile]; app_process /data/local/tmp com.shxyke.MaaTouch.App\"" }, - "BlueStacks": { - "devices": "[Adb] devices", - "addressRegex": "(.+)\tdevice", - "connect": "[Adb] connect [AdbSerial]", - "uuid": "[Adb] -s [AdbSerial] shell settings get secure android_id", - "click": "[Adb] -s [AdbSerial] shell input tap [x] [y]", - "swipe": "[Adb] -s [AdbSerial] shell input swipe [x1] [y1] [x2] [y2] [duration]", - "display": "[Adb] -s [AdbSerial] shell dumpsys window displays | grep -o -E cur=+[^\\ ]+ | grep -o -E [0-9]+", - "displayFormat": "%d%d", - "screencapRawByNC": "[Adb] -s [AdbSerial] exec-out \"screencap | nc -w 3 [NcAddress] [NcPort]\"", - "ncAddress": "[Adb] -s [AdbSerial] shell \" cat /proc/net/arp | grep : \"", - "ncPort": 6723, - "screencapRawWithGzip": "[Adb] -s [AdbSerial] exec-out \"screencap | gzip -1\"", - "screencapEncode": "[Adb] -s [AdbSerial] exec-out screencap -p", - "release": "[Adb] kill-server", - "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", - "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", - "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", - "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", - "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", - "callMinitouch": "[Adb] -s [AdbSerial] shell \"/data/local/tmp/[minitouchWorkingFile]\" -i" - }, - "MuMuEmulator": { - "devices": "[Adb] devices", - "addressRegex": "(.+)\tdevice", - "connect": "[Adb] connect [AdbSerial]", - "uuid": "[Adb] -s [AdbSerial] shell settings get secure android_id", - "click": "[Adb] -s [AdbSerial] shell input tap [x] [y]", - "swipe": "[Adb] -s [AdbSerial] shell input swipe [x1] [y1] [x2] [y2] [duration]", - "display": "[Adb] -s [AdbSerial] shell dumpsys window displays | grep -o -E cur=+[^\\ ]+ | grep -o -E [0-9]+", - "displayFormat": "%d%d", - "screencapRawByNC": "[Adb] -s [AdbSerial] exec-out \"screencap | nc -w 3 [NcAddress] [NcPort]\"", - "ncAddress": "[Adb] -s [AdbSerial] shell \" cat /proc/net/arp | grep : \"", - "ncPort": 6723, - "screencapRawWithGzip": "[Adb] -s [AdbSerial] exec-out \"screencap | gzip -1\"", - "screencapEncode": "[Adb] -s [AdbSerial] exec-out screencap -p", - "release": "[Adb] kill-server", - "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", - "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", - "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", - "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", - "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", - "callMinitouch": "[Adb] -s [AdbSerial] shell \"/data/local/tmp/[minitouchWorkingFile]\" -i" - }, - "LDPlayer": { - "devices": "[Adb] devices", - "addressRegex": "(.+)\tdevice", - "connect": "[Adb] connect [AdbSerial]", - "uuid": "[Adb] -s [AdbSerial] shell settings get secure android_id", - "click": "[Adb] -s [AdbSerial] shell input tap [x] [y]", - "swipe": "[Adb] -s [AdbSerial] shell input swipe [x1] [y1] [x2] [y2] [duration]", - "display": "[Adb] -s [AdbSerial] shell dumpsys window displays | grep -o -E cur=+[^\\ ]+ | grep -o -E [0-9]+", - "displayFormat": "%d%d", + { + "configName": "CapWithShell", + "baseConfig": "General", "screencapRawByNC": "[Adb] -s [AdbSerial] shell \"screencap | nc -w 3 [NcAddress] [NcPort]\"", - "ncAddress": "[Adb] -s [AdbSerial] shell \" cat /proc/net/arp | grep : \"", - "ncPort": 6723, "screencapRawWithGzip": "[Adb] -s [AdbSerial] shell \"screencap | gzip -1\"", - "screencapEncode": "[Adb] -s [AdbSerial] shell screencap -p", - "release": "[Adb] kill-server", - "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", - "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", - "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", - "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", - "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", - "callMinitouch": "[Adb] -s [AdbSerial] shell \"/data/local/tmp/[minitouchWorkingFile]\" -i" + "screencapEncode": "[Adb] -s [AdbSerial] shell screencap -p" }, - "Nox": { - "devices": "[Adb] devices", - "addressRegex": "(.+)\tdevice", - "connect": "[Adb] connect [AdbSerial]", - "uuid": "[Adb] -s [AdbSerial] shell settings get secure android_id", - "click": "[Adb] -s [AdbSerial] shell input tap [x] [y]", - "swipe": "[Adb] -s [AdbSerial] shell input swipe [x1] [y1] [x2] [y2] [duration]", - "display": "[Adb] -s [AdbSerial] shell dumpsys window displays | grep -o -E cur=+[^\\ ]+ | grep -o -E [0-9]+", - "displayFormat": "%d%d", - "screencapRawByNC": "[Adb] -s [AdbSerial] exec-out \"screencap | nc -w 3 [NcAddress] [NcPort]\"", - "ncAddress": "[Adb] -s [AdbSerial] shell \" cat /proc/net/arp | grep : \"", - "ncPort": 6723, - "screencapRawWithGzip": "[Adb] -s [AdbSerial] exec-out \"screencap | gzip -1\"", - "screencapEncode": "[Adb] -s [AdbSerial] exec-out screencap -p", - "release": "[Adb] kill-server", - "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", - "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", - "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", - "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", - "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", - "callMinitouch": "[Adb] -s [AdbSerial] shell \"/data/local/tmp/[minitouchWorkingFile]\" -i" + { + "configName": "BlueStacks", + "baseConfig": "General" }, - "XYAZ": { - "devices": "[Adb] devices", - "addressRegex": "(.+)\tdevice", - "connect": "[Adb] connect [AdbSerial]", - "uuid": "[Adb] -s [AdbSerial] shell settings get secure android_id", - "click": "[Adb] -s [AdbSerial] shell input tap [x] [y]", - "swipe": "[Adb] -s [AdbSerial] shell input swipe [x1] [y1] [x2] [y2] [duration]", - "display": "[Adb] -s [AdbSerial] shell dumpsys window displays | grep -o -E cur=+[^\\ ]+ | grep -o -E [0-9]+", - "displayFormat": "%d%d", - "screencapRawByNC": "[Adb] -s [AdbSerial] exec-out \"screencap | nc -w 3 [NcAddress] [NcPort]\"", - "ncAddress": "[Adb] -s [AdbSerial] shell \" cat /proc/net/arp | grep : \"", - "ncPort": 6723, - "screencapRawWithGzip": "[Adb] -s [AdbSerial] shell \"screencap | gzip -1\"", - "screencapEncode": "[Adb] -s [AdbSerial] shell screencap -p", - "release": "[Adb] kill-server", - "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", - "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", - "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", - "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", - "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", - "callMinitouch": "[Adb] -s [AdbSerial] shell \"/data/local/tmp/[minitouchWorkingFile]\" -i" + { + "configName": "MuMuEmulator", + "baseConfig": "General" }, - "WSA": { - "devices": "[Adb] devices", - "addressRegex": "(.+)\tdevice", - "connect": "[Adb] connect [AdbSerial]", + { + "configName": "LDPlayer", + "baseConfig": "CapWithShell" + }, + { + "configName": "Nox", + "baseConfig": "General" + }, + { + "configName": "XYAZ", + "baseConfig": "CapWithShell" + }, + { + "configName": "WSA", + "baseConfig": "CapWithShell", "displayId": "[Adb] -s [AdbSerial] shell dumpsys display | grep mUniqueId=virtual:com.microsoft.windows.systemapp:com.hypergryph.arknights", - "uuid": "[Adb] -s [AdbSerial] shell settings get secure android_id", "click": "[Adb] -s [AdbSerial] shell input -d [DisplayId] tap [x] [y]", "swipe": "[Adb] -s [AdbSerial] shell input -d [DisplayId] swipe [x1] [y1] [x2] [y2] [duration]", - "display": "[Adb] -s [AdbSerial] shell \"wm size -d [DisplayId] | grep -o -E [0-9]+\"", - "displayFormat": "%d%d", - "screencapRawByNC": "[Adb] -s [AdbSerial] exec-out \"screencap | nc -w 3 [NcAddress] [NcPort]\"", - "ncAddress": "[Adb] -s [AdbSerial] shell \" cat /proc/net/arp | grep : \"", - "ncPort": 6723, - "screencapRawWithGzip": "[Adb] -s [AdbSerial] shell \"screencap -d [DisplayId] | gzip -1\"", - "screencapEncode": "[Adb] -s [AdbSerial] shell screencap -d [DisplayId] -p", - "release": "[Adb] kill-server", - "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", - "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", - "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", - "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", - "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", - "callMinitouch": "[Adb] -s [AdbSerial] shell \"/data/local/tmp/[minitouchWorkingFile]\" -i" + "display": "[Adb] -s [AdbSerial] shell \"wm size -d [DisplayId] | grep -o -E [0-9]+\"" }, - "Compatible": { - "devices": "[Adb] devices", - "addressRegex": "(.+)\tdevice", - "connect": "[Adb] connect [AdbSerial]", - "uuid": "[Adb] -s [AdbSerial] shell echo 111111", - "click": "[Adb] -s [AdbSerial] shell input tap [x] [y]", - "swipe": "[Adb] -s [AdbSerial] shell input swipe [x1] [y1] [x2] [y2] [duration]", - "display": "[Adb] -s [AdbSerial] shell dumpsys window displays | grep -o -E cur=+[^\\ ]+ | grep -o -E [0-9]+", - "displayFormat": "%d%d", - "screencapRawByNC": "[Adb] -s [AdbSerial] exec-out \"screencap | nc -w 3 [NcAddress] [NcPort]\"", - "ncAddress": "[Adb] -s [AdbSerial] shell \" cat /proc/net/arp | grep : \"", - "ncPort": 6723, - "screencapRawWithGzip": "[Adb] -s [AdbSerial] exec-out \"screencap | gzip -1\"", - "screencapEncode": "[Adb] -s [AdbSerial] exec-out screencap -p", - "release": "[Adb] kill-server", - "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", - "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", - "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", - "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", - "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", - "callMinitouch": "[Adb] -s [AdbSerial] shell \"/data/local/tmp/[minitouchWorkingFile]\" -i" + { + "configName": "Compatible", + "baseConfig": "General", + "uuid": "[Adb] -s [AdbSerial] shell echo 111111" }, - "CompatMac": { - "devices": "[Adb] devices", - "addressRegex": "(.+)\tdevice", - "connect": "[Adb] connect [AdbSerial]", - "uuid": "[Adb] -s [AdbSerial] shell echo 111111", - "click": "[Adb] -s [AdbSerial] shell input tap [x] [y]", - "swipe": "[Adb] -s [AdbSerial] shell input swipe [x1] [y1] [x2] [y2] [duration]", - "display": "[Adb] -s [AdbSerial] shell dumpsys window displays | grep -o -E cur=+[^\\ ]+ | grep -o -E [0-9]+", - "displayFormat": "%d%d", - "screencapRawByNC": "[Adb] -s [AdbSerial] exec-out \"screencap | nc -w 3 [NcAddress] [NcPort]\"", + { + "configName": "CompatMac", + "baseConfig": "Compatible", "ncAddress": "[Adb] -s [AdbSerial] shell \"cat /proc/net/arp | grep : | sort\"", - "ncPort": 6723, - "screencapRawWithGzip": "", - "screencapEncode": "[Adb] -s [AdbSerial] exec-out screencap -p", - "release": "[Adb] kill-server", - "start": "[Adb] -s [AdbSerial] shell am start -n [Intent]", - "stop": "[Adb] -s [AdbSerial] shell \"am force-stop `dumpsys activity activities 2>/dev/null | grep Activities= 2>/dev/null | grep -m 1 -i -o -E [^\\ ]*arknights[^/]*`\"", - "abilist": "[Adb] -s [AdbSerial] shell getprop ro.product.cpu.abilist", - "orientation": "[Adb] -s [AdbSerial] shell dumpsys input | grep SurfaceOrientation | grep -m 1 -o -E [0-9]", - "pushMinitouch": "[Adb] -s [AdbSerial] push \"[minitouchLocalPath]\" \"/data/local/tmp/[minitouchWorkingFile]\"", - "chmodMinitouch": "[Adb] -s [AdbSerial] shell chmod 700 \"/data/local/tmp/[minitouchWorkingFile]\"", - "callMinitouch": "[Adb] -s [AdbSerial] shell \"/data/local/tmp/[minitouchWorkingFile]\" -i" + "screencapRawWithGzip": "" } - } + ] } diff --git a/resource/copilot/GA-EX8-raid.json b/resource/copilot/GA-EX8-raid.json deleted file mode 100644 index 5f9ab04c9c..0000000000 --- a/resource/copilot/GA-EX8-raid.json +++ /dev/null @@ -1,169 +0,0 @@ -{ - "minimum_required": "v4.0", - "doc": { - "title": "《AI 都比我打得好》", - "details": "作业抄自 https://www.bilibili.com/video/BV1zS4y1U76j" - }, - "stage_name": "千层蛋糕", - "opers": [ - { - "name": "银灰", - "skill": 3 - }, - { - "name": "凯尔希", - "skill": 3 - }, - { - "name": "史尔特尔", - "skill": 3 - }, - { - "name": "泥岩", - "skill": 2 - } - ], - "actions": [ - { - "type": "二倍速" - }, - { - "name": "泥岩", - "location": [ - 2, - 6 - ], - "direction": "右" - }, - { - "name": "银灰", - "location": [ - 4, - 3 - ], - "direction": "左" - }, - { - "kills": 6, - "pre_delay": 2000, - "type": "技能", - "name": "银灰" - }, - { - "pre_delay": 12000, - "name": "史尔特尔", - "location": [ - 4, - 2 - ], - "direction": "下" - }, - { - "pre_delay": 1000, - "type": "技能", - "name": "史尔特尔" - }, - { - "kills": 19, - "name": "凯尔希", - "location": [ - 5, - 2 - ], - "direction": "右" - }, - { - "name": "Mon3tr", - "location": [ - 8, - 2 - ], - "direction": "上" - }, - { - "kills": 23, - "pre_delay": 1000, - "type": "技能", - "name": "凯尔希" - }, - { - "name": "银灰", - "location": [ - 8, - 5 - ], - "direction": "上" - }, - { - "kills": 26, - "type": "技能", - "name": "银灰", - "post_delay": 6000 - }, - { - "name": "史尔特尔", - "location": [ - 8, - 6 - ], - "direction": "上" - }, - { - "pre_delay": 1000, - "type": "技能", - "name": "史尔特尔" - }, - { - "kills": 28, - "type": "撤退", - "name": "史尔特尔" - }, - { - "name": "Mon3tr", - "type": "撤退" - }, - { - "name": "银灰", - "type": "撤退" - }, - { - "name": "Mon3tr", - "location": [ - 5, - 1 - ], - "direction": "右" - }, - { - "kills": 31, - "type": "技能", - "name": "凯尔希" - }, - { - "kills": 34, - "name": "银灰", - "location": [ - 9, - 4 - ], - "direction": "上" - }, - { - "name": "史尔特尔", - "location": [ - 8, - 2 - ], - "direction": "右" - }, - { - "kills": 37, - "type": "技能", - "name": "银灰" - }, - { - "type": "技能", - "name": "史尔特尔" - } - ] -} diff --git a/resource/credit_fight_copilot.json b/resource/copilot/OF-1_credit_fight.json similarity index 56% rename from resource/credit_fight_copilot.json rename to resource/copilot/OF-1_credit_fight.json index 14811d5a4f..4782fb45be 100644 --- a/resource/credit_fight_copilot.json +++ b/resource/copilot/OF-1_credit_fight.json @@ -6,7 +6,7 @@ }, { "type": "Deploy", - "name": "近战", + "name": "先锋", "location": [ 5, 3 @@ -18,30 +18,35 @@ } ], "doc": { - "title": "OF-1 借人赚信用", - "details": "OF-1 借人赚信用" + "title": "OF-1 Credit Fight", + "details": "OF-1 Credit Fight" }, "groups": [ { - "name": "近战", + "name": "先锋", "opers": [ { - "name": "德克萨斯", - "skill_usage": 1 + "name": "德克萨斯" }, { - "name": "芬", - "skill_usage": 1 + "name": "芬" }, { "name": "推进之王", - "skill": 2, + "skill": 2 + }, + { + "name": "风笛", + "skill": 2 + }, + { + "name": "嵯峨", + "skill": 3, "skill_usage": 1 } ] } ], "opers": [], - "stage_name": "OF-1", - "difficulty": 3 + "stage_name": "OF-1" } diff --git a/resource/copilot/WD-EX-1.json b/resource/copilot/WD-EX-1.json deleted file mode 100644 index 9b99acfe03..0000000000 --- a/resource/copilot/WD-EX-1.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "minimum_required": "v4.0", - "doc": { - "title": "《摆完挂机 简单好抄》", - "details": "作业抄自 https://www.bilibili.com/video/BV12r4y1W7s4?p=10", - "strategy_author": "萧然Q", - "copilot_author": "Evil Deamo", - "version": "v1.0" - }, - "stage_name": "兽群战术", - "opers": [ - { - "name": "煌", - "skill": 2 - } - ], - "groups": [ - { - "name": "普通单奶", - "opers": [ - { - "name": "闪灵", - "skill": 2 - }, - { - "name": "华法琳", - "skill": 1 - }, - { - "name": "赫默2", - "skill": 1 - } - ] - } - ], - "actions": [ - { - "name": "煌", - "location": [ - 7, - 3 - ], - "direction": "左" - }, - { - "name": "普通单奶", - "location": [ - 9, - 4 - ], - "direction": "左" - } - ] -} diff --git a/resource/copilot/WD-EX8-raid.json b/resource/copilot/WD-EX8-raid.json deleted file mode 100644 index 5230bd7949..0000000000 --- a/resource/copilot/WD-EX8-raid.json +++ /dev/null @@ -1,219 +0,0 @@ -{ - "minimum_required": "v4.0", - "doc": { - "title": "《AI 都比我打得好 - 第二集》", - "details": "作业抄自 https://www.bilibili.com/video/BV12r4y1W7s4?p=18" - }, - "stage_name": "如帝国之影", - "opers": [ - { - "name": "棘刺", - "skill": 3, - "skill_usage": 1 - }, - { - "name": "银灰", - "skill": 3 - }, - { - "name": "推进之王", - "skill": 2 - }, - { - "name": "史尔特尔", - "skill": 3 - }, - { - "name": "塞雷娅", - "skill": 1 - }, - { - "name": "艾雅法拉", - "skill": 3 - } - ], - "actions": [ - { - "name": "银灰", - "location": [ - 6, - 5 - ], - "direction": "上" - }, - { - "type": "二倍速" - }, - { - "name": "推进之王", - "location": [ - 5, - 5 - ], - "direction": "左" - }, - { - "type": "二倍速" - }, - { - "name": "史尔特尔", - "location": [ - 11, - 4 - ], - "direction": "上" - }, - { - "type": "技能", - "name": "银灰" - }, - { - "type": "二倍速" - }, - { - "name": "棘刺", - "location": [ - 2, - 7 - ], - "direction": "上" - }, - { - "name": "塞雷娅", - "location": [ - 7, - 5 - ], - "direction": "右" - }, - { - "name": "艾雅法拉", - "location": [ - 3, - 2 - ], - "direction": "右" - }, - { - "pre_delay": 8000, - "name": "艾雅法拉", - "type": "技能" - }, - { - "name": "史尔特尔", - "type": "技能" - }, - { - "kills": 33, - "type": "撤退", - "name": "艾雅法拉" - }, - { - "type": "撤退", - "name": "史尔特尔" - }, - { - "type": "撤退", - "name": "推进之王" - }, - { - "pre_delay": 2000, - "name": "史尔特尔", - "location": [ - 8, - 5 - ], - "direction": "左" - }, - { - "name": "艾雅法拉", - "location": [ - 10, - 6 - ], - "direction": "左" - }, - { - "type": "撤退", - "name": "塞雷娅" - }, - { - "name": "银灰", - "type": "技能" - }, - { - "pre_delay": 2000, - "name": "史尔特尔", - "type": "技能" - }, - { - "pre_delay": 1000, - "name": "艾雅法拉", - "type": "技能" - }, - { - "pre_delay": 12000, - "name": "推进之王", - "location": [ - 3, - 4 - ], - "direction": "下" - }, - { - "name": "塞雷娅", - "location": [ - 7, - 7 - ], - "direction": "右" - }, - { - "name": "史尔特尔", - "location": [ - 6, - 3 - ], - "direction": "下" - }, - { - "type": "技能", - "name": "史尔特尔" - }, - { - "kills": 40, - "name": "艾雅法拉", - "location": [ - 5, - 4 - ], - "direction": "右" - }, - { - "name": "推进之王", - "location": [ - 8, - 3 - ], - "direction": "左" - }, - { - "pre_delay": 3000, - "name": "艾雅法拉", - "type": "技能" - }, - { - "name": "银灰", - "location": [ - 5, - 7 - ], - "direction": "上" - }, - { - "pre_delay": 8000, - "type": "技能", - "name": "银灰" - } - ] -} diff --git a/resource/copilot/YanFengRongDong-30.json b/resource/copilot/YanFengRongDong-30.json deleted file mode 100644 index 6b9880298a..0000000000 --- a/resource/copilot/YanFengRongDong-30.json +++ /dev/null @@ -1,351 +0,0 @@ -{ - "minimum_required": "v4.0", - "doc": { - "title": "《全自动危机合约 30》", - "details": "作业抄自 https://www.bilibili.com/video/BV1mF411L7PF。\n没写完,摆烂了,不要用这个" - }, - "stage_name": "obt/rune/level_rune_11-01", - "opers": [ - { - "name": "史尔特尔", - "skill": 3 - }, - { - "name": "银灰", - "skill": 3 - }, - { - "name": "号角", - "skill": 3, - "skill_usage": 1 - }, - { - "name": "风笛", - "skill": 3 - }, - { - "name": "铃兰", - "skill": 3 - }, - { - "name": "傀影", - "skill": 3 - }, - { - "name": "卡夫卡", - "skill": 1 - }, - { - "name": "极境", - "skill": 1, - "skill_usage": 1 - }, - { - "name": "阿", - "skill": 3 - }, - { - "name": "温蒂", - "skill": 3 - }, - { - "name": "桃金娘", - "skill": 1, - "skill_usage": 1 - }, - { - "name": "卡缇", - "skill": 1 - }, - { - "name": "耀骑士临光", - "skill": 2 - } - ], - "actions": [ - { - "name": "桃金娘", - "location": [ - 5, - 1 - ], - "direction": "右" - }, - { - "name": "风笛", - "location": [ - 9, - 3 - ], - "direction": "上" - }, - { - "name": "极境", - "location": [ - 6, - 1 - ], - "direction": "右" - }, - { - "pre_delay": 4500, - "name": "傀影", - "location": [ - 8, - 1 - ], - "direction": "下" - }, - { - "type": "撤退", - "name": "傀影" - }, - { - "name": "温蒂", - "location": [ - 10, - 4 - ], - "direction": "左" - }, - { - "type": "技能", - "name": "风笛" - }, - { - "kills": 3, - "type": "撤退", - "name": "风笛" - }, - { - "name": "号角", - "location": [ - 5, - 2 - ], - "direction": "左" - }, - { - "name": "工程蓄水炮", - "location": [ - 9, - 4 - ], - "direction": "下" - }, - { - "pre_delay": 12000, - "type": "技能", - "name": "温蒂" - }, - { - "type": "撤退", - "name": "温蒂" - }, - { - "doc": "你史尔特尔奶奶来啦!", - "doc_color": "red", - "name": "史尔特尔", - "location": [ - 6, - 6 - ], - "direction": "右", - "post_delay": 6000 - }, - { - "doc": "莱瓦汀!", - "doc_color": "red", - "type": "技能", - "name": "史尔特尔" - }, - { - "kills": 12, - "type": "撤退", - "name": "史尔特尔" - }, - { - "name": "铃兰", - "location": [ - 10, - 5 - ], - "direction": "左" - }, - { - "name": "风笛", - "location": [ - 8, - 6 - ], - "direction": "上" - }, - { - "doc": "蛋可能打不死,没有关系,后面还有补刀", - "type": "撤退", - "name": "号角" - }, - { - "pre_delay": 5000, - "name": "傀影", - "location": [ - 9, - 4 - ], - "direction": "左" - }, - { - "pre_delay": 4000, - "type": "撤退", - "name": "傀影" - }, - { - "name": "银灰", - "location": [ - 7, - 1 - ], - "direction": "下" - }, - { - "name": "耀骑士临光", - "location": [ - 3, - 5 - ], - "direction": "左" - }, - { - "name": "风笛", - "type": "技能" - }, - { - "pre_delay": 3000, - "name": "极境", - "type": "撤退" - }, - { - "name": "卡夫卡", - "location": [ - 4, - 5 - ], - "direction": "左" - }, - { - "name": "耀骑士临光", - "type": "撤退" - }, - { - "name": "卡夫卡", - "type": "撤退" - }, - { - "name": "傀影", - "location": [ - 4, - 4 - ], - "direction": "下" - }, - { - "name": "温蒂", - "location": [ - 10, - 4 - ], - "direction": "左" - }, - { - "kills": 18, - "name": "风笛", - "type": "撤退" - }, - { - "name": "桃金娘", - "type": "撤退" - }, - { - "name": "傀影", - "location": [ - 3, - 5 - ], - "direction": "左" - }, - { - "pre_delay": 1000, - "name": "傀影", - "type": "撤退" - }, - { - "name": "号角", - "location": [ - 6, - 1 - ], - "direction": "下" - }, - { - "name": "卡夫卡", - "location": [ - 3, - 5 - ], - "direction": "左" - }, - { - "name": "卡夫卡", - "type": "撤退" - }, - { - "name": "阿", - "location": [ - 3, - 1 - ], - "direction": "右" - }, - { - "pre_delay": 18000, - "name": "铃兰", - "type": "技能" - }, - { - "name": "号角", - "type": "技能" - }, - { - "name": "阿", - "type": "技能" - }, - { - "name": "阿", - "type": "技能" - }, - { - "name": "傀影", - "location": [ - 8, - 1 - ], - "direction": "左" - }, - { - "name": "工程蓄水炮", - "location": [ - 9, - 4 - ], - "direction": "左" - }, - { - "name": "温蒂", - "type": "技能" - }, - { - "name": "温蒂", - "type": "技能" - } - ] -} diff --git a/resource/copilot/YanFengRongDong.json b/resource/copilot/YanFengRongDong.json deleted file mode 100644 index 890e527e17..0000000000 --- a/resource/copilot/YanFengRongDong.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "minimum_required": "v4.0", - "doc": { - "title": "《全自动危机合约 18》", - "details": "作业抄自 https://www.bilibili.com/video/BV13S4y187NW" - }, - "stage_name": "obt/rune/level_rune_11-01", - "opers": [ - { - "name": "史尔特尔", - "skill": 3 - }, - { - "name": "伊芙利特", - "skill": 2 - }, - { - "name": "棘刺", - "skill": 3, - "skill_usage": 1 - }, - { - "name": "克洛丝", - "skill": 3 - }, - { - "name": "红", - "skill": 2 - }, - { - "name": "蜜莓", - "skill": 1 - } - ], - "actions": [ - { - "name": "令", - "location": [ - 10, - 4 - ], - "direction": "左" - }, - { - "name": "“弦惊”", - "location": [ - 8, - 6 - ], - "direction": "上" - }, - { - "name": "“弦惊”", - "location": [ - 3, - 5 - ], - "direction": "左" - }, - { - "name": "“弦惊”", - "location": [ - 2, - 3 - ], - "direction": "下" - }, - { - "location": [ - 3, - 5 - ], - "type": "撤退" - }, - { - "location": [ - 2, - 3 - ], - "type": "撤退" - } - ] -} diff --git a/resource/copilot/test.json b/resource/copilot/test.json deleted file mode 100644 index 04c46568c4..0000000000 --- a/resource/copilot/test.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "minimum_required": "v4.0", - "doc": { - "title": "Hello World", - "details": "第一份测试作业", - "requirements": "" - }, - "stage_name": "切尔诺伯格", - "opers": [ - { - "name": "能天使" - }, - { - "name": "澄闪" - }, - { - "name": "临光" - } - ], - "groups": [ - { - "name": "投降先锋", - "opers": [ - { - "name": "桃金娘", - "skill": 1, - "skill_usage": 1 - }, - { - "name": "琴柳", - "skill": 1, - "skill_usage": 1 - } - ] - } - ], - "actions": [ - { - "name": "投降先锋", - "location": [ - 8, - 4 - ], - "direction": "左" - }, - { - "name": "能天使", - "location": [ - 8, - 5 - ], - "direction": "左" - }, - { - "name": "澄闪", - "location": [ - 7, - 3 - ], - "direction": "下" - }, - { - "type": "二倍速" - }, - { - "name": "临光", - "location": [ - 7, - 4 - ], - "direction": "左" - }, - { - "kills": 25, - "type": "技能", - "name": "澄闪" - }, - { - "kills": 30, - "type": "撤退", - "name": "投降先锋" - } - ] -} diff --git a/resource/global/YoStarEN/resource/tasks.json b/resource/global/YoStarEN/resource/tasks.json index 3cb65ab38d..2c6fad5701 100644 --- a/resource/global/YoStarEN/resource/tasks.json +++ b/resource/global/YoStarEN/resource/tasks.json @@ -1,489 +1,4 @@ { - "StartButton1": { - "text": [ - "Start" - ] - }, - "PRTS2": { - "text": [ - "Takeover" - ] - }, - "VisitNextOcr": { - "text": [ - "Visit Next" - ] - }, - "VisitLimited": { - "text": [ - "limit", - "reached" - ] - }, - "NoFriends": { - "text": [ - "No friends" - ] - }, - "RecruitTags": { - "ocrReplace": [ - [ - "Starter", - "新手" - ], - [ - "Senior Operator", - "资深干员" - ], - [ - "Top Operator", - "高级资深干员" - ], - [ - "Melee", - "近战位" - ], - [ - "Ranged", - "远程位" - ], - [ - "Guard", - "近卫干员" - ], - [ - "Medic", - "医疗干员" - ], - [ - "Vanguard", - "先锋干员" - ], - [ - "Caster", - "术师干员" - ], - [ - "Sniper", - "狙击干员" - ], - [ - "Defender", - "重装干员" - ], - [ - "Supporter", - "辅助干员" - ], - [ - "Specialist", - "特种干员" - ], - [ - "Healing", - "治疗" - ], - [ - "Support", - "支援" - ], - [ - "DPS", - "输出" - ], - [ - "AoE", - "群攻" - ], - [ - "Slow", - "减速" - ], - [ - "Survival", - "生存" - ], - [ - "Defense", - "防护" - ], - [ - "Debuff", - "削弱" - ], - [ - "Shift", - "位移" - ], - [ - "Crowd-Control", - "控场" - ], - [ - "Nuker", - "爆发" - ], - [ - "Summon", - "召唤" - ], - [ - "Fast-Redeploy", - "快速复活" - ], - [ - "DP-Recovery", - "费用回复" - ], - [ - "Robot", - "支援机械" - ] - ] - }, - "Mall": { - "text": [ - "Store" - ] - }, - "CreditStoreOcr": { - "text": [ - "Credit Store" - ] - }, - "CreditShop-NoMoney": { - "text": [ - "Insufficient Credit", - "Unable to" - ] - }, - "Roguelike@StageTraderInvestSystemFull": { - "text": [ - "Storage full" - ] - }, - "Phantom@Roguelike@StageEncounterOptionUnknown": { - "templThreshold": 0.9 - }, - "BattleStageName": { - "Doc": "该任务的 ocrReplace 被所有涉及Rouge-like的English识别任务复用", - "ocrReplace": [ - [ - "A Date With Slugs", - "与虫为伴" - ], - [ - "Beast Taming", - "驯兽小屋" - ], - [ - "Gun Salute", - "礼炮小队" - ], - [ - "Accident", - "意外" - ], - [ - "The Grand Finale", - "压轴登场" - ], - [ - "Patrol Squad", - "巡逻队" - ], - [ - "Destitute Knights", - "落魄骑士" - ], - [ - "Unequal Split", - "分赃不均" - ], - [ - "Justice", - "正义" - ], - [ - "A Familiar Face", - "似曾相识" - ], - [ - "Vintage Transport", - "酒商运输队" - ], - [ - "With The Crowd", - "从众效应" - ], - [ - "Beast Fighting", - "斗兽笼" - ], - [ - "Premiere", - "首演" - ], - [ - "Reform", - "感化" - ], - [ - "Pressing Ahead", - "步步紧逼" - ], - [ - "Shrouded in Clouds", - "阴云笼罩" - ], - [ - "Fireworks Show", - "烟花秀" - ], - [ - "Unending", - "永无尽头" - ], - [ - "Traveler From Afar", - "远方来客" - ], - [ - "A Dance Together", - "共舞" - ], - [ - "Bob's Beers", - "鲍勃酒品" - ], - [ - "Drone Landing Zone", - "无人机起降库" - ], - [ - "The Red Mist", - "红雾弥漫" - ], - [ - "The Night of Ritual", - "仪式之夜" - ], - [ - "The Biting Cold", - "彻骨冰寒" - ], - [ - "Dangers Abound", - "危机四伏" - ], - [ - "Surprise Factory", - "惊喜工厂" - ], - [ - "Absurd Trickeries", - "荒唐把戏" - ], - [ - "Sarkaz Desire", - "萨卡兹的渴求" - ], - [ - "Ursus Desire", - "乌萨斯的渴求" - ], - [ - "A Date With Slugs", - "与虫为伴" - ], - [ - "Beast Taming", - "驯兽小屋" - ], - [ - "Gun Salute", - "礼炮小队" - ], - [ - "Accident", - "意外" - ], - [ - "The Grand Finale", - "压轴登场" - ], - [ - "Patrol Squad", - "巡逻队" - ], - [ - "Destitute Knights", - "落魄骑士" - ], - [ - "Unequal Split", - "分赃不均" - ], - [ - "Justice", - "正义" - ], - [ - "A Familiar Face", - "似曾相识" - ], - [ - "Vintage Transport", - "酒商运输队" - ], - [ - "With The Crowd", - "从众效应" - ], - [ - "Beast Fighting", - "斗兽笼" - ], - [ - "Premiere", - "首演" - ], - [ - "Reform", - "感化" - ], - [ - "Pressing Ahead", - "步步紧逼" - ], - [ - "Shrouded in Clouds", - "阴云笼罩" - ], - [ - "Fireworks Show", - "烟花秀" - ], - [ - "Unending", - "永无尽头" - ], - [ - "Traveler From Afar", - "远方来客" - ], - [ - "A Dance Together", - "共舞" - ], - [ - "Bob's Beers", - "鲍勃酒品" - ], - [ - "Drone Landing Zone", - "无人机起降库" - ], - [ - "The Red Mist", - "红雾弥漫" - ], - [ - "The Night of Ritual", - "仪式之夜" - ], - [ - "The Biting Cold", - "彻骨冰寒" - ], - [ - "Dangers Abound", - "危机四伏" - ], - [ - "Surprise Factory", - "惊喜工厂" - ], - [ - "Absurd Trickeries", - "荒唐把戏" - ], - [ - "Sarkaz Desire", - "萨卡兹的渴求" - ], - [ - "Ursus Desire", - "乌萨斯的渴求" - ], - [ - "Mind The Doors", - "开门请当心" - ], - [ - "Theft from Above", - "大盗当头" - ], - [ - "Terrifying Legends", - "恐怖传说" - ], - [ - "Fatal Melodies", - "悦耳杀机" - ], - [ - "A Cold Seperation", - "寒渊惜别" - ], - [ - "Crying Over Spilt Milk", - "覆水难收" - ], - [ - "Need No More", - "别无所求" - ], - [ - "Nothing Ends Well", - "诸事不顺" - ], - [ - "Disorderly Banquet", - "无序盛宴" - ], - [ - "Demonic Cage", - "邪异囚笼" - ], - [ - "This Ursus Man", - "这位乌萨斯人" - ], - [ - "Duck Lord's Play", - "鸭爵的戏剧" - ], - [ - "Duck Lord's Party", - "鸭爵的宴会" - ], - [ - "Gopnik's Fist", - "高普尼克之拳" - ], - [ - "'Knights' Duel'", - "“骑士对决”" - ] - ], - "roi": [ - 250, - 435, - 800, - 100 - ] - }, "CharsNameOcrReplace": { "Doc": "该任务的 ocrReplace 被所有涉及干员名的English Name识别任务复用", "ocrReplace": [ @@ -1761,6 +1276,590 @@ ] ] }, + "StartButton1": { + "text": [ + "Start" + ] + }, + "PRTS2": { + "text": [ + "Takeover" + ] + }, + "NoFriends": { + "text": [ + "No friends" + ] + }, + "VisitNextOcr": { + "text": [ + "Visit Next" + ] + }, + "Mall": { + "text": [ + "Store" + ] + }, + "CreditStoreOcr": { + "text": [ + "Credit Store" + ] + }, + "VisitLimited": { + "text": [ + "limit", + "reached" + ] + }, + "CreditShop-NoMoney": { + "text": [ + "Insufficient Credit", + "Unable to" + ] + }, + "RecruitTags": { + "ocrReplace": [ + [ + "Starter", + "新手" + ], + [ + "Senior Operator", + "资深干员" + ], + [ + "Top Operator", + "高级资深干员" + ], + [ + "Melee", + "近战位" + ], + [ + "Ranged", + "远程位" + ], + [ + "Guard", + "近卫干员" + ], + [ + "Medic", + "医疗干员" + ], + [ + "Vanguard", + "先锋干员" + ], + [ + "Caster", + "术师干员" + ], + [ + "Sniper", + "狙击干员" + ], + [ + "Defender", + "重装干员" + ], + [ + "Supporter", + "辅助干员" + ], + [ + "Specialist", + "特种干员" + ], + [ + "Healing", + "治疗" + ], + [ + "Support", + "支援" + ], + [ + "DPS", + "输出" + ], + [ + "AoE", + "群攻" + ], + [ + "Slow", + "减速" + ], + [ + "Survival", + "生存" + ], + [ + "Defense", + "防护" + ], + [ + "Debuff", + "削弱" + ], + [ + "Shift", + "位移" + ], + [ + "Crowd-Control", + "控场" + ], + [ + "Nuker", + "爆发" + ], + [ + "Summon", + "召唤" + ], + [ + "Fast-Redeploy", + "快速复活" + ], + [ + "DP-Recovery", + "费用回复" + ], + [ + "Robot", + "支援机械" + ] + ] + }, + "InfrastReward": { + "text": [ + "Collectable", + "Orders", + "Acquired", + "Trust" + ] + }, + "InfrastStationedInfo": { + "text": [ + "Operator" + ] + }, + "BattleStageName": { + "Doc": "该任务的 ocrReplace 被所有涉及Rouge-like的English识别任务复用", + "ocrReplace": [ + [ + "A Date With Slugs", + "与虫为伴" + ], + [ + "Beast Taming", + "驯兽小屋" + ], + [ + "Gun Salute", + "礼炮小队" + ], + [ + "Accident", + "意外" + ], + [ + "The Grand Finale", + "压轴登场" + ], + [ + "Patrol Squad", + "巡逻队" + ], + [ + "Destitute Knights", + "落魄骑士" + ], + [ + "Unequal Split", + "分赃不均" + ], + [ + "Justice", + "正义" + ], + [ + "A Familiar Face", + "似曾相识" + ], + [ + "Vintage Transport", + "酒商运输队" + ], + [ + "With The Crowd", + "从众效应" + ], + [ + "Beast Fighting", + "斗兽笼" + ], + [ + "Premiere", + "首演" + ], + [ + "Reform", + "感化" + ], + [ + "Pressing Ahead", + "步步紧逼" + ], + [ + "Shrouded in Clouds", + "阴云笼罩" + ], + [ + "Fireworks Show", + "烟花秀" + ], + [ + "Unending", + "永无尽头" + ], + [ + "Traveler From Afar", + "远方来客" + ], + [ + "A Dance Together", + "共舞" + ], + [ + "Bob's Beers", + "鲍勃酒品" + ], + [ + "Drone Landing Zone", + "无人机起降库" + ], + [ + "The Red Mist", + "红雾弥漫" + ], + [ + "The Night of Ritual", + "仪式之夜" + ], + [ + "The Biting Cold", + "彻骨冰寒" + ], + [ + "Dangers Abound", + "危机四伏" + ], + [ + "Surprise Factory", + "惊喜工厂" + ], + [ + "Absurd Trickeries", + "荒唐把戏" + ], + [ + "Sarkaz Desire", + "萨卡兹的渴求" + ], + [ + "Ursus Desire", + "乌萨斯的渴求" + ], + [ + "A Date With Slugs", + "与虫为伴" + ], + [ + "Beast Taming", + "驯兽小屋" + ], + [ + "Gun Salute", + "礼炮小队" + ], + [ + "Accident", + "意外" + ], + [ + "The Grand Finale", + "压轴登场" + ], + [ + "Patrol Squad", + "巡逻队" + ], + [ + "Destitute Knights", + "落魄骑士" + ], + [ + "Unequal Split", + "分赃不均" + ], + [ + "Justice", + "正义" + ], + [ + "A Familiar Face", + "似曾相识" + ], + [ + "Vintage Transport", + "酒商运输队" + ], + [ + "With The Crowd", + "从众效应" + ], + [ + "Beast Fighting", + "斗兽笼" + ], + [ + "Premiere", + "首演" + ], + [ + "Reform", + "感化" + ], + [ + "Pressing Ahead", + "步步紧逼" + ], + [ + "Shrouded in Clouds", + "阴云笼罩" + ], + [ + "Fireworks Show", + "烟花秀" + ], + [ + "Unending", + "永无尽头" + ], + [ + "Traveler From Afar", + "远方来客" + ], + [ + "A Dance Together", + "共舞" + ], + [ + "Bob's Beers", + "鲍勃酒品" + ], + [ + "Drone Landing Zone", + "无人机起降库" + ], + [ + "The Red Mist", + "红雾弥漫" + ], + [ + "The Night of Ritual", + "仪式之夜" + ], + [ + "The Biting Cold", + "彻骨冰寒" + ], + [ + "Dangers Abound", + "危机四伏" + ], + [ + "Surprise Factory", + "惊喜工厂" + ], + [ + "Absurd Trickeries", + "荒唐把戏" + ], + [ + "Sarkaz Desire", + "萨卡兹的渴求" + ], + [ + "Ursus Desire", + "乌萨斯的渴求" + ], + [ + "Mind The Doors", + "开门请当心" + ], + [ + "Theft from Above", + "大盗当头" + ], + [ + "Terrifying Legends", + "恐怖传说" + ], + [ + "Fatal Melodies", + "悦耳杀机" + ], + [ + "A Cold Seperation", + "寒渊惜别" + ], + [ + "Crying Over Spilt Milk", + "覆水难收" + ], + [ + "Need No More", + "别无所求" + ], + [ + "Nothing Ends Well", + "诸事不顺" + ], + [ + "Disorderly Banquet", + "无序盛宴" + ], + [ + "Demonic Cage", + "邪异囚笼" + ], + [ + "This Ursus Man", + "这位乌萨斯人" + ], + [ + "Duck Lord's Play", + "鸭爵的戏剧" + ], + [ + "Duck Lord's Party", + "鸭爵的宴会" + ], + [ + "Gopnik's Fist", + "高普尼克之拳" + ], + [ + "'Knights' Duel'", + "“骑士对决”" + ] + ], + "roi": [ + 250, + 435, + 800, + 100 + ] + }, + "StageDrops-DropType-ExpAndLMB": { + "templThreshold": 0.7 + }, + "StageDrops-DropType-Normal": { + "templThreshold": 0.7 + }, + "StageDrops-DropType-Extra": { + "templThreshold": 0.7 + }, + "StageDrops-DropType-Furniture": { + "templThreshold": 0.7 + }, + "StageDrops-DropType-Special": { + "templThreshold": 0.7 + }, + "StageDrops-DropType-Sanity": { + "templThreshold": 0.7 + }, + "StageDrops-DropType-Reward": { + "templThreshold": 0.7 + }, + "Roguelike@StageTraderInvestSystemFull": { + "text": [ + "Storage full" + ] + }, + "Phantom@Roguelike@StageEncounterOptionUnknown": { + "templThreshold": 0.9 + }, + "RoguelikeCustom-HijackCoChar": { + "ocrReplace": [ + [ + "Caster", + "术师" + ], + [ + "Medic", + "医疗" + ], + [ + "Vanguard", + "先锋" + ], + [ + "Sniper", + "狙击" + ], + [ + "Specialist", + "特种" + ], + [ + "Supporter", + "辅助" + ], + [ + "Defender", + "重装" + ], + [ + "Guard", + "近卫" + ] + ], + "preDelay": 1000 + }, + "RoguelikeCustom-HijackRoles": { + "ocrReplace": [ + [ + "As Your Heart Desires", + "随心所欲" + ], + [ + "First Move Advantage", + "先手必胜" + ], + [ + "Slow and Steady Wins", + "稳扎稳打" + ], + [ + "the Race", + "稳扎稳打" + ], + [ + "Overcoming Your", + "取长补短" + ], + [ + "Weaknesses", + "取长补短" + ] + ] + }, "RoguelikeCustom-HijackSquad": { "ocrReplace": [ [ @@ -1805,71 +1904,6 @@ ] ] }, - "RoguelikeCustom-HijackRoles": { - "ocrReplace": [ - [ - "As Your Heart Desires", - "随心所欲" - ], - [ - "First Move Advantage", - "先手必胜" - ], - [ - "Slow and Steady Wins", - "稳扎稳打" - ], - [ - "the Race", - "稳扎稳打" - ], - [ - "Overcoming Your", - "取长补短" - ], - [ - "Weaknesses", - "取长补短" - ] - ] - }, - "RoguelikeCustom-HijackCoChar": { - "ocrReplace": [ - [ - "Caster", - "术师" - ], - [ - "Medic", - "医疗" - ], - [ - "Vanguard", - "先锋" - ], - [ - "Sniper", - "狙击" - ], - [ - "Specialist", - "特种" - ], - [ - "Supporter", - "辅助" - ], - [ - "Defender", - "重装" - ], - [ - "Guard", - "近卫" - ] - ], - "preDelay": 1000 - }, "RoguelikeTraderShoppingOcr": { "ocrReplace": [ [ @@ -3001,39 +3035,5 @@ "《欢欣鼓舞》" ] ] - }, - "StageDrops-DropType-ExpAndLMB": { - "templThreshold": 0.7 - }, - "StageDrops-DropType-Normal": { - "templThreshold": 0.7 - }, - "StageDrops-DropType-Extra": { - "templThreshold": 0.7 - }, - "StageDrops-DropType-Furniture": { - "templThreshold": 0.7 - }, - "StageDrops-DropType-Special": { - "templThreshold": 0.7 - }, - "StageDrops-DropType-Sanity": { - "templThreshold": 0.7 - }, - "StageDrops-DropType-Reward": { - "templThreshold": 0.7 - }, - "InfrastReward": { - "text": [ - "Collectable", - "Orders", - "Acquired", - "Trust" - ] - }, - "InfrastStationedInfo": { - "text": [ - "Operator" - ] } -} +} \ No newline at end of file diff --git a/resource/global/YoStarJP/resource/tasks.json b/resource/global/YoStarJP/resource/tasks.json index c3038c8be8..7582034620 100644 --- a/resource/global/YoStarJP/resource/tasks.json +++ b/resource/global/YoStarJP/resource/tasks.json @@ -1,382 +1,12 @@ { - "StartButton1": { + "ClickChapter1": { "text": [ - "行動開始" + "覚醒" ] }, - "PRTS3": { + "ClickChapter2": { "text": [ - "残り配置可能数" - ] - }, - "VisitNextOcr": { - "text": [ - "次を訪問" - ] - }, - "VisitLimited": { - "text": [ - "上限", - "達しました", - "Fpは入手できません", - "再訪問の場合" - ] - }, - "NoFriends": { - "text": [ - "戦友があリませれ" - ] - }, - "StageDrops-Quantity": { - "template": "empty.png", - "templThreshold": 3, - "templThreshold_Doc": "这里用来作为字间距阈值", - "roi": [ - 62, - 90, - 46, - 22 - ], - "maskRange": [ - 200, - 255 - ] - }, - "RecruitTags": { - "ocrReplace": [ - [ - "初期", - "新手" - ], - [ - "エリート", - "资深干员" - ], - [ - "上級エリート", - "高级资深干员" - ], - [ - "近距離", - "近战位" - ], - [ - "遠距離", - "远程位" - ], - [ - "前衛タイ.*", - "近卫干员" - ], - [ - "医療タイ.*", - "医疗干员" - ], - [ - "先鋒タイ.*", - "先锋干员" - ], - [ - "術師タイ.*", - "术师干员" - ], - [ - "狙撃タイ.*", - "狙击干员" - ], - [ - "重装タイ.*", - "重装干员" - ], - [ - "補助タイ.*", - "辅助干员" - ], - [ - "特殊タイ.*", - "特种干员" - ], - [ - "治療", - "治疗" - ], - [ - "支援", - "支援" - ], - [ - "火力", - "输出" - ], - [ - "範囲攻撃", - "群攻" - ], - [ - "減速", - "减速" - ], - [ - "生存", - "生存" - ], - [ - "防御", - "防护" - ], - [ - "弱化", - "削弱" - ], - [ - "強制移動", - "位移" - ], - [ - "牽制", - "控场" - ], - [ - "爆発力", - "爆发" - ], - [ - "召喚", - "召唤" - ], - [ - "高速再配置", - "快速复活" - ], - [ - "C.+ST回復", - "费用回复" - ], - [ - "ロボット", - "支援机械" - ] - ] - }, - "Mall": { - "text": [ - "買部" - ] - }, - "CreditStoreOcr": { - "text": [ - "FP交換所" - ] - }, - "CreditShop-NoMoney": { - "text": [ - "足りません", - "FPが" - ] - }, - "BattleStageName": { - "Doc": "该任务的 ocrReplace 被所有涉及肉鴿地圖名的日文识别任务复用", - "ocrReplace": [ - [ - "猛獣小屋", - "驯兽小屋" - ], - [ - "猛歌小屋", - "驯兽小屋" - ], - [ - "猛默小屋", - "驯兽小屋" - ], - [ - "墜落事故", - "意外" - ], - [ - "ムシとー緒", - "与虫为伴" - ], - [ - "礼砲小隊", - "礼炮小队" - ], - [ - "真打ち登場", - "压轴登场" - ], - [ - "巡視隊", - "巡逻队" - ], - [ - "零落の騎士", - "落魄骑士" - ], - [ - "分け前のもつれ", - "分赃不均" - ], - [ - "正義", - "正义" - ], - [ - "デジャヴュ", - "似曾相识" - ], - [ - "酒屋の輸送隊", - "酒商运输队" - ], - [ - "パブリック・エネミー", - "从众效应" - ], - [ - "闘獣の檻", - "斗兽笼" - ], - [ - "初演", - "首演" - ], - [ - "感化", - "感化" - ], - [ - "過去からの刺客", - "步步紧逼" - ], - [ - "覆う黒雲", - "阴云笼罩" - ], - [ - "花火ショー", - "烟花秀" - ], - [ - "エンドレスチャージ", - "永无尽头" - ], - [ - "遠方からの来客", - "远方来客" - ], - [ - "ナイトフィーバー", - "共舞" - ], - [ - "ボブ酒造", - "鲍勃酒品" - ], - [ - "ドローン発着庫", - "无人机起降库" - ], - [ - "赤い霧の眠らぬ夜", - "红雾弥漫" - ], - [ - "儀式の夜", - "仪式之夜" - ], - [ - "氷の芸術", - "彻骨冰寒" - ], - [ - "ポルターガイスト", - "危机四伏" - ], - [ - "サプライズ工場", - "惊喜工厂" - ], - [ - "奈落への吶喊", - "荒唐把戏" - ], - [ - "敷居に注意を", - "开门请当心" - ], - [ - "天翔ける怪盗・劇団篇", - "大盗当头" - ], - [ - "恐怖の都市伝説", - "恐怖传说" - ], - [ - "殺戮の調べ", - "悦耳杀机" - ], - [ - "酷寒の惜別", - "寒渊惜别" - ], - [ - "戻る道なし", - "覆水难收" - ], - [ - "秩序無き盛宴", - "无序盛宴" - ], - [ - "異端の檻", - "邪异囚笼" - ], - [ - "サルカズの渇望", - "萨卡兹的渴求" - ], - [ - "ウルサスの渇望", - "乌萨斯的渴求" - ], - [ - "ウルサスの漢", - "这位乌萨斯人" - ], - [ - "サルカズの渇望", - "萨卡兹的渴求" - ], - [ - "ウルサスの渇望", - "乌萨斯的渴求" - ], - [ - "最期の願い", - "别无所求" - ], - [ - "茶番の終わり", - "诸事不顺" - ], - [ - "ダック卿のステージ", - "鸭爵的戏剧" - ], - [ - "ダック卿のパーティー", - "鸭爵的宴会" - ], - [ - "ゴプニクの挨拶", - "高普尼克之拳" - ], - [ - "「騎士の対決」", - "“骑士对决”" - ] + "幻滅" ] }, "CharsNameOcrReplace": { @@ -1724,21 +1354,57 @@ ] ] }, + "StartToWakeUp": { + "Doc": "相较国服调大roi", + "roi": [ + 480, + 450, + 320, + 60 + ] + }, + "StartUpConnectingFlag": { + "Doc": "相较国服调大roi", + "roi": [ + 0, + 635, + 550, + 85 + ] + }, + "TodaysSupplies": { + "text": [ + "本日配給" + ] + }, + "Loading": { + "text": [ + "ニューラル", + "コネクタ", + "接続中" + ], + "roi": [ + 700, + 600, + 350, + 120 + ] + }, + "StartButton1": { + "text": [ + "行動開始" + ] + }, + "PRTS3": { + "text": [ + "残り配置可能数" + ] + }, "GoLastBattle": { "text": [ "前回の参加作戦" ] }, - "ClickChapter1": { - "text": [ - "覚醒" - ] - }, - "ClickChapter2": { - "text": [ - "幻滅" - ] - }, "StartRecruit": { "text": [ "求人開始" @@ -1754,6 +1420,455 @@ "緊急招集" ] }, + "NoFriends": { + "text": [ + "戦友があリませれ" + ] + }, + "VisitNextOcr": { + "text": [ + "次を訪問" + ] + }, + "Mall": { + "text": [ + "買部" + ] + }, + "CreditStoreOcr": { + "text": [ + "FP交換所" + ] + }, + "VisitLimited": { + "text": [ + "上限", + "達しました", + "Fpは入手できません", + "再訪問の場合" + ] + }, + "CreditShop-NoMoney": { + "text": [ + "足りません", + "FPが" + ] + }, + "RecruitTags": { + "ocrReplace": [ + [ + "初期", + "新手" + ], + [ + "エリート", + "资深干员" + ], + [ + "上級エリート", + "高级资深干员" + ], + [ + "近距離", + "近战位" + ], + [ + "遠距離", + "远程位" + ], + [ + "前衛タイ.*", + "近卫干员" + ], + [ + "医療タイ.*", + "医疗干员" + ], + [ + "先鋒タイ.*", + "先锋干员" + ], + [ + "術師タイ.*", + "术师干员" + ], + [ + "狙撃タイ.*", + "狙击干员" + ], + [ + "重装タイ.*", + "重装干员" + ], + [ + "補助タイ.*", + "辅助干员" + ], + [ + "特殊タイ.*", + "特种干员" + ], + [ + "治療", + "治疗" + ], + [ + "支援", + "支援" + ], + [ + "火力", + "输出" + ], + [ + "範囲攻撃", + "群攻" + ], + [ + "減速", + "减速" + ], + [ + "生存", + "生存" + ], + [ + "防御", + "防护" + ], + [ + "弱化", + "削弱" + ], + [ + "強制移動", + "位移" + ], + [ + "牽制", + "控场" + ], + [ + "爆発力", + "爆发" + ], + [ + "召喚", + "召唤" + ], + [ + "高速再配置", + "快速复活" + ], + [ + "C.+ST回復", + "费用回复" + ], + [ + "ロボット", + "支援机械" + ] + ] + }, + "InfrastReward": { + "text": [ + "受取可", + "納品可", + "信頼獲得" + ] + }, + "InfrastStationedInfo": { + "text": [ + "配属情報" + ] + }, + "InfrastEnterOperList": { + "text": [ + "体力", + "休憩中", + "仕事中", + "配属" + ] + }, + "BattleStageName": { + "Doc": "该任务的 ocrReplace 被所有涉及肉鴿地圖名的日文识别任务复用", + "ocrReplace": [ + [ + "猛獣小屋", + "驯兽小屋" + ], + [ + "猛歌小屋", + "驯兽小屋" + ], + [ + "猛默小屋", + "驯兽小屋" + ], + [ + "墜落事故", + "意外" + ], + [ + "ムシとー緒", + "与虫为伴" + ], + [ + "礼砲小隊", + "礼炮小队" + ], + [ + "真打ち登場", + "压轴登场" + ], + [ + "巡視隊", + "巡逻队" + ], + [ + "零落の騎士", + "落魄骑士" + ], + [ + "分け前のもつれ", + "分赃不均" + ], + [ + "正義", + "正义" + ], + [ + "デジャヴュ", + "似曾相识" + ], + [ + "酒屋の輸送隊", + "酒商运输队" + ], + [ + "パブリック・エネミー", + "从众效应" + ], + [ + "闘獣の檻", + "斗兽笼" + ], + [ + "初演", + "首演" + ], + [ + "感化", + "感化" + ], + [ + "過去からの刺客", + "步步紧逼" + ], + [ + "覆う黒雲", + "阴云笼罩" + ], + [ + "花火ショー", + "烟花秀" + ], + [ + "エンドレスチャージ", + "永无尽头" + ], + [ + "遠方からの来客", + "远方来客" + ], + [ + "ナイトフィーバー", + "共舞" + ], + [ + "ボブ酒造", + "鲍勃酒品" + ], + [ + "ドローン発着庫", + "无人机起降库" + ], + [ + "赤い霧の眠らぬ夜", + "红雾弥漫" + ], + [ + "儀式の夜", + "仪式之夜" + ], + [ + "氷の芸術", + "彻骨冰寒" + ], + [ + "ポルターガイスト", + "危机四伏" + ], + [ + "サプライズ工場", + "惊喜工厂" + ], + [ + "奈落への吶喊", + "荒唐把戏" + ], + [ + "敷居に注意を", + "开门请当心" + ], + [ + "天翔ける怪盗・劇団篇", + "大盗当头" + ], + [ + "恐怖の都市伝説", + "恐怖传说" + ], + [ + "殺戮の調べ", + "悦耳杀机" + ], + [ + "酷寒の惜別", + "寒渊惜别" + ], + [ + "戻る道なし", + "覆水难收" + ], + [ + "秩序無き盛宴", + "无序盛宴" + ], + [ + "異端の檻", + "邪异囚笼" + ], + [ + "サルカズの渇望", + "萨卡兹的渴求" + ], + [ + "ウルサスの渇望", + "乌萨斯的渴求" + ], + [ + "ウルサスの漢", + "这位乌萨斯人" + ], + [ + "サルカズの渇望", + "萨卡兹的渴求" + ], + [ + "ウルサスの渇望", + "乌萨斯的渴求" + ], + [ + "最期の願い", + "别无所求" + ], + [ + "茶番の終わり", + "诸事不顺" + ], + [ + "ダック卿のステージ", + "鸭爵的戏剧" + ], + [ + "ダック卿のパーティー", + "鸭爵的宴会" + ], + [ + "ゴプニクの挨拶", + "高普尼克之拳" + ], + [ + "「騎士の対決」", + "“骑士对决”" + ] + ] + }, + "StageDrops-Quantity": { + "template": "empty.png", + "templThreshold": 6, + "templThreshold_Doc": "这里用来作为字间距阈值", + "roi": [ + 62, + 90, + 46, + 22 + ], + "maskRange": [ + 200, + 255 + ] + }, + "Phantom@Roguelike@StageEncounterOptionUnknown": { + "templThreshold": 0.9 + }, + "RoguelikeCustom-HijackCoChar": { + "ocrReplace": [ + [ + "術師", + "术师" + ], + [ + "医療", + "医疗" + ], + [ + "先鋒", + "先锋" + ], + [ + "狙撃", + "狙击" + ], + [ + "特殊", + "特种" + ], + [ + "補助", + "辅助" + ], + [ + "重装", + "重装" + ], + [ + "前衛", + "近卫" + ] + ] + }, + "RoguelikeCustom-HijackRoles": { + "ocrReplace": [ + [ + "自由自在", + "随心所欲" + ], + [ + "先手必勝", + "先手必胜" + ], + [ + "攻守一体", + "稳扎稳打" + ], + [ + "前線支援", + "取长补短" + ] + ] + }, "RoguelikeCustom-HijackSquad": { "ocrReplace": [ [ @@ -1798,62 +1913,6 @@ ] ] }, - "RoguelikeCustom-HijackRoles": { - "ocrReplace": [ - [ - "自由自在", - "随心所欲" - ], - [ - "先手必勝", - "先手必胜" - ], - [ - "攻守一体", - "稳扎稳打" - ], - [ - "前線支援", - "取长补短" - ] - ] - }, - "RoguelikeCustom-HijackCoChar": { - "ocrReplace": [ - [ - "術師", - "术师" - ], - [ - "医療", - "医疗" - ], - [ - "先鋒", - "先锋" - ], - [ - "狙撃", - "狙击" - ], - [ - "特殊", - "特种" - ], - [ - "補助", - "辅助" - ], - [ - "重装", - "重装" - ], - [ - "前衛", - "近卫" - ] - ] - }, "RoguelikeRecruitLevel": { "Doc": "日服的等级字体比国服大一圈,要改roi", "rectMove": [ @@ -2990,34 +3049,5 @@ "《欢欣鼓舞》" ] ] - }, - "InfrastReward": { - "text": [ - "受取可", - "納品可", - "信頼獲得" - ] - }, - "InfrastStationedInfo": { - "text": [ - "配属情報" - ] - }, - "InfrastEnterOperList": { - "text": [ - "体力", - "休憩中", - "仕事中", - "配属" - ] - }, - "StartToWakeUp": { - "Doc": "相较国服调大roi", - "roi": [ - 480, - 450, - 320, - 60 - ] } -} +} \ No newline at end of file diff --git a/resource/global/YoStarKR/readme.md b/resource/global/YoStarKR/readme.md index 6c97fcff76..c207fe41fe 100644 --- a/resource/global/YoStarKR/readme.md +++ b/resource/global/YoStarKR/readme.md @@ -22,13 +22,13 @@ Now supports: - Restore with Originite - Set the max number of auto battles -## 한국인 +## 한국 서버 -'설정' - '시작 설정' - '클라이언트 버전'으로 이동하여 'YoStarKR'을 선택하세요. +`설정` - `시작 설정` - `클라이언트 버전`으로 이동하여 `요스타 KR`을 선택하세요. -이제 다음을 지원합니다. +현재 다음과 같은 기능을 지원합니다. -- 자동 전투('현재 단계' 선택만 지원) -- 물약으로 회복 -- Originite로 복원 +- 자동 전투(`현재` 스테이지 선택만 지원) +- 이성 회복제로 이성 회복 +- 순오리지늄으로 이성 회복 - 최대 자동 전투 횟수 설정 diff --git a/resource/global/YoStarKR/resource/tasks.json b/resource/global/YoStarKR/resource/tasks.json index 79cee883e7..37c7f8862c 100644 --- a/resource/global/YoStarKR/resource/tasks.json +++ b/resource/global/YoStarKR/resource/tasks.json @@ -1,4 +1,1481 @@ { + "ClickChapter1": { + "text": [ + "각성" + ] + }, + "ClickChapter2": { + "text": [ + "환멸" + ] + }, + "ClickChapter3": { + "text": [ + "석양" + ] + }, + "CharsNameOcrReplace": { + "Doc": "该任务的ocrReplace被所有涉及干员名的日文识别任务复用", + "ocrReplace": [ + [ + "실버애쉬", + "银灰" + ], + [ + "블레이즈", + "煌" + ], + [ + "수르트", + "史尔特尔" + ], + [ + "^첸$", + "陈" + ], + [ + "쏜즈", + "棘刺" + ], + [ + "쓴즈", + "棘刺" + ], + [ + "쓴츠", + "棘刺" + ], + [ + "쓴不", + "棘刺" + ], + [ + "쏟즈", + "棘刺" + ], + [ + "^스펙터$", + "幽灵鲨" + ], + [ + "^스페터$", + "幽灵鲨" + ], + [ + "니어더래디언트나이트", + "耀骑士临光" + ], + [ + "라플란드", + "拉普兰德" + ], + [ + "인드라", + "因陀罗" + ], + [ + "아미야", + "阿米娅" + ], + [ + "브로카", + "布洛卡" + ], + [ + "새비지", + "暴行" + ], + [ + "바이비크", + "柏喙" + ], + [ + "프란카", + "芙兰卡" + ], + [ + "시데로카", + "铸铁" + ], + [ + "스와이어", + "诗怀雅" + ], + [ + "위슬래시", + "鞭刃" + ], + [ + "아카후유", + "赤冬" + ], + [ + "플레임브링어", + "炎客" + ], + [ + "멜란사", + "玫兰莎" + ], + [ + "도베르만", + "杜宾" + ], + [ + "마토이마루", + "缠丸" + ], + [ + "프로스트리프", + "霜叶" + ], + [ + "에스텔", + "艾丝黛尔" + ], + [ + "헬라그", + "赫拉格" + ], + [ + "팔라스", + "帕拉斯" + ], + [ + "마운틴", + "山" + ], + [ + "^스카디$", + "斯卡蒂" + ], + [ + "에이어스카르페", + "断崖" + ], + [ + "테킬라", + "龙舌兰" + ], + [ + "플린트", + "燧石" + ], + [ + "아스테시아", + "星极" + ], + [ + "라플루마", + "羽毛笔" + ], + [ + "Tachanka", + "战车" + ], + [ + "컨빅션", + "断罪者" + ], + [ + "컨백션", + "断罪者" + ], + [ + "아렌", + "芳汀" + ], + [ + "재키", + "杰克" + ], + [ + "커터", + "刻刀" + ], + [ + "비헌터", + "猎蜂" + ], + [ + "무스", + "慕斯" + ], + [ + "우타게", + "宴" + ], + [ + "포푸카", + "泡普卡" + ], + [ + "미드나이트", + "月见夜" + ], + [ + "예비인원근거리", + "预备干员近战" + ], + [ + "안젤리나", + "安洁莉娜" + ], + [ + "소라", + "空" + ], + [ + "스카디더커럽팅하트", + "浊心斯卡蒂" + ], + [ + "스카디더커럽팀하트", + "浊心斯卡蒂" + ], + [ + "프카디더커럽팀하트", + "浊心斯卡蒂" + ], + [ + "링", + "令" + ], + [ + "씬", + "稀音" + ], + [ + "스즈란", + "铃兰" + ], + [ + "메이어", + "梅尔" + ], + [ + "마젤란", + "麦哲伦" + ], + [ + "프라마닉스", + "初雪" + ], + [ + "프라마늬스", + "初雪" + ], + [ + "노시스", + "灵知" + ], + [ + "글라우쿠스", + "格劳克斯" + ], + [ + "샤마르", + "巫恋" + ], + [ + "츠키노기", + "月禾" + ], + [ + "이스티나", + "真理" + ], + [ + "포덴코", + "波登可" + ], + [ + "포넨코", + "波登可" + ], + [ + "어스스피릿", + "地灵" + ], + [ + "로베르타", + "罗比菈塔" + ], + [ + "딥컬러", + "深海色" + ], + [ + "덥컬러", + "深海色" + ], + [ + "오키드", + "梓兰" + ], + [ + "예비인원캐스터", + "预备干员术师" + ], + [ + "^히비스커스$", + "芙蓉" + ], + [ + "안셀", + "安赛尔" + ], + [ + "미르", + "末药" + ], + [ + "^가비알$", + "嘉维尔" + ], + [ + "퍼퓨머", + "调香师" + ], + [ + "퍼퓨며", + "调香师" + ], + [ + "프틸롭시스", + "白面鸮" + ], + [ + "사일런스", + "赫默" + ], + [ + "와파린", + "华法琳" + ], + [ + "샤이닝", + "闪灵" + ], + [ + "나이팅게일", + "夜莺" + ], + [ + "수수로", + "苏苏洛" + ], + [ + "실론", + "锡兰" + ], + [ + "브리즈", + "微风" + ], + [ + "폴리닉", + "亚叶" + ], + [ + "퓨어스트림", + "清流" + ], + [ + "위스퍼레인", + "絮雨" + ], + [ + "투예", + "图耶" + ], + [ + "켈시", + "凯尔希" + ], + [ + "멀베리", + "桑葚" + ], + [ + "허니베리", + "蜜莓" + ], + [ + "예비인원지원", + "预备干员后勤" + ], + [ + "예비인원'지원", + "预备干员后勤" + ], + [ + "플레임테일", + "焰尾" + ], + [ + "와일드메인", + "野鬃" + ], + [ + "사일라흐", + "琴柳" + ], + [ + "사가", + "嵯峨" + ], + [ + "빈스토크", + "豆苗" + ], + [ + "키아베", + "贾维" + ], + [ + "엘리시움", + "极境" + ], + [ + "백파이프", + "风笛" + ], + [ + "리드", + "苇草" + ], + [ + "머틀", + "桃金娘" + ], + [ + "머를", + "桃金娘" + ], + [ + "그라니", + "格拉尼" + ], + [ + "시즈", + "推进之王" + ], + [ + "텍사스", + "德克萨斯" + ], + [ + "지마", + "凛冬" + ], + [ + "비그나", + "红豆" + ], + [ + "스캐빈저", + "清道夫" + ], + [ + "쿠리어", + "讯使" + ], + [ + "플룸", + "翎羽" + ], + [ + "바닐라", + "香草" + ], + [ + "팽", + "芬" + ], + [ + "야토", + "夜刀" + ], + [ + "저스티스나이트", + "正义骑士号" + ], + [ + "파투스", + "远牙" + ], + [ + "첸더홀룽데이", + "假日威龙陈" + ], + [ + "첸더홀룬데이", + "假日威龙陈" + ], + [ + "토디폰스", + "熔泉" + ], + [ + "Ash", + "灰烬" + ], + [ + "아르케토", + "空弦" + ], + [ + "파인콘", + "松果" + ], + [ + "로즈몬티스", + "迷迭香" + ], + [ + "아오스타", + "奥斯塔" + ], + [ + "에이프릴", + "四月" + ], + [ + "애시드드롭", + "酸糖" + ], + [ + "안드레아나", + "安哲拉" + ], + [ + "로사", + "早露" + ], + [ + "세사", + "慑砂" + ], + [ + "그레이스롯", + "灰喉" + ], + [ + "엠브리엘", + "安比尔" + ], + [ + "^메이$", + "梅" + ], + [ + "이그제큐터", + "送葬人" + ], + [ + "버메일", + "红云" + ], + [ + "슈바르츠", + "黑" + ], + [ + "캐터펄트", + "空爆" + ], + [ + "엑시아", + "能天使" + ], + [ + "멕시아", + "能天使" + ], + [ + "파이어워치", + "守林人" + ], + [ + "프로방스", + "普罗旺斯" + ], + [ + "메테오라이트", + "陨星" + ], + [ + "플래티넘", + "白金" + ], + [ + "플래티념", + "白金" + ], + [ + "블루포이즌", + "蓝毒" + ], + [ + "블루포이존", + "蓝毒" + ], + [ + "시라유키", + "白雪" + ], + [ + "메테오", + "流星" + ], + [ + "제시카", + "杰西卡" + ], + [ + "아드나키엘", + "安德切尔" + ], + [ + "^크루스$", + "克洛丝" + ], + [ + "레인저", + "巡林者" + ], + [ + "예비인원스나이퍼", + "预备干员狙击" + ], + [ + "예비인원스나이프", + "预备干员狙击" + ], + [ + "샬렘", + "暮落" + ], + [ + "슬렘", + "暮落" + ], + [ + "오로라", + "极光" + ], + [ + "애쉬락", + "灰毫" + ], + [ + "헤비레인", + "暴雨" + ], + [ + "Blitz", + "闪击" + ], + [ + "머드락", + "泥岩" + ], + [ + "블레미샤인", + "瑕光" + ], + [ + "버블", + "泡泡" + ], + [ + "유넥티스", + "森蚺" + ], + [ + "유섹티스", + "森蚺" + ], + [ + "아스베스토스", + "石棉" + ], + [ + "니엔", + "年" + ], + [ + "훔", + "吽" + ], + [ + "바이슨", + "拜松" + ], + [ + "듀나", + "坚雷" + ], + [ + "스팟", + "斑点" + ], + [ + "스팠", + "斑点" + ], + [ + "사리아", + "塞雷娅" + ], + [ + "호시구마", + "星熊" + ], + [ + "벌컨", + "火神" + ], + [ + "크루아상", + "可颂" + ], + [ + "리스캄", + "雷蛇" + ], + [ + "^니어$", + "临光" + ], + [ + "굼", + "古米" + ], + [ + "쿠오라", + "蛇屠箱" + ], + [ + "마터호른", + "角峰" + ], + [ + "비글", + "米格鲁" + ], + [ + "카디건", + "卡缇" + ], + [ + "느와르코르네", + "黑角" + ], + [ + "쉐라", + "耶拉" + ], + [ + "코로세럼", + "蚀清" + ], + [ + "푸딩", + "布丁" + ], + [ + "푸딪", + "布丁" + ], + [ + "카넬리안", + "卡涅利安" + ], + [ + "카엘리안", + "卡涅利安" + ], + [ + "인디고", + "深靛" + ], + [ + "패신저", + "异客" + ], + [ + "^시$", + "夕" + ], + [ + "라바더퍼거토리", + "炎狱炎熔" + ], + [ + "아이리스", + "爱丽丝" + ], + [ + "민트", + "薄绿" + ], + [ + "토미미", + "特米米" + ], + [ + "비즈왁스", + "蜜蜡" + ], + [ + "비즈확스", + "蜜蜡" + ], + [ + "비즈옥스", + "蜜蜡" + ], + [ + "클릭", + "卡达" + ], + [ + "클릴", + "卡达" + ], + [ + "레온하르트", + "莱恩哈特" + ], + [ + "압생트", + "苦艾" + ], + [ + "케오베", + "刻俄柏" + ], + [ + "^레이즈$", + "惊蛰" + ], + [ + "모스티마", + "莫斯提马" + ], + [ + "^그레이$", + "格雷伊" + ], + [ + "나이트메어", + "夜魔" + ], + [ + "에이야퍄들라", + "艾雅法拉" + ], + [ + "메이야퍄들라", + "艾雅法拉" + ], + [ + "메이야프들라", + "艾雅法拉" + ], + [ + "에이야프들라", + "艾雅法拉" + ], + [ + "이프리트", + "伊芙利特" + ], + [ + "스카이파이어", + "天火" + ], + [ + "기타노", + "远山" + ], + [ + "헤이즈", + "夜烟" + ], + [ + "스튜어드", + "史都华德" + ], + [ + "^라바$", + "炎熔" + ], + [ + "두린", + "杜林" + ], + [ + "미즈키", + "水月" + ], + [ + "키라라", + "绮良" + ], + [ + "베나", + "贝娜" + ], + [ + "글래디아", + "歌蕾蒂娅" + ], + [ + "Frost", + "霜华" + ], + [ + "우요우", + "乌有" + ], + [ + "카프카", + "卡夫卡" + ], + [ + "로빈", + "罗宾" + ], + [ + "제이", + "孑" + ], + [ + "위디", + "温蒂" + ], + [ + "팬텀", + "傀影" + ], + [ + "팬럼", + "傀影" + ], + [ + "^아$", + "阿" + ], + [ + "스노우상트", + "雪雉" + ], + [ + "와이후", + "槐琥" + ], + [ + "에단", + "伊桑" + ], + [ + "에프이터", + "食铁兽" + ], + [ + "맨티코어", + "狮蝎" + ], + [ + "클리프하트", + "崖心" + ], + [ + "레드", + "红" + ], + [ + "쇼", + "阿消" + ], + [ + "로프", + "暗索" + ], + [ + "그라벨", + "砾" + ], + [ + "봉인된지면", + "封印的地面" + ], + [ + "카제마루", + "风丸" + ], + [ + "에너지중합체", + "能量聚合体" + ], + [ + "'호스트어시스턴트'", + "“报幕助手”" + ], + [ + "호스트어시스턴트", + "“报幕助手”" + ], + [ + "스노우상트의안전한크레인", + "雪雉的安全起重机" + ], + [ + "피아메타", + "菲亚梅塔" + ], + [ + "수식방지코팅장치", + "防水蚀镀膜装置" + ], + [ + "스카디의시본", + "斯卡蒂的海嗣" + ], + [ + "전장의폐허", + "战场废墟" + ], + [ + "드래곤플라이.L", + "龙腾.L" + ], + [ + "드래곤플라이L", + "龙腾.L" + ], + [ + "'칭핑'", + "“清平”" + ], + [ + "칭핑", + "“清平”" + ], + [ + "오리지늄제단", + "源石祭坛" + ], + [ + "메딕프로브", + "医疗探机" + ], + [ + "엠퍼러", + "大帝" + ], + [ + "체스트넛", + "褐果" + ], + [ + "드론공장", + "无人机工厂" + ], + [ + "게이트", + "闸门" + ], + [ + "^리$", + "老鲤" + ], + [ + "블랙나이트", + "夜半" + ], + [ + "퀘르쿠스", + "夏栎" + ], + [ + "궤르쿠스", + "夏栎" + ], + [ + "케르쿠스", + "夏栎" + ], + [ + "탐지기", + "侦测器" + ], + [ + "지휘단말기", + "指挥终端" + ], + [ + "돌무더기", + "碎石" + ], + [ + "고에너지오리지늄폭탄", + "高能源石炸弹" + ], + [ + "크루스더킨글린트", + "寒芒克洛丝" + ], + [ + "저주인형", + "诅咒娃娃" + ], + [ + "로도스아일랜드임시직원", + "罗德岛临时雇员" + ], + [ + "이동식전술격납고", + "可移动战术机库" + ], + [ + "락락", + "洛洛" + ], + [ + "거울속의환영", + "镜中虚影" + ], + [ + "도로장애물", + "道路障碍物" + ], + [ + "아이린", + "艾丽妮" + ], + [ + "'클립'", + "\"夹子\"" + ], + [ + "클립", + "\"夹子\"" + ], + [ + "메탈크랩호위대", + "磐蟹护卫队" + ], + [ + "'작은즈자이'", + "\"小自在\"" + ], + [ + "작은즈자이", + "\"小自在\"" + ], + [ + "휴대용가스통", + "便携气罐" + ], + [ + "미에슈코코일", + "梅什科线圈" + ], + [ + "종이인형", + "纸偶" + ], + [ + "슬럼버풋", + "眠兽" + ], + [ + "방해장치", + "干扰装置" + ], + [ + "윈드플릿", + "掠风" + ], + [ + "원드플릿", + "掠风" + ], + [ + "하이디", + "海蒂" + ], + [ + "L44'축음기'", + "L44\"留声机\"" + ], + [ + "L44축음기", + "L44\"留声机\"" + ], + [ + "즈다이", + "子代" + ], + [ + "인포서", + "见行者" + ], + [ + "성도의손", + "圣徒之手" + ], + [ + "안정적인배터리", + "可靠电池" + ], + [ + "강화재", + "加固装置" + ], + [ + "골든글로우", + "澄闪" + ], + [ + "주인없는재화", + "无主的财富" + ], + [ + "스펙터디언체인드", + "归溟幽灵鲨" + ], + [ + "스페터디먼셰인드", + "归溟幽灵鲨" + ], + [ + "스페터디언체인다", + "归溟幽灵鲨" + ], + [ + "스페터디먼체인드", + "归溟幽灵鲨" + ], + [ + "루멘", + "流明" + ], + [ + "프로스트노바의오리지늄얼음결정", + "霜星的源石冰晶" + ], + [ + "미스터럼블", + "轰隆隆先生" + ], + [ + "^혼$", + "号角" + ], + [ + "사막의오벨리스크", + "沙之碑" + ], + [ + "기계수달", + "机械水獭" + ], + [ + "드래곤플라이.F", + "龙腾.F" + ], + [ + "드래곤플라이F", + "龙腾.F" + ], + [ + "드래곤플라이.A", + "龙腾.A" + ], + [ + "드래곤플라이A", + "龙腾.A" + ], + [ + "적방향", + "此面向敌" + ], + [ + "공학용저수포", + "工程蓄水炮" + ], + [ + "이동촬영기", + "移动摄影器" + ], + [ + "로즈몬티스의전술장비", + "迷迭香的战术装备" + ], + [ + "전술함정", + "迎宾踏垫" + ], + [ + "전자동스타일러", + "全自动造型仪" + ], + [ + "특제수상플랫폼", + "特制水上平台" + ], + [ + "'눈부신태양'", + "“耀阳”" + ], + [ + "눈부신태양", + "“耀阳”" + ], + [ + "'샤오야오'", + "“逍遥”" + ], + [ + "샤오야오", + "“逍遥”" + ], + [ + "'시엔징'", + "“弦惊”" + ], + [ + "시엔징", + "“弦惊”" + ], + [ + "장애물", + "障碍物" + ], + [ + "^연$", + "风筝" + ], + [ + "충격장치", + "震撼装置" + ], + [ + "발리스타", + "弩炮" + ], + [ + "휴대용보급기", + "便携式补给站" + ], + [ + "오리지늄얼음결정", + "源石冰晶" + ], + [ + "방해지뢰", + "干扰地雷" + ], + [ + "오리지늄기류발생장치", + "源石流发生装置" + ], + [ + "거대버섯", + "巨蕈" + ], + [ + "패트리어트의오리지늄제단", + "爱国者的源石祭坛" + ], + [ + "방패병", + "盾卫" + ], + [ + "구속장치", + "禁锢装置" + ], + [ + "개량형양자폭죽", + "改良型二踢脚" + ], + [ + "펄스방어모듈", + "脉冲防御模组" + ], + [ + "최루가스제어밸브", + "催泪瓦斯控制阀" + ], + [ + "토석구조물", + "土石结构" + ], + [ + "모래폭풍", + "沙尘暴" + ], + [ + "응급처치시설", + "应急救治设施" + ], + [ + "밀물제어장치", + "涨潮控制" + ], + [ + "망가진기둥", + "破碎支柱" + ], + [ + "시티네온", + "城市霓虹" + ], + [ + "기사훈장", + "骑士之徽" + ], + [ + "눈보라", + "暴风雪" + ], + [ + "고장난포그머신", + "失修舞台雾机" + ], + [ + "'젤라토머신'", + "“冰淇淋机”" + ], + [ + "젤라토머신", + "“冰淇淋机”" + ], + [ + "런디니움수성부포", + "伦蒂尼姆城防副炮" + ], + [ + "나인컬러드디어", + "九色鹿" + ] + ] + }, + "StartToWakeUp": { + "Doc": "相较国服调大roi", + "roi": [ + 540, + 480, + 192, + 56 + ] + }, "StartButton1": { "text": [ "작전개시" @@ -9,5 +1486,2083 @@ "배치가능", "인원" ] + }, + "GoLastBattle": { + "text": [ + "지난", + "지난작전", + "바로가기", + "바로가고", + "바로가가" + ] + }, + "StartRecruit": { + "text": [ + "개시" + ] + }, + "RecruitFlag": { + "text": [ + "공개모집" + ] + }, + "RecruitNow": { + "text": [ + "즉시모집", + "측시모집", + "즉시" + ] + }, + "VisitNextOcr": { + "text": [ + "다음", + "방문" + ] + }, + "Mall": { + "text": [ + "구매센터" + ] + }, + "CreditStoreOcr": { + "text": [ + "크레딧", + "크레딪", + "크레딜" + ] + }, + "RecruitTags": { + "ocrReplace": [ + [ + "신입", + "新手" + ], + [ + "^특별채용$", + "资深干员" + ], + [ + "^특별 채용$", + "资深干员" + ], + [ + "고급특별채용", + "高级资深干员" + ], + [ + "고급 특별 채용", + "高级资深干员" + ], + [ + "근거리", + "近战位" + ], + [ + "원거리", + "远程位" + ], + [ + "^가드$", + "近卫干员" + ], + [ + "메딕", + "医疗干员" + ], + [ + "뱅가드", + "先锋干员" + ], + [ + "캐스터", + "术师干员" + ], + [ + "스나이퍼", + "狙击干员" + ], + [ + "디펜더", + "重装干员" + ], + [ + "서포터", + "辅助干员" + ], + [ + "스페셜리스트", + "特种干员" + ], + [ + "힐링", + "治疗" + ], + [ + "지원", + "支援" + ], + [ + "딜러", + "输出" + ], + [ + "범위공격", + "群攻" + ], + [ + "감속", + "减速" + ], + [ + "생존형", + "生存" + ], + [ + "방어형", + "防护" + ], + [ + "디버프", + "削弱" + ], + [ + "강제이동", + "位移" + ], + [ + "제어형", + "控场" + ], + [ + "누커", + "爆发" + ], + [ + "소환", + "召唤" + ], + [ + "쾌속부활", + "快速复活" + ], + [ + "코스트", + "费用回复" + ], + [ + "로봇", + "支援机械" + ], + [ + "로못", + "支援机械" + ], + [ + "^가도$", + "近卫干员" + ], + [ + "^가든$", + "近卫干员" + ], + [ + "메닥", + "医疗干员" + ], + [ + "메딜", + "医疗干员" + ], + [ + "메닉", + "医疗干员" + ], + [ + "스냐이퍼", + "狙击干员" + ], + [ + "뱅가도", + "先锋干员" + ], + [ + "뱅가든", + "先锋干员" + ], + [ + "스페설리스트", + "特种干员" + ] + ] + }, + "InfrastReward": { + "text": [ + "획득가능", + "오더납품", + "획득", + "납품", + "오퍼레이터", + "신뢰도", + "모퍼레미터", + "센뢰도" + ] + }, + "BattleStageName": { + "Doc": "该任务的ocrReplace被所有涉及肉鴿地圖名的日文识别任务复用", + "ocrReplace": [ + [ + "원석충과함께", + "与虫为伴" + ], + [ + "사육장", + "驯兽小屋" + ], + [ + "예포소대盤", + "礼炮小队" + ], + [ + "예포소대", + "礼炮小队" + ], + [ + "사고", + "意外" + ], + [ + "피날레", + "压轴登场" + ], + [ + "순찰대", + "巡逻队" + ], + [ + "몰락한기사", + "落魄骑士" + ], + [ + "장물분쟁", + "分赃不均" + ], + [ + "정의", + "正义" + ], + [ + "데자뷔", + "似曾相识" + ], + [ + "맥주수송대", + "酒商运输队" + ], + [ + "군중심리", + "从众效应" + ], + [ + "콜로세움", + "斗兽笼" + ], + [ + "첫공연", + "首演" + ], + [ + "감화", + "感化" + ], + [ + "죄여오는숨통", + "步步紧逼" + ], + [ + "먹구름", + "阴云笼罩" + ], + [ + "불꽃놀이", + "烟花秀" + ], + [ + "끝없는질주", + "永无尽头" + ], + [ + "멀리서온손님", + "远方来客" + ], + [ + "댄스파티", + "共舞" + ], + [ + "빅밥의맥주", + "鲍勃酒品" + ], + [ + "드론이착륙격납고", + "无人机起降库" + ], + [ + "붉은안개", + "红雾弥漫" + ], + [ + "의식의밤", + "仪式之夜" + ], + [ + "뼈가시릴만큼", + "彻骨冰寒" + ], + [ + "사면초가", + "危机四伏" + ], + [ + "서프라이즈팩토리", + "惊喜工厂" + ], + [ + "황당한속임수", + "荒唐把戏" + ], + [ + "문조심", + "开门请当心" + ], + [ + "하늘나는괴도", + "大盗当头" + ], + [ + "공포의전설", + "恐怖传说" + ], + [ + "청아한살의", + "悦耳杀机" + ], + [ + "한이서린이별", + "寒渊惜别" + ], + [ + "엎지른물", + "覆水难收" + ], + [ + "사악한우리", + "邪异囚笼" + ], + [ + "혼돈의파티", + "无序盛宴" + ], + [ + "살카즈의갈망", + "萨卡兹的渴求" + ], + [ + "우르수스의갈망", + "乌萨斯的渴求" + ], + [ + "어떤우르수스인", + "这位乌萨斯人" + ], + [ + "살카즈의갈망", + "萨卡兹的渴求" + ], + [ + "우르수스의갈망", + "乌萨斯的渴求" + ], + [ + "마지막소원", + "别无所求" + ], + [ + "산넘어산", + "诸事不顺" + ], + [ + "덕로드의무대", + "鸭爵的戏剧" + ], + [ + "덕로드의연회", + "鸭爵的宴会" + ], + [ + "고프닉의주먹", + "高普尼克之拳" + ], + [ + "'기사결투'", + "“骑士对决”" + ], + [ + "기사결투", + "“骑士对决”" + ] + ] + }, + "RoguelikeRecruitLevel": { + "Doc": "日服的等级字体比国服大一圈,要改roi", + "rectMove": [ + -172, + -1, + 18, + 12 + ] + }, + "RoguelikeTraderShoppingOcr": { + "ocrReplace": [ + [ + "목표HP", + "目标生命" + ], + [ + "오리지늄각뿔", + "源石锭" + ], + [ + "희망", + "希望" + ], + [ + "편성가능인원수", + "可携带干员数" + ], + [ + "지휘경험치", + "指挥经验" + ], + [ + "뱅가드모집권", + "先锋招募券" + ], + [ + "^가드모집권$", + "近卫招募券" + ], + [ + "디펜더모집권", + "重装招募券" + ], + [ + "스나이퍼모집권", + "狙击招募券" + ], + [ + "캐스터모집권", + "术师招募券" + ], + [ + "서포터모집권", + "辅助招募券" + ], + [ + "메딕모집권", + "医疗招募券" + ], + [ + "메틱모집권", + "医疗招募券" + ], + [ + "메되모집권", + "医疗招募券" + ], + [ + "스페셜리스트모집권", + "特种招募券" + ], + [ + "고급뱅가드모집권", + "高级先锋招募券" + ], + [ + "고급가드모집권", + "高级近卫招募券" + ], + [ + "고급디펜더모집권", + "高级重装招募券" + ], + [ + "고급스나이퍼모집권", + "高级狙击招募券" + ], + [ + "고급캐스터모집권", + "高级术师招募券" + ], + [ + "고급서포터모집권", + "高级辅助招募券" + ], + [ + "고급메딕모집권", + "高级医疗招募券" + ], + [ + "고급스페셜리스트모집권", + "高级特种招募券" + ], + [ + "돌격협의모집권", + "突击协议招募券" + ], + [ + "방어협의모집권", + "堡垒协议招募券" + ], + [ + "원거리협의모집권", + "远程协议招募券" + ], + [ + "파괴협의모집권", + "破坏协议招募券" + ], + [ + "전선통합모집권", + "前线统合招募券" + ], + [ + "후방협조모집권", + "后方协调招募券" + ], + [ + "뱅가드모집귄", + "先锋招募券" + ], + [ + "^가드모집귄$", + "近卫招募券" + ], + [ + "디펜더모집귄", + "重装招募券" + ], + [ + "스나이퍼모집귄", + "狙击招募券" + ], + [ + "캐스터모집귄", + "术师招募券" + ], + [ + "서포터모집귄", + "辅助招募券" + ], + [ + "메딕모집귄", + "医疗招募券" + ], + [ + "스페셜리스트모집귄", + "特种招募券" + ], + [ + "고급뱅가드모집귄", + "高级先锋招募券" + ], + [ + "고급가드모집귄", + "高级近卫招募券" + ], + [ + "고급디펜더모집귄", + "高级重装招募券" + ], + [ + "고급스나이퍼모집귄", + "高级狙击招募券" + ], + [ + "고급캐스터모집귄", + "高级术师招募券" + ], + [ + "고급서포터모집귄", + "高级辅助招募券" + ], + [ + "고급메딕모집귄", + "高级医疗招募券" + ], + [ + "고급스페셜리스트모집귄", + "高级特种招募券" + ], + [ + "돌격협의모집귄", + "突击协议招募券" + ], + [ + "방어협의모집귄", + "堡垒协议招募券" + ], + [ + "원거리협의모집귄", + "远程协议招募券" + ], + [ + "파괴협의모집귄", + "破坏协议招募券" + ], + [ + "전선통합모집귄", + "前线统合招募券" + ], + [ + "후방협조모집귄", + "后方协调招募券" + ], + [ + "고급인사배치서한", + "高级人事调度函" + ], + [ + "인사배치서한", + "人事调度函" + ], + [ + "특별인사배치서한", + "特别人事调度函" + ], + [ + "전선통합특별모집권", + "前线统合资深招募券" + ], + [ + "후방협조특별모집권", + "后方协调资深招募券" + ], + [ + "고급인사특별모집권", + "高级人事资深招募券" + ], + [ + "전선통합특별모집귄", + "前线统合资深招募券" + ], + [ + "후방협조특별모집귄", + "后方协调资深招募券" + ], + [ + "고급인사특별모집귄", + "高级人事资深招募券" + ], + [ + "고급물자배급권", + "高级物资配给券" + ], + [ + "임시물자배급권", + "临时物资配给券" + ], + [ + "뱅가드랭크상승권", + "先锋进阶券" + ], + [ + "가드랭크상승권", + "近卫进阶券" + ], + [ + "디펜더랭크상승권", + "重装进阶券" + ], + [ + "스나이퍼랭크상승권", + "狙击进阶券" + ], + [ + "캐스터랭크상승권", + "术师进阶券" + ], + [ + "서포터랭크상승권", + "辅助进阶券" + ], + [ + "메딕랭크상승권", + "医疗进阶券" + ], + [ + "스페셜리스트랭크상승권", + "特种进阶券" + ], + [ + "지휘분대", + "指挥分队" + ], + [ + "집합분대", + "集群分队" + ], + [ + "지원분대", + "后勤分队" + ], + [ + "예봉분대", + "矛头分队" + ], + [ + "강습전술분대", + "突击战术分队" + ], + [ + "방어전술분대", + "堡垒战术分队" + ], + [ + "원거리전술분대", + "远程战术分队" + ], + [ + "파괴전술분대", + "破坏战术分队" + ], + [ + "연구분대", + "研究分队" + ], + [ + "고급화분대", + "高规格分队" + ], + [ + "'사일런트스쿼드'", + "“静音小队”" + ], + [ + "사일런트스쿼드", + "“静音小队”" + ], + [ + "갈라진속박의끈", + "开裂的束缚带" + ], + [ + "기이한가면", + "奇渊面具" + ], + [ + "대모의증표", + "教母的信物" + ], + [ + "낡은사진", + "残破合影" + ], + [ + "작가의대변자", + "作者的喉舌" + ], + [ + "로즈몬티스의포옹", + "迷迭香之拥" + ], + [ + "금박장식주사위", + "镶金骨骰" + ], + [ + "'검은밤의속삭임'", + "“黑夜呢喃”" + ], + [ + "검은밤의속삭임", + "“黑夜呢喃”" + ], + [ + "《고요함》", + "《大静谧》" + ], + [ + "이철원형방패", + "异铁小圆盾" + ], + [ + "군단미러아머", + "军团护心镜" + ], + [ + "고대증기투구", + "古旧的蒸汽甲胄" + ], + [ + "황제의은총", + "皇帝的恩宠" + ], + [ + "귀족레이피어", + "贵族刺剑" + ], + [ + "올드가디언의창", + "老近卫军之锋" + ], + [ + "헌신의목걸이", + "显圣吊坠" + ], + [ + "은식기", + "银餐叉" + ], + [ + "망가진리볼버탄창", + "损坏的左轮弹巢" + ], + [ + "악취나는지혈제", + "难闻的止血剂" + ], + [ + "구급상자", + "急救药箱" + ], + [ + "정체불명의기기", + "未知仪器" + ], + [ + "녹슨면도날", + "锈蚀刀片" + ], + [ + "마부의채찍", + "赶车夫的长鞭" + ], + [ + "'어벤져'", + "“复仇者”" + ], + [ + "어벤져", + "“复仇者”" + ], + [ + "제식저항도구", + "制式防暴用具" + ], + [ + "황제의소장품", + "皇帝的收藏" + ], + [ + "'찬란한눈물'", + "“璀璨悲泣”" + ], + [ + "찬란한눈물", + "“璀璨悲泣”" + ], + [ + "살아있는장미", + "活玫瑰" + ], + [ + "창백해진화관", + "苍白花冠" + ], + [ + "공연용향수", + "演出用香水" + ], + [ + "디자이너의자", + "设计师量尺" + ], + [ + "'아츠킬러'", + "“法术杀手”" + ], + [ + "아츠킬러", + "“法术杀手”" + ], + [ + "댄서의팔찌", + "舞者手链" + ], + [ + "우르수스흘렙", + "乌萨斯列巴" + ], + [ + "'우르수스홀렙", + "乌萨斯列巴" + ], + [ + "고행자의슈크림빵", + "苦行者泡芙" + ], + [ + "딱딱한바게트", + "铁棍面包" + ], + [ + "초콜릿시제품", + "试制巧克力" + ], + [ + "가울마카롱", + "高卢小圆饼" + ], + [ + "빅토리아케이크", + "维多利亚蛋糕" + ], + [ + "노선설명도", + "路线说明图" + ], + [ + "어둑한램프", + "昏暗的提灯" + ], + [ + "구리나침판", + "黄铜指南针" + ], + [ + "파손된가면", + "破损的面具" + ], + [ + "백지명함", + "空白名片" + ], + [ + "인형의집", + "人偶之家" + ], + [ + "미니극장모형", + "微缩舞台模型" + ], + [ + "드림바인드캐슬모형", + "缠梦古堡模型" + ], + [ + "우르수스곡도", + "乌萨斯弯刀" + ], + [ + "빅토리아왕관", + "维多利亚王冠" + ], + [ + "라이타니엔셉터", + "莱塔尼亚权杖" + ], + [ + "가울맨틀", + "高卢长袍" + ], + [ + "반세공다이아몬드", + "半洗孤钻" + ], + [ + "트라고디아시길", + "酒神的印记" + ], + [ + "'프릴리베의오른눈'", + "“游禽的右眼”" + ], + [ + "프릴리베의오른눈", + "“游禽的右眼”" + ], + [ + "'프릴리베의왼눈'", + "“游禽的左眼”" + ], + [ + "프릴리베의왼눈", + "“游禽的左眼”" + ], + [ + "'화려한용모'", + "“华美容貌”" + ], + [ + "화려한용모", + "“华美容貌”" + ], + [ + "'망치의검'", + "“剑锤”" + ], + [ + "망치의검", + "“剑锤”" + ], + [ + "'부러진검'", + "“断剑”" + ], + [ + "부러진검", + "“断剑”" + ], + [ + "낯익은조각상", + "眼熟的雕像" + ], + [ + "우정의상징", + "友谊之证" + ], + [ + "검은색댄스화", + "漆黑的舞鞋" + ], + [ + "하얀색댄스화", + "洁白的舞鞋" + ], + [ + "'칼춤'", + "“刀舞”" + ], + [ + "칼춤", + "“刀舞”" + ], + [ + "'배풍등'", + "“白英花”" + ], + [ + "배풍등", + "“白英花”" + ], + [ + "'그림자'", + "“影子”" + ], + [ + "그림자", + "“影子”" + ], + [ + "《낀데의꽃》", + "《坎德之花》" + ], + [ + "《무감각과저속함》", + "《麻木与庸俗》" + ], + [ + "《세상의아름다움과추함》", + "《世间的美与丑》" + ], + [ + "망가진인형", + "残破的玩偶" + ], + [ + "쓸모없는가위", + "无用的剪刀" + ], + [ + "빈유서봉투", + "空白遗书" + ], + [ + "대속의타이", + "替罪领巾" + ], + [ + "대체배우", + "替补演员" + ], + [ + "깨달음", + "恍悟" + ], + [ + "클로돌파", + "钝爪突破" + ], + [ + "클로폭발", + "钝爪爆发" + ], + [ + "클로정통", + "钝爪熟稔" + ], + [ + "클로고양", + "钝爪振奋" + ], + [ + "클로백전", + "钝爪百战" + ], + [ + "브로큰스피어돌파", + "折戟突破" + ], + [ + "브로큰스피어창날", + "折戟锋刃" + ], + [ + "브로큰스피어혈전", + "折戟浴血" + ], + [ + "브로큰스피어혈진", + "折戟浴血" + ], + [ + "브로큰스피어일당백", + "折戟一夫当关" + ], + [ + "브로큰스피어임전무퇴", + "折戟破釜沉舟" + ], + [ + "프로텍터돌파", + "铁卫突破" + ], + [ + "1프로텍터2돌파", + "铁卫突破" + ], + [ + "프로텍터침략", + "铁卫侵掠" + ], + [ + "프로텍터부동", + "铁卫不动" + ], + [ + "프로텍터추진", + "铁卫推进" + ], + [ + "프로텍터무봉", + "铁卫无锋" + ], + [ + "브로큰보우돌파", + "残弩突破" + ], + [ + "브로큰보우백발백중", + "残弩百步穿杨" + ], + [ + "브로큰보우전장의존", + "残弩战场依存" + ], + [ + "브로큰보우전장의", + "残弩战场依存" + ], + [ + "브로큰보우교차사격", + "残弩交叉火力" + ], + [ + "브로큰보우신속", + "残弩神速" + ], + [ + "브로큰스태프돌파", + "断杖突破" + ], + [ + "브로큰스태프위버", + "断杖织法者" + ], + [ + "브로큰스태프아리아", + "断杖咏唱" + ], + [ + "브로큰스태프집중", + "断杖凝神" + ], + [ + "브로큰스태프고난의주술", + "断杖苦难巫咒" + ], + [ + "스트럿돌파", + "支柱突破" + ], + [ + "\"스트렷돌파", + "支柱突破" + ], + [ + "스트럿이차전장", + "支柱次要战场" + ], + [ + "스트럿근면", + "支柱勤奋" + ], + [ + "스트럿파괴", + "支柱破兵" + ], + [ + "스트럿약화", + "支柱枯法" + ], + [ + "힐러돌파", + "医者突破" + ], + [ + "힐러자생", + "医者自医" + ], + [ + "힐러강력시약", + "医者强效试剂" + ], + [ + "힐러명의", + "医者妙手" + ], + [ + "힐러정신강화", + "医者理智固剂" + ], + [ + "러스트블레이드돌파", + "锈刃突破" + ], + [ + "러스트블레이드처형", + "锈刃处决" + ], + [ + "'러스트블레이드2처형", + "锈刃处决" + ], + [ + "러스트블레이드각개전투", + "锈刃单兵" + ], + [ + "러스트블레이드무인지경", + "锈刃无人之境" + ], + [ + "러스트블레이드신력", + "锈刃神力" + ], + [ + "^러스트블레이드신$", + "锈刃神力" + ], + [ + "가시의손", + "尖刺之手" + ], + [ + "목조르는손", + "扼喉之手" + ], + [ + "긁기의손", + "扣挠之手" + ], + [ + "확장의손", + "扩散之手" + ], + [ + "뜯기의손", + "撕扯之手" + ], + [ + "극속의손", + "极速之手" + ], + [ + "모둠의손", + "积攒之手" + ], + [ + "블루스카프", + "蓝色丝巾" + ], + [ + "빨간리본", + "红色蝴蝶结" + ], + [ + "괴상한플루트", + "古怪的长笛" + ], + [ + "유리로만든새", + "玻璃小鸟" + ], + [ + "독주오르골", + "独奏八音盒" + ], + [ + "오리지늄아이리스", + "源石鸢尾花" + ], + [ + "순금의원정", + "赤金的远征" + ], + [ + "《두린의지상유람기》", + "《杜林地上环游记》" + ], + [ + "[두린의지상유람>", + "《杜林地上环游记》" + ], + [ + "《옛가울지명원류고》", + "《旧高卢地名源流考》" + ], + [ + "고대가울의은화", + "古高卢银币" + ], + [ + "엘리제돈주머니", + "爱丽舍钱袋" + ], + [ + "가울은행수표", + "高卢银行支票" + ], + [ + "《제2경제개혁법》", + "《第二经济改革法》" + ], + [ + "바닐라사르시탄산음료", + "香草沙士汽水" + ], + [ + "땡땡이주스", + "球球果汁" + ], + [ + "파울비스트푸아그라", + "羽兽肝酱" + ], + [ + "매혹의향수", + "迷梦香精" + ], + [ + "황무지테킬라", + "荒地龙舌兰" + ], + [ + "모건대장의술", + "摩根队长佳酿" + ], + [ + "스피리터스", + "生命之水" + ], + [ + "로열리큐어", + "皇家利口酒" + ], + [ + "'만개'", + "“绽放”" + ], + [ + "만개", + "“绽放”" + ], + [ + "'인기가수'", + "“当红歌手”" + ], + [ + "인기가수", + "“当红歌手”" + ], + [ + "망석중이", + "悬丝傀儡" + ], + [ + "'동심저격인형'", + "“童趣玩偶”" + ], + [ + "동심저격인형", + "“童趣玩偶”" + ], + [ + "코인인형", + "投币玩具" + ], + [ + "기사계율·신편", + "骑士戒律·新编" + ], + [ + "황금술의성배", + "金酒之杯" + ], + [ + "유기농통조림", + "绿叶菜罐头" + ], + [ + "073번안전시약", + "073号安全试剂" + ], + [ + "시라쿠사인의분노", + "叙拉古人的愤怒" + ], + [ + "'문명의존속'", + "“文明的存续”" + ], + [ + "문명의존속", + "“文明的存续”" + ], + [ + "영광의어깨띠", + "荣耀绶带" + ], + [ + "'충성과의리'", + "“忠义”" + ], + [ + "충성과의리", + "“忠义”" + ], + [ + "'시간의끝'", + "“时光之末”" + ], + [ + "시간의끝", + "“时光之末”" + ], + [ + "왕정의맹약", + "王庭盟约" + ], + [ + "농축억제제", + "浓缩抑制剂" + ], + [ + "전기주전자", + "热水壶" + ], + [ + "특수저지장치", + "特殊抑制器" + ], + [ + "석상귀조각상", + "石像鬼塑像" + ], + [ + "뱀파이어의침대", + "血魔的寝床" + ], + [ + "영생의상징", + "长生者之证" + ], + [ + "열린소품상자", + "被撬开的道具箱" + ], + [ + "낡은악보", + "古旧乐谱残章" + ], + [ + "계약해지서", + "解约协议" + ], + [ + "만능열쇠", + "万能钥匙" + ], + [ + "밴시의입맞춤", + "女妖之吻" + ], + [ + "고대주화", + "古旧钱币" + ], + [ + "배우의장신구박스", + "演员的首饰盒" + ], + [ + "무결점보옥", + "无瑕宝玉" + ], + [ + "조커카드", + "尖笑鬼牌" + ], + [ + "미스크리스틴쓰담권", + "Miss.Christine摸摸券" + ], + [ + "고대주물", + "古旧铸物" + ], + [ + "클로전훈", + "钝爪典训" + ], + [ + "브로큰스피어전훈", + "折戟典训" + ], + [ + "프로텍터전훈", + "铁卫典训" + ], + [ + "프로텍터2전훈", + "铁卫典训" + ], + [ + "'브로큰보우전훈", + "残弩典训" + ], + [ + "브로큰보우전훈", + "残弩典训" + ], + [ + "브로큰스태프전훈", + "断杖典训" + ], + [ + "스트럿전훈", + "支柱典训" + ], + [ + "힐러전훈", + "医者典训" + ], + [ + "러스트블레이드전훈", + "锈刃典训" + ], + [ + "지역액션플랜", + "地区行动方案" + ], + [ + "전역작전문서", + "全局作战文件" + ], + [ + "인사부비밀서한", + "人事部密信" + ], + [ + "연설문", + "一份演讲稿" + ], + [ + "크림슨극단의반쪽티켓", + "猩红剧团票根" + ], + [ + "럭키코인", + "幸运硬币" + ], + [ + "무도회가면", + "假面舞会面具" + ], + [ + "보물반지", + "至宝指环" + ], + [ + "빅토리아'고철'훈장", + "维多利亚“废铁”勋章" + ], + [ + "빅토리아고철훈장", + "维多利亚“废铁”勋章" + ], + [ + "라이타니엔명예훈장", + "莱塔尼亚荣誉勋章" + ], + [ + "녹슨쇠망치", + "锈蚀的铁锤" + ], + [ + "네잎클로버화석", + "四叶草化石" + ], + [ + "돌격협의확충", + "突击协议扩充" + ], + [ + "돌격협의증원", + "突击协议增援" + ], + [ + "방어협의확충", + "堡垒协议扩充" + ], + [ + "방어협의증원", + "堡垒协议增援" + ], + [ + "원거리협의확충", + "远程协议扩充" + ], + [ + "원거리협의증원", + "远程协议增援" + ], + [ + "파괴협의확충", + "破坏协议扩充" + ], + [ + "파괴협의증원", + "破坏协议增援" + ], + [ + "국왕의새창", + "国王的新枪" + ], + [ + "가드의군모", + "近卫军帽" + ], + [ + "'고통스러운쾌락'", + "“苦痛的快乐”" + ], + [ + "고통스러운쾌락", + "“苦痛的快乐”" + ], + [ + "고성의후손", + "古堡的子嗣" + ], + [ + "꿈틀대는식탐", + "涌动之餐" + ], + [ + "'밤의공포'", + "“夜骇”" + ], + [ + "밤의공포", + "“夜骇”" + ], + [ + "'무한'", + "“无度”" + ], + [ + "무한", + "“无度”" + ], + [ + "지원보급기", + "支援补给站" + ], + [ + "지원지뢰세트", + "支援地雷组" + ], + [ + "지원프지뢰세트", + "支援地雷组" + ], + [ + "지원럼블", + "支援轰隆隆" + ], + [ + "지원크레인", + "支援起重机" + ], + [ + "지원포그머신", + "支援雾机" + ], + [ + "지원가스통", + "支援气罐组" + ], + [ + "지원'보급기", + "支援补给站" + ], + [ + "지원'지뢰세트", + "支援地雷组" + ], + [ + "지원'럼블", + "支援轰隆隆" + ], + [ + "지원'크레인", + "支援起重机" + ], + [ + "지원'포그머신", + "支援雾机" + ], + [ + "지원'가스통", + "支援气罐组" + ], + [ + "《개선의노래》", + "《凯旋颂》" + ], + [ + "《호수의보물》", + "《湖中至宝》" + ], + [ + "《백일주화》", + "《一百零一日》" + ], + [ + "《외로운방랑자》", + "《独行客》" + ], + [ + "《원더랜드인드림》", + "《梦中奇缘》" + ], + [ + "《설녀와서리남》", + "《霜牡与雪牝》" + ], + [ + "《헬리아의빛》", + "《赫里亚之辉》" + ], + [ + "《일곱언덕의어미늑대》", + "《七丘的狼母》" + ], + [ + "《동틀무렵》", + "《初晓》" + ], + [ + "《황금파울비스트》", + "《金羽兽》" + ], + [ + "《와일드골드》", + "《狂野之金》" + ], + [ + "《자장가》", + "《摇篮曲》" + ], + [ + "《광란의축제》", + "《欢欣鼓舞》" + ], + [ + "死囚之舞", + "死囚之舞" + ], + [ + "初幕", + "初幕" + ], + [ + "今日菜谱", + "今日菜谱" + ], + [ + "“迷醉荷谟伊”", + "“迷醉荷谟伊”" + ], + [ + "女皇之愿", + "女皇之愿" + ], + [ + "凯旋号角", + "凯旋号角" + ], + [ + "高闪相机", + "高闪相机" + ], + [ + "精神治疗录像带", + "精神治疗录像带" + ], + [ + "皇族金胸针", + "皇族金胸针" + ], + [ + "“逝者垂泪”", + "“逝者垂泪”" + ], + [ + "老蒲扇", + "老蒲扇" + ], + [ + "食腐者手杖", + "食腐者手杖" + ], + [ + "安洁莉娜的创想", + "安洁莉娜的创想" + ], + [ + "Scout的狙击镜", + "Scout的狙击镜" + ], + [ + "“噤声”", + "“噤声”" + ], + [ + "“聚焦”", + "“聚焦”" + ], + [ + "罗德岛战术电台", + "罗德岛战术电台" + ], + [ + "突击协议-利刃", + "突击协议-利刃" + ], + [ + "突击协议-散兵", + "突击协议-散兵" + ], + [ + "堡垒协议-方阵", + "堡垒协议-方阵" + ], + [ + "堡垒协议-固守", + "堡垒协议-固守" + ], + [ + "远程协议-遥击", + "远程协议-遥击" + ], + [ + "远程协议-克敌", + "远程协议-克敌" + ], + [ + "破坏协议-消除", + "破坏协议-消除" + ], + [ + "破坏协议-压制", + "破坏协议-压制" + ] + ] + }, + "VisitLimited_Temp": { + "text": [] + }, + "NoFriends_Temp": { + "text": [] + }, + "StageDropsQuantity": { + "template": "empty.png", + "templThreshold": 3, + "templThreshold_Doc": "这里用来作为字间距阈值", + "roi": [ + 62, + 90, + 46, + 22 + ], + "maskRange": [ + 200, + 255 + ] + }, + "CreditShopNoMoney": { + "text": [ + "부족", + "불가" + ] + }, + "RoguelikeCustomHijackSquad": { + "ocrReplace": [ + [ + "지휘", + "指挥分队" + ], + [ + "집합", + "集群分队" + ], + [ + "지원", + "后勤分队" + ], + [ + "예봉", + "矛头分队" + ], + [ + "강습", + "突击战术分队" + ], + [ + "방어", + "堡垒战术分队" + ], + [ + "원거리", + "远程战术分队" + ], + [ + "파괴", + "破坏战术分队" + ], + [ + "연구", + "研究分队" + ], + [ + "고급화", + "高规格分队" + ] + ] + }, + "RoguelikeCustomHijackRoles": { + "ocrReplace": [ + [ + "원하는", + "随心所欲" + ], + [ + "원하는대로", + "随心所欲" + ], + [ + "선수필승", + "先手必胜" + ], + [ + "차근차근", + "稳扎稳打" + ], + [ + "상호보완", + "取长补短" + ] + ] + }, + "RoguelikeCustomHijackCoChar": { + "ocrReplace": [ + [ + "캐스터", + "术师" + ], + [ + "메딕", + "医疗" + ], + [ + "뱅가드", + "先锋" + ], + [ + "스나이퍼", + "狙击" + ], + [ + "스페셜리스트", + "特种" + ], + [ + "서포터", + "辅助" + ], + [ + "디펜더", + "重装" + ], + [ + "가드", + "近卫" + ] + ] + }, + "InfrastStationedInfo_Temp": { + "text": [ + "配属情報" + ] + }, + "InfrastEnterOperList_Temp": { + "text": [ + "体力", + "休憩中", + "仕事中", + "配属" + ] } -} +} \ No newline at end of file diff --git a/resource/global/YoStarKR/resource/template/AddOperatorMfgAggressive.png b/resource/global/YoStarKR/resource/template/AddOperatorMfgAggressive.png new file mode 100644 index 0000000000..60155551ba Binary files /dev/null and b/resource/global/YoStarKR/resource/template/AddOperatorMfgAggressive.png differ diff --git a/resource/global/YoStarKR/resource/template/AddOperatorReceptionGentle.png b/resource/global/YoStarKR/resource/template/AddOperatorReceptionGentle.png new file mode 100644 index 0000000000..2180ce67a0 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/AddOperatorReceptionGentle.png differ diff --git a/resource/global/YoStarKR/resource/template/AddOperatorTradeAggressive.png b/resource/global/YoStarKR/resource/template/AddOperatorTradeAggressive.png new file mode 100644 index 0000000000..f9eb0a479c Binary files /dev/null and b/resource/global/YoStarKR/resource/template/AddOperatorTradeAggressive.png differ diff --git a/resource/global/YoStarKR/resource/template/AnnihilationConfirm.png b/resource/global/YoStarKR/resource/template/AnnihilationConfirm.png new file mode 100644 index 0000000000..8e25d38920 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/AnnihilationConfirm.png differ diff --git a/resource/global/YoStarKR/resource/template/AwardFinished.png b/resource/global/YoStarKR/resource/template/AwardFinished.png new file mode 100644 index 0000000000..4f7a66e010 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/AwardFinished.png differ diff --git a/resource/global/YoStarKR/resource/template/BattleQuickFormationClear.png b/resource/global/YoStarKR/resource/template/BattleQuickFormationClear.png new file mode 100644 index 0000000000..e64d774ae7 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/BattleQuickFormationClear.png differ diff --git a/resource/global/YoStarKR/resource/template/BattleQuickFormationCollapseRole.png b/resource/global/YoStarKR/resource/template/BattleQuickFormationCollapseRole.png new file mode 100644 index 0000000000..dadf5a2ffd Binary files /dev/null and b/resource/global/YoStarKR/resource/template/BattleQuickFormationCollapseRole.png differ diff --git a/resource/global/YoStarKR/resource/template/BattleQuickFormationConfirm.png b/resource/global/YoStarKR/resource/template/BattleQuickFormationConfirm.png new file mode 100644 index 0000000000..90fc36419e Binary files /dev/null and b/resource/global/YoStarKR/resource/template/BattleQuickFormationConfirm.png differ diff --git a/resource/global/YoStarKR/resource/template/BattleQuickFormationExpandRole.png b/resource/global/YoStarKR/resource/template/BattleQuickFormationExpandRole.png new file mode 100644 index 0000000000..d6eb0ae2b6 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/BattleQuickFormationExpandRole.png differ diff --git a/resource/global/YoStarKR/resource/template/ClearSelection.png b/resource/global/YoStarKR/resource/template/ClearSelection.png new file mode 100644 index 0000000000..4752b726a7 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/ClearSelection.png differ diff --git a/resource/global/YoStarKR/resource/template/Clue.png b/resource/global/YoStarKR/resource/template/Clue.png new file mode 100644 index 0000000000..bdedec7569 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Clue.png differ diff --git a/resource/global/YoStarKR/resource/template/CollectCredit.png b/resource/global/YoStarKR/resource/template/CollectCredit.png new file mode 100644 index 0000000000..ec9399f975 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/CollectCredit.png differ diff --git a/resource/global/YoStarKR/resource/template/ControlCenter.png b/resource/global/YoStarKR/resource/template/ControlCenter.png new file mode 100644 index 0000000000..94e597b593 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/ControlCenter.png differ diff --git a/resource/global/YoStarKR/resource/template/ControlCenterMini.png b/resource/global/YoStarKR/resource/template/ControlCenterMini.png new file mode 100644 index 0000000000..525c732133 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/ControlCenterMini.png differ diff --git a/resource/global/YoStarKR/resource/template/CreditStore.png b/resource/global/YoStarKR/resource/template/CreditStore.png new file mode 100644 index 0000000000..4fac783f8d Binary files /dev/null and b/resource/global/YoStarKR/resource/template/CreditStore.png differ diff --git a/resource/global/YoStarKR/resource/template/DailyTask.png b/resource/global/YoStarKR/resource/template/DailyTask.png new file mode 100644 index 0000000000..43a9e3462e Binary files /dev/null and b/resource/global/YoStarKR/resource/template/DailyTask.png differ diff --git a/resource/global/YoStarKR/resource/template/DeliverableOrder.png b/resource/global/YoStarKR/resource/template/DeliverableOrder.png new file mode 100644 index 0000000000..58d1a868f3 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/DeliverableOrder.png differ diff --git a/resource/global/YoStarKR/resource/template/DepotEnter.png b/resource/global/YoStarKR/resource/template/DepotEnter.png new file mode 100644 index 0000000000..414b9455fc Binary files /dev/null and b/resource/global/YoStarKR/resource/template/DepotEnter.png differ diff --git a/resource/global/YoStarKR/resource/template/DepotMaterialTab.png b/resource/global/YoStarKR/resource/template/DepotMaterialTab.png new file mode 100644 index 0000000000..93edaa7981 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/DepotMaterialTab.png differ diff --git a/resource/global/YoStarKR/resource/template/DepotMaterialTabClicked.png b/resource/global/YoStarKR/resource/template/DepotMaterialTabClicked.png new file mode 100644 index 0000000000..e27c70236c Binary files /dev/null and b/resource/global/YoStarKR/resource/template/DepotMaterialTabClicked.png differ diff --git a/resource/global/YoStarKR/resource/template/Dorm.png b/resource/global/YoStarKR/resource/template/Dorm.png new file mode 100644 index 0000000000..97c83e85ab Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Dorm.png differ diff --git a/resource/global/YoStarKR/resource/template/DormMini.png b/resource/global/YoStarKR/resource/template/DormMini.png new file mode 100644 index 0000000000..806437beac Binary files /dev/null and b/resource/global/YoStarKR/resource/template/DormMini.png differ diff --git a/resource/global/YoStarKR/resource/template/DroneAssistTrade.png b/resource/global/YoStarKR/resource/template/DroneAssistTrade.png new file mode 100644 index 0000000000..7aef84f90b Binary files /dev/null and b/resource/global/YoStarKR/resource/template/DroneAssistTrade.png differ diff --git a/resource/global/YoStarKR/resource/template/DroneCancel.png b/resource/global/YoStarKR/resource/template/DroneCancel.png new file mode 100644 index 0000000000..978e81818e Binary files /dev/null and b/resource/global/YoStarKR/resource/template/DroneCancel.png differ diff --git a/resource/global/YoStarKR/resource/template/DroneConfirm.png b/resource/global/YoStarKR/resource/template/DroneConfirm.png new file mode 100644 index 0000000000..0ad3fdbe8c Binary files /dev/null and b/resource/global/YoStarKR/resource/template/DroneConfirm.png differ diff --git a/resource/global/YoStarKR/resource/template/DroneMax.png b/resource/global/YoStarKR/resource/template/DroneMax.png new file mode 100644 index 0000000000..a3a0df8078 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/DroneMax.png differ diff --git a/resource/global/YoStarKR/resource/template/EnterInfrast.png b/resource/global/YoStarKR/resource/template/EnterInfrast.png new file mode 100644 index 0000000000..1e5a6c93dc Binary files /dev/null and b/resource/global/YoStarKR/resource/template/EnterInfrast.png differ diff --git a/resource/global/YoStarKR/resource/template/EnterOperator.png b/resource/global/YoStarKR/resource/template/EnterOperator.png new file mode 100644 index 0000000000..8dc7891105 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/EnterOperator.png differ diff --git a/resource/global/YoStarKR/resource/template/FriendsList.png b/resource/global/YoStarKR/resource/template/FriendsList.png new file mode 100644 index 0000000000..603508c9a8 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/FriendsList.png differ diff --git a/resource/global/YoStarKR/resource/template/GetClue1.png b/resource/global/YoStarKR/resource/template/GetClue1.png new file mode 100644 index 0000000000..b3ad92d9ca Binary files /dev/null and b/resource/global/YoStarKR/resource/template/GetClue1.png differ diff --git a/resource/global/YoStarKR/resource/template/GetClue2.png b/resource/global/YoStarKR/resource/template/GetClue2.png new file mode 100644 index 0000000000..b41e4eb088 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/GetClue2.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastClearButton.png b/resource/global/YoStarKR/resource/template/InfrastClearButton.png new file mode 100644 index 0000000000..4752b726a7 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastClearButton.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastFilterMenuNotStationedButton.png b/resource/global/YoStarKR/resource/template/InfrastFilterMenuNotStationedButton.png new file mode 100644 index 0000000000..e3aca9f413 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastFilterMenuNotStationedButton.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastFilterMenuNotStationedButtonAlreadyClicked.png b/resource/global/YoStarKR/resource/template/InfrastFilterMenuNotStationedButtonAlreadyClicked.png new file mode 100644 index 0000000000..81e089ae06 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastFilterMenuNotStationedButtonAlreadyClicked.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastMfgChipFlag.png b/resource/global/YoStarKR/resource/template/InfrastMfgChipFlag.png new file mode 100644 index 0000000000..8b733c196a Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastMfgChipFlag.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastMfgDogFoodFlag.png b/resource/global/YoStarKR/resource/template/InfrastMfgDogFoodFlag.png new file mode 100644 index 0000000000..ce0dee4ca9 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastMfgDogFoodFlag.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastMfgOriginStoneFlag.png b/resource/global/YoStarKR/resource/template/InfrastMfgOriginStoneFlag.png new file mode 100644 index 0000000000..50f611ed90 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastMfgOriginStoneFlag.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastMfgPureGoldFlag.png b/resource/global/YoStarKR/resource/template/InfrastMfgPureGoldFlag.png new file mode 100644 index 0000000000..e71a636110 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastMfgPureGoldFlag.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastOperListTabMoodDoubleClick.png b/resource/global/YoStarKR/resource/template/InfrastOperListTabMoodDoubleClick.png new file mode 100644 index 0000000000..16c6ad0ba2 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastOperListTabMoodDoubleClick.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastOperListTabMoodDoubleClickWhenUnclicked.png b/resource/global/YoStarKR/resource/template/InfrastOperListTabMoodDoubleClickWhenUnclicked.png new file mode 100644 index 0000000000..b4bb9d5a92 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastOperListTabMoodDoubleClickWhenUnclicked.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastOperListTabSkillUnClicked.png b/resource/global/YoStarKR/resource/template/InfrastOperListTabSkillUnClicked.png new file mode 100644 index 0000000000..21e5bd06d5 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastOperListTabSkillUnClicked.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastOperListTabWorkStatusUnClicked.png b/resource/global/YoStarKR/resource/template/InfrastOperListTabWorkStatusUnClicked.png new file mode 100644 index 0000000000..736d9da781 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastOperListTabWorkStatusUnClicked.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastOverview.png b/resource/global/YoStarKR/resource/template/InfrastOverview.png new file mode 100644 index 0000000000..c628c2e4cf Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastOverview.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastSortByTrustButton.png b/resource/global/YoStarKR/resource/template/InfrastSortByTrustButton.png new file mode 100644 index 0000000000..d0f47b84de Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastSortByTrustButton.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastSortByTrustButtonClickAgain.png b/resource/global/YoStarKR/resource/template/InfrastSortByTrustButtonClickAgain.png new file mode 100644 index 0000000000..13d9b1f6f4 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastSortByTrustButtonClickAgain.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastTradeMoneyFlag.png b/resource/global/YoStarKR/resource/template/InfrastTradeMoneyFlag.png new file mode 100644 index 0000000000..337b94acc3 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastTradeMoneyFlag.png differ diff --git a/resource/global/YoStarKR/resource/template/InfrastTradeSyntheticJadeFlag.png b/resource/global/YoStarKR/resource/template/InfrastTradeSyntheticJadeFlag.png new file mode 100644 index 0000000000..f94e129769 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/InfrastTradeSyntheticJadeFlag.png differ diff --git a/resource/global/YoStarKR/resource/template/Mall.png b/resource/global/YoStarKR/resource/template/Mall.png new file mode 100644 index 0000000000..ae773f8de0 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Mall.png differ diff --git a/resource/global/YoStarKR/resource/template/Manufacturing.png b/resource/global/YoStarKR/resource/template/Manufacturing.png new file mode 100644 index 0000000000..69bcc55d0a Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Manufacturing.png differ diff --git a/resource/global/YoStarKR/resource/template/ManufacturingMini.png b/resource/global/YoStarKR/resource/template/ManufacturingMini.png new file mode 100644 index 0000000000..1dbd6c564b Binary files /dev/null and b/resource/global/YoStarKR/resource/template/ManufacturingMini.png differ diff --git a/resource/global/YoStarKR/resource/template/Office.png b/resource/global/YoStarKR/resource/template/Office.png new file mode 100644 index 0000000000..0f4a2aaa6d Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Office.png differ diff --git a/resource/global/YoStarKR/resource/template/OfficeMini.png b/resource/global/YoStarKR/resource/template/OfficeMini.png new file mode 100644 index 0000000000..6a67b39773 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/OfficeMini.png differ diff --git a/resource/global/YoStarKR/resource/template/OnShift.png b/resource/global/YoStarKR/resource/template/OnShift.png new file mode 100644 index 0000000000..3fcd1c6504 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/OnShift.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@Abandon.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@Abandon.png new file mode 100644 index 0000000000..a94ecb89c7 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@Abandon.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@ChooseDifficulty.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@ChooseDifficulty.png new file mode 100644 index 0000000000..1249956708 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@ChooseDifficulty.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@Continue.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@Continue.png new file mode 100644 index 0000000000..4309f65aca Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@Continue.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@EnterAfterRecruit.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@EnterAfterRecruit.png new file mode 100644 index 0000000000..3dfc6bd71e Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@EnterAfterRecruit.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDrop1.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDrop1.png new file mode 100644 index 0000000000..12d6b0f28d Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDrop1.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDrop2.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDrop2.png new file mode 100644 index 0000000000..61407e6b53 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDrop2.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDrop3.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDrop3.png new file mode 100644 index 0000000000..290b53f764 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDrop3.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropCompleted.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropCompleted.png new file mode 100644 index 0000000000..047770c8c6 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropCompleted.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropLeave.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropLeave.png new file mode 100644 index 0000000000..667a30a259 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropLeave.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropRecruit.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropRecruit.png new file mode 100644 index 0000000000..209626d6bd Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropRecruit.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropSelect.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropSelect.png new file mode 100644 index 0000000000..75df691435 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropSelect.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropSelectReward.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropSelectReward.png new file mode 100644 index 0000000000..235cfaa43c Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@GetDropSelectReward.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@LastReward.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@LastReward.png new file mode 100644 index 0000000000..a15a4d5166 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@LastReward.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@LastReward2.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@LastReward2.png new file mode 100644 index 0000000000..976aca34b4 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@LastReward2.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@LastReward3.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@LastReward3.png new file mode 100644 index 0000000000..0567002e5a Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@LastReward3.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@MissionFailedFlag2.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@MissionFailedFlag2.png new file mode 100644 index 0000000000..d15df48c42 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@MissionFailedFlag2.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@Recruit.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@Recruit.png new file mode 100644 index 0000000000..60e91b24e0 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@Recruit.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@RolesDefault.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@RolesDefault.png new file mode 100644 index 0000000000..de2edccda7 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@RolesDefault.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@SquadDefault.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@SquadDefault.png new file mode 100644 index 0000000000..5115f2a054 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@SquadDefault.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageCambatDpsEnter.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageCambatDpsEnter.png new file mode 100644 index 0000000000..7bb028b8c7 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageCambatDpsEnter.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageDreadfulFoeEnter.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageDreadfulFoeEnter.png new file mode 100644 index 0000000000..a96dfad0f9 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageDreadfulFoeEnter.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageEmergencyDpsEnter.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageEmergencyDpsEnter.png new file mode 100644 index 0000000000..30bdcd4b40 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageEmergencyDpsEnter.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageEncounterEnter.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageEncounterEnter.png new file mode 100644 index 0000000000..aa295b9f6b Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageEncounterEnter.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageEncounterLeaveConfirm.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageEncounterLeaveConfirm.png new file mode 100644 index 0000000000..5dfb65c127 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageEncounterLeaveConfirm.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageSafeHouseEnter.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageSafeHouseEnter.png new file mode 100644 index 0000000000..0995e72c58 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageSafeHouseEnter.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageTraderEnter.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageTraderEnter.png new file mode 100644 index 0000000000..7788196e6d Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StageTraderEnter.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StartExplore.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StartExplore.png new file mode 100644 index 0000000000..6d5c2f5ebd Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@StartExplore.png differ diff --git a/resource/global/YoStarKR/resource/template/Phantom@Roguelike@TodoEnter.png b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@TodoEnter.png new file mode 100644 index 0000000000..22ff7d89fc Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Phantom@Roguelike@TodoEnter.png differ diff --git a/resource/global/YoStarKR/resource/template/Power.png b/resource/global/YoStarKR/resource/template/Power.png new file mode 100644 index 0000000000..f26ea35eb8 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Power.png differ diff --git a/resource/global/YoStarKR/resource/template/PowerMini.png b/resource/global/YoStarKR/resource/template/PowerMini.png new file mode 100644 index 0000000000..e9a58ad186 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/PowerMini.png differ diff --git a/resource/global/YoStarKR/resource/template/ReceiveAward.png b/resource/global/YoStarKR/resource/template/ReceiveAward.png new file mode 100644 index 0000000000..b757f06c7d Binary files /dev/null and b/resource/global/YoStarKR/resource/template/ReceiveAward.png differ diff --git a/resource/global/YoStarKR/resource/template/Reception.png b/resource/global/YoStarKR/resource/template/Reception.png new file mode 100644 index 0000000000..a09cd73f22 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Reception.png differ diff --git a/resource/global/YoStarKR/resource/template/ReceptionFlag.png b/resource/global/YoStarKR/resource/template/ReceptionFlag.png new file mode 100644 index 0000000000..12dc0f1565 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/ReceptionFlag.png differ diff --git a/resource/global/YoStarKR/resource/template/ReceptionMini.png b/resource/global/YoStarKR/resource/template/ReceptionMini.png new file mode 100644 index 0000000000..79de37a2bf Binary files /dev/null and b/resource/global/YoStarKR/resource/template/ReceptionMini.png differ diff --git a/resource/global/YoStarKR/resource/template/Recruit.png b/resource/global/YoStarKR/resource/template/Recruit.png new file mode 100644 index 0000000000..6358392ad1 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Recruit.png differ diff --git a/resource/global/YoStarKR/resource/template/RecruitFinish.png b/resource/global/YoStarKR/resource/template/RecruitFinish.png new file mode 100644 index 0000000000..3855389896 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/RecruitFinish.png differ diff --git a/resource/global/YoStarKR/resource/template/RecruitRefresh.png b/resource/global/YoStarKR/resource/template/RecruitRefresh.png new file mode 100644 index 0000000000..64c55b5cac Binary files /dev/null and b/resource/global/YoStarKR/resource/template/RecruitRefresh.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@ChooseOperConfirm.png b/resource/global/YoStarKR/resource/template/Roguelike@ChooseOperConfirm.png new file mode 100644 index 0000000000..288fc75416 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@ChooseOperConfirm.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@DropsFlag.png b/resource/global/YoStarKR/resource/template/Roguelike@DropsFlag.png new file mode 100644 index 0000000000..7c974b1070 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@DropsFlag.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@FormationConfirm.png b/resource/global/YoStarKR/resource/template/Roguelike@FormationConfirm.png new file mode 100644 index 0000000000..e6a243007b Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@FormationConfirm.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@QuickFormation.png b/resource/global/YoStarKR/resource/template/Roguelike@QuickFormation.png new file mode 100644 index 0000000000..7a83f1914f Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@QuickFormation.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@RecruitCloseGuide.png b/resource/global/YoStarKR/resource/template/Roguelike@RecruitCloseGuide.png new file mode 100644 index 0000000000..84d25c50d9 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@RecruitCloseGuide.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestCancel.png b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestCancel.png new file mode 100644 index 0000000000..c2375daa4a Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestCancel.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestConfirm.png b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestConfirm.png new file mode 100644 index 0000000000..412882c3f0 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestConfirm.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestSystem.png b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestSystem.png new file mode 100644 index 0000000000..4891c11daf Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestSystem.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestSystemEnter.png b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestSystemEnter.png new file mode 100644 index 0000000000..e5dce04f54 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestSystemEnter.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestSystemLeave.png b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestSystemLeave.png new file mode 100644 index 0000000000..1eba36805c Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderInvestSystemLeave.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@StageTraderLeave.png b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderLeave.png new file mode 100644 index 0000000000..efc794dfda Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderLeave.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@StageTraderLeaveConfirm.png b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderLeaveConfirm.png new file mode 100644 index 0000000000..5c8465d797 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@StageTraderLeaveConfirm.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@StartAction.png b/resource/global/YoStarKR/resource/template/Roguelike@StartAction.png new file mode 100644 index 0000000000..9e9c71217f Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@StartAction.png differ diff --git a/resource/global/YoStarKR/resource/template/Roguelike@TraderRandomShoppingConfirm.png b/resource/global/YoStarKR/resource/template/Roguelike@TraderRandomShoppingConfirm.png new file mode 100644 index 0000000000..9eb007212d Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Roguelike@TraderRandomShoppingConfirm.png differ diff --git a/resource/global/YoStarKR/resource/template/RoguelikeBattleAbandon.png b/resource/global/YoStarKR/resource/template/RoguelikeBattleAbandon.png new file mode 100644 index 0000000000..6817b83fa4 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/RoguelikeBattleAbandon.png differ diff --git a/resource/global/YoStarKR/resource/template/RoguelikeBattleAbandonConfirm.png b/resource/global/YoStarKR/resource/template/RoguelikeBattleAbandonConfirm.png new file mode 100644 index 0000000000..4e64c1e095 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/RoguelikeBattleAbandonConfirm.png differ diff --git a/resource/global/YoStarKR/resource/template/ShamareThumbnail1.png b/resource/global/YoStarKR/resource/template/ShamareThumbnail1.png new file mode 100644 index 0000000000..fbfda30ee4 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/ShamareThumbnail1.png differ diff --git a/resource/global/YoStarKR/resource/template/ShamareThumbnail2.png b/resource/global/YoStarKR/resource/template/ShamareThumbnail2.png new file mode 100644 index 0000000000..b08bf77c03 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/ShamareThumbnail2.png differ diff --git a/resource/global/YoStarKR/resource/template/ShamareThumbnail3.png b/resource/global/YoStarKR/resource/template/ShamareThumbnail3.png new file mode 100644 index 0000000000..e8afc272bf Binary files /dev/null and b/resource/global/YoStarKR/resource/template/ShamareThumbnail3.png differ diff --git a/resource/global/YoStarKR/resource/template/SoldOut.png b/resource/global/YoStarKR/resource/template/SoldOut.png new file mode 100644 index 0000000000..22f14b3de8 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/SoldOut.png differ diff --git a/resource/global/YoStarKR/resource/template/StageAnnihilation.png b/resource/global/YoStarKR/resource/template/StageAnnihilation.png new file mode 100644 index 0000000000..0ec711936e Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StageAnnihilation.png differ diff --git a/resource/global/YoStarKR/resource/template/StageDrops-DropType-ExpAndLMB.png b/resource/global/YoStarKR/resource/template/StageDrops-DropType-ExpAndLMB.png new file mode 100644 index 0000000000..cee5b62140 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StageDrops-DropType-ExpAndLMB.png differ diff --git a/resource/global/YoStarKR/resource/template/StageDrops-DropType-Extra.png b/resource/global/YoStarKR/resource/template/StageDrops-DropType-Extra.png new file mode 100644 index 0000000000..28c06adfd8 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StageDrops-DropType-Extra.png differ diff --git a/resource/global/YoStarKR/resource/template/StageDrops-DropType-Furniture.png b/resource/global/YoStarKR/resource/template/StageDrops-DropType-Furniture.png new file mode 100644 index 0000000000..9a568e6a88 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StageDrops-DropType-Furniture.png differ diff --git a/resource/global/YoStarKR/resource/template/StageDrops-DropType-Normal.png b/resource/global/YoStarKR/resource/template/StageDrops-DropType-Normal.png new file mode 100644 index 0000000000..99597dde79 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StageDrops-DropType-Normal.png differ diff --git a/resource/global/YoStarKR/resource/template/StageDrops-DropType-Reward.png b/resource/global/YoStarKR/resource/template/StageDrops-DropType-Reward.png new file mode 100644 index 0000000000..cf1e7a1799 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StageDrops-DropType-Reward.png differ diff --git a/resource/global/YoStarKR/resource/template/StageDrops-DropType-Sanity.png b/resource/global/YoStarKR/resource/template/StageDrops-DropType-Sanity.png new file mode 100644 index 0000000000..e17cb146a0 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StageDrops-DropType-Sanity.png differ diff --git a/resource/global/YoStarKR/resource/template/StageDrops-DropType-Special.png b/resource/global/YoStarKR/resource/template/StageDrops-DropType-Special.png new file mode 100644 index 0000000000..a23b7fe065 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StageDrops-DropType-Special.png differ diff --git a/resource/global/YoStarKR/resource/template/StartButton2.png b/resource/global/YoStarKR/resource/template/StartButton2.png index 40e0545d8b..18545cb089 100644 Binary files a/resource/global/YoStarKR/resource/template/StartButton2.png and b/resource/global/YoStarKR/resource/template/StartButton2.png differ diff --git a/resource/global/YoStarKR/resource/template/StartToVisit.png b/resource/global/YoStarKR/resource/template/StartToVisit.png new file mode 100644 index 0000000000..ad06ab84d5 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StartToVisit.png differ diff --git a/resource/global/YoStarKR/resource/template/StartToWakeUp.png b/resource/global/YoStarKR/resource/template/StartToWakeUp.png new file mode 100644 index 0000000000..da6a9b64cb Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StartToWakeUp.png differ diff --git a/resource/global/YoStarKR/resource/template/StartUpConnectingFlag.png b/resource/global/YoStarKR/resource/template/StartUpConnectingFlag.png new file mode 100644 index 0000000000..733c364140 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StartUpConnectingFlag.png differ diff --git a/resource/global/YoStarKR/resource/template/StationedNotClicked.png b/resource/global/YoStarKR/resource/template/StationedNotClicked.png new file mode 100644 index 0000000000..ed34077206 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StationedNotClicked.png differ diff --git a/resource/global/YoStarKR/resource/template/StationedOnClicked.png b/resource/global/YoStarKR/resource/template/StationedOnClicked.png new file mode 100644 index 0000000000..d52cb0095c Binary files /dev/null and b/resource/global/YoStarKR/resource/template/StationedOnClicked.png differ diff --git a/resource/global/YoStarKR/resource/template/Task.png b/resource/global/YoStarKR/resource/template/Task.png new file mode 100644 index 0000000000..a3a26c1b8a Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Task.png differ diff --git a/resource/global/YoStarKR/resource/template/Terminal.png b/resource/global/YoStarKR/resource/template/Terminal.png new file mode 100644 index 0000000000..ef40ea6e08 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Terminal.png differ diff --git a/resource/global/YoStarKR/resource/template/Trade.png b/resource/global/YoStarKR/resource/template/Trade.png new file mode 100644 index 0000000000..c22c5bad77 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/Trade.png differ diff --git a/resource/global/YoStarKR/resource/template/TradeMini.png b/resource/global/YoStarKR/resource/template/TradeMini.png new file mode 100644 index 0000000000..ef4fc35a2b Binary files /dev/null and b/resource/global/YoStarKR/resource/template/TradeMini.png differ diff --git a/resource/global/YoStarKR/resource/template/UnlockClues.png b/resource/global/YoStarKR/resource/template/UnlockClues.png new file mode 100644 index 0000000000..de7af20864 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/UnlockClues.png differ diff --git a/resource/global/YoStarKR/resource/template/UsePrts-Annihilation.png b/resource/global/YoStarKR/resource/template/UsePrts-Annihilation.png new file mode 100644 index 0000000000..678aff23d7 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/UsePrts-Annihilation.png differ diff --git a/resource/global/YoStarKR/resource/template/UsePrts.png b/resource/global/YoStarKR/resource/template/UsePrts.png index 3f58c1051d..064b6585f5 100644 Binary files a/resource/global/YoStarKR/resource/template/UsePrts.png and b/resource/global/YoStarKR/resource/template/UsePrts.png differ diff --git a/resource/global/YoStarKR/resource/template/VisitLimited.png b/resource/global/YoStarKR/resource/template/VisitLimited.png new file mode 100644 index 0000000000..cc0210c878 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/VisitLimited.png differ diff --git a/resource/global/YoStarKR/resource/template/VisitNext.png b/resource/global/YoStarKR/resource/template/VisitNext.png new file mode 100644 index 0000000000..048bea7b67 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/VisitNext.png differ diff --git a/resource/global/YoStarKR/resource/template/VisitNextBlack.png b/resource/global/YoStarKR/resource/template/VisitNextBlack.png new file mode 100644 index 0000000000..f028aeef51 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/VisitNextBlack.png differ diff --git a/resource/global/YoStarKR/resource/template/WeeklyTask.png b/resource/global/YoStarKR/resource/template/WeeklyTask.png new file mode 100644 index 0000000000..4ea3511b21 Binary files /dev/null and b/resource/global/YoStarKR/resource/template/WeeklyTask.png differ diff --git a/resource/global/txwy/resource/tasks.json b/resource/global/txwy/resource/tasks.json index f27cb68769..1a5fbf11eb 100644 --- a/resource/global/txwy/resource/tasks.json +++ b/resource/global/txwy/resource/tasks.json @@ -11,477 +11,6 @@ "LS5@StageLS" ] }, - "StartButton1": { - "text": [ - "開始行動" - ] - }, - "PRTS3": { - "text": [ - "可放置角色" - ] - }, - "RecruitFlag": { - "text": [ - "公開招募" - ] - }, - "TodaysSupplies": { - "text": [ - "今日配給" - ] - }, - "Loading": { - "text": [ - "正在提交", - "反饋至神經" - ] - }, - "StartRecruit": { - "text": [ - "開始招" - ] - }, - "RecruitNow": { - "text": [ - "立即招" - ] - }, - "Roguelike@FromIntegratedStrategies": { - "text": [ - "進入主題" - ] - }, - "RoguelikeRecruitLevel": { - "Doc": "台服的等级字体比国服大一圈,要改roi", - "rectMove": [ - -172, - -1, - 18, - 12 - ] - }, - "RecruitTags": { - "ocrReplace": [ - [ - "初期", - "新手" - ], - [ - "乾員", - "干员" - ], - [ - "幹員", - "干员" - ], - [ - "翰員", - "干员" - ], - [ - "資深", - "资深" - ], - [ - "高級資深", - "高级资深" - ], - [ - "近戰位", - "近战位" - ], - [ - "遠程位", - "远程位" - ], - [ - "近衛", - "近卫" - ], - [ - "醫療", - "医疗" - ], - [ - "先鋒", - "先锋" - ], - [ - "術師", - "术师" - ], - [ - "衛師", - "术师" - ], - [ - "狙擎", - "狙击" - ], - [ - "狙搫", - "狙击" - ], - [ - "狙犟", - "狙击" - ], - [ - "狙擊", - "狙击" - ], - [ - "重裝", - "重装" - ], - [ - "輔.*助", - "辅助" - ], - [ - "特種", - "特种" - ], - [ - "治療", - "治疗" - ], - [ - "支援", - "支援" - ], - [ - "輸出", - "输出" - ], - [ - "群攻", - "群攻" - ], - [ - "減速", - "减速" - ], - [ - "生存", - "生存" - ], - [ - "防護", - "防护" - ], - [ - "削弱", - "削弱" - ], - [ - "位移", - "位移" - ], - [ - "控場", - "控场" - ], - [ - "爆發", - "爆发" - ], - [ - "召喚", - "召唤" - ], - [ - "快速復活", - "快速复活" - ], - [ - "回復", - "回复" - ], - [ - "費用回.+", - "费用回复" - ], - [ - "支援機械", - "支援机械" - ] - ] - }, - "BattleStageName": { - "Doc": "该任务的 ocrReplace 被所有涉及Rouge-like的繁中识别任务复用", - "ocrReplace": [ - [ - "永無.*頭", - "永无尽头" - ], - [ - "與蟲為伴", - "与虫为伴" - ], - [ - "馴獸小屋", - "驯兽小屋" - ], - [ - "禮炮小隊", - "礼炮小队" - ], - [ - "落魄騎士", - "落魄骑士" - ], - [ - "巡邏隊", - "巡逻队" - ], - [ - "壓軸登場", - "压轴登场" - ], - [ - "正義", - "正义" - ], - [ - "似曾相識", - "似曾相识" - ], - [ - "無序盛宴", - "无序盛宴" - ], - [ - "酒商運輸隊", - "酒商运输队" - ], - [ - "邪異囚籠", - "邪异囚笼" - ], - [ - "從眾效應", - "从众效应" - ], - [ - "從累效應", - "从众效应" - ], - [ - "薩卡茲的渴求", - "萨卡兹的渴求" - ], - [ - "鬥獸籠", - "斗兽笼" - ], - [ - "烏薩斯的渴求", - "乌萨斯的渴求" - ], - [ - "這位烏薩斯人", - "这位乌萨斯人" - ], - [ - "巡邏隊", - "巡逻队" - ], - [ - "步步緊逼", - "步步紧逼" - ], - [ - "陰雲籠罩", - "阴云笼罩" - ], - [ - "煙火秀", - "烟花秀" - ], - [ - "馴獸小屋", - "驯兽小屋" - ], - [ - "遠方來客", - "远方来客" - ], - [ - "禮炮小隊", - "礼炮小队" - ], - [ - "鮑勃酒品", - "鲍勃酒品" - ], - [ - "與蟲為伴", - "与虫为伴" - ], - [ - "無人機起降庫", - "无人机起降库" - ], - [ - "紅霧彌漫", - "红雾弥漫" - ], - [ - "儀式之夜", - "仪式之夜" - ], - [ - "徹骨冰寒", - "彻骨冰寒" - ], - [ - "危機四伏", - "危机四伏" - ], - [ - "驚喜工廠", - "惊喜工厂" - ], - [ - "荒唐把戲", - "荒唐把戏" - ], - [ - "薩卡茲的渴求", - "萨卡兹的渴求" - ], - [ - "開門請當心", - "开门请当心" - ], - [ - "烏薩斯的渴求", - "乌萨斯的渴求" - ], - [ - "大盜當頭", - "大盗当头" - ], - [ - "恐怖傳說", - "恐怖传说" - ], - [ - "悅耳殺機", - "悦耳杀机" - ], - [ - "寒淵惜別", - "寒渊惜别" - ], - [ - "覆水難收", - "覆水难收" - ], - [ - "別無所求", - "别无所求" - ], - [ - "諸事不順", - "诸事不顺" - ], - [ - "鴨爵的戲劇", - "鸭爵的戏剧" - ], - [ - "鴨爵的宴會", - "鸭爵的宴会" - ], - [ - "分贓不均", - "分赃不均" - ], - [ - "分臟不均", - "分赃不均" - ], - [ - "“騎士對決”", - "“骑士对决”" - ], - [ - "壓軸登場", - "压轴登场" - ], - [ - "落魄騎士", - "落魄骑士" - ], - [ - "正義", - "正义" - ], - [ - "似曾相識", - "似曾相识" - ], - [ - "酒商運輸隊", - "酒商运输队" - ], - [ - "鬥獸籠", - "斗兽笼" - ], - [ - "步步緊逼", - "步步紧逼" - ], - [ - "陰雲籠罩", - "阴云笼罩" - ], - [ - "煙火秀", - "烟花秀" - ], - [ - "遠方來客", - "远方来客" - ], - [ - "鮑勃酒品", - "鲍勃酒品" - ], - [ - "無人機起降庫", - "无人机起降库" - ], - [ - "紅霧彌漫", - "红雾弥漫" - ], - [ - "儀式之夜", - "仪式之夜" - ], - [ - "徹骨冰寒", - "彻骨冰寒" - ], - [ - "危機四伏", - "危机四伏" - ], - [ - "驚喜工廠", - "惊喜工厂" - ], - [ - "荒唐把戲", - "荒唐把戏" - ] - ] - }, "CharsNameOcrReplace": { "Doc": "该任务的 ocrReplace 被所有涉及干员名的English Name识别任务复用", "ocrReplace": [ @@ -1195,6 +724,548 @@ ] ] }, + "TodaysSupplies": { + "text": [ + "今日配給" + ] + }, + "Loading": { + "text": [ + "正在提交", + "反饋至神經" + ] + }, + "StartButton1": { + "text": [ + "開始行動" + ] + }, + "PRTS3": { + "text": [ + "可放置角色" + ] + }, + "StartRecruit": { + "text": [ + "開始招" + ] + }, + "RecruitFlag": { + "text": [ + "公開招募" + ] + }, + "RecruitNow": { + "text": [ + "立即招" + ] + }, + "RecruitTags": { + "ocrReplace": [ + [ + "初期", + "新手" + ], + [ + "乾員", + "干员" + ], + [ + "幹員", + "干员" + ], + [ + "翰員", + "干员" + ], + [ + "資深", + "资深" + ], + [ + "高級資深", + "高级资深" + ], + [ + "近戰位", + "近战位" + ], + [ + "遠程位", + "远程位" + ], + [ + "近衛", + "近卫" + ], + [ + "醫療", + "医疗" + ], + [ + "先鋒", + "先锋" + ], + [ + "術師", + "术师" + ], + [ + "衛師", + "术师" + ], + [ + "狙擎", + "狙击" + ], + [ + "狙搫", + "狙击" + ], + [ + "狙犟", + "狙击" + ], + [ + "狙擊", + "狙击" + ], + [ + "重裝", + "重装" + ], + [ + "輔.*助", + "辅助" + ], + [ + "特種", + "特种" + ], + [ + "治療", + "治疗" + ], + [ + "支援", + "支援" + ], + [ + "輸出", + "输出" + ], + [ + "群攻", + "群攻" + ], + [ + "減速", + "减速" + ], + [ + "生存", + "生存" + ], + [ + "防護", + "防护" + ], + [ + "削弱", + "削弱" + ], + [ + "位移", + "位移" + ], + [ + "控場", + "控场" + ], + [ + "爆發", + "爆发" + ], + [ + "召喚", + "召唤" + ], + [ + "快速復活", + "快速复活" + ], + [ + "回復", + "回复" + ], + [ + "費用回.+", + "费用回复" + ], + [ + "支援機械", + "支援机械" + ] + ] + }, + "InfrastReward": { + "text": [ + "可收獲", + "訂單交付", + "幹員信賴" + ] + }, + "InfrastStationedInfo": { + "text": [ + "進駐資訊" + ] + }, + "InfrastEnterOperList": { + "text": [ + "心情", + "休息中", + "工作中", + "進駐" + ] + }, + "BattleStageName": { + "Doc": "该任务的 ocrReplace 被所有涉及Rouge-like的繁中识别任务复用", + "ocrReplace": [ + [ + "永無.*頭", + "永无尽头" + ], + [ + "與蟲為伴", + "与虫为伴" + ], + [ + "馴獸小屋", + "驯兽小屋" + ], + [ + "禮炮小隊", + "礼炮小队" + ], + [ + "落魄騎士", + "落魄骑士" + ], + [ + "巡邏隊", + "巡逻队" + ], + [ + "壓軸登場", + "压轴登场" + ], + [ + "正義", + "正义" + ], + [ + "似曾相識", + "似曾相识" + ], + [ + "無序盛宴", + "无序盛宴" + ], + [ + "酒商運輸隊", + "酒商运输队" + ], + [ + "邪異囚籠", + "邪异囚笼" + ], + [ + "從眾效應", + "从众效应" + ], + [ + "從累效應", + "从众效应" + ], + [ + "薩卡茲的渴求", + "萨卡兹的渴求" + ], + [ + "鬥獸籠", + "斗兽笼" + ], + [ + "烏薩斯的渴求", + "乌萨斯的渴求" + ], + [ + "這位烏薩斯人", + "这位乌萨斯人" + ], + [ + "巡邏隊", + "巡逻队" + ], + [ + "步步緊逼", + "步步紧逼" + ], + [ + "陰雲籠罩", + "阴云笼罩" + ], + [ + "煙火秀", + "烟花秀" + ], + [ + "馴獸小屋", + "驯兽小屋" + ], + [ + "遠方來客", + "远方来客" + ], + [ + "禮炮小隊", + "礼炮小队" + ], + [ + "鮑勃酒品", + "鲍勃酒品" + ], + [ + "與蟲為伴", + "与虫为伴" + ], + [ + "無人機起降庫", + "无人机起降库" + ], + [ + "紅霧彌漫", + "红雾弥漫" + ], + [ + "儀式之夜", + "仪式之夜" + ], + [ + "徹骨冰寒", + "彻骨冰寒" + ], + [ + "危機四伏", + "危机四伏" + ], + [ + "驚喜工廠", + "惊喜工厂" + ], + [ + "荒唐把戲", + "荒唐把戏" + ], + [ + "薩卡茲的渴求", + "萨卡兹的渴求" + ], + [ + "開門請當心", + "开门请当心" + ], + [ + "烏薩斯的渴求", + "乌萨斯的渴求" + ], + [ + "大盜當頭", + "大盗当头" + ], + [ + "恐怖傳說", + "恐怖传说" + ], + [ + "悅耳殺機", + "悦耳杀机" + ], + [ + "寒淵惜別", + "寒渊惜别" + ], + [ + "覆水難收", + "覆水难收" + ], + [ + "別無所求", + "别无所求" + ], + [ + "諸事不順", + "诸事不顺" + ], + [ + "鴨爵的戲劇", + "鸭爵的戏剧" + ], + [ + "鴨爵的宴會", + "鸭爵的宴会" + ], + [ + "分贓不均", + "分赃不均" + ], + [ + "分臟不均", + "分赃不均" + ], + [ + "“騎士對決”", + "“骑士对决”" + ], + [ + "壓軸登場", + "压轴登场" + ], + [ + "落魄騎士", + "落魄骑士" + ], + [ + "正義", + "正义" + ], + [ + "似曾相識", + "似曾相识" + ], + [ + "酒商運輸隊", + "酒商运输队" + ], + [ + "鬥獸籠", + "斗兽笼" + ], + [ + "步步緊逼", + "步步紧逼" + ], + [ + "陰雲籠罩", + "阴云笼罩" + ], + [ + "煙火秀", + "烟花秀" + ], + [ + "遠方來客", + "远方来客" + ], + [ + "鮑勃酒品", + "鲍勃酒品" + ], + [ + "無人機起降庫", + "无人机起降库" + ], + [ + "紅霧彌漫", + "红雾弥漫" + ], + [ + "儀式之夜", + "仪式之夜" + ], + [ + "徹骨冰寒", + "彻骨冰寒" + ], + [ + "危機四伏", + "危机四伏" + ], + [ + "驚喜工廠", + "惊喜工厂" + ], + [ + "荒唐把戲", + "荒唐把戏" + ] + ] + }, + "Roguelike@FromIntegratedStrategies": { + "text": [ + "進入主題" + ] + }, + "RoguelikeCustom-HijackCoChar": { + "ocrReplace": [ + [ + "術師", + "术师" + ], + [ + "醫療", + "医疗" + ], + [ + "先鋒", + "先锋" + ], + [ + "狙擊", + "狙击" + ], + [ + "特種", + "特种" + ], + [ + "輔助", + "辅助" + ], + [ + "重裝", + "重装" + ], + [ + "近衛", + "近卫" + ] + ] + }, + "RoguelikeCustom-HijackRoles": { + "ocrReplace": [ + [ + "先手必勝", + "先手必胜" + ], + [ + "稳.*稳打", + "稳扎稳打" + ], + [ + "穩.*穩打", + "稳扎稳打" + ], + [ + "取長補(短|矩)", + "取长补短" + ], + [ + "隨心所欲", + "随心所欲" + ] + ] + }, "RoguelikeCustom-HijackSquad": { "ocrReplace": [ [ @@ -1239,64 +1310,13 @@ ] ] }, - "RoguelikeCustom-HijackRoles": { - "ocrReplace": [ - [ - "先手必勝", - "先手必胜" - ], - [ - "稳.*稳打", - "稳扎稳打" - ], - [ - "穩.*穩打", - "稳扎稳打" - ], - [ - "取長補(短|矩)", - "取长补短" - ], - [ - "隨心所欲", - "随心所欲" - ] - ] - }, - "RoguelikeCustom-HijackCoChar": { - "ocrReplace": [ - [ - "術師", - "术师" - ], - [ - "醫療", - "医疗" - ], - [ - "先鋒", - "先锋" - ], - [ - "狙擊", - "狙击" - ], - [ - "特種", - "特种" - ], - [ - "輔助", - "辅助" - ], - [ - "重裝", - "重装" - ], - [ - "近衛", - "近卫" - ] + "RoguelikeRecruitLevel": { + "Doc": "台服的等级字体比国服大一圈,要改roi", + "rectMove": [ + -172, + -1, + 18, + 12 ] }, "RoguelikeTraderShoppingOcr": { @@ -2246,25 +2266,5 @@ "《欢欣鼓舞》" ] ] - }, - "InfrastReward": { - "text": [ - "可收獲", - "訂單交付", - "幹員信賴" - ] - }, - "InfrastStationedInfo": { - "text": [ - "進駐資訊" - ] - }, - "InfrastEnterOperList": { - "text": [ - "心情", - "休息中", - "工作中", - "進駐" - ] } -} +} \ No newline at end of file diff --git a/resource/roguelike_copilot.json b/resource/roguelike/copilot.json similarity index 100% rename from resource/roguelike_copilot.json rename to resource/roguelike/copilot.json diff --git a/resource/roguelike_recruit.json b/resource/roguelike/recruitment.json similarity index 99% rename from resource/roguelike_recruit.json rename to resource/roguelike/recruitment.json index ffce518e06..de7a7d5336 100644 --- a/resource/roguelike_recruit.json +++ b/resource/roguelike/recruitment.json @@ -167,7 +167,7 @@ { "name": "艾丽妮", "skill": 3, - "alternate_skill": 2, + "alternate_skill": 1, "recruit_priority": 750, "promote_priority": 750, "offset_melee": true, diff --git a/resource/roguelike_shopping.json b/resource/roguelike/shopping.json similarity index 100% rename from resource/roguelike_shopping.json rename to resource/roguelike/shopping.json diff --git a/resource/tasks.json b/resource/tasks.json index 08ec6f8d97..bcdc961965 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -187,6 +187,16 @@ "action": "ClickRect", "isAscii": true, "text": [], + "ocrReplace": [ + [ + " ", + "" + ], + [ + "EPIS0DE", + "EPISODE" + ] + ], "roi": [ 16, 219, @@ -214,57 +224,57 @@ }, "01@EnterEpisode": { "text": [ - "01" + "EPISODE01" ] }, "02@EnterEpisode": { "text": [ - "02" + "EPISODE02" ] }, "03@EnterEpisode": { "text": [ - "03" + "EPISODE03" ] }, "04@EnterEpisode": { "text": [ - "04" + "EPISODE04" ] }, "05@EnterEpisode": { "text": [ - "05" + "EPISODE05" ] }, "06@EnterEpisode": { "text": [ - "06" + "EPISODE06" ] }, "07@EnterEpisode": { "text": [ - "07" + "EPISODE07" ] }, "08@EnterEpisode": { "text": [ - "08" + "EPISODE08" ] }, "09@EnterEpisode": { "text": [ - "09" + "EPISODE09" ] }, "10@EnterEpisode": { "text": [ - "10" + "EPISODE10" ] }, "11@EnterEpisode": { "text": [ - "11" + "EPISODE11" ] }, "LevelOfDifficulty": { @@ -294,21 +304,21 @@ 122 ] }, - "Hard": { + "ChapterDifficultyHard": { "baseTask": "LevelOfDifficulty", "next": [ - "EnterHard", + "EnterChapterDifficultyHard", "Return" ] }, - "Normal": { + "ChapterDifficultyNormal": { "baseTask": "LevelOfDifficulty", "next": [ - "EnterNormal", + "EnterChapterDifficultyNormal", "Return" ] }, - "EnterHard": { + "EnterChapterDifficultyHard": { "algorithm": "OcrDetect", "action": "ClickSelf", "text": [ @@ -321,7 +331,7 @@ 145 ] }, - "EnterNormal": { + "EnterChapterDifficultyNormal": { "algorithm": "OcrDetect", "action": "ClickSelf", "text": [ @@ -340,6 +350,16 @@ "action": "Swipe", "isAscii": true, "text": [], + "ocrReplace": [ + [ + " ", + "" + ], + [ + "EPIS0DE", + "EPISODE" + ] + ], "roi": [ 16, 219, @@ -358,6 +378,12 @@ 10, 10 ], + "specialParams": [ + 200, + 0, + 2, + 0 + ], "maxTimes": 20, "next": [ "EnterEpisode", @@ -367,23 +393,23 @@ }, "11@SwipeLeftToEpisode": { "text": [ - "12", - "13" + "EPISODE12", + "EPISODE13" ] }, "10@SwipeLeftToEpisode": { "text": [ - "11", - "12", - "13" + "EPISODE11", + "EPISODE12", + "EPISODE13" ] }, "09@SwipeLeftToEpisode": { "text": [ - "10", - "11", - "12", - "13" + "EPISODE10", + "EPISODE11", + "EPISODE12", + "EPISODE13" ] }, "08@SwipeLeftToEpisode": { @@ -393,28 +419,28 @@ }, "07@SwipeLeftToEpisode": { "text": [ - "08" + "EPISODE08" ] }, "06@SwipeLeftToEpisode": { "text": [ - "07", - "08" + "EPISODE07", + "EPISODE08" ] }, "05@SwipeLeftToEpisode": { "text": [ - "06", - "07", - "08" + "EPISODE06", + "EPISODE07", + "EPISODE08" ] }, "04@SwipeLeftToEpisode": { "text": [ - "05", - "06", - "07", - "08" + "EPISODE05", + "EPISODE06", + "EPISODE07", + "EPISODE08" ] }, "03@SwipeLeftToEpisode": { @@ -424,20 +450,20 @@ }, "02@SwipeLeftToEpisode": { "text": [ - "03" + "EPISODE03" ] }, "01@SwipeLeftToEpisode": { "text": [ - "02", - "03" + "EPISODE02", + "EPISODE03" ] }, "00@SwipeLeftToEpisode": { "text": [ - "01", - "02", - "03" + "EPISODE01", + "EPISODE02", + "EPISODE03" ] }, "StageNavigationBegin": { @@ -451,10 +477,6 @@ "Doc": "右滑五次,然后检测关卡并左滑", "Doc2": "在一次关卡导航中,仅swipe五次,其余情况进exceededNext", "baseTask": "ChapterSwipeToTheRight", - "next": [ - "#self" - ], - "maxTimes": 5, "exceededNext": [ "ClickStageName", "StageNavigationSlowlySwipeLeft" @@ -480,7 +502,7 @@ "exceededNext": [ "Home@ReturnTo" ], - "maxTimes": 10 + "maxTimes": 20 }, "ClickedCorrectStageOrSwipe": { "baseTask": "StartButton1", @@ -607,16 +629,17 @@ ] }, "ChapterSlowlySwipeToTheLeft": { + "Doc": "在上面一点滑避免点到关卡划不动", "baseTask": "SlowlySwipeToTheLeft", "specificRect": [ - 300, - 350, + 200, + 100, 20, 20 ], "rectMove": [ - 900, - 350, + 1000, + 100, 20, 20 ] @@ -625,31 +648,52 @@ "baseTask": "SlowlySwipeToTheRight", "specificRect": [ 900, - 350, + 100, 20, 20 ], "rectMove": [ 300, - 350, + 100, 20, 20 ] }, "ChapterSwipeToTheLeft": { + "Doc": "滑动到最左", "baseTask": "ChapterSlowlySwipeToTheLeft", "specialParams": [ 150, 0, 0.5 - ] + ], + "next": [ + "#self" + ], + "maxTimes": 5 }, "ChapterSwipeToTheRight": { + "Doc": "滑动到最右", "baseTask": "ChapterSlowlySwipeToTheRight", "specialParams": [ 150, 0, 0.5 + ], + "next": [ + "#self" + ], + "maxTimes": 5 + }, + "SwipeToStage": { + "Doc": "活动导航左滑找关", + "baseTask": "ChapterSlowlySwipeToTheLeft", + "specialParams": [ + 150, + 1 + ], + "next": [ + "#next" ] }, "SwipeLeftToStage1-7": { @@ -818,6 +862,7 @@ ] }, "SwipeToStageIS": { + "Doc": "IS关特殊的上下滑动", "algorithm": "JustReturn", "action": "Swipe", "specificRect": [ @@ -889,7 +934,7 @@ ], "next": [ "StageNL-10", - "SwipeToStageNL-10" + "NL-10@SwipeToStage" ] }, "NL-9": { @@ -900,7 +945,7 @@ ], "next": [ "StageNL-9", - "SwipeToStageNL-9" + "NL-9@SwipeToStage" ] }, "NL-8": { @@ -911,7 +956,7 @@ ], "next": [ "StageNL-8", - "SwipeToStageNL-8" + "NL-8@SwipeToStage" ] }, "NL-Open": { @@ -945,30 +990,6 @@ "ChapterSwipeToTheRight" ] }, - "SwipeToStageNL-10": { - "algorithm": "JustReturn", - "baseTask": "ChapterSlowlySwipeToTheLeft", - "next": [ - "StageNL-10", - "SwipeToStageNL-10" - ] - }, - "SwipeToStageNL-9": { - "algorithm": "JustReturn", - "baseTask": "ChapterSlowlySwipeToTheLeft", - "next": [ - "StageNL-9", - "SwipeToStageNL-9" - ] - }, - "SwipeToStageNL-8": { - "algorithm": "JustReturn", - "baseTask": "ChapterSlowlySwipeToTheLeft", - "next": [ - "StageNL-8", - "SwipeToStageNL-8" - ] - }, "StageNL-10": { "algorithm": "OcrDetect", "action": "ClickSelf", @@ -1128,7 +1149,8 @@ "cache": false, "isAscii": true, "text": [ - "OF-F3" + "OF-F3", + "0F-F3" ] }, "StageOF-1": { @@ -1137,7 +1159,8 @@ "cache": false, "isAscii": true, "text": [ - "OF-1" + "OF-1", + "0F-1" ] }, "IC-9": { @@ -1148,7 +1171,7 @@ ], "next": [ "StageIC-9", - "SwipeToStageIC-9" + "IC-9@SwipeToStage" ] }, "IC-8": { @@ -1159,7 +1182,7 @@ ], "next": [ "StageIC-8", - "SwipeToStageIC-8" + "IC-8@SwipeToStage" ] }, "IC-7": { @@ -1170,7 +1193,7 @@ ], "next": [ "StageIC-7", - "SwipeToStageIC-7" + "IC-7@SwipeToStage" ] }, "IC-Open": { @@ -1200,30 +1223,6 @@ "ChapterSwipeToTheRight" ] }, - "SwipeToStageIC-9": { - "algorithm": "JustReturn", - "baseTask": "ChapterSlowlySwipeToTheLeft", - "next": [ - "StageIC-9", - "SwipeToStageIC-9" - ] - }, - "SwipeToStageIC-8": { - "algorithm": "JustReturn", - "baseTask": "ChapterSlowlySwipeToTheLeft", - "next": [ - "StageIC-8", - "SwipeToStageIC-8" - ] - }, - "SwipeToStageIC-7": { - "algorithm": "JustReturn", - "baseTask": "ChapterSlowlySwipeToTheLeft", - "next": [ - "StageIC-7", - "SwipeToStageIC-7" - ] - }, "StageIC-9": { "algorithm": "OcrDetect", "action": "ClickSelf", @@ -1280,7 +1279,7 @@ ], "next": [ "StageDV-8", - "SwipeToStageDV-8" + "DV-8@SwipeToStage" ] }, "DV-7": { @@ -1291,7 +1290,7 @@ ], "next": [ "StageDV-7", - "SwipeToStageDV-7" + "DV-7@SwipeToStage" ] }, "DV-6": { @@ -1302,7 +1301,7 @@ ], "next": [ "StageDV-6", - "SwipeToStageDV-6" + "DV-6@SwipeToStage" ] }, "DV-Open": { @@ -1342,30 +1341,6 @@ "ChapterSwipeToTheRight" ] }, - "SwipeToStageDV-8": { - "algorithm": "JustReturn", - "baseTask": "ChapterSlowlySwipeToTheLeft", - "next": [ - "StageDV-8", - "SwipeToStageDV-8" - ] - }, - "SwipeToStageDV-7": { - "algorithm": "JustReturn", - "baseTask": "ChapterSlowlySwipeToTheLeft", - "next": [ - "StageDV-7", - "SwipeToStageDV-7" - ] - }, - "SwipeToStageDV-6": { - "algorithm": "JustReturn", - "baseTask": "ChapterSlowlySwipeToTheLeft", - "next": [ - "StageDV-6", - "SwipeToStageDV-6" - ] - }, "StageDV-8": { "algorithm": "OcrDetect", "action": "ClickSelf", @@ -1420,7 +1395,7 @@ ], "next": [ "StageLE-5", - "SwipeToStageLE-5" + "LE-5@SwipeToStage" ] }, "LE-6": { @@ -1432,7 +1407,7 @@ ], "next": [ "StageLE-6", - "SwipeToStageLE-6" + "LE-6@SwipeToStage" ] }, "LE-7": { @@ -1444,7 +1419,7 @@ ], "next": [ "StageLE-7", - "SwipeToStageLE-7" + "LE-7@SwipeToStage" ] }, "LE-Open": { @@ -1473,30 +1448,6 @@ "ChapterSwipeToTheRight" ] }, - "SwipeToStageLE-5": { - "algorithm": "JustReturn", - "baseTask": "ChapterSlowlySwipeToTheLeft", - "next": [ - "StageLE-5", - "SwipeToStageLE-5" - ] - }, - "SwipeToStageLE-6": { - "algorithm": "JustReturn", - "baseTask": "ChapterSlowlySwipeToTheLeft", - "next": [ - "StageLE-6", - "SwipeToStageLE-6" - ] - }, - "SwipeToStageLE-7": { - "algorithm": "JustReturn", - "baseTask": "ChapterSlowlySwipeToTheLeft", - "next": [ - "StageLE-7", - "SwipeToStageLE-7" - ] - }, "StageLE-5": { "algorithm": "OcrDetect", "action": "ClickSelf", @@ -1631,13 +1582,28 @@ 200 ] }, + "BI-6": { + "algorithm": "JustReturn", + "action": "DoNothing", + "sub": [ + "BI-Open", + "BIChapterToBI" + ], + "next": [ + "StageBI-6", + "BI-6@SwipeToStage" + ] + }, "BI-7": { "algorithm": "JustReturn", "action": "DoNothing", "sub": [ "BI-Open", - "StageBI", - "StageBI7" + "BIChapterToBI" + ], + "next": [ + "StageBI-7", + "BI-7@SwipeToStage" ] }, "BI-8": { @@ -1645,11 +1611,15 @@ "action": "DoNothing", "sub": [ "BI-Open", - "StageBI", - "StageBI8" + "BIChapterToBI" + ], + "next": [ + "StageBI-8", + "BI-8@SwipeToStage" ] }, "BI-Open": { + "action": "ClickSelf", "algorithm": "OcrDetect", "text": [ "风雪过境" @@ -1661,7 +1631,7 @@ 150 ] }, - "StageBI": { + "BIChapterToBI": { "action": "ClickSelf", "roi": [ 1000, @@ -1669,28 +1639,55 @@ 280, 150 ], + "postDelay": 2000, "next": [ + "BIChapterToBI", "ChapterSwipeToTheRight" ] }, - "StageBI7": { + "StageBI-6": { "action": "ClickSelf", + "algorithm": "OcrDetect", + "text": [ + "B1-6", + "BI-6" + ], "cache": false, "roi": [ - 50, - 250, - 200, - 80 + 0, + 145, + 1280, + 332 ] }, - "StageBI8": { + "StageBI-7": { "action": "ClickSelf", + "algorithm": "OcrDetect", + "text": [ + "B1-7", + "BI-7" + ], "cache": false, "roi": [ - 200, - 350, - 200, - 80 + 0, + 145, + 1280, + 332 + ] + }, + "StageBI-8": { + "action": "ClickSelf", + "algorithm": "OcrDetect", + "text": [ + "B1-8", + "BI-8" + ], + "cache": false, + "roi": [ + 0, + 145, + 1280, + 332 ] }, "ResourceStages": { @@ -1728,7 +1725,7 @@ }, "PR-A-1": { "baseTask": "ResourceStages", - "doc": "医疗/重装", + "Doc": "医疗/重装", "next": [ "PR-A-1@StagePR-A", "PR-A-1@SwipeToTheRight" @@ -1743,7 +1740,7 @@ }, "PR-B-1": { "baseTask": "ResourceStages", - "doc": "术士/狙击", + "Doc": "术士/狙击", "next": [ "PR-B-1@StagePR-B", "PR-B-1@SwipeToTheRight" @@ -1758,7 +1755,7 @@ }, "PR-C-1": { "baseTask": "ResourceStages", - "doc": "先锋/辅助", + "Doc": "先锋/辅助", "next": [ "PR-C-1@StagePR-C", "PR-C-1@SwipeToTheRight" @@ -1773,7 +1770,7 @@ }, "PR-D-1": { "baseTask": "ResourceStages", - "doc": "近卫/特种", + "Doc": "近卫/特种", "next": [ "PR-D-1@StagePR-D", "PR-D-1@SwipeToTheRight" @@ -1788,7 +1785,7 @@ }, "StageResource": { "action": "ClickSelf", - "doc": "进入资源关卡", + "Doc": "进入资源关卡", "roi": [ 455, 562, @@ -1976,352 +1973,7 @@ "algorithm": "OcrDetect", "text": [], "Doc": "该任务的 ocrReplace 被所有涉及干员名的识别任务复用", - "ocrReplace": [ - [ - "【", - "" - ], - [ - "《", - "" - ], - [ - ".*SLAN", - "" - ], - [ - "白面.*", - "白面鸮" - ], - [ - "夜营", - "夜莺" - ], - [ - "蛇居箱", - "蛇屠箱" - ], - [ - ".*刺", - "棘刺" - ], - [ - "^E$", - "山" - ], - [ - "^口$", - "山" - ], - [ - "^F$", - "山" - ], - [ - "^U$", - "山" - ], - [ - "^1$", - "山" - ], - [ - "^中$", - "山" - ], - [ - "^上$", - "山" - ], - [ - "^云$", - "山" - ], - [ - "^峨$", - "嵯峨" - ], - [ - "姜哦", - "嵯峨" - ], - [ - "姜峨", - "嵯峨" - ], - [ - "健影", - "傀影" - ], - [ - "愧影", - "傀影" - ], - [ - "赤赤黑大", - "赫默" - ], - [ - "赤赤黑犬", - "赫默" - ], - [ - "赫黑大", - "赫默" - ], - [ - "^灵鲨", - "幽灵鲨" - ], - [ - "桑甚", - "桑葚" - ], - [ - "灰烟", - "灰烬" - ], - [ - "迷.*香", - "迷迭香" - ], - [ - "森.*", - "森蚺" - ], - [ - ".*心斯卡蒂", - "浊心斯卡蒂" - ], - [ - "斯卡蒂的海刷", - "斯卡蒂的海嗣" - ], - [ - "^会$", - "令" - ], - [ - "^心$", - "令" - ], - [ - "归.+幽灵鲨", - "归溟幽灵鲨" - ], - [ - "鞭便刃", - "鞭刃" - ], - [ - "险星", - "陨星" - ], - [ - "雪难", - "雪雉" - ], - [ - "雪雄", - "雪雉" - ], - [ - "狮竭", - "狮蝎" - ], - [ - "扬师虫", - "狮蝎" - ], - [ - "漂冬", - "凛冬" - ], - [ - "笔草", - "苇草" - ], - [ - "^草$", - "苇草" - ], - [ - "领习", - "翎羽" - ], - [ - "令羽.*", - "翎羽" - ], - [ - "令翎羽", - "翎羽" - ], - [ - "燃石", - "燧石" - ], - [ - "卡湿利安", - "卡涅利安" - ], - [ - "^研$", - "砾" - ], - [ - "紫雨", - "絮雨" - ], - [ - "罗比拉塔", - "罗比菈塔" - ], - [ - "罗比技塔", - "罗比菈塔" - ], - [ - "^叶$", - "吽" - ], - [ - "慢砂", - "慑砂" - ], - [ - "灌尘芙蓉", - "濯尘芙蓉" - ], - [ - "^子$", - "孑" - ], - [ - "凤笛", - "风笛" - ], - [ - "岚笛", - "风笛" - ], - [ - "罗比塔", - "罗比菈塔" - ], - [ - "惊垫", - "惊蛰" - ], - [ - "^惊$", - "惊蛰" - ], - [ - "^岁$", - "夕" - ], - [ - "特米来", - "特米米" - ], - [ - "^一岁$", - "夕" - ], - [ - "永月", - "水月" - ], - [ - "布亍", - "布丁" - ], - [ - "野景", - "野鬃" - ], - [ - "野素", - "野鬃" - ], - [ - "野繁", - "野鬃" - ], - [ - "野聚", - "野鬃" - ], - [ - "野紫", - "野鬃" - ], - [ - "^柏$", - "柏喙" - ], - [ - "柏哆", - "柏喙" - ], - [ - "^赤黑$", - "赤冬" - ], - [ - "福果", - "褐果" - ], - [ - "塞雷如", - "塞雷娅" - ], - [ - "限星", - "陨星" - ], - [ - "般子", - "骰子" - ], - [ - "8面子", - "8面骰子" - ], - [ - "伊柔", - "伊桑" - ], - [ - ".*默德克萨斯", - "缄默德克萨斯" - ], - [ - "霸霜叶", - "霜叶" - ], - [ - "千员", - "干员" - ], - [ - "克克洛丝", - "克洛丝" - ], - [ - "^影$", - "傀影" - ], - [ - "^桑芸$", - "桑葚" - ], - [ - "^罪$", - "斥罪" - ] - ] + "ocrReplace": [] }, "StartUpThemes": { "algorithm": "JustReturn", @@ -2624,7 +2276,7 @@ ] }, "Annihilation": { - "doc": "剿灭作战,一般本周的满了也不会有人再刷的,所以只识别右上角ToDoList里的剿灭就可以了", + "Doc": "剿灭作战,一般本周的满了也不会有人再刷的,所以只识别右上角ToDoList里的剿灭就可以了", "template": "StageAnnihilation.png", "templThreshold": 0.6, "cache": false, @@ -2699,6 +2351,16 @@ "StartButton1" ] }, + "NotUsePrts": { + "action": "ClickSelf", + "roi": [ + 1000, + 550, + 280, + 90 + ], + "cache": false + }, "UsePrts-Annihilation": { "Doc": "剿灭的“全权委托”按钮", "action": "ClickSelf", @@ -2933,18 +2595,21 @@ ] }, "EndOfActionThenStop": { + "baseTask": "EndOfAction", "template": "EndOfAction.png", - "roi": [ - 0, - 290, - 70, - 60 - ], + "reduceOtherTimes": [], "preDelay": 5000, "next": [ "ClickCornerThenStop" ] }, + "FightMissionFailedThenStop": { + "baseTask": "FightMissionFailedAndStop", + "preDelay": 5000, + "next": [ + "EndOfActionThenStop" + ] + }, "EndOfActionAnnihilation": { "algorithm": "OcrDetect", "Doc": "本任务注册了插件 StageDropsTaskPlugin", @@ -2989,15 +2654,8 @@ ] }, "ClickCornerThenStop": { - "ClickCorner_Doc": "点击屏幕右边,不会点到掉落物品,且不会关掉关卡选择的一块区域", - "algorithm": "JustReturn", - "action": "ClickRect", - "specificRect": [ - 1000, - 120, - 270, - 10 - ] + "baseTask": "ClickCorner", + "next": [] }, "UseMedicine": { "action": "DoNothing", @@ -4026,12 +3684,7 @@ "CreditShop-ProductName": { "algorithm": "OcrDetect", "text": [], - "ocrReplace": [ - [ - "龙门.*", - "龙门币" - ] - ], + "ocrReplace": [], "roi": [ 0, -30, @@ -4062,24 +3715,7 @@ 480, 120 ], - "ocrReplace": [ - [ - "千员", - "干员" - ], - [ - "王员", - "干员" - ], - [ - "手员", - "干员" - ], - [ - ".*击干员", - "狙击干员" - ] - ] + "ocrReplace": [] }, "RecruitRefresh": { "action": "ClickSelf", @@ -4127,11 +3763,12 @@ "Doc": "识别公招小时数", "algorithm": "OcrDetect", "isAscii": true, + "withoutDet": true, "roi": [ - 400, - 180, - 100, - 90 + 410, + 195, + 85, + 60 ], "text": [ "01", @@ -4149,11 +3786,12 @@ "Doc": "识别公招分钟数", "algorithm": "OcrDetect", "isAscii": true, + "withoutDet": true, "roi": [ - 570, - 180, - 100, - 90 + 575, + 195, + 85, + 60 ], "text": [ "00", @@ -5525,7 +5163,7 @@ }, "SendClueFlag": { "action": "DoNothing", - "doc": "这里识别的是自己的线索的new:如果获取完自己的线索、再获取完好友送的线索,自己的线索new还亮着,则说明自己的线索没获取成功,即线索满了", + "Doc": "这里识别的是自己的线索的new:如果获取完自己的线索、再获取完好友送的线索,自己的线索new还亮着,则说明自己的线索没获取成功,即线索满了", "next": [ "SendClues" ], @@ -5888,36 +5526,7 @@ "algorithm": "OcrDetect", "cache": false, "text": [], - "ocrReplace": [ - [ - ".*兽小屋", - "驯兽小屋" - ], - [ - "分.*不均", - "分赃不均" - ], - [ - "落.*骑士", - "落魄骑士" - ], - [ - "邪异.*笼", - "邪异囚笼" - ], - [ - "寒洲惜别", - "寒渊惜别" - ], - [ - "海.*沙暴", - "海窟沙暴" - ], - [ - ".*痕乐园", - "溟痕乐园" - ] - ], + "ocrReplace": [], "roi": [ 250, 435, @@ -5933,9 +5542,9 @@ 244, 167 ], - "postDelay": 1000, "next": [ - "BattleSupportUnitFormationSelect" + "BattleSupportUnitFormationSelect", + "BattleSupportUnitFormation" ] }, "BattleSupportUnitFormationSelect": { @@ -5946,7 +5555,10 @@ 1165, 75 ], - "postDelay": 1000 + "next": [ + "BattleSupportUnitFormationSelect", + "Stop" + ] }, "BattleQuickFormation": { "action": "ClickSelf", @@ -5958,7 +5570,8 @@ ], "postDelay": 1000, "next": [ - "BattleQuickFormationClear" + "BattleQuickFormationClear", + "BattleQuickFormation" ] }, "BattleQuickFormationClear": { @@ -6340,16 +5953,16 @@ "BattleUseOper": { "algorithm": "JustReturn", "preDelay": 100, - "postDelay": 150, + "postDelay": 200, "Doc": "pre 是从点击干员,到干员信息弹出来等待的时间;post 是干员上场,到设置朝向之间等待的时间" }, "BattleSwipeOper": { "algorithm": "JustReturn", - "preDelay": 200, - "postDelay": 80, + "preDelay": 400, + "postDelay": 150, "Doc": "pre 是将干员滑动到场上的 duration 系数;post 是设置干员朝向滑动的 duration", "specialParams": [ - 300, + 400, 2, 0 ], @@ -6735,6 +6348,14 @@ [ "^.+-MO-?\\d+$", "_INVALID_" + ], + [ + "Ap-", + "AP-" + ], + [ + "Bl-", + "BI-" ] ], "roi": [ @@ -6883,9 +6504,29 @@ "l", "1" ], + [ + "方", + "万" + ], + [ + "芳", + "万" + ], [ "萬", "万" + ], + [ + "만", + "万" + ], + [ + "億", + "亿" + ], + [ + "억", + "亿" ] ] }, @@ -7030,7 +6671,7 @@ "InfrastOperListSlowlySwipeToTheRight": { "baseTask": "SlowlySwipeToTheRight", "specificRect": [ - 1150, + 1000, 350, 20, 20 @@ -8009,6 +7650,8 @@ "template": "empty.png", "baseTask": "Roguelike@StageEnter", "next": [ + "Roguelike@StageEncounterEnter", + "Roguelike@StageEncounterOptions#next", "Roguelike@StageEncounterClickToLeave" ] }, @@ -8150,6 +7793,7 @@ "template": "empty.png", "baseTask": "Roguelike@StageEnter", "next": [ + "Roguelike@StageSafeHouseEnter", "Roguelike@StageEncounterOptions#next", "Roguelike@StageEncounterClickToLeave" ] @@ -8170,6 +7814,7 @@ "baseTask": "Roguelike@StageEnter", "postDelay": 3000, "next": [ + "Roguelike@StageTraderEnter", "Roguelike@StageTraderInvestSystem", "Roguelike@TraderRandomShopping", "Roguelike@StageTraderLeave" @@ -9498,4 +9143,4 @@ "RoguelikeWaitBattleStart" ] } -} +} \ No newline at end of file diff --git a/resource/template/StageBI.png b/resource/template/BIChapterToBI.png similarity index 100% rename from resource/template/StageBI.png rename to resource/template/BIChapterToBI.png diff --git a/resource/template/NotUsePrts.png b/resource/template/NotUsePrts.png new file mode 100644 index 0000000000..45c34ae77e Binary files /dev/null and b/resource/template/NotUsePrts.png differ diff --git a/resource/template/StageBI7.png b/resource/template/StageBI7.png deleted file mode 100644 index 6f9ca0c911..0000000000 Binary files a/resource/template/StageBI7.png and /dev/null differ diff --git a/resource/template/StageBI8.png b/resource/template/StageBI8.png deleted file mode 100644 index ba49669013..0000000000 Binary files a/resource/template/StageBI8.png and /dev/null differ diff --git a/tools/TestCaller/TestCaller.vcxproj b/src/Cpp/Sample.vcxproj similarity index 93% rename from tools/TestCaller/TestCaller.vcxproj rename to src/Cpp/Sample.vcxproj index 7efb39a6c7..05276fb0c7 100644 --- a/tools/TestCaller/TestCaller.vcxproj +++ b/src/Cpp/Sample.vcxproj @@ -1,111 +1,111 @@ - - - - - Release - x64 - - - RelWithDebInfo - x64 - - - - - - - 16.0 - Win32Proj - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64} - Tools - 10.0 - TestCaller - - - - Application - false - v143 - true - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - false - $(SolutionDir)\include - $(TargetDir);$(LibraryPath) - - - false - $(SolutionDir)\include - $(TargetDir);$(LibraryPath) - - - - Level4 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - stdcpp20 - stdc17 - MultiThreaded - /utf-8 /MP %(AdditionalOptions) - - - Console - true - true - true - MeoAssistant.lib;%(AdditionalDependencies) - $(TargetDir);%(AdditionalLibraryDirectories) - true - - - - - Level3 - true - false - true - LOG_TRACE;NDEBUG;_CONSOLE;ASST_DEBUG;%(PreprocessorDefinitions) - true - stdcpp20 - stdc17 - MultiThreaded - Disabled - /utf-8 /MP %(AdditionalOptions) - - - Console - true - true - true - MeoAssistant.lib;%(AdditionalDependencies) - $(TargetDir);%(AdditionalLibraryDirectories) - true - - - - - + + + + + Release + x64 + + + RelWithDebInfo + x64 + + + + + + + 16.0 + Win32Proj + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64} + Tools + 10.0 + Sample + + + + Application + false + v143 + true + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + false + $(SolutionDir)\include + $(TargetDir);$(LibraryPath) + + + false + $(SolutionDir)\include + $(TargetDir);$(LibraryPath) + + + + Level4 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp20 + stdc17 + MultiThreaded + /utf-8 /MP %(AdditionalOptions) + + + Console + true + true + true + MaaCore.lib;%(AdditionalDependencies) + $(TargetDir);%(AdditionalLibraryDirectories) + true + + + + + Level3 + true + false + true + LOG_TRACE;NDEBUG;_CONSOLE;ASST_DEBUG;%(PreprocessorDefinitions) + true + stdcpp20 + stdc17 + MultiThreaded + Disabled + /utf-8 /MP %(AdditionalOptions) + + + Console + true + true + true + MaaCore.lib;%(AdditionalDependencies) + $(TargetDir);%(AdditionalLibraryDirectories) + true + + + + + \ No newline at end of file diff --git a/tools/TestCaller/TestCaller.vcxproj.filters b/src/Cpp/Sample.vcxproj.filters similarity index 52% rename from tools/TestCaller/TestCaller.vcxproj.filters rename to src/Cpp/Sample.vcxproj.filters index 65fa6d5ae5..0f3e9f63c8 100644 --- a/tools/TestCaller/TestCaller.vcxproj.filters +++ b/src/Cpp/Sample.vcxproj.filters @@ -5,14 +5,6 @@ {4FC737F1-C7A5-4376-A066-2A32D752A2FF} cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - diff --git a/tools/TestCaller/main.cpp b/src/Cpp/main.cpp similarity index 90% rename from tools/TestCaller/main.cpp rename to src/Cpp/main.cpp index dcd52875aa..698654005c 100644 --- a/tools/TestCaller/main.cpp +++ b/src/Cpp/main.cpp @@ -4,6 +4,7 @@ #include #include #include +#include int main([[maybe_unused]] int argc, char** argv) { @@ -16,8 +17,8 @@ int main([[maybe_unused]] int argc, char** argv) bool loaded = AsstLoadResource(cur_path.string().c_str()); // 增量更新外服的资源 - const auto oversea_path = cur_path / "resource" / "global" / "YoStarJP"; - loaded &= AsstLoadResource(oversea_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; @@ -99,7 +100,9 @@ int main([[maybe_unused]] int argc, char** argv) AsstStart(ptr); - std::ignore = getchar(); + while (AsstRunning(ptr)) { + std::this_thread::yield(); + } AsstStop(ptr); AsstDestroy(ptr); diff --git a/src/Dart/lib/maa_core.dart b/src/Dart/lib/maa_core.dart index 00c8f366af..d39d1223f2 100644 --- a/src/Dart/lib/maa_core.dart +++ b/src/Dart/lib/maa_core.dart @@ -9,7 +9,7 @@ import 'package:path/path.dart' as p; class MaaCore implements MaaCoreInterface { // Native Symbols - // MeoAssistant + // MaaCore static late AsstLoadResourceFunc _asstLoadResource; static late AsstCreateExFunc _asstCreateEx; static late AsstConnectFunc _asstConnect; @@ -51,13 +51,13 @@ class MaaCore implements MaaCoreInterface { return []; } - static String get meoAssistantLibName { + static String get MaaCoreLibName { if (Platform.isLinux) { - return 'libMeoAssistant.so'; + return 'libMaaCore.so'; } else if (Platform.isWindows) { - return 'MeoAssistant.dll'; + return 'MaaCore.dll'; } - return 'libMeoAssistant.dylib'; + return 'libMaaCore.dylib'; } static String get callbackLibName { @@ -125,7 +125,7 @@ class MaaCore implements MaaCoreInterface { } static void _loadNativeSymbols(String libDir) { - _loadMeoAssistant(libDir); + _loadMaaCore(libDir); _loadCallbackLib(libDir); _symbolsLoaded = true; } @@ -137,7 +137,7 @@ class MaaCore implements MaaCoreInterface { _asstCallback = lib.lookup('callback'); } - static void _loadMeoAssistant(String libDir) { + static void _loadMaaCore(String libDir) { if (Platform.isWindows) { for (var dep in _deps) { print("load dep: $dep"); @@ -145,7 +145,7 @@ class MaaCore implements MaaCoreInterface { print("loaded dep: $dep"); } } - final lib = DynamicLibrary.open(p.join(libDir, meoAssistantLibName)); + final lib = DynamicLibrary.open(p.join(libDir, MaaCoreLibName)); _asstLoadResource = lib.lookup('AsstLoadResource').asFunction(); _asstCreateEx = lib.lookup('AsstCreateEx').asFunction(); diff --git a/src/Golang/MaaAssistantArknights/conf.yaml b/src/Golang/conf.yaml similarity index 100% rename from src/Golang/MaaAssistantArknights/conf.yaml rename to src/Golang/conf.yaml diff --git a/src/Golang/MaaAssistantArknights/conf/config.go b/src/Golang/conf/config.go similarity index 100% rename from src/Golang/MaaAssistantArknights/conf/config.go rename to src/Golang/conf/config.go diff --git a/src/Golang/MaaAssistantArknights/go.mod b/src/Golang/go.mod similarity index 100% rename from src/Golang/MaaAssistantArknights/go.mod rename to src/Golang/go.mod diff --git a/src/Golang/MaaAssistantArknights/go.sum b/src/Golang/go.sum similarity index 100% rename from src/Golang/MaaAssistantArknights/go.sum rename to src/Golang/go.sum diff --git a/src/Golang/MaaAssistantArknights/internal/api/errors.go b/src/Golang/internal/api/errors.go similarity index 100% rename from src/Golang/MaaAssistantArknights/internal/api/errors.go rename to src/Golang/internal/api/errors.go diff --git a/src/Golang/MaaAssistantArknights/internal/store/store.go b/src/Golang/internal/store/store.go similarity index 100% rename from src/Golang/MaaAssistantArknights/internal/store/store.go rename to src/Golang/internal/store/store.go diff --git a/src/Golang/MaaAssistantArknights/maa/asst_linux.go b/src/Golang/maa/asst_linux.go similarity index 100% rename from src/Golang/MaaAssistantArknights/maa/asst_linux.go rename to src/Golang/maa/asst_linux.go diff --git a/src/Golang/MaaAssistantArknights/maa/asst_widows.go b/src/Golang/maa/asst_widows.go similarity index 98% rename from src/Golang/MaaAssistantArknights/maa/asst_widows.go rename to src/Golang/maa/asst_widows.go index 4926e59f26..ed436f8d8e 100644 --- a/src/Golang/MaaAssistantArknights/maa/asst_widows.go +++ b/src/Golang/maa/asst_widows.go @@ -7,7 +7,7 @@ import ( // 之后抽象成和Linux调用方式保持一致 先这么拆 const ( - loadDLL = "MeoAssistant.dll" + loadDLL = "MaaCore.dll" sep = string(os.PathSeparator) ) diff --git a/src/Golang/MaaAssistantArknights/maa/hook.go b/src/Golang/maa/hook.go similarity index 100% rename from src/Golang/MaaAssistantArknights/maa/hook.go rename to src/Golang/maa/hook.go diff --git a/src/Golang/MaaAssistantArknights/maa/maa.go b/src/Golang/maa/maa.go similarity index 100% rename from src/Golang/MaaAssistantArknights/maa/maa.go rename to src/Golang/maa/maa.go diff --git a/src/Golang/MaaAssistantArknights/maa/task.go b/src/Golang/maa/task.go similarity index 100% rename from src/Golang/MaaAssistantArknights/maa/task.go rename to src/Golang/maa/task.go diff --git a/src/Golang/MaaAssistantArknights/maa/util.go b/src/Golang/maa/util.go similarity index 100% rename from src/Golang/MaaAssistantArknights/maa/util.go rename to src/Golang/maa/util.go diff --git a/src/Golang/MaaAssistantArknights/main.go b/src/Golang/main.go similarity index 100% rename from src/Golang/MaaAssistantArknights/main.go rename to src/Golang/main.go diff --git a/src/Golang/MaaAssistantArknights/server/http/db/cache.go b/src/Golang/server/http/db/cache.go similarity index 100% rename from src/Golang/MaaAssistantArknights/server/http/db/cache.go rename to src/Golang/server/http/db/cache.go diff --git a/src/Golang/MaaAssistantArknights/server/http/handler.go b/src/Golang/server/http/handler.go similarity index 100% rename from src/Golang/MaaAssistantArknights/server/http/handler.go rename to src/Golang/server/http/handler.go diff --git a/src/Golang/MaaAssistantArknights/server/http/params/params.go b/src/Golang/server/http/params/params.go similarity index 100% rename from src/Golang/MaaAssistantArknights/server/http/params/params.go rename to src/Golang/server/http/params/params.go diff --git a/src/Golang/MaaAssistantArknights/server/http/router.go b/src/Golang/server/http/router.go similarity index 100% rename from src/Golang/MaaAssistantArknights/server/http/router.go rename to src/Golang/server/http/router.go diff --git a/src/Golang/MaaAssistantArknights/server/http/server.go b/src/Golang/server/http/server.go similarity index 100% rename from src/Golang/MaaAssistantArknights/server/http/server.go rename to src/Golang/server/http/server.go diff --git a/src/Golang/MaaAssistantArknights/server/http/task_handler.go b/src/Golang/server/http/task_handler.go similarity index 100% rename from src/Golang/MaaAssistantArknights/server/http/task_handler.go rename to src/Golang/server/http/task_handler.go diff --git a/src/Java/Maaj/.gitignore b/src/Java/.gitignore similarity index 100% rename from src/Java/Maaj/.gitignore rename to src/Java/.gitignore diff --git a/src/Java/Maaj/Maa-HTTP-Server-startup.bat b/src/Java/Maa-HTTP-Server-startup.bat similarity index 100% rename from src/Java/Maaj/Maa-HTTP-Server-startup.bat rename to src/Java/Maa-HTTP-Server-startup.bat diff --git a/src/Java/Maaj/Readme.md b/src/Java/Readme.md similarity index 97% rename from src/Java/Maaj/Readme.md rename to src/Java/Readme.md index 0117c06453..44f0f95de7 100644 --- a/src/Java/Maaj/Readme.md +++ b/src/Java/Readme.md @@ -32,9 +32,9 @@ 1. 把他丢进 Maa 文件夹下,形成如下文件结构.备注: 启动脚本[Maa-HTTP-Server-startup.bat](Maa-HTTP-Server-startup.bat). ```text - MeoAssistantArknights_v3.9.0-beta.8 - │ MeoAsstGui.exe - │ MeoAssistant.dll + MaaCoreArknights_v3.9.0-beta.8 + │ MAA.exe + │ MaaCore.dll │ ... └───Java-HTTP │ Maa-HTTP-0.0.1.jar @@ -108,7 +108,7 @@ ```json { - "adbPath": "C:\\MeoAssistantArknights3\\platform-tools\\adb.exe", + "adbPath": "C:\\MaaCoreArknights3\\platform-tools\\adb.exe", "host": "127.0.0.1:62001", "detailJson": "" } @@ -144,7 +144,6 @@ --- - --- ##### 接口名称 添加任务 @@ -400,7 +399,7 @@ { "id": "ccd76e0c367511158ca774ff951a22e8bb62f5d3", "host": "127.0.0.1:62026", - "adbPath": "C:\\Users\\atmzx\\Desktop\\MeoAssistantArknights3\\platform-tools\\adb.exe", + "adbPath": "C:\\Users\\atmzx\\Desktop\\MaaCoreArknights3\\platform-tools\\adb.exe", "uuid": "", "status": 0 } @@ -441,7 +440,6 @@ ###### 4) 请求返回结果: 图片内容, PNG 格式 - ### WebSocket 部分 请求地址(没错跟HTTP同样是8848钛金端口 @@ -511,7 +509,7 @@ "command": "connect", "msgId": 114514, "data": { - "adbPath": "C:\\Users\\atmzx\\Desktop\\MeoAssistantArknights3\\platform-tools\\adb.exe", + "adbPath": "C:\\Users\\atmzx\\Desktop\\MaaCoreArknights3\\platform-tools\\adb.exe", "host": "127.0.0.1:62001" } } @@ -561,7 +559,7 @@ appendTask setTaskParams start stop等接口不再描述,均可遵循以上规 "details": { "uuid": "", "details": { - "adb": "C:\\MeoAssistantArknights3\\platform-tools\\adb.exe", + "adb": "C:\\MaaCoreArknights3\\platform-tools\\adb.exe", "address": "127.0.0.1:62001", "config": "General", "width": 1280, diff --git a/src/Java/Maaj/build.gradle.kts b/src/Java/build.gradle.kts similarity index 100% rename from src/Java/Maaj/build.gradle.kts rename to src/Java/build.gradle.kts diff --git a/src/Java/Maaj/gradlew b/src/Java/gradlew similarity index 100% rename from src/Java/Maaj/gradlew rename to src/Java/gradlew diff --git a/src/Java/Maaj/gradlew.bat b/src/Java/gradlew.bat similarity index 100% rename from src/Java/Maaj/gradlew.bat rename to src/Java/gradlew.bat diff --git a/src/Java/Maaj/settings.gradle.kts b/src/Java/settings.gradle.kts similarity index 100% rename from src/Java/Maaj/settings.gradle.kts rename to src/Java/settings.gradle.kts diff --git a/src/Java/Maaj/src/main/java/com/iguigui/maaj/Application.kt b/src/Java/src/main/java/com/iguigui/maaj/Application.kt similarity index 100% rename from src/Java/Maaj/src/main/java/com/iguigui/maaj/Application.kt rename to src/Java/src/main/java/com/iguigui/maaj/Application.kt diff --git a/src/Java/Maaj/src/main/java/com/iguigui/maaj/dto/msgEnum.kt b/src/Java/src/main/java/com/iguigui/maaj/dto/msgEnum.kt similarity index 100% rename from src/Java/Maaj/src/main/java/com/iguigui/maaj/dto/msgEnum.kt rename to src/Java/src/main/java/com/iguigui/maaj/dto/msgEnum.kt diff --git a/src/Java/Maaj/src/main/java/com/iguigui/maaj/dto/request.kt b/src/Java/src/main/java/com/iguigui/maaj/dto/request.kt similarity index 100% rename from src/Java/Maaj/src/main/java/com/iguigui/maaj/dto/request.kt rename to src/Java/src/main/java/com/iguigui/maaj/dto/request.kt diff --git a/src/Java/Maaj/src/main/java/com/iguigui/maaj/dto/response.kt b/src/Java/src/main/java/com/iguigui/maaj/dto/response.kt similarity index 100% rename from src/Java/Maaj/src/main/java/com/iguigui/maaj/dto/response.kt rename to src/Java/src/main/java/com/iguigui/maaj/dto/response.kt diff --git a/src/Java/Maaj/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java b/src/Java/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java similarity index 93% rename from src/Java/Maaj/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java rename to src/Java/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java index 9a8de744a4..d349e79cbe 100644 --- a/src/Java/Maaj/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java +++ b/src/Java/src/main/java/com/iguigui/maaj/easySample/MaaJavaSample.java @@ -20,13 +20,13 @@ public class MaaJavaSample { */ public static void main(String[] args) { //设定JNA寻找maa的dll的地址,同时也要把这个路径添加到环境变量中的Path中! - String maaPath = "C:/Users/iguigui/Desktop/MeoAssistantArknights3"; + String maaPath = "C:/Users/iguigui/Desktop/MaaCoreArknights3"; System.setProperty("jna.library.path", maaPath); //adb地址,自己看着办 String adbPath = maaPath + "/platform-tools/adb.exe"; //第一步,加载Maa调用实例,加载失败请检查jna.library.path和path参数 - MeoAssistant instance = Native.load("MeoAssistant", MeoAssistant.class); + MaaCore instance = Native.load("MaaCore", MaaCore.class); System.out.println("获取Maa版本号:" + instance.AsstGetVersion()); //第二步,加载Maa资源初始化 diff --git a/src/Java/Maaj/src/main/java/com/iguigui/maaj/easySample/MeoAssistant.java b/src/Java/src/main/java/com/iguigui/maaj/easySample/MeoAssistant.java similarity index 97% rename from src/Java/Maaj/src/main/java/com/iguigui/maaj/easySample/MeoAssistant.java rename to src/Java/src/main/java/com/iguigui/maaj/easySample/MeoAssistant.java index 36e71aa754..d27ce32ad2 100644 --- a/src/Java/Maaj/src/main/java/com/iguigui/maaj/easySample/MeoAssistant.java +++ b/src/Java/src/main/java/com/iguigui/maaj/easySample/MeoAssistant.java @@ -6,7 +6,7 @@ import com.sun.jna.win32.StdCallLibrary; //本质上是对C接口的抽象层 //请参考C接口 https://github.com/MaaAssistantArknights/MaaAssistantArknights/blob/master/include/AsstCaller.h -public interface MeoAssistant extends StdCallLibrary { +public interface MaaCore extends StdCallLibrary { //回调接口定义 interface AsstApiCallback extends StdCallCallback { diff --git a/src/Java/Maaj/src/main/java/com/iguigui/maaj/routing/HttpRouting.kt b/src/Java/src/main/java/com/iguigui/maaj/routing/HttpRouting.kt similarity index 100% rename from src/Java/Maaj/src/main/java/com/iguigui/maaj/routing/HttpRouting.kt rename to src/Java/src/main/java/com/iguigui/maaj/routing/HttpRouting.kt diff --git a/src/Java/Maaj/src/main/java/com/iguigui/maaj/routing/WsRouting.kt b/src/Java/src/main/java/com/iguigui/maaj/routing/WsRouting.kt similarity index 100% rename from src/Java/Maaj/src/main/java/com/iguigui/maaj/routing/WsRouting.kt rename to src/Java/src/main/java/com/iguigui/maaj/routing/WsRouting.kt diff --git a/src/Java/Maaj/src/main/java/com/iguigui/maaj/service/Connection.kt b/src/Java/src/main/java/com/iguigui/maaj/service/Connection.kt similarity index 100% rename from src/Java/Maaj/src/main/java/com/iguigui/maaj/service/Connection.kt rename to src/Java/src/main/java/com/iguigui/maaj/service/Connection.kt diff --git a/src/Java/Maaj/src/main/java/com/iguigui/maaj/service/MaaInstance.kt b/src/Java/src/main/java/com/iguigui/maaj/service/MaaInstance.kt similarity index 94% rename from src/Java/Maaj/src/main/java/com/iguigui/maaj/service/MaaInstance.kt rename to src/Java/src/main/java/com/iguigui/maaj/service/MaaInstance.kt index 7167ae4b52..f01442fa81 100644 --- a/src/Java/Maaj/src/main/java/com/iguigui/maaj/service/MaaInstance.kt +++ b/src/Java/src/main/java/com/iguigui/maaj/service/MaaInstance.kt @@ -2,7 +2,7 @@ package com.iguigui.maaj.service import com.iguigui.maaj.dto.CallBackLog import com.iguigui.maaj.dto.* -import com.iguigui.maaj.easySample.MeoAssistant +import com.iguigui.maaj.easySample.MaaCore import com.iguigui.maaj.logger import com.iguigui.maaj.util.Json import com.sun.jna.Pointer @@ -11,17 +11,17 @@ import java.util.concurrent.atomic.AtomicLong import kotlin.reflect.KFunction1 class MaaInstance( - private val instance: MeoAssistant, + private val instance: MaaCore, val id: String, val adbPath: String, val host: String, private val detailJson: String, val callBackAction: KFunction1 ) : - MeoAssistant.AsstApiCallback { + MaaCore.AsstApiCallback { // constructor( -// instance: MeoAssistant, +// instance: MaaCore, // id: String, // adbPath: String, // host: String, diff --git a/src/Java/Maaj/src/main/java/com/iguigui/maaj/service/MaaService.kt b/src/Java/src/main/java/com/iguigui/maaj/service/MaaService.kt similarity index 85% rename from src/Java/Maaj/src/main/java/com/iguigui/maaj/service/MaaService.kt rename to src/Java/src/main/java/com/iguigui/maaj/service/MaaService.kt index be9696544f..62dafc288a 100644 --- a/src/Java/Maaj/src/main/java/com/iguigui/maaj/service/MaaService.kt +++ b/src/Java/src/main/java/com/iguigui/maaj/service/MaaService.kt @@ -1,7 +1,7 @@ package com.iguigui.maaj.service import com.iguigui.maaj.dto.* -import com.iguigui.maaj.easySample.MeoAssistant +import com.iguigui.maaj.easySample.MaaCore import com.iguigui.maaj.logger import com.sun.jna.Native import io.ktor.websocket.* @@ -18,12 +18,12 @@ object MaaService { private val wsConnection = Collections.synchronizedSet(LinkedHashSet()) - val meoAssistant: MeoAssistant by lazy { + val MaaCore: MaaCore by lazy { var maaPath = File(File("").absolutePath).parent logger.info("maaPath $maaPath") -// maaPath = "C:\\Users\\atmzx\\Desktop\\MeoAssistantArknights3" +// maaPath = "C:\\Users\\atmzx\\Desktop\\MaaCoreArknights3" System.setProperty("jna.library.path", maaPath) - val load = Native.load("MeoAssistant", MeoAssistant::class.java) + val load = Native.load("MaaCore", MaaCore::class.java) load.AsstLoadResource(maaPath) load } @@ -33,8 +33,8 @@ object MaaService { // if (instancePool.containsKey(id)) { // return ConnectResponse(id, true) // } - val maaInstance = MaaInstance(meoAssistant, id, adbPath, host, detailJson, ::callBackLog) - maaInstance.pointer = meoAssistant.AsstCreateEx(maaInstance, maaInstance.id) + val maaInstance = MaaInstance(MaaCore, id, adbPath, host, detailJson, ::callBackLog) + maaInstance.pointer = MaaCore.AsstCreateEx(maaInstance, maaInstance.id) val connect = maaInstance.connect() if (!connect) { return ConnectResponse("", false) @@ -54,7 +54,7 @@ object MaaService { fun stop(id: String) = instancePool[id]?.stop() ?: false - fun getVersion(): String = meoAssistant.AsstGetVersion() + fun getVersion(): String = MaaCore.AsstGetVersion() private fun sha1(password: String): String { val messageDigest = MessageDigest.getInstance("SHA") diff --git a/src/Java/Maaj/src/main/java/com/iguigui/maaj/util/JsonUtil.kt b/src/Java/src/main/java/com/iguigui/maaj/util/JsonUtil.kt similarity index 100% rename from src/Java/Maaj/src/main/java/com/iguigui/maaj/util/JsonUtil.kt rename to src/Java/src/main/java/com/iguigui/maaj/util/JsonUtil.kt diff --git a/src/Java/Maaj/src/main/resources/application.conf b/src/Java/src/main/resources/application.conf similarity index 100% rename from src/Java/Maaj/src/main/resources/application.conf rename to src/Java/src/main/resources/application.conf diff --git a/src/Java/Maaj/src/main/resources/log4j2.xml b/src/Java/src/main/resources/log4j2.xml similarity index 100% rename from src/Java/Maaj/src/main/resources/log4j2.xml rename to src/Java/src/main/resources/log4j2.xml diff --git a/src/Java/Maaj/src/main/resources/logback-fileAppender.xml b/src/Java/src/main/resources/logback-fileAppender.xml similarity index 100% rename from src/Java/Maaj/src/main/resources/logback-fileAppender.xml rename to src/Java/src/main/resources/logback-fileAppender.xml diff --git a/src/Java/Maaj/src/main/resources/logback.xml b/src/Java/src/main/resources/logback.xml similarity index 100% rename from src/Java/Maaj/src/main/resources/logback.xml rename to src/Java/src/main/resources/logback.xml diff --git a/src/Java/Maaj/src/test/java/com/iguigui/maaj/routing/HttpRoutingKtTest.kt b/src/Java/src/test/java/com/iguigui/maaj/routing/HttpRoutingKtTest.kt similarity index 100% rename from src/Java/Maaj/src/test/java/com/iguigui/maaj/routing/HttpRoutingKtTest.kt rename to src/Java/src/test/java/com/iguigui/maaj/routing/HttpRoutingKtTest.kt diff --git a/src/MeoAssistant/.editorconfig b/src/MaaCore/.editorconfig similarity index 100% rename from src/MeoAssistant/.editorconfig rename to src/MaaCore/.editorconfig diff --git a/src/MeoAssistant/Assistant.cpp b/src/MaaCore/Assistant.cpp similarity index 64% rename from src/MeoAssistant/Assistant.cpp rename to src/MaaCore/Assistant.cpp index 4437d95bf0..91cd79c506 100644 --- a/src/MeoAssistant/Assistant.cpp +++ b/src/MaaCore/Assistant.cpp @@ -1,14 +1,13 @@ #include "Assistant.h" +#include "Utils/NoWarningCV.h" #include "Utils/Ranges.hpp" - #include -#include "Controller.h" #include "Config/GeneralConfig.h" +#include "Config/Miscellaneous/OcrPack.h" +#include "Controller.h" #include "Status.h" -#include "Utils/Logger.hpp" - #include "Task/Interface/AwardTask.h" #include "Task/Interface/CloseDownTask.h" #include "Task/Interface/CopilotTask.h" @@ -19,19 +18,25 @@ #include "Task/Interface/RecruitTask.h" #include "Task/Interface/RoguelikeTask.h" #include "Task/Interface/StartUpTask.h" +#include "Utils/Logger.hpp" #ifdef ASST_DEBUG #include "Task/Interface/DebugTask.h" #endif using namespace asst; -Assistant::Assistant(AsstApiCallback callback, void* callback_arg) : m_callback(callback), m_callback_arg(callback_arg) +bool ::AsstExtAPI::set_static_option(StaticOptionKey key, const std::string& value) +{ + Log.info(__FUNCTION__, "| key", static_cast(key), "value", value); + return false; +} + +Assistant::Assistant(ApiCallback callback, void* callback_arg) : m_callback(callback), m_callback_arg(callback_arg) { LogTraceFunction; m_status = std::make_shared(); - m_ctrler = std::make_shared(task_callback, static_cast(this)); - m_ctrler->set_exit_flag(&m_thread_idle); + m_ctrler = std::make_shared(async_callback, this); m_working_thread = std::thread(&Assistant::working_proc, this); m_msg_thread = std::thread(&Assistant::msg_proc, this); @@ -58,19 +63,32 @@ bool asst::Assistant::set_instance_option(InstanceOptionKey key, const std::stri { Log.info(__FUNCTION__, "| key", static_cast(key), "value", value); switch (key) { - case InstanceOptionKey::MinitouchEnabled: - if (value == "0") { + case InstanceOptionKey::TouchMode: + if (constexpr std::string_view Adb = "adb"; value == Adb) { m_ctrler->set_minitouch_enabled(false); return true; } - else if (value == "1") { - m_ctrler->set_minitouch_enabled(true); + else if (constexpr std::string_view Minitouch = "minitouch"; value == Minitouch) { + m_ctrler->set_minitouch_enabled(true, false); return true; } - else { - return false; + else if (constexpr std::string_view MaaTouch = "maatouch"; value == MaaTouch) { + m_ctrler->set_minitouch_enabled(true, true); + return true; } + break; + case InstanceOptionKey::DeploymentWithPause: + if (constexpr std::string_view Enable = "1"; value == Enable) { + m_ctrler->set_swipe_with_pause(true); + return true; + } + else if (constexpr std::string_view Disable = "0"; value == Disable) { + m_ctrler->set_swipe_with_pause(false); + return true; + } + break; } + Log.error("Unknown key or value", value); return false; } @@ -107,10 +125,10 @@ asst::Assistant::TaskId asst::Assistant::append_task(const std::string& type, co std::shared_ptr ptr = nullptr; -#define ASST_ASSISTANT_APPEND_TASK_FROM_STRING_IF_BRANCH(TASK) \ - else if (type == TASK::TaskType) \ - { \ - ptr = std::make_shared(task_callback, static_cast(this)); \ +#define ASST_ASSISTANT_APPEND_TASK_FROM_STRING_IF_BRANCH(TASK) \ + else if (type == TASK::TaskType) \ + { \ + ptr = std::make_shared(async_callback, this); \ } if constexpr (false) {} @@ -136,14 +154,14 @@ asst::Assistant::TaskId asst::Assistant::append_task(const std::string& type, co #undef ASST_ASSISTANT_APPEND_TASK_FROM_STRING_IF_BRANCH auto& json = ret.value(); - ptr->set_exit_flag(&m_thread_idle).set_ctrler(m_ctrler).set_status(m_status).set_enable(json.get("enable", true)); + ptr->set_enable(json.get("enable", true)); bool params_ret = ptr->set_params(json); if (!params_ret) { return 0; } - std::unique_lock lock(m_mutex); + std::unique_lock lock(m_mutex); ++m_task_id; ptr->set_task_id(m_task_id); m_tasks_list.emplace_back(m_task_id, ptr); @@ -184,16 +202,47 @@ std::vector asst::Assistant::get_image() const if (!inited()) { return {}; } - return m_ctrler->get_encoded_image_cache(); + cv::Mat img = m_ctrler->get_image_cache(); + std::vector buf; + cv::imencode(".png", img, buf); + return buf; } -bool asst::Assistant::ctrler_click(int x, int y) +asst::Assistant::AsyncCallId asst::Assistant::async_connect(const std::string& adb_path, const std::string& address, + const std::string& config, bool block) { + LogTraceFunction; + + int async_call_id = ++m_call_id; + async_call([&]() -> bool { return connect(adb_path, address, config); }, async_call_id, "Connect", block); + + return async_call_id; +} + +asst::Assistant::AsyncCallId asst::Assistant::async_click(int x, int y, bool block) +{ + LogTraceFunction; if (!inited()) { - return false; + return 0; } - m_ctrler->click(Point(x, y)); - return true; + + int async_call_id = ++m_call_id; + async_call([&]() -> bool { return m_ctrler->click(Point(x, y)); }, async_call_id, "Click", block); + + return async_call_id; +} + +asst::Assistant::AsyncCallId asst::Assistant::async_screencap(bool block) +{ + LogTraceFunction; + if (!inited()) { + return 0; + } + + int async_call_id = ++m_call_id; + async_call([&]() -> bool { return m_ctrler->screencap(); }, async_call_id, "Screencap", block); + + return async_call_id; } std::string asst::Assistant::get_uuid() const @@ -246,7 +295,7 @@ bool Assistant::stop(bool block) return true; } -bool asst::Assistant::running() +bool asst::Assistant::running() const { return !m_thread_idle; } @@ -263,13 +312,14 @@ void Assistant::working_proc() if (!m_thread_idle && !m_tasks_list.empty()) { const auto [id, task_ptr] = m_tasks_list.front(); lock.unlock(); - // only one instance of working_proc running, unlock here to allow set_task_param to the running task + // only one instance of working_proc running, unlock here to allow set_task_param to the running + // task json::value callback_json = json::object { { "taskchain", std::string(task_ptr->get_task_chain()) }, { "taskid", id }, }; - task_callback(AsstMsg::TaskChainStart, callback_json, this); + async_callback(AsstMsg::TaskChainStart, callback_json, this); bool ret = task_ptr->run(); finished_tasks.emplace_back(id); @@ -282,7 +332,7 @@ void Assistant::working_proc() auto msg = m_thread_idle ? AsstMsg::TaskChainStopped : (ret ? AsstMsg::TaskChainCompleted : AsstMsg::TaskChainError); - task_callback(msg, callback_json, this); + async_callback(msg, callback_json, this); if (m_thread_idle) { finished_tasks.clear(); @@ -291,7 +341,7 @@ void Assistant::working_proc() if (m_tasks_list.empty()) { callback_json["finished_tasks"] = json::array(finished_tasks); - task_callback(AsstMsg::AllTasksCompleted, callback_json, this); + async_callback(AsstMsg::AllTasksCompleted, callback_json, this); finished_tasks.clear(); } @@ -300,7 +350,7 @@ void Assistant::working_proc() m_condvar.wait_for(lock, std::chrono::milliseconds(delay), [&]() -> bool { return m_thread_idle; }); if (m_thread_idle) { - task_callback(AsstMsg::TaskChainStopped, callback_json, this); + async_callback(AsstMsg::TaskChainStopped, callback_json, this); } } else { @@ -328,7 +378,7 @@ void Assistant::msg_proc() lock.unlock(); if (m_callback) { - m_callback(static_cast(msg), detail.to_string().c_str(), m_callback_arg); + m_callback(static_cast(msg), detail.to_string().c_str(), m_callback_arg); } } else { @@ -337,31 +387,30 @@ void Assistant::msg_proc() } } -void Assistant::task_callback(AsstMsg msg, const json::value& detail, void* custom_arg) +void Assistant::async_callback(AsstMsg msg, const json::value& detail, Assistant* inst) { - auto p_this = static_cast(custom_arg); json::value more_detail = detail; if (!more_detail.contains("uuid")) { - more_detail["uuid"] = p_this->m_uuid; + more_detail["uuid"] = inst->m_uuid; } switch (msg) { case AsstMsg::InternalError: case AsstMsg::InitFailed: - p_this->stop(false); + inst->stop(false); break; default: break; } - Log.trace("Assistant::task_callback |", msg, more_detail.to_string()); - // 加入回调消息队列,由回调消息线程外抛给外部 - p_this->append_callback(msg, std::move(more_detail)); + inst->append_callback(msg, std::move(more_detail)); } void asst::Assistant::append_callback(AsstMsg msg, json::value detail) { + Log.info("Assistant::append_callback |", msg, detail.to_string()); + std::unique_lock lock(m_msg_mutex); m_msg_queue.emplace(msg, std::move(detail)); m_msg_condvar.notify_one(); @@ -378,3 +427,35 @@ bool asst::Assistant::inited() const noexcept { return m_ctrler && m_ctrler->inited(); } + +void asst::Assistant::async_call(std::function func, int async_call_id, const std::string what, bool block) +{ + auto future = std::async(std::launch::async, [&]() { + auto start = std::chrono::steady_clock::now(); + bool ret = func(); + auto cost = + std::chrono::duration_cast(std::chrono::steady_clock::now() - start).count(); + json::value info = json::object { + { "uuid", m_uuid }, + { "what", what }, + { "async_call_id", async_call_id }, + { + "details", + json::object { + { "ret", ret }, + { "cost", cost }, + }, + }, + }; + async_callback(AsstMsg::AsyncCallInfo, info, this); + }); + + if (!block) { + std::unique_lock lock(m_call_pending_mutex); + m_call_pending.remove_if([](const std::future& fut) { + return fut.wait_for(std::chrono::seconds::zero()) == std::future_status::ready; + }); + m_call_pending.emplace_back(std::move(future)); + } + // else 会等待 future 析构,是阻塞的 +} diff --git a/src/MaaCore/Assistant.h b/src/MaaCore/Assistant.h new file mode 100644 index 0000000000..b7b12b4baa --- /dev/null +++ b/src/MaaCore/Assistant.h @@ -0,0 +1,130 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include "Common/AsstMsg.h" +#include "Common/AsstTypes.h" + +struct AsstExtAPI +{ +public: + using TaskId = int; + using AsyncCallId = int; + + virtual ~AsstExtAPI() = default; + + // 设置进程级参数 + static bool set_static_option(asst::StaticOptionKey key, const std::string& value); + // 设置实例级参数 + virtual bool set_instance_option(asst::InstanceOptionKey key, const std::string& value) = 0; + // 连接adb + virtual bool connect(const std::string& adb_path, const std::string& address, const std::string& config) = 0; + + // 添加任务 + virtual TaskId append_task(const std::string& type, const std::string& params) = 0; + // 动态设置任务参数 + virtual bool set_task_params(TaskId task_id, const std::string& params) = 0; + + // 开始执行任务队列 + virtual bool start(bool block = true) = 0; + // 停止任务队列并清空 + virtual bool stop(bool block = true) = 0; + // 是否正在运行 + virtual bool running() const = 0; + + // 异步连接 + virtual AsyncCallId async_connect(const std::string& adb_path, const std::string& address, + const std::string& config, bool block = false) = 0; + // 异步点击 + virtual AsyncCallId async_click(int x, int y, bool block = false) = 0; + // 异步截图 + virtual AsyncCallId async_screencap(bool block = false) = 0; + + // 获取上次的截图 + virtual std::vector get_image() const = 0; + // 获取 UUID + virtual std::string get_uuid() const = 0; + // 获取任务列表 + virtual std::vector get_tasks_list() const = 0; +}; + +namespace asst +{ + class Controller; + class InterfaceTask; + class Status; + + class Assistant : public AsstExtAPI + { + public: + Assistant(ApiCallback callback = nullptr, void* callback_arg = nullptr); + virtual ~Assistant() override; + + virtual bool set_instance_option(InstanceOptionKey key, const std::string& value) override; + virtual bool connect(const std::string& adb_path, const std::string& address, + const std::string& config) override; + + virtual TaskId append_task(const std::string& type, const std::string& params) override; + virtual bool set_task_params(TaskId task_id, const std::string& params) override; + + virtual bool start(bool block = true) override; + virtual bool stop(bool block = true) override; + virtual bool running() const override; + + virtual AsyncCallId async_connect(const std::string& adb_path, const std::string& address, + const std::string& config, bool block = false) override; + virtual AsyncCallId async_click(int x, int y, bool block = false) override; + virtual AsyncCallId async_screencap(bool block = false) override; + + virtual std::vector get_image() const override; + virtual std::string get_uuid() const override; + virtual std::vector get_tasks_list() const override; + + public: + std::shared_ptr ctrler() const { return m_ctrler; } + std::shared_ptr status() const { return m_status; } + bool need_exit() const { return m_thread_idle; } + + private: + void working_proc(); + void msg_proc(); + static void async_callback(AsstMsg msg, const json::value& detail, Assistant* inst); + + void append_callback(AsstMsg msg, json::value detail); + void clear_cache(); + bool inited() const noexcept; + void async_call(std::function func, int req_id, const std::string what, bool block = false); + + std::string m_uuid; + + std::shared_ptr m_ctrler = nullptr; + std::shared_ptr m_status = nullptr; + + bool m_thread_exit = false; + std::list>> m_tasks_list; + inline static TaskId m_task_id = 0; // 进程级唯一 + ApiCallback m_callback = nullptr; + void* m_callback_arg = nullptr; + + bool m_thread_idle = true; + mutable std::mutex m_mutex; + std::condition_variable m_condvar; + + std::queue> m_msg_queue; + std::mutex m_msg_mutex; + std::condition_variable m_msg_condvar; + + inline static std::atomic m_call_id = 0; // 进程级唯一 + std::mutex m_call_pending_mutex; + std::list> m_call_pending; + + std::thread m_msg_thread; + std::thread m_working_thread; + }; +} // namespace asst diff --git a/src/MeoAssistant/AsstCaller.cpp b/src/MaaCore/AsstCaller.cpp similarity index 60% rename from src/MeoAssistant/AsstCaller.cpp rename to src/MaaCore/AsstCaller.cpp index 59fd5339c4..446757d277 100644 --- a/src/MeoAssistant/AsstCaller.cpp +++ b/src/MaaCore/AsstCaller.cpp @@ -39,38 +39,39 @@ BOOL APIENTRY DllMain(HINSTANCE hModule, #endif #endif -static bool inited = false; +bool inited() +{ + return asst::ResourceLoader::get_instance().loaded(); +} -bool AsstSetUserDir(const char* path) +AsstBool AsstSetUserDir(const char* path) { return asst::UserDir.set(path); } -bool AsstLoadResource(const char* path) +AsstBool AsstLoadResource(const char* path) { + using namespace asst::utils::path_literals; + auto os_path = asst::utils::path(path); + auto res_path = os_path / "resource"_p; if (asst::ResDir.empty()) { - asst::ResDir.set(os_path); + asst::ResDir.set(res_path); } if (asst::UserDir.empty()) { asst::UserDir.set(os_path); } - using namespace asst::utils::path_literals; - inited = asst::ResourceLoader::get_instance().load(os_path / "resource"_p); - return inited; + return asst::ResourceLoader::get_instance().load(res_path); } -bool AsstSetProcessOption(AsstProcessOptionKey key, const char* value) +AsstBool AsstSetStaticOption(AsstStaticOptionKey key, const char* value) { - // TODO: 把 config.option 里的全实现一遍 - std::ignore = key; - std::ignore = value; - return false; + return AsstExtAPI::set_static_option(static_cast(key), value); } AsstHandle AsstCreate() { - if (!inited) { + if (!inited()) { return nullptr; } return new asst::Assistant(); @@ -78,10 +79,10 @@ AsstHandle AsstCreate() AsstHandle AsstCreateEx(AsstApiCallback callback, void* custom_arg) { - if (!inited) { + if (!inited()) { return nullptr; } - return new asst::Assistant(callback, custom_arg); + return new asst::Assistant(static_cast(callback), custom_arg); } void AsstDestroy(AsstHandle handle) @@ -94,7 +95,7 @@ void AsstDestroy(AsstHandle handle) handle = nullptr; } -bool AsstSetInstanceOption(AsstHandle handle, AsstInstanceOptionKey key, const char* value) +AsstBool AsstSetInstanceOption(AsstHandle handle, AsstInstanceOptionKey key, const char* value) { if (handle == nullptr) { return false; @@ -103,71 +104,88 @@ bool AsstSetInstanceOption(AsstHandle handle, AsstInstanceOptionKey key, const c return handle->set_instance_option(static_cast(key), value); } -bool AsstConnect(AsstHandle handle, const char* adb_path, const char* address, const char* config) +AsstBool AsstConnect(AsstHandle handle, const char* adb_path, const char* address, const char* config) { - if (!inited || handle == nullptr) { + if (!inited() || handle == nullptr) { return false; } return handle->connect(adb_path, address, config ? config : std::string()); } -bool AsstStart(AsstHandle handle) +AsstBool AsstStart(AsstHandle handle) { - if (!inited || handle == nullptr) { + if (!inited() || handle == nullptr) { return false; } return handle->start(); } -bool AsstStop(AsstHandle handle) +AsstBool AsstStop(AsstHandle handle) { - if (!inited || handle == nullptr) { + if (!inited() || handle == nullptr) { return false; } return handle->stop(); } -bool AsstRunning(AsstHandle handle) +AsstBool AsstRunning(AsstHandle handle) { - if (!inited || handle == nullptr) { + if (!inited() || handle == nullptr) { return false; } return handle->running(); } +AsstAsyncCallId AsstAsyncConnect(AsstHandle handle, const char* adb_path, const char* address, const char* config, + AsstBool block) +{ + if (!inited() || handle == nullptr) { + return false; + } + return handle->async_connect(adb_path, address, config ? config : std::string(), block); +} + AsstTaskId AsstAppendTask(AsstHandle handle, const char* type, const char* params) { - if (!inited || handle == nullptr) { + if (!inited() || handle == nullptr) { return 0; } return handle->append_task(type, params ? params : ""); } -bool AsstSetTaskParams(AsstHandle handle, AsstTaskId id, const char* params) +AsstBool AsstSetTaskParams(AsstHandle handle, AsstTaskId id, const char* params) { - if (!inited || handle == nullptr) { + if (!inited() || handle == nullptr) { return false; } return handle->set_task_params(id, params ? params : ""); } -bool AsstClick(AsstHandle handle, int x, int y) +AsstAsyncCallId AsstAsyncClick(AsstHandle handle, int32_t x, int32_t y, AsstBool block) { - if (!inited || handle == nullptr) { + if (!inited() || handle == nullptr) { return false; } - return handle->ctrler_click(x, y); + return handle->async_click(x, y, block); +} + +AsstAsyncCallId AsstAsyncScreencap(AsstHandle handle, AsstBool block) +{ + if (!inited() || handle == nullptr) { + return false; + } + return handle->async_screencap(block); } AsstSize AsstGetImage(AsstHandle handle, void* buff, AsstSize buff_size) { - if (!inited || handle == nullptr || buff == nullptr) { + if (!inited() || handle == nullptr || buff == nullptr) { return NullSize; } auto img_data = handle->get_image(); @@ -181,7 +199,7 @@ AsstSize AsstGetImage(AsstHandle handle, void* buff, AsstSize buff_size) AsstSize AsstGetUUID(AsstHandle handle, char* buff, AsstSize buff_size) { - if (!inited || handle == nullptr || buff == nullptr) { + if (!inited() || handle == nullptr || buff == nullptr) { return NullSize; } auto uuid = handle->get_uuid(); @@ -195,7 +213,7 @@ AsstSize AsstGetUUID(AsstHandle handle, char* buff, AsstSize buff_size) AsstSize AsstGetTasksList(AsstHandle handle, AsstTaskId* buff, AsstSize buff_size) { - if (!inited || handle == nullptr || buff == nullptr) { + if (!inited() || handle == nullptr || buff == nullptr) { return NullSize; } auto tasks = handle->get_tasks_list(); @@ -219,8 +237,8 @@ const char* AsstGetVersion() void AsstLog(const char* level, const char* message) { - if (!inited) { - std::cerr << "Not inited" << std::endl; + if (asst::UserDir.empty()) { + std::cerr << __FUNCTION__ << " | User Dir not set" << std::endl; return; } asst::Log.log(asst::Logger::level(level), message); diff --git a/src/MeoAssistant/Common/AsstBattleDef.h b/src/MaaCore/Common/AsstBattleDef.h similarity index 95% rename from src/MeoAssistant/Common/AsstBattleDef.h rename to src/MaaCore/Common/AsstBattleDef.h index 2f33dee2e9..613a5f3877 100644 --- a/src/MeoAssistant/Common/AsstBattleDef.h +++ b/src/MaaCore/Common/AsstBattleDef.h @@ -164,13 +164,13 @@ namespace asst struct ReplacementHome { Point location; - BattleDeployDirection direction; + BattleDeployDirection direction = BattleDeployDirection::Right; }; struct ForceDeployDirection { - BattleDeployDirection direction; - std::unordered_set role; + BattleDeployDirection direction = BattleDeployDirection::Right; + std::unordered_set role = {}; }; struct RoguelikeBattleData @@ -180,7 +180,7 @@ namespace asst std::unordered_set blacklist_location; std::unordered_map force_deploy_direction; std::vector key_kills; - std::array role_order; + std::array role_order = {}; bool use_dice_stage = true; int stop_deploy_blocking_num = INT_MAX; int force_deploy_air_defense_num = 0; @@ -206,7 +206,7 @@ namespace asst struct BattleCharData { std::string name; - BattleRole role; + BattleRole role = BattleRole::Unknown; std::array ranges; int rarity = 0; bool with_direction = true; diff --git a/src/MeoAssistant/Common/AsstConf.h b/src/MaaCore/Common/AsstConf.h similarity index 96% rename from src/MeoAssistant/Common/AsstConf.h rename to src/MaaCore/Common/AsstConf.h index 8b42d1658e..802aafcd5e 100644 --- a/src/MeoAssistant/Common/AsstConf.h +++ b/src/MaaCore/Common/AsstConf.h @@ -19,7 +19,7 @@ #ifdef _MSC_VER #define ASST_SUPPRESS_CV_WARNINGS_START \ ASST_DO_PRAGMA(warning(push)) \ - ASST_DO_PRAGMA(warning(disable : 5054 4251 4305 4275 4100)) + ASST_DO_PRAGMA(warning(disable : 5054 4251 4305 4275 4100 4244)) #define ASST_SUPPRESS_CV_WARNINGS_END ASST_DO_PRAGMA(warning(pop)) #elif defined(__clang__) #define ASST_SUPPRESS_CV_WARNINGS_START \ diff --git a/src/MeoAssistant/Common/AsstInfrastDef.h b/src/MaaCore/Common/AsstInfrastDef.h similarity index 100% rename from src/MeoAssistant/Common/AsstInfrastDef.h rename to src/MaaCore/Common/AsstInfrastDef.h diff --git a/src/MeoAssistant/Common/AsstMsg.h b/src/MaaCore/Common/AsstMsg.h similarity index 82% rename from src/MeoAssistant/Common/AsstMsg.h rename to src/MaaCore/Common/AsstMsg.h index 2dbf7671e5..e4357e68f3 100644 --- a/src/MeoAssistant/Common/AsstMsg.h +++ b/src/MaaCore/Common/AsstMsg.h @@ -15,6 +15,7 @@ namespace asst InitFailed, // 初始化失败 ConnectionInfo, // 连接相关错误 AllTasksCompleted, // 全部任务完成 + AsyncCallInfo, // 外部异步调用信息 /* TaskChain Info */ TaskChainError = 10000, // 任务链执行/识别错误 TaskChainStart, // 任务链开始 @@ -53,12 +54,11 @@ namespace asst return os << _type_name.at(type); } - // AsstCallback 消息回调函数 - // 参数: - // AsstMsg 消息类型 - // const json::value& 消息详情json,每种消息不同,Todo,需要补充个协议文档啥的 - // void* 外部调用者自定义参数,每次回调会带出去,建议传个(void*)this指针进来 - using AsstCallback = std::function; + // 对外的回调接口 + using AsstMsgId = int32_t; + using ApiCallback = void (*)(AsstMsgId msg, const char* details_json, void* custom_arg); - using AsstApiCallback = void (*)(int msg, const char* detail_json, void* custom_arg); + // 内部使用的回调 + class Assistant; + using AsstCallback = std::function; } diff --git a/src/MeoAssistant/Common/AsstTypes.h b/src/MaaCore/Common/AsstTypes.h similarity index 97% rename from src/MeoAssistant/Common/AsstTypes.h rename to src/MaaCore/Common/AsstTypes.h index 20b35e3d41..6c3e22fc0e 100644 --- a/src/MeoAssistant/Common/AsstTypes.h +++ b/src/MaaCore/Common/AsstTypes.h @@ -29,10 +29,17 @@ namespace asst static constexpr double TemplThresholdDefault = 0.8; + enum class StaticOptionKey + { + Invalid = 0, + }; + enum class InstanceOptionKey { Invalid = 0, - MinitouchEnabled = 1, + /* Deprecated */ // MinitouchEnabled = 1, + TouchMode = 2, // 触控模式设置, "minitouch" | "maatouch" | "adb" + DeploymentWithPause = 3, // 自动战斗、肉鸽、保全 是否使用 暂停下干员, "0" | "1" }; struct Point @@ -399,4 +406,6 @@ namespace asst std::pair mask_range; // 掩码的二值化范围 bool bound = false; // 是否裁剪周围黑边 }; + + inline static const std::string UploadDataSource = "MeoAssistant"; } // namespace asst diff --git a/src/MeoAssistant/Common/AsstVersion.h b/src/MaaCore/Common/AsstVersion.h similarity index 100% rename from src/MeoAssistant/Common/AsstVersion.h rename to src/MaaCore/Common/AsstVersion.h diff --git a/src/MeoAssistant/Config/AbstractConfig.cpp b/src/MaaCore/Config/AbstractConfig.cpp similarity index 100% rename from src/MeoAssistant/Config/AbstractConfig.cpp rename to src/MaaCore/Config/AbstractConfig.cpp diff --git a/src/MeoAssistant/Config/AbstractConfig.h b/src/MaaCore/Config/AbstractConfig.h similarity index 100% rename from src/MeoAssistant/Config/AbstractConfig.h rename to src/MaaCore/Config/AbstractConfig.h diff --git a/src/MeoAssistant/Config/AbstractConfigWithTempl.h b/src/MaaCore/Config/AbstractConfigWithTempl.h similarity index 100% rename from src/MeoAssistant/Config/AbstractConfigWithTempl.h rename to src/MaaCore/Config/AbstractConfigWithTempl.h diff --git a/src/MeoAssistant/Config/AbstractResource.h b/src/MaaCore/Config/AbstractResource.h similarity index 100% rename from src/MeoAssistant/Config/AbstractResource.h rename to src/MaaCore/Config/AbstractResource.h diff --git a/src/MaaCore/Config/GeneralConfig.cpp b/src/MaaCore/Config/GeneralConfig.cpp new file mode 100644 index 0000000000..b391c5f675 --- /dev/null +++ b/src/MaaCore/Config/GeneralConfig.cpp @@ -0,0 +1,68 @@ +#include "GeneralConfig.h" + +#include "Utils/Logger.hpp" +#include + +bool asst::GeneralConfig::parse(const json::value& json) +{ + m_version = json.at("version").as_string(); + + { + const json::value& options_json = json.at("options"); + m_options.task_delay = options_json.at("taskDelay").as_integer(); + m_options.control_delay_lower = options_json.at("controlDelayRange")[0].as_integer(); + m_options.control_delay_upper = options_json.at("controlDelayRange")[1].as_integer(); + // m_options.print_window = options_json.at("printWindow").as_boolean(); + m_options.adb_extra_swipe_dist = options_json.get("adbExtraSwipeDist", 100); + m_options.adb_extra_swipe_duration = options_json.get("adbExtraSwipeDuration", -1); + m_options.adb_swipe_duration_multiplier = options_json.get("adbSwipeDurationMultiplier", 10.0); + m_options.minitouch_extra_swipe_dist = options_json.get("minitouchExtraSwipeDist", 100); + m_options.minitouch_extra_swipe_duration = options_json.get("minitouchExtraSwipeDuration", -1); + m_options.swipe_with_pause_required_distance = options_json.get("swipeWithPauseRequiredDistance", 50); + if (auto order = options_json.find("minitouchProgramsOrder")) { + for (const auto& type : *order) { + m_options.minitouch_programs_order.emplace_back(type.as_string()); + } + } + m_options.penguin_report.cmd_format = options_json.get("penguinReport", "cmdFormat", std::string()); + m_options.yituliu_report.cmd_format = options_json.get("yituliuReport", "cmdFormat", std::string()); + m_options.depot_export_template.ark_planner = + options_json.get("depotExportTemplate", "arkPlanner", std::string()); + } + + for (const auto& [client_type, intent_name] : json.at("intent").as_object()) { + m_intent_name[client_type] = intent_name.as_string(); + } + + for (const auto& cfg_json : json.at("connection").as_array()) { + std::string base_name = cfg_json.get("baseConfig", std::string()); + const AdbCfg& base_cfg = base_name.empty() ? AdbCfg() : m_adb_cfg.at(base_name); + + AdbCfg adb; + adb.connect = cfg_json.get("connect", base_cfg.connect); + adb.display_id = cfg_json.get("displayId", base_cfg.display_id); + adb.uuid = cfg_json.get("uuid", base_cfg.uuid); + adb.click = cfg_json.get("click", base_cfg.click); + adb.swipe = cfg_json.get("swipe", base_cfg.swipe); + adb.press_esc = cfg_json.get("pressEsc", base_cfg.press_esc); + adb.display = cfg_json.get("display", base_cfg.display); + adb.screencap_raw_with_gzip = cfg_json.get("screencapRawWithGzip", base_cfg.screencap_raw_with_gzip); + adb.screencap_raw_by_nc = cfg_json.get("screencapRawByNC", base_cfg.screencap_raw_by_nc); + adb.nc_address = cfg_json.get("ncAddress", base_cfg.nc_address); + adb.nc_port = static_cast(cfg_json.get("ncPort", base_cfg.nc_port)); + adb.screencap_encode = cfg_json.get("screencapEncode", base_cfg.screencap_encode); + adb.release = cfg_json.get("release", base_cfg.release); + adb.start = cfg_json.get("start", base_cfg.start); + adb.stop = cfg_json.get("stop", base_cfg.stop); + adb.abilist = cfg_json.get("abilist", base_cfg.abilist); + adb.orientation = cfg_json.get("orientation", base_cfg.orientation); + adb.push_minitouch = cfg_json.get("pushMinitouch", base_cfg.push_minitouch); + adb.chmod_minitouch = cfg_json.get("chmodMinitouch", base_cfg.chmod_minitouch); + adb.call_minitouch = cfg_json.get("callMinitouch", base_cfg.call_minitouch); + adb.call_maatouch = cfg_json.get("callMaatouch", base_cfg.call_maatouch); + + m_adb_cfg[cfg_json.at("configName").as_string()] = std::move(adb); + } + + return true; +} diff --git a/src/MeoAssistant/Config/GeneralConfig.h b/src/MaaCore/Config/GeneralConfig.h similarity index 95% rename from src/MeoAssistant/Config/GeneralConfig.h rename to src/MaaCore/Config/GeneralConfig.h index 9768864701..f7c616845f 100644 --- a/src/MeoAssistant/Config/GeneralConfig.h +++ b/src/MaaCore/Config/GeneralConfig.h @@ -42,6 +42,8 @@ namespace asst double adb_swipe_duration_multiplier = 0; // adb 滑动持续时间倍数 int minitouch_extra_swipe_dist = 0; int minitouch_extra_swipe_duration = -1; + int swipe_with_pause_required_distance = 0; + std::vector minitouch_programs_order; PenguinReportCfg penguin_report; // 企鹅物流汇报: // 每次到结算界面,汇报掉落数据至企鹅物流 https://penguin-stats.cn/ DepotExportTemplate depot_export_template; // 仓库识别结果导出模板 @@ -50,17 +52,13 @@ namespace asst struct AdbCfg { - /* format */ - std::string address_regex; - std::string display_format; - /* command */ - std::string devices; std::string connect; std::string display_id; std::string uuid; std::string click; std::string swipe; + std::string press_esc; std::string display; std::string screencap_raw_with_gzip; std::string screencap_raw_by_nc; @@ -75,6 +73,7 @@ namespace asst std::string push_minitouch; std::string chmod_minitouch; std::string call_minitouch; + std::string call_maatouch; }; class GeneralConfig final : public SingletonHolder, public AbstractConfig diff --git a/src/MeoAssistant/Config/Miscellaneous/BattleDataConfig.cpp b/src/MaaCore/Config/Miscellaneous/BattleDataConfig.cpp similarity index 100% rename from src/MeoAssistant/Config/Miscellaneous/BattleDataConfig.cpp rename to src/MaaCore/Config/Miscellaneous/BattleDataConfig.cpp diff --git a/src/MeoAssistant/Config/Miscellaneous/BattleDataConfig.h b/src/MaaCore/Config/Miscellaneous/BattleDataConfig.h similarity index 100% rename from src/MeoAssistant/Config/Miscellaneous/BattleDataConfig.h rename to src/MaaCore/Config/Miscellaneous/BattleDataConfig.h diff --git a/src/MeoAssistant/Config/Miscellaneous/CopilotConfig.cpp b/src/MaaCore/Config/Miscellaneous/CopilotConfig.cpp similarity index 99% rename from src/MeoAssistant/Config/Miscellaneous/CopilotConfig.cpp rename to src/MaaCore/Config/Miscellaneous/CopilotConfig.cpp index b92f8e3fdc..030dac7966 100644 --- a/src/MeoAssistant/Config/Miscellaneous/CopilotConfig.cpp +++ b/src/MaaCore/Config/Miscellaneous/CopilotConfig.cpp @@ -2,6 +2,7 @@ #include +#include "TilePack.h" #include "Utils/Logger.hpp" void asst::CopilotConfig::clear() @@ -13,7 +14,6 @@ void asst::CopilotConfig::clear() bool asst::CopilotConfig::parse(const json::value& json) { LogTraceFunction; - clear(); m_stage_name = json.at("stage_name").as_string(); diff --git a/src/MeoAssistant/Config/Miscellaneous/CopilotConfig.h b/src/MaaCore/Config/Miscellaneous/CopilotConfig.h similarity index 100% rename from src/MeoAssistant/Config/Miscellaneous/CopilotConfig.h rename to src/MaaCore/Config/Miscellaneous/CopilotConfig.h diff --git a/src/MeoAssistant/Config/Miscellaneous/InfrastConfig.cpp b/src/MaaCore/Config/Miscellaneous/InfrastConfig.cpp similarity index 100% rename from src/MeoAssistant/Config/Miscellaneous/InfrastConfig.cpp rename to src/MaaCore/Config/Miscellaneous/InfrastConfig.cpp diff --git a/src/MeoAssistant/Config/Miscellaneous/InfrastConfig.h b/src/MaaCore/Config/Miscellaneous/InfrastConfig.h similarity index 100% rename from src/MeoAssistant/Config/Miscellaneous/InfrastConfig.h rename to src/MaaCore/Config/Miscellaneous/InfrastConfig.h diff --git a/src/MeoAssistant/Config/Miscellaneous/ItemConfig.cpp b/src/MaaCore/Config/Miscellaneous/ItemConfig.cpp similarity index 100% rename from src/MeoAssistant/Config/Miscellaneous/ItemConfig.cpp rename to src/MaaCore/Config/Miscellaneous/ItemConfig.cpp diff --git a/src/MeoAssistant/Config/Miscellaneous/ItemConfig.h b/src/MaaCore/Config/Miscellaneous/ItemConfig.h similarity index 100% rename from src/MeoAssistant/Config/Miscellaneous/ItemConfig.h rename to src/MaaCore/Config/Miscellaneous/ItemConfig.h diff --git a/src/MeoAssistant/Config/Miscellaneous/OcrPack.cpp b/src/MaaCore/Config/Miscellaneous/OcrPack.cpp similarity index 71% rename from src/MeoAssistant/Config/Miscellaneous/OcrPack.cpp rename to src/MaaCore/Config/Miscellaneous/OcrPack.cpp index 5bfb46ae1a..84e7e1fda0 100644 --- a/src/MeoAssistant/Config/Miscellaneous/OcrPack.cpp +++ b/src/MaaCore/Config/Miscellaneous/OcrPack.cpp @@ -27,8 +27,8 @@ static std::filesystem::path prepare_paddle_dir(const std::filesystem::path& dir #endif asst::OcrPack::OcrPack() + : m_ocr_option(std::make_unique()), m_det(nullptr), m_rec(nullptr), m_ocr(nullptr) { - m_ocr_option = std::make_unique(); m_ocr_option->UseOrtBackend(); } @@ -43,26 +43,42 @@ bool asst::OcrPack::load(const std::filesystem::path& path) return false; } - using namespace asst::utils::path_literals; - const auto dst_model_file = paddle_dir / "det"_p / "inference.pdmodel"_p; - const auto dst_params_file = paddle_dir / "det"_p / "inference.pdiparams"_p; - const auto rec_model_file = paddle_dir / "rec"_p / "inference.pdmodel"_p; - const auto rec_params_file = paddle_dir / "rec"_p / "inference.pdiparams"_p; - const auto rec_label_file = paddle_dir / "ppocr_keys_v1.txt"_p; + do { + using namespace asst::utils::path_literals; + const auto dst_model_file = paddle_dir / "det"_p / "inference.pdmodel"_p; + const auto dst_params_file = paddle_dir / "det"_p / "inference.pdiparams"_p; + const auto rec_model_file = paddle_dir / "rec"_p / "inference.pdmodel"_p; + const auto rec_params_file = paddle_dir / "rec"_p / "inference.pdiparams"_p; + const auto rec_label_file = paddle_dir / "keys.txt"_p; - if (!std::filesystem::exists(dst_model_file) || !std::filesystem::exists(dst_params_file) || - !std::filesystem::exists(rec_model_file) || !std::filesystem::exists(rec_params_file) || - !std::filesystem::exists(rec_label_file)) { - return false; - } + if (std::filesystem::exists(dst_model_file) && std::filesystem::exists(dst_params_file)) { + m_det = std::make_unique( + asst::utils::path_to_ansi_string(dst_model_file), asst::utils::path_to_ansi_string(dst_params_file), + *m_ocr_option); + } + else if (!m_det) { + break; + } + // else 沿用原来的模型 - m_det = std::make_unique(asst::utils::path_to_ansi_string(dst_model_file), - asst::utils::path_to_ansi_string(dst_params_file), - *m_ocr_option); - m_rec = std::make_unique( - asst::utils::path_to_ansi_string(rec_model_file), asst::utils::path_to_ansi_string(rec_params_file), - asst::utils::path_to_ansi_string(rec_label_file), *m_ocr_option); - m_ocr = std::make_unique(m_det.get(), m_rec.get()); + if (std::filesystem::exists(rec_model_file) && std::filesystem::exists(rec_params_file) && + std::filesystem::exists(rec_label_file)) { + m_rec = std::make_unique( + asst::utils::path_to_ansi_string(rec_model_file), asst::utils::path_to_ansi_string(rec_params_file), + asst::utils::path_to_ansi_string(rec_label_file), *m_ocr_option); + } + else if (!m_rec) { + break; + } + // else 沿用原来的模型 + + if (m_det && m_rec) { + m_ocr = std::make_unique(m_det.get(), m_rec.get()); + } + else { + break; + } + } while (false); if (use_temp_dir) { // files can be removed after load @@ -100,29 +116,18 @@ std::vector asst::OcrPack::recognize(const cv::Mat& image, const bool without_det, bool trim) { std::string class_type = utils::demangle(typeid(*this).name()); - // 如果是带 ROI 的 cv::Mat, data 仍是指向完整的图片数据,仅通过内部的一些其他参数标识 ROI - // 直接取 data 拿到的不是正确的图,所以拷贝一份出来 - cv::Mat copied = image.clone(); fastdeploy::vision::OCRResult ocr_result; if (!without_det) { - LogTraceScope("Ocr System with " + class_type); - - m_ocr->Predict(&copied, &ocr_result); + LogTraceScope("Ocr Pipeline with " + class_type); + m_ocr->Predict(image, &ocr_result); } else { LogTraceScope("Ocr Rec with " + class_type); - - std::vector rec_imgs = { std::move(copied) }; - std::vector rec_texts; - std::vector rec_scores; - m_rec->BatchPredict(rec_imgs, &rec_texts, &rec_scores); - - if (!rec_texts.empty()) { - ocr_result.text.emplace_back(std::move(rec_texts.front())); - } - if (!rec_scores.empty()) { - ocr_result.rec_scores.emplace_back(rec_scores.front()); - } + std::string rec_text; + float rec_score = 0; + m_rec->Predict(image, &rec_text, &rec_score); + ocr_result.text.emplace_back(std::move(rec_text)); + ocr_result.rec_scores.emplace_back(rec_score); } #ifdef ASST_DEBUG @@ -147,17 +152,16 @@ std::vector asst::OcrPack::recognize(const cv::Mat& image, const else { det_rect = Rect(0, 0, image.cols, image.rows); } - std::string text = ocr_result.text.at(i); - double score = ocr_result.rec_scores.at(i); - if (score > 2.0) { - score = 0; - } #ifdef ASST_DEBUG cv::rectangle(draw, make_rect(det_rect), cv::Scalar(0, 0, 255), 2); #endif - TextRect tr(score, det_rect, std::move(text)); + double score = ocr_result.rec_scores.at(i); + if (score > 2.0) { + score = 0; + } + TextRect tr(score, det_rect, std::move(ocr_result.text.at(i))); raw_result.emplace_back(tr); if (trim) { utils::string_trim(tr.text); diff --git a/src/MeoAssistant/Config/Miscellaneous/OcrPack.h b/src/MaaCore/Config/Miscellaneous/OcrPack.h similarity index 84% rename from src/MeoAssistant/Config/Miscellaneous/OcrPack.h rename to src/MaaCore/Config/Miscellaneous/OcrPack.h index 6f9b1ea83c..5b77486a9b 100644 --- a/src/MeoAssistant/Config/Miscellaneous/OcrPack.h +++ b/src/MaaCore/Config/Miscellaneous/OcrPack.h @@ -30,9 +30,6 @@ namespace asst { class OcrPack : public AbstractResource { - protected: - static constexpr size_t MaxBoxSize = 256; - public: virtual ~OcrPack() override; @@ -46,10 +43,10 @@ namespace asst protected: OcrPack(); - std::unique_ptr m_ocr_option = nullptr; - std::unique_ptr m_det = nullptr; - std::unique_ptr m_rec = nullptr; - std::unique_ptr m_ocr = nullptr; + std::unique_ptr m_ocr_option; + std::unique_ptr m_det; + std::unique_ptr m_rec; + std::unique_ptr m_ocr; }; class WordOcr final : public SingletonHolder, public OcrPack diff --git a/src/MeoAssistant/Config/Miscellaneous/RecruitConfig.cpp b/src/MaaCore/Config/Miscellaneous/RecruitConfig.cpp similarity index 100% rename from src/MeoAssistant/Config/Miscellaneous/RecruitConfig.cpp rename to src/MaaCore/Config/Miscellaneous/RecruitConfig.cpp diff --git a/src/MeoAssistant/Config/Miscellaneous/RecruitConfig.h b/src/MaaCore/Config/Miscellaneous/RecruitConfig.h similarity index 100% rename from src/MeoAssistant/Config/Miscellaneous/RecruitConfig.h rename to src/MaaCore/Config/Miscellaneous/RecruitConfig.h diff --git a/src/MeoAssistant/Config/Miscellaneous/StageDropsConfig.cpp b/src/MaaCore/Config/Miscellaneous/StageDropsConfig.cpp similarity index 100% rename from src/MeoAssistant/Config/Miscellaneous/StageDropsConfig.cpp rename to src/MaaCore/Config/Miscellaneous/StageDropsConfig.cpp diff --git a/src/MeoAssistant/Config/Miscellaneous/StageDropsConfig.h b/src/MaaCore/Config/Miscellaneous/StageDropsConfig.h similarity index 100% rename from src/MeoAssistant/Config/Miscellaneous/StageDropsConfig.h rename to src/MaaCore/Config/Miscellaneous/StageDropsConfig.h diff --git a/src/MeoAssistant/Config/Miscellaneous/TilePack.cpp b/src/MaaCore/Config/Miscellaneous/TilePack.cpp similarity index 92% rename from src/MeoAssistant/Config/Miscellaneous/TilePack.cpp rename to src/MaaCore/Config/Miscellaneous/TilePack.cpp index 79daa2c5ff..fcb5259d9e 100644 --- a/src/MeoAssistant/Config/Miscellaneous/TilePack.cpp +++ b/src/MaaCore/Config/Miscellaneous/TilePack.cpp @@ -7,8 +7,6 @@ ASST_SUPPRESS_CV_WARNINGS_END #include "Utils/Logger.hpp" -asst::TilePack::~TilePack() = default; - bool asst::TilePack::load(const std::filesystem::path& path) { if (!std::filesystem::exists(path)) { @@ -16,7 +14,7 @@ bool asst::TilePack::load(const std::filesystem::path& path) } try { - m_tile_calculator = std::make_unique(WindowWidthDefault, WindowHeightDefault, path); + m_tile_calculator = std::make_shared(WindowWidthDefault, WindowHeightDefault, path); } catch (const std::exception& e) { Log.error("Tile create failed", e.what()); @@ -25,6 +23,16 @@ bool asst::TilePack::load(const std::filesystem::path& path) return m_tile_calculator != nullptr; } +bool asst::TilePack::contains(const std::string& any_key) const +{ + return m_tile_calculator->contains(any_key); +} + +bool asst::TilePack::contains(const LevelKey& key) const +{ + return m_tile_calculator->contains(key); +} + std::unordered_map proc_data(const std::vector>& pos, const std::vector>& tiles) { @@ -103,4 +111,4 @@ std::unordered_map asst::TilePack::calc(c } return proc_data(pos, tiles); -} \ No newline at end of file +} diff --git a/src/MeoAssistant/Config/Miscellaneous/TilePack.h b/src/MaaCore/Config/Miscellaneous/TilePack.h similarity index 94% rename from src/MeoAssistant/Config/Miscellaneous/TilePack.h rename to src/MaaCore/Config/Miscellaneous/TilePack.h index 7b06278a98..bbeda7faf0 100644 --- a/src/MeoAssistant/Config/Miscellaneous/TilePack.h +++ b/src/MaaCore/Config/Miscellaneous/TilePack.h @@ -58,10 +58,12 @@ namespace asst }; public: - virtual ~TilePack() override; + virtual ~TilePack() override = default; virtual bool load(const std::filesystem::path& path) override; + bool contains(const std::string& any_key) const; + bool contains(const LevelKey& key) const; std::unordered_map calc(const std::string& any_key, bool side) const; std::unordered_map calc(const LevelKey& key, bool side) const; diff --git a/src/MeoAssistant/Config/ResourceLoader.cpp b/src/MaaCore/Config/ResourceLoader.cpp similarity index 86% rename from src/MeoAssistant/Config/ResourceLoader.cpp rename to src/MaaCore/Config/ResourceLoader.cpp index 7af9e5e6a0..1b9d2fb1c9 100644 --- a/src/MeoAssistant/Config/ResourceLoader.cpp +++ b/src/MaaCore/Config/ResourceLoader.cpp @@ -26,6 +26,7 @@ bool asst::ResourceLoader::load(const std::filesystem::path& path) auto full_path = path / Filename; \ bool ret = load_resource(full_path); \ if (!ret) { \ + m_loaded = false; \ Log.error(#Config, " load failed, path:", full_path); \ return false; \ } \ @@ -38,6 +39,7 @@ bool asst::ResourceLoader::load(const std::filesystem::path& path) auto full_templ_dir = path / TemplDir; \ bool ret = load_resource_with_templ(full_path, full_templ_dir); \ if (!ret) { \ + m_loaded = false; \ Log.error(#Config, "load failed, path:", full_path, ", templ dir:", full_templ_dir); \ return false; \ } \ @@ -50,9 +52,9 @@ bool asst::ResourceLoader::load(const std::filesystem::path& path) LoadResourceAndCheckRet(GeneralConfig, "config.json"_p); LoadResourceAndCheckRet(RecruitConfig, "recruitment.json"_p); LoadResourceAndCheckRet(StageDropsConfig, "stages.json"_p); - LoadResourceAndCheckRet(RoguelikeCopilotConfig, "roguelike_copilot.json"_p); - LoadResourceAndCheckRet(RoguelikeRecruitConfig, "roguelike_recruit.json"_p); - LoadResourceAndCheckRet(RoguelikeShoppingConfig, "roguelike_shopping.json"_p); + LoadResourceAndCheckRet(RoguelikeCopilotConfig, "roguelike"_p / "copilot.json"_p); + LoadResourceAndCheckRet(RoguelikeRecruitConfig, "roguelike"_p / "recruitment.json"_p); + LoadResourceAndCheckRet(RoguelikeShoppingConfig, "roguelike"_p / "shopping.json"_p); LoadResourceAndCheckRet(BattleDataConfig, "battle_data.json"_p); /* load resource with json and template files*/ @@ -72,3 +74,8 @@ bool asst::ResourceLoader::load(const std::filesystem::path& path) return true; } + +bool asst::ResourceLoader::loaded() const noexcept +{ + return m_loaded; +} diff --git a/src/MeoAssistant/Config/ResourceLoader.h b/src/MaaCore/Config/ResourceLoader.h similarity index 97% rename from src/MeoAssistant/Config/ResourceLoader.h rename to src/MaaCore/Config/ResourceLoader.h index 06e55c6bec..e1b4671027 100644 --- a/src/MeoAssistant/Config/ResourceLoader.h +++ b/src/MaaCore/Config/ResourceLoader.h @@ -16,6 +16,7 @@ namespace asst virtual ~ResourceLoader() override = default; virtual bool load(const std::filesystem::path& path) override; + bool loaded() const noexcept; private: template diff --git a/src/MeoAssistant/Config/Roguelike/RoguelikeCopilotConfig.cpp b/src/MaaCore/Config/Roguelike/RoguelikeCopilotConfig.cpp similarity index 98% rename from src/MeoAssistant/Config/Roguelike/RoguelikeCopilotConfig.cpp rename to src/MaaCore/Config/Roguelike/RoguelikeCopilotConfig.cpp index 4da39f4eaa..79b29599d4 100644 --- a/src/MeoAssistant/Config/Roguelike/RoguelikeCopilotConfig.cpp +++ b/src/MaaCore/Config/Roguelike/RoguelikeCopilotConfig.cpp @@ -82,7 +82,6 @@ bool asst::RoguelikeCopilotConfig::parse(const json::value& json) BattleRole::Caster, BattleRole::Support, BattleRole::Special, BattleRole::Drone, }; - auto to_lower = [](char c) -> char { return static_cast(std::tolower(c)); }; if (auto opt = stage_info.find("role_order")) { const auto& raw_roles = opt.value(); using views::filter, views::transform; @@ -95,7 +94,7 @@ bool asst::RoguelikeCopilotConfig::parse(const json::value& json) } auto roles = raw_roles | filter(&json::value::is_string) | transform(&json::value::as_string) | transform([&](std::string name) { - ranges::for_each(name, to_lower); + utils::tolowers(name); return std::move(name); }); for (const std::string& role_name : roles) { diff --git a/src/MeoAssistant/Config/Roguelike/RoguelikeCopilotConfig.h b/src/MaaCore/Config/Roguelike/RoguelikeCopilotConfig.h similarity index 100% rename from src/MeoAssistant/Config/Roguelike/RoguelikeCopilotConfig.h rename to src/MaaCore/Config/Roguelike/RoguelikeCopilotConfig.h diff --git a/src/MeoAssistant/Config/Roguelike/RoguelikeRecruitConfig.cpp b/src/MaaCore/Config/Roguelike/RoguelikeRecruitConfig.cpp similarity index 100% rename from src/MeoAssistant/Config/Roguelike/RoguelikeRecruitConfig.cpp rename to src/MaaCore/Config/Roguelike/RoguelikeRecruitConfig.cpp diff --git a/src/MeoAssistant/Config/Roguelike/RoguelikeRecruitConfig.h b/src/MaaCore/Config/Roguelike/RoguelikeRecruitConfig.h similarity index 100% rename from src/MeoAssistant/Config/Roguelike/RoguelikeRecruitConfig.h rename to src/MaaCore/Config/Roguelike/RoguelikeRecruitConfig.h diff --git a/src/MeoAssistant/Config/Roguelike/RoguelikeShoppingConfig.cpp b/src/MaaCore/Config/Roguelike/RoguelikeShoppingConfig.cpp similarity index 100% rename from src/MeoAssistant/Config/Roguelike/RoguelikeShoppingConfig.cpp rename to src/MaaCore/Config/Roguelike/RoguelikeShoppingConfig.cpp diff --git a/src/MeoAssistant/Config/Roguelike/RoguelikeShoppingConfig.h b/src/MaaCore/Config/Roguelike/RoguelikeShoppingConfig.h similarity index 100% rename from src/MeoAssistant/Config/Roguelike/RoguelikeShoppingConfig.h rename to src/MaaCore/Config/Roguelike/RoguelikeShoppingConfig.h diff --git a/src/MeoAssistant/Config/TaskData.cpp b/src/MaaCore/Config/TaskData.cpp similarity index 99% rename from src/MeoAssistant/Config/TaskData.cpp rename to src/MaaCore/Config/TaskData.cpp index 4a107cadb2..27bfd6fa35 100644 --- a/src/MeoAssistant/Config/TaskData.cpp +++ b/src/MaaCore/Config/TaskData.cpp @@ -587,6 +587,7 @@ bool asst::TaskData::syntax_check(const std::string& task_name, const json::valu "action", "algorithm", "baseTask", "cache", "exceededNext", "maskRange", "maxTimes", "next", "onErrorNext", "postDelay", "preDelay", "rectMove", "reduceOtherTimes", "roi", "sub", "subErrorIgnored", "templThreshold", "template", + "specialParams" } }, { AlgorithmType::OcrDetect, { @@ -594,6 +595,7 @@ bool asst::TaskData::syntax_check(const std::string& task_name, const json::valu "fullMatch", "isAscii", "maxTimes", "next", "ocrReplace", "onErrorNext", "postDelay", "preDelay", "rectMove", "reduceOtherTimes", "roi", "sub", "subErrorIgnored", "text", "withoutDet", + "specialParams" } }, { AlgorithmType::JustReturn, { diff --git a/src/MeoAssistant/Config/TaskData.h b/src/MaaCore/Config/TaskData.h similarity index 100% rename from src/MeoAssistant/Config/TaskData.h rename to src/MaaCore/Config/TaskData.h diff --git a/src/MeoAssistant/Config/TemplResource.cpp b/src/MaaCore/Config/TemplResource.cpp similarity index 100% rename from src/MeoAssistant/Config/TemplResource.cpp rename to src/MaaCore/Config/TemplResource.cpp diff --git a/src/MeoAssistant/Config/TemplResource.h b/src/MaaCore/Config/TemplResource.h similarity index 100% rename from src/MeoAssistant/Config/TemplResource.h rename to src/MaaCore/Config/TemplResource.h diff --git a/src/MeoAssistant/Controller.cpp b/src/MaaCore/Controller.cpp similarity index 90% rename from src/MeoAssistant/Controller.cpp rename to src/MaaCore/Controller.cpp index 136a571873..40d72ec187 100644 --- a/src/MeoAssistant/Controller.cpp +++ b/src/MaaCore/Controller.cpp @@ -22,6 +22,7 @@ #include #include +#include "Assistant.h" #include "Common/AsstConf.h" #include "Utils/NoWarningCV.h" @@ -40,8 +41,8 @@ #include "Utils/StringMisc.hpp" #include "Utils/WorkingDir.hpp" -asst::Controller::Controller(const AsstCallback& callback, void* callback_arg) - : m_callback(callback), m_callback_arg(callback_arg), m_rand_engine(std::random_device {}()) +asst::Controller::Controller(const AsstCallback& callback, Assistant* inst) + : InstHelper(inst), m_callback(callback), m_rand_engine(std::random_device {}()) { LogTraceFunction; @@ -84,11 +85,6 @@ std::pair asst::Controller::get_scale_size() const noexcept return m_scale_size; } -bool asst::Controller::need_exit() const -{ - return m_exit_flag != nullptr && *m_exit_flag; -} - std::optional asst::Controller::call_command(const std::string& cmd, int64_t timeout, bool allow_reconnect, bool recv_by_socket) { @@ -99,7 +95,7 @@ std::optional asst::Controller::call_command(const std::string& cmd std::string pipe_data; std::string sock_data; asst::platform::single_page_buffer pipe_buffer; - std::optional> sock_buffer; + asst::platform::single_page_buffer sock_buffer; auto start_time = steady_clock::now(); std::unique_lock callcmd_lock(m_callcmd_mutex); @@ -155,9 +151,9 @@ std::optional asst::Controller::call_command(const std::string& cmd sockov.hEvent = CreateEventW(nullptr, TRUE, FALSE, nullptr); client_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); DWORD dummy; - if (!m_server_accept_ex(m_server_sock, client_socket, sock_buffer.value().get(), - (DWORD)sock_buffer.value().size() - ((sizeof(sockaddr_in) + 16) * 2), - sizeof(sockaddr_in) + 16, sizeof(sockaddr_in) + 16, &dummy, &sockov)) { + if (!m_server_accept_ex(m_server_sock, client_socket, sock_buffer.get(), + (DWORD)sock_buffer.size() - ((sizeof(sockaddr_in) + 16) * 2), sizeof(sockaddr_in) + 16, + sizeof(sockaddr_in) + 16, &dummy, &sockov)) { err = WSAGetLastError(); if (err == ERROR_IO_PENDING) { accept_pending = true; @@ -246,8 +242,7 @@ std::optional asst::Controller::call_command(const std::string& cmd DWORD len = 0; if (GetOverlappedResult(reinterpret_cast(m_server_sock), &sockov, &len, FALSE)) { accept_pending = false; - if (recv_by_socket) - sock_data.insert(sock_data.end(), sock_buffer.value().get(), sock_buffer.value().get() + len); + if (recv_by_socket) sock_data.insert(sock_data.end(), sock_buffer.get(), sock_buffer.get() + len); if (len == 0) { socket_eof = true; @@ -259,8 +254,8 @@ std::optional asst::Controller::call_command(const std::string& cmd sockov = {}; sockov.hEvent = event; - (void)ReadFile(reinterpret_cast(client_socket), sock_buffer.value().get(), - (DWORD)sock_buffer.value().size(), nullptr, &sockov); + (void)ReadFile(reinterpret_cast(client_socket), sock_buffer.get(), + (DWORD)sock_buffer.size(), nullptr, &sockov); } } } @@ -268,15 +263,14 @@ std::optional asst::Controller::call_command(const std::string& cmd // ReadFile DWORD len = 0; if (GetOverlappedResult(reinterpret_cast(client_socket), &sockov, &len, FALSE)) { - if (recv_by_socket) - sock_data.insert(sock_data.end(), sock_buffer.value().get(), sock_buffer.value().get() + len); + if (recv_by_socket) sock_data.insert(sock_data.end(), sock_buffer.get(), sock_buffer.get() + len); if (len == 0) { socket_eof = true; ::closesocket(client_socket); } else { - (void)ReadFile(reinterpret_cast(client_socket), sock_buffer.value().get(), - (DWORD)sock_buffer.value().size(), nullptr, &sockov); + (void)ReadFile(reinterpret_cast(client_socket), sock_buffer.get(), + (DWORD)sock_buffer.size(), nullptr, &sockov); } } else { @@ -336,11 +330,11 @@ std::optional asst::Controller::call_command(const std::string& cmd return std::nullopt; } - ssize_t read_num = ::read(client_socket, sock_buffer.value().get(), sock_buffer.value().size()); + ssize_t read_num = ::read(client_socket, sock_buffer.get(), sock_buffer.size()); while (read_num > 0) { - sock_data.insert(sock_data.end(), sock_buffer.value().get(), sock_buffer.value().get() + read_num); - read_num = ::read(client_socket, sock_buffer.value().get(), sock_buffer.value().size()); + sock_data.insert(sock_data.end(), sock_buffer.get(), sock_buffer.get() + read_num); + read_num = ::read(client_socket, sock_buffer.get(), sock_buffer.size()); } ::close(client_socket); @@ -417,7 +411,9 @@ std::optional asst::Controller::call_command(const std::string& cmd is_reconnect_success = reconnect_str.find("error") == std::string::npos; } if (is_reconnect_success) { - call_and_hup_minitouch(m_adb.call_minitouch); + if (call_and_hup_minitouch()) { + m_minitouch_available = true; + } auto recall_ret = call_command(cmd, timeout, false /* 禁止重连避免无限递归 */, recv_by_socket); if (recall_ret) { // 重连并成功执行了 @@ -446,17 +442,17 @@ std::optional asst::Controller::call_command(const std::string& cmd void asst::Controller::callback(AsstMsg msg, const json::value& details) { if (m_callback) { - m_callback(msg, details, m_callback_arg); + m_callback(msg, details, m_inst); } } -bool asst::Controller::call_and_hup_minitouch(const std::string& cmd) +bool asst::Controller::call_and_hup_minitouch() { LogTraceFunction; release_minitouch(true); + std::string cmd = m_use_maa_touch ? m_adb.call_maatouch : m_adb.call_minitouch; Log.info(cmd); - m_minitouch_avaiable = false; constexpr int PipeReadBuffSize = 4096ULL; constexpr int PipeWriteBuffSize = 64 * 1024ULL; @@ -639,15 +635,12 @@ bool asst::Controller::call_and_hup_minitouch(const std::string& cmd) m_minitouch_props.x_scaling = static_cast(m_minitouch_props.max_x) / m_width; m_minitouch_props.y_scaling = static_cast(m_minitouch_props.max_y) / m_height; - m_minitouch_avaiable = true; return true; } bool asst::Controller::input_to_minitouch(const std::string& cmd) { -#ifdef ASST_DEBUG - Log.info("Input to minitouch", Logger::separator::newline, cmd); -#endif + // Log.debug("Input to minitouch", Logger::separator::newline, cmd); #ifdef _WIN32 if (m_minitouch_parent_write == INVALID_HANDLE_VALUE) { @@ -675,10 +668,10 @@ void asst::Controller::release_minitouch(bool force) { LogTraceFunction; - if (!m_minitouch_avaiable && !force) { + if (!m_minitouch_available && !force) { return; } - m_minitouch_avaiable = false; + m_minitouch_available = false; #ifdef _WIN32 @@ -788,7 +781,7 @@ void asst::Controller::clear_info() noexcept m_width = 0; m_height = 0; m_control_scale = 1.0; - m_minitouch_avaiable = false; + m_minitouch_available = false; m_scale_size = { WindowWidthDefault, WindowHeightDefault }; m_minitouch_props = decltype(m_minitouch_props)(); m_screencap_data_general_size = 0; @@ -1117,7 +1110,7 @@ bool asst::Controller::click_without_scale(const Point& p) Log.error("click point out of range"); } - if (m_minitouch_enabled && m_minitouch_avaiable) { + if (m_minitouch_enabled && m_minitouch_available) { Log.info("minitouch click:", p); Minitoucher toucher(std::bind(&Controller::input_to_minitouch, this, std::placeholders::_1), m_minitouch_props); return toucher.down(p.x, p.y) && toucher.up(); @@ -1135,7 +1128,7 @@ bool asst::Controller::click_without_scale(const Rect& rect) } bool asst::Controller::swipe(const Point& p1, const Point& p2, int duration, bool extra_swipe, double slope_in, - double slope_out) + double slope_out, bool with_pause) { int x1 = static_cast(p1.x * m_control_scale); int y1 = static_cast(p1.y * m_control_scale); @@ -1143,17 +1136,18 @@ bool asst::Controller::swipe(const Point& p1, const Point& p2, int duration, boo int y2 = static_cast(p2.y * m_control_scale); // log.trace("Swipe, raw:", p1.x, p1.y, p2.x, p2.y, "corr:", x1, y1, x2, y2); - return swipe_without_scale(Point(x1, y1), Point(x2, y2), duration, extra_swipe, slope_in, slope_out); + return swipe_without_scale(Point(x1, y1), Point(x2, y2), duration, extra_swipe, slope_in, slope_out, with_pause); } bool asst::Controller::swipe(const Rect& r1, const Rect& r2, int duration, bool extra_swipe, double slope_in, - double slope_out) + double slope_out, bool with_pause) { - return swipe(rand_point_in_rect(r1), rand_point_in_rect(r2), duration, extra_swipe, slope_in, slope_out); + return swipe(rand_point_in_rect(r1), rand_point_in_rect(r2), duration, extra_swipe, slope_in, slope_out, + with_pause); } bool asst::Controller::swipe_without_scale(const Point& p1, const Point& p2, int duration, bool extra_swipe, - double slope_in, double slope_out) + double slope_in, double slope_out, bool with_pause) { int x1 = p1.x, y1 = p1.y; int x2 = p2.x, y2 = p2.y; @@ -1166,13 +1160,10 @@ bool asst::Controller::swipe_without_scale(const Point& p1, const Point& p2, int } const auto& opt = Config.get_options(); - if (m_minitouch_enabled && m_minitouch_avaiable) { + if (m_minitouch_enabled && m_minitouch_available) { Log.info("minitouch swipe", p1, p2, duration, extra_swipe, slope_in, slope_out); Minitoucher toucher(std::bind(&Controller::input_to_minitouch, this, std::placeholders::_1), m_minitouch_props); toucher.down(x1, y1); - if (duration == 0) { - duration = 150; - } constexpr int TimeInterval = Minitoucher::DefaultSwipeDelay; @@ -1183,11 +1174,25 @@ bool asst::Controller::swipe_without_scale(const Point& p1, const Point& p2, int return a * t + b * std::pow(t, 2) + c * std::pow(t, 3); }; // TODO: move this to math.hpp + bool need_pause = with_pause && support_swipe_with_pause(); + std::future pause_future; auto minitouch_move = [&](int _x1, int _y1, int _x2, int _y2, int _duration) { for (int cur_time = TimeInterval; cur_time < _duration; cur_time += TimeInterval) { double progress = cubic_spline(slope_in, slope_out, static_cast(cur_time) / duration); int cur_x = static_cast(std::lerp(_x1, _x2, progress)); int cur_y = static_cast(std::lerp(_y1, _y2, progress)); + if (need_pause && std::sqrt(std::pow(cur_x - _x1, 2) + std::pow(cur_y - _y1, 2)) > + opt.swipe_with_pause_required_distance) { + need_pause = false; + if (m_use_maa_touch) { + constexpr int EscKeyCode = 111; + toucher.key_down(EscKeyCode); + toucher.key_up(EscKeyCode, 0); + } + else { + pause_future = std::async(std::launch::async, [&]() { press_esc(); }); + } + } if (cur_x < 0 || cur_x > m_minitouch_props.max_x || cur_y < 0 || cur_y > m_minitouch_props.max_y) { continue; } @@ -1197,13 +1202,14 @@ bool asst::Controller::swipe_without_scale(const Point& p1, const Point& p2, int toucher.move(_x2, _y2); } }; - minitouch_move(x1, y1, x2, y2, duration); + + constexpr int DefaultDuration = 200; + minitouch_move(x1, y1, x2, y2, duration ? duration : DefaultDuration); if (extra_swipe && opt.minitouch_extra_swipe_duration > 0) { constexpr int ExtraEndDelay = 100; // 停留终点 toucher.wait(ExtraEndDelay); minitouch_move(x2, y2, x2, y2 - opt.minitouch_extra_swipe_dist, opt.minitouch_extra_swipe_duration); - duration += opt.minitouch_extra_swipe_duration; } return toucher.up(); } @@ -1236,9 +1242,22 @@ bool asst::Controller::swipe_without_scale(const Point& p1, const Point& p2, int } bool asst::Controller::swipe_without_scale(const Rect& r1, const Rect& r2, int duration, bool extra_swipe, double v0, - double v1) + double v1, bool with_pause) { - return swipe_without_scale(rand_point_in_rect(r1), rand_point_in_rect(r2), duration, extra_swipe, v0, v1); + return swipe_without_scale(rand_point_in_rect(r1), rand_point_in_rect(r2), duration, extra_swipe, v0, v1, + with_pause); +} + +bool asst::Controller::press_esc() +{ + LogTraceFunction; + + return call_command(m_adb.press_esc).has_value(); +} + +bool asst::Controller::support_swipe_with_pause() const noexcept +{ + return m_minitouch_enabled && m_minitouch_available && m_swipe_with_pause_enabled && !m_adb.press_esc.empty(); } bool asst::Controller::connect(const std::string& adb_path, const std::string& address, const std::string& config) @@ -1386,17 +1405,11 @@ bool asst::Controller::connect(const std::string& adb_path, const std::string& a callback(AsstMsg::ConnectionInfo, info); return false; } - - auto& display_pipe_str = display_ret.value(); + std::stringstream display_ss(display_ret.value()); int size_value1 = 0; int size_value2 = 0; -#ifdef _MSC_VER - sscanf_s(display_pipe_str.c_str(), adb_cfg.display_format.c_str(), &size_value1, &size_value2); -#else - sscanf(display_pipe_str.c_str(), adb_cfg.display_format.c_str(), &size_value1, &size_value2); -#endif - // 为了防止抓取句柄的时候手机是竖屏的(还没进游戏),这里取大的值为宽,小的为高 - // 总不能有人竖屏玩明日方舟吧(? + display_ss >> size_value1 >> size_value2; + m_width = (std::max)(size_value1, size_value2); m_height = (std::min)(size_value1, size_value2); @@ -1466,6 +1479,7 @@ bool asst::Controller::connect(const std::string& adb_path, const std::string& a m_adb.click = cmd_replace(adb_cfg.click); m_adb.swipe = cmd_replace(adb_cfg.swipe); + m_adb.press_esc = cmd_replace(adb_cfg.press_esc); m_adb.screencap_raw_with_gzip = cmd_replace(adb_cfg.screencap_raw_with_gzip); m_adb.screencap_encode = cmd_replace(adb_cfg.screencap_encode); m_adb_release = m_adb.release = cmd_replace(adb_cfg.release); @@ -1506,42 +1520,64 @@ bool asst::Controller::connect(const std::string& adb_path, const std::string& a return false; } - std::string abilist = call_command(cmd_replace(adb_cfg.abilist)).value_or(""); - constexpr std::array OrderedABI = { - "x86_64", "x86", "arm64-v8a", "armeabi-v7a", "armeabi", - }; - std::string_view optimal_abi = "armeabi-v7a"; - for (const auto& abi : OrderedABI) { - if (abilist.find(abi) != std::string::npos) { - optimal_abi = abi; - break; - } - } - Log.info("The optimal abi is", optimal_abi); + while (m_minitouch_enabled) { + m_minitouch_available = false; - auto minitouch_cmd_rep = [&](const std::string& cfg_cmd) -> std::string { - using namespace asst::utils::path_literals; - return utils::string_replace_all( - cmd_replace(cfg_cmd), - { - { "[minitouchLocalPath]", - utils::path_to_utf8_string(ResDir.get() / "minitouch"_p / optimal_abi / "minitouch"_p) }, - { "[minitouchWorkingFile]", m_uuid }, - }); + std::string_view touch_program; + if (m_use_maa_touch) { + touch_program = "maatouch"; + m_minitouch_props.orientation = 0; + } + else { + std::string abilist = call_command(cmd_replace(adb_cfg.abilist)).value_or(std::string()); + for (const auto& abi : Config.get_options().minitouch_programs_order) { + if (abilist.find(abi) != std::string::npos) { + touch_program = abi; + break; + } + } + std::string orientation_str = call_command(cmd_replace(adb_cfg.orientation)).value_or("0"); + if (!orientation_str.empty()) { + char first = orientation_str.front(); + if (first == '0' || first == '1' || first == '2' || first == '3') { + m_minitouch_props.orientation = static_cast(first - '0'); + } + } + } + Log.info("touch_program", touch_program, "orientation", m_minitouch_props.orientation); + + if (touch_program.empty()) break; + + auto minitouch_cmd_rep = [&](const std::string& cfg_cmd) -> std::string { + using namespace asst::utils::path_literals; + return utils::string_replace_all( + cmd_replace(cfg_cmd), + { + { "[minitouchLocalPath]", + utils::path_to_utf8_string(ResDir.get() / "minitouch"_p / touch_program / "minitouch"_p) }, + { "[minitouchWorkingFile]", m_uuid }, + }); + }; + + if (!call_command(minitouch_cmd_rep(adb_cfg.push_minitouch))) break; + if (!call_command(minitouch_cmd_rep(adb_cfg.chmod_minitouch))) break; + + m_adb.call_minitouch = minitouch_cmd_rep(adb_cfg.call_minitouch); + m_adb.call_maatouch = minitouch_cmd_rep(adb_cfg.call_maatouch); + + if (!call_and_hup_minitouch()) break; + + m_minitouch_available = true; + break; }; - call_command(minitouch_cmd_rep(adb_cfg.push_minitouch)); - call_command(minitouch_cmd_rep(adb_cfg.chmod_minitouch)); - - m_adb.call_minitouch = minitouch_cmd_rep(adb_cfg.call_minitouch); - call_and_hup_minitouch(m_adb.call_minitouch); - - std::string orientation_str = call_command(cmd_replace(adb_cfg.orientation)).value_or("0"); - if (!orientation_str.empty()) { - char first = orientation_str.front(); - if (first == '0' || first == '1' || first == '2' || first == '3') { - m_minitouch_props.orientation = static_cast(first - '0'); - } + if (m_minitouch_enabled && !m_minitouch_available) { + json::value info = get_info_json() | json::object { + { "what", "TouchModeNotAvailable" }, + { "why", "" }, + }; + callback(AsstMsg::ConnectionInfo, info); + return false; } // try to find the fastest way @@ -1611,9 +1647,15 @@ bool asst::Controller::inited() const noexcept return m_inited; } -void asst::Controller::set_exit_flag(bool* flag) +void asst::Controller::set_minitouch_enabled(bool enable, bool maa_touch) noexcept { - m_exit_flag = flag; + m_minitouch_enabled = enable; + m_use_maa_touch = maa_touch; +} + +void asst::Controller::set_swipe_with_pause(bool enable) noexcept +{ + m_swipe_with_pause_enabled = enable; } const std::string& asst::Controller::get_uuid() const @@ -1668,11 +1710,7 @@ cv::Mat asst::Controller::get_image(bool raw) return get_resized_image_cache(); } -std::vector asst::Controller::get_encoded_image_cache() const +cv::Mat asst::Controller::get_image_cache() const { - cv::Mat img = get_resized_image_cache(); - std::vector buf; - cv::imencode(".png", img, buf); - - return buf; + return get_resized_image_cache(); } diff --git a/src/MeoAssistant/Controller.h b/src/MaaCore/Controller.h similarity index 84% rename from src/MeoAssistant/Controller.h rename to src/MaaCore/Controller.h index 1246e060b5..719ddc1561 100644 --- a/src/MeoAssistant/Controller.h +++ b/src/MaaCore/Controller.h @@ -18,27 +18,31 @@ #include "Common/AsstMsg.h" #include "Common/AsstTypes.h" +#include "InstHelper.h" #include "Utils/NoWarningCVMat.h" #include "Utils/SingletonHolder.hpp" namespace asst { - class Controller + class Assistant; + + class Controller : private InstHelper { public: - Controller(const AsstCallback& callback, void* callback_arg); + Controller(const AsstCallback& callback, Assistant* inst); Controller(const Controller&) = delete; Controller(Controller&&) = delete; ~Controller(); bool connect(const std::string& adb_path, const std::string& address, const std::string& config); bool inited() const noexcept; - void set_exit_flag(bool* flag); - void set_minitouch_enabled(bool enable) noexcept { m_minitouch_enabled = enable; } + void set_minitouch_enabled(bool enable, bool maa_touch = false) noexcept; + void set_swipe_with_pause(bool enable) noexcept; const std::string& get_uuid() const; cv::Mat get_image(bool raw = false); - std::vector get_encoded_image_cache() const; + cv::Mat get_image_cache() const; + bool screencap(bool allow_reconnect = false); bool start_game(const std::string& client_type); bool stop_game(); @@ -49,13 +53,16 @@ namespace asst bool click_without_scale(const Rect& rect); bool swipe(const Point& p1, const Point& p2, int duration = 0, bool extra_swipe = false, double slope_in = 1, - double slope_out = 1); + double slope_out = 1, bool with_pause = false); bool swipe(const Rect& r1, const Rect& r2, int duration = 0, bool extra_swipe = false, double slope_in = 1, - double slope_out = 1); + double slope_out = 1, bool with_pause = false); bool swipe_without_scale(const Point& p1, const Point& p2, int duration = 0, bool extra_swipe = false, - double slope_in = 1, double slope_out = 1); + double slope_in = 1, double slope_out = 1, bool with_pause = false); bool swipe_without_scale(const Rect& r1, const Rect& r2, int duration = 0, bool extra_swipe = false, - double slope_in = 1, double slope_out = 1); + double slope_in = 1, double slope_out = 1, bool with_pause = false); + + bool press_esc(); + bool support_swipe_with_pause() const noexcept; std::pair get_scale_size() const noexcept; @@ -63,7 +70,6 @@ namespace asst Controller& operator=(Controller&&) = delete; private: - bool need_exit() const; std::optional call_command(const std::string& cmd, int64_t timeout = 20000, bool allow_reconnect = true, bool recv_by_socket = false); bool release(); @@ -74,7 +80,6 @@ namespace asst std::optional init_socket(const std::string& local_address); using DecodeFunc = std::function; - bool screencap(bool allow_reconnect = false); bool screencap(const std::string& cmd, const DecodeFunc& decode_func, bool allow_reconnect = false, bool by_socket = false); void clear_lf_info(); @@ -86,7 +91,7 @@ namespace asst void clear_info() noexcept; void callback(AsstMsg msg, const json::value& details); - bool call_and_hup_minitouch(const std::string& cmd); + bool call_and_hup_minitouch(); bool input_to_minitouch(const std::string& cmd); void release_minitouch(bool force = false); @@ -94,9 +99,7 @@ namespace asst // 导致解码错误,所以这里转一下回来(点名批评 mumu 和雷电) static bool convert_lf(std::string& data); - bool* m_exit_flag = nullptr; AsstCallback m_callback; - void* m_callback_arg = nullptr; std::minstd_rand m_rand_engine; @@ -126,8 +129,10 @@ namespace asst /* command */ std::string connect; std::string call_minitouch; + std::string call_maatouch; std::string click; std::string swipe; + std::string press_esc; std::string screencap_raw_by_nc; std::string screencap_raw_with_gzip; @@ -156,8 +161,11 @@ namespace asst } screencap_method = ScreencapMethod::UnknownYet; } m_adb; - bool m_minitouch_enabled = true; // 开关 - bool m_minitouch_avaiable = false; // 状态 + bool m_swipe_with_pause_enabled = false; + + bool m_minitouch_enabled = true; // 开关 + bool m_use_maa_touch = false; + bool m_minitouch_available = false; // 状态 #ifdef _WIN32 HANDLE m_minitouch_parent_write = INVALID_HANDLE_VALUE; @@ -235,6 +243,13 @@ namespace asst { return m_input_func(up_cmd(wait_ms, with_commit, contact)); } + bool key_down(int key_code, int wait_ms = DefaultClickDelay, bool with_commit = true) { + return m_input_func(key_down_cmd(key_code, wait_ms, with_commit)); + } + bool key_up(int key_code, int wait_ms = DefaultClickDelay, bool with_commit = true) + { + return m_input_func(key_up_cmd(key_code, wait_ms, with_commit)); + } bool wait(int ms) { return m_input_func(wait_cmd(ms)); } void clear() noexcept { m_wait_ms_count = 0; } @@ -285,6 +300,28 @@ namespace asst return str; } + [[nodiscard]] std::string key_down_cmd(int key_code, int wait_ms = DefaultClickDelay, bool with_commit = true) + { + char buff[64] = { 0 }; + sprintf(buff, "k %d d\n", key_code); + std::string str = buff; + + if (with_commit) str += commit_cmd(); + if (wait_ms) str += wait_cmd(wait_ms); + return str; + } + + [[nodiscard]] std::string key_up_cmd(int key_code, int wait_ms = DefaultClickDelay, bool with_commit = true) + { + char buff[64] = { 0 }; + sprintf(buff, "k %d u\n", key_code); + std::string str = buff; + + if (with_commit) str += commit_cmd(); + if (wait_ms) str += wait_cmd(wait_ms); + return str; + } + [[nodiscard]] std::string wait_cmd(int ms) { m_wait_ms_count += ms; diff --git a/src/MaaCore/InstHelper.cpp b/src/MaaCore/InstHelper.cpp new file mode 100644 index 0000000000..5bfd5b642f --- /dev/null +++ b/src/MaaCore/InstHelper.cpp @@ -0,0 +1,18 @@ +#include "InstHelper.h" + +#include "Assistant.h" + +asst::InstHelper::InstHelper(asst::Assistant* inst) : m_inst(inst) {} + +std::shared_ptr asst::InstHelper::ctrler() const +{ + return m_inst ? m_inst->ctrler() : nullptr; +} +std::shared_ptr asst::InstHelper::status() const +{ + return m_inst ? m_inst->status() : nullptr; +} +bool asst::InstHelper::need_exit() const +{ + return m_inst ? m_inst->need_exit() : false; +} \ No newline at end of file diff --git a/src/MaaCore/InstHelper.h b/src/MaaCore/InstHelper.h new file mode 100644 index 0000000000..b816e967a1 --- /dev/null +++ b/src/MaaCore/InstHelper.h @@ -0,0 +1,30 @@ +#pragma once + +#include + +namespace asst +{ + class Assistant; + class Controller; + class Status; + + class InstHelper + { + protected: + InstHelper() = default; + InstHelper(const InstHelper&) = default; + InstHelper(InstHelper&&) noexcept = default; + InstHelper(Assistant* inst); + virtual ~InstHelper() noexcept = default; + + std::shared_ptr ctrler() const; + std::shared_ptr status() const; + bool need_exit() const; + + InstHelper& operator=(const InstHelper&) = default; + InstHelper& operator=(InstHelper&&) noexcept = default; + + protected: + Assistant* m_inst = nullptr; + }; +} diff --git a/src/MeoAssistant/MeoAssistant.vcxproj b/src/MaaCore/MaaCore.vcxproj similarity index 96% rename from src/MeoAssistant/MeoAssistant.vcxproj rename to src/MaaCore/MaaCore.vcxproj index 0cbb6c0b27..9b4ae492f1 100644 --- a/src/MeoAssistant/MeoAssistant.vcxproj +++ b/src/MaaCore/MaaCore.vcxproj @@ -25,6 +25,7 @@ + @@ -38,6 +39,7 @@ + @@ -45,7 +47,6 @@ - @@ -139,6 +140,7 @@ + @@ -152,6 +154,7 @@ + @@ -159,7 +162,6 @@ - @@ -233,8 +235,9 @@ 16.0 Win32Proj {362d1e30-f5ae-4279-9985-65c27b3ba300} - MeoAssistant + MaaCore 10.0 + MaaCore @@ -309,20 +312,19 @@ - xcopy /e /y /i /c "$(ProjectDir)..\..\resource" "$(TargetDir)resource" - xcopy /e /y /i /c "$(ProjectDir)..\..\3rdparty\resource" "$(TargetDir)resource" - Copy resource + + - xcopy /e /y /i /c "$(ProjectDir)..\..\3rdparty\bin" "$(TargetDir)" - Copy 3rd party dll + + @@ -362,20 +364,19 @@ - xcopy /e /y /i /c "$(ProjectDir)..\..\resource" "$(TargetDir)resource" - xcopy /e /y /i /c "$(ProjectDir)..\..\3rdparty\resource" "$(TargetDir)resource" - Copy resource + + - xcopy /e /y /i /c "$(ProjectDir)..\..\3rdparty\bin" "$(TargetDir)" - Copy 3rd party dll + + @@ -386,4 +387,4 @@ - + \ No newline at end of file diff --git a/src/MeoAssistant/MeoAssistant.vcxproj.filters b/src/MaaCore/MaaCore.vcxproj.filters similarity index 98% rename from src/MeoAssistant/MeoAssistant.vcxproj.filters rename to src/MaaCore/MaaCore.vcxproj.filters index 76b2142352..9862636263 100644 --- a/src/MeoAssistant/MeoAssistant.vcxproj.filters +++ b/src/MaaCore/MaaCore.vcxproj.filters @@ -153,9 +153,6 @@ 源文件\Vision\Roguelike - - 源文件\Vision\Roguelike - 源文件\Config @@ -426,6 +423,12 @@ 源文件\Task\Roguelike + + 源文件 + + + 源文件\Vision\Miscellaneous + @@ -488,9 +491,6 @@ 源文件\Vision\Roguelike - - 源文件\Vision\Roguelike - 源文件\Config @@ -704,5 +704,11 @@ 源文件\Task\Roguelike + + 源文件 + + + 源文件\Vision\Miscellaneous + - + \ No newline at end of file diff --git a/src/MaaCore/README.md b/src/MaaCore/README.md new file mode 100644 index 0000000000..c03a838a89 --- /dev/null +++ b/src/MaaCore/README.md @@ -0,0 +1,13 @@ +# MaaCore + +MAA 底层 C++ 模块 + +## 开发相关 + +### Windows + +直接使用 Visual 2022 或以上版本打开 `MAA.sln` 即可,所有环境都是配置好的 + +### Linux | macOS + +[Linux 编译教程](../../docs/Linux编译教程.md) diff --git a/src/MeoAssistant/Status.cpp b/src/MaaCore/Status.cpp similarity index 100% rename from src/MeoAssistant/Status.cpp rename to src/MaaCore/Status.cpp diff --git a/src/MeoAssistant/Status.h b/src/MaaCore/Status.h similarity index 100% rename from src/MeoAssistant/Status.h rename to src/MaaCore/Status.h diff --git a/src/MeoAssistant/Task/AbstractTask.cpp b/src/MaaCore/Task/AbstractTask.cpp similarity index 83% rename from src/MeoAssistant/Task/AbstractTask.cpp rename to src/MaaCore/Task/AbstractTask.cpp index d706d76a87..037eaa8913 100644 --- a/src/MeoAssistant/Task/AbstractTask.cpp +++ b/src/MaaCore/Task/AbstractTask.cpp @@ -10,17 +10,18 @@ #include "Utils/NoWarningCV.h" #include "AbstractTaskPlugin.h" +#include "Assistant.h" +#include "Config/GeneralConfig.h" #include "Controller.h" #include "ProcessTask.h" -#include "Config/GeneralConfig.h" #include "Utils/ImageIo.hpp" #include "Utils/Logger.hpp" #include "Utils/StringMisc.hpp" using namespace asst; -AbstractTask::AbstractTask(const AsstCallback& callback, void* callback_arg, std::string_view task_chain) - : m_callback(callback), m_callback_arg(callback_arg), m_task_chain(task_chain) +AbstractTask::AbstractTask(const AsstCallback& callback, Assistant* inst, std::string_view task_chain) + : InstHelper(inst), m_callback(callback), m_task_chain(task_chain) {} bool asst::AbstractTask::run() @@ -50,30 +51,12 @@ bool asst::AbstractTask::run() return false; } -AbstractTask& asst::AbstractTask::set_exit_flag(bool* exit_flag) noexcept -{ - m_exit_flag = exit_flag; - return *this; -} - AbstractTask& asst::AbstractTask::set_retry_times(int times) noexcept { m_retry_times = times; return *this; } -AbstractTask& asst::AbstractTask::set_ctrler(std::shared_ptr ctrler) noexcept -{ - m_ctrler = std::move(ctrler); - return *this; -} - -AbstractTask& asst::AbstractTask::set_status(std::shared_ptr status) noexcept -{ - m_status = std::move(status); - return *this; -} - AbstractTask& asst::AbstractTask::set_enable(bool enable) noexcept { m_enable = enable; @@ -158,18 +141,10 @@ bool AbstractTask::sleep(unsigned millisecond) return !need_exit(); } -bool asst::AbstractTask::need_exit() const -{ - return m_exit_flag != nullptr && *m_exit_flag; -} - void asst::AbstractTask::callback(AsstMsg msg, const json::value& detail) { for (const TaskPluginPtr& plugin : m_plugins) { - plugin->set_exit_flag(m_exit_flag); - plugin->set_ctrler(m_ctrler); plugin->set_task_id(m_task_id); - plugin->set_status(m_status); plugin->set_task_ptr(this); if (!plugin->verify(msg, detail)) { @@ -184,14 +159,15 @@ void asst::AbstractTask::callback(AsstMsg msg, const json::value& detail) } if (m_callback) { // TODO 屎山: task 字段需要忽略 @ 和前面的字符,否则回调大改 - json::value proced_detail = detail; if (std::string task = detail.get("details", "task", std::string()); !task.empty()) { if (size_t pos = task.rfind('@'); pos != std::string::npos) { + json::value proced_detail = detail; proced_detail["details"]["task"] = task.substr(pos + 1); + m_callback(msg, proced_detail, m_inst); + return; } } - - m_callback(msg, proced_detail, m_callback_arg); + m_callback(msg, detail, m_inst); } } @@ -202,7 +178,7 @@ void asst::AbstractTask::click_return_button() bool asst::AbstractTask::save_img(const std::string& dirname) { - auto image = m_ctrler->get_image(); + auto image = ctrler()->get_image(); if (image.empty()) { return false; } diff --git a/src/MeoAssistant/Task/AbstractTask.h b/src/MaaCore/Task/AbstractTask.h similarity index 79% rename from src/MeoAssistant/Task/AbstractTask.h rename to src/MaaCore/Task/AbstractTask.h index 76f3c7c8af..a341c8dc41 100644 --- a/src/MeoAssistant/Task/AbstractTask.h +++ b/src/MaaCore/Task/AbstractTask.h @@ -6,6 +6,7 @@ #include #include "Common/AsstMsg.h" +#include "InstHelper.h" namespace cv { @@ -21,20 +22,17 @@ namespace asst class Status; class TaskData; - class AbstractTask + class AbstractTask : protected InstHelper { public: - AbstractTask(const AsstCallback& callback, void* callback_arg, std::string_view task_chain); - virtual ~AbstractTask() noexcept = default; + AbstractTask(const AsstCallback& callback, Assistant* inst, std::string_view task_chain); AbstractTask(const AbstractTask&) = default; AbstractTask(AbstractTask&&) noexcept = default; + virtual ~AbstractTask() noexcept = default; virtual bool run(); - virtual AbstractTask& set_exit_flag(bool* exit_flag) noexcept; virtual AbstractTask& set_retry_times(int times) noexcept; - virtual AbstractTask& set_ctrler(std::shared_ptr ctrler) noexcept; - virtual AbstractTask& set_status(std::shared_ptr status) noexcept; virtual AbstractTask& set_enable(bool enable) noexcept; virtual AbstractTask& set_ignore_error(bool ignore) noexcept; virtual AbstractTask& set_task_id(int task_id) noexcept; @@ -43,7 +41,7 @@ namespace asst requires std::derived_from // Plugin must inherit AbstractTaskPlugin std::shared_ptr register_plugin() { - auto plugin = std::make_shared(m_callback, m_callback_arg, m_task_chain); + auto plugin = std::make_shared(m_callback, m_inst, m_task_chain); m_plugins.emplace(plugin); return plugin; } @@ -66,13 +64,10 @@ namespace asst json::value basic_info_with_what(std::string what) const; bool sleep(unsigned millisecond); - bool need_exit() const; bool m_enable = true; bool m_ignore_error = false; AsstCallback m_callback = nullptr; - void* m_callback_arg = nullptr; - bool* m_exit_flag = nullptr; std::string_view m_task_chain; int m_cur_retry = 0; int m_retry_times = RetryTimesDefault; @@ -80,7 +75,5 @@ namespace asst mutable json::value m_basic_info_cache; int m_task_id = 0; std::set m_plugins; - std::shared_ptr m_ctrler = nullptr; - std::shared_ptr m_status = nullptr; }; } // namespace asst diff --git a/src/MeoAssistant/Task/AbstractTaskPlugin.cpp b/src/MaaCore/Task/AbstractTaskPlugin.cpp similarity index 100% rename from src/MeoAssistant/Task/AbstractTaskPlugin.cpp rename to src/MaaCore/Task/AbstractTaskPlugin.cpp diff --git a/src/MeoAssistant/Task/AbstractTaskPlugin.h b/src/MaaCore/Task/AbstractTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/AbstractTaskPlugin.h rename to src/MaaCore/Task/AbstractTaskPlugin.h diff --git a/src/MeoAssistant/Task/Fight/DrGrandetTaskPlugin.cpp b/src/MaaCore/Task/Fight/DrGrandetTaskPlugin.cpp similarity index 97% rename from src/MeoAssistant/Task/Fight/DrGrandetTaskPlugin.cpp rename to src/MaaCore/Task/Fight/DrGrandetTaskPlugin.cpp index 32f0d220c1..56e6484bdb 100644 --- a/src/MeoAssistant/Task/Fight/DrGrandetTaskPlugin.cpp +++ b/src/MaaCore/Task/Fight/DrGrandetTaskPlugin.cpp @@ -49,7 +49,7 @@ int asst::DrGrandetTaskPlugin::analyze_time_left() { LogTraceFunction; - OcrImageAnalyzer analyzer(m_ctrler->get_image()); + OcrImageAnalyzer analyzer(ctrler()->get_image()); analyzer.set_task_info("DrGrandetUseOriginiums"); analyzer.set_replace(Task.get("NumberOcrReplace")->replace_map); // 这里是汉字和数字混合的,用不了单独的en模型 diff --git a/src/MeoAssistant/Task/Fight/DrGrandetTaskPlugin.h b/src/MaaCore/Task/Fight/DrGrandetTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Fight/DrGrandetTaskPlugin.h rename to src/MaaCore/Task/Fight/DrGrandetTaskPlugin.h diff --git a/src/MeoAssistant/Task/Fight/StageDropsTaskPlugin.cpp b/src/MaaCore/Task/Fight/StageDropsTaskPlugin.cpp similarity index 92% rename from src/MeoAssistant/Task/Fight/StageDropsTaskPlugin.cpp rename to src/MaaCore/Task/Fight/StageDropsTaskPlugin.cpp index 5c68d7909e..cbead29cd2 100644 --- a/src/MeoAssistant/Task/Fight/StageDropsTaskPlugin.cpp +++ b/src/MaaCore/Task/Fight/StageDropsTaskPlugin.cpp @@ -5,15 +5,15 @@ #include #include "Common/AsstVersion.h" -#include "Controller.h" -#include "Vision/Roguelike/StageDropsImageAnalyzer.h" #include "Config/Miscellaneous/ItemConfig.h" #include "Config/Miscellaneous/StageDropsConfig.h" #include "Config/TaskData.h" +#include "Controller.h" #include "Status.h" #include "Task/ProcessTask.h" #include "Task/ReportDataTask.h" #include "Utils/Logger.hpp" +#include "Vision/Miscellaneous/StageDropsImageAnalyzer.h" bool asst::StageDropsTaskPlugin::verify(AsstMsg msg, const json::value& details) const { @@ -22,8 +22,8 @@ bool asst::StageDropsTaskPlugin::verify(AsstMsg msg, const json::value& details) } const std::string task = details.at("details").at("task").as_string(); if (task == "Fight@EndOfAction") { - int64_t last_start_time = m_status->get_number(LastStartTimeKey).value_or(0); - int64_t last_recognize_flag = m_status->get_number(RecognitionRestrictionsKey).value_or(0); + int64_t last_start_time = status()->get_number(LastStartTimeKey).value_or(0); + int64_t last_recognize_flag = status()->get_number(RecognitionRestrictionsKey).value_or(0); if (last_start_time + RecognitionTimeOffset == last_recognize_flag) { Log.warn("Only one recognition per start", last_start_time, last_recognize_flag); return false; @@ -104,7 +104,7 @@ bool asst::StageDropsTaskPlugin::recognize_drops() return false; } - StageDropsImageAnalyzer analyzer(m_ctrler->get_image()); + StageDropsImageAnalyzer analyzer(ctrler()->get_image()); if (!analyzer.analyze()) { auto info = basic_info(); info["subtask"] = "RecognizeDrops"; @@ -123,9 +123,9 @@ bool asst::StageDropsTaskPlugin::recognize_drops() return true; } - int64_t last_start_time = m_status->get_number(LastStartTimeKey).value_or(0); + int64_t last_start_time = status()->get_number(LastStartTimeKey).value_or(0); int64_t recognize_flag = last_start_time + RecognitionTimeOffset; - m_status->set_number(RecognitionRestrictionsKey, recognize_flag); + status()->set_number(RecognitionRestrictionsKey, recognize_flag); return true; } @@ -192,7 +192,7 @@ void asst::StageDropsTaskPlugin::set_start_button_delay() return; } - int64_t last_start_time = m_status->get_number(LastStartTimeKey).value_or(0); + int64_t last_start_time = status()->get_number(LastStartTimeKey).value_or(0); if (last_start_time == 0) { return; } @@ -253,7 +253,7 @@ void asst::StageDropsTaskPlugin::upload_to_penguin() format_drop.as_object().erase("itemName"); all_drops.array_emplace(std::move(format_drop)); } - body["source"] = "MeoAssistant"; + body["source"] = UploadDataSource; body["version"] = Version; std::string extra_param; @@ -262,8 +262,7 @@ void asst::StageDropsTaskPlugin::upload_to_penguin() } if (!m_report_penguin_task_ptr) { - m_report_penguin_task_ptr = - std::make_shared(report_penguin_callback, static_cast(this), m_task_chain); + m_report_penguin_task_ptr = std::make_shared(report_penguin_callback, this); } m_report_penguin_task_ptr->set_report_type(ReportType::PenguinStats) @@ -273,11 +272,11 @@ void asst::StageDropsTaskPlugin::upload_to_penguin() .run(); } -void asst::StageDropsTaskPlugin::report_penguin_callback(AsstMsg msg, const json::value& detail, void* custom_arg) +void asst::StageDropsTaskPlugin::report_penguin_callback(AsstMsg msg, const json::value& detail, AbstractTask* task_ptr) { LogTraceFunction; - auto p_this = static_cast(custom_arg); + auto p_this = dynamic_cast(task_ptr); if (!p_this) { return; } diff --git a/src/MeoAssistant/Task/Fight/StageDropsTaskPlugin.h b/src/MaaCore/Task/Fight/StageDropsTaskPlugin.h similarity index 97% rename from src/MeoAssistant/Task/Fight/StageDropsTaskPlugin.h rename to src/MaaCore/Task/Fight/StageDropsTaskPlugin.h index 2f384988af..bffece47bf 100644 --- a/src/MeoAssistant/Task/Fight/StageDropsTaskPlugin.h +++ b/src/MaaCore/Task/Fight/StageDropsTaskPlugin.h @@ -38,7 +38,7 @@ namespace asst bool check_specify_quantity() const; void stop_task(); void upload_to_penguin(); - static void report_penguin_callback(AsstMsg msg, const json::value& detail, void* custom_arg); + static void report_penguin_callback(AsstMsg msg, const json::value& detail, AbstractTask* task_ptr); static inline constexpr int64_t RecognitionTimeOffset = 20; static inline const std::string LastStartTimeKey = Status::ProcessTaskLastTimePrefix + "Fight@StartButton2"; diff --git a/src/MaaCore/Task/Fight/StageNavigationTask.cpp b/src/MaaCore/Task/Fight/StageNavigationTask.cpp new file mode 100644 index 0000000000..2e6b7bb080 --- /dev/null +++ b/src/MaaCore/Task/Fight/StageNavigationTask.cpp @@ -0,0 +1,112 @@ +#include "StageNavigationTask.h" + +#include + +#include "Config/TaskData.h" +#include "Controller.h" +#include "Task/ProcessTask.h" +#include "Utils/Logger.hpp" +#include "Vision/OcrImageAnalyzer.h" + +bool asst::StageNavigationTask::set_stage_name(const std::string& stage_name) +{ + LogTraceFunction; + + clear(); + + // 已有关卡优先使用 tasks.json 中的逻辑 + if (Task.get(stage_name)) { + m_is_directly = true; + m_directly_task = stage_name; + Log.error("directly task", m_directly_task); + return true; + } + m_is_directly = false; + + static const std::regex StageRegex(R"(^([A-Za-z]{0,3})(\d{1,2})-(\d{1,2})(?:-?(\w+))*$)"); + std::smatch stage_sm; + if (!std::regex_match(stage_name, stage_sm, StageRegex)) { + Log.error("The stage name is not in invalid, or is not main line stage", stage_name); + return false; + } + + // 10-1 -> [1] "", [2] "10", [3] "1", [4] "" + // JT8-2 -> [1] "JT", [2] "8", [3] "2", [4] "" + // H10-1-Hard -> [1] "H", [2] "10", [3] "1", [4] "Hard" + const std::string& stage_prefix = stage_sm[1].str(); + const std::string& chapter = stage_sm[2].str(); + const std::string& stage_index = stage_sm[3].str(); + const std::string& difficulty = stage_sm[4].str(); + + static const std::string EpisodeTaskPrefix = "Episode"; + m_chapter_task = EpisodeTaskPrefix + chapter; + Log.info("chapter task", m_chapter_task); + if (!Task.get(m_chapter_task)) { + Log.error("chapter task not exists", m_chapter_task); + return false; + } + + if (!difficulty.empty()) { + std::string upper_difficulty = difficulty; + upper_difficulty[0] = static_cast(::toupper(upper_difficulty[0])); + static const std::string DifficultyTaskPrefix = "ChapterDifficulty"; + m_difficulty_task = DifficultyTaskPrefix + upper_difficulty; + Log.info("difficulty task", m_difficulty_task); + if (!Task.get(m_difficulty_task)) { + Log.error("difficulty task not exists", m_difficulty_task); + return false; + } + } + + std::string upper_prefix = stage_prefix; + ranges::transform(upper_prefix, upper_prefix.begin(), + [](char ch) -> char { return static_cast(::toupper(ch)); }); + m_stage_code = upper_prefix + chapter + "-" + stage_index; + Log.info("stage code", m_stage_code); + + return true; +} + +bool asst::StageNavigationTask::_run() +{ + LogTraceFunction; + + if (m_is_directly) { + return ProcessTask(*this, { m_directly_task }).run(); + } + + return chapter_wayfinding() && swipe_and_find_stage(); +} + +void asst::StageNavigationTask::clear() noexcept +{ + m_is_directly = false; + m_directly_task.clear(); + m_chapter_task.clear(); + m_difficulty_task.clear(); + m_stage_code.clear(); +} + +bool asst::StageNavigationTask::chapter_wayfinding() +{ + LogTraceFunction; + + if (!ProcessTask(*this, { m_chapter_task }).run()) { + return false; + } + + if (!m_difficulty_task.empty()) { + return ProcessTask(*this, { m_difficulty_task }).run(); + } + + return true; +} + +bool asst::StageNavigationTask::swipe_and_find_stage() +{ + LogTraceFunction; + + Task.get(m_stage_code + "@ClickStageName")->text = { m_stage_code }; + Task.get(m_stage_code + "@ClickedCorrectStage")->text = { m_stage_code }; + return ProcessTask(*this, { m_stage_code + "@StageNavigationBegin" }).run(); +} diff --git a/src/MeoAssistant/Task/Fight/StageNavigationTask.h b/src/MaaCore/Task/Fight/StageNavigationTask.h similarity index 56% rename from src/MeoAssistant/Task/Fight/StageNavigationTask.h rename to src/MaaCore/Task/Fight/StageNavigationTask.h index d318d83477..62f48ed8de 100644 --- a/src/MeoAssistant/Task/Fight/StageNavigationTask.h +++ b/src/MaaCore/Task/Fight/StageNavigationTask.h @@ -9,14 +9,20 @@ namespace asst using AbstractTask::AbstractTask; virtual ~StageNavigationTask() noexcept override = default; - void set_stage_name(std::string stage_name); + bool set_stage_name(const std::string& stage_name); protected: virtual bool _run() override; + void clear() noexcept; bool chapter_wayfinding(); bool swipe_and_find_stage(); - std::string m_stage_name; + bool m_is_directly = false; + std::string m_directly_task; + // Not directly + std::string m_chapter_task; + std::string m_difficulty_task; + std::string m_stage_code; }; } diff --git a/src/MeoAssistant/Task/Infrast/DronesForShamareTaskPlugin.cpp b/src/MaaCore/Task/Infrast/DronesForShamareTaskPlugin.cpp similarity index 100% rename from src/MeoAssistant/Task/Infrast/DronesForShamareTaskPlugin.cpp rename to src/MaaCore/Task/Infrast/DronesForShamareTaskPlugin.cpp diff --git a/src/MeoAssistant/Task/Infrast/DronesForShamareTaskPlugin.h b/src/MaaCore/Task/Infrast/DronesForShamareTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Infrast/DronesForShamareTaskPlugin.h rename to src/MaaCore/Task/Infrast/DronesForShamareTaskPlugin.h diff --git a/src/MeoAssistant/Task/Infrast/InfrastAbstractTask.cpp b/src/MaaCore/Task/Infrast/InfrastAbstractTask.cpp similarity index 96% rename from src/MeoAssistant/Task/Infrast/InfrastAbstractTask.cpp rename to src/MaaCore/Task/Infrast/InfrastAbstractTask.cpp index 3d1c596cfc..09a63bec58 100644 --- a/src/MeoAssistant/Task/Infrast/InfrastAbstractTask.cpp +++ b/src/MaaCore/Task/Infrast/InfrastAbstractTask.cpp @@ -16,9 +16,9 @@ #include "Utils/Logger.hpp" #include "Utils/Ranges.hpp" -asst::InfrastAbstractTask::InfrastAbstractTask(const AsstCallback& callback, void* callback_arg, +asst::InfrastAbstractTask::InfrastAbstractTask(const AsstCallback& callback, Assistant* inst, std::string_view task_chain) - : AbstractTask(callback, callback_arg, task_chain) + : AbstractTask(callback, inst, task_chain) { m_retry_times = TaskRetryTimes; } @@ -102,7 +102,7 @@ bool asst::InfrastAbstractTask::enter_facility(int index) return false; } - InfrastFacilityImageAnalyzer analyzer(m_ctrler->get_image()); + InfrastFacilityImageAnalyzer analyzer(ctrler()->get_image()); analyzer.set_to_be_analyzed({ facility_name() }); if (!analyzer.analyze()) { Log.info("result is empty"); @@ -113,7 +113,7 @@ bool asst::InfrastAbstractTask::enter_facility(int index) Log.info("facility index is out of range"); return false; } - m_ctrler->click(rect); + ctrler()->click(rect); m_cur_facility_index = index; callback(AsstMsg::SubTaskExtraInfo, basic_info_with_what("EnterFacility")); @@ -232,7 +232,7 @@ bool asst::InfrastAbstractTask::select_custom_opers(std::vector& pa return false; } - const auto image = m_ctrler->get_image(); + const auto image = ctrler()->get_image(); InfrastOperImageAnalyzer oper_analyzer(image); oper_analyzer.set_to_be_calced(InfrastOperImageAnalyzer::ToBeCalced::Selected); if (!oper_analyzer.analyze()) { @@ -271,7 +271,7 @@ bool asst::InfrastAbstractTask::select_custom_opers(std::vector& pa continue; } if (!oper.selected) { - m_ctrler->click(oper.rect); + ctrler()->click(oper.rect); } if (++room_config.selected >= max_num_of_opers()) { break; @@ -289,7 +289,7 @@ void asst::InfrastAbstractTask::order_opers_selection(const std::vectorget_image(); + const auto image = ctrler()->get_image(); InfrastOperImageAnalyzer oper_analyzer(image); oper_analyzer.set_to_be_calced(InfrastOperImageAnalyzer::ToBeCalced::Selected); if (!oper_analyzer.analyze()) { @@ -316,7 +316,7 @@ void asst::InfrastAbstractTask::order_opers_selection(const std::vectorclick(iter->rect); + ctrler()->click(iter->rect); } else { Log.error("name not in this page", name); @@ -350,7 +350,7 @@ bool asst::InfrastAbstractTask::click_clear_button() // 有可能点快了,清空按钮刚刚出来,实际点上去还不生效,就点了 // 所以多识别一次,如果没清掉就再清一下 if (ret) { - InfrastOperImageAnalyzer analyzer(m_ctrler->get_image()); + InfrastOperImageAnalyzer analyzer(ctrler()->get_image()); analyzer.set_to_be_calced(InfrastOperImageAnalyzer::ToBeCalced::Selected); if (!analyzer.analyze()) { return false; diff --git a/src/MeoAssistant/Task/Infrast/InfrastAbstractTask.h b/src/MaaCore/Task/Infrast/InfrastAbstractTask.h similarity index 96% rename from src/MeoAssistant/Task/Infrast/InfrastAbstractTask.h rename to src/MaaCore/Task/Infrast/InfrastAbstractTask.h index a5fdf47cfe..9f79300033 100644 --- a/src/MeoAssistant/Task/Infrast/InfrastAbstractTask.h +++ b/src/MaaCore/Task/Infrast/InfrastAbstractTask.h @@ -8,7 +8,7 @@ namespace asst class InfrastAbstractTask : public AbstractTask { public: - InfrastAbstractTask(const AsstCallback& callback, void* callback_arg, std::string_view task_chain); + InfrastAbstractTask(const AsstCallback& callback, Assistant* inst, std::string_view task_chain); virtual ~InfrastAbstractTask() override = default; InfrastAbstractTask& set_mood_threshold(double mood_thres) noexcept; diff --git a/src/MeoAssistant/Task/Infrast/InfrastControlTask.cpp b/src/MaaCore/Task/Infrast/InfrastControlTask.cpp similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastControlTask.cpp rename to src/MaaCore/Task/Infrast/InfrastControlTask.cpp diff --git a/src/MeoAssistant/Task/Infrast/InfrastControlTask.h b/src/MaaCore/Task/Infrast/InfrastControlTask.h similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastControlTask.h rename to src/MaaCore/Task/Infrast/InfrastControlTask.h diff --git a/src/MeoAssistant/Task/Infrast/InfrastDormTask.cpp b/src/MaaCore/Task/Infrast/InfrastDormTask.cpp similarity index 97% rename from src/MeoAssistant/Task/Infrast/InfrastDormTask.cpp rename to src/MaaCore/Task/Infrast/InfrastDormTask.cpp index 93686517a1..35c2be33fa 100644 --- a/src/MeoAssistant/Task/Infrast/InfrastDormTask.cpp +++ b/src/MaaCore/Task/Infrast/InfrastDormTask.cpp @@ -79,7 +79,7 @@ bool asst::InfrastDormTask::opers_choose() if (need_exit()) { return false; } - const auto image = m_ctrler->get_image(); + const auto image = ctrler()->get_image(); InfrastOperImageAnalyzer oper_analyzer(image); constexpr int without_skill = InfrastOperImageAnalyzer::All ^ InfrastOperImageAnalyzer::Skill; @@ -103,7 +103,7 @@ bool asst::InfrastDormTask::opers_choose() if (to_fill) { if (oper.doing != infrast::Doing::Working && !oper.selected) { Log.info("to fill"); - m_ctrler->click(oper.rect); + ctrler()->click(oper.rect); ++num_of_selected; } continue; @@ -113,7 +113,7 @@ bool asst::InfrastDormTask::opers_choose() if (m_next_step == NextStep::Fill) { to_fill = true; Log.info("set to_fill = true;"); - m_ctrler->click(oper.rect); + ctrler()->click(oper.rect); ++num_of_selected; continue; } @@ -169,7 +169,7 @@ bool asst::InfrastDormTask::opers_choose() // 判断要不要把人放进宿舍if_opertrust_not_full && if_oper_not_stationed if (if_opertrust_not_full && if_oper_not_stationed) { - m_ctrler->click(oper.rect); + ctrler()->click(oper.rect); ++num_of_selected; } else { @@ -202,7 +202,7 @@ bool asst::InfrastDormTask::opers_choose() case infrast::SmileyType::Distract: // 干员没有被选择的情况下,且不在工作,就进驻宿舍 if (oper.selected == false && oper.doing != infrast::Doing::Working) { - m_ctrler->click(oper.rect); + ctrler()->click(oper.rect); ++num_of_selected; } break; diff --git a/src/MeoAssistant/Task/Infrast/InfrastDormTask.h b/src/MaaCore/Task/Infrast/InfrastDormTask.h similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastDormTask.h rename to src/MaaCore/Task/Infrast/InfrastDormTask.h diff --git a/src/MeoAssistant/Task/Infrast/InfrastInfoTask.cpp b/src/MaaCore/Task/Infrast/InfrastInfoTask.cpp similarity index 87% rename from src/MeoAssistant/Task/Infrast/InfrastInfoTask.cpp rename to src/MaaCore/Task/Infrast/InfrastInfoTask.cpp index 9d7b109ce0..7e57a67fa4 100644 --- a/src/MeoAssistant/Task/Infrast/InfrastInfoTask.cpp +++ b/src/MaaCore/Task/Infrast/InfrastInfoTask.cpp @@ -8,7 +8,7 @@ bool asst::InfrastInfoTask::_run() { swipe_to_the_left_of_main_ui(); - const auto image = m_ctrler->get_image(); + const auto image = ctrler()->get_image(); InfrastFacilityImageAnalyzer analyzer(image); @@ -19,7 +19,7 @@ bool asst::InfrastInfoTask::_run() for (auto&& [name, res] : analyzer.get_result()) { std::string key = "NumOf" + name; // int size = static_cast(res.size()); - m_status->set_number(key, res.size()); + status()->set_number(key, res.size()); Log.trace("InfrastInfoTask | ", key, res.size()); } diff --git a/src/MeoAssistant/Task/Infrast/InfrastInfoTask.h b/src/MaaCore/Task/Infrast/InfrastInfoTask.h similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastInfoTask.h rename to src/MaaCore/Task/Infrast/InfrastInfoTask.h diff --git a/src/MeoAssistant/Task/Infrast/InfrastMfgTask.cpp b/src/MaaCore/Task/Infrast/InfrastMfgTask.cpp similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastMfgTask.cpp rename to src/MaaCore/Task/Infrast/InfrastMfgTask.cpp diff --git a/src/MeoAssistant/Task/Infrast/InfrastMfgTask.h b/src/MaaCore/Task/Infrast/InfrastMfgTask.h similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastMfgTask.h rename to src/MaaCore/Task/Infrast/InfrastMfgTask.h diff --git a/src/MeoAssistant/Task/Infrast/InfrastOfficeTask.cpp b/src/MaaCore/Task/Infrast/InfrastOfficeTask.cpp similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastOfficeTask.cpp rename to src/MaaCore/Task/Infrast/InfrastOfficeTask.cpp diff --git a/src/MeoAssistant/Task/Infrast/InfrastOfficeTask.h b/src/MaaCore/Task/Infrast/InfrastOfficeTask.h similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastOfficeTask.h rename to src/MaaCore/Task/Infrast/InfrastOfficeTask.h diff --git a/src/MeoAssistant/Task/Infrast/InfrastPowerTask.cpp b/src/MaaCore/Task/Infrast/InfrastPowerTask.cpp similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastPowerTask.cpp rename to src/MaaCore/Task/Infrast/InfrastPowerTask.cpp diff --git a/src/MeoAssistant/Task/Infrast/InfrastPowerTask.h b/src/MaaCore/Task/Infrast/InfrastPowerTask.h similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastPowerTask.h rename to src/MaaCore/Task/Infrast/InfrastPowerTask.h diff --git a/src/MeoAssistant/Task/Infrast/InfrastProductionTask.cpp b/src/MaaCore/Task/Infrast/InfrastProductionTask.cpp similarity index 98% rename from src/MeoAssistant/Task/Infrast/InfrastProductionTask.cpp rename to src/MaaCore/Task/Infrast/InfrastProductionTask.cpp index dc66d6ef6e..5e307bafde 100644 --- a/src/MeoAssistant/Task/Infrast/InfrastProductionTask.cpp +++ b/src/MaaCore/Task/Infrast/InfrastProductionTask.cpp @@ -104,11 +104,11 @@ bool asst::InfrastProductionTask::shift_facility_list() } sleep(tab_task_ptr->pre_delay); - m_ctrler->click(tab); + ctrler()->click(tab); sleep(tab_task_ptr->post_delay); /* 识别当前制造/贸易站有没有添加干员按钮,没有就不换班 */ - const auto image = m_ctrler->get_image(); + const auto image = ctrler()->get_image(); add_analyzer.set_image(image); if (!add_analyzer.analyze()) { Log.error("no add button, just continue"); @@ -157,7 +157,7 @@ bool asst::InfrastProductionTask::shift_facility_list() } /* 进入干员选择页面 */ - m_ctrler->click(add_button); + ctrler()->click(add_button); sleep(add_task_ptr->post_delay); for (int i = 0; i <= OperSelectRetryTimes; ++i) { @@ -242,7 +242,7 @@ bool asst::InfrastProductionTask::opers_detect_with_swipe() size_t asst::InfrastProductionTask::opers_detect() { LogTraceFunction; - const auto image = m_ctrler->get_image(); + const auto image = ctrler()->get_image(); InfrastOperImageAnalyzer oper_analyzer(image); oper_analyzer.set_to_be_calced(InfrastOperImageAnalyzer::ToBeCalced::All); @@ -386,7 +386,7 @@ bool asst::InfrastProductionTask::optimal_calc() // 条件判断,不符合的直接过滤掉 bool meet_condition = true; for (const auto& [cond, cond_value] : group.conditions) { - auto cond_opt = m_status->get_number(cond); + auto cond_opt = status()->get_number(cond); if (!cond_opt) { continue; } @@ -531,7 +531,7 @@ bool asst::InfrastProductionTask::opers_choose() if (need_exit()) { return false; } - const auto image = m_ctrler->get_image(); + const auto image = ctrler()->get_image(); InfrastOperImageAnalyzer oper_analyzer(image); oper_analyzer.set_to_be_calced(InfrastOperImageAnalyzer::ToBeCalced::All); oper_analyzer.set_facility(facility_name()); @@ -598,7 +598,7 @@ bool asst::InfrastProductionTask::opers_choose() // 但是如果当前设施只有一个位置,即不存在“上次循环”的情况,说明是清除干员按钮没点到 } else { - m_ctrler->click(find_iter->rect); + ctrler()->click(find_iter->rect); } { auto avlb_iter = ranges::find_if(m_all_available_opers, [&](const infrast::Oper& lhs) -> bool { @@ -658,7 +658,7 @@ asst::infrast::SkillsComb asst::InfrastProductionTask::efficient_regex_calc( // TODO 报错! } std::string status_key = cur_formula.substr(pos + 1, rp_pos - pos - 1); - auto status_opt = m_status->get_number(status_key); + auto status_opt = status()->get_number(status_key); const int64_t status_value = status_opt ? status_opt.value() : 0; cur_formula.replace(pos, rp_pos - pos + 1, std::to_string(status_value)); } @@ -674,7 +674,7 @@ bool asst::InfrastProductionTask::facility_list_detect() LogTraceFunction; m_facility_list_tabs.clear(); - const auto image = m_ctrler->get_image(); + const auto image = ctrler()->get_image(); MultiMatchImageAnalyzer mm_analyzer(image); mm_analyzer.set_task_info("InfrastFacilityListTab" + facility_name()); diff --git a/src/MeoAssistant/Task/Infrast/InfrastProductionTask.h b/src/MaaCore/Task/Infrast/InfrastProductionTask.h similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastProductionTask.h rename to src/MaaCore/Task/Infrast/InfrastProductionTask.h diff --git a/src/MeoAssistant/Task/Infrast/InfrastReceptionTask.cpp b/src/MaaCore/Task/Infrast/InfrastReceptionTask.cpp similarity index 93% rename from src/MeoAssistant/Task/Infrast/InfrastReceptionTask.cpp rename to src/MaaCore/Task/Infrast/InfrastReceptionTask.cpp index fc9446c243..b80261c8c9 100644 --- a/src/MeoAssistant/Task/Infrast/InfrastReceptionTask.cpp +++ b/src/MaaCore/Task/Infrast/InfrastReceptionTask.cpp @@ -66,7 +66,7 @@ bool asst::InfrastReceptionTask::use_clue() proc_clue_vacancy(); } - cv::Mat image = m_ctrler->get_image(); + cv::Mat image = ctrler()->get_image(); // 所有的空位分析一次,看看还缺哪些线索 InfrastClueVacancyImageAnalyzer vacancy_analyzer(image); @@ -98,7 +98,7 @@ bool asst::InfrastReceptionTask::proc_clue_vacancy() const static std::string clue_vacancy = "InfrastClueVacancy"; const static std::vector clue_suffix = { "No1", "No2", "No3", "No4", "No5", "No6", "No7" }; - cv::Mat image = m_ctrler->get_image(); + cv::Mat image = ctrler()->get_image(); for (const std::string& clue : clue_suffix) { if (need_exit()) { return false; @@ -112,19 +112,19 @@ bool asst::InfrastReceptionTask::proc_clue_vacancy() } // 点开线索的空位 Rect vacancy = vacancy_analyzer.get_vacancy().cbegin()->second; - m_ctrler->click(vacancy); + ctrler()->click(vacancy); int delay = Task.get(clue_vacancy + clue)->post_delay; sleep(delay); // 识别右边列表中的线索,然后用最底下的那个(一般都是剩余时间最短的) // swipe_to_the_bottom_of_clue_list_on_the_right(); - image = m_ctrler->get_image(); + image = ctrler()->get_image(); InfrastClueImageAnalyzer clue_analyzer(image); if (!clue_analyzer.analyze()) { continue; } - m_ctrler->click(clue_analyzer.get_result().back().first); + ctrler()->click(clue_analyzer.get_result().back().first); sleep(delay); } return true; @@ -158,14 +158,14 @@ bool asst::InfrastReceptionTask::shift() return true; } - const auto image = m_ctrler->get_image(); + const auto image = ctrler()->get_image(); MatchImageAnalyzer add_analyzer(image); const auto raw_task_ptr = Task.get("InfrastAddOperator" + facility_name() + m_work_mode_name); switch (raw_task_ptr->algorithm) { case AlgorithmType::JustReturn: if (raw_task_ptr->action == ProcessTaskAction::ClickRect) { - m_ctrler->click(raw_task_ptr->specific_rect); + ctrler()->click(raw_task_ptr->specific_rect); } break; case AlgorithmType::MatchTemplate: { @@ -174,7 +174,7 @@ bool asst::InfrastReceptionTask::shift() if (!add_analyzer.analyze()) { return true; } - m_ctrler->click(add_analyzer.get_result().rect); + ctrler()->click(add_analyzer.get_result().rect); } break; default: break; diff --git a/src/MeoAssistant/Task/Infrast/InfrastReceptionTask.h b/src/MaaCore/Task/Infrast/InfrastReceptionTask.h similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastReceptionTask.h rename to src/MaaCore/Task/Infrast/InfrastReceptionTask.h diff --git a/src/MeoAssistant/Task/Infrast/InfrastTradeTask.cpp b/src/MaaCore/Task/Infrast/InfrastTradeTask.cpp similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastTradeTask.cpp rename to src/MaaCore/Task/Infrast/InfrastTradeTask.cpp diff --git a/src/MeoAssistant/Task/Infrast/InfrastTradeTask.h b/src/MaaCore/Task/Infrast/InfrastTradeTask.h similarity index 100% rename from src/MeoAssistant/Task/Infrast/InfrastTradeTask.h rename to src/MaaCore/Task/Infrast/InfrastTradeTask.h diff --git a/src/MeoAssistant/Task/Infrast/ReplenishOriginiumShardTaskPlugin.cpp b/src/MaaCore/Task/Infrast/ReplenishOriginiumShardTaskPlugin.cpp similarity index 100% rename from src/MeoAssistant/Task/Infrast/ReplenishOriginiumShardTaskPlugin.cpp rename to src/MaaCore/Task/Infrast/ReplenishOriginiumShardTaskPlugin.cpp diff --git a/src/MeoAssistant/Task/Infrast/ReplenishOriginiumShardTaskPlugin.h b/src/MaaCore/Task/Infrast/ReplenishOriginiumShardTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Infrast/ReplenishOriginiumShardTaskPlugin.h rename to src/MaaCore/Task/Infrast/ReplenishOriginiumShardTaskPlugin.h diff --git a/src/MeoAssistant/Task/Interface/AwardTask.cpp b/src/MaaCore/Task/Interface/AwardTask.cpp similarity index 59% rename from src/MeoAssistant/Task/Interface/AwardTask.cpp rename to src/MaaCore/Task/Interface/AwardTask.cpp index bb53c94204..99472678b3 100644 --- a/src/MeoAssistant/Task/Interface/AwardTask.cpp +++ b/src/MaaCore/Task/Interface/AwardTask.cpp @@ -4,10 +4,10 @@ #include "Task/ProcessTask.h" -asst::AwardTask::AwardTask(const AsstCallback& callback, void* callback_arg) - : InterfaceTask(callback, callback_arg, TaskType) +asst::AwardTask::AwardTask(const AsstCallback& callback, Assistant* inst) + : InterfaceTask(callback, inst, TaskType) { - auto award_task_ptr = std::make_shared(m_callback, m_callback_arg, TaskType); + auto award_task_ptr = std::make_shared(m_callback, m_inst, TaskType); award_task_ptr->set_tasks({ "AwardBegin" }); m_subtasks.emplace_back(award_task_ptr); } diff --git a/src/MeoAssistant/Task/Interface/AwardTask.h b/src/MaaCore/Task/Interface/AwardTask.h similarity index 80% rename from src/MeoAssistant/Task/Interface/AwardTask.h rename to src/MaaCore/Task/Interface/AwardTask.h index f35ea9e962..07f54ce518 100644 --- a/src/MeoAssistant/Task/Interface/AwardTask.h +++ b/src/MaaCore/Task/Interface/AwardTask.h @@ -10,7 +10,7 @@ namespace asst public: inline static constexpr std::string_view TaskType = "Award"; - AwardTask(const AsstCallback& callback, void* callback_arg); + AwardTask(const AsstCallback& callback, Assistant* inst); virtual ~AwardTask() override = default; }; } diff --git a/src/MeoAssistant/Task/Interface/CloseDownTask.cpp b/src/MaaCore/Task/Interface/CloseDownTask.cpp similarity index 69% rename from src/MeoAssistant/Task/Interface/CloseDownTask.cpp rename to src/MaaCore/Task/Interface/CloseDownTask.cpp index 5752686396..b48db26470 100644 --- a/src/MeoAssistant/Task/Interface/CloseDownTask.cpp +++ b/src/MaaCore/Task/Interface/CloseDownTask.cpp @@ -5,8 +5,8 @@ #include "Task/Miscellaneous/StopGameTaskPlugin.h" #include "Task/ProcessTask.h" -asst::CloseDownTask::CloseDownTask(const AsstCallback& callback, void* callback_arg) - : InterfaceTask(callback, callback_arg, TaskType) +asst::CloseDownTask::CloseDownTask(const AsstCallback& callback, Assistant* inst) + : InterfaceTask(callback, inst, TaskType) { - m_subtasks.emplace_back(std::make_shared(m_callback, m_callback_arg, TaskType)); + m_subtasks.emplace_back(std::make_shared(m_callback, m_inst, TaskType)); } diff --git a/src/MeoAssistant/Task/Interface/CloseDownTask.h b/src/MaaCore/Task/Interface/CloseDownTask.h similarity index 78% rename from src/MeoAssistant/Task/Interface/CloseDownTask.h rename to src/MaaCore/Task/Interface/CloseDownTask.h index 47eeaeed7e..656a6b4ba4 100644 --- a/src/MeoAssistant/Task/Interface/CloseDownTask.h +++ b/src/MaaCore/Task/Interface/CloseDownTask.h @@ -8,7 +8,7 @@ namespace asst public: inline static constexpr std::string_view TaskType = "CloseDown"; - CloseDownTask(const AsstCallback& callback, void* callback_arg); + CloseDownTask(const AsstCallback& callback, Assistant* inst); virtual ~CloseDownTask() override = default; }; } diff --git a/src/MeoAssistant/Task/Interface/CopilotTask.cpp b/src/MaaCore/Task/Interface/CopilotTask.cpp similarity index 73% rename from src/MeoAssistant/Task/Interface/CopilotTask.cpp rename to src/MaaCore/Task/Interface/CopilotTask.cpp index 776c39857a..0c02268ff1 100644 --- a/src/MeoAssistant/Task/Interface/CopilotTask.cpp +++ b/src/MaaCore/Task/Interface/CopilotTask.cpp @@ -7,18 +7,18 @@ #include "Utils/Logger.hpp" #include "Utils/Platform.hpp" -asst::CopilotTask::CopilotTask(const AsstCallback& callback, void* callback_arg) - : InterfaceTask(callback, callback_arg, TaskType), - m_formation_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_battle_task_ptr(std::make_shared(callback, callback_arg, TaskType)) +asst::CopilotTask::CopilotTask(const AsstCallback& callback, Assistant* inst) + : InterfaceTask(callback, inst, TaskType), + m_formation_task_ptr(std::make_shared(callback, inst, TaskType)), + m_battle_task_ptr(std::make_shared(callback, inst, TaskType)) { - auto start_1_tp = std::make_shared(callback, callback_arg, TaskType); + auto start_1_tp = std::make_shared(callback, inst, TaskType); start_1_tp->set_tasks({ "BattleStartPre" }).set_retry_times(0).set_ignore_error(true); m_subtasks.emplace_back(start_1_tp); - m_subtasks.emplace_back(m_formation_task_ptr)->set_retry_times(0); + m_subtasks.emplace_back(m_formation_task_ptr); - auto start_2_tp = std::make_shared(callback, callback_arg, TaskType); + auto start_2_tp = std::make_shared(callback, inst, TaskType); start_2_tp->set_tasks({ "BattleStartNormal", "BattleStartRaid", "BattleStartExercise", "BattleStartSimulation" }) .set_ignore_error(false); m_subtasks.emplace_back(start_2_tp); @@ -39,12 +39,15 @@ bool asst::CopilotTask::set_params(const json::value& params) } if (!Copilot.load(utils::path(*filename_opt))) { + Log.error("CopilotConfig parse failed"); return false; } m_stage_name = Copilot.get_stage_name(); - m_battle_task_ptr->set_stage_name(m_stage_name); - m_formation_task_ptr->set_stage_name(m_stage_name); + if (!m_battle_task_ptr->set_stage_name(m_stage_name)) { + Log.error("Not support stage"); + return false; + } bool with_formation = params.get("formation", false); m_formation_task_ptr->set_enable(with_formation); diff --git a/src/MeoAssistant/Task/Interface/CopilotTask.h b/src/MaaCore/Task/Interface/CopilotTask.h similarity index 90% rename from src/MeoAssistant/Task/Interface/CopilotTask.h rename to src/MaaCore/Task/Interface/CopilotTask.h index 47d7c8de3b..43893dc468 100644 --- a/src/MeoAssistant/Task/Interface/CopilotTask.h +++ b/src/MaaCore/Task/Interface/CopilotTask.h @@ -14,7 +14,7 @@ namespace asst public: inline static constexpr std::string_view TaskType = "Copilot"; - CopilotTask(const AsstCallback& callback, void* callback_arg); + CopilotTask(const AsstCallback& callback, Assistant* inst); virtual ~CopilotTask() override = default; virtual bool set_params(const json::value& params) override; diff --git a/src/MeoAssistant/Task/Interface/DebugTask.cpp b/src/MaaCore/Task/Interface/DebugTask.cpp similarity index 75% rename from src/MeoAssistant/Task/Interface/DebugTask.cpp rename to src/MaaCore/Task/Interface/DebugTask.cpp index aa4711b114..4366172b52 100644 --- a/src/MeoAssistant/Task/Interface/DebugTask.cpp +++ b/src/MaaCore/Task/Interface/DebugTask.cpp @@ -6,16 +6,15 @@ // #include "Plugin/RoguelikeSkillSelectionTaskPlugin.h" -#include "Vision/Miscellaneous/DepotImageAnalyzer.h" -#include "Vision/Roguelike/StageDropsImageAnalyzer.h" #include "Utils/ImageIo.hpp" #include "Utils/Logger.hpp" +#include "Vision/Miscellaneous/DepotImageAnalyzer.h" +#include "Vision/Miscellaneous/StageDropsImageAnalyzer.h" -asst::DebugTask::DebugTask(const AsstCallback& callback, void* callback_arg) - : InterfaceTask(callback, callback_arg, TaskType) +asst::DebugTask::DebugTask(const AsstCallback& callback, Assistant* inst) : InterfaceTask(callback, inst, TaskType) { - ////auto task_ptr = std::make_shared(callback, callback_arg, TaskType); - // auto task_ptr = std::make_shared(callback, callback_arg, TaskType); + ////auto task_ptr = std::make_shared(callback, inst, TaskType); + // auto task_ptr = std::make_shared(callback, inst, TaskType); // m_subtasks.emplace_back(task_ptr); } @@ -23,7 +22,7 @@ bool asst::DebugTask::run() { size_t total = 0; size_t success = 0; - for (const auto& entry : std::filesystem::directory_iterator("../../test/drops/screenshots/ja_jp")) { + for (const auto& entry : std::filesystem::directory_iterator("../../test/drops/screenshots/zh_cn")) { cv::Mat image = asst::imread(entry.path()); if (image.empty()) { continue; diff --git a/src/MeoAssistant/Task/Interface/DebugTask.h b/src/MaaCore/Task/Interface/DebugTask.h similarity index 80% rename from src/MeoAssistant/Task/Interface/DebugTask.h rename to src/MaaCore/Task/Interface/DebugTask.h index 9f9d8918bc..ed1a5a9650 100644 --- a/src/MeoAssistant/Task/Interface/DebugTask.h +++ b/src/MaaCore/Task/Interface/DebugTask.h @@ -8,7 +8,7 @@ namespace asst public: inline static constexpr std::string_view TaskType = "Debug"; - DebugTask(const AsstCallback& callback, void* callback_arg); + DebugTask(const AsstCallback& callback, Assistant* inst); virtual ~DebugTask() override = default; virtual bool run() override; diff --git a/src/MeoAssistant/Task/Interface/DepotTask.cpp b/src/MaaCore/Task/Interface/DepotTask.cpp similarity index 68% rename from src/MeoAssistant/Task/Interface/DepotTask.cpp rename to src/MaaCore/Task/Interface/DepotTask.cpp index 4247a9bed3..22a8f6fb2d 100644 --- a/src/MeoAssistant/Task/Interface/DepotTask.cpp +++ b/src/MaaCore/Task/Interface/DepotTask.cpp @@ -3,14 +3,14 @@ #include "Task/Miscellaneous/DepotRecognitionTask.h" #include "Task/ProcessTask.h" -asst::DepotTask::DepotTask(const AsstCallback& callback, void* callback_arg) - : InterfaceTask(callback, callback_arg, TaskType) +asst::DepotTask::DepotTask(const AsstCallback& callback, Assistant* inst) + : InterfaceTask(callback, inst, TaskType) { - auto enter_task = std::make_shared(m_callback, m_callback_arg, TaskType); + auto enter_task = std::make_shared(m_callback, m_inst, TaskType); enter_task->set_tasks({ "DepotBegin" }).set_ignore_error(true); m_subtasks.emplace_back(enter_task); - auto recognition_task = std::make_shared(m_callback, m_callback_arg, TaskType); + auto recognition_task = std::make_shared(m_callback, m_inst, TaskType); recognition_task->set_retry_times(0); m_subtasks.emplace_back(recognition_task); } diff --git a/src/MeoAssistant/Task/Interface/DepotTask.h b/src/MaaCore/Task/Interface/DepotTask.h similarity index 78% rename from src/MeoAssistant/Task/Interface/DepotTask.h rename to src/MaaCore/Task/Interface/DepotTask.h index 96fe041012..9ff3a7e754 100644 --- a/src/MeoAssistant/Task/Interface/DepotTask.h +++ b/src/MaaCore/Task/Interface/DepotTask.h @@ -8,7 +8,7 @@ namespace asst public: inline static constexpr std::string_view TaskType = "Depot"; - DepotTask(const AsstCallback& callback, void* callback_arg); + DepotTask(const AsstCallback& callback, Assistant* inst); virtual ~DepotTask() override = default; }; } diff --git a/src/MeoAssistant/Task/Interface/FightTask.cpp b/src/MaaCore/Task/Interface/FightTask.cpp similarity index 90% rename from src/MeoAssistant/Task/Interface/FightTask.cpp rename to src/MaaCore/Task/Interface/FightTask.cpp index b4fa178b26..5559a34358 100644 --- a/src/MeoAssistant/Task/Interface/FightTask.cpp +++ b/src/MaaCore/Task/Interface/FightTask.cpp @@ -9,13 +9,14 @@ #include "Task/Fight/StageNavigationTask.h" #include "Task/Miscellaneous/GameCrashRestartTaskPlugin.h" #include "Task/ProcessTask.h" +#include "Utils/Logger.hpp" #include "Utils/Ranges.hpp" -asst::FightTask::FightTask(const AsstCallback& callback, void* callback_arg) - : InterfaceTask(callback, callback_arg, TaskType), - m_start_up_task_ptr(std::make_shared(m_callback, m_callback_arg, TaskType)), - m_stage_navigation_task_ptr(std::make_shared(m_callback, m_callback_arg, TaskType)), - m_fight_task_ptr(std::make_shared(m_callback, m_callback_arg, TaskType)) +asst::FightTask::FightTask(const AsstCallback& callback, Assistant* inst) + : InterfaceTask(callback, inst, TaskType), + m_start_up_task_ptr(std::make_shared(m_callback, m_inst, TaskType)), + m_stage_navigation_task_ptr(std::make_shared(m_callback, m_inst, TaskType)), + m_fight_task_ptr(std::make_shared(m_callback, m_inst, TaskType)) { // 进入选关界面 // 对于指定关卡,就是主界面的“终端”点进去 @@ -79,7 +80,10 @@ bool asst::FightTask::set_params(const json::value& params) } else { m_start_up_task_ptr->set_tasks({ "StageBegin" }).set_times_limit("GoLastBattle", 0); - m_stage_navigation_task_ptr->set_stage_name(stage); + if (!m_stage_navigation_task_ptr->set_stage_name(stage)) { + Log.error("Cannot set stage", stage); + return false; + } m_stage_navigation_task_ptr->set_enable(true); } m_stage_drops_plugin_ptr->set_server(server); diff --git a/src/MeoAssistant/Task/Interface/FightTask.h b/src/MaaCore/Task/Interface/FightTask.h similarity index 93% rename from src/MeoAssistant/Task/Interface/FightTask.h rename to src/MaaCore/Task/Interface/FightTask.h index 4bc3ccf2b1..b43706dcbe 100644 --- a/src/MeoAssistant/Task/Interface/FightTask.h +++ b/src/MaaCore/Task/Interface/FightTask.h @@ -16,7 +16,7 @@ namespace asst public: inline static constexpr std::string_view TaskType = "Fight"; - FightTask(const AsstCallback& callback, void* callback_arg); + FightTask(const AsstCallback& callback, Assistant* inst); virtual ~FightTask() override = default; virtual bool set_params(const json::value& params) override; diff --git a/src/MeoAssistant/Task/Interface/InfrastTask.cpp b/src/MaaCore/Task/Interface/InfrastTask.cpp similarity index 95% rename from src/MeoAssistant/Task/Interface/InfrastTask.cpp rename to src/MaaCore/Task/Interface/InfrastTask.cpp index 969f71b818..568cb61e0c 100644 --- a/src/MeoAssistant/Task/Interface/InfrastTask.cpp +++ b/src/MaaCore/Task/Interface/InfrastTask.cpp @@ -14,17 +14,17 @@ #include "Task/Infrast/ReplenishOriginiumShardTaskPlugin.h" #include "Task/ProcessTask.h" -asst::InfrastTask::InfrastTask(const AsstCallback& callback, void* callback_arg) - : InterfaceTask(callback, callback_arg, TaskType), - m_infrast_begin_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_info_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_mfg_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_trade_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_power_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_control_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_reception_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_office_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_dorm_task_ptr(std::make_shared(callback, callback_arg, TaskType)) +asst::InfrastTask::InfrastTask(const AsstCallback& callback, Assistant* inst) + : InterfaceTask(callback, inst, TaskType), + m_infrast_begin_task_ptr(std::make_shared(callback, inst, TaskType)), + m_info_task_ptr(std::make_shared(callback, inst, TaskType)), + m_mfg_task_ptr(std::make_shared(callback, inst, TaskType)), + m_trade_task_ptr(std::make_shared(callback, inst, TaskType)), + m_power_task_ptr(std::make_shared(callback, inst, TaskType)), + m_control_task_ptr(std::make_shared(callback, inst, TaskType)), + m_reception_task_ptr(std::make_shared(callback, inst, TaskType)), + m_office_task_ptr(std::make_shared(callback, inst, TaskType)), + m_dorm_task_ptr(std::make_shared(callback, inst, TaskType)) { m_infrast_begin_task_ptr->set_tasks({ "InfrastBegin" }).set_ignore_error(true); m_replenish_task_ptr = m_mfg_task_ptr->register_plugin(); @@ -270,7 +270,7 @@ bool asst::InfrastTask::parse_and_set_custom_config(const std::filesystem::path& infrast::CustomFacilityConfig pre_facility_config(1); auto& pre_room_config = pre_facility_config.front(); pre_room_config.names = { target }; - auto pre_task_ptr = std::make_shared(m_callback, m_callback_arg, TaskType); + auto pre_task_ptr = std::make_shared(m_callback, m_inst, TaskType); pre_task_ptr->set_custom_config(std::move(pre_facility_config)); infrast::CustomFacilityConfig facility_config(1); @@ -278,7 +278,7 @@ bool asst::InfrastTask::parse_and_set_custom_config(const std::filesystem::path& room_config.names = { target, FiaName }; room_config.sort = true; - auto Fia_task_ptr = std::make_shared(m_callback, m_callback_arg, TaskType); + auto Fia_task_ptr = std::make_shared(m_callback, m_inst, TaskType); Fia_task_ptr->set_custom_config(std::move(facility_config)); if (Fia_json.get("order", "pre") != "post") { @@ -319,10 +319,10 @@ bool asst::InfrastTask::parse_and_set_custom_config(const std::filesystem::path& if (additional_advance_drones) { std::shared_ptr drones_only_task_ptr = nullptr; if (room == "trading") { - drones_only_task_ptr = std::make_shared(m_callback, m_callback_arg, TaskType); + drones_only_task_ptr = std::make_shared(m_callback, m_inst, TaskType); } else if (room == "manufacture") { - drones_only_task_ptr = std::make_shared(m_callback, m_callback_arg, TaskType); + drones_only_task_ptr = std::make_shared(m_callback, m_inst, TaskType); } drones_only_task_ptr->set_custom_config( diff --git a/src/MeoAssistant/Task/Interface/InfrastTask.h b/src/MaaCore/Task/Interface/InfrastTask.h similarity index 95% rename from src/MeoAssistant/Task/Interface/InfrastTask.h rename to src/MaaCore/Task/Interface/InfrastTask.h index 3534c42d1b..365a8e1697 100644 --- a/src/MeoAssistant/Task/Interface/InfrastTask.h +++ b/src/MaaCore/Task/Interface/InfrastTask.h @@ -27,7 +27,7 @@ namespace asst public: inline static constexpr std::string_view TaskType = "Infrast"; - InfrastTask(const AsstCallback& callback, void* callback_arg); + InfrastTask(const AsstCallback& callback, Assistant* inst); virtual ~InfrastTask() override = default; virtual bool set_params(const json::value& params) override; diff --git a/src/MeoAssistant/Task/Interface/MallTask.cpp b/src/MaaCore/Task/Interface/MallTask.cpp similarity index 89% rename from src/MeoAssistant/Task/Interface/MallTask.cpp rename to src/MaaCore/Task/Interface/MallTask.cpp index 153bbff2bd..106b29815b 100644 --- a/src/MeoAssistant/Task/Interface/MallTask.cpp +++ b/src/MaaCore/Task/Interface/MallTask.cpp @@ -4,14 +4,14 @@ #include "Task/Miscellaneous/CreditShoppingTask.h" #include "Task/ProcessTask.h" -asst::MallTask::MallTask(const AsstCallback& callback, void* callback_arg) - : InterfaceTask(callback, callback_arg, TaskType), - m_visit_task_ptr(std::make_shared(m_callback, m_callback_arg, TaskType)), - m_credit_fight_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_mall_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_shopping_first_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_shopping_task_ptr(std::make_shared(callback, callback_arg, TaskType)), - m_shopping_force_task_ptr(std::make_shared(callback, callback_arg, TaskType)) +asst::MallTask::MallTask(const AsstCallback& callback, Assistant* inst) + : InterfaceTask(callback, inst, TaskType), + m_visit_task_ptr(std::make_shared(m_callback, m_inst, TaskType)), + m_credit_fight_task_ptr(std::make_shared(callback, inst, TaskType)), + m_mall_task_ptr(std::make_shared(callback, inst, TaskType)), + m_shopping_first_task_ptr(std::make_shared(callback, inst, TaskType)), + m_shopping_task_ptr(std::make_shared(callback, inst, TaskType)), + m_shopping_force_task_ptr(std::make_shared(callback, inst, TaskType)) { m_visit_task_ptr->set_tasks({ "VisitBegin" }); m_mall_task_ptr->set_tasks({ "MallBegin" }); diff --git a/src/MeoAssistant/Task/Interface/MallTask.h b/src/MaaCore/Task/Interface/MallTask.h similarity index 92% rename from src/MeoAssistant/Task/Interface/MallTask.h rename to src/MaaCore/Task/Interface/MallTask.h index f8060f0a86..b73dd709d5 100644 --- a/src/MeoAssistant/Task/Interface/MallTask.h +++ b/src/MaaCore/Task/Interface/MallTask.h @@ -12,7 +12,7 @@ namespace asst public: inline static constexpr std::string_view TaskType = "Mall"; - MallTask(const AsstCallback& callback, void* callback_arg); + MallTask(const AsstCallback& callback, Assistant* inst); virtual ~MallTask() override = default; virtual bool set_params(const json::value& params) override; diff --git a/src/MeoAssistant/Task/Interface/RecruitTask.cpp b/src/MaaCore/Task/Interface/RecruitTask.cpp similarity index 93% rename from src/MeoAssistant/Task/Interface/RecruitTask.cpp rename to src/MaaCore/Task/Interface/RecruitTask.cpp index 9364a2cd99..b4b84a94d3 100644 --- a/src/MeoAssistant/Task/Interface/RecruitTask.cpp +++ b/src/MaaCore/Task/Interface/RecruitTask.cpp @@ -3,9 +3,9 @@ #include "Task/Miscellaneous/AutoRecruitTask.h" #include "Task/ProcessTask.h" -asst::RecruitTask::RecruitTask(const AsstCallback& callback, void* callback_arg) - : InterfaceTask(callback, callback_arg, TaskType), - m_auto_recruit_task_ptr(std::make_shared(callback, callback_arg, TaskType)) +asst::RecruitTask::RecruitTask(const AsstCallback& callback, Assistant* inst) + : InterfaceTask(callback, inst, TaskType), + m_auto_recruit_task_ptr(std::make_shared(callback, inst, TaskType)) { m_subtasks.emplace_back(m_auto_recruit_task_ptr)->set_retry_times(5); } diff --git a/src/MeoAssistant/Task/Interface/RecruitTask.h b/src/MaaCore/Task/Interface/RecruitTask.h similarity index 86% rename from src/MeoAssistant/Task/Interface/RecruitTask.h rename to src/MaaCore/Task/Interface/RecruitTask.h index 8b299ad9f9..5dd99555d5 100644 --- a/src/MeoAssistant/Task/Interface/RecruitTask.h +++ b/src/MaaCore/Task/Interface/RecruitTask.h @@ -11,7 +11,7 @@ namespace asst public: inline static constexpr std::string_view TaskType = "Recruit"; - RecruitTask(const AsstCallback& callback, void* callback_arg); + RecruitTask(const AsstCallback& callback, Assistant* inst); virtual ~RecruitTask() override = default; virtual bool set_params(const json::value& params) override; diff --git a/src/MeoAssistant/Task/Interface/RoguelikeTask.cpp b/src/MaaCore/Task/Interface/RoguelikeTask.cpp similarity index 95% rename from src/MeoAssistant/Task/Interface/RoguelikeTask.cpp rename to src/MaaCore/Task/Interface/RoguelikeTask.cpp index 46f23d9580..b876b359fb 100644 --- a/src/MeoAssistant/Task/Interface/RoguelikeTask.cpp +++ b/src/MaaCore/Task/Interface/RoguelikeTask.cpp @@ -14,9 +14,9 @@ #include "Task/Roguelike/RoguelikeSkillSelectionTaskPlugin.h" #include "Utils/Logger.hpp" -asst::RoguelikeTask::RoguelikeTask(const AsstCallback& callback, void* callback_arg) - : InterfaceTask(callback, callback_arg, TaskType), - m_roguelike_task_ptr(std::make_shared(callback, callback_arg, TaskType)) +asst::RoguelikeTask::RoguelikeTask(const AsstCallback& callback, Assistant* inst) + : InterfaceTask(callback, inst, TaskType), + m_roguelike_task_ptr(std::make_shared(callback, inst, TaskType)) { m_roguelike_task_ptr->set_ignore_error(true); m_roguelike_task_ptr->register_plugin(); @@ -46,12 +46,12 @@ bool asst::RoguelikeTask::set_params(const json::value& params) return false; } - if (m_status == nullptr) { + if (status() == nullptr) { m_roguelike_task_ptr->set_tasks({ "Stop" }); - Log.error(__FUNCTION__, "m_status is null"); + Log.error(__FUNCTION__, "status() is null"); return false; } - m_status->set_properties(Status::RoguelikeTheme, theme); + status()->set_properties(Status::RoguelikeTheme, theme); m_roguelike_task_ptr->set_tasks({ theme + "@Roguelike@Begin" }); // 0 - 刷蜡烛,尽可能稳定地打更多层数 diff --git a/src/MeoAssistant/Task/Interface/RoguelikeTask.h b/src/MaaCore/Task/Interface/RoguelikeTask.h similarity index 93% rename from src/MeoAssistant/Task/Interface/RoguelikeTask.h rename to src/MaaCore/Task/Interface/RoguelikeTask.h index 9d45ee59f2..44f7a1cbc4 100644 --- a/src/MeoAssistant/Task/Interface/RoguelikeTask.h +++ b/src/MaaCore/Task/Interface/RoguelikeTask.h @@ -15,7 +15,7 @@ namespace asst public: inline static constexpr std::string_view TaskType = "Roguelike"; - RoguelikeTask(const AsstCallback& callback, void* callback_arg); + RoguelikeTask(const AsstCallback& callback, Assistant* inst); virtual ~RoguelikeTask() override = default; virtual bool set_params(const json::value& params) override; diff --git a/src/MeoAssistant/Task/Interface/StartUpTask.cpp b/src/MaaCore/Task/Interface/StartUpTask.cpp similarity index 77% rename from src/MeoAssistant/Task/Interface/StartUpTask.cpp rename to src/MaaCore/Task/Interface/StartUpTask.cpp index e0a6ff9b48..f597b91e9c 100644 --- a/src/MeoAssistant/Task/Interface/StartUpTask.cpp +++ b/src/MaaCore/Task/Interface/StartUpTask.cpp @@ -4,10 +4,10 @@ #include "Task/ProcessTask.h" -asst::StartUpTask::StartUpTask(const AsstCallback& callback, void* callback_arg) - : InterfaceTask(callback, callback_arg, TaskType), - m_start_game_task_ptr(std::make_shared(m_callback, m_callback_arg, TaskType)), - m_start_up_task_ptr(std::make_shared(m_callback, m_callback_arg, TaskType)) +asst::StartUpTask::StartUpTask(const AsstCallback& callback, Assistant* inst) + : InterfaceTask(callback, inst, TaskType), + m_start_game_task_ptr(std::make_shared(m_callback, m_inst, TaskType)), + m_start_up_task_ptr(std::make_shared(m_callback, m_inst, TaskType)) { m_start_up_task_ptr->set_tasks({ "StartUpBegin" }) .set_times_limit("ReturnTo", 0) diff --git a/src/MeoAssistant/Task/Interface/StartUpTask.h b/src/MaaCore/Task/Interface/StartUpTask.h similarity index 88% rename from src/MeoAssistant/Task/Interface/StartUpTask.h rename to src/MaaCore/Task/Interface/StartUpTask.h index fbda8e4f16..4f9dd39571 100644 --- a/src/MeoAssistant/Task/Interface/StartUpTask.h +++ b/src/MaaCore/Task/Interface/StartUpTask.h @@ -11,7 +11,7 @@ namespace asst public: inline static constexpr std::string_view TaskType = "StartUp"; - StartUpTask(const AsstCallback& callback, void* callback_arg); + StartUpTask(const AsstCallback& callback, Assistant* inst); virtual ~StartUpTask() override = default; bool set_params(const json::value& params) override; diff --git a/src/MeoAssistant/Task/InterfaceTask.h b/src/MaaCore/Task/InterfaceTask.h similarity index 100% rename from src/MeoAssistant/Task/InterfaceTask.h rename to src/MaaCore/Task/InterfaceTask.h diff --git a/src/MeoAssistant/Task/Miscellaneous/AutoRecruitTask.cpp b/src/MaaCore/Task/Miscellaneous/AutoRecruitTask.cpp similarity index 96% rename from src/MeoAssistant/Task/Miscellaneous/AutoRecruitTask.cpp rename to src/MaaCore/Task/Miscellaneous/AutoRecruitTask.cpp index af7017a576..81f3c45361 100644 --- a/src/MeoAssistant/Task/Miscellaneous/AutoRecruitTask.cpp +++ b/src/MaaCore/Task/Miscellaneous/AutoRecruitTask.cpp @@ -1,15 +1,15 @@ #include "AutoRecruitTask.h" -#include "Controller.h" -#include "Vision/Miscellaneous/RecruitImageAnalyzer.h" -#include "Vision/MultiMatchImageAnalyzer.h" -#include "Vision/OcrImageAnalyzer.h" #include "Config/GeneralConfig.h" #include "Config/Miscellaneous/RecruitConfig.h" #include "Config/TaskData.h" +#include "Controller.h" #include "Task/ProcessTask.h" #include "Task/ReportDataTask.h" #include "Utils/Logger.hpp" +#include "Vision/Miscellaneous/RecruitImageAnalyzer.h" +#include "Vision/MultiMatchImageAnalyzer.h" +#include "Vision/OcrImageAnalyzer.h" #include "Utils/Ranges.hpp" #include @@ -193,7 +193,7 @@ bool asst::AutoRecruitTask::_run() if (!recruit_begin()) return false; { - const auto image = m_ctrler->get_image(); + const auto image = ctrler()->get_image(); // initialize_dirty_slot_info(image); m_dirty_slots = { 0, 1, 2, 3 }; if (!hire_all(image)) return false; @@ -209,7 +209,7 @@ bool asst::AutoRecruitTask::_run() return false; } - auto start_rect = try_get_start_button(m_ctrler->get_image()); + auto start_rect = try_get_start_button(ctrler()->get_image()); if (start_rect) { if (need_exit()) return false; if (recruit_one(start_rect.value())) @@ -281,7 +281,7 @@ bool asst::AutoRecruitTask::recruit_one(const Rect& button) int delay = Config.get_options().task_delay; - m_ctrler->click(button); + ctrler()->click(button); sleep(delay); auto calc_result = recruit_calc_task(slot_index_from_rect(button)); @@ -344,7 +344,7 @@ asst::AutoRecruitTask::calc_task_result_type asst::AutoRecruitTask::recruit_calc for (size_t image_analyzer_retry = 0; image_analyzer_retry < analyze_limit;) { ++image_analyzer_retry; - RecruitImageAnalyzer image_analyzer(m_ctrler->get_image()); + RecruitImageAnalyzer image_analyzer(ctrler()->get_image()); if (!image_analyzer.analyze()) continue; if (image_analyzer.get_tags_result().size() != RecruitConfig::CorrectNumberOfTags) continue; @@ -540,9 +540,9 @@ asst::AutoRecruitTask::calc_task_result_type asst::AutoRecruitTask::recruit_calc const int hour_delta = (1 < temp) ? (1 + 9 - temp) : (temp - 1); const int minute_delta = (0 < desired_minute_div_10) ? (0 + 6 - desired_minute_div_10) : (0); for (int i = 0; i < hour_delta; ++i) - m_ctrler->click(image_analyzer.get_hour_decrement_rect()); + ctrler()->click(image_analyzer.get_hour_decrement_rect()); for (int i = 0; i < minute_delta; ++i) - m_ctrler->click(image_analyzer.get_minute_decrement_rect()); + ctrler()->click(image_analyzer.get_minute_decrement_rect()); } // nothing to select, leave the selection empty @@ -559,7 +559,7 @@ asst::AutoRecruitTask::calc_task_result_type asst::AutoRecruitTask::recruit_calc for (const std::string& final_tag_name : final_combination.tags) { auto tag_rect_iter = ranges::find_if(tags, [&](const TextRect& r) { return r.text == final_tag_name; }); if (tag_rect_iter != tags.cend()) { - m_ctrler->click(tag_rect_iter->rect); + ctrler()->click(tag_rect_iter->rect); } } @@ -588,7 +588,7 @@ bool asst::AutoRecruitTask::recruit_begin() bool asst::AutoRecruitTask::check_timer(int minutes_expected) { - const auto image = m_ctrler->get_image(); + const auto image = ctrler()->get_image(); const auto replace_map = Task.get("NumberOcrReplace")->replace_map; { @@ -658,7 +658,7 @@ bool asst::AutoRecruitTask::hire_all(const cv::Mat& image) /// search for blue *Hire* buttons in the recruit home page, mark those slot clean and do hiring bool asst::AutoRecruitTask::hire_all() { - return hire_all(m_ctrler->get_image()); + return hire_all(ctrler()->get_image()); } /// search for *RecruitNow* buttons before recruit and mark them as dirty @@ -710,7 +710,7 @@ void asst::AutoRecruitTask::upload_to_penguin(Rng&& tags) { "quantity", 1 }, }); } - body["source"] = "MeoAssistant"; + body["source"] = UploadDataSource; body["version"] = Version; std::string extra_param; @@ -719,8 +719,7 @@ void asst::AutoRecruitTask::upload_to_penguin(Rng&& tags) } if (!m_report_penguin_task_ptr) { - m_report_penguin_task_ptr = - std::make_shared(report_penguin_callback, static_cast(this), m_task_chain); + m_report_penguin_task_ptr = std::make_shared(report_penguin_callback, this); } m_report_penguin_task_ptr->set_report_type(ReportType::PenguinStats) @@ -736,13 +735,12 @@ void asst::AutoRecruitTask::upload_to_yituliu(const json::value& details) json::value body = details; body["server"] = m_server; - body["source"] = "MeoAssistant"; + body["source"] = UploadDataSource; body["version"] = Version; body["uuid"] = /* m_yituliu_id */ m_penguin_id; if (!m_report_yituliu_task_ptr) { - m_report_yituliu_task_ptr = - std::make_shared(report_yituliu_callback, static_cast(this), m_task_chain); + m_report_yituliu_task_ptr = std::make_shared(report_yituliu_callback, this); } m_report_yituliu_task_ptr->set_report_type(ReportType::YituliuBigData) @@ -751,11 +749,11 @@ void asst::AutoRecruitTask::upload_to_yituliu(const json::value& details) .run(); } -void asst::AutoRecruitTask::report_penguin_callback(AsstMsg msg, const json::value& detail, void* custom_arg) +void asst::AutoRecruitTask::report_penguin_callback(AsstMsg msg, const json::value& detail, AbstractTask* task_ptr) { LogTraceFunction; - auto p_this = static_cast(custom_arg); + auto p_this = dynamic_cast(task_ptr); if (!p_this) { return; } @@ -768,11 +766,11 @@ void asst::AutoRecruitTask::report_penguin_callback(AsstMsg msg, const json::val p_this->callback(msg, detail); } -void asst::AutoRecruitTask::report_yituliu_callback(AsstMsg msg, const json::value& detail, void* custom_arg) +void asst::AutoRecruitTask::report_yituliu_callback(AsstMsg msg, const json::value& detail, AbstractTask* task_ptr) { LogTraceFunction; - auto p_this = static_cast(custom_arg); + auto p_this = dynamic_cast(task_ptr); if (!p_this) { return; } diff --git a/src/MeoAssistant/Task/Miscellaneous/AutoRecruitTask.h b/src/MaaCore/Task/Miscellaneous/AutoRecruitTask.h similarity index 97% rename from src/MeoAssistant/Task/Miscellaneous/AutoRecruitTask.h rename to src/MaaCore/Task/Miscellaneous/AutoRecruitTask.h index c5a6b6ed27..a8e1e1327d 100644 --- a/src/MeoAssistant/Task/Miscellaneous/AutoRecruitTask.h +++ b/src/MaaCore/Task/Miscellaneous/AutoRecruitTask.h @@ -54,8 +54,8 @@ namespace asst template void upload_to_penguin(Rng&& tag_ids); void upload_to_yituliu(const json::value& details); - static void report_penguin_callback(AsstMsg msg, const json::value& detail, void* custom_arg); - static void report_yituliu_callback(AsstMsg msg, const json::value& detail, void* custom_arg); + static void report_penguin_callback(AsstMsg msg, const json::value& detail, AbstractTask* task_ptr); + static void report_yituliu_callback(AsstMsg msg, const json::value& detail, AbstractTask* task_ptr); using slot_index = size_t; diff --git a/src/MeoAssistant/Task/Miscellaneous/BattleFormationTask.cpp b/src/MaaCore/Task/Miscellaneous/BattleFormationTask.cpp similarity index 96% rename from src/MeoAssistant/Task/Miscellaneous/BattleFormationTask.cpp rename to src/MaaCore/Task/Miscellaneous/BattleFormationTask.cpp index 0e67a2da21..d7fbda8fc9 100644 --- a/src/MeoAssistant/Task/Miscellaneous/BattleFormationTask.cpp +++ b/src/MaaCore/Task/Miscellaneous/BattleFormationTask.cpp @@ -2,18 +2,13 @@ #include "Utils/Ranges.hpp" -#include "Controller.h" -#include "Vision/OcrWithFlagTemplImageAnalyzer.h" #include "Config/Miscellaneous/BattleDataConfig.h" #include "Config/Miscellaneous/CopilotConfig.h" #include "Config/TaskData.h" +#include "Controller.h" #include "Task/ProcessTask.h" #include "Utils/Logger.hpp" - -void asst::BattleFormationTask::set_stage_name(std::string name) -{ - m_stage_name = std::move(name); -} +#include "Vision/OcrWithFlagTemplImageAnalyzer.h" void asst::BattleFormationTask::set_support_unit_name(std::string name) { @@ -81,7 +76,7 @@ bool asst::BattleFormationTask::enter_selection_page() bool asst::BattleFormationTask::select_opers_in_cur_page(std::vector& groups) { auto formation_task_ptr = Task.get("BattleQuickFormationOCR"); - auto image = m_ctrler->get_image(); + auto image = ctrler()->get_image(); auto& ocr_replace = Task.get("CharsNameOcrReplace")->replace_map; OcrWithFlagTemplImageAnalyzer name_analyzer(image); @@ -143,10 +138,10 @@ bool asst::BattleFormationTask::select_opers_in_cur_page(std::vector& if (iter == groups.end()) { continue; } - m_ctrler->click(res.rect); + ctrler()->click(res.rect); sleep(formation_task_ptr->post_delay); if (1 <= skill && skill <= 3) { - m_ctrler->click(SkillRectArray.at(skill - 1ULL)); + ctrler()->click(SkillRectArray.at(skill - 1ULL)); } groups.erase(iter); diff --git a/src/MeoAssistant/Task/Miscellaneous/BattleFormationTask.h b/src/MaaCore/Task/Miscellaneous/BattleFormationTask.h similarity index 95% rename from src/MeoAssistant/Task/Miscellaneous/BattleFormationTask.h rename to src/MaaCore/Task/Miscellaneous/BattleFormationTask.h index 260925c4d8..559e22c2ac 100644 --- a/src/MeoAssistant/Task/Miscellaneous/BattleFormationTask.h +++ b/src/MaaCore/Task/Miscellaneous/BattleFormationTask.h @@ -10,7 +10,6 @@ namespace asst using AbstractTask::AbstractTask; virtual ~BattleFormationTask() override = default; - void set_stage_name(std::string name); void set_support_unit_name(std::string name); protected: diff --git a/src/MeoAssistant/Task/Miscellaneous/BattleProcessTask.cpp b/src/MaaCore/Task/Miscellaneous/BattleProcessTask.cpp similarity index 92% rename from src/MeoAssistant/Task/Miscellaneous/BattleProcessTask.cpp rename to src/MaaCore/Task/Miscellaneous/BattleProcessTask.cpp index ce1352b800..85a9b79e07 100644 --- a/src/MeoAssistant/Task/Miscellaneous/BattleProcessTask.cpp +++ b/src/MaaCore/Task/Miscellaneous/BattleProcessTask.cpp @@ -21,34 +21,35 @@ #include "Utils/ImageIo.hpp" - void - asst::BattleProcessTask::set_stage_name(std::string name) +bool asst::BattleProcessTask::set_stage_name(std::string name) { - m_stage_name = std::move(name); -} - -bool asst::BattleProcessTask::_run() -{ - bool ret = get_stage_info(); - - if (!ret) { + if (!Tile.contains(name)) { json::value info = basic_info_with_what("UnsupportedLevel"); auto& details = info["details"]; details["level"] = m_stage_name; callback(AsstMsg::SubTaskExtraInfo, info); return false; } + m_stage_name = std::move(name); + return true; +} - { - json::value info = basic_info_with_what("BattleActionDoc"); - auto& details = info["details"]; - details["title"] = m_copilot_data.title; - details["title_color"] = m_copilot_data.title_color; - details["details"] = m_copilot_data.details; - details["details_color"] = m_copilot_data.details_color; - callback(AsstMsg::SubTaskExtraInfo, info); +bool asst::BattleProcessTask::_run() +{ + if (!get_stage_info()) { + Log.error("get stage info failed"); + return false; } + json::value info = basic_info_with_what("BattleActionDoc"); + info["details"] |= json::object { + { "title", m_copilot_data.title }, + { "title_color", m_copilot_data.title_color }, + { "details", m_copilot_data.details }, + { "details_color", m_copilot_data.details_color }, + }; + callback(AsstMsg::SubTaskExtraInfo, info); + while (!need_exit() && !analyze_opers_preview()) { std::this_thread::yield(); } @@ -77,20 +78,19 @@ bool asst::BattleProcessTask::get_stage_info() bool asst::BattleProcessTask::analyze_opers_preview() { - { - json::value info = basic_info_with_what("BattleAction"); - auto& details = info["details"]; - details["action"] = "识别干员"; - details["doc"] = ""; - details["doc_color"] = ""; - callback(AsstMsg::SubTaskExtraInfo, info); - } + json::value info = basic_info_with_what("BattleAction"); + info["details"] |= json::object { + { "action", "识别干员" }, + { "doc", "" }, + { "doc_color", "" }, + }; + callback(AsstMsg::SubTaskExtraInfo, info); MatchImageAnalyzer officially_begin_analyzer; officially_begin_analyzer.set_task_info("BattleOfficiallyBegin"); cv::Mat image; while (!need_exit()) { - image = m_ctrler->get_image(); + image = ctrler()->get_image(); officially_begin_analyzer.set_image(image); if (officially_begin_analyzer.analyze()) { break; @@ -101,7 +101,7 @@ bool asst::BattleProcessTask::analyze_opers_preview() BattleImageAnalyzer oper_analyzer; oper_analyzer.set_target(BattleImageAnalyzer::Target::Oper); while (!need_exit()) { - image = m_ctrler->get_image(); + image = ctrler()->get_image(); oper_analyzer.set_image(image); if (oper_analyzer.analyze()) { break; @@ -123,7 +123,7 @@ bool asst::BattleProcessTask::analyze_opers_preview() // 所以这里一直点,直到真的点上了为止 while (!need_exit()) { battle_pause(); - image = m_ctrler->get_image(); + image = ctrler()->get_image(); officially_begin_analyzer.set_image(image); if (!officially_begin_analyzer.analyze()) { break; @@ -149,10 +149,10 @@ bool asst::BattleProcessTask::analyze_opers_preview() const auto& cur_oper = oper_analyzer.get_opers(); size_t offset = opers.size() > cur_oper.size() ? opers.size() - cur_oper.size() : 0; cur_rect = cur_oper.at(i - offset).rect; - m_ctrler->click(cur_rect); + ctrler()->click(cur_rect); sleep(click_delay); - image = m_ctrler->get_image(); + image = ctrler()->get_image(); OcrWithPreprocessImageAnalyzer name_analyzer(image); name_analyzer.set_task_info("BattleOperName"); @@ -192,7 +192,7 @@ bool asst::BattleProcessTask::analyze_opers_preview() draw_future.wait(); - m_ctrler->click(cur_rect); + ctrler()->click(cur_rect); sleep(click_delay); battle_pause(); @@ -263,10 +263,10 @@ bool asst::BattleProcessTask::update_opers_info(const cv::Mat& image) // 一个都没匹配上,考虑是新增的召唤物,或者别的东西,点开来看一下 if (matched_result.score == 0) { battle_pause(); - m_ctrler->click(cur_oper.rect); + ctrler()->click(cur_oper.rect); sleep(Task.get("BattleUseOper")->pre_delay); - OcrWithPreprocessImageAnalyzer name_analyzer(m_ctrler->get_image()); + OcrWithPreprocessImageAnalyzer name_analyzer(ctrler()->get_image()); name_analyzer.set_task_info("BattleOperName"); name_analyzer.set_replace(Task.get("CharsNameOcrReplace")->replace_map); @@ -275,7 +275,7 @@ bool asst::BattleProcessTask::update_opers_info(const cv::Mat& image) oper_name = name_analyzer.get_result().front().text; } m_group_to_oper_mapping[oper_name] = BattleDeployOper { oper_name }; - m_ctrler->click(cur_oper.rect); + ctrler()->click(cur_oper.rect); sleep(Task.get("BattleUseOper")->pre_delay); battle_pause(); } @@ -296,8 +296,6 @@ bool asst::BattleProcessTask::update_opers_info(const cv::Mat& image) bool asst::BattleProcessTask::do_action(size_t action_index) { const auto& action = m_copilot_data.actions.at(action_index); - json::value info = basic_info_with_what("BattleAction"); - auto& details = info["details"]; std::string action_desc; switch (action.type) { case BattleActionType::Deploy: @@ -323,9 +321,12 @@ bool asst::BattleProcessTask::do_action(size_t action_index) case BattleActionType::UseAllSkill: case BattleActionType::Output:; } - details["action"] = action_desc; - details["doc"] = action.doc; - details["doc_color"] = action.doc_color; + json::value info = basic_info_with_what("BattleAction"); + info["details"] |= json::object { + { "action", action_desc }, + { "doc", action.doc }, + { "doc_color", action.doc_color }, + }; callback(AsstMsg::SubTaskExtraInfo, info); if (!wait_condition(action)) { @@ -397,7 +398,7 @@ bool asst::BattleProcessTask::do_action(size_t action_index) bool asst::BattleProcessTask::wait_condition(const BattleAction& action) { - cv::Mat image = m_ctrler->get_image(); + cv::Mat image = ctrler()->get_image(); // 计算初始状态 int cost_base = -1; @@ -439,7 +440,7 @@ bool asst::BattleProcessTask::wait_condition(const BattleAction& action) try_possible_skill(image); std::this_thread::yield(); - image = m_ctrler->get_image(); + image = ctrler()->get_image(); } // 计算费用变化量 @@ -451,7 +452,7 @@ bool asst::BattleProcessTask::wait_condition(const BattleAction& action) int cost = analyzer.get_cost(); if (cost_base == -1) { cost_base = cost; - image = m_ctrler->get_image(); + image = ctrler()->get_image(); continue; } if (action.cost_changes != 0) { @@ -469,7 +470,7 @@ bool asst::BattleProcessTask::wait_condition(const BattleAction& action) try_possible_skill(image); std::this_thread::yield(); - image = m_ctrler->get_image(); + image = ctrler()->get_image(); } } @@ -491,7 +492,7 @@ bool asst::BattleProcessTask::wait_condition(const BattleAction& action) try_possible_skill(image); std::this_thread::yield(); - image = m_ctrler->get_image(); + image = ctrler()->get_image(); } } @@ -510,7 +511,7 @@ bool asst::BattleProcessTask::wait_condition(const BattleAction& action) try_possible_skill(image); std::this_thread::yield(); - image = m_ctrler->get_image(); + image = ctrler()->get_image(); } } @@ -519,23 +520,23 @@ bool asst::BattleProcessTask::wait_condition(const BattleAction& action) bool asst::BattleProcessTask::oper_deploy(const BattleAction& action, bool only_pre_process) { - const auto use_oper_task_ptr = Task.get("BattleUseOper"); - const auto swipe_oper_task_ptr = Task.get("BattleSwipeOper"); - const auto& oper_info = m_group_to_oper_mapping[action.group_name]; - auto iter = m_cur_opers_info.find(oper_info.name); + if (iter == m_cur_opers_info.cend()) { + Log.error("Can't find oper info for", oper_info.name); + return false; + } Rect oper_rect = iter->second.rect; - if (!m_in_bullet_time) { - // 点击干员 - m_ctrler->click(oper_rect); - sleep(use_oper_task_ptr->pre_delay); - } - if (only_pre_process) { + if (only_pre_process && !m_in_bullet_time) { + // 点击干员进入子弹时间 + ctrler()->click(oper_rect); return true; } + const auto swipe_oper_task_ptr = Task.get("BattleSwipeOper"); + const auto use_oper_task_ptr = Task.get("BattleUseOper"); + // 拖动到场上 Point placed_point = m_side_tile_info[action.location].pos; @@ -543,9 +544,10 @@ bool asst::BattleProcessTask::oper_deploy(const BattleAction& action, bool only_ int dist = static_cast( Point::distance(placed_point, { oper_rect.x + oper_rect.width / 2, oper_rect.y + oper_rect.height / 2 })); // 1000 是随便取的一个系数,把整数的 pre_delay 转成小数用的 - int duration = static_cast(dist / 800.0 * swipe_oper_task_ptr->pre_delay); - m_ctrler->swipe(oper_rect, placed_rect, duration, false, swipe_oper_task_ptr->special_params.at(1), - swipe_oper_task_ptr->special_params.at(2)); + int duration = static_cast(dist / 1000.0 * swipe_oper_task_ptr->pre_delay); + bool deploy_with_pause = ctrler()->support_swipe_with_pause(); + ctrler()->swipe(oper_rect, placed_rect, duration, false, swipe_oper_task_ptr->special_params.at(1), + swipe_oper_task_ptr->special_params.at(2), deploy_with_pause); sleep(use_oper_task_ptr->post_delay); @@ -564,10 +566,14 @@ bool asst::BattleProcessTask::oper_deploy(const BattleAction& action, bool only_ static const int coeff = Task.get("BattleSwipeOper")->special_params.at(0); Point end_point = placed_point + (direction * coeff); - m_ctrler->swipe(placed_point, end_point, swipe_oper_task_ptr->post_delay); + ctrler()->swipe(placed_point, end_point, swipe_oper_task_ptr->post_delay); sleep(use_oper_task_ptr->post_delay); } + if (deploy_with_pause) { + ctrler()->press_esc(); + } + m_used_opers[iter->first] = BattleDeployInfo { action.location, m_normal_tile_info[action.location].pos, oper_info }; @@ -589,7 +595,7 @@ bool asst::BattleProcessTask::oper_retreat(const BattleAction& action, bool only else { pos = m_normal_tile_info.at(action.location).pos; } - m_ctrler->click(pos); + ctrler()->click(pos); sleep(Task.get("BattleUseOper")->pre_delay); } if (only_pre_process) { @@ -612,7 +618,7 @@ bool asst::BattleProcessTask::use_skill(const BattleAction& action, bool only_pr pos = m_normal_tile_info.at(action.location).pos; } - m_ctrler->click(pos); + ctrler()->click(pos); sleep(Task.get("BattleUseOper")->pre_delay); } @@ -634,7 +640,7 @@ bool asst::BattleProcessTask::wait_to_end(const BattleAction& action) officially_begin_analyzer.set_task_info("BattleOfficiallyBegin"); cv::Mat image; while (!need_exit()) { - image = m_ctrler->get_image(); + image = ctrler()->get_image(); officially_begin_analyzer.set_image(image); if (!officially_begin_analyzer.analyze()) { break; @@ -663,7 +669,7 @@ bool asst::BattleProcessTask::try_possible_skill(const cv::Mat& image) const auto result = find_skill_ready(image(roi), temp); if (result.empty()) continue; - m_ctrler->click(info.pos); + ctrler()->click(info.pos); sleep(Task.get("BattleUseOper")->pre_delay); used |= ProcessTask(*this, { "BattleSkillReadyOnClick" }).set_task_delay(0).run(); if (info.info.skill_usage == BattleSkillUsage::Once) { @@ -689,7 +695,7 @@ void asst::BattleProcessTask::sleep_with_possible_skill(unsigned millisecond) while (!need_exit() && duration < millisecond) { duration = std::chrono::duration_cast(std::chrono::steady_clock::now() - start).count(); - try_possible_skill(m_ctrler->get_image()); + try_possible_skill(ctrler()->get_image()); std::this_thread::yield(); } Log.trace("end of sleep_with_possible_skill", millisecond); diff --git a/src/MeoAssistant/Task/Miscellaneous/BattleProcessTask.h b/src/MaaCore/Task/Miscellaneous/BattleProcessTask.h similarity index 97% rename from src/MeoAssistant/Task/Miscellaneous/BattleProcessTask.h rename to src/MaaCore/Task/Miscellaneous/BattleProcessTask.h index 5f4e0bb9de..d731235979 100644 --- a/src/MeoAssistant/Task/Miscellaneous/BattleProcessTask.h +++ b/src/MaaCore/Task/Miscellaneous/BattleProcessTask.h @@ -3,8 +3,8 @@ #include "Common/AsstBattleDef.h" #include "Common/AsstTypes.h" -#include "Vision/Miscellaneous/BattleImageAnalyzer.h" #include "Config/Miscellaneous/TilePack.h" +#include "Vision/Miscellaneous/BattleImageAnalyzer.h" namespace asst { @@ -14,7 +14,7 @@ namespace asst using AbstractTask::AbstractTask; virtual ~BattleProcessTask() override = default; - void set_stage_name(std::string name); + bool set_stage_name(std::string name); protected: virtual bool _run() override; diff --git a/src/MeoAssistant/Task/Miscellaneous/CreditFightTask.cpp b/src/MaaCore/Task/Miscellaneous/CreditFightTask.cpp similarity index 69% rename from src/MeoAssistant/Task/Miscellaneous/CreditFightTask.cpp rename to src/MaaCore/Task/Miscellaneous/CreditFightTask.cpp index 54a5b85c5c..5ecb90164e 100644 --- a/src/MeoAssistant/Task/Miscellaneous/CreditFightTask.cpp +++ b/src/MaaCore/Task/Miscellaneous/CreditFightTask.cpp @@ -12,20 +12,21 @@ #include "Utils/Ranges.hpp" #include "Utils/WorkingDir.hpp" -asst::CreditFightTask::CreditFightTask(const AsstCallback& callback, void* callback_arg, std::string_view task_chain) - : PackageTask(callback, callback_arg, task_chain) +asst::CreditFightTask::CreditFightTask(const AsstCallback& callback, Assistant* inst, std::string_view task_chain) + : PackageTask(callback, inst, task_chain) { - auto start_up_task_ptr = std::make_shared(m_callback, m_callback_arg, task_chain); - auto stage_navigation_task_ptr = std::make_shared(m_callback, m_callback_arg, task_chain); - auto stop_task_ptr = std::make_shared(m_callback, m_callback_arg, task_chain); - auto copilot_task_ptr = std::make_shared(m_callback, m_callback_arg); + auto start_up_task_ptr = std::make_shared(m_callback, m_inst, task_chain); + auto stage_navigation_task_ptr = std::make_shared(m_callback, m_inst, task_chain); + auto stop_task_ptr = std::make_shared(m_callback, m_inst, task_chain); + auto not_use_prts_task_ptr = std::make_shared(m_callback, m_inst, task_chain); + auto copilot_task_ptr = std::make_shared(m_callback, m_inst); // 开始 start_up_task_ptr->set_tasks({ "StageBegin" }).set_times_limit("GoLastBattle", 0); // 自动战斗 json::value copilot_params = json::object { - { "filename", utils::path_to_utf8_string(ResDir.get() / "resource" / "credit_fight_copilot.json") }, + { "filename", utils::path_to_utf8_string(ResDir.get() / "copilot" / "OF-1_credit_fight.json") }, { "formation", true }, { "support_unit_name", "_RANDOM_" }, }; @@ -34,11 +35,15 @@ asst::CreditFightTask::CreditFightTask(const AsstCallback& callback, void* callb // 关卡导航 stage_navigation_task_ptr->set_stage_name(copilot_task_ptr->get_stage_name()); + // 不使用代理指挥 + not_use_prts_task_ptr->set_tasks({ "NotUsePrts", "Stop" }); + // 战斗结束后 - stop_task_ptr->set_tasks({ "EndOfActionThenStop" }); + stop_task_ptr->set_tasks({ "EndOfActionThenStop", "FightMissionFailedThenStop" }); m_subtasks.emplace_back(start_up_task_ptr); m_subtasks.emplace_back(stage_navigation_task_ptr); + m_subtasks.emplace_back(not_use_prts_task_ptr); m_subtasks.emplace_back(copilot_task_ptr); m_subtasks.emplace_back(stop_task_ptr); } diff --git a/src/MeoAssistant/Task/Miscellaneous/CreditFightTask.h b/src/MaaCore/Task/Miscellaneous/CreditFightTask.h similarity index 74% rename from src/MeoAssistant/Task/Miscellaneous/CreditFightTask.h rename to src/MaaCore/Task/Miscellaneous/CreditFightTask.h index b922039c94..bc4715e84d 100644 --- a/src/MeoAssistant/Task/Miscellaneous/CreditFightTask.h +++ b/src/MaaCore/Task/Miscellaneous/CreditFightTask.h @@ -11,7 +11,7 @@ namespace asst public: inline static constexpr std::string_view TaskType = "CreditFight"; - CreditFightTask(const AsstCallback& callback, void* callback_arg, std::string_view task_chain); + CreditFightTask(const AsstCallback& callback, Assistant* inst, std::string_view task_chain); virtual ~CreditFightTask() override = default; }; } // namespace asst diff --git a/src/MeoAssistant/Task/Miscellaneous/CreditShoppingTask.cpp b/src/MaaCore/Task/Miscellaneous/CreditShoppingTask.cpp similarity index 95% rename from src/MeoAssistant/Task/Miscellaneous/CreditShoppingTask.cpp rename to src/MaaCore/Task/Miscellaneous/CreditShoppingTask.cpp index 0550f99553..5ddd7a1d8e 100644 --- a/src/MeoAssistant/Task/Miscellaneous/CreditShoppingTask.cpp +++ b/src/MaaCore/Task/Miscellaneous/CreditShoppingTask.cpp @@ -32,7 +32,7 @@ asst::CreditShoppingTask& asst::CreditShoppingTask::set_force_shopping_if_credit int asst::CreditShoppingTask::credit_ocr() { - cv::Mat credit_image = m_ctrler->get_image(); + cv::Mat credit_image = ctrler()->get_image(); OcrImageAnalyzer credit_analyzer(credit_image); credit_analyzer.set_task_info("CreditShop-CreditOcr"); credit_analyzer.set_replace(Task.get("NumberOcrReplace")->replace_map); @@ -55,7 +55,7 @@ int asst::CreditShoppingTask::credit_ocr() bool asst::CreditShoppingTask::credit_shopping(bool white_list_enabled, bool credit_ocr_enabled) { - const cv::Mat& image = m_ctrler->get_image(); + const cv::Mat& image = ctrler()->get_image(); CreditShopImageAnalyzer shop_analyzer(image); if (white_list_enabled) { @@ -76,7 +76,7 @@ bool asst::CreditShoppingTask::credit_shopping(bool white_list_enabled, bool cre if (need_exit()) { return false; } - m_ctrler->click(commodity); + ctrler()->click(commodity); ProcessTask(*this, { "CreditShop-BuyIt" }).run(); diff --git a/src/MeoAssistant/Task/Miscellaneous/CreditShoppingTask.h b/src/MaaCore/Task/Miscellaneous/CreditShoppingTask.h similarity index 100% rename from src/MeoAssistant/Task/Miscellaneous/CreditShoppingTask.h rename to src/MaaCore/Task/Miscellaneous/CreditShoppingTask.h diff --git a/src/MeoAssistant/Task/Miscellaneous/DepotRecognitionTask.cpp b/src/MaaCore/Task/Miscellaneous/DepotRecognitionTask.cpp similarity index 97% rename from src/MeoAssistant/Task/Miscellaneous/DepotRecognitionTask.cpp rename to src/MaaCore/Task/Miscellaneous/DepotRecognitionTask.cpp index b4b19105e2..6ac6b72368 100644 --- a/src/MeoAssistant/Task/Miscellaneous/DepotRecognitionTask.cpp +++ b/src/MaaCore/Task/Miscellaneous/DepotRecognitionTask.cpp @@ -28,7 +28,7 @@ bool asst::DepotRecognitionTask::swipe_and_analyze() size_t pre_pos = 0ULL; while (true) { - DepotImageAnalyzer analyzer(m_ctrler->get_image()); + DepotImageAnalyzer analyzer(ctrler()->get_image()); auto future = std::async(std::launch::async, [&]() { swipe(); }); diff --git a/src/MeoAssistant/Task/Miscellaneous/DepotRecognitionTask.h b/src/MaaCore/Task/Miscellaneous/DepotRecognitionTask.h similarity index 100% rename from src/MeoAssistant/Task/Miscellaneous/DepotRecognitionTask.h rename to src/MaaCore/Task/Miscellaneous/DepotRecognitionTask.h diff --git a/src/MeoAssistant/Task/Miscellaneous/GameCrashRestartTaskPlugin.cpp b/src/MaaCore/Task/Miscellaneous/GameCrashRestartTaskPlugin.cpp similarity index 100% rename from src/MeoAssistant/Task/Miscellaneous/GameCrashRestartTaskPlugin.cpp rename to src/MaaCore/Task/Miscellaneous/GameCrashRestartTaskPlugin.cpp diff --git a/src/MeoAssistant/Task/Miscellaneous/GameCrashRestartTaskPlugin.h b/src/MaaCore/Task/Miscellaneous/GameCrashRestartTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Miscellaneous/GameCrashRestartTaskPlugin.h rename to src/MaaCore/Task/Miscellaneous/GameCrashRestartTaskPlugin.h diff --git a/src/MeoAssistant/Task/Miscellaneous/StartGameTaskPlugin.cpp b/src/MaaCore/Task/Miscellaneous/StartGameTaskPlugin.cpp similarity index 87% rename from src/MeoAssistant/Task/Miscellaneous/StartGameTaskPlugin.cpp rename to src/MaaCore/Task/Miscellaneous/StartGameTaskPlugin.cpp index 6584bc5d5e..a94902860e 100644 --- a/src/MeoAssistant/Task/Miscellaneous/StartGameTaskPlugin.cpp +++ b/src/MaaCore/Task/Miscellaneous/StartGameTaskPlugin.cpp @@ -9,7 +9,7 @@ bool StartGameTaskPlugin::_run() if (m_client_type.empty()) { return false; } - return m_ctrler->start_game(m_client_type); + return ctrler()->start_game(m_client_type); } StartGameTaskPlugin& StartGameTaskPlugin::set_client_type(std::string client_type) noexcept diff --git a/src/MeoAssistant/Task/Miscellaneous/StartGameTaskPlugin.h b/src/MaaCore/Task/Miscellaneous/StartGameTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Miscellaneous/StartGameTaskPlugin.h rename to src/MaaCore/Task/Miscellaneous/StartGameTaskPlugin.h diff --git a/src/MeoAssistant/Task/Miscellaneous/StopGameTaskPlugin.cpp b/src/MaaCore/Task/Miscellaneous/StopGameTaskPlugin.cpp similarity index 77% rename from src/MeoAssistant/Task/Miscellaneous/StopGameTaskPlugin.cpp rename to src/MaaCore/Task/Miscellaneous/StopGameTaskPlugin.cpp index 7bcf408c38..11d7ff9a20 100644 --- a/src/MeoAssistant/Task/Miscellaneous/StopGameTaskPlugin.cpp +++ b/src/MaaCore/Task/Miscellaneous/StopGameTaskPlugin.cpp @@ -6,5 +6,5 @@ using namespace asst; bool StopGameTaskPlugin::_run() { - return m_ctrler->stop_game(); + return ctrler()->stop_game(); } diff --git a/src/MeoAssistant/Task/Miscellaneous/StopGameTaskPlugin.h b/src/MaaCore/Task/Miscellaneous/StopGameTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Miscellaneous/StopGameTaskPlugin.h rename to src/MaaCore/Task/Miscellaneous/StopGameTaskPlugin.h diff --git a/src/MeoAssistant/Task/PackageTask.cpp b/src/MaaCore/Task/PackageTask.cpp similarity index 60% rename from src/MeoAssistant/Task/PackageTask.cpp rename to src/MaaCore/Task/PackageTask.cpp index 168d264a77..0ce06396ed 100644 --- a/src/MeoAssistant/Task/PackageTask.cpp +++ b/src/MaaCore/Task/PackageTask.cpp @@ -23,7 +23,7 @@ bool asst::PackageTask::run() continue; } - task_ptr->set_exit_flag(m_exit_flag).set_ctrler(m_ctrler).set_status(m_status).set_task_id(m_task_id); + task_ptr->set_task_id(m_task_id); if (!task_ptr->run() && !task_ptr->get_ignore_error()) { return false; @@ -36,15 +36,6 @@ bool asst::PackageTask::run() return true; } -asst::AbstractTask& asst::PackageTask::set_exit_flag(bool* exit_flag) noexcept -{ - AbstractTask::set_exit_flag(exit_flag); - for (auto&& sub : m_subtasks) { - sub->set_exit_flag(exit_flag); - } - return *this; -} - asst::AbstractTask& asst::PackageTask::set_retry_times(int times) noexcept { AbstractTask::set_retry_times(times); @@ -54,24 +45,6 @@ asst::AbstractTask& asst::PackageTask::set_retry_times(int times) noexcept return *this; } -asst::AbstractTask& asst::PackageTask::set_ctrler(std::shared_ptr ctrler) noexcept -{ - AbstractTask::set_ctrler(ctrler); - for (auto&& sub : m_subtasks) { - sub->set_ctrler(ctrler); - } - return *this; -} - -asst::AbstractTask& asst::PackageTask::set_status(std::shared_ptr status) noexcept -{ - AbstractTask::set_status(status); - for (auto&& sub : m_subtasks) { - sub->set_status(status); - } - return *this; -} - asst::AbstractTask& asst::PackageTask::set_task_id(int task_id) noexcept { AbstractTask::set_task_id(task_id); diff --git a/src/MeoAssistant/Task/PackageTask.h b/src/MaaCore/Task/PackageTask.h similarity index 70% rename from src/MeoAssistant/Task/PackageTask.h rename to src/MaaCore/Task/PackageTask.h index bd3e23b3ee..508e6bcefc 100644 --- a/src/MeoAssistant/Task/PackageTask.h +++ b/src/MaaCore/Task/PackageTask.h @@ -19,10 +19,7 @@ namespace asst virtual bool run() override; - virtual AbstractTask& set_exit_flag(bool* exit_flag) noexcept override; virtual AbstractTask& set_retry_times(int times) noexcept override; - virtual AbstractTask& set_ctrler(std::shared_ptr ctrler) noexcept override; - virtual AbstractTask& set_status(std::shared_ptr status) noexcept override; virtual AbstractTask& set_task_id(int task_id) noexcept override; protected: diff --git a/src/MeoAssistant/Task/ProcessTask.cpp b/src/MaaCore/Task/ProcessTask.cpp similarity index 96% rename from src/MeoAssistant/Task/ProcessTask.cpp rename to src/MaaCore/Task/ProcessTask.cpp index e7d7218023..8936f9ce66 100644 --- a/src/MeoAssistant/Task/ProcessTask.cpp +++ b/src/MaaCore/Task/ProcessTask.cpp @@ -6,12 +6,12 @@ #include -#include "Controller.h" -#include "Vision/Miscellaneous/ProcessTaskImageAnalyzer.h" #include "Config/GeneralConfig.h" #include "Config/TaskData.h" +#include "Controller.h" #include "Status.h" #include "Utils/Logger.hpp" +#include "Vision/Miscellaneous/ProcessTaskImageAnalyzer.h" using namespace asst; @@ -112,10 +112,8 @@ bool ProcessTask::_run() m_cur_task_ptr = front_task_ptr; } else { - const auto image = m_ctrler->get_image(); - ProcessTaskImageAnalyzer analyzer(image, m_cur_tasks_name); - - analyzer.set_status(m_status); + const auto image = ctrler()->get_image(); + ProcessTaskImageAnalyzer analyzer(image, m_cur_tasks_name, m_inst); if (!analyzer.analyze()) { return false; @@ -179,7 +177,7 @@ bool ProcessTask::_run() exec_click_task(rect); break; case ProcessTaskAction::ClickRand: { - auto&& [width, height] = m_ctrler->get_scale_size(); + auto&& [width, height] = ctrler()->get_scale_size(); const Rect full_rect(0, 0, width, height); exec_click_task(full_rect); } break; @@ -200,7 +198,7 @@ bool ProcessTask::_run() break; } - m_status->set_number(Status::ProcessTaskLastTimePrefix + cur_name, time(nullptr)); + status()->set_number(Status::ProcessTaskLastTimePrefix + cur_name, time(nullptr)); // 减少其他任务的执行次数 // 例如,进入吃理智药的界面了,相当于上一次点蓝色开始行动没生效 @@ -315,11 +313,11 @@ json::value asst::ProcessTask::basic_info() const void ProcessTask::exec_click_task(const Rect& matched_rect) { - m_ctrler->click(matched_rect); + ctrler()->click(matched_rect); } void asst::ProcessTask::exec_swipe_task(const Rect& r1, const Rect& r2, int duration, bool extra_swipe, double slope_in, double slope_out) { - m_ctrler->swipe(r1, r2, duration, extra_swipe, slope_in, slope_out); + ctrler()->swipe(r1, r2, duration, extra_swipe, slope_in, slope_out); } diff --git a/src/MeoAssistant/Task/ProcessTask.h b/src/MaaCore/Task/ProcessTask.h similarity index 100% rename from src/MeoAssistant/Task/ProcessTask.h rename to src/MaaCore/Task/ProcessTask.h diff --git a/src/MeoAssistant/Task/ReportDataTask.cpp b/src/MaaCore/Task/ReportDataTask.cpp similarity index 94% rename from src/MeoAssistant/Task/ReportDataTask.cpp rename to src/MaaCore/Task/ReportDataTask.cpp index 231f0710e3..3e91c30c36 100644 --- a/src/MeoAssistant/Task/ReportDataTask.cpp +++ b/src/MaaCore/Task/ReportDataTask.cpp @@ -12,11 +12,10 @@ #include #include -asst::ReportDataTask::~ReportDataTask() -{ - static bool Exit = true; - m_exit_flag = &Exit; -} +asst::ReportDataTask::ReportDataTask(const TaskCallback& task_callback, AbstractTask* upper_task) + : AbstractTask(nullptr, nullptr, upper_task->get_task_chain()), m_task_callback(task_callback), + m_upper_task(upper_task) +{} asst::ReportDataTask& asst::ReportDataTask::set_report_type(ReportType type) { @@ -59,6 +58,13 @@ bool asst::ReportDataTask::_run() return true; } +void asst::ReportDataTask::callback(AsstMsg msg, const json::value& detail) +{ + if (m_task_callback) { + m_task_callback(msg, detail, m_upper_task); + } +} + void asst::ReportDataTask::report_to_penguin() { using namespace std::chrono; diff --git a/src/MeoAssistant/Task/ReportDataTask.h b/src/MaaCore/Task/ReportDataTask.h similarity index 69% rename from src/MeoAssistant/Task/ReportDataTask.h rename to src/MaaCore/Task/ReportDataTask.h index 7cc4382d0d..212922c6af 100644 --- a/src/MeoAssistant/Task/ReportDataTask.h +++ b/src/MaaCore/Task/ReportDataTask.h @@ -11,16 +11,21 @@ namespace asst { enum class ReportType { - Invaild, + Invalid, PenguinStats, YituliuBigData, }; + using TaskCallback = std::function; + class ReportDataTask : public AbstractTask { public: - using AbstractTask::AbstractTask; - virtual ~ReportDataTask() override; + ReportDataTask(const TaskCallback& task_callback, AbstractTask* upper_task); + ReportDataTask(const ReportDataTask&) = default; + ReportDataTask(ReportDataTask&&) = default; + + virtual ~ReportDataTask() override = default; ReportDataTask& set_report_type(ReportType type); @@ -31,6 +36,7 @@ namespace asst using HttpResponsePred = std::function; virtual bool _run() override; + virtual void callback(AsstMsg msg, const json::value& detail) override; void report_to_penguin(); void report_to_yituliu(); @@ -43,9 +49,12 @@ namespace asst }, bool callback_on_failure = true); - ReportType m_report_type = ReportType::Invaild; + ReportType m_report_type = ReportType::Invalid; std::string m_body; std::string m_extra_param; std::vector> m_upload_pending; + + TaskCallback m_task_callback = nullptr; + AbstractTask* m_upper_task = nullptr; }; } // namespace asst diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeBattleTaskPlugin.cpp b/src/MaaCore/Task/Roguelike/RoguelikeBattleTaskPlugin.cpp similarity index 96% rename from src/MeoAssistant/Task/Roguelike/RoguelikeBattleTaskPlugin.cpp rename to src/MaaCore/Task/Roguelike/RoguelikeBattleTaskPlugin.cpp index bb62d83bf6..d17187b198 100644 --- a/src/MeoAssistant/Task/Roguelike/RoguelikeBattleTaskPlugin.cpp +++ b/src/MaaCore/Task/Roguelike/RoguelikeBattleTaskPlugin.cpp @@ -27,7 +27,7 @@ bool asst::RoguelikeBattleTaskPlugin::verify(AsstMsg msg, const json::value& det return false; } - auto roguelike_name_opt = m_status->get_properties(Status::RoguelikeTheme); + auto roguelike_name_opt = status()->get_properties(Status::RoguelikeTheme); if (!roguelike_name_opt) { Log.error("Roguelike name doesn't exist!"); return false; @@ -123,7 +123,7 @@ bool asst::RoguelikeBattleTaskPlugin::get_stage_info() } std::this_thread::yield(); - OcrWithPreprocessImageAnalyzer name_analyzer(m_ctrler->get_image()); + OcrWithPreprocessImageAnalyzer name_analyzer(ctrler()->get_image()); name_analyzer.set_task_info(stage_name_task_ptr); if (!name_analyzer.analyze()) { continue; @@ -356,7 +356,7 @@ bool asst::RoguelikeBattleTaskPlugin::auto_battle() m_need_clear_tiles.pop(); } - const cv::Mat& image = m_ctrler->get_image(); + const cv::Mat& image = ctrler()->get_image(); if (!m_first_deploy && try_possible_skill(image)) { return true; } @@ -429,9 +429,9 @@ bool asst::RoguelikeBattleTaskPlugin::auto_battle() if ((!oper.cooling) || oper.role == BattleRole::Drone) { continue; } - m_ctrler->click(oper.rect); + ctrler()->click(oper.rect); sleep(use_oper_task_ptr->pre_delay); - const cv::Mat& new_image = m_ctrler->get_image(); + const cv::Mat& new_image = ctrler()->get_image(); OcrWithPreprocessImageAnalyzer oper_name_analyzer(new_image); oper_name_analyzer.set_task_info("BattleOperName"); @@ -641,9 +641,9 @@ bool asst::RoguelikeBattleTaskPlugin::auto_battle() const auto& oper = cur_opers.at(i - offset); if (oper.role == BattleRole::Drone) { clicked_drone = true; - m_ctrler->click(oper.rect); + ctrler()->click(oper.rect); sleep(use_oper_task_ptr->pre_delay); - const cv::Mat& new_image = m_ctrler->get_image(); + const cv::Mat& new_image = ctrler()->get_image(); OcrWithPreprocessImageAnalyzer oper_name_analyzer(new_image); oper_name_analyzer.set_task_info("BattleOperName"); @@ -668,10 +668,10 @@ bool asst::RoguelikeBattleTaskPlugin::auto_battle() } } - m_ctrler->click(opt_oper.rect); + ctrler()->click(opt_oper.rect); sleep(use_oper_task_ptr->pre_delay); - OcrWithPreprocessImageAnalyzer oper_name_analyzer(m_ctrler->get_image()); + OcrWithPreprocessImageAnalyzer oper_name_analyzer(ctrler()->get_image()); oper_name_analyzer.set_task_info("BattleOperName"); oper_name_analyzer.set_replace(Task.get("CharsNameOcrReplace")->replace_map); @@ -723,16 +723,17 @@ bool asst::RoguelikeBattleTaskPlugin::auto_battle() int dist = static_cast(Point::distance( placed_point, { opt_oper.rect.x + opt_oper.rect.width / 2, opt_oper.rect.y + opt_oper.rect.height / 2 })); // 1000 是随便取的一个系数,把整数的 pre_delay 转成小数用的 - int duration = static_cast(dist / 800.0 * swipe_oper_task_ptr->pre_delay); - m_ctrler->swipe(opt_oper.rect, placed_rect, duration, false, swipe_oper_task_ptr->special_params.at(1), - swipe_oper_task_ptr->special_params.at(2)); + int duration = static_cast(dist / 1000.0 * swipe_oper_task_ptr->pre_delay); + bool deploy_with_pause = ctrler()->support_swipe_with_pause(); + ctrler()->swipe(opt_oper.rect, placed_rect, duration, false, swipe_oper_task_ptr->special_params.at(1), + swipe_oper_task_ptr->special_params.at(2), deploy_with_pause); sleep(use_oper_task_ptr->post_delay); // 将方向转换为实际的 swipe end 坐标点 if (direction != Point::zero()) { static const int coeff = swipe_oper_task_ptr->special_params.at(0); Point end_point = placed_point + (direction * coeff); - m_ctrler->swipe(placed_point, end_point, swipe_oper_task_ptr->post_delay); + ctrler()->swipe(placed_point, end_point, swipe_oper_task_ptr->post_delay); sleep(use_oper_task_ptr->post_delay); } @@ -746,6 +747,9 @@ bool asst::RoguelikeBattleTaskPlugin::auto_battle() m_need_clear_tiles.emplace(now_time + std::chrono::seconds(35), placed_loc); } } + if (deploy_with_pause) { + ctrler()->press_esc(); + } Log.info("Try to deploy oper", opt_oper.name); m_opers_used = true; @@ -802,7 +806,7 @@ bool asst::RoguelikeBattleTaskPlugin::auto_battle() } m_is_cur_urgent = true; m_cur_home_index = m_next_urgent_index.top(); - Log.info("Enter urgent situtation"); + Log.info("Enter urgent situation"); m_next_urgent_index.pop(); } Log.info("To path", m_cur_home_index); @@ -817,7 +821,7 @@ bool asst::RoguelikeBattleTaskPlugin::speed_up() bool asst::RoguelikeBattleTaskPlugin::use_skill(const Rect& rect) { - m_ctrler->click(rect); + ctrler()->click(rect); sleep(Task.get("BattleUseOper")->pre_delay); ProcessTask task(*this, { "BattleUseSkillJustClick" }); @@ -827,7 +831,7 @@ bool asst::RoguelikeBattleTaskPlugin::use_skill(const Rect& rect) bool asst::RoguelikeBattleTaskPlugin::retreat(const Point& point) { - m_ctrler->click(point); + ctrler()->click(point); sleep(Task.get("BattleUseOper")->pre_delay); return ProcessTask(*this, { "BattleOperRetreatJustClick" }).run(); @@ -886,8 +890,8 @@ void asst::RoguelikeBattleTaskPlugin::clear() m_melee_full = false; m_ranged_full = false; - for (auto& [key, status] : m_restore_status) { - m_status->set_number(key, status); + for (auto& [key, status_value] : m_restore_status) { + status()->set_number(key, status_value); } m_restore_status.clear(); } @@ -907,7 +911,7 @@ bool asst::RoguelikeBattleTaskPlugin::try_possible_skill(const cv::Mat& image) for (auto& [loc, oper_name] : m_used_tiles) { std::string status_key = Status::RoguelikeSkillUsagePrefix + oper_name; auto usage = BattleSkillUsage::Possibly; - auto usage_opt = m_status->get_number(status_key); + auto usage_opt = status()->get_number(status_key); if (usage_opt) { usage = static_cast(usage_opt.value()); } @@ -925,7 +929,7 @@ bool asst::RoguelikeBattleTaskPlugin::try_possible_skill(const cv::Mat& image) Log.trace(result.front().second); - m_ctrler->click(pos_rect); + ctrler()->click(pos_rect); sleep(Task.get("BattleUseOper")->pre_delay); bool ret = ProcessTask(*this, { "BattleSkillReadyOnClick" }).set_retry_times(2).run(); if (!ret) { @@ -933,7 +937,7 @@ bool asst::RoguelikeBattleTaskPlugin::try_possible_skill(const cv::Mat& image) } used |= ret; if (usage == BattleSkillUsage::Once) { - m_status->set_number(status_key, static_cast(BattleSkillUsage::OnceUsed)); + status()->set_number(status_key, static_cast(BattleSkillUsage::OnceUsed)); m_restore_status[status_key] = static_cast(BattleSkillUsage::Once); } } @@ -975,7 +979,7 @@ bool asst::RoguelikeBattleTaskPlugin::wait_start() officially_begin_analyzer.set_task_info("BattleOfficiallyBegin"); cv::Mat image; while (!need_exit() && !check_time()) { - image = m_ctrler->get_image(); + image = ctrler()->get_image(); officially_begin_analyzer.set_image(image); if (officially_begin_analyzer.analyze()) { break; @@ -986,7 +990,7 @@ bool asst::RoguelikeBattleTaskPlugin::wait_start() BattleImageAnalyzer oper_analyzer; oper_analyzer.set_target(BattleImageAnalyzer::Target::Oper); while (!need_exit() && !check_time()) { - image = m_ctrler->get_image(); + image = ctrler()->get_image(); oper_analyzer.set_image(image); if (oper_analyzer.analyze()) { break; @@ -1054,7 +1058,7 @@ std::vector asst::RoguelikeBattleTaskPlugin::available_locations(Ba asst::BattleAttackRange asst::RoguelikeBattleTaskPlugin::get_attack_range(const BattleRealTimeOper& oper) { - int64_t elite = m_status->get_number(Status::RoguelikeCharElitePrefix + oper.name).value_or(0); + int64_t elite = status()->get_number(Status::RoguelikeCharElitePrefix + oper.name).value_or(0); BattleAttackRange right_attack_range = BattleData.get_range(oper.name, elite); if (right_attack_range == BattleDataConfig::EmptyRange) { diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeBattleTaskPlugin.h b/src/MaaCore/Task/Roguelike/RoguelikeBattleTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Roguelike/RoguelikeBattleTaskPlugin.h rename to src/MaaCore/Task/Roguelike/RoguelikeBattleTaskPlugin.h diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeControlTaskPlugin.cpp b/src/MaaCore/Task/Roguelike/RoguelikeControlTaskPlugin.cpp similarity index 94% rename from src/MeoAssistant/Task/Roguelike/RoguelikeControlTaskPlugin.cpp rename to src/MaaCore/Task/Roguelike/RoguelikeControlTaskPlugin.cpp index 9efa620088..d271b6dc8b 100644 --- a/src/MeoAssistant/Task/Roguelike/RoguelikeControlTaskPlugin.cpp +++ b/src/MaaCore/Task/Roguelike/RoguelikeControlTaskPlugin.cpp @@ -13,7 +13,7 @@ bool asst::RoguelikeControlTaskPlugin::verify(AsstMsg msg, const json::value& de return false; } - auto roguelike_name_opt = m_status->get_properties(Status::RoguelikeTheme); + auto roguelike_name_opt = status()->get_properties(Status::RoguelikeTheme); if (!roguelike_name_opt) { Log.error("Roguelike name doesn't exist!"); return false; diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeControlTaskPlugin.h b/src/MaaCore/Task/Roguelike/RoguelikeControlTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Roguelike/RoguelikeControlTaskPlugin.h rename to src/MaaCore/Task/Roguelike/RoguelikeControlTaskPlugin.h diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeCustomStartTaskPlugin.cpp b/src/MaaCore/Task/Roguelike/RoguelikeCustomStartTaskPlugin.cpp similarity index 93% rename from src/MeoAssistant/Task/Roguelike/RoguelikeCustomStartTaskPlugin.cpp rename to src/MaaCore/Task/Roguelike/RoguelikeCustomStartTaskPlugin.cpp index a3387555e7..4d0d1c5d59 100644 --- a/src/MeoAssistant/Task/Roguelike/RoguelikeCustomStartTaskPlugin.cpp +++ b/src/MaaCore/Task/Roguelike/RoguelikeCustomStartTaskPlugin.cpp @@ -14,7 +14,7 @@ bool asst::RoguelikeCustomStartTaskPlugin::verify(AsstMsg msg, const json::value return false; } - auto roguelike_name_opt = m_status->get_properties(Status::RoguelikeTheme); + auto roguelike_name_opt = status()->get_properties(Status::RoguelikeTheme); if (!roguelike_name_opt) { Log.error("Roguelike name doesn't exist!"); return false; @@ -78,7 +78,7 @@ bool asst::RoguelikeCustomStartTaskPlugin::hijack_squad() { constexpr size_t SwipeTimes = 7; for (size_t i = 0; i != SwipeTimes; ++i) { - auto image = m_ctrler->get_image(); + auto image = ctrler()->get_image(); OcrImageAnalyzer analyzer(image); analyzer.set_task_info("RoguelikeCustom-HijackSquad"); analyzer.set_required({ m_customs[RoguelikeCustomType::Squad] }); @@ -89,7 +89,7 @@ bool asst::RoguelikeCustomStartTaskPlugin::hijack_squad() continue; } const auto& rect = analyzer.get_result().front().rect; - m_ctrler->click(rect); + ctrler()->click(rect); return true; } ProcessTask(*this, { "SwipeToTheLeft" }).run(); @@ -98,7 +98,7 @@ bool asst::RoguelikeCustomStartTaskPlugin::hijack_squad() bool asst::RoguelikeCustomStartTaskPlugin::hijack_roles() { - auto image = m_ctrler->get_image(); + auto image = ctrler()->get_image(); OcrImageAnalyzer analyzer(image); analyzer.set_task_info("RoguelikeCustom-HijackRoles"); analyzer.set_required({ m_customs[RoguelikeCustomType::Roles] }); @@ -107,7 +107,7 @@ bool asst::RoguelikeCustomStartTaskPlugin::hijack_roles() return false; } const auto& rect = analyzer.get_result().front().rect; - m_ctrler->click(rect); + ctrler()->click(rect); return true; } @@ -129,7 +129,7 @@ bool asst::RoguelikeCustomStartTaskPlugin::hijack_core_char() // select role const std::string& role_ocr_name = role_iter->second; Log.info("role", role_ocr_name); - auto image = m_ctrler->get_image(); + auto image = ctrler()->get_image(); OcrImageAnalyzer analyzer(image); analyzer.set_task_info("RoguelikeCustom-HijackCoChar"); analyzer.set_required({ role_ocr_name }); @@ -137,10 +137,10 @@ bool asst::RoguelikeCustomStartTaskPlugin::hijack_core_char() return false; } const auto& role_rect = analyzer.get_result().front().rect; - m_ctrler->click(role_rect); + ctrler()->click(role_rect); sleep(Task.get("RoguelikeCustom-HijackCoChar")->pre_delay); - m_status->set_str(Status::RoguelikeCoreChar, char_name); + status()->set_str(Status::RoguelikeCoreChar, char_name); return true; } diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeCustomStartTaskPlugin.h b/src/MaaCore/Task/Roguelike/RoguelikeCustomStartTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Roguelike/RoguelikeCustomStartTaskPlugin.h rename to src/MaaCore/Task/Roguelike/RoguelikeCustomStartTaskPlugin.h diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeDebugTaskPlugin.cpp b/src/MaaCore/Task/Roguelike/RoguelikeDebugTaskPlugin.cpp similarity index 94% rename from src/MeoAssistant/Task/Roguelike/RoguelikeDebugTaskPlugin.cpp rename to src/MaaCore/Task/Roguelike/RoguelikeDebugTaskPlugin.cpp index c610dbb468..2b7d625c4a 100644 --- a/src/MeoAssistant/Task/Roguelike/RoguelikeDebugTaskPlugin.cpp +++ b/src/MaaCore/Task/Roguelike/RoguelikeDebugTaskPlugin.cpp @@ -14,7 +14,7 @@ bool asst::RoguelikeDebugTaskPlugin::verify(AsstMsg msg, const json::value& deta return true; } - auto roguelike_name_opt = m_status->get_properties(Status::RoguelikeTheme); + auto roguelike_name_opt = status()->get_properties(Status::RoguelikeTheme); if (!roguelike_name_opt) { Log.error("Roguelike name doesn't exist!"); return false; diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeDebugTaskPlugin.h b/src/MaaCore/Task/Roguelike/RoguelikeDebugTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Roguelike/RoguelikeDebugTaskPlugin.h rename to src/MaaCore/Task/Roguelike/RoguelikeDebugTaskPlugin.h diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeFormationTaskPlugin.cpp b/src/MaaCore/Task/Roguelike/RoguelikeFormationTaskPlugin.cpp similarity index 91% rename from src/MeoAssistant/Task/Roguelike/RoguelikeFormationTaskPlugin.cpp rename to src/MaaCore/Task/Roguelike/RoguelikeFormationTaskPlugin.cpp index e3af4de6be..e326433889 100644 --- a/src/MeoAssistant/Task/Roguelike/RoguelikeFormationTaskPlugin.cpp +++ b/src/MaaCore/Task/Roguelike/RoguelikeFormationTaskPlugin.cpp @@ -15,7 +15,7 @@ bool asst::RoguelikeFormationTaskPlugin::verify(AsstMsg msg, const json::value& return false; } - auto roguelike_name_opt = m_status->get_properties(Status::RoguelikeTheme); + auto roguelike_name_opt = status()->get_properties(Status::RoguelikeTheme); if (!roguelike_name_opt) { Log.error("Roguelike name doesn't exist!"); return false; @@ -36,7 +36,7 @@ bool asst::RoguelikeFormationTaskPlugin::verify(AsstMsg msg, const json::value& bool asst::RoguelikeFormationTaskPlugin::_run() { - RoguelikeFormationImageAnalyzer formation_analyzer(m_ctrler->get_image()); + RoguelikeFormationImageAnalyzer formation_analyzer(ctrler()->get_image()); if (!formation_analyzer.analyze()) { return false; } @@ -48,7 +48,7 @@ bool asst::RoguelikeFormationTaskPlugin::_run() ++pre_selected; continue; } - m_ctrler->click(oper.rect); + ctrler()->click(oper.rect); ++select_count; } Log.info(__FUNCTION__, "pre_selected: ", pre_selected, " select: ", select_count); @@ -63,7 +63,7 @@ bool asst::RoguelikeFormationTaskPlugin::_run() } if (!reselect && select_count != 0) { sleep(Task.get("RoguelikeQuickFormationDelay")->post_delay); - formation_analyzer.set_image(m_ctrler->get_image()); + formation_analyzer.set_image(ctrler()->get_image()); if (!formation_analyzer.analyze()) { Log.warn("RoguelikeFormationImageAnalyzer re analyze failed"); @@ -101,7 +101,7 @@ void asst::RoguelikeFormationTaskPlugin::clear_and_reselect() size_t asst::RoguelikeFormationTaskPlugin::analyze_and_select() { - RoguelikeFormationImageAnalyzer formation_analyzer(m_ctrler->get_image()); + RoguelikeFormationImageAnalyzer formation_analyzer(ctrler()->get_image()); if (!formation_analyzer.analyze()) { return false; } @@ -111,7 +111,7 @@ size_t asst::RoguelikeFormationTaskPlugin::analyze_and_select() if (oper.selected) { continue; } - m_ctrler->click(oper.rect); + ctrler()->click(oper.rect); ++select_count; } return select_count; diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeFormationTaskPlugin.h b/src/MaaCore/Task/Roguelike/RoguelikeFormationTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Roguelike/RoguelikeFormationTaskPlugin.h rename to src/MaaCore/Task/Roguelike/RoguelikeFormationTaskPlugin.h diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeRecruitTaskPlugin.cpp b/src/MaaCore/Task/Roguelike/RoguelikeRecruitTaskPlugin.cpp similarity index 94% rename from src/MeoAssistant/Task/Roguelike/RoguelikeRecruitTaskPlugin.cpp rename to src/MaaCore/Task/Roguelike/RoguelikeRecruitTaskPlugin.cpp index 7bc131e475..48a8b85c32 100644 --- a/src/MeoAssistant/Task/Roguelike/RoguelikeRecruitTaskPlugin.cpp +++ b/src/MaaCore/Task/Roguelike/RoguelikeRecruitTaskPlugin.cpp @@ -15,7 +15,7 @@ bool asst::RoguelikeRecruitTaskPlugin::verify(AsstMsg msg, const json::value& de return false; } - auto roguelike_name_opt = m_status->get_properties(Status::RoguelikeTheme); + auto roguelike_name_opt = status()->get_properties(Status::RoguelikeTheme); if (!roguelike_name_opt) { Log.error("Roguelike name doesn't exist!"); return false; @@ -62,11 +62,11 @@ bool asst::RoguelikeRecruitTaskPlugin::_run() recruited = true; }; - bool team_full_without_rookie = m_status->get_number(Status::RoguelikeTeamFullWithoutRookie).value_or(0); + bool team_full_without_rookie = status()->get_number(Status::RoguelikeTeamFullWithoutRookie).value_or(0); Log.info("team_full_without_rookie", team_full_without_rookie); // 编队信息 (已有角色) - std::string str_chars_info = m_status->get_str(Status::RoguelikeCharOverview).value_or(json::value().to_string()); + std::string str_chars_info = status()->get_str(Status::RoguelikeCharOverview).value_or(json::value().to_string()); json::value json_chars_info = json::parse(str_chars_info).value_or(json::value()); const auto& chars_map = json_chars_info.as_object(); std::unordered_map team_roles; @@ -94,7 +94,7 @@ bool asst::RoguelikeRecruitTaskPlugin::_run() if (need_exit()) { return false; } - auto image = m_ctrler->get_image(); + auto image = ctrler()->get_image(); RoguelikeRecruitImageAnalyzer analyzer(image); if (!analyzer.analyze()) { Log.trace(__FUNCTION__, "| Page", i, "recruit list analyse failed"); @@ -136,7 +136,7 @@ bool asst::RoguelikeRecruitTaskPlugin::_run() // 查询招募配置 auto& recruit_info = RoguelikeRecruit.get_oper_info( - m_status->get_properties(Status::RoguelikeTheme).value(), oper_info.name); + status()->get_properties(Status::RoguelikeTheme).value(), oper_info.name); if (recruit_info.name.empty()) { continue; } @@ -189,7 +189,7 @@ bool asst::RoguelikeRecruitTaskPlugin::_run() } role_num = team_roles[oper_role]; const auto role_info = RoguelikeRecruit.get_role_info( - m_status->get_properties(Status::RoguelikeTheme).value(), oper_role); + status()->get_properties(Status::RoguelikeTheme).value(), oper_role); for (const auto& offset_pair : ranges::reverse_view(role_info)) { if (role_num >= offset_pair.first) { priority += offset_pair.second; @@ -250,7 +250,7 @@ bool asst::RoguelikeRecruitTaskPlugin::_run() swipe_to_the_left_of_operlist(i + 1); } - auto image = m_ctrler->get_image(); + auto image = ctrler()->get_image(); RoguelikeRecruitImageAnalyzer analyzer(image); if (!analyzer.analyze()) { Log.error(__FUNCTION__, "| Random recruitment analyse failed"); @@ -323,7 +323,7 @@ bool asst::RoguelikeRecruitTaskPlugin::check_char(const std::string& char_name, if (need_exit()) { return false; } - auto image = m_ctrler->get_image(); + auto image = ctrler()->get_image(); RoguelikeRecruitImageAnalyzer analyzer(image); // 只处理识别成功的情况,失败(无任何结果)时继续滑动 @@ -374,11 +374,11 @@ bool asst::RoguelikeRecruitTaskPlugin::check_core_char() { LogTraceFunction; - auto core_opt = m_status->get_str(Status::RoguelikeCoreChar); + auto core_opt = status()->get_str(Status::RoguelikeCoreChar); if (!core_opt || core_opt->empty()) { return false; } - m_status->set_str(Status::RoguelikeCoreChar, ""); + status()->set_str(Status::RoguelikeCoreChar, ""); return check_char(core_opt.value()); } @@ -386,18 +386,18 @@ void asst::RoguelikeRecruitTaskPlugin::select_oper(const BattleRecruitOperInfo& { Log.info(__FUNCTION__, "| Choose oper:", oper.name, "( elite", oper.elite, "level", oper.level, ")"); - m_ctrler->click(oper.rect); + ctrler()->click(oper.rect); - m_status->set_number(Status::RoguelikeCharElitePrefix + oper.name, oper.elite); - m_status->set_number(Status::RoguelikeCharLevelPrefix + oper.name, oper.level); + status()->set_number(Status::RoguelikeCharElitePrefix + oper.name, oper.elite); + status()->set_number(Status::RoguelikeCharLevelPrefix + oper.name, oper.level); - std::string overview_str = m_status->get_str(Status::RoguelikeCharOverview).value_or(json::value().to_string()); + std::string overview_str = status()->get_str(Status::RoguelikeCharOverview).value_or(json::value().to_string()); json::value overview = json::parse(overview_str).value_or(json::value()); overview[oper.name] = json::object { { "elite", oper.elite }, { "level", oper.level }, }; - m_status->set_str(Status::RoguelikeCharOverview, overview.to_string()); + status()->set_str(Status::RoguelikeCharOverview, overview.to_string()); } void asst::RoguelikeRecruitTaskPlugin::swipe_to_the_left_of_operlist(int loop_times) diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeRecruitTaskPlugin.h b/src/MaaCore/Task/Roguelike/RoguelikeRecruitTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Roguelike/RoguelikeRecruitTaskPlugin.h rename to src/MaaCore/Task/Roguelike/RoguelikeRecruitTaskPlugin.h diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeResetTaskPlugin.cpp b/src/MaaCore/Task/Roguelike/RoguelikeResetTaskPlugin.cpp similarity index 89% rename from src/MeoAssistant/Task/Roguelike/RoguelikeResetTaskPlugin.cpp rename to src/MaaCore/Task/Roguelike/RoguelikeResetTaskPlugin.cpp index cf0b38ec6f..1130fe15e9 100644 --- a/src/MeoAssistant/Task/Roguelike/RoguelikeResetTaskPlugin.cpp +++ b/src/MaaCore/Task/Roguelike/RoguelikeResetTaskPlugin.cpp @@ -9,7 +9,7 @@ bool asst::RoguelikeResetTaskPlugin::verify(AsstMsg msg, const json::value& deta return false; } - auto roguelike_name_opt = m_status->get_properties(Status::RoguelikeTheme); + auto roguelike_name_opt = status()->get_properties(Status::RoguelikeTheme); if (!roguelike_name_opt) { Log.error("Roguelike name doesn't exist!"); return false; @@ -31,7 +31,7 @@ bool asst::RoguelikeResetTaskPlugin::verify(AsstMsg msg, const json::value& deta bool asst::RoguelikeResetTaskPlugin::_run() { // 简单粗暴,后面如果多任务间有联动可能要改改 - m_status->clear_number(); - m_status->clear_str(); + status()->clear_number(); + status()->clear_str(); return true; } diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeResetTaskPlugin.h b/src/MaaCore/Task/Roguelike/RoguelikeResetTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Roguelike/RoguelikeResetTaskPlugin.h rename to src/MaaCore/Task/Roguelike/RoguelikeResetTaskPlugin.h diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeShoppingTaskPlugin.cpp b/src/MaaCore/Task/Roguelike/RoguelikeShoppingTaskPlugin.cpp similarity index 93% rename from src/MeoAssistant/Task/Roguelike/RoguelikeShoppingTaskPlugin.cpp rename to src/MaaCore/Task/Roguelike/RoguelikeShoppingTaskPlugin.cpp index a3e08ad661..c50ba68e44 100644 --- a/src/MeoAssistant/Task/Roguelike/RoguelikeShoppingTaskPlugin.cpp +++ b/src/MaaCore/Task/Roguelike/RoguelikeShoppingTaskPlugin.cpp @@ -14,7 +14,7 @@ bool asst::RoguelikeShoppingTaskPlugin::verify(AsstMsg msg, const json::value& d return false; } - auto roguelike_name_opt = m_status->get_properties(Status::RoguelikeTheme); + auto roguelike_name_opt = status()->get_properties(Status::RoguelikeTheme); if (!roguelike_name_opt) { Log.error("Roguelike name doesn't exist!"); return false; @@ -40,14 +40,14 @@ bool asst::RoguelikeShoppingTaskPlugin::_run() OcrWithFlagTemplImageAnalyzer analyzer; analyzer.set_task_info("RoguelikeTraderShopping", "RoguelikeTraderShoppingOcr"); - analyzer.set_image(m_ctrler->get_image()); + analyzer.set_image(ctrler()->get_image()); if (!analyzer.analyze()) { return false; } - bool no_longer_buy = m_status->get_number(Status::RoguelikeTraderNoLongerBuy).value_or(0) ? true : false; + bool no_longer_buy = status()->get_number(Status::RoguelikeTraderNoLongerBuy).value_or(0) ? true : false; - std::string str_chars_info = m_status->get_str(Status::RoguelikeCharOverview).value_or(json::value().to_string()); + std::string str_chars_info = status()->get_str(Status::RoguelikeCharOverview).value_or(json::value().to_string()); json::value json_chars_info = json::parse(str_chars_info).value_or(json::value()); std::unordered_map map_roles_count; @@ -92,7 +92,7 @@ bool asst::RoguelikeShoppingTaskPlugin::_run() const auto& result = analyzer.get_result(); bool bought = false; - auto& all_goods = RoguelikeShopping.get_goods(m_status->get_properties(Status::RoguelikeTheme).value()); + auto& all_goods = RoguelikeShopping.get_goods(status()->get_properties(Status::RoguelikeTheme).value()); for (const auto& goods : all_goods) { if (need_exit()) { return false; @@ -152,10 +152,10 @@ bool asst::RoguelikeShoppingTaskPlugin::_run() // 即 ProcessTask 多点的那一下会点到不影响的地方 // 然后继续走 next 里确认 or 取消等等的逻辑 Log.info("Ready to buy", goods.name); - m_ctrler->click(find_it->rect); + ctrler()->click(find_it->rect); bought = true; if (goods.no_longer_buy) { - m_status->set_number(Status::RoguelikeTraderNoLongerBuy, 1); + status()->set_number(Status::RoguelikeTraderNoLongerBuy, 1); } break; } diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeShoppingTaskPlugin.h b/src/MaaCore/Task/Roguelike/RoguelikeShoppingTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Roguelike/RoguelikeShoppingTaskPlugin.h rename to src/MaaCore/Task/Roguelike/RoguelikeShoppingTaskPlugin.h diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeSkillSelectionTaskPlugin.cpp b/src/MaaCore/Task/Roguelike/RoguelikeSkillSelectionTaskPlugin.cpp similarity index 81% rename from src/MeoAssistant/Task/Roguelike/RoguelikeSkillSelectionTaskPlugin.cpp rename to src/MaaCore/Task/Roguelike/RoguelikeSkillSelectionTaskPlugin.cpp index 28d4268ec7..92843d1392 100644 --- a/src/MeoAssistant/Task/Roguelike/RoguelikeSkillSelectionTaskPlugin.cpp +++ b/src/MaaCore/Task/Roguelike/RoguelikeSkillSelectionTaskPlugin.cpp @@ -14,7 +14,7 @@ bool asst::RoguelikeSkillSelectionTaskPlugin::verify(AsstMsg msg, const json::va return false; } - auto roguelike_name_opt = m_status->get_properties(Status::RoguelikeTheme); + auto roguelike_name_opt = status()->get_properties(Status::RoguelikeTheme); if (!roguelike_name_opt) { Log.error("Roguelike name doesn't exist!"); return false; @@ -37,7 +37,7 @@ bool asst::RoguelikeSkillSelectionTaskPlugin::_run() { LogTraceFunction; - auto image = m_ctrler->get_image(); + auto image = ctrler()->get_image(); RoguelikeSkillSelectionImageAnalyzer analyzer(image); if (!analyzer.analyze()) { @@ -48,7 +48,7 @@ bool asst::RoguelikeSkillSelectionTaskPlugin::_run() bool has_rookie = false; for (const auto& [name, skill_vec] : analyzer.get_result()) { const auto& oper_info = - RoguelikeRecruit.get_oper_info(m_status->get_properties(Status::RoguelikeTheme).value(), name); + RoguelikeRecruit.get_oper_info(status()->get_properties(Status::RoguelikeTheme).value(), name); if (oper_info.name.empty()) { Log.warn("Unknown oper", name); continue; @@ -56,22 +56,22 @@ bool asst::RoguelikeSkillSelectionTaskPlugin::_run() if (oper_info.alternate_skill > 0) { Log.info(__FUNCTION__, name, " select alternate skill:", oper_info.alternate_skill); - m_ctrler->click(skill_vec.at(oper_info.alternate_skill - 1)); + ctrler()->click(skill_vec.at(oper_info.alternate_skill - 1)); sleep(delay); } if (oper_info.skill > 0) { Log.info(__FUNCTION__, name, " select main skill:", oper_info.skill); - m_ctrler->click(skill_vec.at(oper_info.skill - 1)); + ctrler()->click(skill_vec.at(oper_info.skill - 1)); sleep(delay); } constexpr int RookieStd = 200; if (oper_info.promote_priority < RookieStd) { has_rookie = true; } - m_status->set_number(Status::RoguelikeSkillUsagePrefix + name, static_cast(oper_info.skill_usage)); + status()->set_number(Status::RoguelikeSkillUsagePrefix + name, static_cast(oper_info.skill_usage)); } - if (!m_status->get_str(Status::RoguelikeCharOverview)) { + if (!status()->get_str(Status::RoguelikeCharOverview)) { json::value overview; for (const auto& [name, skill_vec] : analyzer.get_result()) { overview[name] = json::object { @@ -79,16 +79,16 @@ bool asst::RoguelikeSkillSelectionTaskPlugin::_run() // 不知道是啥等级随便填一个 }; } - m_status->set_str(Status::RoguelikeCharOverview, overview.to_string()); + status()->set_str(Status::RoguelikeCharOverview, overview.to_string()); } if (analyzer.get_team_full() && !has_rookie) { Log.info("Team full and no rookie"); - m_status->set_number(Status::RoguelikeTeamFullWithoutRookie, 1); + status()->set_number(Status::RoguelikeTeamFullWithoutRookie, 1); } else { Log.info("Team not full or has rookie"); - m_status->set_number(Status::RoguelikeTeamFullWithoutRookie, 0); + status()->set_number(Status::RoguelikeTeamFullWithoutRookie, 0); } return true; } diff --git a/src/MeoAssistant/Task/Roguelike/RoguelikeSkillSelectionTaskPlugin.h b/src/MaaCore/Task/Roguelike/RoguelikeSkillSelectionTaskPlugin.h similarity index 100% rename from src/MeoAssistant/Task/Roguelike/RoguelikeSkillSelectionTaskPlugin.h rename to src/MaaCore/Task/Roguelike/RoguelikeSkillSelectionTaskPlugin.h diff --git a/src/MeoAssistant/Utils/Demangle.hpp b/src/MaaCore/Utils/Demangle.hpp similarity index 100% rename from src/MeoAssistant/Utils/Demangle.hpp rename to src/MaaCore/Utils/Demangle.hpp diff --git a/src/MeoAssistant/Utils/Http.hpp b/src/MaaCore/Utils/Http.hpp similarity index 100% rename from src/MeoAssistant/Utils/Http.hpp rename to src/MaaCore/Utils/Http.hpp diff --git a/src/MeoAssistant/Utils/ImageIo.hpp b/src/MaaCore/Utils/ImageIo.hpp similarity index 100% rename from src/MeoAssistant/Utils/ImageIo.hpp rename to src/MaaCore/Utils/ImageIo.hpp diff --git a/src/MeoAssistant/Utils/Locale.hpp b/src/MaaCore/Utils/Locale.hpp similarity index 100% rename from src/MeoAssistant/Utils/Locale.hpp rename to src/MaaCore/Utils/Locale.hpp diff --git a/src/MeoAssistant/Utils/Logger.hpp b/src/MaaCore/Utils/Logger.hpp similarity index 93% rename from src/MeoAssistant/Utils/Logger.hpp rename to src/MaaCore/Utils/Logger.hpp index 90917bc3b2..1df3665983 100644 --- a/src/MeoAssistant/Utils/Logger.hpp +++ b/src/MaaCore/Utils/Logger.hpp @@ -32,17 +32,21 @@ namespace asst // is_reference_wrapper template - struct is_reference_wrapper : std::false_type - {}; + struct is_reference_wrapper: std::false_type + { + }; template - struct is_reference_wrapper> : std::true_type - {}; + struct is_reference_wrapper>: std::true_type + { + }; template - struct is_reference_wrapper&> : std::true_type - {}; + struct is_reference_wrapper&>: std::true_type + { + }; template - struct is_reference_wrapper&&> : std::true_type - {}; + struct is_reference_wrapper&&>: std::true_type + { + }; template inline constexpr bool is_reference_wrapper_v = is_reference_wrapper::value; @@ -123,12 +127,12 @@ namespace asst toansi_ostream& operator=(toansi_ostream&&) = default; toansi_ostream& operator=(const toansi_ostream&) = default; - toansi_ostream(std::ostream& stream) : m_ofs(stream) {} + toansi_ostream(std::ostream& stream): m_ofs(stream) {} - toansi_ostream(std::reference_wrapper stream) : m_ofs(stream) {} + toansi_ostream(std::reference_wrapper stream): m_ofs(stream) {} template - requires has_stream_insertion_operator + requires has_stream_insertion_operator toansi_ostream& operator<<(T&& v) { if constexpr (std::convertible_to) { @@ -158,10 +162,10 @@ namespace asst ostreams& operator=(ostreams&&) = default; ostreams& operator=(const ostreams&) = default; - ostreams(Args&&... args) : m_ofss(std::forward(args)...) {} + ostreams(Args&&... args): m_ofss(std::forward(args)...) {} template - requires has_stream_insertion_operator + requires has_stream_insertion_operator ostreams& operator<<(T&& x) { streams_put(m_ofss, x, std::index_sequence_for {}); @@ -188,7 +192,7 @@ namespace asst template ostreams(Args&&...) -> ostreams...>; - class Logger : public SingletonHolder + class Logger: public SingletonHolder { public: struct separator @@ -196,7 +200,7 @@ namespace asst constexpr separator() = default; constexpr separator(const separator&) = default; constexpr separator(separator&&) noexcept = default; - constexpr explicit separator(std::string_view s) noexcept : str(s) {} + constexpr explicit separator(std::string_view s) noexcept: str(s) {} constexpr separator& operator=(const separator&) = default; constexpr separator& operator=(separator&&) noexcept = default; constexpr separator& operator=(std::string_view s) noexcept @@ -218,7 +222,7 @@ namespace asst { constexpr level(const level&) = default; constexpr level(level&&) noexcept = default; - constexpr explicit level(std::string_view s) noexcept : str(s) {} + constexpr explicit level(std::string_view s) noexcept: str(s) {} constexpr level& operator=(const level&) = default; constexpr level& operator=(level&&) noexcept = default; constexpr level& operator=(std::string_view s) noexcept @@ -257,7 +261,7 @@ namespace asst } template - LogStream(std::mutex& mtx, _stream_t&& ofs, Logger::level lv) : m_trace_lock(mtx), m_ofs(ofs) + LogStream(std::mutex& mtx, _stream_t&& ofs, Logger::level lv): m_trace_lock(mtx), m_ofs(ofs) { *this << lv; } @@ -309,7 +313,7 @@ namespace asst } else if constexpr (ranges::input_range) { s << "["; - std::string_view comma_space {}; + std::string_view comma_space{}; for (const auto& elem : std::forward(v)) { s << comma_space; stream_put(s, elem); @@ -366,14 +370,14 @@ namespace asst } if constexpr (std::same_as>) { #ifdef ASST_DEBUG - return LogStream(m_trace_mutex, ostreams { toansi_ostream(std::cout), m_ofs }, arg); + return LogStream(m_trace_mutex, ostreams{ toansi_ostream(std::cout), m_ofs }, arg); #else return LogStream(m_trace_mutex, m_ofs, arg); #endif } else { #ifdef ASST_DEBUG - return LogStream(m_trace_mutex, ostreams { toansi_ostream(std::cout), m_ofs }, level::trace, arg); + return LogStream(m_trace_mutex, ostreams{ toansi_ostream(std::cout), m_ofs }, level::trace, arg); #else return LogStream(m_trace_mutex, m_ofs, level::trace, arg); #endif @@ -424,7 +428,7 @@ namespace asst private: friend class SingletonHolder; - Logger() : m_directory(UserDir.get()) + Logger(): m_directory(UserDir.get()) { check_filesize_and_remove(); log_init_info(); @@ -447,7 +451,7 @@ namespace asst void log_init_info() { trace("-----------------------------"); - trace("MeoAssistant Process Start"); + trace("MaaCore Process Start"); trace("Version", asst::Version); trace("Built at", __DATE__, __TIME__); trace("User Dir", m_directory); diff --git a/src/MeoAssistant/Utils/Meta.hpp b/src/MaaCore/Utils/Meta.hpp similarity index 100% rename from src/MeoAssistant/Utils/Meta.hpp rename to src/MaaCore/Utils/Meta.hpp diff --git a/src/MeoAssistant/Utils/MoreCV.hpp b/src/MaaCore/Utils/MoreCV.hpp similarity index 100% rename from src/MeoAssistant/Utils/MoreCV.hpp rename to src/MaaCore/Utils/MoreCV.hpp diff --git a/src/MeoAssistant/Utils/NoWarningCV.h b/src/MaaCore/Utils/NoWarningCV.h similarity index 100% rename from src/MeoAssistant/Utils/NoWarningCV.h rename to src/MaaCore/Utils/NoWarningCV.h diff --git a/src/MeoAssistant/Utils/NoWarningCVMat.h b/src/MaaCore/Utils/NoWarningCVMat.h similarity index 100% rename from src/MeoAssistant/Utils/NoWarningCVMat.h rename to src/MaaCore/Utils/NoWarningCVMat.h diff --git a/src/MeoAssistant/Utils/Platform.hpp b/src/MaaCore/Utils/Platform.hpp similarity index 100% rename from src/MeoAssistant/Utils/Platform.hpp rename to src/MaaCore/Utils/Platform.hpp diff --git a/src/MeoAssistant/Utils/Platform/Platform.h b/src/MaaCore/Utils/Platform/Platform.h similarity index 100% rename from src/MeoAssistant/Utils/Platform/Platform.h rename to src/MaaCore/Utils/Platform/Platform.h diff --git a/src/MeoAssistant/Utils/Platform/PlatformPosix.cpp b/src/MaaCore/Utils/Platform/PlatformPosix.cpp similarity index 100% rename from src/MeoAssistant/Utils/Platform/PlatformPosix.cpp rename to src/MaaCore/Utils/Platform/PlatformPosix.cpp diff --git a/src/MeoAssistant/Utils/Platform/PlatformPosix.h b/src/MaaCore/Utils/Platform/PlatformPosix.h similarity index 100% rename from src/MeoAssistant/Utils/Platform/PlatformPosix.h rename to src/MaaCore/Utils/Platform/PlatformPosix.h diff --git a/src/MeoAssistant/Utils/Platform/PlatformWin32.cpp b/src/MaaCore/Utils/Platform/PlatformWin32.cpp similarity index 100% rename from src/MeoAssistant/Utils/Platform/PlatformWin32.cpp rename to src/MaaCore/Utils/Platform/PlatformWin32.cpp diff --git a/src/MeoAssistant/Utils/Platform/PlatformWin32.h b/src/MaaCore/Utils/Platform/PlatformWin32.h similarity index 100% rename from src/MeoAssistant/Utils/Platform/PlatformWin32.h rename to src/MaaCore/Utils/Platform/PlatformWin32.h diff --git a/src/MeoAssistant/Utils/Platform/SafeWindows.h b/src/MaaCore/Utils/Platform/SafeWindows.h similarity index 100% rename from src/MeoAssistant/Utils/Platform/SafeWindows.h rename to src/MaaCore/Utils/Platform/SafeWindows.h diff --git a/src/MeoAssistant/Utils/Ranges.hpp b/src/MaaCore/Utils/Ranges.hpp similarity index 100% rename from src/MeoAssistant/Utils/Ranges.hpp rename to src/MaaCore/Utils/Ranges.hpp diff --git a/src/MeoAssistant/Utils/SingletonHolder.hpp b/src/MaaCore/Utils/SingletonHolder.hpp similarity index 100% rename from src/MeoAssistant/Utils/SingletonHolder.hpp rename to src/MaaCore/Utils/SingletonHolder.hpp diff --git a/src/MeoAssistant/Utils/StringMisc.hpp b/src/MaaCore/Utils/StringMisc.hpp similarity index 66% rename from src/MeoAssistant/Utils/StringMisc.hpp rename to src/MaaCore/Utils/StringMisc.hpp index 83d7b78fec..7a2554078c 100644 --- a/src/MeoAssistant/Utils/StringMisc.hpp +++ b/src/MaaCore/Utils/StringMisc.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include @@ -17,26 +18,30 @@ namespace asst::utils { namespace detail { - template + template using sv_type = std::basic_string_view::value_type, typename std::remove_reference_t::traits_type>; - template + template using sv_pair = std::pair, sv_type>; } // namespace detail - template + template > + concept IsSomeKindOfString = std::same_as || std::same_as; + + template + requires IsSomeKindOfString inline constexpr void string_replace_all_in_place(StringT& str, detail::sv_type from, detail::sv_type to) { - using size_type = std::string_view::size_type; - for (size_type pos(0);; pos += to.length()) { + for (size_t pos(0);; pos += to.length()) { if ((pos = str.find(from, pos)) == StringT::npos) return; str.replace(pos, from.length(), to); } } - template + template + requires IsSomeKindOfString inline constexpr void string_replace_all_in_place(StringT& str, const detail::sv_pair& replace_pair) { string_replace_all_in_place(str, replace_pair.first, replace_pair.second); @@ -73,6 +78,7 @@ namespace asst::utils #endif template + requires IsSomeKindOfString [[nodiscard]] inline constexpr auto string_replace_all(StringT&& src, detail::sv_type from, detail::sv_type to) { @@ -82,6 +88,7 @@ namespace asst::utils } template + requires IsSomeKindOfString [[nodiscard]] inline constexpr auto string_replace_all(StringT&& src, const detail::sv_pair& replace_pair) { std::decay_t result = std::forward(src); @@ -90,27 +97,37 @@ namespace asst::utils } template + requires IsSomeKindOfString [[nodiscard]] inline constexpr auto string_replace_all( - StringT&& src, std::initializer_list> replace_pairs) + StringT&& str, std::initializer_list> replace_pairs) { - std::decay_t result = std::forward(src); + std::decay_t result = std::forward(str); for (auto&& [from, to] : replace_pairs) { string_replace_all_in_place(result, from, to); } return result; } - template bool { return !std::isspace(c); })> - inline void string_trim(std::string& s, Pred not_space = Pred {}) + template > + requires IsSomeKindOfString + inline void string_trim( + StringT& str, const std::function& not_space = [](CharT ch) -> bool { return !std::isspace(ch); }) { - s.erase(ranges::find_if(s | views::reverse, not_space).base(), s.end()); - s.erase(s.begin(), ranges::find_if(s, not_space)); + str.erase(ranges::find_if(str | views::reverse, not_space).base(), str.end()); + str.erase(str.begin(), ranges::find_if(str, not_space)); } - template - requires std::convertible_to, char> - void tolowers(Rng& rng) + template > + requires IsSomeKindOfString + inline void tolowers(StringT& str) { - ranges::for_each(rng, [](char& c) -> void { c = static_cast(std::tolower(c)); }); + ranges::for_each(str, [](CharT& ch) -> void { ch = static_cast(std::tolower(ch)); }); + } + + template > + requires IsSomeKindOfString + inline void touppers(StringT& str) + { + ranges::for_each(str, [](CharT& ch) -> void { ch = static_cast(std::toupper(ch)); }); } } // namespace asst::utils diff --git a/src/MeoAssistant/Utils/Time.hpp b/src/MaaCore/Utils/Time.hpp similarity index 100% rename from src/MeoAssistant/Utils/Time.hpp rename to src/MaaCore/Utils/Time.hpp diff --git a/src/MeoAssistant/Utils/WorkingDir.hpp b/src/MaaCore/Utils/WorkingDir.hpp similarity index 100% rename from src/MeoAssistant/Utils/WorkingDir.hpp rename to src/MaaCore/Utils/WorkingDir.hpp diff --git a/src/MeoAssistant/Vision/AbstractImageAnalyzer.cpp b/src/MaaCore/Vision/AbstractImageAnalyzer.cpp similarity index 94% rename from src/MeoAssistant/Vision/AbstractImageAnalyzer.cpp rename to src/MaaCore/Vision/AbstractImageAnalyzer.cpp index 282278a1d2..3781b816e7 100644 --- a/src/MeoAssistant/Vision/AbstractImageAnalyzer.cpp +++ b/src/MaaCore/Vision/AbstractImageAnalyzer.cpp @@ -2,7 +2,8 @@ #include "Utils/NoWarningCV.h" -#include "Controller.h" +#include "Assistant.h" +#include "InstHelper.h" #include "Utils/ImageIo.hpp" #include "Utils/Logger.hpp" #include "Utils/StringMisc.hpp" @@ -16,8 +17,8 @@ asst::AbstractImageAnalyzer::AbstractImageAnalyzer(const cv::Mat& image) #endif {} -asst::AbstractImageAnalyzer::AbstractImageAnalyzer(const cv::Mat& image, const Rect& roi) - : m_image(image), m_roi(correct_rect(roi, image)) +asst::AbstractImageAnalyzer::AbstractImageAnalyzer(const cv::Mat& image, Assistant* inst) + : InstHelper(inst), m_image(image), m_roi(correct_rect(Rect(), image)) #ifdef ASST_DEBUG , m_image_draw(image.clone()) @@ -90,4 +91,4 @@ bool asst::AbstractImageAnalyzer::save_img(const std::string& dirname) #endif return ret; -} +} \ No newline at end of file diff --git a/src/MeoAssistant/Vision/AbstractImageAnalyzer.h b/src/MaaCore/Vision/AbstractImageAnalyzer.h similarity index 76% rename from src/MeoAssistant/Vision/AbstractImageAnalyzer.h rename to src/MaaCore/Vision/AbstractImageAnalyzer.h index 9d762a9376..e7d2047750 100644 --- a/src/MeoAssistant/Vision/AbstractImageAnalyzer.h +++ b/src/MaaCore/Vision/AbstractImageAnalyzer.h @@ -1,6 +1,7 @@ #pragma once #include "Common/AsstTypes.h" +#include "InstHelper.h" #include "Utils/NoWarningCVMat.h" // #ifndef ASST_DEBUG @@ -10,12 +11,15 @@ namespace asst { class TaskData; - class AbstractImageAnalyzer + class Status; + class Assistant; + + class AbstractImageAnalyzer : protected InstHelper { public: AbstractImageAnalyzer() = default; AbstractImageAnalyzer(const cv::Mat& image); - AbstractImageAnalyzer(const cv::Mat& image, const Rect& roi); + AbstractImageAnalyzer(const cv::Mat& image, Assistant* inst); AbstractImageAnalyzer(const AbstractImageAnalyzer&) = delete; AbstractImageAnalyzer(AbstractImageAnalyzer&&) = delete; virtual ~AbstractImageAnalyzer() = default; @@ -30,6 +34,9 @@ namespace asst bool save_img(const std::string& dirname = "debug/"); + protected: + using InstHelper::status; + protected: static Rect correct_rect(const Rect& rect, const cv::Mat& image) noexcept; @@ -39,5 +46,9 @@ namespace asst #ifdef ASST_DEBUG cv::Mat m_image_draw; #endif + + private: + using InstHelper::ctrler; + using InstHelper::need_exit; }; } diff --git a/src/MeoAssistant/Vision/HashImageAnalyzer.cpp b/src/MaaCore/Vision/HashImageAnalyzer.cpp similarity index 100% rename from src/MeoAssistant/Vision/HashImageAnalyzer.cpp rename to src/MaaCore/Vision/HashImageAnalyzer.cpp diff --git a/src/MeoAssistant/Vision/HashImageAnalyzer.h b/src/MaaCore/Vision/HashImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/HashImageAnalyzer.h rename to src/MaaCore/Vision/HashImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/Infrast/InfrastClueImageAnalyzer.cpp b/src/MaaCore/Vision/Infrast/InfrastClueImageAnalyzer.cpp similarity index 100% rename from src/MeoAssistant/Vision/Infrast/InfrastClueImageAnalyzer.cpp rename to src/MaaCore/Vision/Infrast/InfrastClueImageAnalyzer.cpp diff --git a/src/MeoAssistant/Vision/Infrast/InfrastClueImageAnalyzer.h b/src/MaaCore/Vision/Infrast/InfrastClueImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Infrast/InfrastClueImageAnalyzer.h rename to src/MaaCore/Vision/Infrast/InfrastClueImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/Infrast/InfrastClueVacancyImageAnalyzer.cpp b/src/MaaCore/Vision/Infrast/InfrastClueVacancyImageAnalyzer.cpp similarity index 100% rename from src/MeoAssistant/Vision/Infrast/InfrastClueVacancyImageAnalyzer.cpp rename to src/MaaCore/Vision/Infrast/InfrastClueVacancyImageAnalyzer.cpp diff --git a/src/MeoAssistant/Vision/Infrast/InfrastClueVacancyImageAnalyzer.h b/src/MaaCore/Vision/Infrast/InfrastClueVacancyImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Infrast/InfrastClueVacancyImageAnalyzer.h rename to src/MaaCore/Vision/Infrast/InfrastClueVacancyImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/Infrast/InfrastFacilityImageAnalyzer.cpp b/src/MaaCore/Vision/Infrast/InfrastFacilityImageAnalyzer.cpp similarity index 100% rename from src/MeoAssistant/Vision/Infrast/InfrastFacilityImageAnalyzer.cpp rename to src/MaaCore/Vision/Infrast/InfrastFacilityImageAnalyzer.cpp diff --git a/src/MeoAssistant/Vision/Infrast/InfrastFacilityImageAnalyzer.h b/src/MaaCore/Vision/Infrast/InfrastFacilityImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Infrast/InfrastFacilityImageAnalyzer.h rename to src/MaaCore/Vision/Infrast/InfrastFacilityImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/Infrast/InfrastOperImageAnalyzer.cpp b/src/MaaCore/Vision/Infrast/InfrastOperImageAnalyzer.cpp similarity index 100% rename from src/MeoAssistant/Vision/Infrast/InfrastOperImageAnalyzer.cpp rename to src/MaaCore/Vision/Infrast/InfrastOperImageAnalyzer.cpp diff --git a/src/MeoAssistant/Vision/Infrast/InfrastOperImageAnalyzer.h b/src/MaaCore/Vision/Infrast/InfrastOperImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Infrast/InfrastOperImageAnalyzer.h rename to src/MaaCore/Vision/Infrast/InfrastOperImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/Infrast/InfrastSmileyImageAnalyzer.cpp b/src/MaaCore/Vision/Infrast/InfrastSmileyImageAnalyzer.cpp similarity index 100% rename from src/MeoAssistant/Vision/Infrast/InfrastSmileyImageAnalyzer.cpp rename to src/MaaCore/Vision/Infrast/InfrastSmileyImageAnalyzer.cpp diff --git a/src/MeoAssistant/Vision/Infrast/InfrastSmileyImageAnalyzer.h b/src/MaaCore/Vision/Infrast/InfrastSmileyImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Infrast/InfrastSmileyImageAnalyzer.h rename to src/MaaCore/Vision/Infrast/InfrastSmileyImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/MatchImageAnalyzer.cpp b/src/MaaCore/Vision/MatchImageAnalyzer.cpp similarity index 95% rename from src/MeoAssistant/Vision/MatchImageAnalyzer.cpp rename to src/MaaCore/Vision/MatchImageAnalyzer.cpp index 425d34176c..13d7120860 100644 --- a/src/MeoAssistant/Vision/MatchImageAnalyzer.cpp +++ b/src/MaaCore/Vision/MatchImageAnalyzer.cpp @@ -7,9 +7,8 @@ #include "Utils/Logger.hpp" #include "Utils/StringMisc.hpp" -asst::MatchImageAnalyzer::MatchImageAnalyzer(const cv::Mat& image, const Rect& roi, std::string templ_name, - double templ_thres) - : AbstractImageAnalyzer(image, roi), m_templ_name(std::move(templ_name)), m_templ_thres(templ_thres) +asst::MatchImageAnalyzer::MatchImageAnalyzer(const cv::Mat& image, std::string templ_name, double templ_thres) + : AbstractImageAnalyzer(image), m_templ_name(std::move(templ_name)), m_templ_thres(templ_thres) {} bool asst::MatchImageAnalyzer::analyze() diff --git a/src/MeoAssistant/Vision/MatchImageAnalyzer.h b/src/MaaCore/Vision/MatchImageAnalyzer.h similarity index 92% rename from src/MeoAssistant/Vision/MatchImageAnalyzer.h rename to src/MaaCore/Vision/MatchImageAnalyzer.h index 0f5a3f82b5..dfe5768def 100644 --- a/src/MeoAssistant/Vision/MatchImageAnalyzer.h +++ b/src/MaaCore/Vision/MatchImageAnalyzer.h @@ -7,7 +7,7 @@ namespace asst { public: using AbstractImageAnalyzer::AbstractImageAnalyzer; - MatchImageAnalyzer(const cv::Mat& image, const Rect& roi, std::string templ_name, double templ_thres = 0.0); + MatchImageAnalyzer(const cv::Mat& image, std::string templ_name, double templ_thres = 0.0); virtual ~MatchImageAnalyzer() override = default; virtual bool analyze() override; diff --git a/src/MeoAssistant/Vision/Miscellaneous/BattleImageAnalyzer.cpp b/src/MaaCore/Vision/Miscellaneous/BattleImageAnalyzer.cpp similarity index 95% rename from src/MeoAssistant/Vision/Miscellaneous/BattleImageAnalyzer.cpp rename to src/MaaCore/Vision/Miscellaneous/BattleImageAnalyzer.cpp index 3fda045159..7c7b1339eb 100644 --- a/src/MeoAssistant/Vision/Miscellaneous/BattleImageAnalyzer.cpp +++ b/src/MaaCore/Vision/Miscellaneous/BattleImageAnalyzer.cpp @@ -265,14 +265,14 @@ int asst::BattleImageAnalyzer::oper_cost_analyze(const Rect& roi) auto [v_l, v_u] = std::dynamic_pointer_cast(Task.get("BattleOperCostChannelV"))->mask_range; range_lower = cv::Scalar(h_l, s_l, v_l); range_upper = cv::Scalar(h_u, s_u, v_u); - std::unordered_map num_hashs; + std::unordered_map num_hashes; for (auto&& num : NumName) { - auto hashs_vec = std::dynamic_pointer_cast(Task.get("BattleOperCost" + num))->hashes; - for (size_t i = 0; i != hashs_vec.size(); ++i) { - num_hashs.emplace(num + "_" + std::to_string(i), hashs_vec.at(i)); + auto hashes_vec = std::dynamic_pointer_cast(Task.get("BattleOperCost" + num))->hashes; + for (size_t i = 0; i != hashes_vec.size(); ++i) { + num_hashes.emplace(num + "_" + std::to_string(i), hashes_vec.at(i)); } } - hash_analyzer.set_hash_templates(std::move(num_hashs)); + hash_analyzer.set_hash_templates(std::move(num_hashes)); hash_analyzer.set_need_bound(true); hash_analyzer.set_need_split(true); inited = true; @@ -409,14 +409,14 @@ bool asst::BattleImageAnalyzer::hp_analyze() auto [v_l, v_u] = std::dynamic_pointer_cast(Task.get("BattleHpChannelV"))->mask_range; range_lower = cv::Scalar(h_l, s_l, v_l); range_upper = cv::Scalar(h_u, s_u, v_u); - std::unordered_map num_hashs; + std::unordered_map num_hashes; for (auto&& num : NumName) { - const auto& hashs_vec = std::dynamic_pointer_cast(Task.get("BattleHp" + num))->hashes; - for (size_t i = 0; i != hashs_vec.size(); ++i) { - num_hashs.emplace(num + "_" + std::to_string(i), hashs_vec.at(i)); + const auto& hashes_vec = std::dynamic_pointer_cast(Task.get("BattleHp" + num))->hashes; + for (size_t i = 0; i != hashes_vec.size(); ++i) { + num_hashes.emplace(num + "_" + std::to_string(i), hashes_vec.at(i)); } } - hash_analyzer.set_hash_templates(std::move(num_hashs)); + hash_analyzer.set_hash_templates(std::move(num_hashes)); hash_analyzer.set_need_bound(true); hash_analyzer.set_need_split(true); inited = true; diff --git a/src/MeoAssistant/Vision/Miscellaneous/BattleImageAnalyzer.h b/src/MaaCore/Vision/Miscellaneous/BattleImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Miscellaneous/BattleImageAnalyzer.h rename to src/MaaCore/Vision/Miscellaneous/BattleImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/Miscellaneous/CreditShopImageAnalyzer.cpp b/src/MaaCore/Vision/Miscellaneous/CreditShopImageAnalyzer.cpp similarity index 97% rename from src/MeoAssistant/Vision/Miscellaneous/CreditShopImageAnalyzer.cpp rename to src/MaaCore/Vision/Miscellaneous/CreditShopImageAnalyzer.cpp index 0d45657491..6b465ff04b 100644 --- a/src/MeoAssistant/Vision/Miscellaneous/CreditShopImageAnalyzer.cpp +++ b/src/MaaCore/Vision/Miscellaneous/CreditShopImageAnalyzer.cpp @@ -4,10 +4,10 @@ #include "Utils/NoWarningCV.h" +#include "Config/TaskData.h" #include "Vision/MatchImageAnalyzer.h" #include "Vision/MultiMatchImageAnalyzer.h" #include "Vision/OcrImageAnalyzer.h" -#include "Config/TaskData.h" void asst::CreditShopImageAnalyzer::set_black_list(std::vector black_list) { @@ -69,7 +69,8 @@ bool asst::CreditShopImageAnalyzer::whether_to_buy_analyze() name_roi.x += commodity.x; name_roi.y += commodity.y; - OcrImageAnalyzer ocr_analyzer(m_image, name_roi); + OcrImageAnalyzer ocr_analyzer(m_image); + ocr_analyzer.set_roi(name_roi); ocr_analyzer.set_replace(product_name_task_ptr->replace_map); ocr_analyzer.set_required(m_shopping_list); if (ocr_analyzer.analyze()) { diff --git a/src/MeoAssistant/Vision/Miscellaneous/CreditShopImageAnalyzer.h b/src/MaaCore/Vision/Miscellaneous/CreditShopImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Miscellaneous/CreditShopImageAnalyzer.h rename to src/MaaCore/Vision/Miscellaneous/CreditShopImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/Miscellaneous/DepotImageAnalyzer.cpp b/src/MaaCore/Vision/Miscellaneous/DepotImageAnalyzer.cpp similarity index 96% rename from src/MeoAssistant/Vision/Miscellaneous/DepotImageAnalyzer.cpp rename to src/MaaCore/Vision/Miscellaneous/DepotImageAnalyzer.cpp index 72a05797c0..5c9907d698 100644 --- a/src/MeoAssistant/Vision/Miscellaneous/DepotImageAnalyzer.cpp +++ b/src/MaaCore/Vision/Miscellaneous/DepotImageAnalyzer.cpp @@ -2,11 +2,11 @@ #include "Utils/NoWarningCV.h" -#include "Vision/MatchImageAnalyzer.h" -#include "Vision/OcrWithPreprocessImageAnalyzer.h" #include "Config/Miscellaneous/ItemConfig.h" #include "Config/TaskData.h" #include "Utils/Logger.hpp" +#include "Vision/MatchImageAnalyzer.h" +#include "Vision/OcrWithPreprocessImageAnalyzer.h" bool asst::DepotImageAnalyzer::analyze() { @@ -307,10 +307,18 @@ int asst::DepotImageAnalyzer::match_quantity(const Rect& roi) multiple = 10000; digit_str.erase(w_pos, digit_str.size()); } - else if (size_t k_pos = digit_str.find("k"); k_pos != std::string::npos) { + else if (size_t k_pos = digit_str.find("K"); k_pos != std::string::npos) { multiple = 1000; digit_str.erase(k_pos, digit_str.size()); } + else if (size_t e_pos = digit_str.find("亿"); e_pos != std::string::npos) { + multiple = 100000000; + digit_str.erase(e_pos, digit_str.size()); + } + else if (size_t m_pos = digit_str.find("M"); m_pos != std::string::npos) { + multiple = 1000000; + digit_str.erase(m_pos, digit_str.size()); + } if (digit_str.empty() || !ranges::all_of(digit_str, [](const char& c) -> bool { return std::isdigit(c) || c == '.'; })) { diff --git a/src/MeoAssistant/Vision/Miscellaneous/DepotImageAnalyzer.h b/src/MaaCore/Vision/Miscellaneous/DepotImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Miscellaneous/DepotImageAnalyzer.h rename to src/MaaCore/Vision/Miscellaneous/DepotImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/Miscellaneous/ProcessTaskImageAnalyzer.cpp b/src/MaaCore/Vision/Miscellaneous/ProcessTaskImageAnalyzer.cpp similarity index 89% rename from src/MeoAssistant/Vision/Miscellaneous/ProcessTaskImageAnalyzer.cpp rename to src/MaaCore/Vision/Miscellaneous/ProcessTaskImageAnalyzer.cpp index a5553aa717..85d1f987ce 100644 --- a/src/MeoAssistant/Vision/Miscellaneous/ProcessTaskImageAnalyzer.cpp +++ b/src/MaaCore/Vision/Miscellaneous/ProcessTaskImageAnalyzer.cpp @@ -3,15 +3,17 @@ #include #include -#include "Vision/MatchImageAnalyzer.h" -#include "Vision/OcrImageAnalyzer.h" -#include "Vision/OcrWithPreprocessImageAnalyzer.h" #include "Config/TaskData.h" #include "Status.h" #include "Utils/Logger.hpp" +#include "Vision/MatchImageAnalyzer.h" +#include "Vision/OcrImageAnalyzer.h" +#include "Vision/OcrWithPreprocessImageAnalyzer.h" -asst::ProcessTaskImageAnalyzer::ProcessTaskImageAnalyzer(const cv::Mat& image, std::vector tasks_name) - : AbstractImageAnalyzer(image), m_tasks_name(std::move(tasks_name)) +asst::ProcessTaskImageAnalyzer::ProcessTaskImageAnalyzer(const cv::Mat& image, std::vector tasks_name, + Assistant* inst) + : AbstractImageAnalyzer(image, inst), m_tasks_name(std::move(tasks_name)), m_ocr_analyzer(nullptr), + m_ocr_with_preprocess_analyzer(nullptr), m_match_analyzer(nullptr) {} asst::ProcessTaskImageAnalyzer::~ProcessTaskImageAnalyzer() = default; @@ -28,7 +30,7 @@ bool asst::ProcessTaskImageAnalyzer::match_analyze(const std::shared_ptrset_region_of_appeared(Rect()); m_match_analyzer->set_task_info(match_task_ptr); - auto region_opt = m_status->get_rect(match_task_ptr->name); + auto region_opt = status()->get_rect(match_task_ptr->name); if (region_opt) { m_match_analyzer->set_region_of_appeared(region_opt.value()); } @@ -36,7 +38,7 @@ bool asst::ProcessTaskImageAnalyzer::match_analyze(const std::shared_ptranalyze()) { m_result = match_task_ptr; m_result_rect = m_match_analyzer->get_result().rect; - m_status->set_rect(match_task_ptr->name, m_result_rect); + status()->set_rect(match_task_ptr->name, m_result_rect); return true; } return false; @@ -86,7 +88,7 @@ bool asst::ProcessTaskImageAnalyzer::ocr_analyze(const std::shared_ptr analyzer_ptr = &m_ocr_analyzer; } - (*analyzer_ptr)->set_region_of_appeared(m_status->get_rect(ocr_task_ptr->name).value_or(Rect())); + (*analyzer_ptr)->set_region_of_appeared(status()->get_rect(ocr_task_ptr->name).value_or(Rect())); (*analyzer_ptr)->set_task_info(ocr_task_ptr); bool ret = (*analyzer_ptr)->analyze(); @@ -97,7 +99,7 @@ bool asst::ProcessTaskImageAnalyzer::ocr_analyze(const std::shared_ptr auto& res = ocr_result.front(); m_result = ocr_task_ptr; m_result_rect = res.rect; - m_status->set_rect(ocr_task_ptr->name, m_result_rect); + status()->set_rect(ocr_task_ptr->name, m_result_rect); // m_ocr_cache.insert(m_ocr_cache.end(), ocr_result.begin(), ocr_result.end()); Log.trace(__FUNCTION__, "| found", res); } @@ -155,8 +157,3 @@ void asst::ProcessTaskImageAnalyzer::set_tasks(std::vector tasks_na { m_tasks_name = std::move(tasks_name); } - -void asst::ProcessTaskImageAnalyzer::set_status(std::shared_ptr status) noexcept -{ - m_status = std::move(status); -} diff --git a/src/MeoAssistant/Vision/Miscellaneous/ProcessTaskImageAnalyzer.h b/src/MaaCore/Vision/Miscellaneous/ProcessTaskImageAnalyzer.h similarity index 84% rename from src/MeoAssistant/Vision/Miscellaneous/ProcessTaskImageAnalyzer.h rename to src/MaaCore/Vision/Miscellaneous/ProcessTaskImageAnalyzer.h index 2b6e2d4d2b..e39653b729 100644 --- a/src/MeoAssistant/Vision/Miscellaneous/ProcessTaskImageAnalyzer.h +++ b/src/MaaCore/Vision/Miscellaneous/ProcessTaskImageAnalyzer.h @@ -12,21 +12,18 @@ namespace asst class OcrImageAnalyzer; class OcrWithPreprocessImageAnalyzer; class MatchImageAnalyzer; - class Status; + class Assistant; class ProcessTaskImageAnalyzer final : public AbstractImageAnalyzer { public: - using AbstractImageAnalyzer::AbstractImageAnalyzer; - ProcessTaskImageAnalyzer(const cv::Mat& image, const Rect& roi) = delete; - ProcessTaskImageAnalyzer(const cv::Mat& image, std::vector tasks_name); + ProcessTaskImageAnalyzer(const cv::Mat& image, std::vector tasks_name, Assistant* inst); virtual ~ProcessTaskImageAnalyzer() override; virtual bool analyze() override; virtual void set_image(const cv::Mat& image) override; void set_tasks(std::vector tasks_name); - void set_status(std::shared_ptr status) noexcept; std::shared_ptr get_result() const noexcept { return m_result; } const Rect& get_rect() const noexcept { return m_result_rect; } @@ -46,7 +43,6 @@ namespace asst std::unique_ptr m_match_analyzer; std::vector m_tasks_name; std::shared_ptr m_result = nullptr; - std::shared_ptr m_status = nullptr; Rect m_result_rect; // std::vector m_ocr_cache; }; diff --git a/src/MeoAssistant/Vision/Miscellaneous/RecruitImageAnalyzer.cpp b/src/MaaCore/Vision/Miscellaneous/RecruitImageAnalyzer.cpp similarity index 100% rename from src/MeoAssistant/Vision/Miscellaneous/RecruitImageAnalyzer.cpp rename to src/MaaCore/Vision/Miscellaneous/RecruitImageAnalyzer.cpp diff --git a/src/MeoAssistant/Vision/Miscellaneous/RecruitImageAnalyzer.h b/src/MaaCore/Vision/Miscellaneous/RecruitImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Miscellaneous/RecruitImageAnalyzer.h rename to src/MaaCore/Vision/Miscellaneous/RecruitImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/Roguelike/StageDropsImageAnalyzer.cpp b/src/MaaCore/Vision/Miscellaneous/StageDropsImageAnalyzer.cpp similarity index 96% rename from src/MeoAssistant/Vision/Roguelike/StageDropsImageAnalyzer.cpp rename to src/MaaCore/Vision/Miscellaneous/StageDropsImageAnalyzer.cpp index 2a3ba5f9aa..775e1c7441 100644 --- a/src/MeoAssistant/Vision/Roguelike/StageDropsImageAnalyzer.cpp +++ b/src/MaaCore/Vision/Miscellaneous/StageDropsImageAnalyzer.cpp @@ -4,13 +4,13 @@ #include "Utils/NoWarningCV.h" -#include "Vision/MatchImageAnalyzer.h" -#include "Vision/OcrWithPreprocessImageAnalyzer.h" #include "Config/Miscellaneous/ItemConfig.h" #include "Config/Miscellaneous/StageDropsConfig.h" #include "Config/TaskData.h" #include "Utils/ImageIo.hpp" #include "Utils/Logger.hpp" +#include "Vision/MatchImageAnalyzer.h" +#include "Vision/OcrWithPreprocessImageAnalyzer.h" #include @@ -191,7 +191,11 @@ bool asst::StageDropsImageAnalyzer::analyze_drops() } std::string item = match_item(item_roi, drop_type, size - i, size); - int quantity = match_quantity(item_roi, item == LMD_ID); + bool use_word_model = item == LMD_ID; + int quantity = match_quantity(item_roi, use_word_model); + if (use_word_model && quantity == 0) { + quantity = match_quantity(item_roi, false); + } Log.info("Item id:", item, ", quantity:", quantity); #ifdef ASST_DEBUG cv::rectangle(m_image_draw, make_rect(item_roi), cv::Scalar(0, 0, 255), 2); @@ -528,8 +532,14 @@ int asst::StageDropsImageAnalyzer::match_quantity(const Rect& roi, bool use_word #ifdef ASST_DEBUG cv::rectangle(m_image_draw, make_rect(result.rect), cv::Scalar(0, 0, 255)); - cv::putText(m_image_draw, result.text, cv::Point(result.rect.x, result.rect.y - 5), cv::FONT_HERSHEY_SIMPLEX, 0.5, - cv::Scalar(0, 255, 0), 2); + if (use_word_model) { + cv::putText(m_image_draw, result.text, cv::Point(result.rect.x, result.rect.y - 20), cv::FONT_HERSHEY_SIMPLEX, + 0.5, cv::Scalar(0, 0, 255), 2); + } + else { + cv::putText(m_image_draw, result.text, cv::Point(result.rect.x, result.rect.y - 5), cv::FONT_HERSHEY_SIMPLEX, + 0.5, cv::Scalar(0, 255, 0), 2); + } #endif std::string digit_str = result.text; diff --git a/src/MeoAssistant/Vision/Roguelike/StageDropsImageAnalyzer.h b/src/MaaCore/Vision/Miscellaneous/StageDropsImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Roguelike/StageDropsImageAnalyzer.h rename to src/MaaCore/Vision/Miscellaneous/StageDropsImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/MultiMatchImageAnalyzer.cpp b/src/MaaCore/Vision/MultiMatchImageAnalyzer.cpp similarity index 95% rename from src/MeoAssistant/Vision/MultiMatchImageAnalyzer.cpp rename to src/MaaCore/Vision/MultiMatchImageAnalyzer.cpp index 8204ca2386..51cadfb761 100644 --- a/src/MeoAssistant/Vision/MultiMatchImageAnalyzer.cpp +++ b/src/MaaCore/Vision/MultiMatchImageAnalyzer.cpp @@ -10,9 +10,8 @@ #include "Config/TemplResource.h" #include "Utils/Logger.hpp" -asst::MultiMatchImageAnalyzer::MultiMatchImageAnalyzer(const cv::Mat& image, const Rect& roi, std::string templ_name, - double templ_thres) - : AbstractImageAnalyzer(image, roi), m_templ_name(std::move(templ_name)), m_templ_thres(templ_thres) +asst::MultiMatchImageAnalyzer::MultiMatchImageAnalyzer(const cv::Mat& image, std::string templ_name, double templ_thres) + : AbstractImageAnalyzer(image), m_templ_name(std::move(templ_name)), m_templ_thres(templ_thres) {} bool asst::MultiMatchImageAnalyzer::analyze() diff --git a/src/MeoAssistant/Vision/MultiMatchImageAnalyzer.h b/src/MaaCore/Vision/MultiMatchImageAnalyzer.h similarity index 91% rename from src/MeoAssistant/Vision/MultiMatchImageAnalyzer.h rename to src/MaaCore/Vision/MultiMatchImageAnalyzer.h index ad605a0451..e6b09b8ede 100644 --- a/src/MeoAssistant/Vision/MultiMatchImageAnalyzer.h +++ b/src/MaaCore/Vision/MultiMatchImageAnalyzer.h @@ -7,7 +7,7 @@ namespace asst { public: using AbstractImageAnalyzer::AbstractImageAnalyzer; - MultiMatchImageAnalyzer(const cv::Mat& image, const Rect& roi, std::string templ_name, double templ_thres); + MultiMatchImageAnalyzer(const cv::Mat& image, std::string templ_name, double templ_thres); virtual ~MultiMatchImageAnalyzer() override = default; virtual bool analyze() override; diff --git a/src/MeoAssistant/Vision/OcrImageAnalyzer.cpp b/src/MaaCore/Vision/OcrImageAnalyzer.cpp similarity index 100% rename from src/MeoAssistant/Vision/OcrImageAnalyzer.cpp rename to src/MaaCore/Vision/OcrImageAnalyzer.cpp diff --git a/src/MeoAssistant/Vision/OcrImageAnalyzer.h b/src/MaaCore/Vision/OcrImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/OcrImageAnalyzer.h rename to src/MaaCore/Vision/OcrImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/OcrWithFlagTemplImageAnalyzer.cpp b/src/MaaCore/Vision/OcrWithFlagTemplImageAnalyzer.cpp similarity index 91% rename from src/MeoAssistant/Vision/OcrWithFlagTemplImageAnalyzer.cpp rename to src/MaaCore/Vision/OcrWithFlagTemplImageAnalyzer.cpp index c53c0cd71d..4b528b10d2 100644 --- a/src/MeoAssistant/Vision/OcrWithFlagTemplImageAnalyzer.cpp +++ b/src/MaaCore/Vision/OcrWithFlagTemplImageAnalyzer.cpp @@ -6,10 +6,6 @@ asst::OcrWithFlagTemplImageAnalyzer::OcrWithFlagTemplImageAnalyzer(const cv::Mat : OcrWithPreprocessImageAnalyzer(image), m_multi_match_image_analyzer(image) {} -asst::OcrWithFlagTemplImageAnalyzer::OcrWithFlagTemplImageAnalyzer(const cv::Mat& image, const Rect& roi) - : OcrWithPreprocessImageAnalyzer(image, roi), m_multi_match_image_analyzer(image, roi) -{} - void asst::OcrWithFlagTemplImageAnalyzer::set_image(const cv::Mat& image) { OcrWithPreprocessImageAnalyzer::set_image(image); diff --git a/src/MeoAssistant/Vision/OcrWithFlagTemplImageAnalyzer.h b/src/MaaCore/Vision/OcrWithFlagTemplImageAnalyzer.h similarity index 93% rename from src/MeoAssistant/Vision/OcrWithFlagTemplImageAnalyzer.h rename to src/MaaCore/Vision/OcrWithFlagTemplImageAnalyzer.h index 405fc7c607..83e4c0bcf4 100644 --- a/src/MeoAssistant/Vision/OcrWithFlagTemplImageAnalyzer.h +++ b/src/MaaCore/Vision/OcrWithFlagTemplImageAnalyzer.h @@ -9,7 +9,6 @@ namespace asst public: OcrWithFlagTemplImageAnalyzer() = default; OcrWithFlagTemplImageAnalyzer(const cv::Mat& image); - OcrWithFlagTemplImageAnalyzer(const cv::Mat& image, const Rect& roi); virtual ~OcrWithFlagTemplImageAnalyzer() override = default; virtual void set_image(const cv::Mat& image) override; diff --git a/src/MeoAssistant/Vision/OcrWithPreprocessImageAnalyzer.cpp b/src/MaaCore/Vision/OcrWithPreprocessImageAnalyzer.cpp similarity index 100% rename from src/MeoAssistant/Vision/OcrWithPreprocessImageAnalyzer.cpp rename to src/MaaCore/Vision/OcrWithPreprocessImageAnalyzer.cpp diff --git a/src/MeoAssistant/Vision/OcrWithPreprocessImageAnalyzer.h b/src/MaaCore/Vision/OcrWithPreprocessImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/OcrWithPreprocessImageAnalyzer.h rename to src/MaaCore/Vision/OcrWithPreprocessImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/Roguelike/RoguelikeFormationImageAnalyzer.cpp b/src/MaaCore/Vision/Roguelike/RoguelikeFormationImageAnalyzer.cpp similarity index 100% rename from src/MeoAssistant/Vision/Roguelike/RoguelikeFormationImageAnalyzer.cpp rename to src/MaaCore/Vision/Roguelike/RoguelikeFormationImageAnalyzer.cpp diff --git a/src/MeoAssistant/Vision/Roguelike/RoguelikeFormationImageAnalyzer.h b/src/MaaCore/Vision/Roguelike/RoguelikeFormationImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Roguelike/RoguelikeFormationImageAnalyzer.h rename to src/MaaCore/Vision/Roguelike/RoguelikeFormationImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/Roguelike/RoguelikeRecruitImageAnalyzer.cpp b/src/MaaCore/Vision/Roguelike/RoguelikeRecruitImageAnalyzer.cpp similarity index 100% rename from src/MeoAssistant/Vision/Roguelike/RoguelikeRecruitImageAnalyzer.cpp rename to src/MaaCore/Vision/Roguelike/RoguelikeRecruitImageAnalyzer.cpp diff --git a/src/MeoAssistant/Vision/Roguelike/RoguelikeRecruitImageAnalyzer.h b/src/MaaCore/Vision/Roguelike/RoguelikeRecruitImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Roguelike/RoguelikeRecruitImageAnalyzer.h rename to src/MaaCore/Vision/Roguelike/RoguelikeRecruitImageAnalyzer.h diff --git a/src/MeoAssistant/Vision/Roguelike/RoguelikeSkillSelectionImageAnalyzer.cpp b/src/MaaCore/Vision/Roguelike/RoguelikeSkillSelectionImageAnalyzer.cpp similarity index 100% rename from src/MeoAssistant/Vision/Roguelike/RoguelikeSkillSelectionImageAnalyzer.cpp rename to src/MaaCore/Vision/Roguelike/RoguelikeSkillSelectionImageAnalyzer.cpp diff --git a/src/MeoAssistant/Vision/Roguelike/RoguelikeSkillSelectionImageAnalyzer.h b/src/MaaCore/Vision/Roguelike/RoguelikeSkillSelectionImageAnalyzer.h similarity index 100% rename from src/MeoAssistant/Vision/Roguelike/RoguelikeSkillSelectionImageAnalyzer.h rename to src/MaaCore/Vision/Roguelike/RoguelikeSkillSelectionImageAnalyzer.h diff --git a/src/MeoAssistant/re-include.py b/src/MaaCore/re-include.py similarity index 100% rename from src/MeoAssistant/re-include.py rename to src/MaaCore/re-include.py diff --git a/src/MaaMacGui b/src/MaaMacGui new file mode 160000 index 0000000000..32fb20c0b9 --- /dev/null +++ b/src/MaaMacGui @@ -0,0 +1 @@ +Subproject commit 32fb20c0b9826642f3ffb67707daf2c10e20f45b diff --git a/src/MeoAsstGui/.editorconfig b/src/MaaWpfGui/.editorconfig similarity index 100% rename from src/MeoAsstGui/.editorconfig rename to src/MaaWpfGui/.editorconfig diff --git a/src/MeoAsstGui/App.config b/src/MaaWpfGui/App.config similarity index 97% rename from src/MeoAsstGui/App.config rename to src/MaaWpfGui/App.config index d3b6d9590a..3678fb2756 100644 --- a/src/MeoAsstGui/App.config +++ b/src/MaaWpfGui/App.config @@ -1,18 +1,18 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/MeoAsstGui/App.xaml b/src/MaaWpfGui/App.xaml similarity index 91% rename from src/MeoAsstGui/App.xaml rename to src/MaaWpfGui/App.xaml index c6b9e2510b..fc03f429f2 100644 --- a/src/MeoAsstGui/App.xaml +++ b/src/MaaWpfGui/App.xaml @@ -1,8 +1,8 @@  - + diff --git a/src/MeoAsstGui/App.xaml.cs b/src/MaaWpfGui/App.xaml.cs similarity index 88% rename from src/MeoAsstGui/App.xaml.cs rename to src/MaaWpfGui/App.xaml.cs index bf36c9746b..3942b52c68 100644 --- a/src/MeoAsstGui/App.xaml.cs +++ b/src/MaaWpfGui/App.xaml.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -13,7 +13,7 @@ using System.Windows; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// App.xaml 的交互逻辑 diff --git a/src/MeoAsstGui/FodyWeavers.xml b/src/MaaWpfGui/FodyWeavers.xml similarity index 100% rename from src/MeoAsstGui/FodyWeavers.xml rename to src/MaaWpfGui/FodyWeavers.xml diff --git a/src/MeoAsstGui/GlobalSuppressions.cs b/src/MaaWpfGui/GlobalSuppressions.cs similarity index 98% rename from src/MeoAsstGui/GlobalSuppressions.cs rename to src/MaaWpfGui/GlobalSuppressions.cs index feef3b9f86..72097ba6d0 100644 --- a/src/MeoAsstGui/GlobalSuppressions.cs +++ b/src/MaaWpfGui/GlobalSuppressions.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify diff --git a/src/MeoAsstGui/Helper/AutoScroll.cs b/src/MaaWpfGui/Helper/AutoScroll.cs similarity index 97% rename from src/MeoAsstGui/Helper/AutoScroll.cs rename to src/MaaWpfGui/Helper/AutoScroll.cs index 9fbebaa445..747dbf5b39 100644 --- a/src/MeoAsstGui/Helper/AutoScroll.cs +++ b/src/MaaWpfGui/Helper/AutoScroll.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ using System; using System.Windows; using System.Windows.Controls; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The auto scroll property. diff --git a/src/MeoAsstGui/ViewModels/StartSelfModel.cs b/src/MaaWpfGui/Helper/AutoStart.cs similarity index 94% rename from src/MeoAsstGui/ViewModels/StartSelfModel.cs rename to src/MaaWpfGui/Helper/AutoStart.cs index cb8f9348b4..7f9dc31356 100644 --- a/src/MeoAsstGui/ViewModels/StartSelfModel.cs +++ b/src/MaaWpfGui/Helper/AutoStart.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -14,12 +14,12 @@ using System.Diagnostics; using Microsoft.Win32; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The model of auto-starting settings. /// - public class StartSelfModel + public class AutoStart { private static readonly string fileValue = Process.GetCurrentProcess().MainModule?.FileName; diff --git a/src/MeoAsstGui/Helper/CombData.cs b/src/MaaWpfGui/Helper/CombData.cs similarity index 90% rename from src/MeoAsstGui/Helper/CombData.cs rename to src/MaaWpfGui/Helper/CombData.cs index d06aed8d97..174e87384d 100644 --- a/src/MeoAsstGui/Helper/CombData.cs +++ b/src/MaaWpfGui/Helper/CombData.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -11,7 +11,7 @@ // but WITHOUT ANY WARRANTY // -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The with as the value type. diff --git a/src/MeoAsstGui/Helper/ComboBoxExtensions.cs b/src/MaaWpfGui/Helper/ComboBoxExtensions.cs similarity index 97% rename from src/MeoAsstGui/Helper/ComboBoxExtensions.cs rename to src/MaaWpfGui/Helper/ComboBoxExtensions.cs index 2f94445208..30a3af5f05 100644 --- a/src/MeoAsstGui/Helper/ComboBoxExtensions.cs +++ b/src/MaaWpfGui/Helper/ComboBoxExtensions.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -14,7 +14,7 @@ using System.Windows.Controls; using System.Windows.Input; -namespace MeoAsstGui.Helper +namespace MaaWpfGui.Helper { /// /// Extensions diff --git a/src/MeoAsstGui/Helper/DragItemViewModel.cs b/src/MaaWpfGui/Helper/DragItemViewModel.cs similarity index 97% rename from src/MeoAsstGui/Helper/DragItemViewModel.cs rename to src/MaaWpfGui/Helper/DragItemViewModel.cs index 18ff2c336b..4baffa606e 100644 --- a/src/MeoAsstGui/Helper/DragItemViewModel.cs +++ b/src/MaaWpfGui/Helper/DragItemViewModel.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -13,7 +13,7 @@ using Stylet; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The view model of drag item. diff --git a/src/MeoAsstGui/ViewModels/ErrorView.xaml.cs b/src/MaaWpfGui/Helper/ErrorView.xaml.cs similarity index 96% rename from src/MeoAsstGui/ViewModels/ErrorView.xaml.cs rename to src/MaaWpfGui/Helper/ErrorView.xaml.cs index 655ee639fe..44305940e0 100644 --- a/src/MeoAsstGui/ViewModels/ErrorView.xaml.cs +++ b/src/MaaWpfGui/Helper/ErrorView.xaml.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ using System.Diagnostics; using System.Windows; using System.Windows.Documents; -namespace MeoAsstGui.Views +namespace MaaWpfGui.Views { /// /// ErrorView.xaml 的交互逻辑 diff --git a/src/MeoAsstGui/Helper/FlowDocumentPagePadding.cs b/src/MaaWpfGui/Helper/FlowDocumentPagePadding.cs similarity index 97% rename from src/MeoAsstGui/Helper/FlowDocumentPagePadding.cs rename to src/MaaWpfGui/Helper/FlowDocumentPagePadding.cs index 99e7bad492..00ece7e9ff 100644 --- a/src/MeoAsstGui/Helper/FlowDocumentPagePadding.cs +++ b/src/MaaWpfGui/Helper/FlowDocumentPagePadding.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ using System.ComponentModel; using System.Windows; using System.Windows.Documents; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The flow document page padding property. diff --git a/src/MeoAsstGui/Helper/GenericCombData{TValueType}.cs b/src/MaaWpfGui/Helper/GenericCombData{TValueType}.cs similarity index 92% rename from src/MeoAsstGui/Helper/GenericCombData{TValueType}.cs rename to src/MaaWpfGui/Helper/GenericCombData{TValueType}.cs index 135edabff3..bca5a8e4a8 100644 --- a/src/MeoAsstGui/Helper/GenericCombData{TValueType}.cs +++ b/src/MaaWpfGui/Helper/GenericCombData{TValueType}.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -11,7 +11,7 @@ // but WITHOUT ANY WARRANTY // -namespace MeoAsstGui +namespace MaaWpfGui { /// /// Generic combinated data class. diff --git a/src/MeoAsstGui/Helper/IMainWindowManager.cs b/src/MaaWpfGui/Helper/IMainWindowManager.cs similarity index 94% rename from src/MeoAsstGui/Helper/IMainWindowManager.cs rename to src/MaaWpfGui/Helper/IMainWindowManager.cs index 95a13efe83..c037499118 100644 --- a/src/MeoAsstGui/Helper/IMainWindowManager.cs +++ b/src/MaaWpfGui/Helper/IMainWindowManager.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -13,7 +13,7 @@ using System.Windows; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// Manager of the MAA main window diff --git a/src/MeoAsstGui/Helper/Localization.cs b/src/MaaWpfGui/Helper/Localization.cs similarity index 92% rename from src/MeoAsstGui/Helper/Localization.cs rename to src/MaaWpfGui/Helper/Localization.cs index a8723641e3..6235f57fd7 100644 --- a/src/MeoAsstGui/Helper/Localization.cs +++ b/src/MaaWpfGui/Helper/Localization.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -18,7 +18,7 @@ using System.Runtime.ConstrainedExecution; using System.Windows; using System.Windows.Input; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The localization class. @@ -76,7 +76,7 @@ namespace MeoAsstGui { var dictionary = new ResourceDictionary { - Source = new Uri($@"Resources\Localizations\{cur}.xaml", UriKind.Relative), + Source = new Uri($@"Res\Localizations\{cur}.xaml", UriKind.Relative), }; Application.Current.Resources.MergedDictionaries.Add(dictionary); @@ -99,7 +99,7 @@ namespace MeoAsstGui { var dictionary = new ResourceDictionary { - Source = new Uri($@"Resources\Localizations\{culture}.xaml", UriKind.Relative), + Source = new Uri($@"Res\Localizations\{culture}.xaml", UriKind.Relative), }; if (dictionary.Contains(key)) { diff --git a/src/MeoAsstGui/Helper/LogItemViewModel.cs b/src/MaaWpfGui/Helper/LogItemViewModel.cs similarity index 96% rename from src/MeoAsstGui/Helper/LogItemViewModel.cs rename to src/MaaWpfGui/Helper/LogItemViewModel.cs index e0238c9fb4..dea7bb3092 100644 --- a/src/MeoAsstGui/Helper/LogItemViewModel.cs +++ b/src/MaaWpfGui/Helper/LogItemViewModel.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -14,7 +14,7 @@ using System; using Stylet; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The view model of log item. diff --git a/src/MeoAsstGui/Helper/Logger.cs b/src/MaaWpfGui/Helper/Logger.cs similarity index 93% rename from src/MeoAsstGui/Helper/Logger.cs rename to src/MaaWpfGui/Helper/Logger.cs index a93a7593cc..1f6548a035 100644 --- a/src/MeoAsstGui/Helper/Logger.cs +++ b/src/MaaWpfGui/Helper/Logger.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -19,7 +19,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms.VisualStyles; -namespace MeoAsstGui +namespace MaaWpfGui { public class Logger { diff --git a/src/MeoAsstGui/Helper/MaaHotKeys/IMaaHotKeyActionHandler.cs b/src/MaaWpfGui/Helper/MaaHotKeys/IMaaHotKeyActionHandler.cs similarity index 86% rename from src/MeoAsstGui/Helper/MaaHotKeys/IMaaHotKeyActionHandler.cs rename to src/MaaWpfGui/Helper/MaaHotKeys/IMaaHotKeyActionHandler.cs index 63e578fc61..f592ffe4b6 100644 --- a/src/MeoAsstGui/Helper/MaaHotKeys/IMaaHotKeyActionHandler.cs +++ b/src/MaaWpfGui/Helper/MaaHotKeys/IMaaHotKeyActionHandler.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -11,7 +11,7 @@ // but WITHOUT ANY WARRANTY // -namespace MeoAsstGui.MaaHotKeys +namespace MaaWpfGui.MaaHotKeys { public interface IMaaHotKeyActionHandler { diff --git a/src/MeoAsstGui/Helper/MaaHotKeys/IMaaHotKeyManager.cs b/src/MaaWpfGui/Helper/MaaHotKeys/IMaaHotKeyManager.cs similarity index 88% rename from src/MeoAsstGui/Helper/MaaHotKeys/IMaaHotKeyManager.cs rename to src/MaaWpfGui/Helper/MaaHotKeys/IMaaHotKeyManager.cs index 221e5bb910..8e9362427f 100644 --- a/src/MeoAsstGui/Helper/MaaHotKeys/IMaaHotKeyManager.cs +++ b/src/MaaWpfGui/Helper/MaaHotKeys/IMaaHotKeyManager.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -13,7 +13,7 @@ using GlobalHotKey; -namespace MeoAsstGui.MaaHotKeys +namespace MaaWpfGui.MaaHotKeys { public interface IMaaHotKeyManager { diff --git a/src/MeoAsstGui/Helper/MaaHotKeys/MaaHotKey.cs b/src/MaaWpfGui/Helper/MaaHotKeys/MaaHotKey.cs similarity index 93% rename from src/MeoAsstGui/Helper/MaaHotKeys/MaaHotKey.cs rename to src/MaaWpfGui/Helper/MaaHotKeys/MaaHotKey.cs index 72e46ade1a..79a4495e40 100644 --- a/src/MeoAsstGui/Helper/MaaHotKeys/MaaHotKey.cs +++ b/src/MaaWpfGui/Helper/MaaHotKeys/MaaHotKey.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ using System.Text; using System.Windows.Input; using GlobalHotKey; -namespace MeoAsstGui.MaaHotKeys +namespace MaaWpfGui.MaaHotKeys { public class MaaHotKey : HotKey { diff --git a/src/MeoAsstGui/Helper/MaaHotKeys/MaaHotKeyAction.cs b/src/MaaWpfGui/Helper/MaaHotKeys/MaaHotKeyAction.cs similarity index 86% rename from src/MeoAsstGui/Helper/MaaHotKeys/MaaHotKeyAction.cs rename to src/MaaWpfGui/Helper/MaaHotKeys/MaaHotKeyAction.cs index 4b8459cf25..0b9c4632a1 100644 --- a/src/MeoAsstGui/Helper/MaaHotKeys/MaaHotKeyAction.cs +++ b/src/MaaWpfGui/Helper/MaaHotKeys/MaaHotKeyAction.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -13,7 +13,7 @@ using System; -namespace MeoAsstGui.MaaHotKeys +namespace MaaWpfGui.MaaHotKeys { [Flags] public enum MaaHotKeyAction diff --git a/src/MeoAsstGui/Helper/MaaHotKeys/MaaHotKeyActionHandler.cs b/src/MaaWpfGui/Helper/MaaHotKeys/MaaHotKeyActionHandler.cs similarity index 96% rename from src/MeoAsstGui/Helper/MaaHotKeys/MaaHotKeyActionHandler.cs rename to src/MaaWpfGui/Helper/MaaHotKeys/MaaHotKeyActionHandler.cs index 2b03dac804..9a18977311 100644 --- a/src/MeoAsstGui/Helper/MaaHotKeys/MaaHotKeyActionHandler.cs +++ b/src/MaaWpfGui/Helper/MaaHotKeys/MaaHotKeyActionHandler.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ using System; using System.Windows; using StyletIoC; -namespace MeoAsstGui.MaaHotKeys +namespace MaaWpfGui.MaaHotKeys { public class MaaHotKeyActionHandler : IMaaHotKeyActionHandler { diff --git a/src/MeoAsstGui/Helper/MaaHotKeys/MaaHotKeyManager.cs b/src/MaaWpfGui/Helper/MaaHotKeys/MaaHotKeyManager.cs similarity index 97% rename from src/MeoAsstGui/Helper/MaaHotKeys/MaaHotKeyManager.cs rename to src/MaaWpfGui/Helper/MaaHotKeys/MaaHotKeyManager.cs index 1383e89b5a..1b00270814 100644 --- a/src/MeoAsstGui/Helper/MaaHotKeys/MaaHotKeyManager.cs +++ b/src/MaaWpfGui/Helper/MaaHotKeys/MaaHotKeyManager.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -19,7 +19,7 @@ using GlobalHotKey; using Newtonsoft.Json; using StyletIoC; -namespace MeoAsstGui.MaaHotKeys +namespace MaaWpfGui.MaaHotKeys { public class MaaHotKeyManager : IMaaHotKeyManager { diff --git a/src/MeoAsstGui/Helper/MaaUrls.cs b/src/MaaWpfGui/Helper/MaaUrls.cs similarity index 55% rename from src/MeoAsstGui/Helper/MaaUrls.cs rename to src/MaaWpfGui/Helper/MaaUrls.cs index ae18da4d59..b4f7e277b9 100644 --- a/src/MeoAsstGui/Helper/MaaUrls.cs +++ b/src/MaaWpfGui/Helper/MaaUrls.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -14,7 +14,7 @@ using System.Collections.Generic; using System.Linq; -namespace MeoAsstGui +namespace MaaWpfGui { public static class MaaUrls { @@ -32,18 +32,26 @@ namespace MeoAsstGui public static string CustomInfrastGenerator => "https://yituliu.site/riicCal"; - public static List QqGroups { get; } = new List + public static string QqGroups => "https://ota.maa.plus/MaaAssistantArknights/api/qqgroup/"; + + public static string QQchannel => "https://pd.qq.com/s/4j1ju9z47"; + + private static readonly Dictionary _helpUrl = new Dictionary { - "https://jq.qq.com/?k=xRh6gqQZ", - "https://jq.qq.com/?k=u9i2n7Sb", - "https://jq.qq.com/?k=mKdOnhWV", - "https://jq.qq.com/?k=h6FGp0qD", - "https://jq.qq.com/?k=To6b6H6m", - "https://jq.qq.com/?k=K8t6W7HZ", - "https://jq.qq.com/?k=gGRc2Rlw", - "https://jq.qq.com/?k=NOpUOidq", + { "zh-cn", "1.2-常见问题.md" }, + { "en-us", "en-us/1.2-FAQ.md" }, + { "ja-jp", "ja-jp/1.2-よくある質問.md" }, + { "ko-kr", "ko-kr/1.2-FAQ.md" }, + { "zh-tw", "zh-tw/1.2-常見問題.md" }, }; - public static string LatestQqGroup => QqGroups.Last(); + public static string HelpUri + { + get + { + var language = ViewStatusStorage.Get("GUI.Localization", Localization.DefaultLanguage); + return $"https://github.com/MaaAssistantArknights/MaaAssistantArknights/tree/master/docs/{_helpUrl[language]}"; + } + } } } diff --git a/src/MeoAsstGui/Helper/MainWindowManager.cs b/src/MaaWpfGui/Helper/MainWindowManager.cs similarity index 97% rename from src/MeoAsstGui/Helper/MainWindowManager.cs rename to src/MaaWpfGui/Helper/MainWindowManager.cs index fc21f75250..859aeec4d4 100644 --- a/src/MeoAsstGui/Helper/MainWindowManager.cs +++ b/src/MaaWpfGui/Helper/MainWindowManager.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -14,7 +14,7 @@ using System; using System.Windows; -namespace MeoAsstGui +namespace MaaWpfGui { /// public class MainWindowManager : IMainWindowManager diff --git a/src/MeoAsstGui/Helper/MessageBoxManager.cs b/src/MaaWpfGui/Helper/MessageBoxManager.cs similarity index 99% rename from src/MeoAsstGui/Helper/MessageBoxManager.cs rename to src/MaaWpfGui/Helper/MessageBoxManager.cs index 27eefea5d0..9d7f6a37f1 100644 --- a/src/MeoAsstGui/Helper/MessageBoxManager.cs +++ b/src/MaaWpfGui/Helper/MessageBoxManager.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify diff --git a/src/MeoAsstGui/Helper/ScrollViewerBinding.cs b/src/MaaWpfGui/Helper/ScrollViewerBinding.cs similarity index 99% rename from src/MeoAsstGui/Helper/ScrollViewerBinding.cs rename to src/MaaWpfGui/Helper/ScrollViewerBinding.cs index e90cb382a5..2a2180bbbb 100644 --- a/src/MeoAsstGui/Helper/ScrollViewerBinding.cs +++ b/src/MaaWpfGui/Helper/ScrollViewerBinding.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Shapes; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The scroll viewer properties. diff --git a/src/MeoAsstGui/Helper/StageActivityInfo.cs b/src/MaaWpfGui/Helper/StageActivityInfo.cs similarity index 95% rename from src/MeoAsstGui/Helper/StageActivityInfo.cs rename to src/MaaWpfGui/Helper/StageActivityInfo.cs index 965f5fcf9a..51dcaf61cf 100644 --- a/src/MeoAsstGui/Helper/StageActivityInfo.cs +++ b/src/MaaWpfGui/Helper/StageActivityInfo.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -13,7 +13,7 @@ using System; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// Stage activity info diff --git a/src/MeoAsstGui/Helper/StageInfo.cs b/src/MaaWpfGui/Helper/StageInfo.cs similarity index 97% rename from src/MeoAsstGui/Helper/StageInfo.cs rename to src/MaaWpfGui/Helper/StageInfo.cs index 5120d543f3..276475a2c4 100644 --- a/src/MeoAsstGui/Helper/StageInfo.cs +++ b/src/MaaWpfGui/Helper/StageInfo.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ using System; using System.Collections.Generic; using System.Linq; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// Stage info diff --git a/src/MeoAsstGui/Helper/StageManager.cs b/src/MaaWpfGui/Helper/StageManager.cs similarity index 91% rename from src/MeoAsstGui/Helper/StageManager.cs rename to src/MaaWpfGui/Helper/StageManager.cs index dadef82e50..93131bd7c7 100644 --- a/src/MeoAsstGui/Helper/StageManager.cs +++ b/src/MaaWpfGui/Helper/StageManager.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// Stage manager @@ -32,9 +32,9 @@ namespace MeoAsstGui { var sideStory = new StageActivityInfo() { - Tip = "SideStory「叙拉古人」活动", - UtcStartTime = new DateTime(2022, 11, 1, 16, 0, 0).AddHours(-8), - UtcExpireTime = new DateTime(2022, 11, 22, 4, 0, 0).AddHours(-8), + Tip = "SideStory「风雪过境」复刻活动", + UtcStartTime = new DateTime(2022, 12, 1, 16, 0, 0).AddHours(-8), + UtcExpireTime = new DateTime(2022, 12, 15, 4, 0, 0).AddHours(-8), }; var resourceCollection = new StageActivityInfo() @@ -51,10 +51,10 @@ namespace MeoAsstGui // 「当前/上次」关卡导航 { string.Empty, new StageInfo { Display = Localization.GetString("DefaultStage"), Value = string.Empty } }, - // SideStory「叙拉古人」活动 - { "IS-8", new StageInfo { Display = "IS-8", Value = "IS-8", Activity = sideStory } }, - { "IS-9", new StageInfo { Display = "IS-9", Value = "IS-9", Activity = sideStory } }, - { "IS-10", new StageInfo { Display = "IS-10", Value = "IS-10", Activity = sideStory } }, + // SideStory「风雪过境」复刻活动 + { "BI-8", new StageInfo { Display = "BI-8", Value = "BI-8", Activity = sideStory } }, + { "BI-7", new StageInfo { Display = "BI-7", Value = "BI-7", Activity = sideStory } }, + { "BI-6", new StageInfo { Display = "BI-6", Value = "BI-6", Activity = sideStory } }, // 主线关卡 { "1-7", new StageInfo { Display = "1-7", Value = "1-7" } }, diff --git a/src/MeoAsstGui/Helper/ToastNotification.cs b/src/MaaWpfGui/Helper/ToastNotification.cs similarity index 99% rename from src/MeoAsstGui/Helper/ToastNotification.cs rename to src/MaaWpfGui/Helper/ToastNotification.cs index c248d73202..63197f995b 100644 --- a/src/MeoAsstGui/Helper/ToastNotification.cs +++ b/src/MaaWpfGui/Helper/ToastNotification.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -32,7 +32,7 @@ using Notification.Wpf.Constants; using Notification.Wpf.Controls; using Stylet; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The toast notification. diff --git a/src/MeoAsstGui/Helper/TrayIcon.cs b/src/MaaWpfGui/Helper/TrayIcon.cs similarity index 98% rename from src/MeoAsstGui/Helper/TrayIcon.cs rename to src/MaaWpfGui/Helper/TrayIcon.cs index 998e0310dc..05aa14206d 100644 --- a/src/MeoAsstGui/Helper/TrayIcon.cs +++ b/src/MaaWpfGui/Helper/TrayIcon.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ using System.Windows; using System.Windows.Forms; using StyletIoC; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// 托盘图标。 diff --git a/src/MeoAsstGui/Helper/UILogColor.cs b/src/MaaWpfGui/Helper/UILogColor.cs similarity index 95% rename from src/MeoAsstGui/Helper/UILogColor.cs rename to src/MaaWpfGui/Helper/UILogColor.cs index a9f2b3d3e3..a4dcea6bcf 100644 --- a/src/MeoAsstGui/Helper/UILogColor.cs +++ b/src/MaaWpfGui/Helper/UILogColor.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -11,7 +11,7 @@ // but WITHOUT ANY WARRANTY // -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The recommended colors for logs. diff --git a/src/MeoAsstGui/Helper/ViewStatusStorage.cs b/src/MaaWpfGui/Helper/ViewStatusStorage.cs similarity index 98% rename from src/MeoAsstGui/Helper/ViewStatusStorage.cs rename to src/MaaWpfGui/Helper/ViewStatusStorage.cs index 9e46352c81..a7d6f3b3ed 100644 --- a/src/MeoAsstGui/Helper/ViewStatusStorage.cs +++ b/src/MaaWpfGui/Helper/ViewStatusStorage.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ using System.Reflection; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// 界面设置存储(读写json文件) diff --git a/src/MeoAsstGui/Helper/WinAdapter.cs b/src/MaaWpfGui/Helper/WinAdapter.cs similarity index 98% rename from src/MeoAsstGui/Helper/WinAdapter.cs rename to src/MaaWpfGui/Helper/WinAdapter.cs index 22ef34087a..9493edf672 100644 --- a/src/MeoAsstGui/Helper/WinAdapter.cs +++ b/src/MaaWpfGui/Helper/WinAdapter.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ using System.Diagnostics; using System.IO; using System.Linq; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The emulator adapter. diff --git a/src/MeoAsstGui/MeoAsstGui.csproj b/src/MaaWpfGui/MaaWpfGui.csproj similarity index 82% rename from src/MeoAsstGui/MeoAsstGui.csproj rename to src/MaaWpfGui/MaaWpfGui.csproj index d064738b87..face25fa5e 100644 --- a/src/MeoAsstGui/MeoAsstGui.csproj +++ b/src/MaaWpfGui/MaaWpfGui.csproj @@ -1,495 +1,502 @@ - - - - - Debug - AnyCPU - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2} - WinExe - MeoAsstGui - MeoAsstGui - v4.8 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - true - false - - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - https://github.com/MistEO/MeoAssistantArknights - https://github.com/MistEO/MeoAssistantArknights/issues - Meo明日方舟辅助 - MistEO - MeoAssistant - 0 - 4.0.0.0 - false - true - - - OnBuildSuccess - - - newlogo.ico - - - MeoAsstGui.App - - - ..\..\x64\Release\ - TRACE - true - pdbonly - x64 - 8.0 - prompt - ..\..\x64\Release\MeoAsstGui.xml - true - - - ..\..\x64\RelWithDebInfo\ - DEBUG;TRACE - false - pdbonly - x64 - 8.0 - prompt - true - - - - false - true - - - - - - - - - - - - - - - - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GUISettingsUserControl.xaml - - - - - HotKeyEditorUserControl.xaml - - - HotKeySettingsUserControl.xaml - - - StartSettingsUserControl.xaml - - - TimerSettingsUserControl.xaml - - - AutoRecruitSettingsUserControl.xaml - - - ConnectSettingsUserControl.xaml - - - RoguelikeSettingsUserControl.xaml - - - MallSettingsUserControl.xaml - - - InfrastSettingsUserControl.xaml - - - FightSettingsUserControl.xaml - - - - PenguinReportSettingsUserControl.xaml - - - AboutUserControl.xaml - - - VersionUpdateSettingsUserControl.xaml - - - - - - - - - - - App.xaml - Code - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - - MSBuild:Compile - Designer - - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - Code - - - - - - - - - False - Microsoft .NET Framework 4.7.2 %28x86 和 x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - - 2.5.2 - - - 5.7.0 - All - - - 1.1.0 - - - 3.1.1 - - - 3.3.0 - - - 1.15.0 - - - 6.0.4 - - - 7.1.2 - - - 4.3.0 - - - 1.0.10 - - - 2.0.3 - - - 13.0.1 - - - 6.1.0.5 - - - 2.2.0 - - - 1.2.0-beta.435 - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - 1.3.6 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.1 - - - 4.3.0 - - - 6.0.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.4 - - - 4.3.1 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.1 - - - 4.3.1 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.1 - - - 4.3.2 - - - 4.3.0 - - - 4.3.0 - - - 4.3.1 - - - 4.3.0 - - - 4.3.0 - - - 4.3.0 - - - 4.3.1 - - - 4.3.0 - - - - - - - - xcopy /e /y /i /c "$(ProjectDir)..\..\3rdparty\tools" "$(TargetDir)" -xcopy /e /y /i /c "$(ProjectDir)..\..\src\Python" "$(TargetDir)\Python" - + + + + + Debug + AnyCPU + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2} + WinExe + MaaWpfGui + MAA + v4.8 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + true + false + + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + https://github.com/MistEO/MaaCoreArknights + https://github.com/MistEO/MaaCoreArknights/issues + Meo明日方舟辅助 + MistEO + MaaCore + 0 + 4.0.0.0 + false + true + + + OnBuildSuccess + + + newlogo.ico + + + MaaWpfGui.App + + + ..\..\x64\Release\ + TRACE + true + pdbonly + x64 + 8.0 + prompt + ..\..\x64\Release\MAA.xml + true + + + ..\..\x64\RelWithDebInfo\ + DEBUG;TRACE + false + pdbonly + x64 + 8.0 + prompt + true + + + + false + true + + + + + + + + + + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GameClientUserControl.xaml + + + GUISettingsUserControl.xaml + + + + + HotKeyEditorUserControl.xaml + + + HotKeySettingsUserControl.xaml + + + StartSettingsUserControl.xaml + + + TimerSettingsUserControl.xaml + + + AutoRecruitSettingsUserControl.xaml + + + ConnectSettingsUserControl.xaml + + + RoguelikeSettingsUserControl.xaml + + + MallSettingsUserControl.xaml + + + InfrastSettingsUserControl.xaml + + + FightSettingsUserControl.xaml + + + + PenguinReportSettingsUserControl.xaml + + + AboutUserControl.xaml + + + VersionUpdateSettingsUserControl.xaml + + + + + + + + + + + App.xaml + Code + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + MSBuild:Compile + Designer + + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + Code + + + + + + + + + False + Microsoft .NET Framework 4.7.2 %28x86 和 x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + + 2.5.2 + + + 5.7.0 + All + + + 1.1.0 + + + 3.1.1 + + + 3.3.0 + + + 1.15.0 + + + 6.0.4 + + + 7.1.2 + + + 4.3.0 + + + 1.0.10 + + + 2.0.3 + + + 13.0.1 + + + 6.1.0.5 + + + 2.2.0 + + + 1.2.0-beta.435 + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + 1.3.6 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.1 + + + 4.3.0 + + + 6.0.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.4 + + + 4.3.1 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.1 + + + 4.3.1 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.1 + + + 4.3.2 + + + 4.3.0 + + + 4.3.0 + + + 4.3.1 + + + 4.3.0 + + + 4.3.0 + + + 4.3.0 + + + 4.3.1 + + + 4.3.0 + + + + + + + + xcopy /e /y /i /c "$(ProjectDir)..\..\3rdparty\tools" "$(TargetDir)" +xcopy /e /y /i /c "$(ProjectDir)..\..\src\Python" "$(TargetDir)\Python" + \ No newline at end of file diff --git a/src/MeoAsstGui/Helper/AsstProxy.cs b/src/MaaWpfGui/Main/AsstProxy.cs similarity index 98% rename from src/MeoAsstGui/Helper/AsstProxy.cs rename to src/MaaWpfGui/Main/AsstProxy.cs index 45fc40ad15..51cbd67215 100644 --- a/src/MeoAsstGui/Helper/AsstProxy.cs +++ b/src/MaaWpfGui/Main/AsstProxy.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -23,7 +23,7 @@ using Newtonsoft.Json.Linq; using Stylet; using StyletIoC; -namespace MeoAsstGui +namespace MaaWpfGui { #pragma warning disable SA1135 // Using directives should be qualified @@ -37,7 +37,7 @@ namespace MeoAsstGui #pragma warning disable SA1121 // Use built-in type alias /// - /// MeoAssistant 代理类。 + /// MaaCore 代理类。 /// public class AsstProxy { @@ -61,7 +61,7 @@ namespace MeoAsstGui } } - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern unsafe bool AsstLoadResource(byte* dirname); private static unsafe bool AsstLoadResource(string dirname) @@ -72,16 +72,16 @@ namespace MeoAsstGui } } - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern AsstHandle AsstCreate(); - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern AsstHandle AsstCreateEx(CallbackDelegate callback, IntPtr custom_arg); - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern void AsstDestroy(AsstHandle handle); - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern unsafe bool AsstSetInstanceOption(AsstHandle handle, AsstInstanceOptionKey key, byte* value); private static unsafe bool AsstSetInstanceOption(AsstHandle handle, AsstInstanceOptionKey key, string value) @@ -92,7 +92,7 @@ namespace MeoAsstGui } } - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern unsafe bool AsstConnect(AsstHandle handle, byte* adb_path, byte* address, byte* config); private static unsafe bool AsstConnect(AsstHandle handle, string adb_path, string address, string config) @@ -105,7 +105,7 @@ namespace MeoAsstGui } } - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern unsafe AsstTaskId AsstAppendTask(AsstHandle handle, byte* type, byte* task_params); private static unsafe AsstTaskId AsstAppendTask(AsstHandle handle, string type, string task_params) @@ -117,7 +117,7 @@ namespace MeoAsstGui } } - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern unsafe bool AsstSetTaskParams(AsstHandle handle, AsstTaskId id, byte* task_params); private static unsafe bool AsstSetTaskParams(AsstHandle handle, AsstTaskId id, string task_params) @@ -128,13 +128,13 @@ namespace MeoAsstGui } } - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern bool AsstStart(AsstHandle handle); - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern bool AsstStop(AsstHandle handle); - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern unsafe void AsstLog(byte* level, byte* message); /// @@ -267,7 +267,7 @@ namespace MeoAsstGui mainModel.SetInited(); mainModel.Idle = true; var settingsModel = _container.Get(); - settingsModel.UpdateTouchMode(); + settingsModel.UpdateInstanceSettings(); Execute.OnUIThread(async () => { var task = Task.Run(() => @@ -428,6 +428,10 @@ namespace MeoAsstGui case "ScreencapFailed": mainModel.AddLog(Localization.GetString("ScreencapFailed"), UILogColor.Error); break; + + case "TouchModeNotAvaiable": + mainModel.AddLog(Localization.GetString("TouchModeNotAvaiable"), UILogColor.Error); + break; } } @@ -1549,7 +1553,7 @@ namespace MeoAsstGui } /// - /// MeoAssistant 消息。 + /// MaaCore 消息。 /// public enum AsstMsg { @@ -1632,7 +1636,9 @@ namespace MeoAsstGui public enum InstanceOptionKey { - MinitouchEnabled = 1, + /* Deprecated */ // MinitouchEnabled = 1, + TouchMode = 2, + DeploymentWithPause = 3, } } diff --git a/src/MeoAsstGui/Bootstrapper.cs b/src/MaaWpfGui/Main/Bootstrapper.cs similarity index 79% rename from src/MeoAsstGui/Bootstrapper.cs rename to src/MaaWpfGui/Main/Bootstrapper.cs index 85b13f3595..8135b98fa6 100644 --- a/src/MeoAsstGui/Bootstrapper.cs +++ b/src/MaaWpfGui/Main/Bootstrapper.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -18,13 +18,13 @@ using System.Runtime.InteropServices; using System.Windows; using System.Windows.Threading; using GlobalHotKey; -using MeoAsstGui.MaaHotKeys; -using MeoAsstGui.Views; +using MaaWpfGui.MaaHotKeys; +using MaaWpfGui.Views; using Microsoft.Toolkit.Uwp.Notifications; using Stylet; using StyletIoC; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The bootstrapper. @@ -78,31 +78,15 @@ namespace MeoAsstGui } } - // TODO: Delete this - // 由于 zzyyyl 的失误,v4.6.5-beta.3 之后的版本会在更新时删除 Paddle,在发正式版后将下面的块删掉 - // 恢复被删除的 Paddle + foreach (var file in new DirectoryInfo(".").GetFiles("*.old")) { - string resourceDir = Directory.GetCurrentDirectory() + "\\resource"; - string oldResourceDir = Directory.GetCurrentDirectory() + "\\resource.old"; - - var paddleResourcePaths = new[] + try { - "\\PaddleOCR", - "\\PaddleCharOCR", - "\\global\\txwy\\resource\\PaddleOCR", - "\\global\\YoStarEN\\resource\\PaddleOCR", - "\\global\\YoStarJP\\resource\\PaddleOCR", - "\\global\\YoStarKR\\resource\\PaddleOCR", - }; - - foreach (var path in paddleResourcePaths) + file.Delete(); + } + catch (Exception) { - string paddleDir = resourceDir + path; - string oldPaddleDir = oldResourceDir + path; - if (Directory.Exists(oldPaddleDir) && !Directory.Exists(paddleDir)) - { - VersionUpdateViewModel.CopyFilesRecursively(oldPaddleDir, paddleDir); - } + // ignored } } diff --git a/src/MeoAsstGui/ViewModels/CopilotViewModel.cs b/src/MaaWpfGui/Main/CopilotViewModel.cs similarity index 99% rename from src/MeoAsstGui/ViewModels/CopilotViewModel.cs rename to src/MaaWpfGui/Main/CopilotViewModel.cs index 8723cedb1e..cd475589ca 100644 --- a/src/MeoAsstGui/ViewModels/CopilotViewModel.cs +++ b/src/MaaWpfGui/Main/CopilotViewModel.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -30,7 +30,7 @@ using DataFormats = System.Windows.Forms.DataFormats; using DragEventArgs = System.Windows.DragEventArgs; using Screen = Stylet.Screen; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The view model of copilot. @@ -425,7 +425,7 @@ namespace MeoAsstGui { AddLog(Localization.GetString("Running")); var settingsModel = _container.Get(); - if (!settingsModel.AdbReplaced && !settingsModel.UseAdbTouchMode) + if (!settingsModel.AdbReplaced && !settingsModel.IsAdbTouchMode()) { AddLog(Localization.GetString("AdbReplacementTips"), UILogColor.Info); } diff --git a/src/MeoAsstGui/ViewModels/DepotViewModel.cs b/src/MaaWpfGui/Main/DepotViewModel.cs similarity index 98% rename from src/MeoAsstGui/ViewModels/DepotViewModel.cs rename to src/MaaWpfGui/Main/DepotViewModel.cs index dadb925a03..8c8295c732 100644 --- a/src/MeoAsstGui/ViewModels/DepotViewModel.cs +++ b/src/MaaWpfGui/Main/DepotViewModel.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -19,7 +19,7 @@ using Newtonsoft.Json.Linq; using Stylet; using StyletIoC; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The view model of recruit. diff --git a/src/MeoAsstGui/ViewModels/RecruitViewModel.cs b/src/MaaWpfGui/Main/RecruitViewModel.cs similarity index 98% rename from src/MeoAsstGui/ViewModels/RecruitViewModel.cs rename to src/MaaWpfGui/Main/RecruitViewModel.cs index a368ab4f19..2490f1d0fd 100644 --- a/src/MeoAsstGui/ViewModels/RecruitViewModel.cs +++ b/src/MaaWpfGui/Main/RecruitViewModel.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ using System.Threading.Tasks; using Stylet; using StyletIoC; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The view model of recruit. diff --git a/src/MeoAsstGui/ViewModels/RootViewModel.cs b/src/MaaWpfGui/Main/RootViewModel.cs similarity index 97% rename from src/MeoAsstGui/ViewModels/RootViewModel.cs rename to src/MaaWpfGui/Main/RootViewModel.cs index b6fe268e3b..406b4c930d 100644 --- a/src/MeoAsstGui/ViewModels/RootViewModel.cs +++ b/src/MaaWpfGui/Main/RootViewModel.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -15,7 +15,7 @@ using System.Threading.Tasks; using Stylet; using StyletIoC; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The root view model. diff --git a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs b/src/MaaWpfGui/Main/SettingsViewModel.cs similarity index 97% rename from src/MeoAsstGui/ViewModels/SettingsViewModel.cs rename to src/MaaWpfGui/Main/SettingsViewModel.cs index fa4f0ba2dd..0fedc34192 100644 --- a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs +++ b/src/MaaWpfGui/Main/SettingsViewModel.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -21,12 +21,12 @@ using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using System.Windows; -using MeoAsstGui.MaaHotKeys; +using MaaWpfGui.MaaHotKeys; using Newtonsoft.Json.Linq; using Stylet; using StyletIoC; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The view model of settings. @@ -37,7 +37,7 @@ namespace MeoAsstGui private readonly IContainer _container; private readonly IMaaHotKeyManager _maaHotKeyManager; - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern IntPtr AsstGetVersion(); private static readonly string s_versionId = Marshal.PtrToStringAnsi(AsstGetVersion()); @@ -71,6 +71,7 @@ namespace MeoAsstGui _maaHotKeyManager = _container.Get(); DisplayName = Localization.GetString("Settings"); + _listTitle.Add(Localization.GetString("GameSettings")); _listTitle.Add(Localization.GetString("BaseSettings")); _listTitle.Add(Localization.GetString("RoguelikeSettings")); _listTitle.Add(Localization.GetString("RecruitingSettings")); @@ -179,6 +180,13 @@ namespace MeoAsstGui new CombData { Display = Localization.GetString("Compatible"), Value = "Compatible" }, }; + TouchModeList = new List + { + new CombData { Display = Localization.GetString("MiniTouchMode"), Value = "minitouch" }, + new CombData { Display = Localization.GetString("MaaTouchMode"), Value = "maatouch" }, + new CombData { Display = Localization.GetString("AdbTouchMode"), Value = "adb" }, + }; + _dormThresholdLabel = Localization.GetString("DormThreshold") + ": " + _dormThreshold + "%"; RoguelikeModeList = new List @@ -272,7 +280,7 @@ namespace MeoAsstGui } /* 启动设置 */ - private bool _startSelf = StartSelfModel.CheckStart(); + private bool _startSelf = MaaWpfGui.AutoStart.CheckStart(); /// /// Gets or sets a value indicating whether to start itself. @@ -283,7 +291,7 @@ namespace MeoAsstGui set { SetAndNotify(ref _startSelf, value); - StartSelfModel.SetStart(value); + MaaWpfGui.AutoStart.SetStart(value); } } @@ -512,6 +520,8 @@ namespace MeoAsstGui /// public List ConnectConfigList { get; set; } + public List TouchModeList { get; set; } + /// /// Gets or sets the list of inverse clear modes. /// @@ -1007,6 +1017,19 @@ namespace MeoAsstGui } } + private bool _deploymentWithPause = bool.Parse(ViewStatusStorage.Get("Roguelike.DeploymentWithPause", false.ToString())); + + public bool DeploymentWithPause + { + get => _deploymentWithPause; + set + { + SetAndNotify(ref _deploymentWithPause, value); + ViewStatusStorage.Set("Roguelike.DeploymentWithPause", value.ToString()); + UpdateInstanceSettings(); + } + } + /* 访问好友设置 */ private bool _creditFightTaskEnabled = Convert.ToBoolean(ViewStatusStorage.Get("Visit.CreditFightTaskEnabled", bool.FalseString)); @@ -1070,21 +1093,17 @@ namespace MeoAsstGui } } - private string _creditForceShoppingIfCreditFull = ViewStatusStorage.Get("Mall.CreditForceShoppingIfCreditFull", false.ToString()); + private bool _creditForceShoppingIfCreditFull = bool.Parse(ViewStatusStorage.Get("Mall.CreditForceShoppingIfCreditFull", false.ToString())); /// /// Gets or sets a value indicating whether save credit is enabled. /// public bool CreditForceShoppingIfCreditFull { - get - { - return bool.Parse(_creditForceShoppingIfCreditFull); - } - + get => _creditForceShoppingIfCreditFull; set { - SetAndNotify(ref _creditForceShoppingIfCreditFull, value.ToString()); + SetAndNotify(ref _creditForceShoppingIfCreditFull, value); ViewStatusStorage.Set("Mall.CreditForceShoppingIfCreditFull", value.ToString()); } } @@ -1854,23 +1873,29 @@ namespace MeoAsstGui } } - private bool _useAdbTouchMode = Convert.ToBoolean(ViewStatusStorage.Get("Connect.UseAdbTouchMode", false.ToString())); - - public bool UseAdbTouchMode + public bool IsAdbTouchMode() { - get => _useAdbTouchMode; + return TouchMode == "adb"; + } + + private string _touchMode = ViewStatusStorage.Get("Connect.TouchMode", "minitouch"); + + public string TouchMode + { + get => _touchMode; set { - SetAndNotify(ref _useAdbTouchMode, value); - ViewStatusStorage.Set("Connect.UseAdbTouchMode", value.ToString()); - UpdateTouchMode(); + SetAndNotify(ref _touchMode, value); + ViewStatusStorage.Set("Connect.TouchMode", value); + UpdateInstanceSettings(); } } - public void UpdateTouchMode() + public void UpdateInstanceSettings() { var asstProxy = _container.Get(); - asstProxy.AsstSetInstanceOption(InstanceOptionKey.MinitouchEnabled, UseAdbTouchMode ? "0" : "1"); + asstProxy.AsstSetInstanceOption(InstanceOptionKey.TouchMode, TouchMode); + asstProxy.AsstSetInstanceOption(InstanceOptionKey.DeploymentWithPause, DeploymentWithPause ? "1" : "0"); } private static readonly string GoogleAdbDownloadUrl = "https://dl.google.com/android/repository/platform-tools-latest-windows.zip"; @@ -2149,6 +2174,7 @@ namespace MeoAsstGui // var backup = _language; ViewStatusStorage.Set("GUI.Localization", value); + System.Windows.Forms.MessageBoxManager.Unregister(); System.Windows.Forms.MessageBoxManager.Yes = Localization.GetString("Ok", value); System.Windows.Forms.MessageBoxManager.No = Localization.GetString("ManualRestart", value); System.Windows.Forms.MessageBoxManager.Register(); diff --git a/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs b/src/MaaWpfGui/Main/TaskQueueViewModel.cs similarity index 98% rename from src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs rename to src/MaaWpfGui/Main/TaskQueueViewModel.cs index c20fe45641..ee4520a445 100644 --- a/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs +++ b/src/MaaWpfGui/Main/TaskQueueViewModel.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -22,13 +22,13 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; -using MeoAsstGui.Helper; +using MaaWpfGui.Helper; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Stylet; using StyletIoC; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The view model of task queue. @@ -141,7 +141,7 @@ namespace MeoAsstGui private void Timer1_Elapsed(object sender, EventArgs e) { - if (CheckAndUpdateDayOfWeek()) + if (NeedToUpdateDatePrompt()) { UpdateDatePrompt(); UpdateStageList(false); @@ -239,7 +239,7 @@ namespace MeoAsstGui RemainingSanityStageList[0] = new CombData { Display = Localization.GetString("NoUse"), Value = string.Empty }; InitDrops(); - CheckAndUpdateDayOfWeek(); + NeedToUpdateDatePrompt(); UpdateDatePrompt(); UpdateStageList(true); RefreshCustonInfrastPlan(); @@ -312,16 +312,21 @@ namespace MeoAsstGui } } - private bool CheckAndUpdateDayOfWeek() + private bool NeedToUpdateDatePrompt() { var now = DateTime.UtcNow.AddHours(8); var hour = now.Hour; + var min = now.Minute; if (hour >= 0 && hour < 4) { now = now.AddDays(-1); } - if (_curDayOfWeek == now.DayOfWeek) + if (min == 0 && hour == 16) + { + return true; + } + else if (_curDayOfWeek == now.DayOfWeek) { return false; } @@ -663,7 +668,7 @@ namespace MeoAsstGui { AddLog(Localization.GetString("Running")); var settingsModel = _container.Get(); - if (!settingsModel.AdbReplaced && !settingsModel.UseAdbTouchMode) + if (!settingsModel.AdbReplaced && !settingsModel.IsAdbTouchMode()) { AddLog(Localization.GetString("AdbReplacementTips"), UILogColor.Info); } @@ -1201,30 +1206,6 @@ namespace MeoAsstGui } } - /* - public void CheckAndShutdown() - { - if (Shutdown) - { - System.Diagnostics.Process.Start("shutdown.exe", "-s -t 60"); - - var result = _windowManager.ShowMessageBox("已刷完,即将关机,是否取消?", "提示", MessageBoxButton.OK, MessageBoxImage.Question); - if (result == MessageBoxResult.OK) - { - System.Diagnostics.Process.Start("shutdown.exe", "-a"); - } - } - if (Hibernate) - { - System.Diagnostics.Process.Start("shutdown.exe", "-h"); - } - if (Suspend) - { - System.Diagnostics.Process.Start("rundll32.exe", "powrprof.dll,SetSuspendState 0,1,0"); - } - } - */ - /// /// Gets a value indicating whether it is initialized. /// diff --git a/src/MeoAsstGui/ViewModels/VersionUpdateViewModel.cs b/src/MaaWpfGui/Main/VersionUpdateViewModel.cs similarity index 99% rename from src/MeoAsstGui/ViewModels/VersionUpdateViewModel.cs rename to src/MaaWpfGui/Main/VersionUpdateViewModel.cs index 82bcff191c..c0bbebafa9 100644 --- a/src/MeoAsstGui/ViewModels/VersionUpdateViewModel.cs +++ b/src/MaaWpfGui/Main/VersionUpdateViewModel.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -27,7 +27,7 @@ using Newtonsoft.Json.Linq; using Stylet; using StyletIoC; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// The view model of version update. @@ -48,7 +48,7 @@ namespace MeoAsstGui _windowManager = windowManager; } - [DllImport("MeoAssistant.dll")] + [DllImport("MaaCore.dll")] private static extern IntPtr AsstGetVersion(); private static string AddContributorLink(string text) @@ -452,6 +452,7 @@ namespace MeoAsstGui public void AskToRestart() { + System.Windows.Forms.MessageBoxManager.Unregister(); System.Windows.Forms.MessageBoxManager.Yes = Localization.GetString("Ok"); System.Windows.Forms.MessageBoxManager.No = Localization.GetString("ManualRestart"); System.Windows.Forms.MessageBoxManager.Register(); @@ -608,7 +609,7 @@ namespace MeoAsstGui /// /// API 地址 /// 返回 API 的返回值,如出现错误则返回空字符串 - private string RequestApi(string url) + public string RequestApi(string url) { try { diff --git a/src/MeoAsstGui/MeoAsstGui.csproj.DotSettings b/src/MaaWpfGui/MeoAsstGui.csproj.DotSettings similarity index 100% rename from src/MeoAsstGui/MeoAsstGui.csproj.DotSettings rename to src/MaaWpfGui/MeoAsstGui.csproj.DotSettings diff --git a/src/MeoAsstGui/Properties/AssemblyInfo.cs b/src/MaaWpfGui/Properties/AssemblyInfo.cs similarity index 94% rename from src/MeoAsstGui/Properties/AssemblyInfo.cs rename to src/MaaWpfGui/Properties/AssemblyInfo.cs index 92da604950..4e8a1fdbbb 100644 --- a/src/MeoAsstGui/Properties/AssemblyInfo.cs +++ b/src/MaaWpfGui/Properties/AssemblyInfo.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -19,11 +19,11 @@ using System.Windows; // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 -[assembly: AssemblyTitle("MeoAsstGui")] +[assembly: AssemblyTitle("MaaWpfGui")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MeoAsstGui")] +[assembly: AssemblyProduct("MaaWpfGui")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/src/MeoAsstGui/README.md b/src/MaaWpfGui/README.md similarity index 93% rename from src/MeoAsstGui/README.md rename to src/MaaWpfGui/README.md index 119ddda931..d5b60ffa40 100644 --- a/src/MeoAsstGui/README.md +++ b/src/MaaWpfGui/README.md @@ -1,4 +1,4 @@ -# MeoAsstGui +# MaaWpfGui 使用 C# WPF 编写的界面模块 diff --git a/src/MeoAsstGui/Resources/Localizations/en-us.xaml b/src/MaaWpfGui/Res/Localizations/en-us.xaml similarity index 95% rename from src/MeoAsstGui/Resources/Localizations/en-us.xaml rename to src/MaaWpfGui/Res/Localizations/en-us.xaml index 3114123d36..512a326a9c 100644 --- a/src/MeoAsstGui/Resources/Localizations/en-us.xaml +++ b/src/MaaWpfGui/Res/Localizations/en-us.xaml @@ -1,15 +1,16 @@  Settings + Client Base I.S. Recruit - Credit Store + Social Point Combat Connection Startup @@ -58,8 +59,9 @@ MuMu Emulator LD Player Nox - XYAZ + MEmu Old version of WSA + MaaTouch Compatible Mode Morale Threshold @@ -71,6 +73,7 @@ Starting Roles Starting Oper (single, CN name only) Only supports the CN name of a single oper, default if not filled. + Deployment with Pause (Works for IS, Copilot and 保全派驻) Default Mind over matter (to be updated) @@ -166,13 +169,16 @@ Auto start with PC Auto Run task after launched - Client version + Client Type Startup Emulator after launched Delay time Emulator exec path Select Forced Replace ADB File - Compatibility Touch Mode (without minitouch) + Touch Mode + Minitouch (Default) + MaaTouch (Experimental) + Adb Input (Compatibility) Addiction Command arguments I.S. Theme @@ -190,6 +196,8 @@ Wait in the using Originites confirmation screen until the 1 point of sanity has been restored and then immediately use the Originite. Social Point shopping + Combat with Support to earn credits + Combat with Support Unit in OF-1 after Visit Friends to earn 30 credits, do not check it if the stage is set to Current/Last Whitelist (split by semicolon) Blacklist (split by semicolon) Recruitment Permit;LMD @@ -205,10 +213,11 @@ Hide today not open level Variable function button Manual entry of level names - (Test feature) Support most main stage names + stage names from the original list (e.g. 4-10, AP-5, etc.) + Support most main stage names + stage names from the original list (e.g. 4-10, AP-5, H10-1-Hard, etc.) At the end of the level, enter "Normal/Hard" to switch between Normal and Tough difficulty Auto detect connection The checkbox will be automatically unchecked after each detect is completed, and can be checked again if you need to re-detect + Always detect ADB path (rel/abs) Connection address It will be filled in automatically when you use it for the first time. If you encounter any problems, you can try to manually modify it @@ -224,9 +233,7 @@ Recruit Base Combat - Combat with Support to earn credits - Combat with Support Unit in OF-1 after Visit Friends to earn 30 credits - Visit Friends + Credit Store Collect mission rewards Auto I.S. @@ -387,6 +394,7 @@ Reconnect succeeded. Continue the task Reconnect failed. The connection is down! Screencap failed. If it happens repeatedly, try restarting or changing the emulator. + Touch mode is not available, please enter Settings - Connection Settings to change other touch modes Identify error Task error: Combat error @@ -459,20 +467,10 @@ Copilot Json sharing site Copilot Map and Coordinate Custom Base Json Generator - QQ group: - QQ group 1 - QQ group 2 - QQ group 3 - QQ group 4 - QQ group 5 - QQ group 6 - QQ group 7 - QQ group 8 - (Full) + QQ group QQ channel Telegram FAQ - https://github.com/MaaAssistantArknights/MaaAssistantArknights/blob/master/docs/en-us/1.2-FAQ.md Issue diff --git a/src/MeoAsstGui/Resources/Localizations/ja-jp.xaml b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml similarity index 96% rename from src/MeoAsstGui/Resources/Localizations/ja-jp.xaml rename to src/MaaWpfGui/Res/Localizations/ja-jp.xaml index 0852823fd6..88897773d2 100644 --- a/src/MeoAsstGui/Resources/Localizations/ja-jp.xaml +++ b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml @@ -1,7 +1,7 @@  @@ -9,7 +9,7 @@ 基地設定 ローグ設定 公開求人設定 - FP交換所設定 + FP設定 戦闘設定 接続設定 起動設定 @@ -136,7 +136,7 @@ スタートアップ アプリの起動時に自動的に実行 - クライアントバージョン + クライアントバージョン 起動時にエミュレータ自動起動 エミュレータを待つ時間(秒) エミュレータパス @@ -158,6 +158,8 @@ 純正源石使用確認画面で理性が1回復するのを待って、純正源石を使用します FP交換 + サポートを借りて戦闘を行いポイントを獲得します + 戦友を借りて OF-1 で戦闘を行い、30クレジットを獲得します。ステージ設定が 現在/前回 になっている場合は確認を行いません。 優先購入(セミコロンで区切) ブラックリスト(セミコロンで区切) 求人票;龍門幣 @@ -174,16 +176,18 @@ 当日開放されないステージを隠す スタート画面に表示する便利ボタン ステージ名を入力する - (テスト機能)ステージ名と番号(例:4-10、AP-5など)の両方がサポートされています。 + (テスト機能)ステージ名と番号(例:4-10、AP-5、H10-1-Hardなど)の両方がサポートされています。 接続自動認識 このチェックボックスは、検出が完了するたびに自動的にチェックが外れますが、再検出が必要な場合は再度チェックを入れることができます + 常時検知 adbパス(相対/絶対) 接続先アドレス 問題があれば手動で修正してください。 接続構成 adb再接続失敗時にエミュレータを自動で再起動 再接続に20回失敗した後、エミュレータを再起動してみてください,バックグラウンドのタイムドタスクを使用し、終了時にエミュレータを終了させるタスクを設定する場合は、必ずチェックを入れること + ADBの強制置き換え @@ -193,8 +197,8 @@ 公開求人 基地仕事 作戦 - 戦友訪問 - FP交換 + + FP獲得と交換 報酬受取 自動ローグ @@ -275,6 +279,7 @@ タスクが選択されていません 動作中…… 動作停止中…… + もし全てでスタックする場合は、設定 - 接続設定 - ADBの強制置き換え、もしくは 互換性 タッチモード をチェックしてください。 動作停止 不明なエラーが発生しました @@ -429,19 +434,9 @@ 自動攻略ファイルシェアWebサイト Copilot Map and Coordinate Custom Base Json Generator - QQグループ: - グループ1 - グループ2 - グループ3 - グループ4 - グループ5 - グループ6 - グループ7 - グループ8 - (満員) + QQグループ Telegram よくある質問 - https://github.com/MaaAssistantArknights/MaaAssistantArknights/blob/master/docs/ja-jp/1.2-%E3%82%88%E3%81%8F%E3%81%82%E3%82%8B%E8%B3%AA%E5%95%8F.md フィードバック diff --git a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml new file mode 100644 index 0000000000..d5ebad5e0c --- /dev/null +++ b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml @@ -0,0 +1,496 @@ + + + 설정 + 기반시설 + 통합전략 + 공개모집 + 크레딧 상점 + 전투 설정 + 연결 설정 + 시작 설정 + 예약 설정 + UI 설정 + 단축키 설정 + 업데이트 + 정보 + + 버전 + + 숙소 + 제조소 + 무역소 + 발전소 + 응접실 + 사무실 + 제어 센터 + + 드론 미사용 + 무역소-용문폐 + 무역소-합성옥 + 제조소-작전기록 + 제조소-순금 + 제조소-오리지늄 조각 + 제조소-칩 + 숙소의 남은 자리로 신뢰도 증가 + 이미 배치된 오퍼레이터를 숙소에 넣지 않기 + 오리지늄 조각 자동 보충 + 커스텀 기반시설 (베타) + 기본 구성 + 사용자 설정 + 153 1일 3회 교체 + 243 1일 3회 교체 + 243 1일 4회 교체 + 252 1일 3회 교체 + 333 1일 3회 교체 + 기반시설 구성 + 기반시설 구성 인식 실패! + 기반시설 구성: + 기반시설 계획 + 다음 계획용으로 자동 저장 + + 일반 모드 + BlueStacks + MuMu Player + LD Player + Nox + MEmu + WSA 레거시 버전 + MaaTouch + 호환 모드 + + 오퍼레이터 컨디션 한계점 + 커스텀 기반시설이 활성화되어 있다면, 이 설정은 자동배치 시설에만 유효합니다 + + 레벨 우선, 안정적으로 가능한 수준에서 최대한 많은 구역 클리어 + 오리지늄각뿔 우선, 2번째 구역에 도달하는 즉시 탐험 중도 포기 + 시작 분대 + 모집 조합 + 시작 오퍼레이터 (1명) + 단일 오퍼레이터의 중국어 이름만 지원하며, 입력하지 않으면 기본값이 선택됩니다 + 일시정지 상태로 배치하기 (통합전략, 자동 작전, 보전파견에 적용) + + 기본값 + 心胜于物分队 (업데이트 예정) + 物尽其用分队 (업데이트 예정) + 以人为本分队 (업데이트 예정) + 지휘 분대 + 집합 분대 + 지원 분대 + 예봉 분대 + 강습 전술 분대 + 방어 전술 분대 + 원거리 전술 분대 + 파괴 전술 분대 + 연구 분대 + 고급화 분대 + + 기본값 + 선수필승 + 차근차근 + 상호보완 + 원하는 대로 + + 미선택 + 공식 서버 + 빌리빌리 + 요스타 EN + 요스타 JP + 요스타 KR + TXWY (TW) + + 전환 가능 + + 실행 파일 + adb 프로그램 + + 에뮬레이터를 검색하는 중에 오류가 발생했습니다. 이 소프트웨어를 관리자로 실행하거나 수동으로 연결을 설정하십시오. + 에뮬레이터를 찾을 수 없습니다. 이 소프트웨어를 관리자로 실행하거나 수동으로 연결을 설정하십시오. + 여러 에뮬레이터가 실행 중입니다. 사용하지 않는 에뮬레이터를 종료하거나 수동으로 연결을 설정하십시오. + + 언어 전환 + 언어 + 언어가 변경되었습니다. 지금 MAA를 재실행하여 새 설정을 적용하시겠습니까? + 재실행 + 나중에 하기 + 도움말 + + [단축키] MAA 보이기/숨기기 + [단축키] Link 시작/중지 + Backspace/Esc/Delete 키를 누르면 현재 값이 지워집니다 + + 드래그하여 순서를 변경할 수 있습니다 + 재시작 후 변경 사항이 저장되지 않습니다 + 해당 스테이지로 자동 이동하지 않습니다 + + 자동으로 업데이트 확인 + 자동으로 업데이트 + 안정 버전 + 베타 버전 + 개발 버전 + 업데이트할 버전 + aria2로 다운로드 + 지금 업데이트 + + 새로운 버전 확인 + 백그라운드에서 다운로드 중... + 버전: + 정보: + 웹사이트로 가기 + + 업데이트 패키지 확인됨 + 압축을 푸는 중... + + 업데이트 패키지 손상됨 + 파일명: + 삭제했습니다. + + 이미 최신 버전입니다~ + 업데이트 패키지 확인 실패 + 네트워크 연결이나 프록시를 확인해 주세요. + 릴리즈 노트를 받아오지 못했습니다. + 새로운 버전이 빌드되는 중입니다. 다음에 다시 시도해 주세요. + + 업데이트 패키지 다운로드 실패 + ZIP 파일을 수동으로 다운로드해 폴더 안에 놓아 주세요. + 업데이트 패키지 다운로드 완료 + 지금 바로 MAA를 업그레이드하시겠습니까? (프로세스 재시작) + + 새로운 버전이 확인되지만 업데이트 패키지가 없음 + 전체 패키지를 수동으로 다운로드해 업데이트해 주세요. + + 시분초 중 시만 입력해 주세요. 정각에 실행할 것입니다 + 정시 + + 시스템 시작 시 실행 + 실행 후 작업 시작 + 클라이언트 종류 + 실행 후 에뮬레이터를 실행 + 에뮬레이터 실행 대기 (초) + 에뮬레이터 경로 + 선택 + ADB 강제 교체 + 터치 수행 방식 + Minitouch (기본값) + MaaTouch (실험적) + Adb Input (호환 모드) + 추가 변수 + + 통합전략 테마 + 통합전략 화면에서 테마를 고정시켜주어야 합니다 + 팬텀 + 미즈키 + 전략 + N번 시작한 후 작업 중지 + N번 투자 후 작업 중지 + 오리지늄각뿔이 한계 도달 시 중지 + 오리지늄각뿔 투자 + + 펭귄 물류 보고 ID (숫자만) + 그랑데 영감처럼 순오리지늄 사용하기 + 순오리지늄을 이용한 이성 회복 화면에서 1이성이 회복될 때까지 기다린 후에야 순오리지늄을 사용합니다. + + 크레딧 구매 + 지원 오퍼레이터 사용으로 크레딧 얻기 + OF-1을 지원 오퍼레이터와 함께 수행해 30크레딧을 얻습니다. 스테이지가 현재/최근으로 설정되어 있다면 선택하지 마세요. + 구매 우선 항목 (세미콜론으로 구분) + 무시 항목 (세미콜론으로 구분) + 모집 허가증;용문폐 + 카본;카본 번들;가구 부품 + 술 한잔은 어떻습니까🍷? 박사님 + 크레딧이 넘치면 무시 항목도 구매 + + 드론 사용처 + + 트레이로 최소화 + 중요 알림 팝업 + 대체 스테이지 사용 + 미개방 스테이지 숨기기 + 메인 화면 버튼의 기능 + 스테이지 코드 수동 입력 + 대부분의 메인 스테이지와 원래 목록(예: 4-10, AP-5, H10-1-Hard)에 있는 검문소 이름을 지원합니다. + + 연결 자동 감지 + 이 체크박스는 감지가 끝나면 자동으로 체크가 해제됩니다. 다시 감지하려면 다시 체크해주세요. + 항상 감지 + adb 경로 (상대/절대) + 연결 주소 + 문제가 있으면 수동으로 수정하십시오 + 연결 프리셋 + adb 재연결이 실패하면 자동으로 에뮬레이터를 다시 시작합니다 + 20회의 재연결 실패 후에는 에뮬레이터를 다시 시작해 보세요. 백그라운드 예약을 사용하고 작업이 완료되면 에뮬레이터가 종료되도록 설정하려면 반드시 선택해야 합니다. + + + + 파밍 + + 로그인 + 공개모집 + 기반시설 교대 + 작전 + + 상점 + 임무 보상 수령 + 통합전략 + + 전원 선택 + 선택 반전 + 선택 취소 + + 완료 후 + 아무것도 하지 않는다 + 명일방주를 종료 + MAA를 종료 + 에뮬레이터를 종료 + MAA와 에뮬레이터를 종료 + MAA와 에뮬레이터를 종료하고 절전 모드* + 절전 모드* + 시스템 종료* + + Link Start! + 중지 + + + 이성 회복제 사용 + 순오리지늄 사용* + 횟수 제한* + 드롭 제한 + 드롭 수 + 스테이지 선택 + 대안 + 남은 이성 + 미사용 + + + + 현재/최근 + 이벤트가 닫혀 있습니다 + 1-7 + CE-6 (용문폐) + AP-5 (구매증명서) + CA-5 (스킬개론) + LS-6 (작전기록) + + PR-A-1 (메딕/디펜더) + PR-A-2 (메딕/디펜더) + PR-B-1 (캐스터/스나이퍼) + PR-B-2 (캐스터/스나이퍼) + PR-C-1 (뱅가드/서포터) + PR-C-2 (뱅가드/서포터) + PR-D-1 (가드/스페셜리스트) + PR-D-2 (가드/스페셜리스트) + + 섬멸 작전 + + 오늘의 스테이지 팁: + CE (용문폐) + AP (구매증명서) + CA (스킬개론) + LS (작전기록) + SK (카본) + PR-A (메딕/디펜더 칩) + PR-B (캐스터/스나이퍼 칩) + PR-C (뱅가드/서포터 칩) + PR-D (가드/스페셜리스트 칩) + 월요일입니다. 섬멸 작전을 잊지 마세요~ + 일요일입니다. 섬멸 작전을 잊지 마세요~ + + + + 에뮬레이터에 연결 중... + 선택된 작업이 없습니다 + 실행 중... + 프로그램이 작동하지 않으면 설정 - 연결 설정 - ADB 강제 교체를 실행하거나 호환 터치 모드를 활성화해 주세요. + 중지 중... + 중지됨 + 예상치 못한 오류가 발생했습니다 + 설정 성공 + 설정 실패 + 게임 종료 실패 + 에뮬레이터 종료 실패 + 작업을 완료했습니다. 시스템이 곧 종료됩니다. 취소하시겠습니까? + 알림 + 작업을 완료했습니다. 곧 절전 모드에 진입합니다. + + + + + 공개모집 인식 + 팁: 메인 화면의 자동 모집과는 별도로 독립된 기능입니다. 게임 내 공개모집 태그 화면에서 사용하세요~ + 자동 시간 설정 + ★3 태그를 자동 선택 + ★4 태그를 자동 선택 + ★5 태그를 자동 선택 + ★6 태그를 자동 선택 + 인식 시작 + + + + 창고 정리 beta + 이 기능은 현재 테스트 중입니다. 인식 결과가 맞는지 확인 후에 사용해 주세요. 만약 오류가 있다면 debug/depot 폴더를 압축해서 이슈로 보내 주세요. + 식별 시작 + Arkplanner로 내보내기 + Lolicon으로 내보내기 + 클립보드에 복사됨 + + + + 식별 중... + 식별 완료 + + + + 자동 작전 + 작업 파일 경로/코드 + 작업 선택 + 마우스로 작업 파일을 드래그해 선택할 수 있어요 (o゚v゚)ノ + 자동 편성 + 자동 편성은 '선호' 오퍼레이터를 인식할 수 없습니다 + + 시작 + + 비디오 링크 + + + 팁: + 에뮬레이터와 게임의 프레임 레이트를 60FPS 이상으로 설정하십시오. + '작전 시작' 버튼이 있는 화면에 이 기능을 사용하십시오. + 친구의 오퍼레이터를 사용하는 경우에는 '자동 편성'을 선택하지 말고 수동으로 오퍼레이터를 선택하고 시작하십시오. + 패러독스 시뮬레이션의 경우에는 '자동 편성'을 선택하지 말고, 스킬을 선택하고 '시뮬레이션 시작' 버튼이 있는 화면에 시작하십시오. + 자동 편성은 '즐겨찾기''선호' 오퍼레이터를 인식할 수 없습니다. 필요한 경우 선호 오퍼레이터 표시를 취소하고 수동으로 편성할 수 있습니다. + + 파일을 읽지 못했습니다! + 해당 파일을 찾을 수 없습니다! + 네트워크 요청 중 오류가 발생했습니다! + 전략 파일 분석 중 오류가 발생했습니다! + 전략 파일이 아닙니다 + 파일 내용을 확인해주세요! + + + + + 리소스가 손상되었습니다. 전체 패키지를 다시 다운로드하십시오. + 오류 + 상세 + 해결 방안 + FAQ 문서의 Crashes 문단을 참조해 해결하세요. + 관리자 권한으로 MAA를 실행해 주세요 + ADB 파일이 존재하지 않습니다 + ADB 다운로드 실패 + 수동으로 진행해 주세요 (adb.exe의 이름을 바꾸고 에뮬레이터의 adb 파일을 교체해 주세요) + 성공적으로 ADB 파일을 교체했습니다 + GitHub 이슈 생성 + QQ 그룹 가입 + 초기화 오류! + 에뮬레이터 해상도가 지원되지 않습니다. 해상도를 720p 이상, 16:9 비율로 설정해주세요. + 에뮬레이터 해상도를 가져오지 못했습니다. 컴퓨터를 다시 시작하거나 에뮬레이터를 변경한 후 다시 시도하는 것이 좋습니다. + 에뮬레이터가 연결 해제되었습니다. 재연결을 시도합니다. + 다시 연결되었습니다. 작업을 계속합니다. + 다시 연결하지 못했습니다. 연결 해제되었습니다! + 스크린샷 캡처에 실패했습니다. 반복적으로 발생 시 에뮬레이터를 다시 시작하거나 변경해 보세요. + 터치 수행 방식이 사용 불가능합니다. 설정 - 연결 설정에서 다른 방식으로 변경해 주세요. + 인식 오류 + 작업 오류: + 작전 오류 + 작업 시작: + 작업 완료: + 작전 시작: + 작전 완료 + 모든 작업이 완료되었습니다! + 작업 시작됨 + 작업 중지됨 + 클라이언트를 시작하지 못했습니다. 설정 파일을 확인하십시오. + 오류가 발생했습니다 + 반환했습니다 + 드롭 인식 오류 + 펭귄 물류에 업로드 중단 + EX 스테이지가 없어 중단되었습니다 + 행동 개시 + + 이성 회복 아이템을 사용했습니다 + 순오리지늄을 사용했습니다 + PRTS 오류 + 태그가 새로 고쳐졌습니다. + 모집 확정 + 요구 오퍼레이터 충돌 + 탐험 시작됨 + 투자함 + 탐사 중단 + 작전 완료 + 작전 실패 + 투자가 한계에 도달했습니다 + 게임이 강제종료되었습니다. 다시 시작해야 합니다. + 연결이 끊어졌습니다. 다시 연결 중입니다. + 게임 클리어, 축하합니다! + 레벨: 교활한 상인 + 레벨: 안전가옥 + 레벨: 우연한 만남 + 레벨: 작전 + 레벨: 긴급 작전 + 레벨: 험난한 길 + 없음 + 드롭: + 드롭 통계: + 현재 시설: + 생산품이 구성과 맞지 않습니다. + 공개모집 인식 결과: + 공개모집 팁 + ★{0} 오퍼레이터를 모집했습니다! + 로봇을 모집했습니다! + 선택 + 새로고침됨 + 오퍼레이터 부족 + 스테이지 인식 오류 + 편성 시작 + 오퍼레이터를 선택: + 현재 단계: + 지원하지 않는 스테이지입니다. MAA를 업데이트하거나, 작업 파일을 확인하십시오. + 인식 결과: + 연결 실패 + 에뮬레이터를 시작하는 중입니다 + 연결 설정을 확인하거나 시스템을 재시작해보세요 + + + + 종료 + + + + MAA 공식 웹사이트 + 소스 코드: GitHub + 자동 전투 전략 공유 웹사이트 + 자동 전투 맵과 좌표 + 커스텀 기반시설 JSON 생성기 + QQ 그룹 + QQ 채널 + Telegram + 자주 묻는 질문 + 이슈 + + + + ★3 태그를 자동 새로고침하기 + 즉시 완료 허가증을 자동 사용* + ★3 태그 9:00 대신 7:40 설정 + 다른 등급에는 해당되지 않음 + 시행 시의 최대 모집횟수 + 로봇 수동 모집 + ★3 자동 모집 + ★4 자동 모집 + ★5 자동 모집 + ★6 자동 모집 + 체크 시, ★1 태그를 인식할 때 이번 모집을 건너뜁니다. 체크하지 않으면 ★1 태그를 무시합니다. + + + + 으…… 우웁…… + 어머, 박사님. 왜 그렇게 비틀비틀 걷고 계시나요? + 다, 다음엔 적당히 마셔야지…… + Hello World! + + \ No newline at end of file diff --git a/src/MeoAsstGui/Resources/Localizations/pallas.py b/src/MaaWpfGui/Res/Localizations/pallas.py similarity index 100% rename from src/MeoAsstGui/Resources/Localizations/pallas.py rename to src/MaaWpfGui/Res/Localizations/pallas.py diff --git a/src/MeoAsstGui/Resources/Localizations/pallas.xaml b/src/MaaWpfGui/Res/Localizations/pallas.xaml similarity index 96% rename from src/MeoAsstGui/Resources/Localizations/pallas.xaml rename to src/MaaWpfGui/Res/Localizations/pallas.xaml index 9facd90b7a..2f248bfd20 100644 --- a/src/MeoAsstGui/Resources/Localizations/pallas.xaml +++ b/src/MaaWpfGui/Res/Localizations/pallas.xaml @@ -1,7 +1,7 @@  @@ -134,7 +134,7 @@ 🍺🍸🍻🍸🍻🍷💃 🍻🍸🍸🍺🍷🍺🍻🍷 - 🍺🍷🍸🍸🍷🍻 + 🍺🍷🍸🍸🍷🍻 💃💃🍻🍸🍺🍸🍺🍸🕺🍺🍸 🍻💃🕺🍻🍷🍷🍷🍷🍸🕺🍺🍷🍸 🍻🍸🍸🍷🍻🕺 @@ -171,7 +171,7 @@ 🕺🍺🍸🍸🕺🍸🍺🍺🍻🕺🍺🍻🍺🍷 🍺🍺🍺🍸🍺💃🍻🍸🍻🕺🕺 🍺💃🍷🍺🍺🍷🍺🍺 - 🍷🍺🕺🍸🍸💃🍸💃🍺🕺🍻🍸💃🍸🍸🍻🕺🍷💃🍻🍷🕺🍷🍷🍸🍻💃🍻💃💃🍺🍸🍸🍸🍷🕺 + 🍷🍺🕺🍸🍸💃🍸💃🍺🕺🍻🍸💃🍸🍸🍻🕺🍷💃🍷🍷🍻🕺🍸🍻🍷🕺🍷🍷🍸 🍻💃🍻💃💃🍺🍸🍸🍸🍷🕺🍻🍷🍸🍸🕺🍻🍸💃🍸 🍺🍻🕺🍻🕺🍷🍷 🍺🍸🍷🍷🍸🍸🍷🕺🍻🍻🍻🍸🍻🍻🕺🍺🍷🍺🍷🕺💃🍻🕺🍸🍷🍻🍷🍻 @@ -190,7 +190,7 @@ 🍻🍸🍻🍻🕺 🍺🍻💃🍺💃 🍷🍸🍻🍻 - 🍻🍸🍺🍺🍸 + 🍸🍷🍻🕺🍻🍻🍸🍸 🍸🍻🕺🍷🍷🕺💃 🍺🍷🍸🍺🕺🍸 @@ -416,18 +416,8 @@ 🍻🍷🍻🍸🍺🍻🍷🍺🍺🍸 🍸🍺🍷🍸🍺🍺🍸🍻🕺🕺🍻 💃🍺🍷🍺💃 - 🍺🍻🍸 - 🍷🍷🍷 - 🍺🍷🍻 - 🍷🍺🍺 - 🍻💃💃 - 🍻💃🍻 - 🍻💃💃 - 🍻🍺🍺 - 🍸🍸🕺🕺🍺 🍷🍷🍷🍺 🍸🍺🍺🍻🍺 - https://github.com/MaaAssistantArknights/MaaAssistantArknights/blob/master/docs/1.2-%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.md 🍷🍷🍻💃🍺 diff --git a/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml similarity index 95% rename from src/MeoAsstGui/Resources/Localizations/zh-cn.xaml rename to src/MaaWpfGui/Res/Localizations/zh-cn.xaml index 3439af2ad0..71a7b2db78 100644 --- a/src/MeoAsstGui/Resources/Localizations/zh-cn.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml @@ -1,15 +1,16 @@  设置 + 游戏设置 基建设置 肉鸽设置 自动公招 - 信用商店 + 信用相关 理智设置 连接设置 启动设置 @@ -55,11 +56,12 @@ 通用模式 蓝叠模拟器 - MuMu模拟器 + MuMu 模拟器 雷电模拟器 夜神模拟器 逍遥模拟器 WSA 旧版本 + MaaTouch 兼容模式 基建工作心情阈值 @@ -71,6 +73,7 @@ 开局职业组 开局干员 (单个) 仅支持单个干员中文名,不填写则默认选择 + 暂停下干员(同时影响肉鸽、自动战斗、保全) 默认分队 心胜于物分队 @@ -166,13 +169,16 @@ 开机自动启动 启动后直接运行 - 客户端版本 + 客户端类型 启动后自动开启模拟器 等待模拟器启动时间(秒) 模拟器路径 选择 强制替换 ADB - 兼容性的触控模式(不使用 minitouch) + 触控模式 + Minitouch(默认) + MaaTouch(实验功能) + Adb Input(兼容模式) 附加命令 肉鸽主题 @@ -190,6 +196,8 @@ 在碎石确认界面等待,直到当前的 1 点理智恢复完成再立即确认。不碎石时该选项不影响正常运行 信用购物 + 借助战赚信用 + 访问好友后借助战打一把OF-1赚30信用,关卡选择为「当前/上次」时请勿勾选,别传「火蓝之心」关卡OF-1未解锁时请勿勾选 优先购买 子串即可 分号分隔 黑名单 子串即可 分号分隔 招聘许可;龙门币 @@ -205,11 +213,11 @@ 关卡选择隐藏当日不开放关卡 主界面可选择按钮功能 手动输入关卡名 - (测试功能)支持大部分主线关卡名与原列表的关卡名(如4-10、AP-5) + 支持大部分主线关卡名与原列表的关卡名(如4-10、AP-5、H10-1-Hard) 可在关卡结尾输入"Normal/Hard"表示需要切换标准与磨难难度 自动检测连接 每次检测完成后会自动取消勾选,若需要重新检测可再次勾选,若反复连接失败可勾选始终自动检测连接 - 始终自动检测连接 + 始终检测 adb 路径 (相对/绝对) 连接地址 若遇到问题可尝试手动修改 @@ -225,10 +233,8 @@ 自动公招 基建换班 刷理智 - 借助战赚信用 - 访问好友后借助战打一把OF-1赚30信用 - 访问好友 - 收取信用及购物 + + 获取信用及购物 领取日常奖励 自动肉鸽 @@ -387,6 +393,7 @@ 模拟器断开,正在尝试重连 重连成功,继续任务 重连失败,连接断开! + 触控模式不可用。请进入 设置 - 连接设置 切换其他触控模式 截图失败,如反复出现请尝试重启或更换模拟器! 识别错误 任务出错: @@ -460,20 +467,10 @@ 自动战斗作业分享 自动战斗地图坐标 自定义基建排班制作器 - Q 群: - 一群 - 二群 - 三群 - 四群 - 五群 - 六群 - 七群 - 八群 - (已满) - QQ频道 + QQ 群 + QQ 频道 Telegram 常见问题 - https://github.com/MaaAssistantArknights/MaaAssistantArknights/blob/master/docs/1.2-%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.md 问题反馈 diff --git a/src/MeoAsstGui/Resources/Localizations/zh-tw.xaml b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml similarity index 95% rename from src/MeoAsstGui/Resources/Localizations/zh-tw.xaml rename to src/MaaWpfGui/Res/Localizations/zh-tw.xaml index ab1fbab004..8aa56f5716 100644 --- a/src/MeoAsstGui/Resources/Localizations/zh-tw.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml @@ -1,7 +1,7 @@  @@ -9,7 +9,7 @@ 基建設定 肉鴿設定 自動公招 - 信用商店 + 信用相關 理智設定 連接設定 啟動設定 @@ -48,7 +48,7 @@ 通用模式 藍疊模擬器 - MuMu模擬器 + MuMu 模擬器 雷電模擬器 夜神模擬器 逍遙模擬器 @@ -134,7 +134,7 @@ 開機自動啟動 啟動後直接運行 - 用戶端版本 + 用戶端類型 啟動後自動開啟模擬器 等待模擬器啟動時間(秒) 模擬器路徑 @@ -156,6 +156,8 @@ 在碎石確認界面等待,直到當前的 1 點理智恢復完成再立即確認。不碎石時該選項不影響正常運行 信用購物 + 藉助戰賺信用 + 訪問好友後藉助戰打一把OF-1賺30信用,關卡選擇爲「當前/上次」時請勿勾選 優先購買 子串即可 分号分隔 黑名單 子串即可 分号分隔 招聘許可;龍門幣 @@ -171,7 +173,7 @@ 關卡選擇隱藏當日不開放關卡 主介面可選擇按鈕功能 手動輸入關卡代名 - (測試功能)支持大部分主線關卡名與原列表的關卡名(如4-10、AP-5) + 支持大部分主線關卡名與原列表的關卡名(如4-10、AP-5、H10-1-Hard) 可在關卡結尾輸入"Normal/Hard"表示需要切換標準與磨難難度 自動檢測連接 每次檢測完成後會自動取消勾選,若需要重新檢測可再次勾選 @@ -190,8 +192,8 @@ 自動公招 基建換班 刷理智 - 訪問好友 - 收取信用及購物 + + 獲取信用及購物 領取日常獎勵 自動肉鴿 @@ -417,20 +419,10 @@ 自動戰鬥作業分享 自動戰鬥地圖座標 自定義基建排班製作器 - Q 群: - 一群 - 二群 - 三群 - 四群 - 五群 - 六群 - 七群 - 八群 - (已滿) - QQ頻道 + QQ 群 + QQ 頻道 Telegram 常見問題 - https://github.com/MaaAssistantArknights/MaaAssistantArknights/blob/master/docs/zh-tw/1.2-%E5%B8%B8%E8%A6%8B%E5%95%8F%E9%A1%8C.md 問題回饋 diff --git a/src/MeoAsstGui/Views/CopilotView.xaml b/src/MaaWpfGui/Views/CopilotView.xaml similarity index 96% rename from src/MeoAsstGui/Views/CopilotView.xaml rename to src/MaaWpfGui/Views/CopilotView.xaml index e90de169f1..9557ca4fc9 100644 --- a/src/MeoAsstGui/Views/CopilotView.xaml +++ b/src/MaaWpfGui/Views/CopilotView.xaml @@ -1,13 +1,13 @@  + TextWrapping="Wrap" /> + TextWrapping="Wrap" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/MeoAsstGui/Views/RecruitView.xaml b/src/MaaWpfGui/Views/RecruitView.xaml similarity index 93% rename from src/MeoAsstGui/Views/RecruitView.xaml rename to src/MaaWpfGui/Views/RecruitView.xaml index 3f0a22cb2a..d561d7aa40 100644 --- a/src/MeoAsstGui/Views/RecruitView.xaml +++ b/src/MaaWpfGui/Views/RecruitView.xaml @@ -1,11 +1,11 @@  + TextWrapping="Wrap" /> + TextWrapping="Wrap" /> - @@ -60,7 +60,7 @@ Foreground="Gray" Style="{StaticResource TextBlockDefault}" Text="{Binding ListTitle[1]}" /> - @@ -75,7 +75,7 @@ Foreground="Gray" Style="{StaticResource TextBlockDefault}" Text="{Binding ListTitle[2]}" /> - @@ -90,7 +90,7 @@ Foreground="Gray" Style="{StaticResource TextBlockDefault}" Text="{Binding ListTitle[3]}" /> - @@ -105,7 +105,7 @@ Foreground="Gray" Style="{StaticResource TextBlockDefault}" Text="{Binding ListTitle[4]}" /> - @@ -120,7 +120,7 @@ Foreground="Gray" Style="{StaticResource TextBlockDefault}" Text="{Binding ListTitle[5]}" /> - @@ -135,46 +135,46 @@ Foreground="Gray" Style="{StaticResource TextBlockDefault}" Text="{Binding ListTitle[6]}" /> - - - - - - - - - - + + + + + + + + + - + + + + diff --git a/src/MeoAsstGui/Views/TaskQueueView.xaml b/src/MaaWpfGui/Views/TaskQueueView.xaml similarity index 96% rename from src/MeoAsstGui/Views/TaskQueueView.xaml rename to src/MaaWpfGui/Views/TaskQueueView.xaml index 6fa602d201..049e35ab6d 100644 --- a/src/MeoAsstGui/Views/TaskQueueView.xaml +++ b/src/MaaWpfGui/Views/TaskQueueView.xaml @@ -1,15 +1,15 @@  --> - @@ -199,20 +198,20 @@ + TextWrapping="Wrap" /> + TextWrapping="Wrap" /> diff --git a/src/MaaWpfGui/Views/UserControl/AboutUserControl.xaml b/src/MaaWpfGui/Views/UserControl/AboutUserControl.xaml new file mode 100644 index 0000000000..efec634a48 --- /dev/null +++ b/src/MaaWpfGui/Views/UserControl/AboutUserControl.xaml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/MeoAsstGui/UserControl/AboutUserControl.xaml.cs b/src/MaaWpfGui/Views/UserControl/AboutUserControl.xaml.cs similarity index 93% rename from src/MeoAsstGui/UserControl/AboutUserControl.xaml.cs rename to src/MaaWpfGui/Views/UserControl/AboutUserControl.xaml.cs index 30c4d98750..9fc061a8bb 100644 --- a/src/MeoAsstGui/UserControl/AboutUserControl.xaml.cs +++ b/src/MaaWpfGui/Views/UserControl/AboutUserControl.xaml.cs @@ -1,5 +1,5 @@ // -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Documents; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// PenguinReportSettingsUserControl.xaml 的交互逻辑 diff --git a/src/MeoAsstGui/UserControl/AutoRecruitSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/AutoRecruitSettingsUserControl.xaml similarity index 94% rename from src/MeoAsstGui/UserControl/AutoRecruitSettingsUserControl.xaml rename to src/MaaWpfGui/Views/UserControl/AutoRecruitSettingsUserControl.xaml index d8b6413bcc..f5277f5b92 100644 --- a/src/MeoAsstGui/UserControl/AutoRecruitSettingsUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/AutoRecruitSettingsUserControl.xaml @@ -1,12 +1,12 @@  @@ -19,9 +19,7 @@ - + -// MeoAsstGui - A part of the MeoAssistantArknights project +// MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // // This program is free software: you can redistribute it and/or modify @@ -13,7 +13,7 @@ using System.Windows.Controls; -namespace MeoAsstGui +namespace MaaWpfGui { /// /// InfrastSettingsUserContril.xaml 的交互逻辑 diff --git a/src/MeoAsstGui/UserControl/ConnectSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/ConnectSettingsUserControl.xaml similarity index 73% rename from src/MeoAsstGui/UserControl/ConnectSettingsUserControl.xaml rename to src/MaaWpfGui/Views/UserControl/ConnectSettingsUserControl.xaml index b06173cd4b..262e1bd0af 100644 --- a/src/MeoAsstGui/UserControl/ConnectSettingsUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/ConnectSettingsUserControl.xaml @@ -1,20 +1,20 @@  - + @@ -29,25 +29,22 @@ + IsChecked="{Binding AutoDetectConnection}" + ToolTip="{DynamicResource AutoDetectConnectionTip}" /> + IsChecked="{Binding AlwaysAutoDetectConnection}" + Visibility="{c:Binding AutoDetectConnection}" />