mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 18:47:55 +08:00
增加附加命令
This commit is contained in:
@@ -35,6 +35,10 @@
|
||||
<Button Command="{s:Action SelectEmulatorExec}" Content="选择" Margin="10" />
|
||||
</StackPanel>
|
||||
<TextBox Text="{Binding EmulatorPath}" Margin="10" />
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock Margin="10" Style="{StaticResource TextBlockDefault}" Block.TextAlignment="Center" Text="附加命令" />
|
||||
</StackPanel>
|
||||
<TextBox Text="{Binding EmulatorAddCommand}" Margin="10" />
|
||||
<TextBlock Margin="10" Style="{StaticResource TextBlockDefault}" Block.TextAlignment="Center" Text="客户端版本" />
|
||||
<ComboBox IsHitTestVisible ="{Binding Idle}" Margin="10"
|
||||
ItemsSource="{Binding ClientTypeList}"
|
||||
|
||||
@@ -203,6 +203,19 @@ namespace MeoAsstGui
|
||||
}
|
||||
}
|
||||
|
||||
private string _emulatorAddCommand = ViewStatusStorage.Get("Start.EmulatorAddCommand", string.Empty);
|
||||
|
||||
public string EmulatorAddCommand
|
||||
{
|
||||
get { return _emulatorAddCommand; }
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _emulatorAddCommand, value);
|
||||
ViewStatusStorage.Set("Start.EmulatorAddCommand", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string _emulatorWaitSeconds = ViewStatusStorage.Get("Start.EmulatorWaitSeconds", "60");
|
||||
|
||||
public string EmulatorWaitSeconds
|
||||
@@ -222,13 +235,25 @@ namespace MeoAsstGui
|
||||
{
|
||||
return;
|
||||
}
|
||||
Process emuProcess = new Process();
|
||||
emuProcess.StartInfo.FileName = "cmd.exe";
|
||||
emuProcess.StartInfo.RedirectStandardInput = true;
|
||||
emuProcess.StartInfo.UseShellExecute = false;
|
||||
emuProcess.Start();
|
||||
emuProcess.StandardInput.WriteLine(EmulatorPath);
|
||||
emuProcess.StandardInput.WriteLine("exit");
|
||||
if (EmulatorAddCommand.Length != 0)
|
||||
{
|
||||
string StartCommand = "";
|
||||
if (EmulatorPath.StartsWith("\""))
|
||||
{
|
||||
StartCommand += EmulatorPath.ToString();
|
||||
}
|
||||
else StartCommand = "\"" + EmulatorPath.ToString() + "\"";
|
||||
StartCommand += " ";
|
||||
StartCommand += EmulatorAddCommand.ToString();
|
||||
Process emuProcess = new Process();
|
||||
emuProcess.StartInfo.FileName = "cmd.exe";
|
||||
emuProcess.StartInfo.RedirectStandardInput = true;
|
||||
emuProcess.StartInfo.UseShellExecute = false;
|
||||
emuProcess.Start();
|
||||
emuProcess.StandardInput.WriteLine(StartCommand);
|
||||
emuProcess.StandardInput.WriteLine("exit");
|
||||
}
|
||||
else Process.Start(EmulatorPath);
|
||||
int delay = 0;
|
||||
if (!int.TryParse(EmulatorWaitSeconds, out delay))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user