diff --git a/src/MaaWpfGui/Constants/ConfigurationKeys.cs b/src/MaaWpfGui/Constants/ConfigurationKeys.cs
index 28f4a15372..233cb5550c 100644
--- a/src/MaaWpfGui/Constants/ConfigurationKeys.cs
+++ b/src/MaaWpfGui/Constants/ConfigurationKeys.cs
@@ -20,6 +20,7 @@ namespace MaaWpfGui.Constants
{
public const string Localization = "GUI.Localization";
public const string MinimizeToTray = "GUI.MinimizeToTray";
+ public const string HideCloseButton = "GUI.HideCloseButton";
public const string UseNotify = "GUI.UseNotify";
public const string WindowPlacement = "GUI.Placement";
public const string LoadWindowPlacement = "GUI.Placement.Load";
@@ -83,6 +84,7 @@ namespace MaaWpfGui.Constants
public const string CustomInfrastEnabled = "Infrast.CustomInfrastEnabled";
public const string CustomInfrastFile = "Infrast.CustomInfrastFile";
public const string CustomInfrastPlanIndex = "Infrast.CustomInfrastPlanIndex";
+ public const string CustomInfrastPlanShowInFightSettings = "Infrast.CustomInfrastPlanShowInFightSettings";
public const string UseRemainingSanityStage = "Fight.UseRemainingSanityStage";
public const string UseExpiringMedicine = "Fight.UseExpiringMedicine";
diff --git a/src/MaaWpfGui/Helper/WindowManager.cs b/src/MaaWpfGui/Helper/WindowManager.cs
index 19d344c9a4..7cb9cd3532 100644
--- a/src/MaaWpfGui/Helper/WindowManager.cs
+++ b/src/MaaWpfGui/Helper/WindowManager.cs
@@ -141,6 +141,12 @@ namespace MaaWpfGui.Helper
return false;
}
+ public bool ForceShow(Window window)
+ {
+ WindowPlacement wp = default;
+ return SetWindowPlacement(window, ref wp);
+ }
+
private bool SetWindowPlacement(WindowHandle window, ref WindowPlacement wp)
{
try
diff --git a/src/MaaWpfGui/Models/TaskSettingVisibilityInfo.cs b/src/MaaWpfGui/Models/TaskSettingVisibilityInfo.cs
index 541a5e8bbb..c7185718eb 100644
--- a/src/MaaWpfGui/Models/TaskSettingVisibilityInfo.cs
+++ b/src/MaaWpfGui/Models/TaskSettingVisibilityInfo.cs
@@ -54,7 +54,7 @@ namespace MaaWpfGui.Models
{
if (Guide && enable)
{
- currentEnable = taskName;
+ currentEnableSetting = taskName;
enable = false;
}
@@ -110,7 +110,7 @@ namespace MaaWpfGui.Models
set => SetAndNotify(ref _advancedSettingsVisibility, value);
}
- private string currentEnable;
+ private string currentEnableSetting;
private bool _guide = Convert.ToInt32(ConfigurationHelper.GetValue(ConfigurationKeys.GuideStepIndex, "0")) < SettingsViewModel.GuideMaxStep;
@@ -120,8 +120,24 @@ namespace MaaWpfGui.Models
set
{
SetAndNotify(ref _guide, value);
- Set(currentEnable, !value);
+ Set(currentEnableSetting, !value);
}
}
+
+ #region 双入口设置可见性
+
+ private bool _customInfrastPlanShowInFightSettings = bool.Parse(ConfigurationHelper.GetValue(ConfigurationKeys.CustomInfrastPlanShowInFightSettings, false.ToString()));
+
+ public bool CustomInfrastPlanShowInFightSettings
+ {
+ get => _customInfrastPlanShowInFightSettings;
+ set
+ {
+ SetAndNotify(ref _customInfrastPlanShowInFightSettings, value);
+ ConfigurationHelper.SetValue(ConfigurationKeys.CustomInfrastPlanShowInFightSettings, value.ToString());
+ }
+ }
+
+ #endregion
}
}
diff --git a/src/MaaWpfGui/Res/Localizations/en-us.xaml b/src/MaaWpfGui/Res/Localizations/en-us.xaml
index 02bddeb2cd..30788b62a8 100644
--- a/src/MaaWpfGui/Res/Localizations/en-us.xaml
+++ b/src/MaaWpfGui/Res/Localizations/en-us.xaml
@@ -246,12 +246,14 @@
Hide to tray when minimized
System Notification
+ Hide close button
Whether to restart immediately to apply changes
Use alternate stage
Use remaining sanity stage
Brush the specified stage after completing the main task, no longer automatically revert to sanity
Unlimited use of expiring sanity potion
Hide today not open stage
+ Show Base Plan
Variable function button
Manual entry of level names
Support most main stage names + stage names from the original list (e.g. 4-10, AP-5, H10-1-Hard, etc.)
At the end of the level, enter "Normal/Hard" to switch between Normal and Tough difficulty
@@ -558,6 +560,7 @@ The video resolution is required to be 16:9, and there are no interference facto
+ Force display of MAA
Exit
diff --git a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml
index f3103b8b98..89c2988648 100644
--- a/src/MaaWpfGui/Res/Localizations/ja-jp.xaml
+++ b/src/MaaWpfGui/Res/Localizations/ja-jp.xaml
@@ -241,11 +241,13 @@
最小化した際にトレイに表示
重要な通知をポップアップする
+ 「閉じる」ボタンを隠す
代替ステージを選択可能にする
余剰理性の使用
メインタスク終了後に指定されたレベルを選択しても、自動的に理性を回復しません
48時間以内に期限が切れる理性剤を無制限に使用
当日開放されないステージを隠す
+ 基地計画を表示する
スタート画面に表示する便利ボタン
ステージ名を入力する
(テスト機能)ステージ名と番号(例:4-10、AP-5、H10-1-Hardなど)の両方がサポートされています。レベルの最後に"Normal/Hard"を入力することで、標準とハードの難易度を切り替えることができます。
@@ -523,6 +525,7 @@
+ MAAの強制表示
終了
diff --git a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml
index 7c6d658929..11ef4e3ae2 100644
--- a/src/MaaWpfGui/Res/Localizations/ko-kr.xaml
+++ b/src/MaaWpfGui/Res/Localizations/ko-kr.xaml
@@ -247,10 +247,12 @@
트레이로 최소화
중요 알림 팝업
+ 닫기 버튼 숨기기
대체 스테이지 사용
남은 이성 활용
48시간 미만 내 소멸하는 회복제 전부 사용
미개방 스테이지 숨기기
+ 기반시설 계획 표시
메인 화면 버튼의 기능
스테이지 코드 수동 입력
대부분의 메인 스테이지와 원래 목록(예: 4-10, AP-5, H10-1-Hard)에 있는 스테이지 이름을 지원합니다.
@@ -577,6 +579,7 @@
+ MAA 강제 표시
종료
diff --git a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml
index a5345eb18e..ab0ea9eb37 100644
--- a/src/MaaWpfGui/Res/Localizations/zh-cn.xaml
+++ b/src/MaaWpfGui/Res/Localizations/zh-cn.xaml
@@ -249,12 +249,14 @@
最小化时隐藏至托盘
重要信息弹出系统通知
+ 隐藏关闭按钮
是否立刻重启应用更改
使用备选关卡
使用剩余理智
在完成主任务后刷取指定关卡,不再自动回复理智
无限吃48小时内过期的理智药
隐藏当日不开放关卡
+ 显示基建计划
主界面可选择按钮功能
手动输入关卡名
支持大部分主线关卡名与原列表的关卡名(如4-10、AP-5、H10-1-Hard)
可在关卡结尾输入"Normal/Hard"表示需要切换标准与磨难难度
@@ -579,6 +581,7 @@
+ 强制显示MAA
退出
diff --git a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml
index 7bf0fca089..1f46d7f584 100644
--- a/src/MaaWpfGui/Res/Localizations/zh-tw.xaml
+++ b/src/MaaWpfGui/Res/Localizations/zh-tw.xaml
@@ -193,11 +193,13 @@
最小化時隱藏至托盤
重要訊息彈出系統通知
+ 隱藏關閉按鈕
使用備選關卡
使用剩餘理智
在完成主任務後刷取指定關卡,不再自動回復理智
無限吃48小時內過期的理智藥
隱藏當日不開放關卡
+ 顯示基建計劃
主介面可選擇按鈕功能
手動輸入關卡代名
支持大部分主線關卡名與原列表的關卡名(如4-10、AP-5、H10-1-Hard)
可在關卡結尾輸入"Normal/Hard"表示需要切換標準與磨難難度
@@ -460,6 +462,7 @@
+ 強制顯示MAA
退出
diff --git a/src/MaaWpfGui/Services/Managers/IMainWindowManager.cs b/src/MaaWpfGui/Services/Managers/IMainWindowManager.cs
index a7ea1a2d4b..efa8ac48c0 100644
--- a/src/MaaWpfGui/Services/Managers/IMainWindowManager.cs
+++ b/src/MaaWpfGui/Services/Managers/IMainWindowManager.cs
@@ -25,6 +25,11 @@ namespace MaaWpfGui.Services.Managers
///
void Show();
+ ///
+ /// Force show the main window
+ ///
+ void ForceShow();
+
///
/// Collapse the main window
///
diff --git a/src/MaaWpfGui/Services/Managers/MainWindowManager.cs b/src/MaaWpfGui/Services/Managers/MainWindowManager.cs
index 2c2a4bbb8d..0f369d898e 100644
--- a/src/MaaWpfGui/Services/Managers/MainWindowManager.cs
+++ b/src/MaaWpfGui/Services/Managers/MainWindowManager.cs
@@ -50,6 +50,12 @@ namespace MaaWpfGui.Services.Managers
MainWindow.Activate();
}
+ ///
+ public virtual void ForceShow()
+ {
+ ((WindowManager)Instances.WindowManager).ForceShow(MainWindow);
+ }
+
///
public virtual void Collapse()
{
diff --git a/src/MaaWpfGui/Services/TrayIcon.cs b/src/MaaWpfGui/Services/TrayIcon.cs
index c920d5ce43..212eb47122 100644
--- a/src/MaaWpfGui/Services/TrayIcon.cs
+++ b/src/MaaWpfGui/Services/TrayIcon.cs
@@ -64,9 +64,12 @@ namespace MaaWpfGui.Services
switchLangMenu.MenuItems.Add(langMenu);
}
+ MenuItem forceShowMenu = new MenuItem(LocalizationHelper.GetString("ForceShow"));
+ forceShowMenu.Click += ForceShow;
+
MenuItem exitMenu = new MenuItem(LocalizationHelper.GetString("Exit"));
exitMenu.Click += App_exit;
- MenuItem[] menuItems = new MenuItem[] { startMenu, stopMenu, switchLangMenu, exitMenu };
+ MenuItem[] menuItems = new MenuItem[] { startMenu, stopMenu, switchLangMenu, forceShowMenu, exitMenu };
this._notifyIcon.ContextMenu = new ContextMenu(menuItems);
}
@@ -91,6 +94,11 @@ namespace MaaWpfGui.Services
Instances.TaskQueueViewModel?.Stop();
}
+ private void ForceShow(object sender, EventArgs e)
+ {
+ Instances.MainWindowManager.ForceShow();
+ }
+
private void App_exit(object sender, EventArgs e)
{
System.Windows.Application.Current.MainWindow.Close();
diff --git a/src/MaaWpfGui/ViewModels/UI/RootViewModel.cs b/src/MaaWpfGui/ViewModels/UI/RootViewModel.cs
index 2450466513..e243018573 100644
--- a/src/MaaWpfGui/ViewModels/UI/RootViewModel.cs
+++ b/src/MaaWpfGui/ViewModels/UI/RootViewModel.cs
@@ -15,6 +15,7 @@ using System;
using System.ComponentModel;
using System.Threading.Tasks;
using System.Windows;
+using MaaWpfGui.Constants;
using MaaWpfGui.Helper;
using Stylet;
using StyletIoC;
@@ -66,6 +67,17 @@ namespace MaaWpfGui.ViewModels.UI
set => SetAndNotify(ref _windowTitle, value);
}
+ private bool _showCloseButton = !Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.HideCloseButton, bool.FalseString));
+
+ ///
+ /// Gets or sets a value indicating whether to show close button.
+ ///
+ public bool ShowCloseButton
+ {
+ get => _showCloseButton;
+ set => SetAndNotify(ref _showCloseButton, value);
+ }
+
protected override void OnInitialActivate()
{
base.OnInitialActivate();
diff --git a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
index 4d588b7b9a..e5954c8d4a 100644
--- a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
+++ b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
@@ -2439,6 +2439,23 @@ namespace MaaWpfGui.ViewModels.UI
}
}
+ private bool _hideCloseButton = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.HideCloseButton, bool.FalseString));
+
+ ///
+ /// Gets or sets a value indicating whether to hide close button.
+ ///
+ public bool HideCloseButton
+ {
+ get => _hideCloseButton;
+ set
+ {
+ SetAndNotify(ref _hideCloseButton, value);
+ ConfigurationHelper.SetValue(ConfigurationKeys.HideCloseButton, value.ToString());
+ var rvm = (RootViewModel)this.Parent;
+ rvm.ShowCloseButton = !value;
+ }
+ }
+
private bool _useNotify = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.UseNotify, bool.TrueString));
///
diff --git a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs
index 27a26a903f..ac01c67e3f 100644
--- a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs
+++ b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs
@@ -171,18 +171,20 @@ namespace MaaWpfGui.ViewModels.UI
return true;
}
+ if (!Instances.RecognizerViewModel.GachaDone)
+ {
+ // no need to confirm if Gacha running
+ return true;
+ }
+
var window = Instances.MainWindowManager.GetWindowIfVisible();
var result = MessageBoxHelper.ShowNative(window, LocalizationHelper.GetString("ConfirmExitText"), LocalizationHelper.GetString("ConfirmExitTitle"), "MAA", MessageBoxButton.YesNo, MessageBoxImage.Information, MessageBoxResult.No);
return result == MessageBoxResult.Yes;
}
-#pragma warning disable CS0672 // Member overrides obsolete member
-
- // WHY OBSOLETED?
- protected override bool CanClose()
-#pragma warning restore CS0672 // Member overrides obsolete member
+ public override Task CanCloseAsync()
{
- return ConfirmExit();
+ return Task.FromResult(this.ConfirmExit());
}
private void InitTimer()
diff --git a/src/MaaWpfGui/Views/UI/RootView.xaml b/src/MaaWpfGui/Views/UI/RootView.xaml
index 2f6b376c6e..84f099e7d7 100644
--- a/src/MaaWpfGui/Views/UI/RootView.xaml
+++ b/src/MaaWpfGui/Views/UI/RootView.xaml
@@ -16,6 +16,7 @@
MinHeight="600"
d:DataContext="{d:DesignInstance {x:Type ui:RootViewModel}}"
Icon="../../newlogo.ico"
+ ShowCloseButton="{Binding ShowCloseButton}"
mc:Ignorable="d">
diff --git a/src/MaaWpfGui/Views/UI/TaskQueueView.xaml b/src/MaaWpfGui/Views/UI/TaskQueueView.xaml
index c201f4b30d..282764ab8e 100644
--- a/src/MaaWpfGui/Views/UI/TaskQueueView.xaml
+++ b/src/MaaWpfGui/Views/UI/TaskQueueView.xaml
@@ -65,18 +65,23 @@
ToolTip="{DynamicResource LabelSequenceTip}">
-
+
+
+
+
+
+ -->
-
+
-
+
diff --git a/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml
index 37c3058d53..23428ce3e5 100644
--- a/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml
+++ b/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml
@@ -22,10 +22,11 @@
+
-
+
@@ -88,7 +89,7 @@
-
+
@@ -134,9 +135,40 @@
Value="{Binding DropsQuantity, UpdateSourceTrigger=PropertyChanged}" />
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -302,6 +334,10 @@
Content="{DynamicResource HideUnavailableStage}"
IsChecked="{Binding HideUnavailableStage}"
IsEnabled="{c:Binding !CustomStageCode}" />
+
-
+
@@ -34,7 +34,7 @@
+
+ Text="{Binding LanguageInfo, Mode=OneTime}"
+ TextWrapping="Wrap" />
+ Text="UI Theme"
+ TextWrapping="Wrap" />
-
-
-
-
+ Block.TextAlignment="Center"
+ Text="{DynamicResource MainViewButtonFeature}"
+ TextWrapping="Wrap" />
+