mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 01:59:33 +08:00
258 lines
9.3 KiB
XML
258 lines
9.3 KiB
XML
<UserControl
|
||
x:Class="MaaWpfGui.Views.UserControl.ConnectSettingsUserControl"
|
||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding"
|
||
xmlns:controls="clr-namespace:MaaWpfGui.Styles.Controls"
|
||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||
xmlns:dd="urn:gong-wpf-dragdrop"
|
||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||
xmlns:s="https://github.com/canton7/Stylet"
|
||
xmlns:styles="clr-namespace:MaaWpfGui.Styles"
|
||
xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI"
|
||
xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels"
|
||
xmlns:vm="clr-namespace:MaaWpfGui"
|
||
d:DataContext="{d:DesignInstance {x:Type ui:SettingsViewModel}}"
|
||
d:DesignHeight="300"
|
||
d:DesignWidth="550"
|
||
mc:Ignorable="d">
|
||
<Grid>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="100" />
|
||
<ColumnDefinition Width="270" />
|
||
<ColumnDefinition Width="150" />
|
||
</Grid.ColumnDefinitions>
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition />
|
||
<RowDefinition />
|
||
<RowDefinition />
|
||
<RowDefinition />
|
||
<RowDefinition />
|
||
<RowDefinition />
|
||
<RowDefinition />
|
||
<RowDefinition />
|
||
<RowDefinition />
|
||
<RowDefinition />
|
||
</Grid.RowDefinitions>
|
||
<StackPanel
|
||
Grid.Row="0"
|
||
Grid.Column="1"
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
Orientation="Horizontal">
|
||
<CheckBox
|
||
Margin="10"
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
Content="{DynamicResource AutoDetectConnection}"
|
||
IsChecked="{Binding AutoDetectConnection}"
|
||
ToolTip="{DynamicResource AutoDetectConnectionTip}" />
|
||
<CheckBox
|
||
Margin="10"
|
||
VerticalAlignment="Center"
|
||
Content="{DynamicResource AlwaysAutoDetectConnection}"
|
||
IsChecked="{Binding AlwaysAutoDetectConnection}"
|
||
Visibility="{c:Binding AutoDetectConnection}" />
|
||
</StackPanel>
|
||
<controls:TextBlock
|
||
Grid.Row="1"
|
||
Grid.Column="0"
|
||
Margin="10"
|
||
Block.TextAlignment="Center"
|
||
Text="{DynamicResource ADBPath}"
|
||
TextWrapping="Wrap" />
|
||
<TextBox
|
||
Grid.Row="1"
|
||
Grid.Column="1"
|
||
Width="250"
|
||
Height="30"
|
||
Margin="10"
|
||
IsEnabled="{c:Binding !AutoDetectConnection}"
|
||
Text="{Binding AdbPath}" />
|
||
<Button
|
||
Grid.Row="1"
|
||
Grid.Column="2"
|
||
Width="60"
|
||
Height="30"
|
||
Margin="10"
|
||
HorizontalAlignment="Left"
|
||
Command="{s:Action SelectFile}"
|
||
Content="{DynamicResource Select}"
|
||
IsEnabled="{c:Binding !AutoDetectConnection}" />
|
||
|
||
<controls:TextBlock
|
||
Grid.Row="2"
|
||
Grid.Column="0"
|
||
Margin="10"
|
||
Block.TextAlignment="Center"
|
||
Text="{DynamicResource ConnectionAddress}"
|
||
TextWrapping="Wrap" />
|
||
<ComboBox
|
||
Grid.Row="2"
|
||
Grid.Column="1"
|
||
Width="250"
|
||
Height="30"
|
||
Margin="10"
|
||
IsEditable="True"
|
||
IsEnabled="{c:Binding !AutoDetectConnection}"
|
||
ItemsSource="{Binding ConnectAddressHistory}"
|
||
Text="{Binding ConnectAddress, UpdateSourceTrigger=LostFocus}"
|
||
ToolTip="{DynamicResource ConnectionAddressTip}">
|
||
<ComboBox.ItemTemplate>
|
||
<DataTemplate>
|
||
<Grid Width="{c:Binding ActualWidth - 20, RelativeSource={RelativeSource AncestorType=ComboBox}}">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*" />
|
||
<ColumnDefinition Width="Auto" />
|
||
</Grid.ColumnDefinitions>
|
||
<TextBlock
|
||
Grid.Column="0"
|
||
HorizontalAlignment="Left"
|
||
VerticalAlignment="Center"
|
||
Text="{Binding}" />
|
||
<Button
|
||
Grid.Column="1"
|
||
HorizontalAlignment="Right"
|
||
Command="{s:Action RemoveAddress_Click}"
|
||
CommandParameter="{Binding}"
|
||
Content="×"
|
||
FontWeight="Bold" />
|
||
</Grid>
|
||
</DataTemplate>
|
||
</ComboBox.ItemTemplate>
|
||
</ComboBox>
|
||
|
||
<controls:TextBlock
|
||
Grid.Row="3"
|
||
Grid.Column="0"
|
||
Margin="10"
|
||
Block.TextAlignment="Center"
|
||
Text="{DynamicResource ConnectionPreset}"
|
||
TextWrapping="Wrap" />
|
||
<ComboBox
|
||
Grid.Row="3"
|
||
Grid.Column="1"
|
||
Width="250"
|
||
Height="30"
|
||
Margin="10"
|
||
DisplayMemberPath="Display"
|
||
IsEnabled="{c:Binding !AutoDetectConnection}"
|
||
ItemsSource="{Binding ConnectConfigList}"
|
||
SelectedValue="{Binding ConnectConfig}"
|
||
SelectedValuePath="Value" />
|
||
<WrapPanel
|
||
Grid.Row="4"
|
||
Grid.Column="0"
|
||
Grid.ColumnSpan="3"
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center">
|
||
<CheckBox
|
||
Margin="20,10"
|
||
Content="{DynamicResource RetryOnDisconnected}"
|
||
IsChecked="{Binding RetryOnDisconnected}"
|
||
ToolTip="{DynamicResource RetryOnDisconnectedTip}" />
|
||
<CheckBox
|
||
Margin="20,10"
|
||
Content="{DynamicResource AllowADBRestart}"
|
||
IsChecked="{Binding AllowADBRestart}" />
|
||
<CheckBox
|
||
Margin="20,10"
|
||
Content="{DynamicResource AllowADBHardRestart}"
|
||
IsChecked="{Binding AllowADBHardRestart}" />
|
||
<CheckBox
|
||
Margin="20,10"
|
||
Content="{DynamicResource AutoRestartOption}"
|
||
IsChecked="{Binding AutoRestartOnDrop}" />
|
||
</WrapPanel>
|
||
<controls:TextBlock
|
||
Grid.Row="5"
|
||
Grid.Column="0"
|
||
VerticalAlignment="Center"
|
||
Text="{DynamicResource TouchMode}" />
|
||
<ComboBox
|
||
Grid.Row="5"
|
||
Grid.Column="1"
|
||
Width="250"
|
||
Height="30"
|
||
Margin="10"
|
||
DisplayMemberPath="Display"
|
||
IsHitTestVisible="{Binding Idle}"
|
||
ItemsSource="{Binding TouchModeList}"
|
||
SelectedValue="{Binding TouchMode}"
|
||
SelectedValuePath="Value" />
|
||
<Button
|
||
Grid.Row="5"
|
||
Grid.Column="2"
|
||
Height="30"
|
||
Margin="10"
|
||
HorizontalAlignment="Left"
|
||
Command="{s:Action ReplaceADB}"
|
||
Content="{DynamicResource ForcedReplaceADB}" />
|
||
<CheckBox
|
||
Grid.Row="6"
|
||
Grid.Column="0"
|
||
Grid.ColumnSpan="2"
|
||
Margin="80,10,10,10"
|
||
HorizontalAlignment="Left"
|
||
VerticalAlignment="Center"
|
||
Content="{DynamicResource KillAdbOnExit}"
|
||
IsChecked="{Binding KillAdbOnExit}" />
|
||
<CheckBox
|
||
Grid.Row="6"
|
||
Grid.Column="1"
|
||
Grid.ColumnSpan="2"
|
||
Margin="160,10,10,10"
|
||
HorizontalAlignment="Left"
|
||
VerticalAlignment="Center"
|
||
Content="{DynamicResource AdbLiteEnabled}"
|
||
IsChecked="{Binding AdbLiteEnabled}" />
|
||
<CheckBox
|
||
Grid.Row="7"
|
||
Grid.Column="0"
|
||
Grid.ColumnSpan="3"
|
||
Margin="10"
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
IsChecked="{Binding DeploymentWithPause}">
|
||
<controls:TextBlock
|
||
Block.TextAlignment="Center"
|
||
Text="{DynamicResource DeploymentWithPause}"
|
||
TextWrapping="Wrap" />
|
||
</CheckBox>
|
||
<controls:TextBlock
|
||
Grid.Row="8"
|
||
Grid.Column="0"
|
||
Margin="10"
|
||
Block.TextAlignment="Center"
|
||
Text="{DynamicResource StartsWithScript}"
|
||
TextWrapping="Wrap" />
|
||
<TextBox
|
||
Grid.Row="8"
|
||
Grid.Column="1"
|
||
Width="250"
|
||
Height="30"
|
||
Margin="10"
|
||
AllowDrop="True"
|
||
Drop="StartsWithScript_Drop"
|
||
PreviewDragOver="TextBox_PreviewDragOver"
|
||
Text="{Binding StartsWithScript}" />
|
||
<controls:TextBlock
|
||
Grid.Row="9"
|
||
Grid.Column="0"
|
||
Margin="10"
|
||
Block.TextAlignment="Center"
|
||
Text="{DynamicResource EndsWithScript}"
|
||
TextWrapping="Wrap" />
|
||
<TextBox
|
||
Grid.Row="9"
|
||
Grid.Column="1"
|
||
Width="250"
|
||
Height="30"
|
||
Margin="10"
|
||
AllowDrop="True"
|
||
Drop="EndsWithScript_Drop"
|
||
PreviewDragOver="TextBox_PreviewDragOver"
|
||
Text="{Binding EndsWithScript}" />
|
||
</Grid>
|
||
</UserControl>
|