perf: 优化自动战斗界面布局 (#15512)

* perf: 优化自动战斗界面布局

* fix: 显示禁用状态下的自定追加干员提示

* feat: 追加自定干员tooltip的格式化显示
This commit is contained in:
yali-hzy
2026-02-01 21:09:46 +08:00
committed by GitHub
parent ef1987e02a
commit edcc7857ef
2 changed files with 23 additions and 19 deletions

View File

@@ -38,6 +38,7 @@ using MaaWpfGui.Utilities.ValueType;
using MaaWpfGui.ViewModels.Items;
using Microsoft.Win32;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Serilog;
using Stylet;
using static MaaWpfGui.Helper.CopilotHelper;
@@ -448,6 +449,10 @@ public partial class CopilotViewModel : Screen
}
}
[PropertyDependsOn(nameof(UserAdditional))]
public string UserAdditionalPrettyJson => string.IsNullOrWhiteSpace(UserAdditional) ? string.Empty
: JToken.Parse(UserAdditional).ToString(Formatting.None).Replace("},", "},\n");
private bool _isUserAdditionalPopupOpen;
/// <summary>
@@ -707,7 +712,7 @@ public partial class CopilotViewModel : Screen
set => SetAndNotify(ref _useSupportUnitUsage, value);
}
private int _supportUnitUsage = ConfigurationHelper.GetValue(ConfigurationKeys.CopilotSupportUnitUsage, 0);
private int _supportUnitUsage = ConfigurationHelper.GetValue(ConfigurationKeys.CopilotSupportUnitUsage, 1);
public int SupportUnitUsage
{

View File

@@ -273,13 +273,12 @@
</StackPanel>
<!-- UseFormation -->
<StackPanel Orientation="Horizontal" Visibility="{c:Binding '(CopilotTabIndex == 0 or CopilotTabIndex == 3) and Form'}">
<StackPanel Height="28" Orientation="Horizontal" Visibility="{c:Binding '(CopilotTabIndex == 0 or CopilotTabIndex == 3) and Form'}">
<CheckBox
Margin="2.5,5"
Content="{DynamicResource UseFormation}"
IsChecked="{c:Binding UseFormation}" />
<ComboBox
Height="20"
DisplayMemberPath="Display"
ItemsSource="{Binding FormationSelectList}"
SelectedValue="{Binding FormationIndex}"
@@ -297,24 +296,22 @@
</StackPanel>
<!-- SupportUnitUsage -->
<WrapPanel Orientation="Horizontal" Visibility="{c:Binding 'Form and (CopilotTabIndex == 0 or CopilotTabIndex == 3)'}">
<CheckBox
Margin="2.5,5"
Content="{DynamicResource SupportUnitUsage}"
IsChecked="{Binding UseSupportUnitUsage}" />
<WrapPanel Orientation="Vertical" Visibility="{c:Binding 'Form and (CopilotTabIndex == 0 or CopilotTabIndex == 3)'}">
<StackPanel Orientation="Horizontal">
<hc:ComboBox
Height="20"
MinWidth="100"
Margin="2.5,0"
DisplayMemberPath="Display"
ItemsSource="{Binding SupportUnitUsageList}"
SelectedValue="{Binding SupportUnitUsage}"
SelectedValuePath="Value"
Visibility="{c:Binding UseSupportUnitUsage}" />
<CheckBox
Margin="2.5,5"
Content="{DynamicResource SupportUnitUsage}"
IsChecked="{Binding UseSupportUnitUsage}" />
<controls:TooltipBlock TooltipText="{DynamicResource SupportUnitUsage.Tip}" />
</StackPanel>
<hc:ComboBox
MinWidth="100"
Margin="24,0,0,0"
DisplayMemberPath="Display"
ItemsSource="{Binding SupportUnitUsageList}"
SelectedValue="{Binding SupportUnitUsage}"
SelectedValuePath="Value"
Visibility="{c:Binding UseSupportUnitUsage}" />
</WrapPanel>
<!-- AddTrust -->
@@ -341,7 +338,8 @@
hc:IconElement.Geometry="{StaticResource ConfigGeometry}"
BorderThickness="0"
Command="{s:Action OpenUserAdditionalPopup}"
ToolTip="{Binding UserAdditional}" />
ToolTip="{Binding UserAdditionalPrettyJson}"
ToolTipService.ShowOnDisabled="True" />
<controls:TooltipBlock TooltipText="{DynamicResource AddUserAdditionalTip}" />
<Popup
IsOpen="{Binding IsUserAdditionalPopupOpen}"
@@ -591,6 +589,7 @@
<Grid Grid.Row="1" Grid.Column="1">
<hc:TextBox
Height="30"
MinWidth="80"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
hc:BorderElement.CornerRadius="0"