实装统计列表及搜索功能

This commit is contained in:
Hakoyu 2023-10-26 22:31:58 +08:00
parent d050bee34e
commit f51de0f362
2 changed files with 442 additions and 197 deletions

View File

@ -1,182 +1,382 @@
<pu:WindowX x:Class="VPet_Simulator.Windows.winCharacterPanel"
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:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:VPet_Simulator.Windows"
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" mc:Ignorable="d" Title="{ll:Str 面板}" Width="500"
Height="500" Style="{DynamicResource BaseWindowXStyle}" WindowStartupLocation="CenterScreen">
<TabControl x:Name="MainTab" Margin="5" pu:TabControlHelper.CanHeaderPanelScroll="True" SelectedIndex="0"
pu:TabControlHelper.ItemsCornerRadius="4" pu:TabControlHelper.ItemsHeight="NaN"
pu:TabControlHelper.ItemsHoverBackground="{DynamicResource PrimaryLight}"
pu:TabControlHelper.ItemsPadding="10,7"
pu:TabControlHelper.ItemsSelectedBackground="{DynamicResource PrimaryDark}"
pu:TabControlHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}" Background="Transparent"
BorderThickness="0" Foreground="{DynamicResource PrimaryText}"
Grid.Column="1">
<TabControl.ContentTemplate>
<DataTemplate>
<Border Margin="0,5,0,5" Background="{DynamicResource DARKPrimaryText}" CornerRadius="15">
<ContentControl Margin="0,0" Content="{Binding}" />
</Border>
</DataTemplate>
</TabControl.ContentTemplate>
<TabItem Header="{ll:Str 统计面板}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBox Style="{DynamicResource StandardTextBoxStyle}" pu:TextBoxHelper.Watermark="{ll:Str 搜索统计}" />
<DataGrid x:Name="DataGridStatic" Grid.Row="1" Margin="0,5,0,0"/>
</Grid>
<pu:WindowX
x:Class="VPet_Simulator.Windows.winCharacterPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF"
xmlns:local="clr-namespace:VPet_Simulator.Windows"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI"
Title="{ll:Str 面板}"
Width="500"
Height="500"
Style="{DynamicResource BaseWindowXStyle}"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<Window.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
</Window.Resources>
<TabControl
x:Name="MainTab"
Grid.Column="1"
Margin="5"
pu:TabControlHelper.CanHeaderPanelScroll="True"
pu:TabControlHelper.ItemsCornerRadius="4"
pu:TabControlHelper.ItemsHeight="NaN"
pu:TabControlHelper.ItemsHoverBackground="{DynamicResource PrimaryLight}"
pu:TabControlHelper.ItemsPadding="10,7"
pu:TabControlHelper.ItemsSelectedBackground="{DynamicResource PrimaryDark}"
pu:TabControlHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}"
Background="Transparent"
BorderThickness="0"
Foreground="{DynamicResource PrimaryText}"
SelectedIndex="0">
<TabControl.ContentTemplate>
<DataTemplate>
<Border
Margin="0,5,0,5"
Background="{DynamicResource DARKPrimaryText}"
CornerRadius="15">
<ContentControl Margin="0,0" Content="{Binding}" />
</Border>
</DataTemplate>
</TabControl.ContentTemplate>
<TabItem Header="{ll:Str 统计面板}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBox
x:Name="TextBox_Search"
pu:TextBoxHelper.Watermark="{ll:Str 搜索统计}"
Style="{DynamicResource StandardTextBoxStyle}"
TextChanged="TextBox_Search_TextChanged" />
<DataGrid
x:Name="DataGridStatic"
Grid.Row="1"
Margin="0,5,0,0"
d:ItemsSource="{d:SampleData ItemCount=5}"
AutoGenerateColumns="False"
CanUserAddRows="False">
<DataGrid.RowStyle>
<Style BasedOn="{StaticResource {x:Type DataGridRow}}" TargetType="DataGridRow">
<Setter Property="ToolTip" Value="{Binding StatId}" />
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn
Binding="{Binding StatName}"
ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"
Header="{ll:Str 名称}"
IsReadOnly="True" />
<DataGridTextColumn
Binding="{Binding StatCount}"
ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"
Header="{ll:Str 数量}"
IsReadOnly="True" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</TabItem>
<TabItem Header="{ll:Str 详情面板}" Visibility="Collapsed">
<ScrollViewer>
<Grid Margin="15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="7" />
<ColumnDefinition />
</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" />
</Grid.RowDefinitions>
<!--<Label Grid.Column="3" Width="14" Height="14" Background="Transparent" Foreground="{DynamicResource PrimaryText}" Padding="0" VerticalContentAlignment="Center" FontSize="10"
</TabItem>
<TabItem Header="{ll:Str 详情面板}" Visibility="Collapsed">
<ScrollViewer>
<Grid Margin="15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="7" />
<ColumnDefinition />
</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" />
</Grid.RowDefinitions>
<!--<Label Grid.Column="3" Width="14" Height="14" Background="Transparent" Foreground="{DynamicResource PrimaryText}" Padding="0" VerticalContentAlignment="Center" FontSize="10"
HorizontalContentAlignment="Center" BorderBrush="{DynamicResource PrimaryText}" BorderThickness="1" pu:LabelHelper.CornerRadius="7" Content="i" />-->
<TextBlock Margin="0,10,0,0" VerticalAlignment="Top" Text="金钱:" FontWeight="Heavy" />
<StackPanel Grid.Column="2">
<TextBlock FontSize="20" Foreground="{DynamicResource DARKPrimary}" Text="$100,000" />
<TextBlock Margin="5,0,0,10" Text="钱不是万能的,没钱是万万不能的" Foreground="{DynamicResource PrimaryText}"
Opacity="0.5" />
</StackPanel>
<TextBlock x:Name="txtHearth" Grid.Row="1" Margin="0,13,0,0" Visibility="Collapsed"
VerticalAlignment="Top" Text="健康值:" FontWeight="Heavy" />
<StackPanel x:Name="stkHearth" Grid.Row="1" Grid.Column="2" Margin="0,10,0,0" Visibility="Collapsed">
<ProgressBar FontSize="10" Height="20" Value="50"
Foreground="{DynamicResource DangerProgressBarForeground}" Background="Transparent"
BorderBrush="{DynamicResource DangerProgressBarForeground}" BorderThickness="1.5"
pu:ProgressBarHelper.IsPercentVisible="True" pu:ProgressBarHelper.CornerRadius="4"
pu:ProgressBarHelper.GeneratingPercentText="PgbHearth_GeneratingPercentText">
</ProgressBar>
<TextBlock Margin="0,5,0,10" Foreground="{DynamicResource PrimaryText}" Opacity="0.5"
TextWrapping="Wrap" Text="宠物已经生病。通过服用药物可以恢复健康状态。" />
</StackPanel>
<TextBlock Grid.Row="2" Margin="0,13,0,0" VerticalAlignment="Top" Text="等级:" FontWeight="Heavy" />
<StackPanel Grid.Row="2" Grid.Column="2" Margin="0,10,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock FontSize="16" Foreground="{DynamicResource PrimaryText}" Text="Lv 10" />
<TextBlock Grid.Column="2" VerticalAlignment="Bottom" FontWeight="Bold" FontSize="14"
Foreground="{DynamicResource DARKPrimary}" Text="x1 经验速率" />
</Grid>
<ProgressBar Margin="0,5,0,0" FontSize="10" Height="20" Value="50"
Foreground="{DynamicResource ProgressBarForeground}" Background="Transparent"
BorderBrush="{DynamicResource ProgressBarForeground}" BorderThickness="1.5"
pu:ProgressBarHelper.IsPercentVisible="True" pu:ProgressBarHelper.CornerRadius="4"
pu:ProgressBarHelper.GeneratingPercentText="PgbExperience_GeneratingPercentText">
</ProgressBar>
<TextBlock Margin="3,5,0,10" Foreground="{DynamicResource PrimaryText}" Opacity="0.5"
TextWrapping="Wrap" Text="等级越高, 学习和打工收益更高" />
</StackPanel>
<TextBlock Grid.Row="3" Margin="0,13,0,0" VerticalAlignment="Top" Text="体力:" FontWeight="Heavy" />
<StackPanel Grid.Row="3" Grid.Column="2" Margin="0,10,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Foreground="{DynamicResource PrimaryText}" Text="恢复中(自然恢复)" />
<TextBlock Grid.Column="2" VerticalAlignment="Bottom" FontWeight="Bold" FontSize="14"
Foreground="{DynamicResource DARKPrimary}" Text="+1/tick" />
</Grid>
<ProgressBar Margin="0,5,0,0" FontSize="10" Height="20" Value="50"
Foreground="{DynamicResource ProgressBarForeground}" Background="Transparent"
BorderBrush="{DynamicResource ProgressBarForeground}" BorderThickness="1.5"
pu:ProgressBarHelper.IsPercentVisible="True" pu:ProgressBarHelper.CornerRadius="4"
pu:ProgressBarHelper.GeneratingPercentText="PgbExperience_GeneratingPercentText">
</ProgressBar>
<TextBlock Margin="0,5,0,10" Foreground="{DynamicResource PrimaryText}" Opacity="0.5"
TextWrapping="Wrap" Text="睡觉可以快速恢复体力。饱腹度低于50时无法自然恢复体力。" />
</StackPanel>
<TextBlock Grid.Row="4" Margin="0,13,0,0" VerticalAlignment="Top" Text="心情:" FontWeight="Heavy" />
<StackPanel Grid.Row="4" Grid.Column="2" Margin="0,10,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Foreground="{DynamicResource PrimaryText}" Text="-" />
<TextBlock Grid.Column="2" VerticalAlignment="Bottom" FontWeight="Bold" FontSize="14"
Foreground="{DynamicResource DARKPrimary}" Text="+1/tick" />
</Grid>
<ProgressBar Margin="0,5,0,0" FontSize="10" Height="20" Value="60"
Foreground="{DynamicResource ProgressBarForeground}" Background="Transparent"
BorderBrush="{DynamicResource ProgressBarForeground}" BorderThickness="1.5"
pu:ProgressBarHelper.IsPercentVisible="True" pu:ProgressBarHelper.CornerRadius="4"
pu:ProgressBarHelper.GeneratingPercentText="PgbSpirit_GeneratingPercentText">
</ProgressBar>
<TextBlock Margin="0,5,0,10" Foreground="{DynamicResource PrimaryText}" Opacity="0.5"
TextWrapping="Wrap" Text="摸头可以恢复心情。心情低于75时无法获得经验加成。" />
</StackPanel>
<TextBlock Grid.Row="5" Margin="0,13,0,0" VerticalAlignment="Top" Text="饱腹度:" FontWeight="Heavy" />
<StackPanel Grid.Row="5" Grid.Column="2" Margin="0,10,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Foreground="{DynamicResource PrimaryText}" Text="下降中(自然下降)" />
<TextBlock Grid.Column="2" VerticalAlignment="Bottom" FontWeight="Bold" FontSize="14"
Foreground="{DynamicResource DARKPrimary}" Text="+1/tick" />
</Grid>
<ProgressBar Margin="0,5,0,0" FontSize="10" Height="20" Value="80"
Foreground="{DynamicResource ProgressBarForeground}" Background="Transparent"
BorderBrush="{DynamicResource ProgressBarForeground}" BorderThickness="1.5"
pu:ProgressBarHelper.IsPercentVisible="True" pu:ProgressBarHelper.CornerRadius="4"
pu:ProgressBarHelper.GeneratingPercentText="PgbHunger_GeneratingPercentText">
</ProgressBar>
<TextBlock Margin="0,5,0,10" Foreground="{DynamicResource PrimaryText}" Opacity="0.5"
TextWrapping="Wrap" Text="进食可以快速恢复饱腹度。" />
</StackPanel>
<TextBlock Grid.Row="6" Margin="0,13,0,0" VerticalAlignment="Top" Text="口渴度:" FontWeight="Heavy" />
<StackPanel Grid.Row="6" Grid.Column="2" Margin="0,10,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Foreground="{DynamicResource PrimaryText}" Text="下降中(自然下降)" />
<TextBlock Grid.Column="2" VerticalAlignment="Bottom" FontWeight="Bold" FontSize="14"
Foreground="{DynamicResource DARKPrimary}" Text="+1/tick" />
</Grid>
<ProgressBar Margin="0,5,0,0" FontSize="10" Height="20" Value="20"
Foreground="{DynamicResource ProgressBarForeground}" Background="Transparent"
BorderBrush="{DynamicResource ProgressBarForeground}" BorderThickness="1.5"
pu:ProgressBarHelper.IsPercentVisible="True" pu:ProgressBarHelper.CornerRadius="4"
pu:ProgressBarHelper.GeneratingPercentText="PgbThirsty_GeneratingPercentText">
</ProgressBar>
<TextBlock Grid.Column="2" Margin="0,5,0,10" Foreground="{DynamicResource PrimaryText}"
Opacity="0.5" TextWrapping="Wrap" Text="喝水可以快速恢复口渴度。口渴度低于25时宠物会生病。" />
</StackPanel>
</Grid>
</ScrollViewer>
</TabItem>
</TabControl>
<TextBlock
Margin="0,10,0,0"
VerticalAlignment="Top"
FontWeight="Heavy"
Text="金钱:" />
<StackPanel Grid.Column="2">
<TextBlock
FontSize="20"
Foreground="{DynamicResource DARKPrimary}"
Text="$100,000" />
<TextBlock
Margin="5,0,0,10"
Foreground="{DynamicResource PrimaryText}"
Opacity="0.5"
Text="钱不是万能的,没钱是万万不能的" />
</StackPanel>
<TextBlock
x:Name="txtHearth"
Grid.Row="1"
Margin="0,13,0,0"
VerticalAlignment="Top"
FontWeight="Heavy"
Text="健康值:"
Visibility="Collapsed" />
<StackPanel
x:Name="stkHearth"
Grid.Row="1"
Grid.Column="2"
Margin="0,10,0,0"
Visibility="Collapsed">
<ProgressBar
Height="20"
pu:ProgressBarHelper.CornerRadius="4"
pu:ProgressBarHelper.GeneratingPercentText="PgbHearth_GeneratingPercentText"
pu:ProgressBarHelper.IsPercentVisible="True"
Background="Transparent"
BorderBrush="{DynamicResource DangerProgressBarForeground}"
BorderThickness="1.5"
FontSize="10"
Foreground="{DynamicResource DangerProgressBarForeground}"
Value="50" />
<TextBlock
Margin="0,5,0,10"
Foreground="{DynamicResource PrimaryText}"
Opacity="0.5"
Text="宠物已经生病。通过服用药物可以恢复健康状态。"
TextWrapping="Wrap" />
</StackPanel>
<TextBlock
Grid.Row="2"
Margin="0,13,0,0"
VerticalAlignment="Top"
FontWeight="Heavy"
Text="等级:" />
<StackPanel
Grid.Row="2"
Grid.Column="2"
Margin="0,10,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
FontSize="16"
Foreground="{DynamicResource PrimaryText}"
Text="Lv 10" />
<TextBlock
Grid.Column="2"
VerticalAlignment="Bottom"
FontSize="14"
FontWeight="Bold"
Foreground="{DynamicResource DARKPrimary}"
Text="x1 经验速率" />
</Grid>
<ProgressBar
Height="20"
Margin="0,5,0,0"
pu:ProgressBarHelper.CornerRadius="4"
pu:ProgressBarHelper.GeneratingPercentText="PgbExperience_GeneratingPercentText"
pu:ProgressBarHelper.IsPercentVisible="True"
Background="Transparent"
BorderBrush="{DynamicResource ProgressBarForeground}"
BorderThickness="1.5"
FontSize="10"
Foreground="{DynamicResource ProgressBarForeground}"
Value="50" />
<TextBlock
Margin="3,5,0,10"
Foreground="{DynamicResource PrimaryText}"
Opacity="0.5"
Text="等级越高, 学习和打工收益更高"
TextWrapping="Wrap" />
</StackPanel>
<TextBlock
Grid.Row="3"
Margin="0,13,0,0"
VerticalAlignment="Top"
FontWeight="Heavy"
Text="体力:" />
<StackPanel
Grid.Row="3"
Grid.Column="2"
Margin="0,10,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Foreground="{DynamicResource PrimaryText}" Text="恢复中(自然恢复)" />
<TextBlock
Grid.Column="2"
VerticalAlignment="Bottom"
FontSize="14"
FontWeight="Bold"
Foreground="{DynamicResource DARKPrimary}"
Text="+1/tick" />
</Grid>
<ProgressBar
Height="20"
Margin="0,5,0,0"
pu:ProgressBarHelper.CornerRadius="4"
pu:ProgressBarHelper.GeneratingPercentText="PgbExperience_GeneratingPercentText"
pu:ProgressBarHelper.IsPercentVisible="True"
Background="Transparent"
BorderBrush="{DynamicResource ProgressBarForeground}"
BorderThickness="1.5"
FontSize="10"
Foreground="{DynamicResource ProgressBarForeground}"
Value="50" />
<TextBlock
Margin="0,5,0,10"
Foreground="{DynamicResource PrimaryText}"
Opacity="0.5"
Text="睡觉可以快速恢复体力。饱腹度低于50时无法自然恢复体力。"
TextWrapping="Wrap" />
</StackPanel>
<TextBlock
Grid.Row="4"
Margin="0,13,0,0"
VerticalAlignment="Top"
FontWeight="Heavy"
Text="心情:" />
<StackPanel
Grid.Row="4"
Grid.Column="2"
Margin="0,10,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Foreground="{DynamicResource PrimaryText}" Text="-" />
<TextBlock
Grid.Column="2"
VerticalAlignment="Bottom"
FontSize="14"
FontWeight="Bold"
Foreground="{DynamicResource DARKPrimary}"
Text="+1/tick" />
</Grid>
<ProgressBar
Height="20"
Margin="0,5,0,0"
pu:ProgressBarHelper.CornerRadius="4"
pu:ProgressBarHelper.GeneratingPercentText="PgbSpirit_GeneratingPercentText"
pu:ProgressBarHelper.IsPercentVisible="True"
Background="Transparent"
BorderBrush="{DynamicResource ProgressBarForeground}"
BorderThickness="1.5"
FontSize="10"
Foreground="{DynamicResource ProgressBarForeground}"
Value="60" />
<TextBlock
Margin="0,5,0,10"
Foreground="{DynamicResource PrimaryText}"
Opacity="0.5"
Text="摸头可以恢复心情。心情低于75时无法获得经验加成。"
TextWrapping="Wrap" />
</StackPanel>
<TextBlock
Grid.Row="5"
Margin="0,13,0,0"
VerticalAlignment="Top"
FontWeight="Heavy"
Text="饱腹度:" />
<StackPanel
Grid.Row="5"
Grid.Column="2"
Margin="0,10,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Foreground="{DynamicResource PrimaryText}" Text="下降中(自然下降)" />
<TextBlock
Grid.Column="2"
VerticalAlignment="Bottom"
FontSize="14"
FontWeight="Bold"
Foreground="{DynamicResource DARKPrimary}"
Text="+1/tick" />
</Grid>
<ProgressBar
Height="20"
Margin="0,5,0,0"
pu:ProgressBarHelper.CornerRadius="4"
pu:ProgressBarHelper.GeneratingPercentText="PgbHunger_GeneratingPercentText"
pu:ProgressBarHelper.IsPercentVisible="True"
Background="Transparent"
BorderBrush="{DynamicResource ProgressBarForeground}"
BorderThickness="1.5"
FontSize="10"
Foreground="{DynamicResource ProgressBarForeground}"
Value="80" />
<TextBlock
Margin="0,5,0,10"
Foreground="{DynamicResource PrimaryText}"
Opacity="0.5"
Text="进食可以快速恢复饱腹度。"
TextWrapping="Wrap" />
</StackPanel>
<TextBlock
Grid.Row="6"
Margin="0,13,0,0"
VerticalAlignment="Top"
FontWeight="Heavy"
Text="口渴度:" />
<StackPanel
Grid.Row="6"
Grid.Column="2"
Margin="0,10,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Foreground="{DynamicResource PrimaryText}" Text="下降中(自然下降)" />
<TextBlock
Grid.Column="2"
VerticalAlignment="Bottom"
FontSize="14"
FontWeight="Bold"
Foreground="{DynamicResource DARKPrimary}"
Text="+1/tick" />
</Grid>
<ProgressBar
Height="20"
Margin="0,5,0,0"
pu:ProgressBarHelper.CornerRadius="4"
pu:ProgressBarHelper.GeneratingPercentText="PgbThirsty_GeneratingPercentText"
pu:ProgressBarHelper.IsPercentVisible="True"
Background="Transparent"
BorderBrush="{DynamicResource ProgressBarForeground}"
BorderThickness="1.5"
FontSize="10"
Foreground="{DynamicResource ProgressBarForeground}"
Value="20" />
<TextBlock
Grid.Column="2"
Margin="0,5,0,10"
Foreground="{DynamicResource PrimaryText}"
Opacity="0.5"
Text="喝水可以快速恢复口渴度。口渴度低于25时宠物会生病。"
TextWrapping="Wrap" />
</StackPanel>
</Grid>
</ScrollViewer>
</TabItem>
</TabControl>
</pu:WindowX>

View File

@ -1,6 +1,9 @@
using LinePutScript.Localization.WPF;
using Panuon.WPF.UI;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
@ -13,6 +16,7 @@ namespace VPet_Simulator.Windows
public partial class winCharacterPanel : WindowX
{
MainWindow mw;
public winCharacterPanel(MainWindow mw)
{
this.mw = mw;
@ -20,52 +24,65 @@ namespace VPet_Simulator.Windows
foreach (var v in mw.GameSavesData.Statistics.Data)
{
Statlists.Add(new Statlist(v.Key, v.Value));
StatList.Add(new StatInfo(v.Key, v.Value));
}
DataGridStatic.DataContext = Statlists;
DataGridStatic.ItemsSource = StatList;
}
private List<Statlist> Statlists { get; set; } = new List<Statlist>();
private class Statlist
private ObservableCollection<StatInfo> StatList { get; set; } = new();
private class StatInfo
{
public Statlist(string statid, string statcount)
public StatInfo(string statId, string statCount)
{
this.statid = statid;
this.statcount = statcount;
if (statid.StartsWith("buy_"))
StatId = statId;
StatCount = statCount;
if (statId.StartsWith("buy_"))
{
statname = "购买次数".Translate() + statid.Substring(3);
StatName = "购买次数".Translate() + statId.Substring(3);
}
else
{
statname = statid.Translate();
StatName = statId.Translate();
}
}
/// <summary>
/// 统计ID
/// </summary>
public string statid { get; set; }
public string StatId { get; set; }
/// <summary>
/// 统计显示名称
/// </summary>
public string statname { get; set; }
public string StatName { get; set; }
/// <summary>
/// 统计内容
/// </summary>
public string statcount { get; set; }
public string StatCount { get; set; }
}
private void PgbExperience_GeneratingPercentText(object sender, GeneratingPercentTextRoutedEventArgs e)
private void PgbExperience_GeneratingPercentText(
object sender,
GeneratingPercentTextRoutedEventArgs e
)
{
e.Text = $"{e.Value * 10} / {100 * 10}";
}
private void PgbStrength_GeneratingPercentText(object sender, GeneratingPercentTextRoutedEventArgs e)
private void PgbStrength_GeneratingPercentText(
object sender,
GeneratingPercentTextRoutedEventArgs e
)
{
e.Text = $"{e.Value} / 100";
}
private void PgbSpirit_GeneratingPercentText(object sender, GeneratingPercentTextRoutedEventArgs e)
private void PgbSpirit_GeneratingPercentText(
object sender,
GeneratingPercentTextRoutedEventArgs e
)
{
var progressBar = (ProgressBar)sender;
progressBar.Foreground = GetForeground(e.Value);
@ -73,7 +90,10 @@ namespace VPet_Simulator.Windows
e.Text = $"{e.Value} / 100";
}
private void PgbHunger_GeneratingPercentText(object sender, GeneratingPercentTextRoutedEventArgs e)
private void PgbHunger_GeneratingPercentText(
object sender,
GeneratingPercentTextRoutedEventArgs e
)
{
var progressBar = (ProgressBar)sender;
progressBar.Foreground = GetForeground(e.Value);
@ -81,7 +101,10 @@ namespace VPet_Simulator.Windows
e.Text = $"{e.Value} / 100";
}
private void PgbThirsty_GeneratingPercentText(object sender, GeneratingPercentTextRoutedEventArgs e)
private void PgbThirsty_GeneratingPercentText(
object sender,
GeneratingPercentTextRoutedEventArgs e
)
{
var progressBar = (ProgressBar)sender;
progressBar.Foreground = GetForeground(e.Value);
@ -94,7 +117,10 @@ namespace VPet_Simulator.Windows
}
}
private void PgbHearth_GeneratingPercentText(object sender, GeneratingPercentTextRoutedEventArgs e)
private void PgbHearth_GeneratingPercentText(
object sender,
GeneratingPercentTextRoutedEventArgs e
)
{
e.Text = $"{e.Value} / 100";
}
@ -115,5 +141,24 @@ namespace VPet_Simulator.Windows
}
}
private void TextBox_Search_TextChanged(object sender, TextChangedEventArgs e)
{
if (sender is not TextBox textBox)
return;
if (string.IsNullOrWhiteSpace(textBox.Text))
{
DataGridStatic.ItemsSource = StatList;
}
else
{
DataGridStatic.ItemsSource = StatList.Where(
i =>
i.StatName.IndexOf(
textBox.Text,
StringComparison.InvariantCultureIgnoreCase
) >= 0
);
}
}
}
}