Merge pull request #1 from moomiji/feat/OperRecognizer

feat: 干员识别加入识别工具
This commit is contained in:
GD-GK
2023-04-20 08:12:06 +08:00
committed by GitHub
23 changed files with 1155 additions and 505 deletions

View File

@@ -0,0 +1,759 @@
{
"type": "SSS",
"stage_name": "雷神工业测试平台",
"minimum_required": "v4.9.0",
"doc": {
"title": "保全雷神工业测试平台-澄闪铃兰塞雷娅夜莺白面鸮(应急未测试)",
"title_color": "dark",
"details": "目前只能手动编队,请尽量选择练度高费用低的干员,先锋不要带投锋\n\n推荐在您确认了导能原件选择了第三个、战术装备全选A、手动编队并阵容确认后再开始MAA\n\n作业修改自萧然q BV1Sm4y117e3\n\n搬运自作业搬运工\n有问题群里找管理作业搬运工/摸你一下/碳烤沙虫腿",
"details_color": "dark"
},
"buff": "便携式医疗设备",
"equipment": [
"A",
"A",
"A",
"A",
"A",
"A",
"A",
"A"
],
"strategy": "优选策略",
"opers": [
{
"name": "塞雷娅",
"skill": 2,
"skill_usage": 0
},
{
"name": "澄闪",
"skill": 2,
"skill_usage": 0
},
{
"name": "铃兰",
"skill": 2,
"skill_usage": 0
},
{
"name": "白面鸮",
"skill": 2,
"skill_usage": 0
},
{
"name": "夜莺",
"skill": 2,
"skill_usage": 0
}
],
"tool_men": {
"先锋": 3,
"重装": 2,
"狙击": 7,
"辅助": 3
},
"drops": [
"无需增调干员",
"狙击",
"辅助",
"先锋",
"重装",
"战备激活阀",
"增活针剂",
"医疗",
"近卫"
],
"blacklist": [
"罗比菈塔",
"掠风",
"白铁",
"伺夜",
"豆苗",
"夜半",
"森蚺",
"泥岩",
"斥罪",
"洋灰",
"极光",
"海蒂",
"U-Official",
"晓歌",
"梅尔",
"桃金娘",
"极境",
"琴柳"
],
"stages": [
{
"stage_name": "致命吸引",
"strategies": [
{
"tool_men": {
"先锋": 1
},
"location": [
3,
2
],
"direction": "Right"
},
{
"core": "夜莺",
"tool_men": {
"狙击": 1
},
"location": [
3,
1
],
"direction": "Down"
},
{
"core": "塞雷娅",
"tool_men": {
"重装": 1
},
"location": [
4,
2
],
"direction": "Right"
},
{
"core": "澄闪",
"tool_men": {
"狙击": 2
},
"location": [
3,
3
],
"direction": "Right"
},
{
"tool_men": {
"辅助": 100
},
"location": [
4,
1
],
"direction": "Right"
}
],
"draw_as_possible": true,
"actions": [
{
"type": "二倍速"
},
{
"type": "Retreat",
"location": [
3,
2
],
"costs": 20
},
{
"type": "Deploy",
"name": "便携式医疗设备",
"location": [
3,
5
],
"direction": "None"
}
],
"retry_times": 3
},
{
"stage_name": "烂醉铁锤",
"strategies": [
{
"tool_men": {
"先锋": 1
},
"location": [
4,
1
],
"direction": "Left"
},
{
"core": "塞雷娅",
"tool_men": {
"重装": 1
},
"location": [
3,
1
],
"direction": "Left"
},
{
"core": "夜莺",
"tool_men": {
"狙击": 1
},
"location": [
3,
3
],
"direction": "Up"
},
{
"core": "澄闪",
"tool_men": {
"狙击": 2
},
"location": [
3,
2
],
"direction": "Left"
},
{
"tool_men": {
"辅助": 100
},
"location": [
2,
2
],
"direction": "Left"
}
],
"draw_as_possible": true,
"actions": [
{
"type": "二倍速"
},
{
"type": "Deploy",
"name": "便携式医疗设备",
"location": [
5,
5
],
"direction": "None"
}
],
"retry_times": 3
},
{
"stage_name": "为了生存",
"strategies": [
{
"tool_men": {
"先锋": 1
},
"location": [
4,
3
],
"direction": "Right"
},
{
"core": "夜莺",
"tool_men": {
"狙击": 0
},
"location": [
4,
2
],
"direction": "Right"
},
{
"core": "澄闪",
"tool_men": {
"狙击": 3
},
"location": [
5,
2
],
"direction": "Right"
},
{
"core": "铃兰",
"tool_men": {
"狙击": 2
},
"location": [
6,
2
],
"direction": "Down"
},
{
"core": "塞雷娅",
"tool_men": {
"先锋": 1,
"重装": 1
},
"location": [
4,
3
],
"direction": "Right"
},
{
"core": "白面鸮",
"tool_men": {
"辅助": 10,
"狙击": 2
},
"location": [
3,
2
],
"direction": "Right"
}
],
"draw_as_possible": true,
"actions": [
{
"type": "二倍速"
},
{
"type": "Deploy",
"name": "超重绝缘水泥",
"kills": 27,
"location": [
1,
5
],
"direction": "None"
},
{
"type": "Deploy",
"name": "超重绝缘水泥",
"kills": 27,
"location": [
2,
5
],
"direction": "None"
},
{
"type": "Deploy",
"name": "便携式医疗设备",
"location": [
2,
6
],
"direction": "None"
}
],
"retry_times": 3
},
{
"stage_name": "混合毒气",
"strategies": [
{
"tool_men": {
"先锋": 1
},
"location": [
4,
2
],
"direction": "Down"
},
{
"core": "夜莺",
"tool_men": {
"狙击": 1
},
"location": [
6,
2
],
"direction": "Left"
},
{
"core": "澄闪",
"tool_men": {
"狙击": 3
},
"location": [
6,
3
],
"direction": "Down"
},
{
"tool_men": {
"先锋": 10
},
"location": [
7,
2
],
"direction": "Down"
},
{
"core": "塞雷娅",
"tool_men": {
"重装": 1
},
"location": [
5,
2
],
"direction": "Down"
},
{
"tool_men": {
"重装": 1
},
"location": [
4,
2
],
"direction": "Down"
},
{
"core": "白面鸮",
"tool_men": {
"辅助": 10
},
"location": [
6,
1
],
"direction": "Left"
}
],
"draw_as_possible": true,
"actions": [
{
"type": "二倍速"
},
{
"type": "Deploy",
"name": "战备激活阀",
"kills": 4,
"location": [
5,
3
],
"direction": "Right"
},
{
"type": "Deploy",
"name": "便携式医疗设备",
"location": [
2,
3
],
"direction": "None"
},
{
"type": "Deploy",
"name": "超重绝缘水泥",
"kills": 27,
"location": [
1,
3
],
"direction": "None"
},
{
"type": "Deploy",
"name": "超重绝缘水泥",
"kills": 27,
"location": [
1,
4
],
"direction": "None"
}
],
"retry_times": 8
},
{
"stage_name": "枯朽孕育",
"strategies": [
{
"tool_men": {
"先锋": 1
},
"location": [
1,
3
],
"direction": "Right"
},
{
"core": "塞雷娅",
"tool_men": {
"重装": 0
},
"location": [
2,
3
],
"direction": "Right"
},
{
"core": "夜莺",
"tool_men": {
"狙击": 1
},
"location": [
1,
2
],
"direction": "Down"
},
{
"core": "澄闪",
"tool_men": {
"狙击": 3
},
"location": [
2,
2
],
"direction": "Right"
},
{
"core": "铃兰",
"tool_men": {
"狙击": 2
},
"location": [
2,
4
],
"direction": "Right"
},
{
"core": "白面鸮",
"tool_men": {
"狙击": 2
},
"location": [
1,
4
],
"direction": "Up"
},
{
"tool_men": {
"辅助": 100
},
"location": [
3,
2
],
"direction": "Right"
},
{
"tool_men": {
"先锋": 100,
"重装": 100
},
"location": [
1,
3
],
"direction": "Right"
}
],
"draw_as_possible": true,
"actions": [
{
"type": "二倍速"
},
{
"type": "Deploy",
"name": "战备激活阀",
"kills": 4,
"location": [
2,
1
],
"direction": "Down"
},
{
"type": "Deploy",
"name": "便携式医疗设备",
"location": [
4,
5
],
"direction": "None"
},
{
"type": "Deploy",
"name": "超重绝缘水泥",
"kills": 30,
"location": [
2,
5
],
"direction": "None"
},
{
"type": "Deploy",
"name": "超重绝缘水泥",
"kills": 30,
"location": [
3,
5
],
"direction": "None"
}
],
"retry_times": 8
},
{
"stage_name": "窒息",
"strategies": [
{
"tool_men": {
"先锋": 1
},
"location": [
3,
4
],
"direction": "Up"
},
{
"core": "夜莺",
"tool_men": {
"狙击": 1
},
"location": [
4,
5
],
"direction": "Left"
},
{
"core": "塞雷娅",
"tool_men": {
"重装": 1
},
"location": [
3,
4
],
"direction": "Left"
},
{
"core": "澄闪",
"tool_men": {
"狙击": 3
},
"location": [
5,
4
],
"direction": "Left"
},
{
"core": "白面鸮",
"tool_men": {
"狙击": 3
},
"location": [
5,
5
],
"direction": "Left"
},
{
"core": "铃兰",
"tool_men": {
"狙击": 3
},
"location": [
2,
5
],
"direction": "Right"
},
{
"tool_men": {
"重装": 100
},
"location": [
7,
6
],
"direction": "Right"
},
{
"tool_men": {
"辅助": 100
},
"location": [
2,
3
],
"direction": "Down"
}
],
"draw_as_possible": true,
"actions": [
{
"type": "二倍速"
},
{
"type": "Deploy",
"name": "战备激活阀",
"kills": 5,
"location": [
6,
4
],
"direction": "Left"
},
{
"type": "Retreat",
"kills": 8,
"location": [
3,
5
]
},
{
"type": "Deploy",
"name": "便携式医疗设备",
"location": [
6,
3
],
"direction": "None"
},
{
"type": "Deploy",
"name": "超重绝缘水泥",
"kills": 30,
"location": [
7,
6
],
"direction": "None"
},
{
"type": "Deploy",
"name": "超重绝缘水泥",
"kills": 30,
"location": [
8,
6
],
"direction": "None"
}
],
"retry_times": 8
}
]
}

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -48,7 +48,6 @@
<PackagePath>\</PackagePath>
</None>
<None Include=".editorconfig" />
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CalcBinding">

View File

@@ -165,9 +165,6 @@ namespace MaaWpfGui.Main
private readonly RecognizerViewModel _recognizerViewModel;
private readonly CopilotViewModel _copilotViewModel;
private readonly OperViewModel _operViewModel;
/// <summary>
/// Initializes a new instance of the <see cref="AsstProxy"/> class.
/// </summary>
@@ -180,9 +177,6 @@ namespace MaaWpfGui.Main
_recognizerViewModel = container.Get<RecognizerViewModel>();
_copilotViewModel = container.Get<CopilotViewModel>();
_operViewModel = container.Get<OperViewModel>();
_windowManager = windowManager;
_callback = CallbackFunction;
}
@@ -830,7 +824,7 @@ namespace MaaWpfGui.Main
if (taskChain == "Oper")
{
_operViewModel.Parse((JObject)subTaskDetails);
_recognizerViewModel.OperParse((JObject)subTaskDetails);
}
string what = details["what"].ToString();

View File

@@ -39,33 +39,9 @@ namespace MaaWpfGui.Main
public class Bootstrapper : Bootstrapper<RootViewModel>
{
private static SettingsViewModel _settingsViewModel;
private static TrayIcon _trayIconInSettingsViewModel;
private static readonly FieldInfo _settingsViewModelIContainerFiled =
typeof(SettingsViewModel).GetField("_container", BindingFlags.NonPublic | BindingFlags.Instance);
private static TrayIcon _trayIcon;
private static ILogger _logger = Logger.None;
/// <summary>
/// Sets tray icon in <see cref="SettingsViewModel"/>.
/// </summary>
/// <param name="settingsViewModel">The <see cref="SettingsViewModel"/> instance.</param>
/// <remarks>
/// 应当只能是 <see cref="SettingsViewModel"/> 在构造时调用这个函数。用反射拿 <see cref="SettingsViewModel._container"/> 只是为了不额外修改 <see cref="SettingsViewModel"/> 的定义,
/// 并顺便检查传入的 <see cref="SettingsViewModel._container"/> 不为空(即不是随便 <see langword="new"/> 出来的一个 <see cref="SettingsViewModel"/>)。
/// </remarks>
internal static void SetTrayIconInSettingsViewModel(SettingsViewModel settingsViewModel)
{
_settingsViewModel = settingsViewModel;
var container = (IContainer)_settingsViewModelIContainerFiled.GetValue(settingsViewModel);
if (container != null)
{
_trayIconInSettingsViewModel = container.Get<TrayIcon>();
}
// TODO:出现不符合要求的settingsViewModel应当Log一下等一个有缘人
}
/// <inheritdoc/>
/// <remarks>初始化些啥自己加。</remarks>
protected override void OnStart()
@@ -146,8 +122,6 @@ namespace MaaWpfGui.Main
builder.Bind<RecognizerViewModel>().ToSelf().InSingletonScope();
builder.Bind<SettingsViewModel>().ToSelf().InSingletonScope();
builder.Bind<CopilotViewModel>().ToSelf().InSingletonScope();
builder.Bind<OperViewModel>().ToSelf().InSingletonScope();
builder.Bind<AsstProxy>().ToSelf().InSingletonScope();
builder.Bind<TrayIcon>().ToSelf().InSingletonScope();
@@ -166,10 +140,21 @@ namespace MaaWpfGui.Main
/// <inheritdoc/>
protected override void DisplayRootView(object rootViewModel)
{
var windowManager = (Helper.WindowManager)GetInstance(typeof(Helper.WindowManager));
var windowManager = (IWindowManager)GetInstance(typeof(Helper.WindowManager));
windowManager.ShowWindow(rootViewModel);
}
/// <inheritdoc/>
protected override void OnLaunch()
{
var versionUpdateViewModel = (VersionUpdateViewModel)GetInstance(typeof(VersionUpdateViewModel));
versionUpdateViewModel.ShowUpdateOrDownload();
// TrayIcon应该在显示rootViewModel之后再加载
_trayIcon = (TrayIcon)GetInstance(typeof(TrayIcon));
_settingsViewModel = (SettingsViewModel)GetInstance(typeof(SettingsViewModel));
}
/// <inheritdoc/>
/// <remarks>退出时执行啥自己加。</remarks>
protected override void OnExit(ExitEventArgs e)
@@ -185,7 +170,7 @@ namespace MaaWpfGui.Main
}
// 注销任务栏图标
_trayIconInSettingsViewModel.Close();
_trayIcon.Close();
ConfigurationHelper.Release();
_logger.Information("MaaAssistantArknights GUI exited");

View File

@@ -356,10 +356,10 @@
<!-- Logs -->
<!-- Farming -->
<system:String x:Key="IdentificationTool">Identification tool</system:String>
<system:String x:Key="IdentificationTool">Identification Tool</system:String>
<!-- Recruitment Recognition -->
<system:String x:Key="RecruitmentRecognition">Recruit tool</system:String>
<system:String x:Key="RecruitmentRecognition">Recruit Tool</system:String>
<system:String x:Key="RecruitmentRecognitionTip">Tip: This recognition is independent from main tab (Farming); need open up in game recruit tag selection screen then begin ~</system:String>
<system:String x:Key="AutoSettingTime">Auto setting time</system:String>
<system:String x:Key="AutoSelectLevel3Tags">Auto select 3 ★ Tags</system:String>
@@ -370,7 +370,7 @@
<!-- Recruitment Recognition -->
<!-- Depot Recognition -->
<system:String x:Key="DepotRecognition">Depot tool beta</system:String>
<system:String x:Key="DepotRecognition">Depot Tool</system:String>
<system:String x:Key="DepotRecognitionTip">This function is still a test version, please check if the recognition result is correct before using it. If there is an error, please submit the issue by compressing the debug/depot folder in the working path.</system:String>
<system:String x:Key="BeganToDepotRecognition">Start to identify</system:String>
<system:String x:Key="ExportToArkplanner">Export to Arkplanner</system:String>
@@ -379,7 +379,7 @@
<!-- Depot Recognition -->
<!-- 干员识别 -->
<system:String x:Key="OperRecognition">干员识别 beta</system:String>
<system:String x:Key="OperRecognition">干员识别 Tool beta</system:String>
<system:String x:Key="OperRecognitionTip">该功能尚处于测试阶段,干员列表请用稀有度和等级排序,若统计有误,欢迎打包 debug/oper 文件后向我们提交issue ~</system:String>
<system:String x:Key="BeganToOperRecognition">开始识别</system:String>
<!-- 干员识别 -->

View File

@@ -371,7 +371,7 @@
<!-- 公開求人認識 -->
<!-- 倉庫アイテム認識 -->
<system:String x:Key="DepotRecognition">倉庫アイテム認識 beta</system:String>
<system:String x:Key="DepotRecognition">倉庫アイテム認識</system:String>
<system:String x:Key="DepotRecognitionTip">この機能はまだテスト版です。倉庫を開いた後、素材のタブを選択してから認識を行い、結果が正しいかどうか確認してください。エラーが発生した場合は、debug/depotフォルダを作業パスに圧縮して、issueを提出してください。</system:String>
<system:String x:Key="BeganToDepotRecognition">認識開始</system:String>
<system:String x:Key="ExportToArkplanner">Arkplannerへ出力</system:String>

View File

@@ -351,7 +351,7 @@
<!-- 공개모집 인식 -->
<!-- 창고 정리 -->
<system:String x:Key="DepotRecognition">창고 정리 beta</system:String>
<system:String x:Key="DepotRecognition">창고 정리</system:String>
<system:String x:Key="DepotRecognitionTip">이 기능은 현재 테스트 중입니다. 인식 결과가 맞는지 확인 후에 사용해 주세요. 만약 오류가 있다면 debug/depot 폴더를 압축해서 이슈로 보내 주세요.</system:String>
<system:String x:Key="BeganToDepotRecognition">식별 시작</system:String>
<system:String x:Key="ExportToArkplanner">Arkplanner로 내보내기</system:String>

View File

@@ -373,7 +373,7 @@
<!-- 公招识别 -->
<!-- 仓库识别 -->
<system:String x:Key="DepotRecognition">仓库识别 beta</system:String>
<system:String x:Key="DepotRecognition">仓库识别</system:String>
<system:String x:Key="DepotRecognitionTip">该功能尚处于测试阶段,请检查结果是否准确再行使用。若有误,欢迎打包 debug/depot 文件夹后向我们提交 issue ~</system:String>
<system:String x:Key="BeganToDepotRecognition">开始识别</system:String>
<system:String x:Key="ExportToArkplanner">导出至企鹅物流刷图规划</system:String>

View File

@@ -305,7 +305,7 @@
<!-- 公招辨識 -->
<!-- 倉庫識別 -->
<system:String x:Key="DepotRecognition">倉庫識別 beta</system:String>
<system:String x:Key="DepotRecognition">倉庫識別</system:String>
<system:String x:Key="DepotRecognitionTip">該功能尚處於測試階段,請檢查結果是否準確再行使用。若有誤,歡迎打包 debug/depot 文件夾後向我們提交 issue ~</system:String>
<system:String x:Key="BeganToDepotRecognition">開始識別</system:String>
<system:String x:Key="ExportToArkplanner">導出至企鵝物流刷圖規劃</system:String>

View File

@@ -4,6 +4,7 @@
<SolidColorBrush x:Key="PallasBrush" Color="#CDD1FF" />
<SolidColorBrush x:Key="ErrorViewBackgroundBrush" Color="#2d2d30" />
<SolidColorBrush x:Key="VersionUpdateViewBackgroundBrush" Color="#2d2d30" />
<!-- See https://github.com/ghost1372/HandyControls/blob/v3.4.5/src/Shared/HandyControl_Shared/Themes/Basic/Colors/Dark.xaml -->
<!-- Latest Doc https://ghost1372.github.io/handycontrol/basic_xaml/brushes/ -->

View File

@@ -4,7 +4,7 @@
<SolidColorBrush x:Key="PallasBrush" Color="#6A6AAB" />
<SolidColorBrush x:Key="ErrorViewBackgroundBrush" Color="#E6E6E6" />
<SolidColorBrush x:Key="SecondaryRegionBrush" Color="#ffffff" />
<SolidColorBrush x:Key="VersionUpdateViewBackgroundBrush" Color="#ffffff" />
<!-- UiLogColor -->
<SolidColorBrush x:Key="ErrorLogBrush" Color="DarkRed" />

View File

@@ -1,157 +0,0 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using MaaWpfGui.Helper;
using MaaWpfGui.Main;
using Newtonsoft.Json.Linq;
using Stylet;
using StyletIoC;
namespace MaaWpfGui.ViewModels.UI
{
public class OperViewModel : Screen
{
private readonly IWindowManager _windowManager;
private readonly IContainer _container;
private AsstProxy _asstProxy;
/// <summary>
/// 未实装干员但在battle_data中
/// </summary>
private static readonly string[] VirtuallyOpers =
{
"预备干员-近战",
"预备干员-术师",
"预备干员-后勤",
"预备干员-狙击",
"预备干员-重装",
"郁金香",
"Stormeye",
"Touch",
"Pith",
"Sharp",
"阿米娅-WARRIOR",
};
public OperViewModel(IContainer container, IWindowManager windowManager)
{
_windowManager = windowManager;
_container = container;
DisplayName = LocalizationHelper.GetString("OperRecognition");
}
protected override void OnInitialActivate()
{
base.OnInitialActivate();
_asstProxy = _container.Get<AsstProxy>();
}
private string _operInfo = LocalizationHelper.GetString("OperRecognitionTip");
public string OperInfo
{
get => _operInfo;
set => SetAndNotify(ref _operInfo, value);
}
private string _operResult;
public string OperResult
{
get => _operResult;
set => SetAndNotify(ref _operResult, value);
}
public bool Parse(JObject details)
{
string result = string.Empty;
/*已拥有干员*/
JArray operOwn = (JArray)details["have"];
/*未拥有干员,包含预备干员等*/
JArray operNotOwn = (JArray)details["nhave"];
/*移除未实装干员*/
foreach (var name in VirtuallyOpers)
{
operNotOwn.Where(i => i.Type == JTokenType.String && (string)i == name).ToList().ForEach(i => i.Remove());
}
result = "已拥有:" + operOwn.Count.ToString() + "名,未拥有:" + operNotOwn.Count.ToString() + "名;" + "\n\n";
result += "以下干员未拥有:\n\t";
int count = 0;
foreach (var name in operNotOwn)
{
if (count++ < 3)
{
result += name + ", ";
}
else
{
result += name + "\n\t";
count = 0;
}
}
result += "\n\n以下干员已拥有\n\n\t";
count = 0;
foreach (var name in operOwn)
{
if (count++ < 3)
{
result += name + ", ";
}
else
{
result += name + "\n\t";
count = 0;
}
}
OperResult = result;
bool done = (bool)details["done"];
if (done)
{
OperInfo = LocalizationHelper.GetString("IdentificationCompleted") + "\n" + LocalizationHelper.GetString("OperRecognitionTip");
Done = true;
}
return true;
}
private bool _done = false;
/// <summary>
/// Gets or sets a value indicating whether depot info is parsed.
/// </summary>
public bool Done
{
get => _done;
set => SetAndNotify(ref _done, value);
}
private void Clear()
{
OperResult = string.Empty;
Done = false;
}
public async void Start()
{
string errMsg = string.Empty;
OperInfo = LocalizationHelper.GetString("ConnectingToEmulator");
bool caught = await Task.Run(() => _asstProxy.AsstConnect(ref errMsg));
if (!caught)
{
OperInfo = errMsg;
return;
}
OperInfo = LocalizationHelper.GetString("Identifying");
Clear();
_asstProxy.AsstStartOper();
}
}
}

View File

@@ -53,24 +53,6 @@ namespace MaaWpfGui.ViewModels.UI
_asstProxy = _container.Get<AsstProxy>();
}
private int _displayId = 0;
public int DisplayId
{
get => _displayId;
set => SetAndNotify(ref _displayId, value);
}
public void ChangeButtenRecruit()
{
DisplayId = 0;
}
public void ChangeButtenDepot()
{
DisplayId = 1;
}
#region Recruit
private string _recruitInfo = LocalizationHelper.GetString("RecruitmentRecognitionTip");
@@ -336,7 +318,7 @@ namespace MaaWpfGui.ViewModels.UI
/// <summary>
/// Starts depot recognition.
/// </summary>
public async void Start()
public async void StartDepot()
{
string errMsg = string.Empty;
DepotInfo = LocalizationHelper.GetString("ConnectingToEmulator");
@@ -353,5 +335,131 @@ namespace MaaWpfGui.ViewModels.UI
_asstProxy.AsstStartDepot();
}
#endregion
#region Oper
/// <summary>
/// 未实装干员但在battle_data中
/// </summary>
private static readonly string[] VirtuallyOpers =
{
"预备干员-近战",
"预备干员-术师",
"预备干员-后勤",
"预备干员-狙击",
"预备干员-重装",
"郁金香",
"Stormeye",
"Touch",
"Pith",
"Sharp",
"阿米娅-WARRIOR",
};
private string _operInfo = LocalizationHelper.GetString("OperRecognitionTip");
public string OperInfo
{
get => _operInfo;
set => SetAndNotify(ref _operInfo, value);
}
private string _operResult;
public string OperResult
{
get => _operResult;
set => SetAndNotify(ref _operResult, value);
}
public bool OperParse(JObject details)
{
string result = string.Empty;
/*已拥有干员*/
JArray operOwn = (JArray)details["have"];
/*未拥有干员,包含预备干员等*/
JArray operNotOwn = (JArray)details["nhave"];
/*移除未实装干员*/
foreach (var name in VirtuallyOpers)
{
operNotOwn.Where(i => i.Type == JTokenType.String && (string)i == name).ToList().ForEach(i => i.Remove());
}
result = "已拥有:" + operOwn.Count.ToString() + "名,未拥有:" + operNotOwn.Count.ToString() + "名;" + "\n\n";
result += "以下干员未拥有:\n\t";
int count = 0;
foreach (var name in operNotOwn)
{
if (count++ < 3)
{
result += name + ", ";
}
else
{
result += name + "\n\t";
count = 0;
}
}
result += "\n\n以下干员已拥有\n\n\t";
count = 0;
foreach (var name in operOwn)
{
if (count++ < 3)
{
result += name + ", ";
}
else
{
result += name + "\n\t";
count = 0;
}
}
OperResult = result;
bool done = (bool)details["done"];
if (done)
{
OperInfo = LocalizationHelper.GetString("IdentificationCompleted") + "\n" + LocalizationHelper.GetString("OperRecognitionTip");
OperDone = true;
}
return true;
}
private bool _operdone = false;
/// <summary>
/// Gets or sets a value indicating whether depot info is parsed.
/// </summary>
public bool OperDone
{
get => _operdone;
set => SetAndNotify(ref _operdone, value);
}
private void ClearResult()
{
OperResult = string.Empty;
OperDone = false;
}
public async void StartOper()
{
string errMsg = string.Empty;
OperInfo = LocalizationHelper.GetString("ConnectingToEmulator");
bool caught = await Task.Run(() => _asstProxy.AsstConnect(ref errMsg));
if (!caught)
{
OperInfo = errMsg;
return;
}
OperInfo = LocalizationHelper.GetString("Identifying");
ClearResult();
_asstProxy.AsstStartOper();
}
#endregion
}
}

View File

@@ -24,14 +24,11 @@ namespace MaaWpfGui.ViewModels.UI
/// </summary>
public class RootViewModel : Conductor<Screen>.Collection.OneActive
{
private readonly IWindowManager _windowManager;
private readonly AsstProxy _asstProxy;
private readonly TaskQueueViewModel _taskQueueViewModel;
private readonly RecognizerViewModel _recognizerViewModel;
private readonly SettingsViewModel _settingsViewModel;
private readonly CopilotViewModel _copilotViewModel;
private readonly OperViewModel _operViewModel;
private readonly VersionUpdateViewModel _versionUpdateViewModel;
/// <summary>
@@ -40,14 +37,11 @@ namespace MaaWpfGui.ViewModels.UI
/// <param name="container">The IoC container.</param>
public RootViewModel(IContainer container)
{
_windowManager = container.Get<Helper.WindowManager>();
_asstProxy = container.Get<AsstProxy>();
_taskQueueViewModel = container.Get<TaskQueueViewModel>();
_recognizerViewModel = container.Get<RecognizerViewModel>();
_settingsViewModel = container.Get<SettingsViewModel>();
_copilotViewModel = container.Get<CopilotViewModel>();
_operViewModel = container.Get<OperViewModel>();
_versionUpdateViewModel = container.Get<VersionUpdateViewModel>();
}
@@ -57,7 +51,6 @@ namespace MaaWpfGui.ViewModels.UI
CheckAndUpdateNow();
InitViewModels();
InitProxy();
ShowUpdateOrDownload();
}
private async void InitProxy()
@@ -69,7 +62,6 @@ namespace MaaWpfGui.ViewModels.UI
{
Items.Add(_taskQueueViewModel);
Items.Add(_copilotViewModel);
Items.Add(_operViewModel);
Items.Add(_recognizerViewModel);
Items.Add(_settingsViewModel);
@@ -82,24 +74,6 @@ namespace MaaWpfGui.ViewModels.UI
return _versionUpdateViewModel.CheckAndUpdateNow();
}
private async void ShowUpdateOrDownload()
{
if (_versionUpdateViewModel.IsFirstBootAfterUpdate)
{
_versionUpdateViewModel.IsFirstBootAfterUpdate = false;
_windowManager.ShowWindow(_versionUpdateViewModel);
}
else
{
var ret = await _versionUpdateViewModel.CheckAndDownloadUpdate();
if (ret == VersionUpdateViewModel.CheckUpdateRetT.OK)
{
_versionUpdateViewModel.AskToRestart();
}
}
}
private string _windowTitle = "MAA";
/// <summary>
@@ -114,9 +88,6 @@ namespace MaaWpfGui.ViewModels.UI
protected override void OnInitialActivate()
{
base.OnInitialActivate();
// TrayIcon应该在显示rootViewModel之后再加载
Bootstrapper.SetTrayIconInSettingsViewModel(_settingsViewModel);
}
/// <inheritdoc/>

View File

@@ -43,6 +43,7 @@ namespace MaaWpfGui.ViewModels.UI
/// </summary>
public class VersionUpdateViewModel : Screen
{
private readonly IWindowManager _windowManager;
private readonly SettingsViewModel _settingsViewModel;
private readonly TaskQueueViewModel _taskQueueViewModel;
private readonly IHttpService _httpService;
@@ -53,6 +54,7 @@ namespace MaaWpfGui.ViewModels.UI
/// <param name="container">The IoC container.</param>
public VersionUpdateViewModel(IContainer container)
{
_windowManager = container.Get<Helper.WindowManager>();
_settingsViewModel = container.Get<SettingsViewModel>();
_taskQueueViewModel = container.Get<TaskQueueViewModel>();
_httpService = container.Get<IHttpService>();
@@ -353,6 +355,26 @@ namespace MaaWpfGui.ViewModels.UI
Native,
}
/// <summary>
/// 如果是在更新后第一次启动显示ReleaseNote弹窗否则检查更新并下载更新包。
/// </summary>
public async void ShowUpdateOrDownload()
{
if (IsFirstBootAfterUpdate)
{
IsFirstBootAfterUpdate = false;
_windowManager.ShowWindow(this);
}
else
{
var ret = await CheckAndDownloadUpdate();
if (ret == CheckUpdateRetT.OK)
{
AskToRestart();
}
}
}
/// <summary>
/// 检查更新,并下载更新包。
/// </summary>

View File

@@ -118,9 +118,10 @@
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ScrollViewer
<hc:ScrollViewer
Width="360"
Margin="0,10"
IsInertiaEnabled="True"
properties:AutoScroll.AutoScroll="True"
HorizontalScrollBarVisibility="Disabled">
<ItemsControl ItemsSource="{Binding Path=LogItemViewModels}">
@@ -138,7 +139,7 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</hc:ScrollViewer>
<StackPanel
Grid.Row="1"
HorizontalAlignment="Center"

View File

@@ -1,61 +0,0 @@
<UserControl x:Class="MaaWpfGui.Views.UI.OperView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:vm="clr-namespace:MaaWpfGui"
xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels"
xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI"
xmlns:styles="clr-namespace:MaaWpfGui.Styles"
xmlns:controls="clr-namespace:MaaWpfGui.Styles.Controls"
d:DataContext="{d:DesignInstance {x:Type ui:OperViewModel}}"
mc:Ignorable="d"
d:DesignHeight="495" d:DesignWidth="800">
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="150"/>
</Grid.RowDefinitions>
<ScrollViewer
Grid.Row="0"
Margin="10,10,10,0"
VerticalAlignment="Top">
<StackPanel>
<controls:TextBlock
Height="36"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Top"
FontSize="14"
Style="{StaticResource TextBlockDefaultBold}"
Text="{Binding OperInfo}"
TextWrapping="Wrap"/>
<controls:TextBlock
Margin="10"
HorizontalAlignment="Left"
FontSize="14"
Text="{Binding OperResult}"
TextWrapping="Wrap"/>
</StackPanel>
</ScrollViewer>
<StackPanel
Grid.Row="1"
Margin="27,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
Width="150"
Height="60"
Margin="30"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{s:Action Start}"
Content="{DynamicResource BeganToOperRecognition}"
/>
</StackPanel>
</Grid>
</UserControl>

View File

@@ -11,180 +11,219 @@
xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI"
xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels"
xmlns:vm="clr-namespace:MaaWpfGui"
xmlns:hc="https://handyorg.github.io/handycontrol"
d:DataContext="{d:DesignInstance {x:Type ui:RecognizerViewModel}}"
d:DesignHeight="1200"
d:DesignWidth="800"
mc:Ignorable="d">
<StackPanel>
<StackPanel
HorizontalAlignment="Center"
VerticalAlignment="Top"
Orientation="Horizontal">
<Button
Width="150"
Height="30"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{s:Action ChangeButtenRecruit}"
Content="{DynamicResource RecruitmentRecognition}" />
<Button
Width="150"
Height="30"
Command="{s:Action ChangeButtenDepot}"
Content="{DynamicResource DepotRecognition}" />
</StackPanel>
<Grid
Height="500"
Margin="20,0,20,20"
Visibility="{c:Binding 'DisplayId==0'}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="150" />
</Grid.RowDefinitions>
<ScrollViewer
Grid.Row="0"
Margin="10,0"
VerticalAlignment="Top">
<StackPanel>
<controls:TextBlock
Height="36"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Top"
FontSize="14"
Style="{StaticResource TextBlockDefaultBold}"
Text="{Binding RecruitInfo}"
TextWrapping="Wrap" />
<controls:TextBlock
Margin="10"
HorizontalAlignment="Left"
FontSize="14"
Text="{Binding RecruitResult}"
TextWrapping="Wrap" />
</StackPanel>
</ScrollViewer>
<StackPanel
Grid.Row="1"
Margin="27,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<StackPanel Margin="40,0,40,0" VerticalAlignment="Center">
<CheckBox
Margin="5"
Content="{DynamicResource AutoSettingTime}"
IsChecked="{Binding AutoSetTime}" />
<CheckBox
MaxWidth="170"
Margin="5"
HorizontalAlignment="Left"
IsChecked="{Binding IsLevel3UseShortTime}"
ToolTip="{DynamicResource Level3UseShortTimeTip}">
<controls:TextBlock Text="{DynamicResource Level3UseShortTime}" TextWrapping="Wrap" />
</CheckBox>
</StackPanel>
<TabControl
SelectedIndex="3"
Margin="0,10"
BorderThickness="0"
Style="{StaticResource TabControlSliding}">
<TabItem Header="{DynamicResource RecruitmentRecognition}">
<Grid
Margin="20,0,20,20">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="150" />
</Grid.RowDefinitions>
<hc:ScrollViewer
Grid.Row="0"
Margin="10,0"
IsInertiaEnabled="True"
VerticalAlignment="Top">
<StackPanel>
<controls:TextBlock
Height="36"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Top"
FontSize="14"
Style="{StaticResource TextBlockDefaultBold}"
Text="{Binding RecruitInfo}"
TextWrapping="Wrap" />
<controls:TextBlock
Margin="10"
HorizontalAlignment="Left"
FontSize="14"
Text="{Binding RecruitResult}"
TextWrapping="Wrap" />
</StackPanel>
</hc:ScrollViewer>
<StackPanel
Grid.Row="1"
Margin="27,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<StackPanel Margin="40,0,40,0" VerticalAlignment="Center">
<CheckBox
Margin="5"
Content="{DynamicResource AutoSettingTime}"
IsChecked="{Binding AutoSetTime}" />
<CheckBox
MaxWidth="170"
Margin="5"
HorizontalAlignment="Left"
IsChecked="{Binding IsLevel3UseShortTime}"
ToolTip="{DynamicResource Level3UseShortTimeTip}">
<controls:TextBlock Text="{DynamicResource Level3UseShortTime}" TextWrapping="Wrap" />
</CheckBox>
</StackPanel>
<StackPanel Margin="40,0,40,0" VerticalAlignment="Center">
<CheckBox
Margin="0,2"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Content="{DynamicResource AutoSelectLevel3Tags}"
IsChecked="{Binding ChooseLevel3}" />
<CheckBox
Margin="0,2"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Content="{DynamicResource AutoSelectLevel4Tags}"
IsChecked="{Binding ChooseLevel4}" />
<CheckBox
Margin="0,2"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Content="{DynamicResource AutoSelectLevel5Tags}"
IsChecked="{Binding ChooseLevel5}" />
<CheckBox
Margin="0,2"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Content="{DynamicResource AutoSelectLevel6Tags}"
IsChecked="{Binding ChooseLevel6}" />
<StackPanel Margin="40,0,40,0" VerticalAlignment="Center">
<CheckBox
Margin="0,2"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Content="{DynamicResource AutoSelectLevel3Tags}"
IsChecked="{Binding ChooseLevel3}" />
<CheckBox
Margin="0,2"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Content="{DynamicResource AutoSelectLevel4Tags}"
IsChecked="{Binding ChooseLevel4}" />
<CheckBox
Margin="0,2"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Content="{DynamicResource AutoSelectLevel5Tags}"
IsChecked="{Binding ChooseLevel5}" />
<CheckBox
Margin="0,2"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Content="{DynamicResource AutoSelectLevel6Tags}"
IsChecked="{Binding ChooseLevel6}" />
</StackPanel>
<!-- <Label x:Name="prompt" Content="提示本辅助仅会帮你选择最优Tags&#xA;但是不会帮你点击确定按钮!!!&#xA;请自行检查辅助选择的是否正确,&#xA;若辅助出现识别错误,遗漏了高星干员,&#xA;作者概不负责哦__(:з」∠)_" -->
<!-- HorizontalAlignment="Center" VerticalAlignment="Center" Height="121" Width="292" FontSize="16" /> -->
<Button
Width="180"
Height="70"
Margin="38,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{s:Action RecruitStartCalc}"
Content="{DynamicResource BeganToRecruit}" />
</StackPanel>
<!-- <Label x:Name="prompt" Content="提示本辅助仅会帮你选择最优Tags&#xA;但是不会帮你点击确定按钮!!!&#xA;请自行检查辅助选择的是否正确,&#xA;若辅助出现识别错误,遗漏了高星干员,&#xA;作者概不负责哦__(:з」∠)_" -->
<!-- HorizontalAlignment="Center" VerticalAlignment="Center" Height="121" Width="292" FontSize="16" /> -->
<Button
Width="180"
Height="70"
Margin="30"
</Grid>
</TabItem>
<TabItem Header="{DynamicResource DepotRecognition}">
<Grid
Margin="20,0,20,20">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="150" />
</Grid.RowDefinitions>
<hc:ScrollViewer
Grid.Row="0"
Margin="10,0"
IsInertiaEnabled="True"
VerticalAlignment="Top">
<StackPanel>
<controls:TextBlock
Height="36"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Top"
FontSize="14"
Style="{StaticResource TextBlockDefaultBold}"
Text="{Binding DepotInfo}"
TextWrapping="Wrap" />
<controls:TextBlock
Margin="10"
HorizontalAlignment="Left"
FontSize="14"
Text="{Binding DepotResult}"
TextWrapping="Wrap" />
</StackPanel>
</hc:ScrollViewer>
<StackPanel
Grid.Row="1"
Margin="27,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{s:Action RecruitStartCalc}"
Content="{DynamicResource BeganToRecruit}" />
</StackPanel>
</Grid>
<Grid
Height="500"
Margin="20,0,20,20"
Visibility="{c:Binding 'DisplayId==1'}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="150" />
</Grid.RowDefinitions>
<ScrollViewer
Grid.Row="0"
Margin="10,0"
VerticalAlignment="Top">
<StackPanel>
<controls:TextBlock
Height="36"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Top"
FontSize="14"
Style="{StaticResource TextBlockDefaultBold}"
Text="{Binding DepotInfo}"
TextWrapping="Wrap" />
<controls:TextBlock
Margin="10"
HorizontalAlignment="Left"
FontSize="14"
Text="{Binding DepotResult}"
TextWrapping="Wrap" />
Orientation="Horizontal">
<Button
Width="180"
Height="70"
Margin="30"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{s:Action ExportToArkplanner}"
Content="{DynamicResource ExportToArkplanner}"
IsEnabled="{Binding DepotDone}" />
<Button
Width="180"
Height="70"
Margin="30"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{s:Action ExportToLolicon}"
Content="{DynamicResource ExportToLolicon}"
IsEnabled="{Binding DepotDone}" />
<Button
Width="180"
Height="70"
Margin="30"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{s:Action StartDepot}"
Content="{DynamicResource BeganToDepotRecognition}" />
</StackPanel>
</ScrollViewer>
<StackPanel
Grid.Row="1"
Margin="27,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
Width="180"
Height="70"
Margin="30"
</Grid>
</TabItem>
<TabItem Header="{DynamicResource OperRecognition}">
<Grid
Margin="20,0,20,20">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="150"/>
</Grid.RowDefinitions>
<hc:ScrollViewer
Grid.Row="0"
Margin="10,0"
IsInertiaEnabled="True"
VerticalAlignment="Top">
<StackPanel>
<controls:TextBlock
Height="36"
Margin="10"
HorizontalAlignment="Left"
VerticalAlignment="Top"
FontSize="14"
Style="{StaticResource TextBlockDefaultBold}"
Text="{Binding OperInfo}"
TextWrapping="Wrap"/>
<controls:TextBlock
Margin="10"
HorizontalAlignment="Left"
FontSize="14"
Text="{Binding OperResult}"
TextWrapping="Wrap"/>
</StackPanel>
</hc:ScrollViewer>
<StackPanel
Grid.Row="1"
Margin="27,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{s:Action ExportToArkplanner}"
Content="{DynamicResource ExportToArkplanner}"
IsEnabled="{Binding DepotDone}" />
<Button
Width="180"
Height="70"
Margin="30"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{s:Action ExportToLolicon}"
Content="{DynamicResource ExportToLolicon}"
IsEnabled="{Binding DepotDone}" />
<Button
Width="180"
Height="70"
Margin="30"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{s:Action Start}"
Content="{DynamicResource BeganToDepotRecognition}" />
</StackPanel>
</Grid>
</StackPanel>
Orientation="Horizontal">
<Button
Width="180"
Height="70"
Margin="482,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{s:Action StartOper}"
Content="{DynamicResource BeganToOperRecognition}"
/>
</StackPanel>
</Grid>
</TabItem>
</TabControl>
</UserControl>

View File

@@ -15,6 +15,7 @@
xmlns:styles="clr-namespace:MaaWpfGui.Styles"
xmlns:properties="clr-namespace:MaaWpfGui.Styles.Properties"
xmlns:controls="clr-namespace:MaaWpfGui.Styles.Controls"
xmlns:hc="https://handyorg.github.io/handycontrol"
d:DataContext="{d:DesignInstance {x:Type ui:SettingsViewModel}}"
d:DesignHeight="3000"
d:DesignWidth="800"
@@ -32,9 +33,10 @@
ItemsSource="{Binding ListTitle}"
SelectedIndex="{Binding SelectedIndex}" />
<ScrollViewer
<hc:ScrollViewer
Grid.Column="1"
Margin="20,10"
IsInertiaEnabled="True"
HorizontalAlignment="Stretch"
properties:ScrollViewerBinding.ExtentHeight="{Binding ScrollExtentHeight}"
properties:ScrollViewerBinding.RectangleVerticalOffsetList="{Binding RectangleVerticalOffsetList}"
@@ -207,6 +209,6 @@
<userControl:AboutUserControl Margin="20" HorizontalAlignment="Center" />
<!--<Rectangle HorizontalAlignment="Stretch" Fill="{DynamicResource BorderBrush}" Height="1" />-->
</StackPanel>
</ScrollViewer>
</hc:ScrollViewer>
</Grid>
</UserControl>

View File

@@ -187,9 +187,10 @@
<!--<GridSplitter Grid.Column="2" Width="5" HorizontalAlignment="Stretch" />-->
<!--<Rectangle Grid.Column="2" VerticalAlignment="Stretch" Fill="{DynamicResource BorderBrush}" Width="4" />-->
<ScrollViewer
<hc:ScrollViewer
Grid.Column="2"
Margin="10"
IsInertiaEnabled="True"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
properties:AutoScroll.AutoScroll="True"
@@ -220,6 +221,6 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</hc:ScrollViewer>
</Grid>
</UserControl>

View File

@@ -17,7 +17,7 @@
Height="500"
d:DataContext="{d:DesignInstance {x:Type ui:VersionUpdateViewModel}}"
mc:Ignorable="d">
<Grid>
<Grid Background="{DynamicResource VersionUpdateViewBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="*" />
@@ -57,7 +57,10 @@
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
Focusable="False">
<ScrollViewer x:Name="PART_ContentHost" />
<hc:ScrollViewer
x:Name="PART_ContentHost"
IsInertiaEnabled="True"/>
</Border>
</ControlTemplate>
</FlowDocumentScrollViewer.Template>

View File

@@ -16,7 +16,8 @@
d:DataContext="{d:DesignInstance {x:Type ui:TaskQueueViewModel}}"
d:DesignWidth="250"
mc:Ignorable="d">
<ScrollViewer>
<hc:ScrollViewer
IsInertiaEnabled="True">
<Grid Width="220" Margin="0,0,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -294,5 +295,5 @@
</StackPanel>
</Grid>
</Grid>
</ScrollViewer>
</hc:ScrollViewer>
</UserControl>