merge.合并master

This commit is contained in:
MistEO
2022-05-10 21:32:11 +08:00
41 changed files with 1372 additions and 433 deletions

61
.github/workflows/maa-dev-build.yaml vendored Normal file
View File

@@ -0,0 +1,61 @@
name: "Maa Dev Build"
on:
push:
branches:
- dev
paths:
- src/MeoAssistant/**
- src/MeoAssistantBuilder/**
- src/MeoAsstGui/**
- 3rdparty/**
- include/**
- MeoAssistantArknights.sln
pull_request:
paths:
- src/MeoAssistant/**
- src/MeoAssistantBuilder/**
- src/MeoAsstGui/**
- 3rdparty/**
- include/**
- MeoAssistantArknights.sln
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET 6.0.x
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Run dev build task
run: pwsh .\build.ps1 DevBuild
- name: Read file name
id: read_path
run: pwsh .\read_path.ps1 ./artifacts MaaBundle*
- name: Upload Artifacts 0
uses: actions/upload-artifact@v3
with:
name: ${{ steps.read_path.outputs.name_0 }}
path: ${{ steps.read_path.outputs.path_0 }}
- name: Upload Artifacts 1
uses: actions/upload-artifact@v3
with:
name: ${{ steps.read_path.outputs.name_1 }}
path: ${{ steps.read_path.outputs.path_1 }}
- name: Upload Artifacts 2
uses: actions/upload-artifact@v3
with:
name: ${{ steps.read_path.outputs.name_2 }}
path: ${{ steps.read_path.outputs.path_2 }}

View File

@@ -1,30 +1,30 @@
name: Azure Static Web Apps CI/CD
on:
push:
branches:
- master
paths:
- "docs/*"
jobs:
build_and_deploy:
runs-on: ubuntu-latest
name: Build and Deploy Job
if: github.repository_owner == 'MaaAssistantArknights'
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_DESERT_00290F400 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/docs" # App source code path
api_location: "" # Api source code path - optional
output_location: ".vuepress/dist" # Built app content directory - optional
name: Deploy Docs
on:
push:
branches:
- master
paths:
- "docs/*"
workflow_dispatch:
jobs:
build_and_deploy:
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_DESERT_00290F400 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "/docs" # App source code path
api_location: "" # Api source code path - optional
output_location: ".vuepress/dist" # Built app content directory - optional

View File

@@ -0,0 +1,45 @@
name: Release MaaBundle
on:
release:
types:
- published
jobs:
release-bundle:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Setup .NET 6.0.x
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Run release core task
run: pwsh .\build.ps1 ReleaseBundle
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: MaaBundle-${{ steps.tag.outputs.tag }}
path: ./artifacts/MaaBundle*
- name: Upload release assets
uses: xresloader/upload-to-github-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ./artifacts/MaaBundle*
tags: true
draft: false
verbose: true

45
.github/workflows/maa-release-core.yaml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: Release MaaCore
on:
release:
types:
- published
jobs:
release-core:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Setup .NET 6.0.x
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Run release core task
run: pwsh .\build.ps1 ReleaseCore
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: MaaCore-${{ steps.tag.outputs.tag }}
path: ./artifacts/MaaCore*
- name: Upload release assets
uses: xresloader/upload-to-github-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ./artifacts/MaaCore*
tags: true
draft: false
verbose: true

View File

@@ -0,0 +1,39 @@
name: Release MaaResource
on:
push:
branches:
- master
paths:
- resource/**
- 3rdparty/resource/**
workflow_dispatch:
jobs:
release-resource:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET 6.0.x
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Run release resource task
run: pwsh .\build.ps1 ReleaseResource
- name: Read file name
id: read_path
run: pwsh .\read_path.ps1 ./artifacts MaaResource*
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.read_path.outputs.name_0 }}
path: ${{ steps.read_path.outputs.path_0 }}

38
.github/workflows/maa-release-wpf.yaml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Release MaaWpf
on:
push:
branches:
- master
paths:
- src/MeoAsstGui/**
workflow_dispatch:
jobs:
release-wpf:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET 6.0.x
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Run release wpf task
run: pwsh .\build.ps1 ReleaseWpf
- name: Read file name
id: read_path
run: pwsh .\read_path.ps1 ./artifacts MaaWpf*
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.read_path.outputs.name_0 }}
path: ${{ steps.read_path.outputs.path_0 }}

2
.gitignore vendored
View File

@@ -435,3 +435,5 @@ screen.png
adb_screen.png
tools/**/*.png
resource/infrast
.vscode
!3rdparty/tools/*

View File

@@ -158,4 +158,4 @@ private:
};
} // namespace penguin
#endif // PENGUIN_DEPOT_HPP_
#endif // PENGUIN_DEPOT_HPP_

View File

@@ -15,6 +15,7 @@ using dict = nlohmann::ordered_json;
namespace penguin
{
enum class StatusFlags
{
NORMAL = 0,
@@ -842,9 +843,11 @@ private:
}
void _get_quantity()
{
cv::Rect quantityrect = cv::Rect(0, static_cast<int>(round(height * _ITEM_QTY_Y_PROP)),
static_cast<int>(round(width * _ITEM_QTY_WIDTH_PROP)),
static_cast<int>(round(height * _ITEM_QTY_HEIGHT_PROP)));
cv::Rect quantityrect =
cv::Rect(0,
static_cast<int>(round(height * _ITEM_QTY_Y_PROP)),
static_cast<int>(round(width * _ITEM_QTY_WIDTH_PROP)),
static_cast<int>(round(height * _ITEM_QTY_HEIGHT_PROP)));
cv::Mat quantityimg = _img(quantityrect);
_quantity.set_img(quantityimg);
_quantity.analyze();

View File

@@ -18,7 +18,13 @@
#include "depot.hpp"
#include "result.hpp"
static const std::string version = "4.2.3";
#ifdef PENGUIN_RECOGNIZER_RELEASE_VERSION
#define PENGUIN_RECOGNIZER_VERSION_STRING PENGUIN_RECOGNIZER_RELEASE_VERSION
#else
#define PENGUIN_RECOGNIZER_VERSION_STRING "v0.0.0"
#endif
static const std::string version = PENGUIN_RECOGNIZER_VERSION_STRING;
static const std::string opencv_version = CV_VERSION;
cv::Mat decode(std::string JSarrayBuffer)

View File

@@ -31,7 +31,7 @@ const double DROP_AREA_X_PROP = 0.21;
const double DROP_AREA_Y_PROP = 0.2;
const double DROP_AREA_HEIGHT_PROP = 0.8;
const double ITEM_DIAMETER_PROP = 0.524;
const double W_H_PROP = 7;
const double W_H_PROP = 6.5;
enum DroptypeFlags
{
@@ -201,7 +201,7 @@ public:
}
private:
size_t _stars = 0;
int _stars = 0;
void _get_is_3stars()
{
auto& self = *this;
@@ -232,7 +232,7 @@ private:
star_rect.width = sp.back().end - star_rect.x;
_img = star_img = star_img(star_rect);
self._relate(star_rect.tl());
_stars = sp.size();
_stars = static_cast<int>(sp.size());
}
};
@@ -612,7 +612,7 @@ private:
{
continue;
}
int dist = static_cast<int>(abs(kh - hsv[H]));
int dist = static_cast<int>(round(abs(kh - hsv[H])));
_candidates.emplace_back(vtype, dist);
}
std::sort(_candidates.begin(), _candidates.end(),
@@ -751,11 +751,23 @@ public:
const int items_count() const { return _items_count; }
Widget_Droptype() = default;
Widget_Droptype(const cv::Mat& img, const std::string& label, Widget* const parent_widget = nullptr)
: WidgetWithCandidate(img, label, parent_widget) {}
: WidgetWithCandidate(label, parent_widget)
{
set_img(img);
}
void set_img(const cv::Mat& img)
{
cv::Mat img_bin = img;
cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY);
cv::threshold(img_bin, img_bin, 127, 255, cv::THRESH_BINARY);
int bottom = separate(img_bin, DirectionFlags::BOTTOM, 1)[0].end;
Widget::set_img(img(cv::Rect(0, 0, img.cols, bottom)));
}
Widget_Droptype& analyze()
{
if (!_img.empty())
{
_get_items_count();
_get_candidates();
}
if (const auto type = droptype();
@@ -790,7 +802,7 @@ public:
}
private:
int _items_count = static_cast<int>(round(width / (height * W_H_PROP)));
int _items_count = 0;
Widget_DroptypeLine _line {this};
Widget_DroptypeText _text {this};
void _get_candidates()
@@ -809,6 +821,10 @@ private:
_candidates = _text.candidates();
}
}
void _get_items_count()
{
_items_count = static_cast<int>(round(width / (height * W_H_PROP)));
}
};
class Widget_DropArea : public Widget
@@ -827,8 +843,7 @@ public:
: Widget("dropArea", parent_widget) {}
Widget_DropArea(const cv::Mat& img, Widget* const parent_widget = nullptr)
: Widget(img, "dropArea", parent_widget) {}
Widget_DropArea& analyze(const std::string& stage,
const std::string& difficulty)
Widget_DropArea& analyze(const std::string& stage)
{
if (!_img.empty())
{
@@ -849,7 +864,7 @@ public:
widget_label = "droptypes";
push_exception(ERROR, ExcSubtypeFlags::EXC_ILLEGAL);
}
_get_drops(stage, difficulty);
_get_drops(stage);
}
else
{
@@ -995,7 +1010,7 @@ private:
_droptype_list = q.top();
}
void _get_drops(const std::string& stage, [[maybe_unused]] const std::string& difficulty)
void _get_drops(const std::string& stage)
{
if (_status == StatusFlags::HAS_ERROR || _status == StatusFlags::ERROR)
{
@@ -1015,10 +1030,10 @@ private:
{
continue;
}
else if (std::string label =
"drops." + std::to_string(_drop_list.size());
type == DroptypeFlags::FURNITURE)
else if (type == DroptypeFlags::FURNITURE)
{
std::string label =
"drops." + std::to_string(_drop_list.size());
_drop_list.emplace_back(
Drop(Widget_Item(FURNI_1, label, this), type));
}
@@ -1034,13 +1049,13 @@ private:
int length = (droptype.width) / items_count;
for (int i = 0; i < items_count; i++)
{
std::string cur_label =
std::string label =
"drops." + std::to_string(_drop_list.size());
auto range =
cv::Range(droptype.x - x + length * i,
droptype.x - x + length * (i + 1));
auto dropimg = _img(cv::Range(0, droptype.y - y), range);
Widget_Item drop {dropimg, item_diameter, cur_label, this};
Widget_Item drop {dropimg, item_diameter, label, this};
drop.analyze(templs);
_drop_list.emplace_back(drop, type);
_drops_data.push_back({{"dropType", Droptype2Str[type]},
@@ -1216,10 +1231,10 @@ private:
}
const auto& bv = _baseline_v;
auto drop_area_img = _img(
cv::Range(static_cast<int>(bv.y + bv.height * DROP_AREA_Y_PROP), bv.y + bv.height),
cv::Range(static_cast<int>(bv.x + bv.height * DROP_AREA_X_PROP), width));
cv::Range(bv.y + static_cast<int>(bv.height * DROP_AREA_Y_PROP), bv.y + bv.height),
cv::Range(bv.x + static_cast<int>(bv.height * DROP_AREA_X_PROP), width));
_drop_area.set_img(drop_area_img);
_drop_area.analyze(_stage.stage_code(), "NORMAL");
_drop_area.analyze(_stage.stage_code());
}
};
@@ -1285,11 +1300,10 @@ private:
{
return;
}
cv::Mat img_bin = _img(cv::Rect(
0,
static_cast<int>(0.2 * height),
static_cast<int>(0.2 * width),
static_cast<int>(0.4 * height)));
cv::Mat img_bin = _img(cv::Rect(0,
static_cast<int>(0.2 * height),
static_cast<int>(0.2 * width),
static_cast<int>(0.4 * height)));
cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY);
cv::threshold(img_bin, img_bin, 120, 255, cv::THRESH_BINARY);
@@ -1309,8 +1323,9 @@ private:
abs(img_temp.cols - last_height) <= 1 &&
abs(first_height - last_height) <= 1)
{
baseline_v_rect = cv::Rect(range.start, sp2.front().start + static_cast<int>(0.2 * height),
img_temp.cols, sp2.back().end - sp2.front().start);
baseline_v_rect =
cv::Rect(range.start, sp2.front().start + static_cast<int>(0.2 * height),
img_temp.cols, sp2.back().end - sp2.front().start);
break;
}
}
@@ -1336,11 +1351,10 @@ private:
: x(x_), y(y_), width(width_), height(height_), area(area_) {}
};
cv::Mat img_bin = _img(cv::Rect(
0,
static_cast<int>(0.2 * height),
static_cast<int>(0.2 * width),
static_cast<int>(0.4 * height)));
cv::Mat img_bin = _img(cv::Rect(0,
static_cast<int>(0.2 * height),
static_cast<int>(0.2 * width),
static_cast<int>(0.4 * height)));
cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY);
cv::threshold(img_bin, img_bin, 120, 255, cv::THRESH_BINARY);
cv::Mat _;
@@ -1381,10 +1395,11 @@ private:
{
if (ccomps[0].x == ccomps[1].x)
{
baseline_v_rect = cv::Rect(ccomps[0].x,
ccomps[0].y + static_cast<int>(0.2 * height),
ccomps[0].width,
ccomps[1].y - ccomps[0].y + ccomps[1].height);
baseline_v_rect =
cv::Rect(ccomps[0].x,
ccomps[0].y + static_cast<int>(0.2 * height),
ccomps[0].width,
ccomps[1].y - ccomps[0].y + ccomps[1].height);
}
}
else if (const auto ccsize = ccomps.size();
@@ -1393,10 +1408,11 @@ private:
for (int i = 0; i < ccsize - 1; ++i)
{
if (ccomps[i].x == ccomps[i + 1].x)
baseline_v_rect = cv::Rect(ccomps[i].x,
ccomps[i].y + static_cast<int>(0.2 * height),
ccomps[i].width,
ccomps[i + 1].y - ccomps[i].y + ccomps[i + 1].height);
baseline_v_rect =
cv::Rect(ccomps[i].x,
ccomps[i].y + static_cast<int>(0.2 * height),
ccomps[i].width,
ccomps[i + 1].y - ccomps[i].y + ccomps[i + 1].height);
}
}
@@ -1420,8 +1436,9 @@ private:
}
const auto& bv = _baseline_v;
int left_margin = bv.x + bv.width;
auto result_img = _img(cv::Range(bv.y, bv.y + bv.height / 2),
cv::Range(left_margin, static_cast<int>(left_margin + 1.5 * bv.height)));
auto result_img =
_img(cv::Range(bv.y, bv.y + bv.height / 2),
cv::Range(left_margin, left_margin + static_cast<int>(1.5 * bv.height)));
cv::Mat img_bin;
cv::cvtColor(result_img, img_bin, cv::COLOR_BGR2GRAY);
cv::threshold(img_bin, img_bin, 200, 255, cv::THRESH_BINARY);
@@ -1438,8 +1455,9 @@ private:
}
const auto& bv = _baseline_v;
int left_margin = bv.x + bv.width;
auto star_img = _img(cv::Range(bv.y + bv.height / 2, bv.y + bv.height),
cv::Range(left_margin, static_cast<int>(left_margin + 1.2 * bv.height)));
auto star_img =
_img(cv::Range(bv.y + bv.height / 2, bv.y + bv.height),
cv::Range(left_margin, left_margin + static_cast<int>(1.2 * bv.height)));
cv::Mat img_bin;
cv::cvtColor(star_img, img_bin, cv::COLOR_BGR2GRAY);
cv::threshold(img_bin, img_bin, 127, 255, cv::THRESH_BINARY);
@@ -1456,9 +1474,10 @@ private:
}
const auto& bv = _baseline_v;
int left_margin = bv.x + bv.width;
auto stage_img = _img(cv::Range(0, bv.y),
cv::Range(static_cast<int>(left_margin + 0.43 * bv.height),
static_cast<int>(left_margin + 1.5 * bv.height)));
auto stage_img =
_img(cv::Range(0, bv.y),
cv::Range(left_margin + static_cast<int>(0.43 * bv.height),
left_margin + static_cast<int>(1.5 * bv.height)));
cv::Mat img_bin;
cv::cvtColor(stage_img, img_bin, cv::COLOR_BGR2GRAY);
cv::threshold(img_bin, img_bin, 200, 255, cv::THRESH_BINARY);
@@ -1475,8 +1494,9 @@ private:
}
const auto& bv = _baseline_v;
int left_margin = bv.x + bv.width;
auto diff_img = _img(cv::Range(0, bv.y),
cv::Range(left_margin, static_cast<int>(left_margin + 0.43 * bv.height)));
auto diff_img =
_img(cv::Range(0, bv.y),
cv::Range(left_margin, left_margin + static_cast<int>(0.43 * bv.height)));
cv::Mat img_bin;
cv::cvtColor(diff_img, img_bin, cv::COLOR_BGR2GRAY);
cv::threshold(img_bin, img_bin, 64, 255, cv::THRESH_BINARY);
@@ -1492,19 +1512,22 @@ private:
return;
}
const auto& bv = _baseline_v;
cv::Mat img_bin = _img(cv::Range(bv.y + bv.height, height),
cv::Range(bv.x + bv.width, static_cast<int>(0.2 * width)));
cv::Mat img_bin =
_img(cv::Range(bv.y + bv.height, height),
cv::Range(bv.x + bv.width, static_cast<int>(0.2 * width)));
cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY);
cv::threshold(img_bin, img_bin, 127, 255, cv::THRESH_BINARY);
auto sp = separate(img_bin, DirectionFlags::TOP, 2);
int top_margin = bv.y + bv.height + sp[1].start;
auto drop_area_img = _img(
cv::Range(top_margin + static_cast<int>(bv.height * DROP_AREA_Y_PROP), top_margin + bv.height),
cv::Range(top_margin + static_cast<int>(bv.height * DROP_AREA_Y_PROP),
top_margin + bv.height),
cv::Range(bv.x + bv.width, width));
_drop_area.set_img(drop_area_img);
_drop_area.analyze(_stage.stage_code(), _difficutly.difficulty());
_drop_area.analyze(_stage.stage_code());
}
};
} // namespace penguin
#endif // PENGUIN_RESULT_HPP_

View File

@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32228.430
VisualStudioVersion = 17.1.32414.318
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{6C4B8D52-51D1-45F8-AAEC-808035443FD6}"
EndProject
@@ -10,6 +10,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCaller", "tools\TestCal
{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}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TransparentImageCvt", "tools\TransparentImageCvt\TransparentImageCvt.vcxproj", "{093A3174-A27E-4D23-B64E-16F9448AD5AC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeoAssistant", "src\MeoAssistant\MeoAssistant.vcxproj", "{362D1E30-F5AE-4279-9985-65C27B3BA300}"
@@ -19,36 +21,52 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MeoAssistantBuilder", "src\MeoAssistantBuilder\MeoAssistantBuilder.csproj", "{8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CICD|x64 = CICD|x64
Debug|x64 = Debug|x64
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}.CICD|x64.ActiveCfg = RelWithDebInfo|x64
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.CICD|x64.Build.0 = RelWithDebInfo|x64
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Debug|x64.ActiveCfg = RelWithDebInfo|x64
{63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Debug|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}.Release|x86.ActiveCfg = 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
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.CICD|x64.ActiveCfg = CICD|x64
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.CICD|x64.Build.0 = CICD|x64
{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Debug|x64.ActiveCfg = Release|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}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{093A3174-A27E-4D23-B64E-16F9448AD5AC}.CICD|x64.ActiveCfg = Release|x64
{093A3174-A27E-4D23-B64E-16F9448AD5AC}.CICD|x64.Build.0 = Release|x64
{093A3174-A27E-4D23-B64E-16F9448AD5AC}.Debug|x64.ActiveCfg = Release|x64
{093A3174-A27E-4D23-B64E-16F9448AD5AC}.Debug|x64.Build.0 = Release|x64
{093A3174-A27E-4D23-B64E-16F9448AD5AC}.Release|x64.ActiveCfg = Release|x64
{093A3174-A27E-4D23-B64E-16F9448AD5AC}.Release|x64.Build.0 = Release|x64
{093A3174-A27E-4D23-B64E-16F9448AD5AC}.Release|x86.ActiveCfg = Release|Win32
{093A3174-A27E-4D23-B64E-16F9448AD5AC}.Release|x86.Build.0 = Release|Win32
{093A3174-A27E-4D23-B64E-16F9448AD5AC}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{093A3174-A27E-4D23-B64E-16F9448AD5AC}.RelWithDebInfo|x64.Build.0 = Release|x64
{093A3174-A27E-4D23-B64E-16F9448AD5AC}.RelWithDebInfo|x86.ActiveCfg = Release|Win32
{093A3174-A27E-4D23-B64E-16F9448AD5AC}.RelWithDebInfo|x86.Build.0 = Release|Win32
{362D1E30-F5AE-4279-9985-65C27B3BA300}.CICD|x64.ActiveCfg = CICD|x64
{362D1E30-F5AE-4279-9985-65C27B3BA300}.CICD|x64.Build.0 = CICD|x64
{362D1E30-F5AE-4279-9985-65C27B3BA300}.Debug|x64.ActiveCfg = RelWithDebInfo|x64
{362D1E30-F5AE-4279-9985-65C27B3BA300}.Debug|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}.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
{8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.CICD|x64.ActiveCfg = Release|x64
{8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.CICD|x64.Build.0 = Release|x64
{8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.Debug|x64.ActiveCfg = Debug|x64
{8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.Release|x64.ActiveCfg = Release|x64
{8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.Release|x64.Build.0 = Release|x64
{8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.RelWithDebInfo|x64.ActiveCfg = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

16
build.ps1 Normal file
View File

@@ -0,0 +1,16 @@
if ($args.Length -ne 1) {
throw "One argument required"
}
$target = $args[0]
$valid_targets = @("ReleaseCore", "ReleaseWpf", "ReleaseResource", "ReleaseBundle", "DevBuild")
if (!$valid_targets.Contains($target)) {
throw "$target is not a valid target"
}
Set-Location -Path .\src\MeoAssistantBuilder
dotnet run -- --target $target
Set-Location -Path ..\..\

View File

@@ -53,7 +53,7 @@
### Win11 WSA
支持。WSA 目前没有实现 AOSP screencap 需要的接口,无法进行截图。等微软支持后会尝试适配
勉强支持。WSA 的截图经常莫名其妙截出来一个白屏,导致识别异常,不推荐使用
### AVD

16
read_path.ps1 Normal file
View File

@@ -0,0 +1,16 @@
if ($args.Length -ne 2) {
throw "Need two arguments"
}
$fs = Get-ChildItem -Path $args[0] -Filter $args[1]
$index = 0
foreach($f in $fs) {
$name = $f.Name
$path = $f.FullName
Write-Output "::set-output name=name_$index::$name"
Write-Output "::set-output name=path_$index::$path"
$index = $index + 1
}

View File

@@ -1737,6 +1737,205 @@
"RecruitNowConfirm"
]
},
"ActivitiesBegin": {
"algorithm": "justreturn",
"action": "doNothing",
"next": [
"ReturnToActivities",
"MiningActivities",
"RecruitingActivities"
]
},
"ReturnToActivities": {
"template": "Return.png",
"action": "clickSelf",
"roi": [
0,
0,
180,
80
],
"next": [
"ReturnToActivities",
"MiningActivities",
"RecruitingActivities",
"Stop"
]
},
"MiningActivities": {
"algorithm": "OcrDetect",
"text": [
"限时开采",
"开采"
],
"action": "clickSelf",
"roi": [
0,
20,
302,
302
],
"next": [
"MiningActivityDigging",
"MiningActivitiesReturn"
]
},
"MiningActivityDigging": {
"action": "clickSelf",
"roi": [
901,
469,
334,
182
],
"next": [
"MiningActivityDigging",
"MiningActivityDiggingEnd",
"MiningActivitiesReturn"
]
},
"MiningActivityDiggingEnd": {
"action": "clickSelf",
"roi": [
559,
563,
160,
157
],
"next": [
"MiningActivitiesReturn"
]
},
"MiningActivitiesReturn": {
"template": "CloseAnno.png",
"action": "clickSelf",
"roi": [
1146,
0,
134,
162
],
"next": [
"RecruitingActivities",
"MiningActivitiesReturn",
"Stop"
]
},
"RecruitingActivities": {
"algorithm": "OcrDetect",
"text": [
"赠送",
"次"
],
"action": "clickSelf",
"roi": [
1148,
416,
132,
138
],
"next": [
"RecruitingActivitiesConfirm",
"RecruitingActivities"
]
},
"RecruitingActivitiesConfirm": {
"action": "doNothing",
"algorithm": "OcrDetect",
"text": [
"赠送",
"次",
"小时"
],
"roi": [
729,
515,
303,
135
],
"next": [
"RecruitingActivitiesRecruit",
"RecruitingActivitiesConfirm"
]
},
"RecruitingActivitiesRecruit": {
"algorithm": "OcrDetect",
"action": "clickSelf",
"text": [
"寻访一次",
"寻访"
],
"roi": [
770,
577,
267,
143
],
"next": [
"RecruitingActivitiesRecruitNowConfirm"
]
},
"RecruitingActivitiesRecruitNowConfirm": {
"action": "clickSelf",
"template": "RecruitNowConfirm.png",
"roi": [
586,
399,
694,
192
],
"next": [
"RecruitingActivitiesRecruitSkip",
"RecruitingActivitiesRecruitSkipWithoutButton",
"RecruitingActivitiesRecruitNowConfirm"
]
},
"RecruitingActivitiesRecruitSkip": {
"action": "clickSelf",
"template": "RecruitSkip.png",
"roi": [
1100,
0,
180,
150
],
"next": [
"RecruitingActivitiesRecruitSkip",
"RecruitingActivitiesRecruitSkipWithoutButton"
]
},
"RecruitingActivitiesRecruitSkipWithoutButton": {
"action": "clickRect",
"algorithm": "justReturn",
"specificRect": [
1180,
15,
85,
60
],
"next": [
"RecruitingActivitiesRecruitEnd",
"RecruitingActivitiesRecruitSkip",
"RecruitingActivitiesRecruitSkipWithoutButton"
]
},
"RecruitingActivitiesRecruitEnd": {
"algorithm": "OcrDetect",
"action": "doNothing",
"text": [
"寻访一次",
"寻访"
],
"roi": [
770,
577,
267,
143
],
"next": [
"Stop"
]
},
"AwardBegin": {
"algorithm": "JustReturn",
"action": "DoNothing",

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|x64">
@@ -9,6 +9,10 @@
<Configuration>RelWithDebInfo</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="CICD|x64">
<Configuration>CICD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\AsstCaller.h" />
@@ -185,6 +189,13 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CICD|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@@ -200,19 +211,30 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='CICD|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)include;$(SolutionDir)3rdparty\include;$(IncludePath)</IncludePath>
<LibraryPath>$(TargetDir);$(SolutionDir)\3rdparty\lib;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)..\..\include;$(ProjectDir)..\..\3rdparty\include;$(IncludePath)</IncludePath>
<LibraryPath>$(TargetDir);$(ProjectDir)..\..\3rdparty\lib;$(LibraryPath)</LibraryPath>
<OutDir>$(ProjectDir)..\..\$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CICD|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\include;$(ProjectDir)..\..\3rdparty\include;$(IncludePath)</IncludePath>
<LibraryPath>$(TargetDir);$(ProjectDir)..\..\3rdparty\lib;$(LibraryPath)</LibraryPath>
<OutDir>$(ProjectDir)..\..\$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)include;$(SolutionDir)3rdparty\include;$(IncludePath)</IncludePath>
<LibraryPath>$(TargetDir);$(SolutionDir)\3rdparty\lib;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)..\..\include;$(ProjectDir)..\..\3rdparty\include;$(IncludePath)</IncludePath>
<LibraryPath>$(TargetDir);$(ProjectDir)..\..\3rdparty\lib;$(LibraryPath)</LibraryPath>
<OutDir>$(ProjectDir)..\..\$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -245,19 +267,50 @@
</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>xcopy /e /y /i /c $(SolutionDir)resource $(TargetDir)resource
xcopy /e /y /i /c $(SolutionDir)3rdparty\resource $(TargetDir)resource</Command>
<Command>
xcopy /e /y /i /c $(ProjectDir)..\..\resource $(TargetDir)resource
xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\resource $(TargetDir)resource
</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>copy resource</Message>
<Message>Copy resource</Message>
</PostBuildEvent>
<PreLinkEvent>
<Command>xcopy /e /y /i /c $(SolutionDir)3rdparty\bin $(TargetDir)</Command>
<Command>
xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\bin $(TargetDir)
</Command>
</PreLinkEvent>
<PreLinkEvent>
<Message>copy 3rd party dll</Message>
<Message>Copy 3rd party dll</Message>
</PreLinkEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='CICD|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;ASST_DLL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<Optimization>MaxSpeed</Optimization>
<AdditionalOptions>/utf-8 /MP %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>ppocr.lib;opencv_world453.lib;zlibstatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<Profile>true</Profile>
<IgnoreSpecificDefaultLibraries>msvcrt.lib</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
@@ -292,17 +345,21 @@ xcopy /e /y /i /c $(SolutionDir)3rdparty\resource $(TargetDir)resource</Command>
</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>xcopy /e /y /i /c $(SolutionDir)resource $(TargetDir)resource
xcopy /e /y /i /c $(SolutionDir)3rdparty\resource $(TargetDir)resource</Command>
<Command>
xcopy /e /y /i /c $(ProjectDir)..\..\resource $(TargetDir)resource
xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\resource $(TargetDir)resource
</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>copy resource</Message>
<Message>Copy resource</Message>
</PostBuildEvent>
<PreLinkEvent>
<Command>xcopy /e /y /i /c $(SolutionDir)3rdparty\bin $(TargetDir)</Command>
<Command>
xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\bin $(TargetDir)
</Command>
</PreLinkEvent>
<PreLinkEvent>
<Message>copy 3rd party dll</Message>
<Message>Copy 3rd party dll</Message>
</PreLinkEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@@ -0,0 +1,23 @@
namespace MeoAssistantBuilder;
public static class Constants
{
public const string MaaProjectRootDirectory = "../../";
public const string MaaProjectThirdPartyDirectory = "../../3rdparty";
public const string MaaProjectResourceDirectory = "../../resource";
public const string MaaProjectArtifactDirectory = "../../artifacts";
public const string MaaCoreProjectDirectory = "../MeoAssistant";
public const string MaaWpfProjectDirectory = "../MeoAsstGui";
public const string MaaCoreProjectFilePath = $"{MaaCoreProjectDirectory}/MeoAssistant.vcxproj";
public const string MaaWpfProjectFilePath = $"{MaaWpfProjectDirectory}/MeoAsstGui.csproj";
public const string MaaBuildOutputDirectory = $"{MaaProjectRootDirectory}/x64";
public const string MaaCoreBuildIntermediatOutputDirectory = $"{MaaCoreProjectDirectory}/x64";
public static readonly string[] MaaCoreExtraFiles = new [] { "MeoAssistant.pdb", "MeoAssistant.lib", "MeoAssistant.exp" };
public static readonly string[] MaaWpfExtraFiles = new[] { "MeoAsstGui.pdb", "MeoAsstGui.exe.config" };
}

View File

@@ -0,0 +1,17 @@
using Cake.Common.Tools.MSBuild;
namespace MeoAssistantBuilder.Helper;
public static class BuildCoreHelper
{
public static void BuildCore(this MaaBuildContext context, string configuration)
{
context.MSBuild(Constants.MaaCoreProjectFilePath, new MSBuildSettings
{
WorkingDirectory = Constants.MaaProjectRootDirectory,
ToolPath = context.MsBuildExecutable,
Configuration = configuration,
PlatformTarget = PlatformTarget.x64
});
}
}

View File

@@ -0,0 +1,18 @@
using Cake.Common.Tools.MSBuild;
namespace MeoAssistantBuilder.Helper;
public static class BuildWpfHelper
{
public static void BuildWpf(this MaaBuildContext context, string configuration)
{
context.MSBuild(Constants.MaaWpfProjectFilePath, new MSBuildSettings
{
WorkingDirectory = Constants.MaaProjectRootDirectory,
Restore = true,
ToolPath = context.MsBuildExecutable,
Configuration = configuration,
PlatformTarget = PlatformTarget.x64
});
}
}

View File

@@ -0,0 +1,60 @@
using Cake.Common.Diagnostics;
using Cake.Common.IO;
namespace MeoAssistantBuilder.Helper;
public static class CleanDirectoryHelper
{
public static void CleanArtifacts(this MaaBuildContext context)
{
context.CleanDirectory(Constants.MaaProjectArtifactDirectory);
if (Directory.Exists(Constants.MaaProjectArtifactDirectory))
{
Directory.CreateDirectory(Constants.MaaProjectArtifactDirectory);
}
}
public static void CleanCore(this MaaBuildContext context)
{
context.CleanDirectory(Constants.MaaBuildOutputDirectory);
context.CleanDirectory(Constants.MaaCoreBuildIntermediatOutputDirectory);
}
public static void CleanWpf(this MaaBuildContext context)
{
context.CleanDirectory(Constants.MaaBuildOutputDirectory);
context.CleanDirectory(Path.Combine(Constants.MaaWpfProjectDirectory, "bin"));
context.CleanDirectory(Path.Combine(Constants.MaaWpfProjectDirectory, "obj"));
}
public static void CleanAll(this MaaBuildContext context)
{
CleanCore(context);
CleanWpf(context);
}
public static void RemoveExtraCore(this MaaBuildContext context, string buildOutput)
{
foreach (var extra in Constants.MaaCoreExtraFiles)
{
var file = Path.Combine(buildOutput, extra);
if (File.Exists(file))
{
File.Delete(file);
context.Information($"Delete file: {file}");
}
}
}
public static void RemoveExtraWpf(this MaaBuildContext context, string buildOutput)
{
foreach (var extra in Constants.MaaWpfExtraFiles)
{
var file = Path.Combine(buildOutput, extra);
if (File.Exists(file))
{
File.Delete(file);
context.Information($"Delete file: {file}");
}
}
}
}

View File

@@ -0,0 +1,53 @@
using Cake.Common.Diagnostics;
using Cake.Common.IO;
namespace MeoAssistantBuilder.Helper
{
public static class FileCopyHelper
{
public static void CopyThirdPartyDlls(this MaaBuildContext context, string outputDir)
{
var thirdPartyDlls = Directory.GetFiles(Path.Combine(Constants.MaaProjectThirdPartyDirectory, "bin"));
foreach (var f in thirdPartyDlls)
{
var fileName = new FileInfo(f).Name;
context.CopyFile(f, Path.Combine(outputDir, fileName));
context.Information($"Copy file: FROM {f} to {Path.Combine(outputDir, fileName)}");
}
}
public static void CopyResources(this MaaBuildContext context, string outputDir)
{
var resourceTargetDir = Path.Combine(outputDir, "resource");
var resourceThirdParty = Path.Combine(Constants.MaaProjectRootDirectory, "3rdparty\\resource");
var resoutceMaa = Path.Combine(Constants.MaaProjectRootDirectory, "resource");
var files = new List<string>();
var directories = new List<string>();
files.AddRange(Directory.GetFiles(resourceThirdParty));
files.AddRange(Directory.GetFiles(resoutceMaa));
directories.AddRange(Directory.GetDirectories(resourceThirdParty));
directories.AddRange(Directory.GetDirectories(resoutceMaa));
if (Directory.Exists(resourceTargetDir) is false)
{
Directory.CreateDirectory(resourceTargetDir);
}
foreach (var f in files)
{
var fileName = new FileInfo(f).Name;
context.CopyFile(f, Path.Combine(resourceTargetDir, fileName));
context.Information($"Copy file: FROM {f} TO {Path.Combine(resourceTargetDir, fileName)}");
}
foreach (var d in directories)
{
var dirName = new DirectoryInfo(d).Name;
context.CopyDirectory(d, Path.Combine(resourceTargetDir, dirName));
context.Information($"Copy directory: FROM {d} TO {Path.Combine(resourceTargetDir, dirName)}");
}
}
}
}

View File

@@ -0,0 +1,38 @@
using Cake.Common.Build;
using Cake.Common.Diagnostics;
namespace MeoAssistantBuilder.Helper;
public static class GetBuildInformationHelper
{
public static (string, string) GetBuildInformation(this MaaBuildContext context)
{
var ghAction = context.GitHubActions();
var buildTime = DateTime.UtcNow.AddHours(8);
var bt = buildTime.ToString("yyyy-MM-dd-HH-mm-ss");
string hash;
if (ghAction.IsRunningOnGitHubActions)
{
hash = ghAction.Environment.Workflow.Sha.ToLower()[..7];
}
else
{
try
{
var realPath = new DirectoryInfo(Constants.MaaProjectRootDirectory).FullName;
var repo = new LibGit2Sharp.Repository(realPath);
var commit = repo.Commits.First();
hash = commit.Sha.ToLower()[..7];
}
catch (Exception e)
{
context.Warning($"Failed to get git log: {e.Message}");
hash = "Unknown";
}
}
return (bt, hash);
}
}

View File

@@ -0,0 +1,28 @@
using Cake.Common;
using Cake.Common.Tools.VSWhere;
using Cake.Core;
using Cake.Core.Diagnostics;
using Cake.Frosting;
namespace MeoAssistantBuilder;
public class MaaBuildContext : FrostingContext
{
public string MsBuildExecutable { get; set; }
public MaaBuildContext(ICakeContext context) : base(context)
{
MsBuildExecutable = context.Argument<string>("tool", "");
if (MsBuildExecutable == "")
{
var vsPath = context.VSWhereLatest();
if (vsPath == null)
{
context.Log.Write(Verbosity.Normal, LogLevel.Fatal, "Can not find Visual Studio install path");
System.Environment.Exit(-1);
}
MsBuildExecutable = Path.Combine(vsPath.FullPath, "Msbuild\\Current\\Bin\\MsBuild.exe");
}
context.Log.Information($"Use MsBuild at: {MsBuildExecutable}");
}
}

View File

@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<Platforms>x64</Platforms>
<Configurations>Debug;Release;CICD</Configurations>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="2.2.0" />
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0102" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,15 @@
using Cake.Frosting;
using MeoAssistantBuilder;
var sArgs = new List<string>();
foreach (var arg in args)
{
var sa = arg.Split(" ")
.ToList();
sa.RemoveAll(x => string.IsNullOrEmpty(x) || string.IsNullOrWhiteSpace(x));
sArgs.AddRange(sa);
}
return new CakeHost()
.UseContext<MaaBuildContext>()
.Run(sArgs);

View File

@@ -0,0 +1,23 @@
# MeoAssistantBuilder
MAA 构建项目
## 构建 MAA
需要安装
- `.NET SDK 6.0`
- `.NET Framework SDK 4.8`
- `MSVC v143 x64`
- `MSBuild (VS2022)`
在本项目根目录执行
```
dotnet run -- --target <TARGET>
```
TARGET 可选项
- `DevBuild`
- `ReleaseCore`
- `ReleaseWpf`
- `ReleaseResource`

View File

@@ -0,0 +1,61 @@
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Frosting;
using MeoAssistantBuilder.Helper;
using System.IO.Compression;
namespace MeoAssistantBuilder.Tasks;
[TaskName("DevBuild")]
public sealed class DevBuildTask : FrostingTask<MaaBuildContext>
{
public override void Run(MaaBuildContext context)
{
context.Information("--------------------------------------------------");
context.Information("1. Get build information");
context.Information("--------------------------------------------------");
context.CleanArtifacts();
var (bt, hash) = context.GetBuildInformation();
var artifact = $"MaaBundle-DevBuild-(CONF)-{hash}-{bt}.zip";
context.Information($"Dev build of commit {hash} at {bt}");
context.Information("--------------------------------------------------");
context.Information("2. Build MaaBundle with configuration Release");
context.Information("--------------------------------------------------");
context.CleanAll();
context.BuildCore("Release");
context.BuildWpf("Release");
var releaseOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "Release");
var releaseArtifact = Path.Combine(Constants.MaaProjectArtifactDirectory, artifact.Replace("(CONF)", "Release"));
ZipFile.CreateFromDirectory(releaseOutput, releaseArtifact);
context.Information("--------------------------------------------------");
context.Information("3. Build MaaBundle with configuration RelWithDebInfo");
context.Information("--------------------------------------------------");
context.CleanAll();
context.BuildCore("RelWithDebInfo");
context.BuildWpf("RelWithDebInfo");
var releaseDebugOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "RelWithDebInfo");
var releaseDebugArtifact = Path.Combine(Constants.MaaProjectArtifactDirectory, artifact.Replace("(CONF)", "RelWithDebInfo"));
ZipFile.CreateFromDirectory(releaseDebugOutput, releaseDebugArtifact);
context.Information("--------------------------------------------------");
context.Information("4. Build MaaBundle with configuration CICD");
context.Information("--------------------------------------------------");
context.CleanAll();
context.BuildCore("CICD");
context.BuildWpf("CICD");
var releaseCiOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "CICD");
var releaseCiArtifact = Path.Combine(Constants.MaaProjectArtifactDirectory, artifact.Replace("(CONF)", "CICD"));
context.CopyThirdPartyDlls(releaseCiOutput);
context.CopyResources(releaseCiOutput);
ZipFile.CreateFromDirectory(releaseCiOutput, releaseCiArtifact);
}
}

View File

@@ -0,0 +1,88 @@
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Frosting;
using MeoAssistantBuilder.Helper;
using System.IO.Compression;
using System.Text.RegularExpressions;
namespace MeoAssistantBuilder.Tasks;
[TaskName("ReleaseBundle")]
public sealed class ReleaseBundleTask : FrostingTask<MaaBuildContext>
{
public override void Run(MaaBuildContext context)
{
context.Information("--------------------------------------------------");
context.Information("1. Read MaaCore version string");
context.Information("--------------------------------------------------");
var version = "UNKNOWN";
var versionFile = Path.Combine(Constants.MaaCoreProjectDirectory, "Version.h");
var versionFileContent = File.ReadAllText(versionFile);
var regex = @"v((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)";
var match = Regex.Match(versionFileContent, regex);
if (match.Success is false)
{
context.Warning("Can not read version");
Environment.Exit(-1);
}
else
{
version = match.Value;
}
var ghActions = context.GitHubActions();
if (ghActions.IsRunningOnGitHubActions is false)
{
version += "-Local";
}
else
{
context.Information($"Running in GitHub Action with workflow name: {ghActions.Environment.Workflow.Workflow}, ref: {ghActions.Environment.Workflow.Ref}");
if (ghActions.Environment.Workflow.Workflow != "Release MaaCore")
{
version += $"-{ghActions.Environment.Workflow.RunId}";
}
else
{
var tag = ghActions.Environment.Workflow.Ref.Replace("refs/tags/", "");
if (tag != version)
{
context.Error($"Version do not match. From File: {version}. From Ref: {tag}");
Environment.Exit(-1);
}
}
}
context.Information($"MaaCore Version: {version}");
context.Information("--------------------------------------------------");
context.Information("2. Release MaaCore with third party dlls and resource");
context.Information("--------------------------------------------------");
var buildOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "Release");
context.CleanAll();
context.CleanArtifacts();
context.BuildCore("Release");
context.RemoveExtraCore(buildOutput);
context.Information("--------------------------------------------------");
context.Information("3. Release MaaWpf with third party executables");
context.Information("--------------------------------------------------");
context.BuildWpf("Release");
context.RemoveExtraWpf(buildOutput);
context.Information("--------------------------------------------------");
context.Information("4. Bundle MaaBundle package");
context.Information("--------------------------------------------------");
var bundle = Path.Combine(Constants.MaaProjectArtifactDirectory, $"MaaBundle-{version}.zip");
ZipFile.CreateFromDirectory(buildOutput, bundle);
context.Information($"Bundled MaaBundle file: {bundle}");
}
}

View File

@@ -0,0 +1,97 @@
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Frosting;
using MeoAssistantBuilder.Helper;
using System.IO.Compression;
using System.Text.RegularExpressions;
namespace MeoAssistantBuilder.Tasks;
[TaskName("ReleaseCore")]
public sealed class ReleaseCoreTask : FrostingTask<MaaBuildContext>
{
public override void Run(MaaBuildContext context)
{
context.Information("--------------------------------------------------");
context.Information("1. Read MaaCore version string");
context.Information("--------------------------------------------------");
var version = "UNKNOWN";
var versionFile = Path.Combine(Constants.MaaCoreProjectDirectory, "Version.h");
var versionFileContent = File.ReadAllText(versionFile);
var regex = @"v((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)";
var match = Regex.Match(versionFileContent, regex);
if (match.Success is false)
{
context.Warning("Can not read version");
Environment.Exit(-1);
}
else
{
version = match.Value;
}
var ghActions = context.GitHubActions();
if (ghActions.IsRunningOnGitHubActions is false)
{
version += "-Local";
}
else
{
context.Information($"Running in GitHub Action with workflow name: {ghActions.Environment.Workflow.Workflow}, ref: {ghActions.Environment.Workflow.Ref}");
if (ghActions.Environment.Workflow.Workflow != "Release MaaCore")
{
version += $"-{ghActions.Environment.Workflow.RunId}";
}
else
{
var tag = ghActions.Environment.Workflow.Ref.Replace("refs/tags/", "");
if (tag != version)
{
context.Error($"Version do not match. From File: {version}. From Ref: {tag}");
Environment.Exit(-1);
}
}
}
context.Information($"MaaCore Version: {version}");
context.Information("--------------------------------------------------");
context.Information("2. Build MaaCore with CICD configuration");
context.Information("--------------------------------------------------");
context.CleanCore();
context.CleanArtifacts();
context.BuildCore("CICD");
context.Information("--------------------------------------------------");
context.Information("3. Remove extra files from build output");
context.Information("--------------------------------------------------");
var buildOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "CICD");
context.RemoveExtraCore(buildOutput);
context.Information("--------------------------------------------------");
context.Information("4. Copy 3rd party library DLLs to output directory");
context.Information("--------------------------------------------------");
var thirdPartyDlls = Directory.GetFiles(Path.Combine(Constants.MaaProjectThirdPartyDirectory, "bin"));
foreach(var f in thirdPartyDlls)
{
var fileName = new FileInfo(f).Name;
File.Copy(f, Path.Combine(buildOutput, fileName));
context.Information($"Copy file: FROM {f} to {Path.Combine(buildOutput, fileName)}");
}
context.Information("--------------------------------------------------");
context.Information("5. Bundle MaaCore DLLs");
context.Information("--------------------------------------------------");
var bundle = Path.Combine(Constants.MaaProjectArtifactDirectory, $"MaaCore-{version}.zip");
ZipFile.CreateFromDirectory(buildOutput, bundle);
context.Information($"Bundled MAACore DLLs file: {bundle}");
}
}

View File

@@ -0,0 +1,43 @@
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Frosting;
using MeoAssistantBuilder.Helper;
using System.IO.Compression;
namespace MeoAssistantBuilder.Tasks;
[TaskName("ReleaseResource")]
public sealed class ReleaseResourceTask : FrostingTask<MaaBuildContext>
{
public override void Run(MaaBuildContext context)
{
context.Information("--------------------------------------------------");
context.Information("1. Get bundle information");
context.Information("--------------------------------------------------");
var (hash, bt) = context.GetBuildInformation();
context.CleanArtifacts();
var version = $"{hash}-{bt}";
context.Information($"MaaResource Version: {version}");
context.Information("--------------------------------------------------");
context.Information("2. Copy MaaResource");
context.Information("--------------------------------------------------");
var resDir = Path.Combine(Constants.MaaBuildOutputDirectory, "resource");
if (Directory.Exists(resDir) is false)
{
Directory.CreateDirectory(resDir);
}
context.CopyResources(resDir);
context.Information("--------------------------------------------------");
context.Information("3. Bundle MaaResource");
context.Information("--------------------------------------------------");
var bundle = Path.Combine(Constants.MaaProjectArtifactDirectory, $"MaaResource-{version}.zip");
ZipFile.CreateFromDirectory(resDir, bundle);
context.Information($"Bundled MaaResource file: {bundle}");
}
}

View File

@@ -0,0 +1,46 @@
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Frosting;
using MeoAssistantBuilder.Helper;
using System.IO.Compression;
namespace MeoAssistantBuilder.Tasks;
[TaskName("ReleaseWpf")]
public sealed class ReleaseWpfTask : FrostingTask<MaaBuildContext>
{
public override void Run(MaaBuildContext context)
{
context.Information("--------------------------------------------------");
context.Information("1. Build MaaWpf with ReleaseCore configuration");
context.Information("--------------------------------------------------");
var (hash, bt) = context.GetBuildInformation();
context.CleanWpf();
context.CleanArtifacts();
context.BuildWpf("CICD");
context.Information("--------------------------------------------------");
context.Information("2. Remove extra files from build output");
context.Information("--------------------------------------------------");
var buildOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "CICD");
context.RemoveExtraWpf(buildOutput);
context.Information("--------------------------------------------------");
context.Information("3. Set MaaWpf Version Number");
context.Information("--------------------------------------------------");
var version = $"{hash}-{bt}";
context.Information($"MaaWpf Version: {version}");
context.Information("--------------------------------------------------");
context.Information("4. Bundle MaaWpf Executables");
context.Information("--------------------------------------------------");
var bundle = Path.Combine(Constants.MaaProjectArtifactDirectory, $"MaaWpf-{version}.zip");
ZipFile.CreateFromDirectory(buildOutput, bundle);
context.Information($"Bundled MaaWpf Executables file: {bundle}");
}
}

View File

@@ -11,7 +11,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

View File

@@ -139,46 +139,45 @@ namespace MeoAsstGui
/// <param name="sounds">提示音类型</param>
protected async Task PlayNotificationSoundAsync(NotificationSounds sounds = NotificationSounds.None)
{
await Task.Run(() =>
try
{
try
switch (sounds)
{
switch (sounds)
{
case NotificationSounds.Exclamation: SystemSounds.Exclamation.Play(); break;
case NotificationSounds.Asterisk: SystemSounds.Asterisk.Play(); break;
case NotificationSounds.Question: SystemSounds.Question.Play(); break;
case NotificationSounds.Beep: SystemSounds.Beep.Play(); break;
case NotificationSounds.Hand: SystemSounds.Hand.Play(); break;
case NotificationSounds.Exclamation: SystemSounds.Exclamation.Play(); break;
case NotificationSounds.Asterisk: SystemSounds.Asterisk.Play(); break;
case NotificationSounds.Question: SystemSounds.Question.Play(); break;
case NotificationSounds.Beep: SystemSounds.Beep.Play(); break;
case NotificationSounds.Hand: SystemSounds.Hand.Play(); break;
case NotificationSounds.Notification:
using (var key = Registry.CurrentUser.OpenSubKey(@"AppEvents\Schemes\Apps\.Default\Notification.Default\.Current"))
case NotificationSounds.Notification:
using (var key = Registry.CurrentUser.OpenSubKey(@"AppEvents\Schemes\Apps\.Default\Notification.Default\.Current"))
{
if (key != null)
{
if (key != null)
// 获取 (Default) 项
var o = key.GetValue(null);
if (o != null)
{
// 获取 (Default) 项
var o = key.GetValue(null);
if (o != null)
{
var theSound = new SoundPlayer((string)o);
theSound.Play();
}
}
else
{
// 如果不支持就播放其它提示音
PlayNotificationSoundAsync(NotificationSounds.Asterisk);
var theSound = new SoundPlayer((string)o);
theSound.Play();
}
}
break;
else
{
// 如果不支持就播放其它提示音
await PlayNotificationSoundAsync(NotificationSounds.Asterisk);
}
}
break;
case NotificationSounds.None:
default: break;
}
case NotificationSounds.None:
default: break;
}
catch (Exception) { }
}).ConfigureAwait(false);
}
catch (Exception)
{
// Ignore
}
}
#endregion
@@ -316,7 +315,7 @@ namespace MeoAsstGui
}
// 播放通知提示音
PlayNotificationSoundAsync(sound);
PlayNotificationSoundAsync(sound).Wait();
// 任务栏闪烁
FlashWindowEx();

View File

@@ -38,23 +38,25 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>newlogo.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RelWithDebInfo|AnyCPU'">
<PropertyGroup>
<StartupObject>MeoAsstGui.App</StartupObject>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>..\..\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RelWithDebInfo|x64'">
<OutputPath>..\..\x64\RelWithDebInfo\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>false</Optimize>
@@ -63,28 +65,17 @@
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup>
<StartupObject>MeoAsstGui.App</StartupObject>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'CICD|x64'">
<OutputPath>..\..\x64\CICD\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Costura, Version=5.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Costura.Fody.5.6.0\lib\netstandard1.0\Costura.dll</HintPath>
</Reference>
<Reference Include="GongSolutions.WPF.DragDrop, Version=2.0.0.0, Culture=neutral, PublicKeyToken=91f1945125b7a587, processorArchitecture=MSIL">
<HintPath>..\..\packages\gong-wpf-dragdrop.2.4.1\lib\net47\GongSolutions.WPF.DragDrop.dll</HintPath>
</Reference>
<Reference Include="HandyControl, Version=3.2.0.0, Culture=neutral, PublicKeyToken=45be8712787a1e5b, processorArchitecture=MSIL">
<HintPath>..\..\packages\HandyControl.3.2.0\lib\net472\HandyControl.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Stylet, Version=1.3.6.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Stylet.1.3.6\lib\net45\Stylet.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
@@ -225,26 +216,7 @@
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include=".editorconfig" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
@@ -252,7 +224,7 @@
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 x64%29</ProductName>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
@@ -267,17 +239,16 @@
</PackageReference>
<PackageReference Include="Costura.Fody">
<Version>5.7.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="gong-wpf-dragdrop">
<Version>2.4.3</Version>
<Version>3.1.1</Version>
</PackageReference>
<PackageReference Include="HandyControl">
<Version>3.3.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.Platforms">
<Version>5.0.4</Version>
<Version>6.0.3</Version>
</PackageReference>
<PackageReference Include="Microsoft.Win32.Primitives">
<Version>4.3.0</Version>
@@ -289,7 +260,7 @@
<Version>13.0.1</Version>
</PackageReference>
<PackageReference Include="Notification.Wpf">
<Version>6.1.0.1</Version>
<Version>6.1.0.5</Version>
</PackageReference>
<PackageReference Include="Stylet">
<Version>1.3.6</Version>
@@ -310,7 +281,7 @@
<Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.DiagnosticSource">
<Version>5.0.1</Version>
<Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.Tools">
<Version>4.3.0</Version>
@@ -417,6 +388,6 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy /e /y /i /c $(SolutionDir)resource $(TargetDir)resource</PostBuildEvent>
<PostBuildEvent>xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\tools $(TargetDir)</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -1,72 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace MeoAsstGui.Properties
{
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if (object.ReferenceEquals(resourceMan, null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MeoAsstGui.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -1,30 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace MeoAsstGui.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>