mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 10:10:45 +08:00
feat: 启动MAA后直接最小化
This commit is contained in:
@@ -50,6 +50,7 @@ namespace MaaWpfGui.Constants
|
||||
|
||||
public const string ClientType = "Start.ClientType";
|
||||
public const string RunDirectly = "Start.RunDirectly";
|
||||
public const string MinimizeDirectly = "Start.MinimizeDirectly";
|
||||
public const string StartEmulator = "Start.StartEmulator";
|
||||
public const string MinimizingStartup = "Start.MinimizingStartup";
|
||||
public const string EmulatorPath = "Start.EmulatorPath";
|
||||
|
||||
@@ -91,6 +91,19 @@ namespace MaaWpfGui.Helper
|
||||
MoveWindowToDisplay(ScreenName, window);
|
||||
}
|
||||
|
||||
bool minimizeDirectly = bool.Parse(ConfigurationHelper.GetValue(ConfigurationKeys.MinimizeDirectly, bool.FalseString));
|
||||
if (minimizeDirectly)
|
||||
{
|
||||
window.WindowState = WindowState.Minimized;
|
||||
}
|
||||
|
||||
bool minimizeToTray = bool.Parse(ConfigurationHelper.GetValue(ConfigurationKeys.MinimizeToTray, bool.FalseString));
|
||||
if (minimizeDirectly && minimizeToTray)
|
||||
{
|
||||
window.ShowInTaskbar = false;
|
||||
window.Visibility = Visibility.Hidden;
|
||||
}
|
||||
|
||||
var app = Application.Current as App;
|
||||
app!.DarkToStart();
|
||||
}
|
||||
|
||||
@@ -183,6 +183,7 @@
|
||||
|
||||
<system:String x:Key="LaunchOnSystemStartup">Auto start with PC</system:String>
|
||||
<system:String x:Key="RunTaskAfterLaunch">Auto Run task after launched</system:String>
|
||||
<system:String x:Key="MinimizeAfterLaunch">Auto Minimize after launched</system:String>
|
||||
<system:String x:Key="ClientType">Client Type</system:String>
|
||||
<system:String x:Key="AutoRestartOption">Restart when game disconnects</system:String>
|
||||
<system:String x:Key="OpenEmulatorAfterLaunch">Startup Emulator after launched</system:String>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ResourceDictionary
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespaces:MaaWpfGui"
|
||||
@@ -181,6 +181,7 @@
|
||||
|
||||
<system:String x:Key="LaunchOnSystemStartup">スタートアップ</system:String>
|
||||
<system:String x:Key="RunTaskAfterLaunch">アプリの起動時に自動的に実行</system:String>
|
||||
<system:String x:Key="MinimizeAfterLaunch">アプリの起動時に自動的に最小化</system:String>
|
||||
<system:String x:Key="ClientType">クライアントバージョン</system:String>
|
||||
<system:String x:Key="AutoRestartOption">ゲームが切断されたときに自動的に再接続する</system:String>
|
||||
<system:String x:Key="OpenEmulatorAfterLaunch">起動時にエミュレータ自動起動</system:String>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ResourceDictionary
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespaces:MaaWpfGui"
|
||||
@@ -175,6 +175,7 @@
|
||||
|
||||
<system:String x:Key="LaunchOnSystemStartup">시스템 시작 시 MAA 실행</system:String>
|
||||
<system:String x:Key="RunTaskAfterLaunch">MAA 실행 후 작업 자동 시작</system:String>
|
||||
<system:String x:Key="MinimizeAfterLaunch">MAA 실행 후 최소화</system:String>
|
||||
<system:String x:Key="ClientType">클라이언트 종류</system:String>
|
||||
<system:String x:Key="AutoRestartOption">게임 연결이 끊어지면 자동으로 다시 연결</system:String>
|
||||
<system:String x:Key="OpenEmulatorAfterLaunch">MAA 실행 후 에뮬레이터를 실행</system:String>
|
||||
|
||||
@@ -184,6 +184,7 @@
|
||||
|
||||
<system:String x:Key="LaunchOnSystemStartup">开机自动启动MAA</system:String>
|
||||
<system:String x:Key="RunTaskAfterLaunch">启动MAA后直接运行</system:String>
|
||||
<system:String x:Key="MinimizeAfterLaunch">启动MAA后直接最小化</system:String>
|
||||
<system:String x:Key="ClientType">客户端类型</system:String>
|
||||
<system:String x:Key="AutoRestartOption">游戏掉线时自动重连</system:String>
|
||||
<system:String x:Key="HelpUsWithOverseasServersTip">外服适配滞销,帮帮我们!不会编程也可以</system:String>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ResourceDictionary
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespaces:MaaWpfGui"
|
||||
@@ -138,6 +138,7 @@
|
||||
|
||||
<system:String x:Key="LaunchOnSystemStartup">開機自動啟動</system:String>
|
||||
<system:String x:Key="RunTaskAfterLaunch">啟動後直接運行</system:String>
|
||||
<system:String x:Key="MinimizeAfterLaunch">啟動後直接最小化</system:String>
|
||||
<system:String x:Key="ClientType">用戶端類型</system:String>
|
||||
<system:String x:Key="AutoRestartOption">遊戲掉線時自動重連</system:String>
|
||||
<system:String x:Key="OpenEmulatorAfterLaunch">啟動後自動開啟模擬器</system:String>
|
||||
|
||||
@@ -360,6 +360,21 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
}
|
||||
}
|
||||
|
||||
private bool _minimizeDirectly = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.MinimizeDirectly, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to minimize directly.
|
||||
/// </summary>
|
||||
public bool MinimizeDirectly
|
||||
{
|
||||
get => _minimizeDirectly;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _minimizeDirectly, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.MinimizeDirectly, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _startEmulator = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.StartEmulator, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -39,15 +39,22 @@
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Block.TextAlignment="Center"
|
||||
Content="{DynamicResource OpenEmulatorAfterLaunch}"
|
||||
IsChecked="{Binding StartEmulator}" />
|
||||
Content="{DynamicResource RunTaskAfterLaunch}"
|
||||
IsChecked="{Binding RunDirectly}" />
|
||||
<CheckBox
|
||||
Margin="10"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Block.TextAlignment="Center"
|
||||
Content="{DynamicResource RunTaskAfterLaunch}"
|
||||
IsChecked="{Binding RunDirectly}" />
|
||||
Content="{DynamicResource MinimizeAfterLaunch}"
|
||||
IsChecked="{Binding MinimizeDirectly}" />
|
||||
<CheckBox
|
||||
Margin="10"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Block.TextAlignment="Center"
|
||||
Content="{DynamicResource OpenEmulatorAfterLaunch}"
|
||||
IsChecked="{Binding StartEmulator}" />
|
||||
<CheckBox
|
||||
Margin="10"
|
||||
HorizontalAlignment="Left"
|
||||
|
||||
Reference in New Issue
Block a user