753 lines
53 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<UserControl x:Class="Milimoe.FunGame.Testing.Desktop.GameMapTesting.GameMapViewer"
x:Name="GameMapViewerControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:model="clr-namespace:Milimoe.FunGame.Core.Model;assembly=FunGame.Core"
xmlns:local="clr-namespace:Milimoe.FunGame.Testing.Desktop.GameMapTesting"
xmlns:constant="clr-namespace:Milimoe.FunGame.Core.Library.Constant;assembly=FunGame.Core"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800">
<UserControl.Resources>
<!-- ... 现有资源样式 ... -->
<!-- 装备槽位的样式 -->
<Style x:Key="EquipSlotStyle" TargetType="Border">
<Setter Property="Width" Value="50"/>
<Setter Property="Height" Value="50"/>
<Setter Property="BorderBrush" Value="DarkGray"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="3"/>
<Setter Property="Margin" Value="3"/>
<Setter Property="Background" Value="LightGray"/>
<!-- 默认背景色 -->
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
</Style>
<!-- 装备槽位中文本的样式 -->
<Style x:Key="EquipSlotTextStyle" TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="DimGray"/>
<!-- 默认文本颜色 -->
</Style>
<!-- 状态图标的样式 -->
<Style x:Key="StatusIconStyle" TargetType="Border">
<Setter Property="Width" Value="30"/>
<Setter Property="Height" Value="30"/>
<Setter Property="BorderBrush" Value="Gray"/>
<Setter Property="BorderThickness" Value="0.5"/>
<Setter Property="CornerRadius" Value="2"/>
<Setter Property="Margin" Value="2"/>
<Setter Property="Background" Value="LightBlue"/>
<!-- 默认背景色 -->
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
</Style>
<!-- 状态图标中文本的样式 -->
<Style x:Key="StatusIconTextStyle" TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Foreground" Value="Navy"/>
<!-- 默认文本颜色 -->
</Style>
<!-- 角色属性文本的样式 -->
<Style x:Key="CharacterAttributeTextStyle" TargetType="TextBlock">
<Setter Property="Margin" Value="0,1"/>
<Setter Property="FontSize" Value="11"/>
<Setter Property="Foreground" Value="#FF333333"/>
</Style>
<!-- 新增:队列项中角色头像文本的转换器 -->
<local:FirstCharConverter x:Key="FirstCharConverter"/>
<!-- 新增:队列项中角色名称和等级文本的转换器 -->
<local:CharacterToStringWithLevelConverter x:Key="CharacterToStringWithLevelConverter"/>
<!-- 新增:技能/物品名称格式化转换器 -->
<local:SkillItemFormatterConverter x:Key="SkillItemFormatterConverter"/>
<!-- 新增:技能/物品可用性判断转换器 -->
<local:SkillUsabilityConverter x:Key="SkillUsabilityConverter"/>
<!-- 新增:角色图标的样式 (圆形) -->
<Style x:Key="CharacterIconStyle" TargetType="Border">
<Setter Property="Width" Value="28"/>
<Setter Property="Height" Value="28"/>
<Setter Property="CornerRadius" Value="14"/>
<Setter Property="BorderBrush" Value="DarkBlue"/>
<Setter Property="BorderThickness" Value="1.5"/>
<Setter Property="Background" Value="#FF6A5ACD"/>
<!-- 默认背景色,可根据角色动态改变 -->
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
</Style>
<!-- 新增:角色图标中文本的样式 -->
<Style x:Key="CharacterIconTextStyle" TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<!-- 新增:选择列表项的样式 -->
<Style x:Key="SelectionItemStyle" TargetType="Border">
<Setter Property="Background" Value="LightCyan"/>
<Setter Property="BorderBrush" Value="DarkCyan"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="3"/>
<Setter Property="Padding" Value="5"/>
<Setter Property="Margin" Value="3"/>
<Setter Property="Cursor" Value="Hand"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Cyan"/>
</Trigger>
<!-- 当 Border 禁用时的样式 -->
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="#FFE0E0E0"/>
<Setter Property="BorderBrush" Value="Gray"/>
<Setter Property="Cursor" Value="Arrow"/>
<!-- 鼠标变为默认箭头 -->
<!-- 可以通过设置 TextElement.Foreground 来影响内部 TextBlock 的颜色 -->
<Setter Property="TextElement.Foreground" Value="DimGray"/>
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
<Setter Property="ToolTip" Value="无法使用:条件不满足"/>
</Trigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*"/>
<!-- 左侧动态队列 -->
<ColumnDefinition Width="1*"/>
<!-- 地图区域 -->
<ColumnDefinition Width="0.8*"/>
<!-- 新增:右侧调试日志 -->
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<!-- 地图、左侧队列、右侧日志占据的行 -->
<RowDefinition Height="Auto"/>
<!-- 底部信息界面占据的行 -->
</Grid.RowDefinitions>
<!-- 左侧动态更新队列面板 -->
<Border Grid.Column="0" Grid.Row="0" BorderBrush="LightGray" BorderThickness="1" Margin="5" Padding="5">
<StackPanel x:Name="LeftQueuePanel" MinWidth="180" Background="#FFF0F8FF">
<!-- AliceBlue -->
<TextBlock x:Name="QueueTitle" Text="行动顺序表" Margin="0,0,0,10" FontWeight="Bold" FontSize="14"/>
<!-- 动态内容将在此处添加 -->
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Height="Auto">
<ItemsControl x:Name="CharacterQueueItemsControl" ItemsSource="{Binding CharacterQueueDisplayItems, RelativeSource={RelativeSource AncestorType=UserControl}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderThickness="0,0,0,1" Margin="0,2,0,2" Padding="2">
<Border.Style>
<Style TargetType="Border">
<Setter Property="BorderBrush" Value="LightGray"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Character.Promotion}" Value="200">
<Setter Property="Background" Value="Bisque"/>
</DataTrigger>
<DataTrigger Binding="{Binding Character.Promotion}" Value="1800">
<Setter Property="Background" Value="#FFDDA0DD"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid>
<Grid.ColumnDefinitions>
<!-- 图标列 -->
<ColumnDefinition Width="Auto"/>
<!-- 文本信息列 -->
<ColumnDefinition Width="*"/>
<!-- 新增:回合奖励列 -->
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 角色图标 (用大字代替) -->
<Border Grid.Column="0" Grid.RowSpan="2" Width="25" Height="25" BorderBrush="DarkGray" BorderThickness="1" CornerRadius="3" Margin="0,0,5,0">
<!-- 默认背景色,可根据角色动态改变 -->
<Border.Style>
<Style TargetType="Border">
<!-- 默认背景色 -->
<Setter Property="Background" Value="#FF6A5ACD"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Character.Promotion}" Value="1800">
<Setter Property="Background" Value="#FF228B22"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<TextBlock Text="{Binding Character.NickName, Converter={StaticResource FirstCharConverter}}"
Foreground="White"
FontSize="10"
FontWeight="Bold"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<!-- 角色名称和等级 -->
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding Character, Converter={StaticResource CharacterToStringWithLevelConverter}}"
FontWeight="SemiBold" FontSize="10" Margin="0,0,0,2"/>
<!-- ATDelay -->
<TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding ATDelay, StringFormat=AT Delay: {0:0.##}}"
FontSize="11" Foreground="DimGray"/>
<!-- 新增:回合奖励显示 -->
<StackPanel Grid.Column="2" Grid.RowSpan="2" VerticalAlignment="Center" Margin="5,0,0,0">
<!-- 直接绑定到 ViewModel 的 PredictedTurnNumber -->
<TextBlock FontSize="9" Foreground="Gray" HorizontalAlignment="Right"
Text="{Binding PredictedTurnNumber, StringFormat=回合: {0}}" />
<!-- 直接绑定到 ViewModel 的 TurnRewardSkillName -->
<TextBlock FontSize="10" Foreground="DarkGreen" FontWeight="SemiBold" HorizontalAlignment="Right"
Text="{Binding TurnRewardSkillName}" />
</StackPanel>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</StackPanel>
</Border>
<!-- 地图区域 (使用ScrollViewer支持大地图滚动) -->
<ScrollViewer Grid.Column="1" Grid.Row="0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"
Background="#FFE0FFFF">
<Border BorderBrush="DarkGray" BorderThickness="1" Margin="5">
<!-- 新增一个Grid来容纳Canvas和调试文本框实现叠加效果 -->
<Grid>
<!-- 地图Canvas占据Grid的全部空间 -->
<!-- 添加 MouseLeftButtonDown 事件处理器 -->
<Canvas x:Name="GameMapCanvas" Background="White" MouseLeftButtonDown="GameMapCanvas_MouseLeftButtonDown">
<!-- 地图格子和角色图标将在此处动态绘制 -->
</Canvas>
<!-- 格子信息面板叠加在Canvas之上位于左侧 -->
<Border x:Name="GridInfoPanel"
Panel.ZIndex="100"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="10"
Width="250"
MaxHeight="300"
Background="#CCFFFFFF"
BorderBrush="DarkGray"
BorderThickness="1"
CornerRadius="5"
Padding="10"
Visibility="Collapsed">
<!-- 初始状态为隐藏 -->
<StackPanel>
<TextBlock Text="格子信息" FontWeight="Bold" FontSize="14" Margin="0,0,0,5"/>
<ScrollViewer VerticalScrollBarVisibility="Auto" MaxHeight="250">
<StackPanel>
<TextBlock x:Name="GridIdTextBlock" Text="ID: " Margin="0,2"/>
<TextBlock x:Name="GridCoordTextBlock" Text="坐标: " Margin="0,2"/>
<TextBlock x:Name="GridColorTextBlock" Text="颜色: " Margin="0,2"/>
<!-- 新增:格子上的角色列表 -->
<TextBlock Text="格子上的角色:" FontWeight="SemiBold" Margin="0,5,0,2"/>
<ItemsControl x:Name="GridCharactersInfoItemsControl">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="LightGray" BorderThickness="0,0,0,1" Padding="2" Margin="0,2">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding NickName}" FontWeight="SemiBold" Margin="0,0,5,0"/>
<TextBlock Text="{Binding HP, StringFormat=HP:{0:0.##}}"/>
<TextBlock Text="{Binding MaxHP, StringFormat=/{0:0.##}}" Margin="0,0,5,0"/>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!-- 原有的 GridCharactersTextBlock 已移除 -->
<TextBlock x:Name="GridEffectsTextBlock" Text="效果: " Margin="0,2" TextWrapping="Wrap"/>
<!-- 可以根据需要添加更多信息 -->
<Button x:Name="CloseGridInfoButton" Content="关闭" Margin="0,10,0,0" HorizontalAlignment="Right" Click="CloseGridInfoButton_Click"/>
</StackPanel>
</ScrollViewer>
</StackPanel>
</Border>
<!-- 新增:角色选择面板 (Overlay) -->
<Border x:Name="CharacterSelectionOverlay"
Panel.ZIndex="200"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="400"
MaxHeight="600"
Background="#DDFFFFFF"
BorderBrush="DarkBlue"
BorderThickness="2"
CornerRadius="10"
Padding="20"
Visibility="Collapsed">
<StackPanel>
<TextBlock Text="请选择你的角色" FontWeight="Bold" FontSize="16" Margin="0,0,0,10" HorizontalAlignment="Center"/>
<ScrollViewer VerticalScrollBarVisibility="Auto" MaxHeight="300">
<ItemsControl x:Name="CharacterSelectionItemsControl">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Style="{StaticResource SelectionItemStyle}"
Tag="{Binding}"
MouseLeftButtonDown="CharacterSelectionItem_MouseLeftButtonDown"
MouseEnter="CharacterSelectionItem_MouseEnter">
<TextBlock Text="{Binding NickName}" FontSize="14" FontWeight="SemiBold"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<!-- 新增:角色详情显示区域 -->
<TextBlock Text="角色详情" FontWeight="Bold" FontSize="14" Margin="0,10,0,5" HorizontalAlignment="Center"/>
<ScrollViewer VerticalScrollBarVisibility="Auto" MaxHeight="200">
<!-- 限制详情区域高度 -->
<RichTextBox x:Name="CharacterDetailsRichTextBox"
IsReadOnly="True"
BorderThickness="0"
Background="Transparent"
Foreground="DimGray"
FontSize="11"
AcceptsReturn="True"
VerticalScrollBarVisibility="Disabled"
HorizontalScrollBarVisibility="Disabled">
<FlowDocument>
<Paragraph Margin="0">将鼠标悬停在角色名称上以查看详情。</Paragraph>
</FlowDocument>
</RichTextBox>
</ScrollViewer>
</StackPanel>
</Border>
<!-- 新增:技能/物品选择面板 (Overlay) -->
<Border x:Name="SkillItemSelectionOverlay"
Panel.ZIndex="200"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="400"
MaxHeight="600"
Background="#DDFFFFFF"
BorderBrush="DarkGreen"
BorderThickness="2"
CornerRadius="10"
Padding="20"
Visibility="Collapsed">
<StackPanel>
<TextBlock x:Name="SkillItemSelectionTitle" Text="请选择技能/物品" FontWeight="Bold" FontSize="16" Margin="0,0,0,10" HorizontalAlignment="Center"/>
<ScrollViewer VerticalScrollBarVisibility="Auto" MaxHeight="300">
<ItemsControl x:Name="SkillItemSelectionItemsControl">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Style="{StaticResource SelectionItemStyle}"
Tag="{Binding}"
MouseLeftButtonDown="SkillItemSelectionItem_MouseLeftButtonDown"
MouseEnter="SkillItemSelectionItem_MouseEnter">
<Border.IsEnabled>
<MultiBinding Converter="{StaticResource SkillUsabilityConverter}">
<Binding Path="."/>
<Binding ElementName="GameMapViewerControl" Path="PlayerCharacter"/>
</MultiBinding>
</Border.IsEnabled>
<TextBlock Text="{Binding Converter={StaticResource SkillItemFormatterConverter}}" FontSize="14" FontWeight="SemiBold"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<!-- 新增:详情显示区域 -->
<TextBlock x:Name="SkillItemDescription" Text="技能/物品详情" FontWeight="Bold" FontSize="14" Margin="0,10,0,5" HorizontalAlignment="Center"/>
<ScrollViewer VerticalScrollBarVisibility="Auto" MaxHeight="200">
<!-- 限制详情区域高度 -->
<RichTextBox x:Name="SkillItemDetailsRichTextBox"
IsReadOnly="True"
BorderThickness="0"
Background="Transparent"
Foreground="DimGray"
FontSize="11"
AcceptsReturn="True"
VerticalScrollBarVisibility="Disabled"
HorizontalScrollBarVisibility="Disabled">
<FlowDocument>
<Paragraph Margin="0">将鼠标悬停在名称上以查看详情。</Paragraph>
</FlowDocument>
</RichTextBox>
</ScrollViewer>
<Button Content="取消" Margin="0,10,0,0" HorizontalAlignment="Right" Click="CancelSkillItemSelection_Click"/>
</StackPanel>
</Border>
<!-- 新增:目标选择确认面板 (Overlay) -->
<Border x:Name="TargetSelectionOverlay"
Panel.ZIndex="200"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="10"
Width="250"
MaxHeight="300"
Background="#CCFFFFFF"
BorderBrush="DarkRed"
BorderThickness="1"
CornerRadius="5"
Padding="10"
Visibility="Collapsed">
<StackPanel>
<TextBlock x:Name="TargetSelectionTitle" Text="选择目标" FontWeight="Bold" FontSize="14" Margin="0,0,0,5"/>
<ScrollViewer VerticalScrollBarVisibility="Auto" MaxHeight="200">
<ItemsControl x:Name="SelectedTargetsItemsControl" ItemsSource="{Binding SelectedTargets, RelativeSource={RelativeSource AncestorType=UserControl}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="LightGray" BorderThickness="0,0,0,1" Padding="2" Margin="0,2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<!-- 用于名称和属性条 -->
<ColumnDefinition Width="Auto"/>
<!-- 用于 "X" 按钮 -->
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<!-- 角色名称 -->
<TextBlock Text="{Binding NickName}" FontWeight="SemiBold" Margin="0,0,5,0" FontSize="11"/>
<!-- HP 条 -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,1">
<TextBlock Text="HP:" VerticalAlignment="Center" Width="25" FontSize="9"/>
<ProgressBar Value="{Binding HP}" Maximum="{Binding MaxHP}" Height="8" Width="100" Background="LightGray" BorderBrush="Gray" BorderThickness="0.5" Foreground="Green"/>
<TextBlock Text="{Binding HP, StringFormat={}{0:0.##}}" Margin="5,0,0,0" VerticalAlignment="Center" FontSize="9"/>
<TextBlock Text="{Binding MaxHP, StringFormat=/{0:0.##}}" VerticalAlignment="Center" FontSize="9"/>
</StackPanel>
<!-- MP 条 -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,1">
<TextBlock Text="MP:" VerticalAlignment="Center" Width="25" FontSize="9"/>
<ProgressBar Value="{Binding MP}" Maximum="{Binding MaxMP}" Height="8" Width="100" Background="LightGray" BorderBrush="Gray" BorderThickness="0.5" Foreground="Blue"/>
<TextBlock Text="{Binding MP, StringFormat={}{0:0.##}}" Margin="5,0,0,0" VerticalAlignment="Center" FontSize="9"/>
<TextBlock Text="{Binding MaxMP, StringFormat=/{0:0.##}}" VerticalAlignment="Center" FontSize="9"/>
</StackPanel>
<!-- EP 条 -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,1">
<TextBlock Text="EP:" VerticalAlignment="Center" Width="25" FontSize="9"/>
<ProgressBar Value="{Binding EP}" Maximum="{Binding GameplayEquilibriumConstant.MaxEP}" Height="8" Width="100" Background="LightGray" BorderBrush="Gray" BorderThickness="0.5" Foreground="Orange"/>
<TextBlock Text="{Binding EP, StringFormat={}{0:0.##}}" Margin="5,0,0,0" VerticalAlignment="Center" FontSize="9"/>
<TextBlock Text="{Binding GameplayEquilibriumConstant.MaxEP, StringFormat=/{0:0.##}}" VerticalAlignment="Center" FontSize="9"/>
</StackPanel>
</StackPanel>
<!-- 移除按钮 -->
<Button Grid.Column="1" Content="X" Margin="5,0,0,0" Tag="{Binding Id}" Click="RemoveTarget_Click"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" VerticalAlignment="Center"/>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
<Button Content="确认" Margin="0,0,5,0" Click="ConfirmTargets_Click"/>
<Button Content="取消" Click="CancelTargetSelection_Click"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 新增:继续提示面板 (Overlay) -->
<Border x:Name="ContinuePromptOverlay"
Panel.ZIndex="200"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="300"
Height="150"
Background="#DDFFFFFF"
BorderBrush="DarkOrange"
BorderThickness="2"
CornerRadius="10"
Padding="20"
Visibility="Collapsed">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock x:Name="ContinuePromptTextBlock" Text="请点击继续..." TextWrapping="Wrap" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,15"/>
<Button Content="继续" Width="80" Click="ContinuePromptButton_Click"/>
</StackPanel>
</Border>
<TextBlock x:Name="CountdownTextBlock"
Panel.ZIndex="200"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="15"
FontSize="18"
FontWeight="Bold"
Foreground="White"
Background="#88000000"
Padding="8"
Visibility="Collapsed"
Text="0 秒后继续..." />
</Grid>
</Border>
</ScrollViewer>
<!-- 新增:右侧调试日志面板 -->
<Border Grid.Column="2" Grid.Row="0" BorderBrush="LightGray" BorderThickness="1" Margin="5" Padding="5">
<Grid Background="#FFF0F8FF">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="调试日志" Margin="0,0,0,10" FontWeight="Bold" FontSize="14"/>
<ScrollViewer Grid.Row="1" x:Name="DebugLogScrollViewer"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<!-- 修改:将 TextBlock 替换为 RichTextBox -->
<RichTextBox x:Name="DebugLogRichTextBox"
IsReadOnly="True"
BorderThickness="0"
Background="Transparent"
Foreground="DimGray"
FontSize="11"
AcceptsReturn="True"
VerticalScrollBarVisibility="Disabled"
HorizontalScrollBarVisibility="Disabled">
<FlowDocument>
<Paragraph Margin="0">调试日志:</Paragraph>
</FlowDocument>
</RichTextBox>
</ScrollViewer>
</Grid>
</Border>
<!-- 底部信息界面面板 (横向填充) -->
<Border Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" BorderBrush="LightGray" BorderThickness="1" Margin="5" Padding="5">
<!-- 将StackPanel替换为Grid实现左右两部分的布局 -->
<Grid x:Name="BottomInfoPanelGrid" Background="#FFF0FFFF">
<!-- Azure -->
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<!-- 左半部分:角色信息 -->
<ColumnDefinition Width="2*"/>
<!-- 中间部分:装备和状态 (新增) -->
<ColumnDefinition Width="3*"/>
<!-- 右半部分:操作按钮 -->
</Grid.ColumnDefinitions>
<!-- 左半部分:角色信息 -->
<Border Grid.Column="0" BorderBrush="LightGray" BorderThickness="0,0,1,0" Margin="0,0,5,0" Padding="5">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel Orientation="Vertical">
<TextBlock Text="当前角色信息" FontWeight="Bold" FontSize="14" Margin="0,0,0,10"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<!-- 头像 -->
<ColumnDefinition Width="*"/>
<!-- 名称和进度条 -->
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 头像框 - 显示字符 -->
<Border x:Name="CharacterAvatarBorder" Grid.RowSpan="4" Grid.Column="0" Width="60" Height="60" BorderBrush="DarkGray" BorderThickness="1" CornerRadius="5" Margin="0,0,10,0"
Background="#FF6A5ACD">
<!-- 默认背景色,可以根据角色动态改变 -->
<Grid>
<TextBlock x:Name="CharacterAvatarTextBlock"
Text="?"
Foreground="White"
FontSize="28"
FontWeight="Bold"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</Border>
<!-- 角色名称 -->
<TextBlock x:Name="CharacterNameTextBlock" Grid.Row="0" Grid.Column="1" Text="角色名称: [未选择]" FontWeight="SemiBold" FontSize="13" Margin="0,0,0,5"/>
<!-- HP条 (包含护盾) -->
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,2">
<TextBlock Text="HP:" VerticalAlignment="Center" Width="30"/>
<!-- 内部Grid用于叠加HP和护盾Rectangle -->
<Grid Height="10" Width="120" HorizontalAlignment="Left">
<!-- 背景条 -->
<Border Background="LightGray" BorderBrush="Gray" BorderThickness="0.5" CornerRadius="2"/>
<!-- 实际HP进度 -->
<Rectangle x:Name="HpFillRectangle" HorizontalAlignment="Left" Fill="Green" Height="10" RadiusX="2" RadiusY="2"/>
<!-- 护盾进度叠加在HP之上 -->
<Rectangle x:Name="ShieldFillRectangle" HorizontalAlignment="Left" Fill="Transparent" Height="10" RadiusX="2" RadiusY="2"
Visibility="Collapsed" Panel.ZIndex="1"/>
</Grid>
<TextBlock x:Name="HpValueTextBlock" Text="0/0" Margin="5,0,0,0" VerticalAlignment="Center" FontSize="10"/>
</StackPanel>
<!-- MP条 -->
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,2">
<TextBlock Text="MP:" Width="30" VerticalAlignment="Center"/>
<ProgressBar x:Name="MpProgressBar" Value="0" Maximum="100" Height="10" Width="120" Background="LightGray" BorderBrush="Gray" BorderThickness="0.5" Foreground="Blue"/>
<TextBlock x:Name="MpValueTextBlock" Text="0/0" Margin="5,0,0,0" VerticalAlignment="Center" FontSize="10"/>
</StackPanel>
<!-- EP条 -->
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,2">
<TextBlock Text="EP:" Width="30" VerticalAlignment="Center"/>
<ProgressBar x:Name="EpProgressBar" Value="0" Maximum="100" Height="10" Width="120" Background="LightGray" BorderBrush="Gray" BorderThickness="0.5" Foreground="Orange"/>
<TextBlock x:Name="EpValueTextBlock" Text="0/0" Margin="5,0,0,0" VerticalAlignment="Center" FontSize="10"/>
</StackPanel>
</Grid>
<!-- 新增:其他角色属性 -->
<Border BorderBrush="LightGray" BorderThickness="0,1,0,0" Margin="0,10,0,0" Padding="0,10,0,0">
<!-- 将StackPanel替换为Grid实现横向两列排布 -->
<Grid x:Name="CharacterAttributesGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1.4*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" x:Name="AttackTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="攻击力:"/>
<TextBlock Grid.Row="0" Grid.Column="1" x:Name="PhysicalDefTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="物理护甲:"/>
<TextBlock Grid.Row="1" Grid.Column="0" x:Name="MagicResTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="魔法抗性:"/>
<TextBlock Grid.Row="1" Grid.Column="1" x:Name="SpeedTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="行动速度:"/>
<TextBlock Grid.Row="2" Grid.Column="0" x:Name="PrimaryAttrTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="核心属性:"/>
<TextBlock Grid.Row="2" Grid.Column="1" x:Name="StrengthTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="力量:"/>
<TextBlock Grid.Row="3" Grid.Column="0" x:Name="AgilityTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="敏捷:"/>
<TextBlock Grid.Row="3" Grid.Column="1" x:Name="IntellectTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="智力:"/>
<TextBlock Grid.Row="4" Grid.Column="0" x:Name="HpRegenTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="生命回复:"/>
<TextBlock Grid.Row="4" Grid.Column="1" x:Name="MpRegenTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="魔法回复:"/>
<TextBlock Grid.Row="5" Grid.Column="0" x:Name="CritRateTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="暴击率:"/>
<TextBlock Grid.Row="5" Grid.Column="1" x:Name="CritDmgTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="暴击伤害:"/>
<TextBlock Grid.Row="6" Grid.Column="0" x:Name="EvadeRateTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="闪避率:"/>
<TextBlock Grid.Row="6" Grid.Column="1" x:Name="LifestealTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="生命偷取:"/>
<TextBlock Grid.Row="7" Grid.Column="0" x:Name="CdrTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="冷却缩减:"/>
<TextBlock Grid.Row="7" Grid.Column="1" x:Name="AccelCoeffTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="加速系数:"/>
<TextBlock Grid.Row="8" Grid.Column="0" x:Name="PhysPenTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="物理穿透:"/>
<TextBlock Grid.Row="8" Grid.Column="1" x:Name="MagicPenTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Text="魔法穿透:"/>
</Grid>
</Border>
</StackPanel>
</ScrollViewer>
</Border>
<!-- 新增中间部分:装备和状态 -->
<Border Grid.Column="1" BorderBrush="LightGray" BorderThickness="0,0,1,0" Margin="0,0,5,0" Padding="5"
x:Name="EquipStatusInfoBorder" MouseLeftButtonDown="EquipStatusInfoBorder_MouseLeftButtonDown">
<StackPanel Orientation="Vertical">
<!-- 装备栏 -->
<TextBlock Text="装备" FontWeight="Bold" FontSize="14" Margin="0,0,0,5"/>
<WrapPanel x:Name="EquipSlotsPanel" HorizontalAlignment="Center" Margin="0,0,0,10">
<!-- 魔法卡包 -->
<Border x:Name="MagicCardPackBorder" Style="{StaticResource EquipSlotStyle}" MouseLeftButtonDown="EquipSlot_MouseLeftButtonDown">
<TextBlock x:Name="MagicCardPackSlotText" Text="魔" Style="{StaticResource EquipSlotTextStyle}"/>
</Border>
<!-- 武器 -->
<Border x:Name="WeaponBorder" Style="{StaticResource EquipSlotStyle}" MouseLeftButtonDown="EquipSlot_MouseLeftButtonDown">
<TextBlock x:Name="WeaponSlotText" Text="武" Style="{StaticResource EquipSlotTextStyle}"/>
</Border>
<!-- 防具 -->
<Border x:Name="ArmorBorder" Style="{StaticResource EquipSlotStyle}" MouseLeftButtonDown="EquipSlot_MouseLeftButtonDown">
<TextBlock x:Name="ArmorSlotText" Text="防" Style="{StaticResource EquipSlotTextStyle}"/>
</Border>
<!-- 鞋子 -->
<Border x:Name="ShoesBorder" Style="{StaticResource EquipSlotStyle}" MouseLeftButtonDown="EquipSlot_MouseLeftButtonDown">
<TextBlock x:Name="ShoesSlotText" Text="鞋" Style="{StaticResource EquipSlotTextStyle}"/>
</Border>
<!-- 饰品1 -->
<Border x:Name="Accessory1Border" Style="{StaticResource EquipSlotStyle}" MouseLeftButtonDown="EquipSlot_MouseLeftButtonDown">
<TextBlock x:Name="Accessory1SlotText" Text="饰1" Style="{StaticResource EquipSlotTextStyle}"/>
</Border>
<!-- 饰品2 -->
<Border x:Name="Accessory2Border" Style="{StaticResource EquipSlotStyle}" MouseLeftButtonDown="EquipSlot_MouseLeftButtonDown">
<TextBlock x:Name="Accessory2SlotText" Text="饰2" Style="{StaticResource EquipSlotTextStyle}"/>
</Border>
</WrapPanel>
<!-- 状态条 -->
<TextBlock Text="状态" FontWeight="Bold" FontSize="14" Margin="0,0,0,5"/>
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" MaxHeight="80">
<WrapPanel x:Name="CharacterEffectsPanel" HorizontalAlignment="Left">
<!-- 状态图标将在此处动态添加 -->
</WrapPanel>
</ScrollViewer>
<!-- 新增:装备和状态描述 -->
<Border BorderBrush="LightGray" BorderThickness="0,1,0,0" Margin="0,10,0,0" Padding="0,10,0,0">
<StackPanel>
<TextBlock Text="详情描述" FontWeight="Bold" FontSize="14" Margin="0,0,0,5"/>
<ScrollViewer VerticalScrollBarVisibility="Auto" MaxHeight="80">
<RichTextBox x:Name="DescriptionRichTextBox"
IsReadOnly="True"
BorderThickness="0"
Background="Transparent"
Foreground="DimGray"
FontSize="11"
AcceptsReturn="True"
VerticalScrollBarVisibility="Disabled"
HorizontalScrollBarVisibility="Disabled">
<FlowDocument>
<Paragraph Margin="0">点击装备或状态图标查看详情。</Paragraph>
</FlowDocument>
</RichTextBox>
</ScrollViewer>
</StackPanel>
</Border>
</StackPanel>
</Border>
<!-- 右半部分:操作按钮 -->
<Border Grid.Column="2" Padding="5">
<StackPanel Orientation="Vertical">
<TextBlock Text="操作" FontWeight="Bold" FontSize="14" Margin="0,0,0,10"/>
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Center">
<!-- IsEnabled 默认设置为 False由代码控制 -->
<!-- Tag 属性用于在 Click 事件中识别是哪个动作 -->
<Button x:Name="MoveButton" Content="移动" Width="100" Height="30" Margin="5" Click="ActionButton_Click" Tag="{x:Static constant:CharacterActionType.Move}" IsEnabled="False"/>
<Button x:Name="AttackButton" Content="普通攻击" Width="100" Height="30" Margin="5" Click="ActionButton_Click" Tag="{x:Static constant:CharacterActionType.NormalAttack}" IsEnabled="False"/>
<Button x:Name="SkillButton" Content="战技/魔法" Width="100" Height="30" Margin="5" Click="ActionButton_Click" Tag="{x:Static constant:CharacterActionType.PreCastSkill}" IsEnabled="False"/>
<Button x:Name="UseItemButton" Content="使用物品" Width="100" Height="30" Margin="5" Click="ActionButton_Click" Tag="{x:Static constant:CharacterActionType.UseItem}" IsEnabled="False"/>
<Button x:Name="EndTurnButton" Content="结束回合" Width="100" Height="30" Margin="5" Click="ActionButton_Click" Tag="{x:Static constant:CharacterActionType.EndTurn}" IsEnabled="False"/>
<Button x:Name="PreCastButton" Content="爆发技插队" Width="100" Height="30" Margin="5" Click="PreCastSkillButton_Click" Tag="" IsEnabled="False"/>
</WrapPanel>
<!-- 新增:数据统计 -->
<Border BorderBrush="LightGray" BorderThickness="0,1,0,0" Margin="0,10,0,0" Padding="0,10,0,0">
<StackPanel>
<TextBlock Text="数据统计" FontWeight="Bold" FontSize="14" Margin="0,0,0,5"/>
<TextBlock x:Name="StatsRatingKillsAssistsDeathsTextBlock" Style="{StaticResource CharacterAttributeTextStyle}"/>
<TextBlock x:Name="StatsLiveTimeRoundTurnTextBlock" Style="{StaticResource CharacterAttributeTextStyle}"/>
<TextBlock x:Name="StatsControlHealShieldTextBlock" Style="{StaticResource CharacterAttributeTextStyle}"/>
<TextBlock x:Name="StatsTotalDamageTextBlock" Style="{StaticResource CharacterAttributeTextStyle}"/>
<TextBlock x:Name="StatsTotalTakenDamageTextBlock" Style="{StaticResource CharacterAttributeTextStyle}"/>
<TextBlock x:Name="StatsTrueDamageTextBlock" Style="{StaticResource CharacterAttributeTextStyle}" Visibility="Collapsed"/>
<!-- 初始隐藏,有真实伤害时显示 -->
<TextBlock x:Name="StatsDamagePerSecondTurnTextBlock" Style="{StaticResource CharacterAttributeTextStyle}"/>
</StackPanel>
</Border>
</StackPanel>
</Border>
</Grid>
</Border>
</Grid>
</UserControl>