mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
@@ -40,6 +40,14 @@ namespace MaaWpfGui
|
||||
[DllImport("MaaCore.dll")]
|
||||
private static extern IntPtr AsstGetVersion();
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
|
||||
|
||||
private const int SWMINIMIZE = 6;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool IsIconic(IntPtr hWnd);
|
||||
|
||||
private static readonly string s_versionId = Marshal.PtrToStringAnsi(AsstGetVersion());
|
||||
|
||||
/// <summary>
|
||||
@@ -330,6 +338,18 @@ namespace MaaWpfGui
|
||||
}
|
||||
}
|
||||
|
||||
private bool _minimizingStartup = Convert.ToBoolean(ViewStatusStorage.Get("Start.MinimizingStartup", bool.FalseString));
|
||||
|
||||
public bool MinimizingStartup
|
||||
{
|
||||
get => _minimizingStartup;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _minimizingStartup, value);
|
||||
ViewStatusStorage.Set("Start.MinimizingStartup", value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private string _emulatorPath = ViewStatusStorage.Get("Start.EmulatorPath", string.Empty);
|
||||
|
||||
/// <summary>
|
||||
@@ -389,13 +409,30 @@ namespace MaaWpfGui
|
||||
return;
|
||||
}
|
||||
|
||||
ProcessStartInfo startInfo;
|
||||
if (EmulatorAddCommand.Length != 0)
|
||||
{
|
||||
Process.Start(EmulatorPath, EmulatorAddCommand);
|
||||
startInfo = new ProcessStartInfo(EmulatorPath, EmulatorAddCommand);
|
||||
}
|
||||
else
|
||||
{
|
||||
Process.Start(EmulatorPath);
|
||||
startInfo = new ProcessStartInfo(EmulatorPath);
|
||||
}
|
||||
|
||||
startInfo.UseShellExecute = false;
|
||||
Process process = new Process
|
||||
{
|
||||
StartInfo = startInfo,
|
||||
};
|
||||
|
||||
process.Start();
|
||||
process.WaitForInputIdle();
|
||||
if (MinimizingStartup)
|
||||
{
|
||||
while (!IsIconic(process.MainWindowHandle))
|
||||
{
|
||||
ShowWindow(process.MainWindowHandle, SWMINIMIZE);
|
||||
}
|
||||
}
|
||||
|
||||
if (!int.TryParse(EmulatorWaitSeconds, out int delay))
|
||||
|
||||
@@ -172,6 +172,7 @@
|
||||
<system:String x:Key="RunTaskAfterLaunch">Auto Run task after launched</system:String>
|
||||
<system:String x:Key="ClientType">Client Type</system:String>
|
||||
<system:String x:Key="OpenEmulatorAfterLaunch">Startup Emulator after launched</system:String>
|
||||
<system:String x:Key="MinimizingStartup">Minimizing the startup Emulator</system:String>
|
||||
<system:String x:Key="WaitForEmulator">Delay time</system:String>
|
||||
<system:String x:Key="EmulatorPath">Emulator exec path</system:String>
|
||||
<system:String x:Key="Select">Select</system:String>
|
||||
|
||||
@@ -139,6 +139,7 @@
|
||||
<system:String x:Key="RunTaskAfterLaunch">アプリの起動時に自動的に実行</system:String>
|
||||
<system:String x:Key="ClientType">クライアントバージョン</system:String>
|
||||
<system:String x:Key="OpenEmulatorAfterLaunch">起動時にエミュレータ自動起動</system:String>
|
||||
<system:String x:Key="MinimizingStartup">エミュレーターの起動を最小化する</system:String>
|
||||
<system:String x:Key="WaitForEmulator">エミュレータを待つ時間(秒)</system:String>
|
||||
<system:String x:Key="EmulatorPath">エミュレータパス</system:String>
|
||||
<system:String x:Key="Select">選択</system:String>
|
||||
|
||||
@@ -171,6 +171,7 @@
|
||||
<system:String x:Key="RunTaskAfterLaunch">실행 후 작업 시작</system:String>
|
||||
<system:String x:Key="ClientType">클라이언트 종류</system:String>
|
||||
<system:String x:Key="OpenEmulatorAfterLaunch">실행 후 에뮬레이터를 실행</system:String>
|
||||
<system:String x:Key="MinimizingStartup">시작 시뮬레이터 최소화</system:String>
|
||||
<system:String x:Key="WaitForEmulator">에뮬레이터 실행 대기 (초)</system:String>
|
||||
<system:String x:Key="EmulatorPath">에뮬레이터 경로</system:String>
|
||||
<system:String x:Key="Select">선택</system:String>
|
||||
|
||||
@@ -136,6 +136,7 @@
|
||||
<system:String x:Key="RunTaskAfterLaunch">🍻🍸🍸🍺🍷🍺🍻🍷</system:String>
|
||||
<system:String x:Key="ClientType">🍺🍷🍸🍸🍷🍻</system:String>
|
||||
<system:String x:Key="OpenEmulatorAfterLaunch">💃💃🍻🍸🍺🍸🍺🍸🕺🍺🍸</system:String>
|
||||
<system:String x:Key="MinimizingStartup">🍷🍸🍸🍺🍷🍺🍻🍷</system:String>
|
||||
<system:String x:Key="WaitForEmulator">🍻💃🕺🍻🍷🍷🍷🍷🍸🕺🍺🍷🍸</system:String>
|
||||
<system:String x:Key="EmulatorPath">🍻🍸🍸🍷🍻🕺</system:String>
|
||||
<system:String x:Key="Select">🍺🍻🍸</system:String>
|
||||
|
||||
@@ -172,6 +172,7 @@
|
||||
<system:String x:Key="RunTaskAfterLaunch">启动后直接运行</system:String>
|
||||
<system:String x:Key="ClientType">客户端类型</system:String>
|
||||
<system:String x:Key="OpenEmulatorAfterLaunch">启动后自动开启模拟器</system:String>
|
||||
<system:String x:Key="MinimizingStartup">最小化启动模拟器</system:String>
|
||||
<system:String x:Key="WaitForEmulator">等待模拟器启动时间(秒)</system:String>
|
||||
<system:String x:Key="EmulatorPath">模拟器路径</system:String>
|
||||
<system:String x:Key="Select">选择</system:String>
|
||||
|
||||
@@ -137,6 +137,7 @@
|
||||
<system:String x:Key="RunTaskAfterLaunch">啟動後直接運行</system:String>
|
||||
<system:String x:Key="ClientType">用戶端類型</system:String>
|
||||
<system:String x:Key="OpenEmulatorAfterLaunch">啟動後自動開啟模擬器</system:String>
|
||||
<system:String x:Key="MinimizingStartup">最小化啟動模擬器</system:String>
|
||||
<system:String x:Key="WaitForEmulator">等待模擬器啟動時間(秒)</system:String>
|
||||
<system:String x:Key="EmulatorPath">模擬器路徑</system:String>
|
||||
<system:String x:Key="Select">選擇</system:String>
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
<CheckBox
|
||||
Grid.Row="4"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.ColumnSpan="3"
|
||||
Margin="15"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
|
||||
@@ -52,13 +52,25 @@
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Center">
|
||||
<CheckBox
|
||||
Margin="20,10,10,10"
|
||||
HorizontalAlignment="Left"
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Block.TextAlignment="Center"
|
||||
Content="{DynamicResource OpenEmulatorAfterLaunch}"
|
||||
IsChecked="{Binding StartEmulator}" />
|
||||
Orientation="Vertical">
|
||||
<CheckBox
|
||||
Margin="20,10,10,10"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Block.TextAlignment="Center"
|
||||
Content="{DynamicResource OpenEmulatorAfterLaunch}"
|
||||
IsChecked="{Binding StartEmulator}" />
|
||||
<CheckBox
|
||||
Margin="20,10,10,10"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Block.TextAlignment="Center"
|
||||
Content="{DynamicResource MinimizingStartup}"
|
||||
IsChecked="{Binding MinimizingStartup}" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
|
||||
Reference in New Issue
Block a user