From 3db8613a434c7d6d31bb85fb7cc51f88dd427f17 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Tue, 10 Jun 2025 23:33:35 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20wpf=E5=90=84=E7=A7=8D=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=20(#12930)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 给喜欢指定参数不看说明的加个提示 * chore: 给代理倍率加个? * fix: 减重繁中 * chore: KR tweak translation * i18n: EN dot symbol * feat: 带提示控件使用 TooltipBlock * chore: 调整无序列表显示 * chore: 调整显示效果 * perf: 简化自定干员提示 * fix: TooltipText 内容错误 * chore: 调整 TooltipBlock 默认 Margin * chore: 重置 TextBox InitialShowDelay 默认行为 * chore: 修改描述 * chore: 修改自动战斗描述 * perf: 优化控件布局 * feat: 新增强制Github下载描述 * chore: 调整绑定 --------- Co-authored-by: HX3N Co-authored-by: Constrat <56174894+Constrat@users.noreply.github.com> Co-authored-by: uye <99072975+ABA2396@users.noreply.github.com> --- src/MaaWpfGui/Res/Localizations/en-us.xaml | 25 ++- src/MaaWpfGui/Res/Localizations/ja-jp.xaml | 23 ++- src/MaaWpfGui/Res/Localizations/ko-kr.xaml | 27 ++- src/MaaWpfGui/Res/Localizations/zh-cn.xaml | 27 ++- src/MaaWpfGui/Res/Localizations/zh-tw.xaml | 27 ++- .../Styles/Controls/TooltipBlock.xaml | 8 +- .../Styles/Controls/TooltipBlock.xaml.cs | 65 ++++++- .../ViewModels/UI/CopilotViewModel.cs | 22 +-- .../FightSettingsUserControlModel.cs | 4 +- .../InfrastSettingsUserControlModel.cs | 14 -- src/MaaWpfGui/Views/UI/CopilotView.xaml | 179 ++++++++++-------- src/MaaWpfGui/Views/UI/RecognizerView.xaml | 18 +- .../Views/UserControl/GuideUserControl.xaml | 95 +++++----- .../UserControl/HotKeyEditorUserControl.xaml | 7 +- .../HotKeySettingsUserControl.xaml | 6 +- .../Settings/ConnectSettingsUserControl.xaml | 104 +++++----- ...ternalNotificationSettingsUserControl.xaml | 46 +++-- .../Settings/GuiSettingsUserControl.xaml | 13 +- .../Settings/TimerSettingsUserControl.xaml | 35 ++-- .../VersionUpdateSettingsUserControl.xaml | 31 +-- .../TaskQueue/AwardSettingsUserControl.xaml | 12 +- .../TaskQueue/FightSettingsUserControl.xaml | 79 +++++--- .../TaskQueue/InfrastSettingsUserControl.xaml | 44 +++-- .../TaskQueue/MallSettingsUserControl.xaml | 69 ++++--- .../TaskQueue/PostActionUserControl.xaml | 28 +-- .../TaskQueue/RecruitSettingsUserControl.xaml | 40 ++-- .../RoguelikeSettingsUserControl.xaml | 43 +++-- .../TaskQueue/StartUpTaskUserControl.xaml | 97 ++++++---- 28 files changed, 721 insertions(+), 467 deletions(-) diff --git a/src/MaaWpfGui/Res/Localizations/en-us.xaml b/src/MaaWpfGui/Res/Localizations/en-us.xaml index 3739d96d67..73ae8840ef 100644 --- a/src/MaaWpfGui/Res/Localizations/en-us.xaml +++ b/src/MaaWpfGui/Res/Localizations/en-us.xaml @@ -284,6 +284,7 @@ You can cancel this popup by clicking the Settings - Issue Report link. Thank yo Global Source Force using GitHub + When updates are detected, force download update packages from Github MirrorChyan Fill after switching source Please enter CDK @@ -559,6 +560,17 @@ The primary instance is 0, and other instances are the numbers after the version Material Quantity Series + • AUTO: +Automatically identify the maximum proxy multiplier of the level, maintain the maximum proxy multiplier and do not overflow sanity after using sanity potion + +• Value (1~6): +Execute proxy according to the set multiplier +If the current sanity is not enough to complete the set multiplier (such as only enough for 5 times but set to 6 times), you cannot enter the battle +Or +If the number of battles is not enough to complete the set multiplier (such as only enough for 5 times but set to 6 times), you will not be able to enter the battle + +• Not selected: +Do not adjust the proxy multiplier setting in the game Stage Alternative Remaining Sanity @@ -722,17 +734,20 @@ The video aspect ratio needs to be 16:9 without interference factors such as bla An error occurred, the like failed. : < Thanks for the likes!\nThe comment section is already open on the web page, please feel free to leave your comment! Auto Squad - 「Favourite」 marked operators cannot be recognized at this time + 「Favourite」 marked operators maybe cannot be recognized Add low-trust operators Add custom operators Use 「;」 as the separator, 「,」 to separate the operator name and skills, for example: W, 3; Ash, 2 Battle list - Does not support cross-chapter navigation -Only supports: the same chapter of the main story, SideStory (does not support jumping from EX chapter to S chapter) + Does not support cross-chapter navigation. Only supports: + 1. MainStory: Navigation within the same chapter + 2. SideStory: Navigation within current page (Normal/EX/S cannot jump to each other) Please switch to the stage selection page before starting (Challenge) - Right click to add challenge difficulty - Right click to clear inactive tasks + Left-click to add Normal difficulty +Right click to add challenge difficulty + Left-click to clear all tasks +Right-click to clear inactive tasks Loop Times Start Video Link diff --git a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml index 2e4ec79244..fcd1fa9170 100644 --- a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml +++ b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml @@ -285,6 +285,7 @@ グローバルソース GitHub を強制使用 + 更新を検出後、Githubから強制的に更新パッケージをダウンロード MirrorChyan 更新ソース切替後入力 CDKを入力してください @@ -563,6 +564,17 @@ C:\\leidian\\LDPlayer9 素材の指定 ドロップ数 連戦回数 + • 自動: +レベルの最大代理乗数を自動で判別し、最大代理乗数を維持し、正気ポーション使用後に正気度オーバーフローが発生しないようにします。 + +• 値 (1~6): +設定された乗数に従って代理を実行します。 +現在の正気度が設定された乗数を満たしていない場合(例えば、5回分しか残っていないのに6回に設定している場合)、バトルに参加できません。 +または +バトル回数が設定された乗数を満たしていない場合(例えば、5回分しか残っていないのに6回に設定している場合)、バトルに参加できません。 + +• 選択しない場合: +ゲーム内で代理乗数の設定を調整しません。 ステージ 代替ステージ 余剰理性の消費 @@ -731,12 +743,15 @@ C:\\leidian\\LDPlayer9 カスタムで指定したオペレーターを追加する 「;」 はセパレータ、「,」 でオペレーターの名前とスキルを区切ります。例: Surtr, 3; Eyjafjalla,1 バトルリスト - チャプター間の移動はサポートされていません -メインストーリーの同じチャプター、サイドストーリーのみサポートされています(EXチャプターからSチャプターへの移動はサポートされていません) + チャプター間の移動はサポートされていません。サポートのみです: + 1. メインストーリー:同一章内でのナビゲーション + 2. SideStory:現在のページ内ナビゲーション(通常/EX/S 相互移動不可) 開始前にステージ選択ページに切り替えてください (強襲) - 右クリックしてレイドの難易度を追加します - 右クリックして非アクティブなタスクをクリアします + 左クリックで通常難易度を追加 +右クリックしてレイドの難易度を追加します + 左クリックですべてのタスクをクリア +右クリックで非アクティブなタスクをクリア ループ回数 開始 映像へのハイパーリンク diff --git a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml index ffee492542..2c43248aaf 100644 --- a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml +++ b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml @@ -284,6 +284,7 @@ 글로벌 소스 GitHub 강제 사용 + 업데이트 감지 후, Github에서 강제로 업데이트 패키지 다운로드 MirrorChyan 소스 전환 후 입력 CDK를 입력해 주세요 @@ -440,7 +441,7 @@ OF-1 스테이지가 개방되지 않은 경우에는 선택하지 마세요.주 작업을 완료한 후 지정된 스테이지를 실행하며, 이성 회복제/오리지늄을 사용하지 않습니다 48시간 미만 남은 이성 회복제 사용 미개방 스테이지 숨기기 - 연속 전투 횟수 숨기기 + 연속 전투 숨기기 기반시설 계획 표시 메인 화면 버튼의 기능 스테이지 코드 수동 입력 @@ -561,7 +562,18 @@ C:\\leidian\\LDPlayer9 횟수 제한 드롭 제한 드롭 수 - 연속 전투 횟수 + 연속 전투 + AUTO: +스테이지의 가능한 최대 대리 지휘 횟수의 배수를 감지하고, 자동으로 최대 대리 지휘 횟수를 유지하며, 이성 회복제 사용 후 이성이 남지 않도록 합니다. + +단순 배수 (1~6): +설정된 배수에 따라 대리 지휘 횟수를 실행합니다. +현재 이성 수치가 설정된 배수를 완료하기에 충분하지 않은 경우(예: 5회만 가능하지만 6회로 설정), 전투를 시작하지 않습니다. +또는 +스테이지가 설정된 배수를 완료하기에 충분하지 않은 경우(예: 5회만 가능하지만 6회로 설정), 전투를 시작하지 않습니다. + +미선택: +연속 대리 지휘 횟수를 조정하지 않습니다. 스테이지 선택 대안 남은 이성 @@ -730,12 +742,15 @@ C:\\leidian\\LDPlayer9 커스텀 오퍼레이터 추가 「;」 로 오퍼레이터를 구분하고, 「,」 로 스킬을 구분합니다. 예시: W, 3; Ash, 2 전투 목록 - 챕터 간 이동은 지원하지 않습니다. -지원: 메인 스토리의 동일 챕터, 사이드 스토리(EX 챕터에서 S 챕터로의 이동은 지원하지 않습니다.) + 챕터 간 이동은 지원하지 않습니다. 지원: + 1. 메인 스토리: 동일 챕터 내 네비게이션 + 2. SideStory: 현재 페이지 내 네비게이션(일반/EX/S 서로 이동 불가) 시작하기 전에 스테이지 선택 화면으로 전환하세요 (하드) - 하드 모드를 추가하려면 마우스 오른쪽 버튼을 클릭하세요 - 다 끝난 작업을 제거하려면 마우스 오른쪽 버튼을 클릭하세요 + 좌클릭으로 일반 난이도 추가 +하드 모드를 추가하려면 마우스 오른쪽 버튼을 클릭하세요 + 좌클릭으로 모든 작업 지우기 +우클릭으로 비활성 작업 지우기 반복 횟수 시작 영상 링크 diff --git a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml index 78f02ebbb7..6e1ac4f32c 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml @@ -285,6 +285,7 @@ 海外源 强制使用 GitHub + 检测到更新后,强制从 Github 下载更新包 Mirror酱 切换更新源后填写 请输入 CDK @@ -559,10 +560,21 @@ C:\\leidian\\LDPlayer9。\n 吃理智药 吃源石 - 作战次数 + 指定次数 指定材料 刷取数量 代理倍率 + • AUTO: +自动识别关卡最大代理倍率, 保持最大代理倍率且使用理智药后理智不溢出 + +• 数值 (1~6): +按设定倍率执行代理 +若当前理智不足完成设定倍率 (如仅够 5 次但设为 6 倍), 则无法进入战斗 + 或者 +战斗次数不足完成设定倍率 (如仅够 5 次但设为 6 倍), 也将无法进入战斗 + +• 不选择: +不调整游戏内代理倍率设定 关卡选择 备选 剩余理智 @@ -726,18 +738,21 @@ C:\\leidian\\LDPlayer9。\n 出现错误,评价失败 : < 感谢评价!\n网页已经开放评论区,欢迎前往留下你的评论! 自动编队 - 自动编队可能暂时无法识别带有 「特别关注」 标记的干员 + 自动编队可能无法识别带有 「特别关注」 标记的干员 补充低信赖干员 追加自定干员 以英文 「;」 为分隔符,英文 「,」 分隔干员名与技能,例: 史尔特尔,3;艾雅法拉,1 循环次数 战斗列表 - 不支持跨章节导航 -仅支持: 主线关同一章节, SideStory (不支持从 EX 跳转 S) + 不支持跨章节导航。仅支持: + 1. 主线关卡:同一章节内导航 + 2. SideStory:当前页面内导航(普通/EX/S 相互不可跳转) 开始前请切换至关卡选择页面 (突袭) - 右键添加突袭难度 - 右键清除未激活任务 + 左键添加普通难度 +右键添加突袭难度 + 左键清除所有任务 +右键清除未激活任务 开始 视频链接 技能 diff --git a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml index e45e1200b1..4c730d2ee0 100644 --- a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml +++ b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml @@ -284,6 +284,7 @@ 全域來源 強制使用 GitHub + 檢測到更新後,強制從 Github 下載更新包 MirrorChyan 切換更新源後填寫 請輸入 CDK @@ -557,10 +558,21 @@ C:\\leidian\\LDPlayer9。\n 吃理智藥 吃源石 - 战斗次數 + 指定次数 指定材料 刷取數量 代理倍率 + • AUTO: +自動辨識關卡最大代理倍率, 保持最大代理倍率且使用理智藥後理智不溢出 + +• 數值 (1~6): +按設定倍率執行代理 +若當前理智不足完成設定倍率 (如僅夠 5 次但設為 6 倍), 則無法進入戰鬥 + 或者 +戰鬥次數不足完成設定倍率 (如僅夠 5 次但設為 6 倍), 也將無法進入戰鬥 + +• 不選擇: +不調整遊戲內代理倍率設定 關卡選擇 備選 剩餘理智 @@ -724,17 +736,20 @@ C:\\leidian\\LDPlayer9。\n 出現錯誤,評價失敗 : < 感謝評價!\n網頁已經開放評論區,歡迎前往留下你的評論! 自動編隊 - 自動編隊暫時無法辨識 「特別關注」 的幹員 + 自動編隊可能無法辨識 「特別關注」 的幹員 補充低信賴幹員 追加自定幹員 使用 「;」 作為分隔符,用 「,」 分隔操作員姓名和技能,例:史尔特尔,3;艾雅法拉,1 戰鬥列表 - 不支援跨章節導航 -僅支援: 主線關同一章節, SideStory (不支援從 EX 跳轉 S) + 不支援跨章節導航。僅支援: + 1. 主線關卡:同一章節內導航 + 2. SideStory:當前頁面內導航(普通/EX/S 相互不可跳轉) 開始前請切換至關卡選擇頁面 (突襲) - 右鍵添加突襲難度 - 右鍵清除未激活任務 + 左鍵添加普通難度 +右鍵添加突襲難度 + 左键清除所有任务 +右键清除未激活任务 循環次數 開始 影片連結 diff --git a/src/MaaWpfGui/Styles/Controls/TooltipBlock.xaml b/src/MaaWpfGui/Styles/Controls/TooltipBlock.xaml index e3a8a460bc..b3d51e662b 100644 --- a/src/MaaWpfGui/Styles/Controls/TooltipBlock.xaml +++ b/src/MaaWpfGui/Styles/Controls/TooltipBlock.xaml @@ -11,11 +11,13 @@ + ToolTipService.InitialShowDelay="{Binding InitialShowDelay}" + ToolTipService.IsEnabled="{c:Binding 'TooltipTextEmpty ? \'False\' : \'True\''}"> #nullable enable +using System; using System.Windows; using System.Windows.Controls; +using System.Windows.Media.Animation; namespace MaaWpfGui.Styles.Controls; @@ -25,11 +27,22 @@ public partial class TooltipBlock : UserControl { InitializeComponent(); DataContext = this; + + Opacity = NormalOpacity; + + MouseEnter += OnMouseEnter; + MouseLeave += OnMouseLeave; } - public static readonly DependencyProperty TooltipTextProperty = DependencyProperty.Register(nameof(TooltipText), typeof(string), typeof(TooltipBlock), new PropertyMetadata(string.Empty)); + public static readonly DependencyProperty TooltipTextProperty = DependencyProperty.Register(nameof(TooltipText), typeof(string), typeof(TooltipBlock), new(string.Empty)); - public static readonly DependencyProperty TooltipMaxWidthProperty = DependencyProperty.Register(nameof(TooltipMaxWidth), typeof(double), typeof(TooltipBlock), new PropertyMetadata(double.MaxValue)); + public static readonly DependencyProperty TooltipMaxWidthProperty = DependencyProperty.Register(nameof(TooltipMaxWidth), typeof(double), typeof(TooltipBlock), new(double.MaxValue)); + + public static readonly DependencyProperty NormalOpacityProperty = DependencyProperty.Register(nameof(NormalOpacity), typeof(double), typeof(TooltipBlock), new(0.7, OnOpacityChanged)); + + public static readonly DependencyProperty HoverOpacityProperty = DependencyProperty.Register(nameof(HoverOpacity), typeof(double), typeof(TooltipBlock), new(1.0, OnOpacityChanged)); + + public static readonly DependencyProperty InitialShowDelayProperty = DependencyProperty.Register(nameof(InitialShowDelay), typeof(int), typeof(TooltipBlock), new(200)); public string TooltipText { @@ -44,4 +57,52 @@ public partial class TooltipBlock : UserControl get => (double)GetValue(TooltipMaxWidthProperty); set => SetValue(TooltipMaxWidthProperty, value); } + + public double NormalOpacity + { + get => (double)GetValue(NormalOpacityProperty); + set => SetValue(NormalOpacityProperty, value); + } + + public double HoverOpacity + { + get => (double)GetValue(HoverOpacityProperty); + set => SetValue(HoverOpacityProperty, value); + } + + public int InitialShowDelay + { + get => (int)GetValue(InitialShowDelayProperty); + set => SetValue(InitialShowDelayProperty, value); + } + + private static void OnOpacityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (d is TooltipBlock { IsMouseOver: false } tooltipBlock) + { + tooltipBlock.Opacity = tooltipBlock.NormalOpacity; + } + } + + private void OnMouseEnter(object sender, EventArgs e) + { + AnimateOpacity(HoverOpacity); + } + + private void OnMouseLeave(object sender, EventArgs e) + { + AnimateOpacity(NormalOpacity); + } + + private void AnimateOpacity(double targetOpacity) + { + var animation = new DoubleAnimation + { + To = targetOpacity, + Duration = new(TimeSpan.FromMilliseconds(InitialShowDelay)), + FillBehavior = FillBehavior.HoldEnd, + }; + + BeginAnimation(OpacityProperty, animation); + } } diff --git a/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs b/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs index ad8f68d5ce..2cfebbe4be 100644 --- a/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/CopilotViewModel.cs @@ -182,7 +182,14 @@ namespace MaaWpfGui.ViewModels.UI { SetAndNotify(ref _filename, value); ClearLog(); - UpdateFilename(value); + if (string.IsNullOrWhiteSpace(value)) + { + AddLog(LocalizationHelper.GetString("CopilotTip"), showTime: false); + } + else + { + UpdateFilename(value); + } } } @@ -522,16 +529,6 @@ namespace MaaWpfGui.ViewModels.UI RateCopilot(CopilotId, false); } - private void EasterEgg(string text) - { - switch (text) - { - case "/help": - AddLog(LocalizationHelper.GetString("HelloWorld"), UiLogColor.Message, showTime: false); - break; - } - } - #endregion 方法 #endregion UI绑定及操作 @@ -589,8 +586,7 @@ namespace MaaWpfGui.ViewModels.UI } else { - EasterEgg(filename); - return; + payload = null; } if (payload is CopilotModel copilot) diff --git a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs index 9c70597d87..ac36b58480 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs @@ -461,7 +461,7 @@ public class FightSettingsUserControlModel : TaskViewModel } } - public Dictionary SeriesList { get; } = new() + public static Dictionary SeriesList { get; } = new() { { "AUTO", 0 }, { "6", 6 }, @@ -478,7 +478,7 @@ public class FightSettingsUserControlModel : TaskViewModel private static int InitFightSeries() { var series = ConfigurationHelper.GetValue(ConfigurationKeys.SeriesQuantity, 0); - if (Enumerable.Range(-1, 8).Contains(series)) + if (SeriesList.ContainsValue(series)) { return series; } diff --git a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/InfrastSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/InfrastSettingsUserControlModel.cs index e120c0c55c..a8794b70fd 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/InfrastSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/InfrastSettingsUserControlModel.cs @@ -103,8 +103,6 @@ public class InfrastSettingsUserControlModel : TaskViewModel InfrastItemViewModels = new ObservableCollection(tempOrderList!); InfrastItemViewModels.CollectionChanged += InfrastOrderSelectionChanged; - - _dormThresholdLabel = LocalizationHelper.GetString("DormThreshold") + ": " + _dormThreshold + "%"; } /// @@ -150,22 +148,10 @@ public class InfrastSettingsUserControlModel : TaskViewModel set { SetAndNotify(ref _dormThreshold, value); - DormThresholdLabel = LocalizationHelper.GetString("DormThreshold") + ": " + _dormThreshold + "%"; ConfigurationHelper.SetValue(ConfigurationKeys.DormThreshold, value.ToString()); } } - private string _dormThresholdLabel = string.Empty; - - /// - /// Gets or sets the label of dormitory threshold. - /// - public string DormThresholdLabel - { - get => _dormThresholdLabel; - set => SetAndNotify(ref _dormThresholdLabel, value); - } - /// /// Gets infrast order list. /// diff --git a/src/MaaWpfGui/Views/UI/CopilotView.xaml b/src/MaaWpfGui/Views/UI/CopilotView.xaml index 309a1cc6be..fb4d46e4a6 100644 --- a/src/MaaWpfGui/Views/UI/CopilotView.xaml +++ b/src/MaaWpfGui/Views/UI/CopilotView.xaml @@ -53,6 +53,7 @@ + IsEnabled="{c:Binding '(Idle) and (StartEnabled)'}" />