Files
MaaAssistantArknights/src/MaaWpfGui/Views/UserControl/FightSettingsUserControl.xaml

357 lines
18 KiB
XML

<UserControl
x:Class="MaaWpfGui.Views.UserControl.FightSettingsUserControl"
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:hc="https://handyorg.github.io/handycontrol"
xmlns:local="clr-namespace:MaaWpfGui"
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:TaskQueueViewModel}}"
d:DesignWidth="220"
mc:Ignorable="d">
<StackPanel>
<Grid Visibility="{c:Binding !TaskSettingVisibilities.EnableAdvancedSettings}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="100" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical">
<CheckBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
Content="{DynamicResource UseSanityPotion}"
IsChecked="{Binding UseMedicine}" />
<CheckBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
Content="{DynamicResource UseOriginitePrime}"
IsChecked="{Binding UseStone}"
ToolTip="{DynamicResource CheckBoxesNotSaved}" />
<CheckBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
Content="{DynamicResource PerformBattles}"
IsChecked="{Binding HasTimesLimited}"
ToolTip="{DynamicResource CheckBoxesNotSaved}" />
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Vertical">
<hc:NumericUpDown
Width="70"
Height="30"
Margin="6"
HorizontalAlignment="Left"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Maximum="9999"
Minimum="0"
ValueChanged="NumericUpDown_ValueChanged"
Value="{Binding MedicineNumber, UpdateSourceTrigger=PropertyChanged}" />
<hc:NumericUpDown
Width="70"
Height="30"
Margin="6"
HorizontalAlignment="Left"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Maximum="9999"
Minimum="0"
ValueChanged="NumericUpDown_ValueChanged"
Value="{Binding StoneNumber, UpdateSourceTrigger=PropertyChanged}" />
<hc:NumericUpDown
Width="70"
Height="30"
Margin="6"
HorizontalAlignment="Left"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Maximum="9999"
Minimum="0"
ValueChanged="NumericUpDown_ValueChanged"
Value="{Binding MaxTimes, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="100" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical">
<CheckBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
Content="{DynamicResource AssignedMaterial}"
IsChecked="{Binding IsSpecifiedDrops}"
ToolTip="{DynamicResource NoAutoNavigation}" />
<Grid Height="42" Visibility="{c:Binding IsSpecifiedDrops}">
<controls:TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{DynamicResource Quantity}"
TextAlignment="Center" />
</Grid>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Vertical">
<ComboBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
DisplayMemberPath="Display"
DropDownClosed="{s:Action DropsListDropDownClosed}"
IsEditable="True"
IsTextSearchEnabled="False"
ItemsSource="{Binding DropsList}"
Loaded="{s:Action DropsList_Loaded}"
SelectedValue="{Binding DropsItemId}"
SelectedValuePath="Value"
Text="{Binding DropsItemName}" />
<hc:NumericUpDown
Width="Auto"
Height="30"
MinWidth="60"
Margin="6"
HorizontalAlignment="Left"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Maximum="1145141919"
Minimum="1"
ValueChanged="NumericUpDown_ValueChanged"
Visibility="{c:Binding IsSpecifiedDrops}"
Value="{Binding DropsQuantity, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</Grid>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="100" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="2" Orientation="Vertical">
<Grid Height="42">
<controls:TextBlock
Margin="6"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{DynamicResource StageSelect}"
TextAlignment="Center"
TextWrapping="Wrap" />
</Grid>
<Grid Height="42" Visibility="{c:Binding UseAlternateStage}">
<controls:TextBlock
Margin="6"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{DynamicResource StageSelect2}"
TextAlignment="Center"
TextWrapping="Wrap" />
</Grid>
<Grid Height="42" Visibility="{c:Binding UseAlternateStage}">
<!-- a placeholder -->
<controls:TextBlock
Margin="6"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text=""
TextAlignment="Center"
TextWrapping="Wrap" />
</Grid>
<Grid Height="42" Visibility="{c:Binding UseRemainingSanityStage}">
<controls:TextBlock
Margin="6"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{DynamicResource RemainingSanityStage}"
TextAlignment="Center"
TextWrapping="Wrap" />
</Grid>
</StackPanel>
<StackPanel
Grid.Row="2"
Grid.Column="1"
Orientation="Vertical">
<ComboBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
DisplayMemberPath="Display"
IsEnabled="{c:Binding !CustomStageCode}"
IsHitTestVisible="{c:Binding !FightTaskRunning}"
ItemsSource="{Binding StageList}"
SelectedValue="{Binding Stage1}"
SelectedValuePath="Value"
Visibility="{c:Binding !CustomStageCode}" />
<ComboBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
DisplayMemberPath="Display"
IsEnabled="{c:Binding !CustomStageCode and UseAlternateStage}"
IsHitTestVisible="{c:Binding !FightTaskRunning}"
ItemsSource="{Binding AlternateStageList}"
SelectedValue="{Binding Stage2}"
SelectedValuePath="Value"
Visibility="{c:Binding !CustomStageCode and UseAlternateStage}" />
<ComboBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
DisplayMemberPath="Display"
IsEnabled="{c:Binding !CustomStageCode and UseAlternateStage}"
IsHitTestVisible="{c:Binding !FightTaskRunning}"
ItemsSource="{Binding AlternateStageList}"
SelectedValue="{Binding Stage3}"
SelectedValuePath="Value"
Visibility="{c:Binding !CustomStageCode and UseAlternateStage}" />
<ComboBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
DisplayMemberPath="Display"
IsEnabled="{c:Binding !CustomStageCode and UseRemainingSanityStage}"
IsHitTestVisible="{c:Binding !FightTaskRunning}"
ItemsSource="{Binding RemainingSanityStageList}"
SelectedValue="{Binding RemainingSanityStage}"
SelectedValuePath="Value"
ToolTip="{DynamicResource UseRemainingSanityStageTip}"
Visibility="{c:Binding !CustomStageCode and UseRemainingSanityStage}" />
<TextBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
IsEnabled="{c:Binding CustomStageCode}"
IsHitTestVisible="{c:Binding !FightTaskRunning}"
Text="{Binding Stage1, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{DynamicResource CustomStageCodeTip}"
Visibility="{c:Binding CustomStageCode}" />
<TextBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
IsEnabled="{c:Binding CustomStageCode}"
IsHitTestVisible="{c:Binding !FightTaskRunning}"
Text="{Binding Stage2, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{DynamicResource CustomStageCodeTip}"
Visibility="{c:Binding CustomStageCode and UseAlternateStage}" />
<TextBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
IsEnabled="{c:Binding CustomStageCode and UseAlternateStage}"
IsHitTestVisible="{c:Binding !FightTaskRunning}"
Text="{Binding Stage3, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{DynamicResource CustomStageCodeTip}"
Visibility="{c:Binding CustomStageCode and UseAlternateStage}" />
<TextBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
IsEnabled="{c:Binding CustomStageCode and UseRemainingSanityStage}"
IsHitTestVisible="{c:Binding !FightTaskRunning}"
Text="{Binding RemainingSanityStage, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{DynamicResource UseRemainingSanityStageTip}"
Visibility="{c:Binding CustomStageCode and UseRemainingSanityStage}" />
</StackPanel>
</Grid>
<Grid Grid.Row="3" Visibility="{c:Binding CustomInfrastEnabled and TaskSettingVisibilities.CustomInfrastPlanShowInFightSettings}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="100" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<Grid Height="42">
<controls:TextBlock
Margin="6"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{DynamicResource CustomInfrastPlan}"
TextAlignment="Center"
TextWrapping="Wrap" />
</Grid>
</StackPanel>
<StackPanel
Grid.Row="2"
Grid.Column="1"
Orientation="Vertical">
<ComboBox
Height="30"
Margin="6"
VerticalContentAlignment="Center"
DisplayMemberPath="Display"
IsHitTestVisible="{c:Binding !InfrastTaskRunning}"
ItemsSource="{Binding CustomInfrastPlanList}"
SelectedValue="{Binding CustomInfrastPlanIndex}"
SelectedValuePath="Value" />
</StackPanel>
</Grid>
</Grid>
<StackPanel
s:View.ActionTarget="{Binding DataContext, RelativeSource={RelativeSource Self}}"
DataContext="{Binding TaskSettingDataContext}"
IsEnabled="{Binding Idle}"
Visibility="{c:Binding TaskSettingVisibilities.EnableAdvancedSettings}">
<CheckBox
Margin="0,10"
Content="{DynamicResource DrGrandet}"
IsChecked="{Binding IsDrGrandet}"
ToolTip="{DynamicResource DrGrandetTip}" />
<CheckBox
Margin="0,10"
Content="{DynamicResource CustomStageCode}"
IsChecked="{Binding CustomStageCode}"
ToolTip="{DynamicResource CustomStageCodeTip}" />
<CheckBox
Margin="0,10"
Content="{DynamicResource UseAlternateStage}"
IsChecked="{Binding UseAlternateStage}" />
<CheckBox
Margin="0,10"
Content="{DynamicResource UseRemainingSanityStage}"
IsChecked="{Binding UseRemainingSanityStage}"
ToolTip="{DynamicResource UseRemainingSanityStageTip}" />
<CheckBox Margin="0,10" IsChecked="{Binding UseExpiringMedicine}">
<TextBlock
Block.TextAlignment="Left"
Text="{DynamicResource UseExpiringMedicine}"
TextWrapping="Wrap" />
</CheckBox>
<CheckBox
Margin="0,10"
Content="{DynamicResource HideUnavailableStage}"
IsChecked="{Binding HideUnavailableStage}" />
<CheckBox
Margin="0,10"
Content="{DynamicResource CustomInfrastPlanShowInFightSettings}"
IsChecked="{Binding TaskSettingVisibilities.CustomInfrastPlanShowInFightSettings}" />
<TextBlock
Margin="8,10,8,0"
HorizontalAlignment="Left"
Block.TextAlignment="Center"
Foreground="{DynamicResource PrimaryTextBrush}"
Text="{DynamicResource PenguinID}"
TextWrapping="Wrap" />
<TextBox
Margin="0,5"
InputMethod.IsInputMethodEnabled="False"
Style="{StaticResource TextBoxExtend}"
Text="{Binding PenguinId}" />
</StackPanel>
</StackPanel>
</UserControl>