mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 10:10:45 +08:00
feat: 添加基建排班内置配置文件选择
This commit is contained in:
@@ -40,6 +40,13 @@
|
||||
<system:String x:Key="DormFilterNotStationedEnabled">Do not put stationed opers in dorm</system:String>
|
||||
<system:String x:Key="OriginiumShardAutoReplenishment">Originium Shard auto replenishment</system:String>
|
||||
<system:String x:Key="CustomInfrastEnabled">Enable Custom Base (beta)</system:String>
|
||||
<system:String x:Key="DefaultInfrast">Default Infrast</system:String>
|
||||
<system:String x:Key="UserDefined">User defined</system:String>
|
||||
<system:String x:Key="153_3">153 3 times a day</system:String>
|
||||
<system:String x:Key="243_3">243 3 times a day</system:String>
|
||||
<system:String x:Key="243_4">243 4 times a day</system:String>
|
||||
<system:String x:Key="252_3">252 3 times a day</system:String>
|
||||
<system:String x:Key="333_3">333 3 times a day</system:String>
|
||||
<system:String x:Key="CustomInfrastFile">Base Configuration</system:String>
|
||||
<system:String x:Key="CustomInfrastFileParseFailed">Base Configuration Parsing Error!</system:String>
|
||||
<system:String x:Key="CustomInfrastTitle">Base Configuration:</system:String>
|
||||
|
||||
@@ -40,6 +40,13 @@
|
||||
<system:String x:Key="DormFilterNotStationedEnabled">不将已进驻的干员放入宿舍</system:String>
|
||||
<system:String x:Key="OriginiumShardAutoReplenishment">源石碎片自动补货</system:String>
|
||||
<system:String x:Key="CustomInfrastEnabled">启用自定义基建配置(beta)</system:String>
|
||||
<system:String x:Key="DefaultInfrast">内置配置</system:String>
|
||||
<system:String x:Key="UserDefined">自定义</system:String>
|
||||
<system:String x:Key="153_3">153 一天3换</system:String>
|
||||
<system:String x:Key="243_3">243 一天3换</system:String>
|
||||
<system:String x:Key="243_4">243 一天4换</system:String>
|
||||
<system:String x:Key="252_3">252 一天3换</system:String>
|
||||
<system:String x:Key="333_3">333 一天3换</system:String>
|
||||
<system:String x:Key="CustomInfrastFile">自定义基建配置文件</system:String>
|
||||
<system:String x:Key="CustomInfrastFileParseFailed">自定义基建配置文件解析错误!</system:String>
|
||||
<system:String x:Key="CustomInfrastTitle">自定义基建配置:</system:String>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
x:Class="MeoAsstGui.InfrastSettingsUserControl"
|
||||
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:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dd="urn:gong-wpf-dragdrop"
|
||||
xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
xmlns:vm="clr-namespace:MeoAsstGui;assembly=MeoAsstGui"
|
||||
@@ -23,14 +23,14 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListBox
|
||||
Grid.Column="0"
|
||||
Width="200"
|
||||
Margin="10"
|
||||
dd:DragDrop.IsDragSource="True"
|
||||
dd:DragDrop.IsDropTarget="True"
|
||||
ItemsSource="{Binding Path=InfrastItemViewModels}"
|
||||
SelectionChanged="{s:Action InfrastOrderSelectionChanged}"
|
||||
ToolTip="{DynamicResource LabelSequenceTip}">
|
||||
Grid.Column="0"
|
||||
Width="200"
|
||||
Margin="10"
|
||||
dd:DragDrop.IsDragSource="True"
|
||||
dd:DragDrop.IsDropTarget="True"
|
||||
ItemsSource="{Binding Path=InfrastItemViewModels}"
|
||||
SelectionChanged="{s:Action InfrastOrderSelectionChanged}"
|
||||
ToolTip="{DynamicResource LabelSequenceTip}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@@ -48,106 +48,135 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Vertical">
|
||||
<TextBlock
|
||||
Margin="0,5"
|
||||
Grid.Row="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource TextBlockDefault}"
|
||||
Text="{DynamicResource DroneUsage}" />
|
||||
Orientation="Vertical">
|
||||
<TextBlock
|
||||
Margin="0,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource TextBlockDefault}"
|
||||
Text="{DynamicResource DroneUsage}" />
|
||||
<ComboBox
|
||||
Width="150"
|
||||
Margin="0,5"
|
||||
DisplayMemberPath="Display"
|
||||
IsEnabled="{c:Binding !CustomInfrastEnabled}"
|
||||
ItemsSource="{Binding UsesOfDronesList}"
|
||||
SelectedValue="{Binding UsesOfDrones}"
|
||||
SelectedValuePath="Value" />
|
||||
Width="150"
|
||||
Margin="0,5"
|
||||
DisplayMemberPath="Display"
|
||||
IsEnabled="{c:Binding !CustomInfrastEnabled}"
|
||||
ItemsSource="{Binding UsesOfDronesList}"
|
||||
SelectedValue="{Binding UsesOfDrones}"
|
||||
SelectedValuePath="Value" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Vertical">
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Vertical">
|
||||
<TextBlock
|
||||
Margin="0,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource TextBlockDefault}"
|
||||
ToolTip="{DynamicResource InfrastThresholdTip}"
|
||||
Text="{Binding DormThresholdLabel}" />
|
||||
Margin="0,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource TextBlockDefault}"
|
||||
Text="{Binding DormThresholdLabel}"
|
||||
ToolTip="{DynamicResource InfrastThresholdTip}" />
|
||||
<Slider
|
||||
Width="200"
|
||||
Margin="0,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ToolTip="{DynamicResource InfrastThresholdTip}"
|
||||
Value="{Binding DormThreshold}" />
|
||||
Width="200"
|
||||
Margin="0,5"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
ToolTip="{DynamicResource InfrastThresholdTip}"
|
||||
Value="{Binding DormThreshold}" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Grid.RowSpan="2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Vertical">
|
||||
<CheckBox
|
||||
Margin="5"
|
||||
HorizontalAlignment="Left"
|
||||
Grid.Row="2"
|
||||
Grid.RowSpan="2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Content="{DynamicResource DormTrustEnabled}"
|
||||
IsChecked="{Binding DormTrustEnabled}" />
|
||||
Orientation="Vertical">
|
||||
<CheckBox
|
||||
Margin="5"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding DormFilterNotStationedEnabled}">
|
||||
Margin="5"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Content="{DynamicResource DormTrustEnabled}"
|
||||
IsChecked="{Binding DormTrustEnabled}" />
|
||||
<CheckBox
|
||||
Margin="5"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding DormFilterNotStationedEnabled}">
|
||||
<TextBlock
|
||||
MaxWidth="180"
|
||||
Text="{DynamicResource DormFilterNotStationedEnabled}"
|
||||
TextWrapping="Wrap" />
|
||||
MaxWidth="180"
|
||||
Text="{DynamicResource DormFilterNotStationedEnabled}"
|
||||
TextWrapping="Wrap" />
|
||||
</CheckBox>
|
||||
<CheckBox
|
||||
Margin="5"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding OriginiumShardAutoReplenishment}">
|
||||
Margin="5"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding OriginiumShardAutoReplenishment}">
|
||||
<TextBlock
|
||||
MaxWidth="180"
|
||||
Text="{DynamicResource OriginiumShardAutoReplenishment}"
|
||||
TextWrapping="Wrap" />
|
||||
MaxWidth="180"
|
||||
Text="{DynamicResource OriginiumShardAutoReplenishment}"
|
||||
TextWrapping="Wrap" />
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<StackPanel Grid.Row="1" Margin="10" HorizontalAlignment="Center">
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Center">
|
||||
<CheckBox
|
||||
Margin="10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding CustomInfrastEnabled}">
|
||||
Margin="10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding CustomInfrastEnabled}">
|
||||
<TextBlock
|
||||
MaxWidth="180"
|
||||
Text="{DynamicResource CustomInfrastEnabled}"
|
||||
TextWrapping="Wrap" />
|
||||
MaxWidth="180"
|
||||
Text="{DynamicResource CustomInfrastEnabled}"
|
||||
TextWrapping="Wrap" />
|
||||
</CheckBox>
|
||||
<StackPanel Orientation="Horizontal" IsEnabled="{Binding CustomInfrastEnabled}">
|
||||
<Grid IsEnabled="{Binding CustomInfrastEnabled}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
Style="{StaticResource TextBlockDefault}"
|
||||
Text="{DynamicResource DefaultInfrast}" />
|
||||
<ComboBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Width="115"
|
||||
Height="30"
|
||||
ItemsSource="{Binding DefaultInfrastList}"
|
||||
SelectedValue="{Binding DefaultInfrast}"
|
||||
SelectedValuePath="Value" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
Margin="10"
|
||||
Text="{Binding CustomInfrastFile}" />
|
||||
<Button
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Width="60"
|
||||
Height="30"
|
||||
Margin="10"
|
||||
Command="{s:Action SelectCustomInfrastFile}"
|
||||
Content="{DynamicResource Select}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -145,6 +145,16 @@ namespace MeoAsstGui
|
||||
|
||||
InfrastItemViewModels = new ObservableCollection<DragItemViewModel>(temp_order_list);
|
||||
|
||||
DefaultInfrastList = new List<CombData>
|
||||
{
|
||||
new CombData { Display = Localization.GetString("UserDefined"), Value = "user_defined" },
|
||||
new CombData { Display = Localization.GetString("153_3"), Value = "153_layout_3_times_pre_day.json" },
|
||||
new CombData { Display = Localization.GetString("243_3"), Value = "243_layout_3_times_pre_day.json" },
|
||||
new CombData { Display = Localization.GetString("243_4"), Value = "243_layout_4_times_per_day.json" },
|
||||
new CombData { Display = Localization.GetString("252_3"), Value = "252_layout_3_times_pre_day.json" },
|
||||
new CombData { Display = Localization.GetString("333_3"), Value = "333_layout_for_Orundum_3_times_pre_day.json" },
|
||||
};
|
||||
|
||||
UsesOfDronesList = new List<CombData>
|
||||
{
|
||||
new CombData { Display = Localization.GetString("DronesNotUse"), Value = "_NotUse" },
|
||||
@@ -464,6 +474,11 @@ namespace MeoAsstGui
|
||||
/// </summary>
|
||||
public List<CombData> UsesOfDronesList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of uses of default infrast.
|
||||
/// </summary>
|
||||
public List<CombData> DefaultInfrastList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of roguelike lists.
|
||||
/// </summary>
|
||||
@@ -586,6 +601,26 @@ namespace MeoAsstGui
|
||||
}
|
||||
}
|
||||
|
||||
private string _defaultInfrast = ViewStatusStorage.Get("Infrast.DefaultInfrast", "user_defined");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the uses of drones.
|
||||
/// </summary>
|
||||
public string DefaultInfrast
|
||||
{
|
||||
get => _defaultInfrast;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _defaultInfrast, value);
|
||||
if (_defaultInfrast != "user_defined")
|
||||
{
|
||||
CustomInfrastFile = "resource\\custom_infrast\\" + value;
|
||||
}
|
||||
|
||||
ViewStatusStorage.Set("Infrast.DefaultInfrast", value);
|
||||
}
|
||||
}
|
||||
|
||||
private string _dormFilterNotStationedEnabled = ViewStatusStorage.Get("Infrast.DormFilterNotStationedEnabled", false.ToString());
|
||||
|
||||
/// <summary>
|
||||
@@ -659,6 +694,8 @@ namespace MeoAsstGui
|
||||
{
|
||||
CustomInfrastFile = dialog.FileName;
|
||||
}
|
||||
|
||||
DefaultInfrast = "user_defined";
|
||||
}
|
||||
|
||||
private string _customInfrastFile = ViewStatusStorage.Get("Infrast.CustomInfrastFile", string.Empty);
|
||||
|
||||
Reference in New Issue
Block a user