更新UI和说话支持

This commit is contained in:
ZouJin 2023-01-11 21:10:18 +08:00
parent dac5f72570
commit 279c15e34c
13 changed files with 288 additions and 180 deletions

View File

@ -28,7 +28,11 @@ namespace VPet_Simulator.Core
/// <summary>
/// 菜单栏
/// </summary>
public ToolBar Bar;
public ToolBar ToolBar;
/// <summary>
/// 菜单栏
/// </summary>
public MessageBar MsgBar;
/// <summary>
/// 刷新时间时会调用该方法
/// </summary>
@ -42,9 +46,12 @@ namespace VPet_Simulator.Core
InitializeComponent();
Core = core;
Bar = new ToolBar(this);
Bar.Visibility = Visibility.Collapsed;
UIGrid.Children.Add(Bar);
ToolBar = new ToolBar(this);
ToolBar.Visibility = Visibility.Collapsed;
UIGrid.Children.Add(ToolBar);
MsgBar = new MessageBar();
MsgBar.Visibility = Visibility.Collapsed;
UIGrid.Children.Add(MsgBar);
//TODO:锚定设置
Core.TouchEvent.Add(new TouchArea(new Point(138, 12), new Size(224, 176), DisplayTouchHead));
Core.TouchEvent.Add(new TouchArea(new Point(0, 0), new Size(500, 180), DisplayRaised, true));
@ -55,7 +62,10 @@ namespace VPet_Simulator.Core
EventTimer.Elapsed += EventTimer_Elapsed;
MoveTimer.Elapsed += MoveTimer_Elapsed;
}
public void Say(string text)
{
MsgBar.Show(Core.Save.Name, text);
}
private void MoveTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
Core.Controller.MoveWindows(MoveTimerPoint.X, MoveTimerPoint.Y);
@ -87,7 +97,7 @@ namespace VPet_Simulator.Core
if (act != null)
Dispatcher.Invoke(act.DoAction);
else
Dispatcher.Invoke(Bar.Show);
Dispatcher.Invoke(ToolBar.Show);
}
});
}

View File

@ -27,6 +27,7 @@ namespace VPet_Simulator.Core
TimeHandle?.Invoke(this);
//TODO:饮食等乱七八糟的消耗
//UIHandle
Dispatcher.Invoke(() => TimeUIHandle.Invoke(this));

View File

@ -4,16 +4,19 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:VPet_Simulator.Core" mc:Ignorable="d" Height="500"
Width="500">
Width="500" MouseDoubleClick="UserControl_MouseDoubleClick">
<UserControl.Resources>
<ResourceDictionary Source="Theme.xaml" />
</UserControl.Resources>
<Border Background="{DynamicResource Primary}" BorderBrush="{DynamicResource DARKPrimaryDark}" BorderThickness="5"
VerticalAlignment="Bottom" Padding="10" Margin="5" CornerRadius="5">
VerticalAlignment="Bottom" Padding="10" Margin="5" CornerRadius="5" MouseEnter="Border_MouseEnter"
MouseLeave="Border_MouseLeave">
<StackPanel>
<Label Content="虚拟桌宠名字:" Foreground="{DynamicResource PrimaryText}" HorizontalAlignment="Left" Padding="0"
FontWeight="Bold" Margin="0,0,0,6" FontSize="22" Background="{x:Null}" />
<TextBlock Text="我说话长这样,这是我说的话巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉" TextWrapping="WrapWithOverflow" FontSize="16" />
<Label x:Name="LName" Content="虚拟桌宠名字:" Foreground="{DynamicResource PrimaryText}" HorizontalAlignment="Left" Padding="0"
FontWeight="Bold" Margin="0,0,0,6" FontSize="32"
Background="{x:Null}" />
<TextBlock x:Name="TText" Text="我说话长这样,这是我说的话巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉" TextWrapping="WrapWithOverflow"
FontSize="24" />
</StackPanel>
</Border>
</UserControl>

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
@ -23,6 +24,38 @@ namespace VPet_Simulator.Core
public MessageBar()
{
InitializeComponent();
ShowTimer.Elapsed += ShowTimer_Elapsed;
}
private void ShowTimer_Elapsed(object sender, ElapsedEventArgs e)
{
Dispatcher.Invoke(() => this.Visibility = Visibility.Collapsed);
}
public Timer ShowTimer = new Timer();
public void Show(string name, string text)
{
TText.Text = text;
LName.Content = name;
ShowTimer.Interval = text.Length * 200 + 1000;
ShowTimer.Start();
this.Visibility = Visibility.Visible;
}
private void Border_MouseEnter(object sender, MouseEventArgs e)
{
ShowTimer.Stop();
}
private void Border_MouseLeave(object sender, MouseEventArgs e)
{
ShowTimer.Start();
}
private void UserControl_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
ShowTimer.Stop();
this.Visibility = Visibility.Collapsed;
}
}
}

View File

@ -1,40 +1,146 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="Primary" Color="#FF81d4fa" />
<SolidColorBrush x:Key="PrimaryTrans" Color="#DD81d4fa" />
<SolidColorBrush x:Key="PrimaryTrans4" Color="#4481d4fa" />
<SolidColorBrush x:Key="PrimaryTransA" Color="#AA81d4fa" />
<SolidColorBrush x:Key="PrimaryTransE" Color="#EE81d4fa" />
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI"
xmlns:pucore="clr-namespace:Panuon.WPF;assembly=Panuon.WPF">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="Primary" Color="#FF81d4fa" />
<SolidColorBrush x:Key="PrimaryTrans" Color="#DD81d4fa" />
<SolidColorBrush x:Key="PrimaryTrans4" Color="#4481d4fa" />
<SolidColorBrush x:Key="PrimaryTransA" Color="#AA81d4fa" />
<SolidColorBrush x:Key="PrimaryTransE" Color="#EE81d4fa" />
<SolidColorBrush x:Key="PrimaryLight" Color="#FFA3E2FF" />
<SolidColorBrush x:Key="PrimaryLighter" Color="#FFC1EBFF" />
<SolidColorBrush x:Key="PrimaryDark" Color="#FF5CBEEA" />
<SolidColorBrush x:Key="PrimaryDarker" Color="#FF3CA9DB" />
<SolidColorBrush x:Key="PrimaryText" Color="#FF000000" />
<SolidColorBrush x:Key="PrimaryLight" Color="#FFA3E2FF" />
<SolidColorBrush x:Key="PrimaryLighter" Color="#FFC1EBFF" />
<SolidColorBrush x:Key="PrimaryDark" Color="#FF5CBEEA" />
<SolidColorBrush x:Key="PrimaryDarker" Color="#FF3CA9DB" />
<SolidColorBrush x:Key="PrimaryText" Color="#FF000000" />
<SolidColorBrush x:Key="Secondary" Color="#FF90caf9" />
<SolidColorBrush x:Key="SecondaryTrans" Color="#DD90caf9" />
<SolidColorBrush x:Key="SecondaryTrans4" Color="#4490caf9" />
<SolidColorBrush x:Key="SecondaryTransA" Color="#AA90caf9" />
<SolidColorBrush x:Key="SecondaryTransE" Color="#EE90caf9" />
<SolidColorBrush x:Key="Secondary" Color="#FF90caf9" />
<SolidColorBrush x:Key="SecondaryTrans" Color="#DD90caf9" />
<SolidColorBrush x:Key="SecondaryTrans4" Color="#4490caf9" />
<SolidColorBrush x:Key="SecondaryTransA" Color="#AA90caf9" />
<SolidColorBrush x:Key="SecondaryTransE" Color="#EE90caf9" />
<SolidColorBrush x:Key="SecondaryLight" Color="#FFADD7F9" />
<SolidColorBrush x:Key="SecondaryLighter" Color="#FFCBE4F9" />
<SolidColorBrush x:Key="SecondaryDark" Color="#FF6BB1E9" />
<SolidColorBrush x:Key="SecondaryDarker" Color="#FF4999DA" />
<SolidColorBrush x:Key="SecondaryText" Color="#FF000000" />
<SolidColorBrush x:Key="SecondaryLight" Color="#FFADD7F9" />
<SolidColorBrush x:Key="SecondaryLighter" Color="#FFCBE4F9" />
<SolidColorBrush x:Key="SecondaryDark" Color="#FF6BB1E9" />
<SolidColorBrush x:Key="SecondaryDarker" Color="#FF4999DA" />
<SolidColorBrush x:Key="SecondaryText" Color="#FF000000" />
<SolidColorBrush x:Key="DARKPrimary" Color="#FF039be5" />
<SolidColorBrush x:Key="DARKPrimaryTrans" Color="#DD039be5" />
<SolidColorBrush x:Key="DARKPrimaryTrans4" Color="#44039be5" />
<SolidColorBrush x:Key="DARKPrimaryTransA" Color="#AA039be5" />
<SolidColorBrush x:Key="DARKPrimaryTransE" Color="#EE039be5" />
<SolidColorBrush x:Key="DARKPrimary" Color="#FF039be5" />
<SolidColorBrush x:Key="DARKPrimaryTrans" Color="#DD039be5" />
<SolidColorBrush x:Key="DARKPrimaryTrans4" Color="#44039be5" />
<SolidColorBrush x:Key="DARKPrimaryTransA" Color="#AA039be5" />
<SolidColorBrush x:Key="DARKPrimaryTransE" Color="#EE039be5" />
<SolidColorBrush x:Key="DARKPrimaryLight" Color="#FF1FA9EC" />
<SolidColorBrush x:Key="DARKPrimaryLighter" Color="#FF3DB8F4" />
<SolidColorBrush x:Key="DARKPrimaryDark" Color="#FF0290D5" />
<SolidColorBrush x:Key="DARKPrimaryDarker" Color="#FF0286C6" />
<SolidColorBrush x:Key="DARKPrimaryText" Color="#FFffffff" />
<SolidColorBrush x:Key="DARKPrimaryLight" Color="#FF1FA9EC" />
<SolidColorBrush x:Key="DARKPrimaryLighter" Color="#FF3DB8F4" />
<SolidColorBrush x:Key="DARKPrimaryDark" Color="#FF0290D5" />
<SolidColorBrush x:Key="DARKPrimaryDarker" Color="#FF0286C6" />
<SolidColorBrush x:Key="DARKPrimaryText" Color="#FFffffff" />
<Color x:Key="ShadowColor">#90caf9</Color>
<Color x:Key="ShadowColor">#90caf9</Color>
</ResourceDictionary>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DrawingBrush x:Key="ProgressBarForeground" Viewport="0,0,8,22" ViewportUnits="Absolute" Stretch="None"
TileMode="Tile">
<DrawingBrush.RelativeTransform>
<RotateTransform Angle="2" />
</DrawingBrush.RelativeTransform>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="{DynamicResource DARKPrimaryTransA}">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="5.5,0,2.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="{DynamicResource DARKPrimary}">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,5.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="SuccessProgressBarForeground" Viewport="0,0,8,22" ViewportUnits="Absolute"
Stretch="None" TileMode="Tile">
<DrawingBrush.RelativeTransform>
<RotateTransform Angle="2" />
</DrawingBrush.RelativeTransform>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#AAAACC6C">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="5.5,0,2.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#AACC6C">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,5.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="WarningProgressBarForeground" Viewport="0,0,8,22" ViewportUnits="Absolute"
Stretch="None" TileMode="Tile">
<DrawingBrush.RelativeTransform>
<RotateTransform Angle="2" />
</DrawingBrush.RelativeTransform>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#AAFFCC4C">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="5.5,0,2.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#FFCC4C">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,5.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="DangerProgressBarForeground" Viewport="0,0,8,22" ViewportUnits="Absolute"
Stretch="None" TileMode="Tile">
<DrawingBrush.RelativeTransform>
<RotateTransform Angle="2" />
</DrawingBrush.RelativeTransform>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#AAFF4C4C">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="5.5,0,2.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#FF4C4C">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,5.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@ -8,9 +8,10 @@
<ResourceDictionary Source="Theme.xaml" />
</UserControl.Resources>
<Grid>
<Border x:Name="BdrPanel" VerticalAlignment="Bottom" Margin="0,0,0,55" TextBlock.FontSize="24" Visibility="Collapsed"
TextElement.FontSize="24" BorderBrush="{DynamicResource DARKPrimaryDarker}" BorderThickness="1"
Background="{DynamicResource DARKPrimaryText}" CornerRadius="5" MouseLeave="MenuPanel_MouseLeave">
<Border x:Name="BdrPanel" VerticalAlignment="Bottom" Margin="0,0,0,55" TextBlock.FontSize="24"
Visibility="Collapsed" TextElement.FontSize="24" BorderBrush="{DynamicResource DARKPrimaryDarker}"
BorderThickness="1" Background="{DynamicResource DARKPrimaryText}" CornerRadius="5"
MouseLeave="MenuPanel_MouseLeave">
<Grid Margin="15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@ -93,15 +94,21 @@
<UniformGrid Columns="5" />
</ItemsPanelTemplate>
</Menu.ItemsPanel>
<MenuItem x:Name="MenuFeed" Header="投喂">
<MenuItem Header="食物" />
<MenuItem Header="饮料" />
<MenuItem Header="药品" />
<MenuItem x:Name="MenuFeed" Header="投喂" HorizontalContentAlignment="Center">
<MenuItem Header="食物" HorizontalContentAlignment="Center" />
<MenuItem Header="饮料" HorizontalContentAlignment="Center" />
<MenuItem Header="药品" HorizontalContentAlignment="Center" />
</MenuItem>
<MenuItem x:Name="MenuPanel" Header="面板" MouseEnter="MenuPanel_MouseEnter" MouseLeave="MenuPanel_MouseLeave" />
<MenuItem Header="打工" />
<MenuItem Header="睡觉" />
<MenuItem Header="设置" Click="MenuSetting_Click" />
<MenuItem x:Name="MenuPanel" Header="面板" MouseEnter="MenuPanel_MouseEnter" MouseLeave="MenuPanel_MouseLeave"
HorizontalContentAlignment="Center" />
<MenuItem x:Name="MenuInteract" Header="互动" HorizontalContentAlignment="Center">
<MenuItem Header="睡觉" HorizontalContentAlignment="Center" />
<MenuItem Header="玩耍" HorizontalContentAlignment="Center" />
<MenuItem Header="说话" HorizontalContentAlignment="Center" />
<MenuItem Header="学习" HorizontalContentAlignment="Center" />
</MenuItem>
<MenuItem x:Name="MenuDIY" Header="自定" HorizontalContentAlignment="Center" Click="MenuDIY_Click" />
<MenuItem Header="设置" Click="MenuSetting_Click" HorizontalContentAlignment="Center" />
</Menu>
</Grid>
</UserControl>

View File

@ -114,14 +114,32 @@ namespace VPet_Simulator.Core
{
m.Core.Controller.ShowPanel();
}
public void AddMenuButton(string parentMenu,
/// <summary>
/// 窗口类型
/// </summary>
public enum MenuType
{
/// <summary>
/// 投喂
/// </summary>
Feed,
/// <summary>
/// 互动
/// </summary>
Interact,
/// <summary>
/// 自定
/// </summary>
DIY,
}
public void AddMenuButton(MenuType parentMenu,
string displayName,
Action clickCallback)
{
var menuItem = new MenuItem()
{
Header = displayName,
HorizontalContentAlignment = HorizontalAlignment.Center
};
menuItem.Click += delegate
{
@ -129,9 +147,15 @@ namespace VPet_Simulator.Core
};
switch (parentMenu)
{
case "投喂":
case MenuType.Feed:
MenuFeed.Items.Add(menuItem);
break;
case MenuType.Interact:
MenuInteract.Items.Add(menuItem);
break;
case MenuType.DIY:
MenuDIY.Items.Add(menuItem);
break;
}
}
@ -196,5 +220,10 @@ namespace VPet_Simulator.Core
{
closePanelTimer.Start();
}
private void MenuDIY_Click(object sender, RoutedEventArgs e)
{
m.Say("private void MenuDIY_Click(object sender, RoutedEventArgs e)\r\n {\r\n m.Say(\"\");\r\n }");
}
}
}

View File

@ -35,14 +35,14 @@ namespace VPet_Simulator.Core
/// 获取桌宠距离下方的位置
/// </summary>
double GetWindowsDistanceDown();
/// <summary>
/// 窗体宽度
/// </summary>
double WindowsWidth { get; set; }
/// <summary>
/// 窗体高度
/// </summary>
double WindowsHight { get; set; }
///// <summary>
///// 窗体宽度
///// </summary>
//double WindowsWidth { get; set; }
///// <summary>
///// 窗体高度
///// </summary>
//double WindowsHight { get; set; }
/// <summary>
/// 缩放比例
/// </summary>

View File

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace VPet_Simulator.Core
{
@ -12,6 +13,11 @@ namespace VPet_Simulator.Core
/// </summary>
public class Save
{
/// <summary>
/// 宠物名字
/// </summary>
public string Name;
/// <summary>
/// 金钱
/// </summary>
@ -122,8 +128,9 @@ namespace VPet_Simulator.Core
/// <summary>
/// 新游戏
/// </summary>
public Save()
public Save(string name)
{
Name = name;
Money = 100;
Exp = 0;
Strength = 100;
@ -140,6 +147,7 @@ namespace VPet_Simulator.Core
public Save(Line line)
{
Money = line.GetFloat("money");
Name = line.Info;
Exp = line.GetInt("exp");
Strength = line.GetFloat("strength");
StrengthDrink = line.GetFloat("strengthdrink");
@ -155,7 +163,7 @@ namespace VPet_Simulator.Core
/// <returns>存档行</returns>
public Line ToLine()
{
Line save = new Line("vpet", "");
Line save = new Line("vpet", Name);
save.SetFloat("money", Money);
save.SetInt("exp", Exp);
save.SetFloat("strength", Strength);
@ -166,5 +174,27 @@ namespace VPet_Simulator.Core
save.SetFloat("Likability", Likability);
return save;
}
/// <summary>
/// 当前正在的状态
/// </summary>
public enum WorkingState
{
/// <summary>
/// 默认:啥都没干
/// </summary>
Nomal,
/// <summary>
/// 正在干活, workingobj指示正在干啥活
/// </summary>
Working,
/// <summary>
/// 学习中
/// </summary>
Studying,
/// <summary>
/// 玩耍中
/// </summary>
Playing,
}
}
}

View File

@ -6,114 +6,6 @@
<pucore:SharedResourceDictionary Source="/Panuon.WPF.UI;component/Control.xaml" />
</ResourceDictionary.MergedDictionaries>
<DrawingBrush x:Key="ProgressBarForeground"
Viewport="0,0,8,22"
ViewportUnits="Absolute"
Stretch="None"
TileMode="Tile">
<DrawingBrush.RelativeTransform>
<RotateTransform Angle="2" />
</DrawingBrush.RelativeTransform>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="{DynamicResource DARKPrimaryTransA}">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="5.5,0,2.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="{DynamicResource DARKPrimary}">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,5.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="SuccessProgressBarForeground"
Viewport="0,0,8,22"
ViewportUnits="Absolute"
Stretch="None"
TileMode="Tile">
<DrawingBrush.RelativeTransform>
<RotateTransform Angle="2" />
</DrawingBrush.RelativeTransform>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#AAAACC6C">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="5.5,0,2.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#AACC6C">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,5.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="WarningProgressBarForeground"
Viewport="0,0,8,22"
ViewportUnits="Absolute"
Stretch="None"
TileMode="Tile">
<DrawingBrush.RelativeTransform>
<RotateTransform Angle="2" />
</DrawingBrush.RelativeTransform>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#AAFFCC4C">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="5.5,0,2.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#FFCC4C">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,5.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="DangerProgressBarForeground"
Viewport="0,0,8,22"
ViewportUnits="Absolute"
Stretch="None"
TileMode="Tile">
<DrawingBrush.RelativeTransform>
<RotateTransform Angle="2" />
</DrawingBrush.RelativeTransform>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#AAFF4C4C">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="5.5,0,2.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#FF4C4C">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,5.5,22" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
<Style x:Key="BaseWindowXStyle"
TargetType="pu:WindowX">

View File

@ -18,9 +18,6 @@ namespace VPet_Simulator.Windows
this.mw = mw;
}
public double WindowsWidth { get => mw.Dispatcher.Invoke(() => mw.Width); set => mw.Dispatcher.Invoke(() => mw.Width = value); }
public double WindowsHight { get => mw.Dispatcher.Invoke(() => mw.Height); set => mw.Dispatcher.Invoke(() => mw.Height = value); }
public double GetWindowsDistanceDown()
{
return mw.Dispatcher.Invoke(() => System.Windows.SystemParameters.PrimaryScreenHeight - mw.Top - mw.Height);

View File

@ -101,7 +101,7 @@ namespace VPet_Simulator.Windows
Dispatcher.Invoke(new Action(() => LoadingText.Content = "尝试加载游戏内容"));
//加载游戏内容
Core.Controller = new MWController(this);
Core.Save = new Save();
Core.Save = new Save("莉莉丝");
Dispatcher.Invoke(new Action(() => {
Core.Graph = Pets[0].Graph;
LoadingText.Visibility = Visibility.Collapsed;

View File

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:VPet_Simulator.Windows"
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI"
mc:Ignorable="d"
d:DesignHeight="450"
d:DesignHeight="800"
d:DesignWidth="800"
Title="面板"
Width="400"