ToolBar支持滚动

This commit is contained in:
ZouJin 2023-08-19 00:53:04 +10:00
parent 4452919b33
commit cbe8ddf891
5 changed files with 98 additions and 263 deletions

View File

@ -1,18 +1,11 @@
<UserControl
x:Class="VPet_Simulator.Core.ToolBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<UserControl x:Class="VPet_Simulator.Core.ToolBar" 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.Core"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="https://opensource.panuon.com/wpf-ui"
Width="500"
Height="500"
VerticalAlignment="Top"
MouseEnter="UserControl_MouseEnter"
MouseLeave="UserControl_MouseLeave"
mc:Ignorable="d">
xmlns:pu="https://opensource.panuon.com/wpf-ui" Width="500" Height="500" VerticalAlignment="Top"
MouseEnter="UserControl_MouseEnter" MouseLeave="UserControl_MouseLeave" mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@ -22,19 +15,10 @@
</ResourceDictionary>
</UserControl.Resources>
<Grid x:Name="MainGrid" x:FieldModifier="public">
<Border
x:Name="BdrPanel"
Margin="0,0,0,55"
VerticalAlignment="Bottom"
x:FieldModifier="public"
Background="{DynamicResource DARKPrimaryText}"
BorderBrush="{DynamicResource DARKPrimaryDarker}"
BorderThickness="1"
CornerRadius="5"
MouseLeave="MenuPanel_MouseLeave"
TextBlock.FontSize="24"
TextElement.FontSize="24"
Visibility="Collapsed">
<Border x:Name="BdrPanel" Margin="0,0,0,55" VerticalAlignment="Bottom" x:FieldModifier="public"
Background="{DynamicResource DARKPrimaryText}" BorderBrush="{DynamicResource DARKPrimaryDarker}"
BorderThickness="1" CornerRadius="5" MouseLeave="MenuPanel_MouseLeave" TextBlock.FontSize="24"
TextElement.FontSize="24" Visibility="Collapsed">
<Grid Margin="15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@ -53,251 +37,101 @@
<RowDefinition Height="30" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<TextBlock
x:Name="Tlv"
Grid.ColumnSpan="3"
VerticalAlignment="Center"
Foreground="{DynamicResource DARKPrimary}"
Text="Lv 14" />
<Button
Grid.Column="2"
Grid.ColumnSpan="3"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="Transparent"
Click="MenuPanel_Click"
Content="{ll:Str 详细}"
Cursor="Hand"
Foreground="{DynamicResource DARKPrimary}"
Visibility="Collapsed">
<TextBlock x:Name="Tlv" Grid.ColumnSpan="3" VerticalAlignment="Center"
Foreground="{DynamicResource DARKPrimary}" Text="Lv 14" />
<Button Grid.Column="2" Grid.ColumnSpan="3" HorizontalAlignment="Right" VerticalAlignment="Center"
Background="Transparent" Click="MenuPanel_Click" Content="{ll:Str 详细}" Cursor="Hand"
Foreground="{DynamicResource DARKPrimary}" Visibility="Collapsed">
<Button.ContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" TextDecorations="Underline" />
</DataTemplate>
</Button.ContentTemplate>
</Button>
<TextBlock
x:Name="till"
Grid.Row="1"
Grid.ColumnSpan="5"
Foreground="#FF4C4C"
Text="{ll:Str 宠物已经生病\, 通过服用药物可以恢复}"
TextWrapping="Wrap" />
<TextBlock
x:Name="tfun"
Grid.Row="1"
Grid.ColumnSpan="5"
Foreground="#4caf50"
Text="{ll:Str 已关闭数据计算\, 可放心挂机}"
TextWrapping="Wrap" />
<TextBlock
Grid.Row="2"
VerticalAlignment="Center"
Text="{ll:Str 金钱}" />
<TextBlock
x:Name="tMoney"
Grid.Row="2"
Grid.Column="2"
Foreground="{DynamicResource DARKPrimary}"
<TextBlock x:Name="till" Grid.Row="1" Grid.ColumnSpan="5" Foreground="#FF4C4C"
Text="{ll:Str 宠物已经生病\, 通过服用药物可以恢复}" TextWrapping="Wrap" />
<TextBlock x:Name="tfun" Grid.Row="1" Grid.ColumnSpan="5" Foreground="#4caf50"
Text="{ll:Str 已关闭数据计算\, 可放心挂机}" TextWrapping="Wrap" />
<TextBlock Grid.Row="2" VerticalAlignment="Center" Text="{ll:Str 金钱}" />
<TextBlock x:Name="tMoney" Grid.Row="2" Grid.Column="2" Foreground="{DynamicResource DARKPrimary}"
Text="$100,000" />
<TextBlock
Grid.Row="3"
VerticalAlignment="Center"
Text="{ll:Str 经验}" />
<ProgressBar
x:Name="pExp"
Grid.Row="3"
Grid.Column="2"
Height="20"
VerticalAlignment="Center"
<TextBlock Grid.Row="3" VerticalAlignment="Center" Text="{ll:Str 经验}" />
<ProgressBar x:Name="pExp" Grid.Row="3" Grid.Column="2" Height="20" VerticalAlignment="Center"
pu:ProgressBarHelper.CornerRadius="10"
pu:ProgressBarHelper.GeneratingPercentText="PgbExperience_GeneratingPercentText"
pu:ProgressBarHelper.IsPercentVisible="True"
FontSize="20"
Foreground="{DynamicResource ProgressBarForeground}"
Value="40" />
<TextBlock
x:Name="tExp"
Grid.Row="3"
Grid.Column="4"
HorizontalAlignment="Right"
Foreground="{DynamicResource DARKPrimary}"
Text="x1.0" />
<TextBlock
Grid.Row="4"
VerticalAlignment="Center"
Text="{ll:Str 体力}" />
<ProgressBar
x:Name="pStrength"
Grid.Row="4"
Grid.Column="2"
Height="20"
VerticalAlignment="Center"
pu:ProgressBarHelper.IsPercentVisible="True" FontSize="20"
Foreground="{DynamicResource ProgressBarForeground}" Value="40" />
<TextBlock x:Name="tExp" Grid.Row="3" Grid.Column="4" HorizontalAlignment="Right"
Foreground="{DynamicResource DARKPrimary}" Text="x1.0" />
<TextBlock Grid.Row="4" VerticalAlignment="Center" Text="{ll:Str 体力}" />
<ProgressBar x:Name="pStrength" Grid.Row="4" Grid.Column="2" Height="20" VerticalAlignment="Center"
pu:ProgressBarHelper.CornerRadius="10"
pu:ProgressBarHelper.GeneratingPercentText="PgbStrength_GeneratingPercentText"
pu:ProgressBarHelper.IsPercentVisible="True"
FontSize="20"
Foreground="{DynamicResource ProgressBarForeground}"
Maximum="100"
Value="40" />
<TextBlock
x:Name="tStrength"
Grid.Row="4"
Grid.Column="4"
HorizontalAlignment="Right"
Foreground="{DynamicResource DARKPrimary}"
Text="+1/t" />
<TextBlock
Grid.Row="5"
VerticalAlignment="Center"
Text="{ll:Str 心情}" />
<ProgressBar
x:Name="pFeeling"
Grid.Row="5"
Grid.Column="2"
Height="20"
VerticalAlignment="Center"
pu:ProgressBarHelper.IsPercentVisible="True" FontSize="20"
Foreground="{DynamicResource ProgressBarForeground}" Maximum="100" Value="40" />
<TextBlock x:Name="tStrength" Grid.Row="4" Grid.Column="4" HorizontalAlignment="Right"
Foreground="{DynamicResource DARKPrimary}" Text="+1/t" />
<TextBlock Grid.Row="5" VerticalAlignment="Center" Text="{ll:Str 心情}" />
<ProgressBar x:Name="pFeeling" Grid.Row="5" Grid.Column="2" Height="20" VerticalAlignment="Center"
pu:ProgressBarHelper.CornerRadius="10"
pu:ProgressBarHelper.GeneratingPercentText="PgbSpirit_GeneratingPercentText"
pu:ProgressBarHelper.IsPercentVisible="True"
FontSize="20"
Foreground="{DynamicResource ProgressBarForeground}"
Maximum="100"
Value="60" />
<TextBlock
x:Name="tFeeling"
Grid.Row="5"
Grid.Column="4"
HorizontalAlignment="Right"
Foreground="{DynamicResource DARKPrimary}"
Text="+1/t" />
<TextBlock
Grid.Row="6"
VerticalAlignment="Center"
Text="{ll:Str 饱腹度}" />
<ProgressBar
x:Name="pStrengthFoodMax"
Grid.Row="6"
Grid.Column="2"
Height="20"
VerticalAlignment="Center"
pu:ProgressBarHelper.CornerRadius="10"
Background="#FFDDDDDD"
FontSize="20"
Foreground="{DynamicResource ProgressBarForeground}"
Maximum="100"
Opacity="0.5"
pu:ProgressBarHelper.IsPercentVisible="True" FontSize="20"
Foreground="{DynamicResource ProgressBarForeground}" Maximum="100" Value="60" />
<TextBlock x:Name="tFeeling" Grid.Row="5" Grid.Column="4" HorizontalAlignment="Right"
Foreground="{DynamicResource DARKPrimary}" Text="+1/t" />
<TextBlock Grid.Row="6" VerticalAlignment="Center" Text="{ll:Str 饱腹度}" />
<ProgressBar x:Name="pStrengthFoodMax" Grid.Row="6" Grid.Column="2" Height="20"
VerticalAlignment="Center" pu:ProgressBarHelper.CornerRadius="10" Background="#FFDDDDDD"
FontSize="20" Foreground="{DynamicResource ProgressBarForeground}" Maximum="100" Opacity="0.5"
Value="90" />
<ProgressBar
x:Name="pStrengthFood"
Grid.Row="6"
Grid.Column="2"
Height="20"
VerticalAlignment="Center"
<ProgressBar x:Name="pStrengthFood" Grid.Row="6" Grid.Column="2" Height="20" VerticalAlignment="Center"
pu:ProgressBarHelper.CornerRadius="10"
pu:ProgressBarHelper.GeneratingPercentText="PgbHunger_GeneratingPercentText"
pu:ProgressBarHelper.IsPercentVisible="True"
Background="{x:Null}"
FontSize="20"
Foreground="{DynamicResource ProgressBarForeground}"
Maximum="100"
Value="80" />
pu:ProgressBarHelper.IsPercentVisible="True" Background="{x:Null}" FontSize="20"
Foreground="{DynamicResource ProgressBarForeground}" Maximum="100" Value="80" />
<TextBlock
x:Name="tStrengthFood"
Grid.Row="6"
Grid.Column="4"
HorizontalAlignment="Right"
Foreground="{DynamicResource DARKPrimary}"
Text="+1/t" />
<TextBlock
Grid.Row="7"
VerticalAlignment="Center"
Text="{ll:Str 口渴度}" />
<ProgressBar
x:Name="pStrengthDrinkMax"
Grid.Row="7"
Grid.Column="2"
Height="20"
VerticalAlignment="Center"
pu:ProgressBarHelper.CornerRadius="10"
Background="#FFDDDDDD"
FontSize="20"
Foreground="{DynamicResource ProgressBarForeground}"
Maximum="100"
Opacity="0.5"
<TextBlock x:Name="tStrengthFood" Grid.Row="6" Grid.Column="4" HorizontalAlignment="Right"
Foreground="{DynamicResource DARKPrimary}" Text="+1/t" />
<TextBlock Grid.Row="7" VerticalAlignment="Center" Text="{ll:Str 口渴度}" />
<ProgressBar x:Name="pStrengthDrinkMax" Grid.Row="7" Grid.Column="2" Height="20"
VerticalAlignment="Center" pu:ProgressBarHelper.CornerRadius="10" Background="#FFDDDDDD"
FontSize="20" Foreground="{DynamicResource ProgressBarForeground}" Maximum="100" Opacity="0.5"
Value="90" />
<ProgressBar
x:Name="pStrengthDrink"
Grid.Row="7"
Grid.Column="2"
Height="20"
VerticalAlignment="Center"
<ProgressBar x:Name="pStrengthDrink" Grid.Row="7" Grid.Column="2" Height="20" VerticalAlignment="Center"
pu:ProgressBarHelper.CornerRadius="10"
pu:ProgressBarHelper.GeneratingPercentText="PgbThirsty_GeneratingPercentText"
pu:ProgressBarHelper.IsPercentVisible="True"
Background="{x:Null}"
FontSize="20"
Foreground="{DynamicResource ProgressBarForeground}"
Maximum="100"
Value="20" />
<TextBlock
x:Name="tStrengthDrink"
Grid.Row="7"
Grid.Column="4"
HorizontalAlignment="Right"
Foreground="{DynamicResource DARKPrimary}"
Text="+1/t" />
pu:ProgressBarHelper.IsPercentVisible="True" Background="{x:Null}" FontSize="20"
Foreground="{DynamicResource ProgressBarForeground}" Maximum="100" Value="20" />
<TextBlock x:Name="tStrengthDrink" Grid.Row="7" Grid.Column="4" HorizontalAlignment="Right"
Foreground="{DynamicResource DARKPrimary}" Text="+1/t" />
</Grid>
</Border>
<Menu
Width="500"
VerticalAlignment="Bottom"
pu:MenuHelper.SubmenuItemsHorizontalContentAlignment="Center"
<Menu Width="500" VerticalAlignment="Bottom" pu:MenuHelper.SubmenuItemsHorizontalContentAlignment="Center"
pu:MenuHelper.TopLevelItemsHorizontalContentAlignment="Center"
Style="{DynamicResource ToolBarMenuStyle}">
Style="{DynamicResource ToolBarMenuStyle}" ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
pu:DropDownHelper.MaxHeight="500" Height="60">
<Menu.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="5" />
</ItemsPanelTemplate>
</Menu.ItemsPanel>
<MenuItem
x:Name="MenuFeed"
Padding="0"
x:FieldModifier="public"
Header="{ll:Str 投喂}" />
<MenuItem
x:Name="MenuPanel"
Padding="0"
Header="{ll:Str 面板}"
MouseEnter="MenuPanel_MouseEnter"
<MenuItem x:Name="MenuFeed" Padding="0" x:FieldModifier="public" Header="{ll:Str 投喂}" />
<MenuItem x:Name="MenuPanel" Padding="0" Header="{ll:Str 面板}" MouseEnter="MenuPanel_MouseEnter"
MouseLeave="MenuPanel_MouseLeave" />
<MenuItem
x:Name="MenuInteract"
Width="99"
Padding="0"
Header="{ll:Str 互动}">
<MenuItem x:Name="MenuInteract" Width="99" Padding="0" Header="{ll:Str 互动}">
<MenuItem Click="Sleep_Click" Header="{ll:Str 睡觉}" />
<MenuItem x:Name="MenuStudy" Header="{ll:Str 学习}" />
<MenuItem x:Name="MenuPlay" Header="{ll:Str 玩耍}" />
<MenuItem x:Name="MenuWork" Header="{ll:Str 工作}" />
<MenuItem x:Name="MenuStudy" Header="{ll:Str 学习}" ScrollViewer.VerticalScrollBarVisibility="Auto"
pu:DropDownHelper.MaxHeight="100" />
<MenuItem x:Name="MenuPlay" Header="{ll:Str 玩耍}" ScrollViewer.VerticalScrollBarVisibility="Auto"
pu:DropDownHelper.MaxHeight="100" />
<MenuItem x:Name="MenuWork" Header="{ll:Str 工作}" ScrollViewer.VerticalScrollBarVisibility="Auto"
pu:DropDownHelper.MaxHeight="100" />
<!--<MenuItem Header="说话" IsEnabled="False" />-->
</MenuItem>
<MenuItem
x:Name="MenuDIY"
Padding="0"
x:FieldModifier="public"
Header="{ll:Str 自定}" />
<MenuItem
x:Name="MenuSetting"
Padding="0"
x:FieldModifier="public"
Header="{ll:Str 系统}">
<MenuItem
x:Name="MenuMODConfig"
x:FieldModifier="public"
Header="{ll:Str MOD设置}"
Visibility="Collapsed" />
<MenuItem x:Name="MenuDIY" Padding="0" x:FieldModifier="public" Header="{ll:Str 自定}" />
<MenuItem x:Name="MenuSetting" Padding="0" x:FieldModifier="public" Header="{ll:Str 系统}">
<MenuItem x:Name="MenuMODConfig" x:FieldModifier="public" Header="{ll:Str MOD设置}" Visibility="Collapsed" />
</MenuItem>
</Menu>
</Grid>

View File

@ -344,7 +344,8 @@
<Run FontSize="18" FontWeight="Bold" Text="{ll:Str 游戏操作}" />
</TextBlock>
<Button Grid.Row="1" Grid.Column="2" Margin="4" Padding="1" pu:ButtonHelper.CornerRadius="4"
Background="{DynamicResource SecondaryLight}" Click="save_click" Content="{ll:Str 保存游戏}" ToolTip="{ll:Str '手动保存桌宠存档,就算不手动保存,桌宠也会在退出的时候自动保存'}" />
Background="{DynamicResource SecondaryLight}" Click="save_click" Content="{ll:Str 保存游戏}"
ToolTip="{ll:Str '手动保存桌宠存档,就算不手动保存,桌宠也会在退出的时候自动保存'}" />
<Button Grid.Row="1" Grid.Column="2" Margin="4" Padding="1" pu:ButtonHelper.CornerRadius="4"
Background="{DynamicResource SecondaryLight}" Click="cleancache_click"
Content="{ll:Str 清理缓存}" ToolTip="{ll:Str '清理缓存的动画,声音文件'}" />
@ -815,7 +816,7 @@
</Hyperlink>
<Run />
<Hyperlink Click="LB_Click" Foreground="Black" TextDecorations="Underline">
LBGame
洛里斯杨远
</Hyperlink>
<LineBreak /><LineBreak /> <Run Text="{ll:Str '相关链接'}" />
<Run xml:space="preserve"> </Run>

View File

@ -657,7 +657,7 @@ namespace VPet_Simulator.Windows
private void LB_Click(object sender, RoutedEventArgs e)
{
ExtensionSetting.StartURL("https://www.exlb.net/VPet");
ExtensionSetting.StartURL("https://space.bilibili.com/609610777");
}
private void VPET_Click(object sender, RoutedEventArgs e)
@ -672,7 +672,7 @@ namespace VPet_Simulator.Windows
private void Group_Click(object sender, RoutedEventArgs e)
{
if (LocalizeCore.CurrentCulture.StartsWith("zh"))
ExtensionSetting.StartURL("https://tieba.baidu.com/f?kw=%E8%99%9A%E6%8B%9F%E4%B8%BB%E6%92%AD%E6%A8%A1%E6%8B%9F%E5%99%A8");
ExtensionSetting.StartURL("https://space.bilibili.com/690425399");
else
ExtensionSetting.StartURL("https://github.com/LorisYounger/VPet");
}

View File

@ -152,7 +152,7 @@ UI&程序#UI&程序:|
项目页面#项目页面:|
相关链接#相关链接:|
虚拟主播模拟器#虚拟主播模拟器:|
相关群#相关群:|
相关群#桌宠官方号:|
用户名#用户名:|
版本#版本:|
激活#激活:|

View File

@ -152,7 +152,7 @@ UI&程序#UI&程式:|
项目页面#項目頁面:|
相关链接#相關連結:|
虚拟主播模拟器#虛擬主播模擬器:|
相关群#相關群:|
相关群#桌寵官方號:|
用户名#用戶名:|
版本#版本:|
激活#啟動:|