新增 摸身体动画

This commit is contained in:
ZouJin 2023-02-21 22:37:01 +11:00
parent c6a73e589e
commit 232850b535
33 changed files with 69 additions and 20 deletions

1
Tutorial.md Normal file
View File

@ -0,0 +1 @@
# 虚拟桌宠模拟器 使用教程

View File

@ -1,5 +1,5 @@
<UserControl x:Class="VPet_Simulator.Core.Main" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
<pu:ContentControlX x:Class="VPet_Simulator.Core.Main" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI"
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" d:DesignHeight="250" d:DesignWidth="250">
@ -13,4 +13,4 @@
</Grid>
</Grid>
</Viewbox>
</UserControl>
</pu:ContentControlX>

View File

@ -1,4 +1,5 @@
using System;
using Panuon.WPF.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -19,7 +20,7 @@ namespace VPet_Simulator.Core
/// <summary>
/// Main.xaml 的交互逻辑
/// </summary>
public partial class Main : UserControl, IDisposable
public partial class Main : ContentControlX, IDisposable
{
/// <summary>
/// 游戏核心
@ -200,7 +201,7 @@ namespace VPet_Simulator.Core
private DateTime wavespan;
private void MainGrid_MouseWave(object sender, MouseEventArgs e)
{
if ((DateTime.Now - wavespan).TotalSeconds > 5)
if ((DateTime.Now - wavespan).TotalSeconds > 2)
{
wavetimes = 0;
switchcount = 0;
@ -224,7 +225,7 @@ namespace VPet_Simulator.Core
}
else
{
if (waveleft != true)
if (wavetop != true)
wavetop = false;
else
{
@ -251,11 +252,11 @@ namespace VPet_Simulator.Core
if (wavetop == true)
{
DisplayTouchHead();
Console.WriteLine(wavetimes);
//Console.WriteLine(wavetimes);
}
else
{
DisplayTouchBody();
}
}
}

View File

@ -114,7 +114,35 @@ namespace VPet_Simulator.Core
Display(GraphCore.GraphType.Touch_Head_C_End, DisplayNomal
)));
}
/// <summary>
/// 显示摸身体情况
/// </summary>
public void DisplayTouchBody()
{
if (Core.Controller.EnableFunction && Core.Save.Strength <= DistanceMin)
{
Core.Save.StrengthChange(-1);
Core.Save.FeelingChange(1);
}
if (DisplayType == GraphType.Touch_Body_A_Start)
return;
if (DisplayType == GraphType.Touch_Body_B_Loop)
if (PetGrid.Child is IGraph ig && ig.GraphType == GraphCore.GraphType.Touch_Body_B_Loop)
{
ig.IsContinue = true;
return;
}
else if (PetGrid2.Child is IGraph ig2 && ig2.GraphType == GraphCore.GraphType.Touch_Body_B_Loop)
{
ig2.IsContinue = true;
return;
}
Display(GraphCore.GraphType.Touch_Body_A_Start, () =>
Display(GraphCore.GraphType.Touch_Body_B_Loop, () =>
Display(GraphCore.GraphType.Touch_Body_C_End, DisplayNomal
)));
}
/// <summary>
/// 显示待机(模式1)情况
/// </summary>

View File

@ -87,6 +87,18 @@ namespace VPet_Simulator.Core
/// </summary>
Touch_Head_C_End,
/// <summary>
/// 摸身体 (开始)
/// </summary>
Touch_Body_A_Start,
/// <summary>
/// 摸身体 (循环)
/// </summary>
Touch_Body_B_Loop,
/// <summary>
/// 摸身体 (结束)
/// </summary>
Touch_Body_C_End,
/// <summary>
/// 爬行向右 (开始)
/// </summary>
Crawl_Right_A_Start,

View File

@ -1,5 +1,4 @@
<pu:ContentControlX x:Class="VPet_Simulator.Core.PNGAnimation"
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI"
<Grid x:Class="VPet_Simulator.Core.PNGAnimation"
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"
@ -7,6 +6,4 @@
xmlns:local="clr-namespace:VPet_Simulator.Core"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="500">
<Grid x:Name="MainGrid">
</Grid>
</pu:ContentControlX>
</Grid>

View File

@ -25,7 +25,7 @@ namespace VPet_Simulator.Core
/// <summary>
/// PNGAnimation.xaml 的交互逻辑
/// </summary>
public partial class PNGAnimation : ContentControlX, IGraph
public partial class PNGAnimation : Grid, IGraph
{
/// <summary>
/// 所有动画帧
@ -90,7 +90,7 @@ namespace VPet_Simulator.Core
Width = 500 * (paths.Length + 1),
Height = 500
};
MainGrid.Children.Add(img);
Children.Add(img);
for (int i = 0; i < paths.Length; i++)
{
FileInfo file = paths[i];
@ -115,7 +115,7 @@ namespace VPet_Simulator.Core
Width = 500 * (paths.Length + 1),
Height = 500
};
MainGrid.Children.Add(img);
Children.Add(img);
for (int i = 0; i < paths.Length; i++)
{
FileInfo file = paths[i];

View File

@ -217,11 +217,16 @@ namespace VPet_Simulator.Windows
Main.Say("欢迎使用虚拟桌宠模拟器\n这是个早期的测试版,若有bug请多多包涵\n欢迎在菜单栏-管理-反馈中提交bug或建议");
});
}
else if (Set["SingleTips"].GetDateTime("update") <= new DateTime(2023, 2, 17))
else if (Set["SingleTips"].GetDateTime("update") <= new DateTime(2023, 2, 20))
{
if (Set["SingleTips"].GetDateTime("update") <= new DateTime(2023, 2, 17))
notifyIcon.ShowBalloonTip(10, "更新通知 02/17",
"现在使用缓存机制,不仅占用小,而且再也不会有那种闪闪的问题了!\n现已支持开机启动功能,前往设置设置开机启动", ToolTipIcon.Info);
else
notifyIcon.ShowBalloonTip(10, "更新通知 02/20",
"现已支通过抚摸(鼠标左右移动)进行摸头", ToolTipIcon.Info);
Set["SingleTips"].SetDateTime("update", DateTime.Now);
notifyIcon.ShowBalloonTip(10, "更新通知 02/17",
"现在使用缓存机制,不仅占用小,而且再也不会有那种闪闪的问题了!\n现已支持开机启动功能,前往设置设置开机启动", ToolTipIcon.Info);
}
}));
}

View File

@ -27,6 +27,7 @@
<ListBox x:Name="DisplayListBox" Margin="0,30,0,0" MouseDoubleClick="DisplayListBox_MouseDoubleClick">
<ListBoxItem Content="DisplayNomal" />
<ListBoxItem Content="DisplayTouchHead" />
<ListBoxItem Content="DisplayTouchBody" />
<ListBoxItem Content="DisplayBoring" />
<ListBoxItem Content="DisplaySquat" />
<ListBoxItem Content="DisplaySleep" />

View File

@ -77,6 +77,9 @@ namespace VPet_Simulator.Windows
case "DisplayTouchHead":
mw.Main.DisplayTouchHead();
break;
case "DisplayTouchBody":
mw.Main.DisplayTouchBody();
break;
case "DisplayBoring":
mw.Main.DisplayBoring();
break;
@ -137,6 +140,7 @@ namespace VPet_Simulator.Windows
case "DisplayIdel_StateTWO":
mw.Main.DisplayIdel_StateTWO();
break;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB