虚拟桌宠模拟器
127
README.md
@ -1,2 +1,127 @@
|
||||
# VPet
|
||||
# VPet-Simulator
|
||||
|
||||
虚拟桌宠模拟器 一个开源的桌宠软件, 可以内置到任何WPF应用程序
|
||||
|
||||
## 软件设计
|
||||
|
||||
* VPet-Simulator: 适用于桌面端的虚拟桌宠模拟器
|
||||
* MainWindows 主窗体,存放和展示Core
|
||||
* WinSetting.xaml 软件设置/MOD 窗口
|
||||
* MWController.cs 窗体控制器
|
||||
* VPet-Simulator.Core: 软件核心 方便内置到任何WPF应用程序(例如:VUP-Simulator)
|
||||
* Handle 接口与控件
|
||||
* IController 窗体控制器 (调用相关功能,例如移动到侧边等)
|
||||
* Function 通用功能
|
||||
* GameCore 游戏核心,包含各种数据等内容
|
||||
* Save 游戏存档等
|
||||
* Setting 游戏设置
|
||||
* Graph 图形渲染
|
||||
* IGraph 图形基本接口
|
||||
* IEyeTracking 眼部跟踪
|
||||
* PNGAnimation 桌宠动画组件
|
||||
* Picture 桌宠静态组件
|
||||
* Item 所有物品
|
||||
* Item 所有物品类
|
||||
* Food 可以吃的食物
|
||||
* Drink 可以喝的饮料
|
||||
* Display 显示
|
||||
* Main.xaml 核心显示部件
|
||||
* MainDisplay 核心显示方法
|
||||
* MainLogic 核心显示逻辑
|
||||
* ToolBar 点击人物时候的工具栏
|
||||
* MessageBar 人物说话时候的说话栏
|
||||
* Theme 主题
|
||||
|
||||
## 游戏设计
|
||||
|
||||
* 金钱 钱不是是万能的,没钱是万万不能的
|
||||
* 人物数据
|
||||
* 经验/等级
|
||||
* 盈利速度加成
|
||||
* 解锁更多对话等
|
||||
* 体力
|
||||
* 工作/摸头/学习 消耗体力
|
||||
* 自然百分比回复(在饱腹度>50%)
|
||||
* 睡觉回复(饱腹度>=25)
|
||||
* 饱腹度 固定上限100
|
||||
* 工作/学习 消耗饱腹度
|
||||
* 自然下降
|
||||
* 进食 回复
|
||||
* 心情 固定上限100
|
||||
* 工作/学习消耗
|
||||
* 摸头回复
|
||||
* 心情>=75时同时增加经验
|
||||
* 口渴度 固定上限100
|
||||
* 自然下降
|
||||
* 喝水回复
|
||||
* 低于 25 加生病条
|
||||
* 隐藏条:
|
||||
* 生病条:
|
||||
* 生病的概率
|
||||
* 心情<=25增加概率 心情>=75缓慢减少
|
||||
* 打工/学习增加固定百分比
|
||||
* 体力<=40 增加概率
|
||||
* 降低心情
|
||||
* 好感度
|
||||
* 心情<=25 降低+与心情同步减少
|
||||
* 心情>=90与心情同步增加
|
||||
* 人物互动
|
||||
* 摸头
|
||||
* 摸身子
|
||||
* 喂食
|
||||
* 喂水
|
||||
* 去打工
|
||||
* 去学习
|
||||
* 去睡觉
|
||||
* 玩耍
|
||||
* 人物隐藏互动
|
||||
* 被拉起 (切换位置)
|
||||
* 爬墙
|
||||
* 爬地板
|
||||
* 躲藏 (被发现加心情)
|
||||
|
||||
## 图像资源
|
||||
|
||||
图像资源可能需要拆分以至于支持动图
|
||||
|
||||
* 模式 (其他状态得制作符合该模式的表情/动作) 部分模式无特殊动作
|
||||
* 高兴 - 兴奋的表情/肢体动作
|
||||
* 普通 - 一般的表情/肢体动作
|
||||
* 状态不佳 - 情绪低落/肢体动作
|
||||
* 生病(躺床) - 单独做个生病躺床的拆分
|
||||
* IDEL 待机状态
|
||||
* 发呆 - (可以准备多个)
|
||||
* 盯着鼠标看 (需要拆分眼睛和眨眼等)
|
||||
* 等等 - 其他待机状态,例如不小心睡着等,或者换几个姿势(换姿势无生病)
|
||||
* 人物互动
|
||||
* 摸头 - 摸头,包含高兴和附魔的手 可以准备不同的动画和表情
|
||||
* 摸身子 - 嫌弃/害羞/弹问号/等
|
||||
* 喂食 - 吃掉食物动作和动画
|
||||
* 水果 ($15 生病条-2饱腹度+10)
|
||||
* 汉堡 ($20 饱腹度+40 生病条+1 口渴-10)
|
||||
* 沙拉 ($20 饱腹度+20 生病条-2)
|
||||
* 药丸
|
||||
* 更多
|
||||
* 喂水 - 喝水和更多动作和动画
|
||||
* 普通水
|
||||
* 矿泉水
|
||||
* 饮料
|
||||
* 药水
|
||||
* 更多
|
||||
* 去打工 (无生病)
|
||||
* 去当虚拟主播 (更高层次eg:高级设备) lv>=20
|
||||
* 去当虚拟主播 (符合游戏设定 普通设备) lv>=10
|
||||
* 去编写程序 lv>=5
|
||||
* 去当外聘客服 全通用
|
||||
* 去学习 (无生病)
|
||||
* 看书 (不同的颜色决定等级)
|
||||
* 去睡觉
|
||||
* 玩耍 (无生病)
|
||||
* 玩游戏机
|
||||
* 运动(打球等)
|
||||
* 小游戏(可以后续设计,例如井字棋等等)
|
||||
* 人物隐藏互动
|
||||
* 被拉起 (切换位置)(无生病,生病时使用状态不佳)
|
||||
* 爬墙 (无状态不佳/生病))
|
||||
* 爬地板 (无状态不佳/生病))
|
||||
* 躲藏 (被发现加心情 无状态不佳/生病)
|
16
VPet-Simulator.Core/Display/Main.xaml
Normal file
@ -0,0 +1,16 @@
|
||||
<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"
|
||||
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">
|
||||
<Viewbox>
|
||||
<Grid x:Name="MainGrid" Width="500" Height="500" MouseLeftButtonDown="MainGrid_MouseLeftButtonDown"
|
||||
MouseLeftButtonUp="MainGrid_MouseLeftButtonUp">
|
||||
<Border x:Name="PetGrid" VerticalAlignment="Bottom" />
|
||||
<Border x:Name="PetGrid2" VerticalAlignment="Bottom" />
|
||||
<Grid x:Name="UIGrid">
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</UserControl>
|
89
VPet-Simulator.Core/Display/Main.xaml.cs
Normal file
@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Main.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class Main : UserControl
|
||||
{
|
||||
public GameCore Core;
|
||||
public ToolBar Bar;
|
||||
public Main(GameCore core)
|
||||
{
|
||||
InitializeComponent();
|
||||
Core = core;
|
||||
|
||||
Bar = new ToolBar(this);
|
||||
UIGrid.Children.Add(Bar);
|
||||
Bar.Visibility = Visibility.Collapsed;
|
||||
|
||||
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));
|
||||
var ig = Core.Graph.FindGraph(GraphCore.GraphType.Default, Core.Save.Mode);
|
||||
PetGrid.Child = ig.This;
|
||||
ig.Run();
|
||||
|
||||
EventTimer.Elapsed += EventTimer_Elapsed;
|
||||
}
|
||||
bool isPress = false;
|
||||
private void MainGrid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
isPress = true;
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(Core.Setting.PressLength);
|
||||
Point mp = default;
|
||||
Dispatcher.BeginInvoke(new Action(() => mp = Mouse.GetPosition(MainGrid))).Wait();
|
||||
if (isPress)
|
||||
{//历遍长按事件
|
||||
var act = Core.TouchEvent.FirstOrDefault(x => x.IsPress == true && x.Touch(mp));
|
||||
if (act != null)
|
||||
Dispatcher.BeginInvoke(act.DoAction);
|
||||
}
|
||||
else
|
||||
{//历遍点击事件
|
||||
var act = Core.TouchEvent.FirstOrDefault(x => x.IsPress == false && x.Touch(mp));
|
||||
if (act != null)
|
||||
Dispatcher.Invoke(act.DoAction);
|
||||
else
|
||||
Dispatcher.Invoke(Bar.Show);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void MainGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
isPress = false;
|
||||
if(rasetype != -1)
|
||||
{
|
||||
MainGrid.MouseMove -= MainGrid_MouseMove;
|
||||
rasetype = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void MainGrid_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
var mp = e.GetPosition(MainGrid);
|
||||
var x = mp.X - 290;
|
||||
var y = mp.Y - 128;
|
||||
Core.Controller.MoveWindows(x, y);
|
||||
if (Math.Abs(x) + Math.Abs(y) > 10)
|
||||
rasetype = 0;
|
||||
}
|
||||
}
|
||||
}
|
142
VPet-Simulator.Core/Display/MainDisplay.cs
Normal file
@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
public partial class Main
|
||||
{
|
||||
/// <summary>
|
||||
/// 显示默认情况
|
||||
/// </summary>
|
||||
public void DisplayNomal()
|
||||
{
|
||||
IsNomal = true;
|
||||
Display(Core.Graph.FindGraph(GraphCore.GraphType.Default, Core.Save.Mode));
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示摸头情况
|
||||
/// </summary>
|
||||
public void DisplayTouchHead()
|
||||
{
|
||||
IsNomal = false;
|
||||
if (((IGraph)PetGrid.Child).GraphType == GraphCore.GraphType.Touch_Head_B_Loop)
|
||||
{
|
||||
((IGraph)PetGrid.Child).IsContinue = true;
|
||||
return;
|
||||
}
|
||||
Display(Core.Graph.FindGraph(GraphCore.GraphType.Touch_Head_A_Start, Core.Save.Mode), () =>
|
||||
Display(Core.Graph.FindGraph(GraphCore.GraphType.Touch_Head_B_Loop, Core.Save.Mode), () =>
|
||||
Display(Core.Graph.FindGraph(GraphCore.GraphType.Touch_Head_C_End, Core.Save.Mode), () =>
|
||||
Display(Core.Graph.FindGraph(GraphCore.GraphType.Default, Core.Save.Mode)
|
||||
))));
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示拖拽情况
|
||||
/// </summary>
|
||||
public void DisplayRaised()
|
||||
{
|
||||
IsNomal = false;
|
||||
//位置迁移: 254-128
|
||||
MainGrid.MouseMove += MainGrid_MouseMove;
|
||||
rasetype = 0;
|
||||
DisplayRaising();
|
||||
//if (((IGraph)PetGrid.Child).GraphType == GraphCore.GraphType.Touch_Head_B_Loop)
|
||||
//{
|
||||
// ((IGraph)PetGrid.Child).IsContinue = true;
|
||||
// return;
|
||||
//}
|
||||
//Display(Core.Graph.FindGraph(GraphCore.GraphType.Raised_Dynamic, Core.Save.Mode), () =>
|
||||
// Display(Core.Graph.FindGraph(GraphCore.GraphType.Touch_Head_B_Loop, Core.Save.Mode), () =>
|
||||
// Display(Core.Graph.FindGraph(GraphCore.GraphType.Touch_Head_C_End, Core.Save.Mode), () =>
|
||||
// Display(Core.Graph.FindGraph(GraphCore.GraphType.Default, Core.Save.Mode)
|
||||
//))));
|
||||
}
|
||||
int rasetype = -1;
|
||||
/// <summary>
|
||||
/// 显示拖拽中
|
||||
/// </summary>
|
||||
public void DisplayRaising()
|
||||
{
|
||||
switch (rasetype++)
|
||||
{
|
||||
case -1:
|
||||
DisplayFalled();
|
||||
rasetype = -2;
|
||||
return;
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
Display(Core.Graph.FindGraph(GraphCore.GraphType.Raised_Dynamic, Core.Save.Mode), DisplayRaising);
|
||||
return;
|
||||
case 3:
|
||||
Display(Core.Graph.FindGraph(GraphCore.GraphType.Raised_Static_A_Start, Core.Save.Mode), DisplayRaising);
|
||||
return;
|
||||
default:
|
||||
Display(Core.Graph.FindGraph(GraphCore.GraphType.Raised_Static_B_Loop, Core.Save.Mode), DisplayRaising);
|
||||
rasetype = 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 显示掉到地上
|
||||
/// </summary>
|
||||
public void DisplayFalled()
|
||||
{//TODO:爬起
|
||||
Display(Core.Graph.FindGraph(GraphCore.GraphType.Fall_B_End, Core.Save.Mode), DisplayNomal);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool petgridcrlf = true;
|
||||
/// <summary>
|
||||
/// 显示动画 (自动多层切换)
|
||||
/// </summary>
|
||||
/// <param name="graph">动画</param>
|
||||
/// <param name="EndAction">结束操作</param>
|
||||
public void Display(IGraph graph, Action EndAction = null)
|
||||
{
|
||||
if (PetGrid.Child == graph.This)
|
||||
{
|
||||
((IGraph)(PetGrid.Child)).Run(EndAction);
|
||||
return;
|
||||
}
|
||||
else if (PetGrid2.Child == graph.This)
|
||||
{
|
||||
((IGraph)(PetGrid2.Child)).Run(EndAction);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
graph.Run(EndAction);
|
||||
if (petgridcrlf)
|
||||
{
|
||||
((IGraph)(PetGrid.Child)).Stop(true);
|
||||
Dispatcher.Invoke(() => PetGrid2.Child = graph.This);
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(25);
|
||||
Dispatcher.Invoke(() => PetGrid.Child = null);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
((IGraph)(PetGrid2.Child)).Stop(true);
|
||||
Dispatcher.Invoke(() => PetGrid.Child = graph.This);
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(25);
|
||||
Dispatcher.Invoke(() => PetGrid2.Child = null);
|
||||
});
|
||||
}
|
||||
petgridcrlf = !petgridcrlf;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
30
VPet-Simulator.Core/Display/MainLogic.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
public partial class Main
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否在默认情况(playnoaml)
|
||||
/// </summary>
|
||||
public bool IsNomal = true;
|
||||
|
||||
public Timer EventTimer = new Timer(15000)
|
||||
{
|
||||
AutoReset = true,
|
||||
Enabled = true
|
||||
};
|
||||
private void EventTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
if (IsNomal)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
VPet-Simulator.Core/Display/MessageBar.xaml
Normal file
@ -0,0 +1,11 @@
|
||||
<UserControl x:Class="VPet_Simulator.Core.MessageBar"
|
||||
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:local="clr-namespace:VPet_Simulator.Core" mc:Ignorable="d" Height="500"
|
||||
Width="500">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
28
VPet-Simulator.Core/Display/MessageBar.xaml.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// MessageBar.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MessageBar : UserControl
|
||||
{
|
||||
public MessageBar()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
38
VPet-Simulator.Core/Display/Theme.xaml
Normal file
@ -0,0 +1,38 @@
|
||||
<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="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="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" />
|
||||
</ResourceDictionary>
|
53
VPet-Simulator.Core/Display/ToolBar.xaml
Normal file
@ -0,0 +1,53 @@
|
||||
<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: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" xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI"
|
||||
MouseEnter="UserControl_MouseEnter" MouseLeave="UserControl_MouseLeave">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="Theme.xaml" />
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<pu:ContentControlX BorderBrush="{DynamicResource DARKPrimaryDarker}"
|
||||
Background="{DynamicResource SecondaryLight}" BorderThickness="2" CornerRadius="5" Height="50"
|
||||
Width="500" VerticalAlignment="Bottom">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Background="Transparent" Content="投喂" FontSize="24" Foreground="{DynamicResource PrimaryText}"
|
||||
BorderBrush="Transparent" pu:ButtonHelper.HoverBackground="{DynamicResource Secondary}"
|
||||
/>
|
||||
<Button Background="Transparent" Content="面板" FontSize="24" Foreground="{DynamicResource PrimaryText}"
|
||||
BorderBrush="Transparent" pu:ButtonHelper.HoverBackground="{DynamicResource Secondary}"
|
||||
Grid.Column="4" />
|
||||
<Button Background="Transparent" Content="打工" FontSize="24" Foreground="{DynamicResource PrimaryText}"
|
||||
BorderBrush="Transparent" pu:ButtonHelper.HoverBackground="{DynamicResource Secondary}"
|
||||
Grid.Column="2" />
|
||||
<Button Background="Transparent" Content="睡觉" FontSize="24" Foreground="{DynamicResource PrimaryText}"
|
||||
BorderBrush="Transparent" pu:ButtonHelper.HoverBackground="{DynamicResource Secondary}"
|
||||
Grid.Column="6" />
|
||||
<Button Background="Transparent" Content="设置" FontSize="24" Foreground="{DynamicResource PrimaryText}"
|
||||
BorderBrush="Transparent" pu:ButtonHelper.HoverBackground="{DynamicResource Secondary}"
|
||||
Grid.Column="8" />
|
||||
<Rectangle Grid.Column="1" Width="2" Fill="{DynamicResource SecondaryDarker}"
|
||||
HorizontalAlignment="Center" Margin="0,6,0,6" />
|
||||
<Rectangle Grid.Column="3" Width="2" Fill="{DynamicResource SecondaryDarker}"
|
||||
HorizontalAlignment="Center" Margin="0,6,0,6" />
|
||||
<Rectangle Grid.Column="5" Width="2" Fill="{DynamicResource SecondaryDarker}"
|
||||
HorizontalAlignment="Center" Margin="0,6,0,6" />
|
||||
<Rectangle Grid.Column="7" Width="2" Fill="{DynamicResource SecondaryDarker}"
|
||||
HorizontalAlignment="Center" Margin="0,6,0,6" />
|
||||
|
||||
</Grid>
|
||||
</pu:ContentControlX>
|
||||
</Grid>
|
||||
</UserControl>
|
71
VPet-Simulator.Core/Display/ToolBar.xaml.cs
Normal file
@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Timers;
|
||||
using Timer = System.Timers.Timer;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// ToolBar.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ToolBar : UserControl
|
||||
{
|
||||
Main m;
|
||||
Timer closetimer;
|
||||
bool onFocus = false;
|
||||
public ToolBar(Main m)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.m = m;
|
||||
closetimer = new Timer()
|
||||
{
|
||||
Interval = 4000,
|
||||
AutoReset = false,
|
||||
Enabled = false
|
||||
};
|
||||
closetimer.Elapsed += Closetimer_Elapsed;
|
||||
}
|
||||
|
||||
private void Closetimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
if (onFocus)
|
||||
{
|
||||
onFocus = false;
|
||||
closetimer.Start();
|
||||
}
|
||||
else
|
||||
Dispatcher.Invoke(() => this.Visibility = Visibility.Collapsed);
|
||||
}
|
||||
|
||||
public void Show()
|
||||
{
|
||||
Visibility = Visibility.Visible;
|
||||
if (closetimer.Enabled)
|
||||
onFocus = true;
|
||||
else
|
||||
closetimer.Start();
|
||||
}
|
||||
|
||||
private void UserControl_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
closetimer.Stop();
|
||||
}
|
||||
|
||||
private void UserControl_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
closetimer.Start();
|
||||
}
|
||||
}
|
||||
}
|
178
VPet-Simulator.Core/Graph/GraphCore.cs
Normal file
@ -0,0 +1,178 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
public class GraphCore
|
||||
{
|
||||
/// <summary>
|
||||
/// 动画类型
|
||||
/// </summary>
|
||||
public enum GraphType
|
||||
{
|
||||
/// <summary>
|
||||
/// 被提起动态 (循环)
|
||||
/// </summary>
|
||||
Raised_Dynamic,
|
||||
/// <summary>
|
||||
/// 被提起静态 (开始)
|
||||
/// </summary>
|
||||
Raised_Static_A_Start,
|
||||
/// <summary>
|
||||
/// 被提起静态 (循环)
|
||||
/// </summary>
|
||||
Raised_Static_B_Loop,
|
||||
/// <summary>
|
||||
/// 从上向右爬 (循环)
|
||||
/// </summary>
|
||||
Climb_Top_Right,
|
||||
/// <summary>
|
||||
/// 从上向左爬 (循环)
|
||||
/// </summary>
|
||||
Climb_Top_Left,
|
||||
/// <summary>
|
||||
/// 从右边爬 (循环)
|
||||
/// </summary>
|
||||
Climb_Right,
|
||||
/// <summary>
|
||||
/// 从左边爬 (循环)
|
||||
/// </summary>
|
||||
Climb_Left,
|
||||
/// <summary>
|
||||
/// 呼吸 (循环)
|
||||
/// </summary>
|
||||
Default,
|
||||
/// <summary>
|
||||
/// 摸头 (开始)
|
||||
/// </summary>
|
||||
Touch_Head_A_Start,
|
||||
/// <summary>
|
||||
/// 摸头 (循环)
|
||||
/// </summary>
|
||||
Touch_Head_B_Loop,
|
||||
/// <summary>
|
||||
/// 摸头 (结束)
|
||||
/// </summary>
|
||||
Touch_Head_C_End,
|
||||
/// <summary>
|
||||
/// 爬行向右 (循环)
|
||||
/// </summary>
|
||||
Crawl_Right,
|
||||
/// <summary>
|
||||
/// 爬行向左 (循环)
|
||||
/// </summary>
|
||||
Crawl_Left,
|
||||
/// <summary>
|
||||
/// 下蹲 (开始)
|
||||
/// </summary>
|
||||
Squat_A_Start,
|
||||
/// <summary>
|
||||
/// 下蹲 (循环)
|
||||
/// </summary>
|
||||
Squat_B_Loop,
|
||||
/// <summary>
|
||||
/// 下蹲 (结束)
|
||||
/// </summary>
|
||||
Squat_C_End,
|
||||
/// <summary>
|
||||
/// 下落 (开始/循环)
|
||||
/// </summary>
|
||||
Fall_A_Loop,
|
||||
/// <summary>
|
||||
/// 下落 (结束)
|
||||
/// </summary>
|
||||
Fall_B_End,
|
||||
/// <summary>
|
||||
/// 走路向右 (开始)
|
||||
/// </summary>
|
||||
Walk_Right_A_Start,
|
||||
/// <summary>
|
||||
/// 走路向右 (循环)
|
||||
/// </summary>
|
||||
Walk_Right_B_Loop,
|
||||
/// <summary>
|
||||
/// 走路向右 (结束)
|
||||
/// </summary>
|
||||
Walk_Right_C_End,
|
||||
/// <summary>
|
||||
/// 走路向左 (开始)
|
||||
/// </summary>
|
||||
Walk_Left_A_Start,
|
||||
/// <summary>
|
||||
/// 走路向左 (循环)
|
||||
/// </summary>
|
||||
Walk_Left_B_Loop,
|
||||
/// <summary>
|
||||
/// 走路向左 (结束)
|
||||
/// </summary>
|
||||
Walk_Left_C_End,
|
||||
}
|
||||
/// <summary>
|
||||
/// 动画类型默认设置 前文本|是否循环|是否常用
|
||||
/// </summary>
|
||||
public static readonly dynamic[][] GraphTypeValue = new dynamic[][]
|
||||
{
|
||||
new dynamic[]{ "raised_dynamic" ,false,true},
|
||||
new dynamic[]{ "raised_static_a", false,true},
|
||||
new dynamic[]{ "raised_static_b", false,true},
|
||||
new dynamic[]{ "climb_top_right", true,false},
|
||||
new dynamic[]{ "climb_top_left", true,false},
|
||||
new dynamic[]{ "climb_right", true,false},
|
||||
new dynamic[]{ "climb_left", true,false},
|
||||
new dynamic[]{ "default", true,true},
|
||||
new dynamic[]{ "touch_head_a", false,true},
|
||||
new dynamic[]{ "touch_head_b", false,true},
|
||||
new dynamic[]{ "touch_head_c", false,true},
|
||||
new dynamic[]{ "crawl_right", true,true},
|
||||
new dynamic[]{ "crawl_left", true,true},
|
||||
new dynamic[]{ "squat_a", false,true},
|
||||
new dynamic[]{ "squat_b", false, true},
|
||||
new dynamic[]{ "squat_c", false,true},
|
||||
new dynamic[]{ "fall_a", true,false},
|
||||
new dynamic[]{ "fall_b", false,true},
|
||||
new dynamic[]{ "walk_right_a", false,true},
|
||||
new dynamic[]{ "walk_right_b", true,true},
|
||||
new dynamic[]{ "walk_right_c", false,true},
|
||||
new dynamic[]{ "walk_left_a", false,true},
|
||||
new dynamic[]{ "walk_left_b", true,true},
|
||||
new dynamic[]{ "walk_left_c", false,true},
|
||||
};
|
||||
/// <summary>
|
||||
/// 图像字典
|
||||
/// </summary>
|
||||
public Dictionary<GraphType, List<IGraph>> Graphs = new Dictionary<GraphType, List<IGraph>>();
|
||||
|
||||
/// <summary>
|
||||
/// 添加动画
|
||||
/// </summary>
|
||||
/// <param name="graph">动画</param>
|
||||
/// <param name="type">类型</param>
|
||||
public void AddGraph(IGraph graph, GraphType type)
|
||||
{
|
||||
if (!Graphs.ContainsKey(type))
|
||||
{
|
||||
Graphs.Add(type, new List<IGraph>());
|
||||
}
|
||||
Graphs[type].Add(graph);
|
||||
}
|
||||
public IGraph FindGraph(GraphType type, Save.ModeType mode)
|
||||
{
|
||||
if (Graphs.ContainsKey(type))
|
||||
{
|
||||
var list = Graphs[type].FindAll(x => x.ModeType == mode);
|
||||
if (list.Count > 0)
|
||||
{
|
||||
return list[Function.Rnd.Next(list.Count)];
|
||||
}
|
||||
else
|
||||
{
|
||||
return Graphs[type][Function.Rnd.Next(Graphs[type].Count)];
|
||||
}
|
||||
}
|
||||
return FindGraph(GraphType.Default, mode);
|
||||
}
|
||||
}
|
||||
}
|
12
VPet-Simulator.Core/Graph/IEyeTracking.xaml
Normal file
@ -0,0 +1,12 @@
|
||||
<UserControl x:Class="VPet_Simulator.Core.IEyeTracking"
|
||||
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:local="clr-namespace:VPet_Simulator.Core"
|
||||
mc:Ignorable="d"
|
||||
Height="500" Width="500">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
28
VPet-Simulator.Core/Graph/IEyeTracking.xaml.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// IEyeTracking.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class IEyeTracking : UserControl
|
||||
{
|
||||
public IEyeTracking()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
54
VPet-Simulator.Core/Graph/IGraph.cs
Normal file
@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using static VPet_Simulator.Core.GraphCore;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 动画显示接口
|
||||
/// </summary>
|
||||
public interface IGraph
|
||||
{
|
||||
/// <summary>
|
||||
/// 从0开始运行该动画
|
||||
/// </summary>
|
||||
void Run(Action EndAction = null);
|
||||
/// <summary>
|
||||
/// 当前动画播放状态
|
||||
/// </summary>
|
||||
bool PlayState { get; set; }
|
||||
/// <summary>
|
||||
/// 是否循环播放
|
||||
/// </summary>
|
||||
bool IsLoop { get; set; }
|
||||
/// <summary>
|
||||
/// 是否继续播放
|
||||
/// </summary>
|
||||
bool IsContinue { get; set; }
|
||||
/// <summary>
|
||||
/// 是否储存到内存以支持快速显示
|
||||
/// </summary>
|
||||
bool StoreMemory { get; }
|
||||
/// <summary>
|
||||
/// 该动画UI状态
|
||||
/// </summary>
|
||||
Save.ModeType ModeType { get;}
|
||||
/// <summary>
|
||||
/// 该动画UI状态
|
||||
/// </summary>
|
||||
GraphType GraphType { get; }
|
||||
/// <summary>
|
||||
/// 当前UI
|
||||
/// </summary>
|
||||
UIElement This { get; }
|
||||
/// <summary>
|
||||
/// 停止动画
|
||||
/// </summary>
|
||||
/// <param name="StopEndAction">停止动画时是否允许执行停止帧</param>
|
||||
void Stop(bool StopEndAction = false);
|
||||
}
|
||||
}
|
11
VPet-Simulator.Core/Graph/PNGAnimation.xaml
Normal file
@ -0,0 +1,11 @@
|
||||
<UserControl 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"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:VPet_Simulator.Core"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="500" d:DesignWidth="500">
|
||||
<Grid x:Name="MainGrid">
|
||||
</Grid>
|
||||
</UserControl>
|
235
VPet-Simulator.Core/Graph/PNGAnimation.xaml.cs
Normal file
@ -0,0 +1,235 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows;
|
||||
using static System.Net.WebRequestMethods;
|
||||
using System.Windows.Threading;
|
||||
using System.Threading;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// PNGAnimation.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PNGAnimation : UserControl, IGraph
|
||||
{
|
||||
/// <summary>
|
||||
/// 所有动画帧
|
||||
/// </summary>
|
||||
public List<Animation> Animations;
|
||||
/// <summary>
|
||||
/// 当前动画播放状态
|
||||
/// </summary>
|
||||
public bool PlayState { get; set; } = false;
|
||||
/// <summary>
|
||||
/// 当前动画是否执行ENDACTION
|
||||
/// </summary>
|
||||
private bool DoEndAction = true;
|
||||
/// <summary>
|
||||
/// 是否循环播放
|
||||
/// </summary>
|
||||
public bool IsLoop { get; set; }
|
||||
/// <summary>
|
||||
/// 是否循环播放
|
||||
/// </summary>
|
||||
public bool IsContinue { get; set; } = false;
|
||||
/// <summary>
|
||||
/// 是否储存到内存以支持快速显示
|
||||
/// </summary>
|
||||
public bool StoreMemory { get; private set; }
|
||||
public UIElement This => this;
|
||||
|
||||
public Save.ModeType ModeType { get; private set; }
|
||||
|
||||
public GraphCore.GraphType GraphType { get; private set; }
|
||||
|
||||
int nowid;
|
||||
/// <summary>
|
||||
/// 新建 PNG 动画
|
||||
/// </summary>
|
||||
/// <param name="path">文件夹位置</param>
|
||||
/// <param name="isLoop">是否循环</param>
|
||||
/// <param name="storemem">是否储存到内存以支持快速显示</param>
|
||||
public PNGAnimation(string path, Save.ModeType modetype, GraphCore.GraphType graphtype, bool isLoop = true, bool storemem = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
Animations = new List<Animation>();
|
||||
IsLoop = isLoop;
|
||||
StoreMemory = storemem;
|
||||
GraphType = graphtype;
|
||||
ModeType = modetype;
|
||||
if (storemem)
|
||||
foreach (var file in new DirectoryInfo(path).GetFiles())
|
||||
{
|
||||
int time = int.Parse(file.Name.Split('.').Reverse().ToArray()[1].Split('_').Last());
|
||||
var img = new Image()
|
||||
{
|
||||
Source = new BitmapImage(new Uri(file.FullName)),
|
||||
Visibility = Visibility.Hidden
|
||||
};
|
||||
MainGrid.Children.Add(img);
|
||||
Animations.Add(new Animation(this, time, () =>
|
||||
{
|
||||
img.Visibility = Visibility.Visible;
|
||||
}, () => img.Visibility = Visibility.Hidden));
|
||||
}
|
||||
else
|
||||
{
|
||||
Image[] imgs = new Image[3];
|
||||
imgs[0] = new Image()
|
||||
{
|
||||
Visibility = Visibility.Hidden
|
||||
};
|
||||
imgs[1] = new Image()
|
||||
{
|
||||
Visibility = Visibility.Hidden
|
||||
};
|
||||
imgs[2] = new Image()
|
||||
{
|
||||
Visibility = Visibility.Hidden
|
||||
};
|
||||
var fs = new DirectoryInfo(path).GetFiles();
|
||||
|
||||
int time = int.Parse(fs[0].Name.Split('.').Reverse().ToArray()[1].Split('_').Last());
|
||||
//第一张图:有专门自己的图层
|
||||
var img = new Image()
|
||||
{
|
||||
Source = new BitmapImage(new Uri(fs[0].FullName)),
|
||||
Visibility = Visibility.Hidden
|
||||
};
|
||||
MainGrid.Children.Add(img);
|
||||
MainGrid.Children.Add(imgs[0]);
|
||||
MainGrid.Children.Add(imgs[1]);
|
||||
MainGrid.Children.Add(imgs[2]);
|
||||
Animations.Add(new Animation(this, time, () =>
|
||||
{
|
||||
img.Visibility = Visibility.Visible;
|
||||
imgs[1].Source = new BitmapImage(new Uri(fs[1].FullName));
|
||||
}, () => img.Visibility = Visibility.Hidden));
|
||||
|
||||
int last = fs.Count() - 1;
|
||||
for (int i = 1; i < last; i++)
|
||||
{
|
||||
time = int.Parse(fs[i].Name.Split('.').Reverse().ToArray()[1].Split('_').Last());
|
||||
var im1 = imgs[i % 3];
|
||||
var im2 = imgs[(i + 1) % 3];
|
||||
var st3 = fs[i + 1].FullName;
|
||||
Animations.Add(new Animation(this, time, () =>
|
||||
{
|
||||
im1.Visibility = Visibility.Visible;
|
||||
im2.Source = new BitmapImage(new Uri(st3));
|
||||
}, () => im1.Visibility = Visibility.Hidden));
|
||||
}
|
||||
//最后一张图: 不处理下一张图的imgsSources
|
||||
|
||||
time = int.Parse(fs[last].Name.Split('.').Reverse().ToArray()[1].Split('_').Last());
|
||||
Animations.Add(new Animation(this, time, () => imgs[last % 3].Visibility = Visibility.Visible
|
||||
, () => imgs[last % 3].Visibility = Visibility.Hidden));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 单帧动画
|
||||
/// </summary>
|
||||
public class Animation
|
||||
{
|
||||
private PNGAnimation parent;
|
||||
/// <summary>
|
||||
/// 显示
|
||||
/// </summary>
|
||||
public Action Visible;
|
||||
/// <summary>
|
||||
/// 隐藏
|
||||
/// </summary>
|
||||
public Action Hidden;
|
||||
/// <summary>
|
||||
/// 帧时间
|
||||
/// </summary>
|
||||
public int Time;
|
||||
public Animation(PNGAnimation parent, int time, Action visible, Action hidden)
|
||||
{
|
||||
this.parent = parent;
|
||||
Time = time;
|
||||
Visible = visible;
|
||||
Hidden = hidden;
|
||||
}
|
||||
/// <summary>
|
||||
/// 运行该图层
|
||||
/// </summary>
|
||||
public void Run(Action EndAction = null)
|
||||
{
|
||||
//先显示该图层
|
||||
parent.Dispatcher.Invoke(Visible);
|
||||
//然后等待帧时间毫秒
|
||||
Thread.Sleep(Time);
|
||||
//判断是否要下一步
|
||||
if (parent.PlayState)
|
||||
{
|
||||
if (++parent.nowid >= parent.Animations.Count)
|
||||
if (parent.IsLoop)
|
||||
parent.nowid = 0;
|
||||
else if (parent.IsContinue)
|
||||
{
|
||||
parent.IsContinue = false;
|
||||
parent.nowid = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (parent.DoEndAction)
|
||||
EndAction?.Invoke();//运行结束动画时事件
|
||||
//重新加载第一帧
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(25);
|
||||
parent.Dispatcher.Invoke(Hidden);
|
||||
});
|
||||
return;
|
||||
}
|
||||
//要下一步,现在就隐藏图层
|
||||
//隐藏该图层
|
||||
parent.Dispatcher.Invoke(Hidden);
|
||||
parent.Animations[parent.nowid].Run(EndAction);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
parent.IsContinue = false;
|
||||
if (parent.DoEndAction)
|
||||
EndAction?.Invoke();//运行结束动画时事件
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(25);
|
||||
parent.Dispatcher.Invoke(Hidden);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 从0开始运行该动画
|
||||
/// </summary>
|
||||
public void Run(Action EndAction = null)
|
||||
{
|
||||
nowid = 0;
|
||||
PlayState = true;
|
||||
DoEndAction = true;
|
||||
new Thread(() => Animations[0].Run(EndAction)).Start();
|
||||
}
|
||||
|
||||
public void Stop(bool StopEndAction = false)
|
||||
{
|
||||
DoEndAction = !StopEndAction;
|
||||
PlayState = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
6
VPet-Simulator.Core/Graph/Picture.xaml
Normal file
@ -0,0 +1,6 @@
|
||||
<Image x:Class="VPet_Simulator.Core.Picture" 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:local="clr-namespace:VPet_Simulator.Core" mc:Ignorable="d" Height="500" Width="500">
|
||||
</Image>
|
75
VPet-Simulator.Core/Graph/Picture.xaml.cs
Normal file
@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Picture.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class Picture : Image, IGraph
|
||||
{
|
||||
/// <summary>
|
||||
/// 新建新静态图像
|
||||
/// </summary>
|
||||
/// <param name="path">图片路径</param>
|
||||
public Picture(string path, Save.ModeType modetype, int length = 1000, bool isloop = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
ModeType = modetype;
|
||||
IsLoop = isloop;
|
||||
Length = length;
|
||||
Source = new BitmapImage(new Uri(path));
|
||||
}
|
||||
public Save.ModeType ModeType { get; private set; }
|
||||
|
||||
public bool PlayState { get; set; }
|
||||
public bool IsLoop { get; set; }
|
||||
public int Length { get; set; }
|
||||
public bool StoreMemory => true;
|
||||
|
||||
public UIElement This => this;
|
||||
|
||||
public bool IsContinue { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
|
||||
public GraphCore.GraphType GraphType => throw new NotImplementedException();
|
||||
|
||||
public void Run(Action EndAction = null)
|
||||
{
|
||||
PlayState = true;
|
||||
StopEndAction = false;
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(Length);
|
||||
if (IsLoop && PlayState)
|
||||
{
|
||||
Run(EndAction);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayState = false;
|
||||
if (!StopEndAction)
|
||||
EndAction?.Invoke();//运行结束动画时事件
|
||||
}
|
||||
});
|
||||
}
|
||||
bool StopEndAction = false;
|
||||
public void Stop(bool StopEndAction = false)
|
||||
{
|
||||
PlayState = false;
|
||||
this.StopEndAction = StopEndAction;
|
||||
}
|
||||
}
|
||||
}
|
13
VPet-Simulator.Core/Handle/Function.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
public class Function
|
||||
{
|
||||
public static Random Rnd = new Random();
|
||||
}
|
||||
}
|
83
VPet-Simulator.Core/Handle/GameCore.cs
Normal file
@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 游戏使用资源
|
||||
/// </summary>
|
||||
public class GameCore
|
||||
{
|
||||
/// <summary>
|
||||
/// 控制器
|
||||
/// </summary>
|
||||
public IController Controller;
|
||||
/// <summary>
|
||||
/// 触摸范围和事件列表
|
||||
/// </summary>
|
||||
public List<TouchArea> TouchEvent = new List<TouchArea>();
|
||||
/// <summary>
|
||||
/// 游戏设置
|
||||
/// </summary>
|
||||
public Setting Setting;
|
||||
/// <summary>
|
||||
/// 图形核心
|
||||
/// </summary>
|
||||
public GraphCore Graph;
|
||||
/// <summary>
|
||||
/// 游戏数据
|
||||
/// </summary>
|
||||
public Save Save;
|
||||
}
|
||||
/// <summary>
|
||||
/// 触摸范围事件
|
||||
/// </summary>
|
||||
public class TouchArea
|
||||
{
|
||||
/// <summary>
|
||||
/// 位置
|
||||
/// </summary>
|
||||
public Point Locate;
|
||||
/// <summary>
|
||||
/// 大小
|
||||
/// </summary>
|
||||
public Size Size;
|
||||
/// <summary>
|
||||
/// 如果是触发的内容
|
||||
/// </summary>
|
||||
public Action DoAction;
|
||||
/// <summary>
|
||||
/// 否:立即触发/是:长按触发
|
||||
/// </summary>
|
||||
public bool IsPress;
|
||||
/// <summary>
|
||||
/// 创建个触摸范围事件
|
||||
/// </summary>
|
||||
/// <param name="locate">位置</param>
|
||||
/// <param name="size">大小</param>
|
||||
/// <param name="doAction">如果是触发的内容</param>
|
||||
/// <param name="isPress">否:立即触发/是:长按触发</param>
|
||||
public TouchArea(Point locate, Size size, Action doAction, bool isPress = false)
|
||||
{
|
||||
Locate = locate;
|
||||
Size = size;
|
||||
DoAction = doAction;
|
||||
IsPress = isPress;
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断是否成功触发该点击事件
|
||||
/// </summary>
|
||||
/// <param name="point">位置</param>
|
||||
/// <returns>是否成功</returns>
|
||||
public bool Touch(Point point)
|
||||
{
|
||||
double inx = point.X - Locate.X;
|
||||
double iny = point.Y - Locate.Y;
|
||||
return inx >= 0 && inx <= Size.Width && iny >= 0 && iny <= Size.Height;
|
||||
}
|
||||
}
|
||||
}
|
48
VPet-Simulator.Core/Handle/IController.cs
Normal file
@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 桌宠控制器
|
||||
/// </summary>
|
||||
public abstract class IController
|
||||
{
|
||||
/// <summary>
|
||||
/// 移动桌宠位置
|
||||
/// </summary>
|
||||
/// <param name="X">X轴</param>
|
||||
/// <param name="Y">Y轴</param>
|
||||
public abstract void MoveWindows(double X, double Y);
|
||||
|
||||
/// <summary>
|
||||
/// 获取桌宠距离左侧的位置
|
||||
/// </summary>
|
||||
public abstract double GetWindowsDistanceLeft();
|
||||
/// <summary>
|
||||
/// 获取桌宠距离右侧的位置
|
||||
/// </summary>
|
||||
public abstract double GetWindowsDistanceRight();
|
||||
/// <summary>
|
||||
/// 获取桌宠距离上方的位置
|
||||
/// </summary>
|
||||
public abstract double GetWindowsDistanceUp();
|
||||
/// <summary>
|
||||
/// 获取桌宠距离下方的位置
|
||||
/// </summary>
|
||||
public abstract double GetWindowsDistanceDown();
|
||||
/// <summary>
|
||||
/// 窗体宽度
|
||||
/// </summary>
|
||||
public abstract double WindowsWidth { get; set; }
|
||||
/// <summary>
|
||||
/// 窗体高度
|
||||
/// </summary>
|
||||
public abstract double WindowsHight { get; set; }
|
||||
|
||||
}
|
||||
}
|
170
VPet-Simulator.Core/Handle/Save.cs
Normal file
@ -0,0 +1,170 @@
|
||||
using LinePutScript;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 游戏存档
|
||||
/// </summary>
|
||||
public class Save
|
||||
{
|
||||
/// <summary>
|
||||
/// 金钱
|
||||
/// </summary>
|
||||
public double Money;
|
||||
/// <summary>
|
||||
/// 经验值
|
||||
/// </summary>
|
||||
public int Exp;
|
||||
/// <summary>
|
||||
/// 等级
|
||||
/// </summary>
|
||||
public int Level => (int)(Math.Sqrt(Exp) / 5) + 1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 升级所需经验值
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int LevelUpNeed() => (int)(Math.Pow((Level - 1) * 5, 2));
|
||||
/// <summary>
|
||||
/// 体力 0-100
|
||||
/// </summary>
|
||||
public double Strength { get => strength; set => strength = Math.Min(100, Math.Max(0, value)); }
|
||||
|
||||
private double strength;
|
||||
/// <summary>
|
||||
/// 饱腹度
|
||||
/// </summary>
|
||||
public double StrengthFood { get => strengthFood; set => strengthFood = Math.Min(100, Math.Max(0, value)); }
|
||||
|
||||
private double strengthFood;
|
||||
/// <summary>
|
||||
/// 口渴度
|
||||
/// </summary>
|
||||
public double StrengthDrink { get => strengthDrink; set => strengthDrink = Math.Min(100, Math.Max(0, value)); }
|
||||
|
||||
private double strengthDrink;
|
||||
/// <summary>
|
||||
/// 心情
|
||||
/// </summary>
|
||||
public double Feeling { get => feeling; set => feeling = Math.Min(100, Math.Max(0, value)); }
|
||||
|
||||
private double feeling;
|
||||
/// <summary>
|
||||
/// 健康(生病)(隐藏)
|
||||
/// </summary>
|
||||
public double Health { get => health; set => health = Math.Min(100, Math.Max(0, value)); }
|
||||
|
||||
private double health;
|
||||
/// <summary>
|
||||
/// 好感度(隐藏)(累加值)
|
||||
/// </summary>
|
||||
public double Likability { get => likability; set => likability = Math.Min(90 + Level * 10, Math.Max(0, value)); }
|
||||
|
||||
private double likability;
|
||||
/// <summary>
|
||||
/// 宠物状态模式
|
||||
/// </summary>
|
||||
public enum ModeType
|
||||
{
|
||||
/// <summary>
|
||||
/// 高兴
|
||||
/// </summary>
|
||||
Happy,
|
||||
/// <summary>
|
||||
/// 普通
|
||||
/// </summary>
|
||||
Nomal,
|
||||
/// <summary>
|
||||
/// 状态不佳
|
||||
/// </summary>
|
||||
PoorCondition,
|
||||
/// <summary>
|
||||
/// 生病(躺床)
|
||||
/// </summary>
|
||||
Ill
|
||||
}
|
||||
public ModeType Mode = ModeType.Nomal;
|
||||
/// <summary>
|
||||
/// 计算宠物当前状态
|
||||
/// </summary>
|
||||
public void CalMode()
|
||||
{
|
||||
int realhel = 60 - (Feeling >= 80 ? 20 : 0) - (Likability >= 80 ? 20 : (Likability >= 40 ? 10 : 0));
|
||||
//先从最次的开始
|
||||
if (Health <= realhel)
|
||||
{
|
||||
//可以确认从状态不佳和生病二选一
|
||||
if (Health <= realhel / 2)
|
||||
{//生病
|
||||
Mode = ModeType.Ill;
|
||||
}
|
||||
else
|
||||
{
|
||||
Mode = ModeType.PoorCondition;
|
||||
}
|
||||
}
|
||||
//然后判断是高兴还是普通
|
||||
else if (Feeling >= 80 - (Likability >= 80 ? 20 : (Likability >= 40 ? 10 : 0)))
|
||||
{
|
||||
Mode = ModeType.Happy;
|
||||
}
|
||||
else
|
||||
{
|
||||
Mode = ModeType.Nomal;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 新游戏
|
||||
/// </summary>
|
||||
public Save()
|
||||
{
|
||||
Money = 100;
|
||||
Exp = 0;
|
||||
Strength = 100;
|
||||
StrengthFood = 100;
|
||||
StrengthDrink = 100;
|
||||
Feeling = 60;
|
||||
Health = 100;
|
||||
Likability = 0;
|
||||
CalMode();
|
||||
}
|
||||
/// <summary>
|
||||
/// 读档
|
||||
/// </summary>
|
||||
public Save(Line line)
|
||||
{
|
||||
Money = line.GetFloat("money");
|
||||
Exp = line.GetInt("exp");
|
||||
Strength = line.GetFloat("strength");
|
||||
StrengthDrink = line.GetFloat("strengthdrink");
|
||||
StrengthFood = line.GetFloat("strengthfood");
|
||||
Feeling = line.GetFloat("feeling");
|
||||
Health = line.GetFloat("health");
|
||||
Likability = line.GetFloat("likability");
|
||||
CalMode();
|
||||
}
|
||||
/// <summary>
|
||||
/// 存档
|
||||
/// </summary>
|
||||
/// <returns>存档行</returns>
|
||||
public Line ToLine()
|
||||
{
|
||||
Line save = new Line("vpet", "");
|
||||
save.SetFloat("money", Money);
|
||||
save.SetInt("exp", Exp);
|
||||
save.SetFloat("strength", Strength);
|
||||
save.SetFloat("strengthdrink", StrengthDrink);
|
||||
save.SetFloat("strengthfood", StrengthFood);
|
||||
save.SetFloat("feeling", Feeling);
|
||||
save.SetFloat("health", Health);
|
||||
save.SetFloat("Likability", Likability);
|
||||
return save;
|
||||
}
|
||||
}
|
||||
}
|
40
VPet-Simulator.Core/Handle/Setting.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using LinePutScript;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// 游戏设置,例如窗体大小等
|
||||
/// </summary>
|
||||
public class Setting : LpsDocument
|
||||
{
|
||||
/// <summary>
|
||||
/// 窗体宽度
|
||||
/// </summary>
|
||||
public double Width
|
||||
{
|
||||
get => this["windows"].GetDouble("width", 250);
|
||||
set => this["windows"].SetDouble("width", value);
|
||||
}
|
||||
/// <summary>
|
||||
/// 窗体高度
|
||||
/// </summary>
|
||||
public double Heigh
|
||||
{
|
||||
get => this["windows"].GetDouble("heigh", 250);
|
||||
set => this["windows"].SetDouble("heigh", value);
|
||||
}
|
||||
/// <summary>
|
||||
/// 按多久视为长按 单位毫秒
|
||||
/// </summary>
|
||||
public int PressLength
|
||||
{
|
||||
get => this["windows"].GetInt("presslength", 500);
|
||||
set => this["windows"].SetInt("presslength", value);
|
||||
}
|
||||
}
|
||||
}
|
12
VPet-Simulator.Core/Item/Drink.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
internal class Drink
|
||||
{
|
||||
}
|
||||
}
|
12
VPet-Simulator.Core/Item/Food.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
internal class Food
|
||||
{
|
||||
}
|
||||
}
|
12
VPet-Simulator.Core/Item/Item.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
internal class Item
|
||||
{
|
||||
}
|
||||
}
|
55
VPet-Simulator.Core/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("VPet-Simulator.Core")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("VPet-Simulator.Core")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//若要开始生成可本地化的应用程序,请设置
|
||||
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
|
||||
//例如,如果您在源文件中使用的是美国英语,
|
||||
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
|
||||
//对以下 NeutralResourceLanguage 特性的注释。 更新
|
||||
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly:ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
|
||||
//(未在页面中找到资源时使用,
|
||||
//或应用程序资源字典中找到时使用)
|
||||
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
|
||||
//(未在页面中找到资源时使用,
|
||||
//、应用程序或任何主题专用资源字典中找到时使用)
|
||||
)]
|
||||
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
62
VPet-Simulator.Core/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,62 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本: 4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace VPet_Simulator.Core.Properties {
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 强类型资源类,用于查找本地化字符串等。
|
||||
/// </summary>
|
||||
// 此类是由 StronglyTypedResourceBuilder
|
||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回此类使用的缓存 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if ((resourceMan == null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VPet_Simulator.Core.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
117
VPet-Simulator.Core/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
30
VPet-Simulator.Core/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace VPet_Simulator.Core.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
7
VPet-Simulator.Core/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
147
VPet-Simulator.Core/VPet-Simulator.Core.csproj
Normal file
@ -0,0 +1,147 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{7BD4CB1D-C8F3-4349-9BF0-CD11789130BA}</ProjectGuid>
|
||||
<OutputType>library</OutputType>
|
||||
<RootNamespace>VPet_Simulator.Core</RootNamespace>
|
||||
<AssemblyName>VPet-Simulator.Core</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="LinePutScript, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\LinePutScript.1.5.4\lib\net462\LinePutScript.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Panuon.WPF, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Panuon.WPF.1.0.1\lib\net462\Panuon.WPF.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Panuon.WPF.UI, Version=1.1.6.5, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Panuon.WPF.UI.1.1.6.5\lib\net462\Panuon.WPF.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="Display\Main.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="Display\Main.xaml.cs">
|
||||
<DependentUpon>Main.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="Display\MessageBar.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Display\Theme.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Display\ToolBar.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Graph\IEyeTracking.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Graph\Picture.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Graph\PNGAnimation.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Display\MainDisplay.cs" />
|
||||
<Compile Include="Display\MainLogic.cs" />
|
||||
<Compile Include="Display\MessageBar.xaml.cs">
|
||||
<DependentUpon>MessageBar.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Display\ToolBar.xaml.cs">
|
||||
<DependentUpon>ToolBar.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Graph\GraphCore.cs" />
|
||||
<Compile Include="Graph\IEyeTracking.xaml.cs">
|
||||
<DependentUpon>IEyeTracking.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Graph\IGraph.cs" />
|
||||
<Compile Include="Graph\Picture.xaml.cs">
|
||||
<DependentUpon>Picture.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Graph\PNGAnimation.xaml.cs">
|
||||
<DependentUpon>PNGAnimation.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Handle\Function.cs" />
|
||||
<Compile Include="Handle\GameCore.cs" />
|
||||
<Compile Include="Handle\IController.cs" />
|
||||
<Compile Include="Handle\Save.cs" />
|
||||
<Compile Include="Handle\Setting.cs" />
|
||||
<Compile Include="Item\Drink.cs" />
|
||||
<Compile Include="Item\Food.cs" />
|
||||
<Compile Include="Item\Item.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
6
VPet-Simulator.Core/packages.config
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="LinePutScript" version="1.5.4" targetFramework="net462" />
|
||||
<package id="Panuon.WPF" version="1.0.1" targetFramework="net462" />
|
||||
<package id="Panuon.WPF.UI" version="1.1.6.5" targetFramework="net462" />
|
||||
</packages>
|
6
VPet-Simulator.Tool/App.config
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
</configuration>
|
85
VPet-Simulator.Tool/Program.cs
Normal file
@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VPet_Simulator.Tool
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("VPet Simulator Tool");
|
||||
start:
|
||||
Console.WriteLine("请输入需要使用的功能编号");
|
||||
Console.WriteLine("1. 精简动画相同图片");
|
||||
switch (Console.ReadLine())
|
||||
{
|
||||
case "1":
|
||||
do
|
||||
{
|
||||
Animation();
|
||||
} while (true);
|
||||
default:
|
||||
Console.WriteLine("暂无该功能");
|
||||
goto start;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 将图片重命名并转换成 名字_序号_持续时间 格式
|
||||
/// </summary>
|
||||
static void Animation()
|
||||
{
|
||||
Console.WriteLine("请输入每张图片的持续时间 (单位: 毫秒)");
|
||||
string timestr = Console.ReadLine();
|
||||
int time = timestr == "" ? 125 : int.Parse(timestr);
|
||||
Console.WriteLine("请输入图片位置");
|
||||
DirectoryInfo directoryInfo = new DirectoryInfo(Console.ReadLine());
|
||||
int id = 0;
|
||||
int rpt = 1;
|
||||
string hash = null;
|
||||
FileInfo lastf = null;
|
||||
foreach (FileInfo fileInfo in directoryInfo.GetFiles())
|
||||
{
|
||||
if (lastf == null)
|
||||
{
|
||||
lastf = fileInfo;
|
||||
hash = GetFileHash(fileInfo);
|
||||
continue;
|
||||
}
|
||||
string filehash = GetFileHash(fileInfo);
|
||||
if (hash.Equals(filehash))
|
||||
{
|
||||
//这个文件和上一个文件的hash值相同,这个上个文件
|
||||
lastf.Delete();
|
||||
lastf = fileInfo;
|
||||
rpt++;
|
||||
continue;
|
||||
}
|
||||
hash = filehash;
|
||||
lastf.MoveTo(Path.Combine(directoryInfo.FullName, $"{lastf.Name.Split('_')[0]}_{id++:D3}_{rpt * time}.png"));
|
||||
rpt = 1;
|
||||
lastf = fileInfo;
|
||||
}
|
||||
lastf.MoveTo(Path.Combine(directoryInfo.FullName, $"{lastf.Name.Split('_')[0]}_{id++:D3}_{rpt * time}.png"));
|
||||
Console.WriteLine("图片处理已完成");
|
||||
}
|
||||
public static string GetFileHash(FileInfo fileInfo)
|
||||
{
|
||||
//创建一个哈希算法对象
|
||||
using (HashAlgorithm hash = HashAlgorithm.Create())
|
||||
{
|
||||
using (FileStream file = fileInfo.OpenRead())
|
||||
{
|
||||
//哈希算法根据文本得到哈希码的字节数组
|
||||
return BitConverter.ToString(hash.ComputeHash(file));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
36
VPet-Simulator.Tool/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("VPet-Simulator.Tool")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("VPet-Simulator.Tool")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("692ce45e-01a9-4500-8b1d-afc0fe2767fa")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
53
VPet-Simulator.Tool/VPet-Simulator.Tool.csproj
Normal file
@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{692CE45E-01A9-4500-8B1D-AFC0FE2767FA}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>VPet_Simulator.Tool</RootNamespace>
|
||||
<AssemblyName>VPet-Simulator.Tool</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
6
VPet-Simulator.Windows/App.config
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
</configuration>
|
9
VPet-Simulator.Windows/App.xaml
Normal file
@ -0,0 +1,9 @@
|
||||
<Application x:Class="VPet_Simulator.Windows.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:VPet_Simulator.Windows"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
17
VPet-Simulator.Windows/App.xaml.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace VPet_Simulator.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// App.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
47
VPet-Simulator.Windows/MWController.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VPet_Simulator.Core;
|
||||
|
||||
namespace VPet_Simulator.Windows
|
||||
{
|
||||
public class MWController : IController
|
||||
{
|
||||
MainWindow mw;
|
||||
public MWController(MainWindow mw)
|
||||
{
|
||||
this.mw = mw;
|
||||
}
|
||||
|
||||
public override double WindowsWidth { get => mw.Width; set => mw.Width = value; }
|
||||
public override double WindowsHight { get => mw.Height; set => mw.Height = value; }
|
||||
|
||||
public override double GetWindowsDistanceDown()
|
||||
{
|
||||
return System.Windows.SystemParameters.PrimaryScreenHeight - mw.Top - mw.Height;
|
||||
}
|
||||
|
||||
public override double GetWindowsDistanceLeft()
|
||||
{
|
||||
return mw.Left;
|
||||
}
|
||||
|
||||
public override double GetWindowsDistanceRight()
|
||||
{
|
||||
return System.Windows.SystemParameters.PrimaryScreenWidth - mw.Left - mw.Width;
|
||||
}
|
||||
|
||||
public override double GetWindowsDistanceUp()
|
||||
{
|
||||
return mw.Top;
|
||||
}
|
||||
|
||||
public override void MoveWindows(double X, double Y)
|
||||
{
|
||||
mw.Left += X * .5;
|
||||
mw.Top += Y * .5;
|
||||
}
|
||||
}
|
||||
}
|
13
VPet-Simulator.Windows/MainWindow.xaml
Normal file
@ -0,0 +1,13 @@
|
||||
<Window x:Class="VPet_Simulator.Windows.MainWindow" 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" ResizeMode="NoResize"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:VPet_Simulator.Windows" mc:Ignorable="d" WindowStyle="None" Title="MainWindow"
|
||||
Height="250" Width="250" Background="{x:Null}" Topmost="True">
|
||||
<WindowChrome.WindowChrome>
|
||||
<WindowChrome GlassFrameThickness="-1" />
|
||||
</WindowChrome.WindowChrome>
|
||||
<Grid>
|
||||
<Grid x:Name="DisplayGrid" />
|
||||
</Grid>
|
||||
</Window>
|
106
VPet-Simulator.Windows/MainWindow.xaml.cs
Normal file
@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using VPet_Simulator.Core;
|
||||
using static VPet_Simulator.Core.GraphCore;
|
||||
|
||||
namespace VPet_Simulator.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// MainWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public readonly string ModPath = Environment.CurrentDirectory + @"\mod";
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
//不存在就关掉
|
||||
var modpath = new DirectoryInfo(ModPath + @"\0000_core\pet\vup");
|
||||
if (!modpath.Exists)
|
||||
{
|
||||
MessageBox.Show("缺少模组Core,无法启动桌宠", "启动错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
|
||||
var core = new GameCore();
|
||||
core.Setting = new Setting();
|
||||
core.Controller = new MWController(this);
|
||||
core.Graph = new GraphCore();
|
||||
core.Save = new Save();
|
||||
LoadGraph(core.Graph, modpath, "");
|
||||
DisplayGrid.Children.Add(new Main(core));
|
||||
}
|
||||
//public void DEBUGValue()
|
||||
//{
|
||||
// Dispatcher.Invoke(() =>
|
||||
// {
|
||||
// Console.WriteLine("Left: " + mwc.GetWindowsDistanceLeft());
|
||||
// Console.WriteLine("Right: " + mwc.GetWindowsDistanceRight());
|
||||
// });
|
||||
// Thread.Sleep(1000);
|
||||
// DEBUGValue();
|
||||
//}
|
||||
public static void LoadGraph(GraphCore graph, DirectoryInfo di, string path_name)
|
||||
{
|
||||
var list = di.EnumerateDirectories();
|
||||
if (list.Count() == 0)
|
||||
{
|
||||
if (File.Exists(di.FullName + @"\info.lps"))
|
||||
{//如果自带描述信息,则手动加载
|
||||
|
||||
}
|
||||
else
|
||||
{//自动加载 PNG ANMIN
|
||||
path_name = path_name.Trim('_').ToLower();
|
||||
for (int i = 0; i < GraphTypeValue.Length; i++)
|
||||
{
|
||||
if (path_name.StartsWith(GraphTypeValue[i][0]))
|
||||
{
|
||||
if (path_name.Contains("happy"))
|
||||
{
|
||||
graph.AddGraph(new PNGAnimation(di.FullName, Save.ModeType.Happy, (GraphType)i, GraphTypeValue[i][1], GraphTypeValue[i][2]), (GraphType)i);
|
||||
}
|
||||
if (path_name.Contains("nomal"))
|
||||
{
|
||||
graph.AddGraph(new PNGAnimation(di.FullName, Save.ModeType.Nomal, (GraphType)i, GraphTypeValue[i][1], GraphTypeValue[i][2]), (GraphType)i);
|
||||
}
|
||||
if (path_name.Contains("poorcondition"))
|
||||
{
|
||||
graph.AddGraph(new PNGAnimation(di.FullName, Save.ModeType.PoorCondition, (GraphType)i, GraphTypeValue[i][1], GraphTypeValue[i][2]), (GraphType)i);
|
||||
}
|
||||
if (path_name.Contains("ill"))
|
||||
{
|
||||
graph.AddGraph(new PNGAnimation(di.FullName, Save.ModeType.Ill, (GraphType)i, GraphTypeValue[i][1], GraphTypeValue[i][2]), (GraphType)i);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
#if DEBUG
|
||||
throw new Exception("未知的图像类型: " + path_name);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
foreach (var p in list)
|
||||
{
|
||||
LoadGraph(graph, p, path_name + "_" + p.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
55
VPet-Simulator.Windows/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("VPet-Simulator.Windows")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("VPet-Simulator.Windows")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//若要开始生成可本地化的应用程序,请设置
|
||||
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
|
||||
//例如,如果您在源文件中使用的是美国英语,
|
||||
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
|
||||
//对以下 NeutralResourceLanguage 特性的注释。 更新
|
||||
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
|
||||
//(未在页面中找到资源时使用,
|
||||
//或应用程序资源字典中找到时使用)
|
||||
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
|
||||
//(未在页面中找到资源时使用,
|
||||
//、应用程序或任何主题专用资源字典中找到时使用)
|
||||
)]
|
||||
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
71
VPet-Simulator.Windows/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本: 4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace VPet_Simulator.Windows.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 强类型资源类,用于查找本地化字符串等。
|
||||
/// </summary>
|
||||
// 此类是由 StronglyTypedResourceBuilder
|
||||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回此类使用的缓存 ResourceManager 实例。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VPet_Simulator.Windows.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写当前线程的 CurrentUICulture 属性,对
|
||||
/// 使用此强类型资源类的所有资源查找执行重写。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
117
VPet-Simulator.Windows/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
30
VPet-Simulator.Windows/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace VPet_Simulator.Windows.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
7
VPet-Simulator.Windows/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
112
VPet-Simulator.Windows/VPet-Simulator.Windows.csproj
Normal file
@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{B5C2DD17-735F-4F9F-82E4-B8692AEC03F1}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>VPet_Simulator.Windows</RootNamespace>
|
||||
<AssemblyName>VPet-Simulator.Windows</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Panuon.WPF, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Panuon.WPF.1.0.1\lib\net48\Panuon.WPF.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Panuon.WPF.UI, Version=1.1.6.5, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Panuon.WPF.UI.1.1.6.5\lib\net48\Panuon.WPF.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MWController.cs" />
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\VPet-Simulator.Core\VPet-Simulator.Core.csproj">
|
||||
<Project>{7bd4cb1d-c8f3-4349-9bf0-cd11789130ba}</Project>
|
||||
<Name>VPet-Simulator.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
BIN
VPet-Simulator.Windows/mod/0000_core/icon.png
Normal file
After Width: | Height: | Size: 190 KiB |
4
VPet-Simulator.Windows/mod/0000_core/info.lps
Normal file
@ -0,0 +1,4 @@
|
||||
vupmod#Core:|author#lorisyounger:|gamever#20:|ver#100:|
|
||||
intro#这是虚拟桌宠模拟器的核心运行文件/com可以参考此文件编写mod:|
|
||||
authorid#253101309:|
|
||||
itemid#1:|
|
1
VPet-Simulator.Windows/mod/0000_core/pet/vup.lps
Normal file
@ -0,0 +1 @@
|
||||
pet#默认虚拟桌宠:|intor#虚拟主播模拟器默认人物形象:|path#vup:|
|
After Width: | Height: | Size: 202 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 208 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 186 KiB |
After Width: | Height: | Size: 195 KiB |
After Width: | Height: | Size: 197 KiB |
After Width: | Height: | Size: 195 KiB |
After Width: | Height: | Size: 184 KiB |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 183 KiB |
After Width: | Height: | Size: 188 KiB |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 195 KiB |
After Width: | Height: | Size: 187 KiB |
After Width: | Height: | Size: 193 KiB |
After Width: | Height: | Size: 167 KiB |
After Width: | Height: | Size: 162 KiB |
After Width: | Height: | Size: 163 KiB |
After Width: | Height: | Size: 148 KiB |
After Width: | Height: | Size: 147 KiB |
After Width: | Height: | Size: 148 KiB |
After Width: | Height: | Size: 163 KiB |
After Width: | Height: | Size: 162 KiB |
After Width: | Height: | Size: 167 KiB |
After Width: | Height: | Size: 161 KiB |
After Width: | Height: | Size: 153 KiB |
After Width: | Height: | Size: 152 KiB |
After Width: | Height: | Size: 139 KiB |
After Width: | Height: | Size: 137 KiB |
After Width: | Height: | Size: 139 KiB |
After Width: | Height: | Size: 152 KiB |
After Width: | Height: | Size: 153 KiB |
After Width: | Height: | Size: 161 KiB |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 247 KiB |
After Width: | Height: | Size: 245 KiB |
After Width: | Height: | Size: 247 KiB |
After Width: | Height: | Size: 260 KiB |
After Width: | Height: | Size: 259 KiB |
After Width: | Height: | Size: 247 KiB |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 165 KiB |
After Width: | Height: | Size: 176 KiB |
After Width: | Height: | Size: 180 KiB |
After Width: | Height: | Size: 170 KiB |
After Width: | Height: | Size: 180 KiB |
After Width: | Height: | Size: 176 KiB |