更新食物图片&数据优化
@ -354,11 +354,13 @@ namespace VPet_Simulator.Core
|
||||
if (wavetimes >= 10 || DisplayType == GraphCore.GraphType.Default || DisplayType == GraphType.Touch_Head_B_Loop || DisplayType == GraphType.Touch_Head_C_End)
|
||||
DisplayTouchHead();
|
||||
//Console.WriteLine(wavetimes);
|
||||
LastInteractionTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (wavetimes >= 10 || DisplayType == GraphCore.GraphType.Default || DisplayType == GraphType.Touch_Body_B_Loop || DisplayType == GraphType.Touch_Body_C_End)
|
||||
DisplayTouchBody();
|
||||
LastInteractionTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
if (Core.Controller.EnableFunction && Core.Save.Strength >= 10 && Core.Save.Feeling < 100)
|
||||
{
|
||||
Core.Save.StrengthChange(-1);
|
||||
Core.Save.StrengthChange(-2);
|
||||
Core.Save.FeelingChange(1);
|
||||
}
|
||||
if (DisplayType == GraphType.Touch_Head_A_Start)
|
||||
@ -147,7 +147,7 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
if (Core.Controller.EnableFunction && Core.Save.Strength >= 10 && Core.Save.Feeling < 100)
|
||||
{
|
||||
Core.Save.StrengthChange(-1);
|
||||
Core.Save.StrengthChange(-2);
|
||||
Core.Save.FeelingChange(1);
|
||||
}
|
||||
if (DisplayType == GraphType.Touch_Body_A_Start)
|
||||
@ -1259,7 +1259,7 @@ namespace VPet_Simulator.Core
|
||||
return PetGrid2;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
((IGraph)(PetGrid2Tag)).Stop(true);
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
@ -1271,7 +1271,7 @@ namespace VPet_Simulator.Core
|
||||
GC.Collect();
|
||||
return PetGrid;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ namespace VPet_Simulator.Core
|
||||
Core.Save.StoreTake();
|
||||
double freedrop = (DateTime.Now - LastInteractionTime).TotalMinutes;
|
||||
if (freedrop < 1)
|
||||
freedrop = 0;
|
||||
freedrop = 0.5 * TimePass;
|
||||
else
|
||||
freedrop = Math.Sqrt(freedrop) * TimePass;
|
||||
switch (State)
|
||||
@ -182,7 +182,7 @@ namespace VPet_Simulator.Core
|
||||
Core.Save.Health -= TimePass;
|
||||
}
|
||||
lowStrengthFood();
|
||||
var addmoney = TimePass * (6 + Core.Save.Level);
|
||||
var addmoney = TimePass * (10 + Core.Save.Level);
|
||||
Core.Save.Exp += addmoney;
|
||||
WorkTimer.GetCount += addmoney;
|
||||
}
|
||||
@ -191,12 +191,12 @@ namespace VPet_Simulator.Core
|
||||
Core.Save.StrengthChange(TimePass);
|
||||
if (Core.Save.StrengthFood >= 75)
|
||||
Core.Save.Health += TimePass;
|
||||
var addmoney = TimePass * (15 + Core.Save.Level);
|
||||
var addmoney = TimePass * (30 + Core.Save.Level);
|
||||
Core.Save.Exp += addmoney;
|
||||
WorkTimer.GetCount += addmoney;
|
||||
}
|
||||
Core.Save.StrengthChangeFood(-TimePass * 3);
|
||||
Core.Save.StrengthChangeDrink(-TimePass * 4);
|
||||
Core.Save.StrengthChangeFood(-TimePass * 1.5);
|
||||
Core.Save.StrengthChangeDrink(-TimePass * 2);
|
||||
Core.Save.FeelingChange(-freedrop * 3);
|
||||
goto default;
|
||||
default://默认
|
||||
|
@ -14,16 +14,16 @@ namespace VPet_Simulator.Core
|
||||
/// 宠物名字
|
||||
/// </summary>
|
||||
[Line(name: "name")]
|
||||
public string Name;
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 金钱
|
||||
/// </summary>
|
||||
[Line(Type = LPSConvert.ConvertType.ToFloat, Name = "money")] public double Money;
|
||||
[Line(Type = LPSConvert.ConvertType.ToFloat, Name = "money")] public double Money { get; set; }
|
||||
/// <summary>
|
||||
/// 经验值
|
||||
/// </summary>
|
||||
[Line(type: LPSConvert.ConvertType.ToFloat, name: "exp")] public double Exp;
|
||||
[Line(type: LPSConvert.ConvertType.ToFloat, name: "exp")] public double Exp { get; set; }
|
||||
/// <summary>
|
||||
/// 等级
|
||||
/// </summary>
|
||||
@ -39,12 +39,12 @@ namespace VPet_Simulator.Core
|
||||
/// </summary>
|
||||
public double Strength { get => strength; set => strength = Math.Min(100, Math.Max(0, value)); }
|
||||
[Line(Type = LPSConvert.ConvertType.ToFloat)]
|
||||
private double strength;
|
||||
private double strength { get; set; }
|
||||
/// <summary>
|
||||
/// 待补充的体力,随着时间缓慢加给桌宠
|
||||
/// </summary>//让游戏更有游戏性
|
||||
[Line(Type = LPSConvert.ConvertType.ToFloat)]
|
||||
public double StoreStrength;
|
||||
public double StoreStrength { get; set; }
|
||||
/// <summary>
|
||||
/// 变化 体力
|
||||
/// </summary>
|
||||
@ -72,12 +72,12 @@ namespace VPet_Simulator.Core
|
||||
}
|
||||
}
|
||||
[Line(Type = LPSConvert.ConvertType.ToFloat)]
|
||||
private double strengthFood;
|
||||
private double strengthFood { get; set; }
|
||||
/// <summary>
|
||||
/// 待补充的饱腹度,随着时间缓慢加给桌宠
|
||||
/// </summary>//让游戏更有游戏性
|
||||
[Line(Type = LPSConvert.ConvertType.ToFloat)]
|
||||
public double StoreStrengthFood;
|
||||
public double StoreStrengthFood { get; set; }
|
||||
public void StrengthChangeFood(double value)
|
||||
{
|
||||
ChangeStrengthFood += value;
|
||||
@ -106,12 +106,12 @@ namespace VPet_Simulator.Core
|
||||
}
|
||||
|
||||
[Line(Type = LPSConvert.ConvertType.ToFloat)]
|
||||
private double strengthDrink;
|
||||
private double strengthDrink { get; set; }
|
||||
/// <summary>
|
||||
/// 待补充的口渴度,随着时间缓慢加给桌宠
|
||||
/// </summary>//让游戏更有游戏性
|
||||
[Line(Type = LPSConvert.ConvertType.ToFloat)]
|
||||
public double StoreStrengthDrink;
|
||||
public double StoreStrengthDrink { get; set; }
|
||||
/// <summary>
|
||||
/// 变化 口渴度
|
||||
/// </summary>
|
||||
@ -127,12 +127,12 @@ namespace VPet_Simulator.Core
|
||||
public double Feeling { get => feeling; set => feeling = Math.Min(100, Math.Max(0, value)); }
|
||||
|
||||
[Line(Type = LPSConvert.ConvertType.ToFloat)]
|
||||
private double feeling;
|
||||
private double feeling { get; set; }
|
||||
/// <summary>
|
||||
/// 待补充的心情,随着时间缓慢加给桌宠
|
||||
/// </summary>//让游戏更有游戏性
|
||||
[Line(Type = LPSConvert.ConvertType.ToFloat)]
|
||||
public double StoreFeeling;
|
||||
public double StoreFeeling { get; set; }
|
||||
/// <summary>
|
||||
/// 变化 心情
|
||||
/// </summary>
|
||||
@ -148,7 +148,7 @@ namespace VPet_Simulator.Core
|
||||
public double Health { get => health; set => health = Math.Min(100, Math.Max(0, value)); }
|
||||
|
||||
[Line(Type = LPSConvert.ConvertType.ToFloat)]
|
||||
private double health;
|
||||
private double health { get; set; }
|
||||
/// <summary>
|
||||
/// 好感度(隐藏)(累加值)
|
||||
/// </summary>
|
||||
@ -169,7 +169,7 @@ namespace VPet_Simulator.Core
|
||||
}
|
||||
|
||||
[Line(Type = LPSConvert.ConvertType.ToFloat)]
|
||||
private double likability;
|
||||
private double likability { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 清除变化
|
||||
@ -261,7 +261,7 @@ namespace VPet_Simulator.Core
|
||||
Ill
|
||||
}
|
||||
[Line(name: "mode")]
|
||||
public ModeType Mode = ModeType.Nomal;
|
||||
public ModeType Mode { get; set; } = ModeType.Nomal;
|
||||
/// <summary>
|
||||
/// 计算宠物当前状态
|
||||
/// </summary>
|
||||
|
@ -224,210 +224,210 @@ namespace VPet_Simulator.Windows
|
||||
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
LoadingText.Content = "尝试加载动画和生成缓存";
|
||||
var pl = Pets.Find(x => x.Name == Set.PetGraph);
|
||||
Core.Graph = pl == null ? Pets[0].Graph() : pl.Graph();
|
||||
LoadingText.Content = "正在加载CGPT";
|
||||
LoadingText.Content = "尝试加载动画和生成缓存";
|
||||
var pl = Pets.Find(x => x.Name == Set.PetGraph);
|
||||
Core.Graph = pl == null ? Pets[0].Graph() : pl.Graph();
|
||||
LoadingText.Content = "正在加载CGPT";
|
||||
|
||||
winSetting = new winGameSetting(this);
|
||||
winBetterBuy = new winBetterBuy(this);
|
||||
Main = new Main(Core) { };
|
||||
if (!Set["CGPT"][(gbol)"enable"] && IsSteamUser)
|
||||
{
|
||||
TalkBox = new TalkBox(this);
|
||||
Main.ToolBar.MainGrid.Children.Add(TalkBox);
|
||||
}
|
||||
else if (Set["CGPT"][(gbol)"enable"])
|
||||
{
|
||||
TalkBox = new TalkBoxAPI(this);
|
||||
Main.ToolBar.MainGrid.Children.Add(TalkBox);
|
||||
}
|
||||
LoadingText.Content = "正在加载游戏";
|
||||
var m = new System.Windows.Controls.MenuItem()
|
||||
{
|
||||
Header = "MOD管理",
|
||||
HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center,
|
||||
};
|
||||
m.Click += (x, y) =>
|
||||
{
|
||||
Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||
Topmost = false;
|
||||
winSetting.MainTab.SelectedIndex = 5;
|
||||
winSetting.Show();
|
||||
};
|
||||
Main.ToolBar.MenuMODConfig.Items.Add(m);
|
||||
try
|
||||
{
|
||||
//加载游戏创意工坊插件
|
||||
foreach (MainPlugin mp in Plugins)
|
||||
mp.LoadPlugin();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
new winReport(this, "由于插件引起的游戏启动错误\n" + e.ToString()).Show();
|
||||
}
|
||||
Foods.ForEach(item => item.LoadImageSource(this));
|
||||
|
||||
Main.DefaultClickAction = () =>
|
||||
{
|
||||
if (new TimeSpan(DateTime.Now.Ticks - lastclicktime).TotalSeconds > 20)
|
||||
winSetting = new winGameSetting(this);
|
||||
winBetterBuy = new winBetterBuy(this);
|
||||
Main = new Main(Core) { };
|
||||
if (!Set["CGPT"][(gbol)"enable"] && IsSteamUser)
|
||||
{
|
||||
lastclicktime = DateTime.Now.Ticks;
|
||||
var v = rndtext[Function.Rnd.Next(rndtext.Count)];
|
||||
Main.Say(v.Item1, v.Item2);
|
||||
TalkBox = new TalkBox(this);
|
||||
Main.ToolBar.MainGrid.Children.Add(TalkBox);
|
||||
}
|
||||
};
|
||||
Main.PlayVoiceVolume = Set.VoiceVolume;
|
||||
DisplayGrid.Child = Main;
|
||||
Task.Run(() =>
|
||||
{
|
||||
while (Main.IsWorking)
|
||||
else if (Set["CGPT"][(gbol)"enable"])
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
TalkBox = new TalkBoxAPI(this);
|
||||
Main.ToolBar.MainGrid.Children.Add(TalkBox);
|
||||
}
|
||||
Dispatcher.Invoke(() => LoadingText.Visibility = Visibility.Collapsed);
|
||||
});
|
||||
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "退出桌宠", () => { Main.ToolBar.Visibility = Visibility.Collapsed; Close(); });
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "开发控制台", () => { Main.ToolBar.Visibility = Visibility.Collapsed; new winConsole(this).Show(); });
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "反馈中心", () => { Main.ToolBar.Visibility = Visibility.Collapsed; new winReport(this).Show(); });
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "设置面板", () =>
|
||||
{
|
||||
Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||
Topmost = false;
|
||||
winSetting.Show();
|
||||
});
|
||||
|
||||
//this.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/Res/TopLogo2019.PNG")));
|
||||
|
||||
//Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "喂食测试", () =>
|
||||
// {
|
||||
// Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||
// IRunImage eat = (IRunImage)Core.Graph.FindGraph(GraphType.Eat, GameSave.ModeType.Nomal);
|
||||
// var b = Main.FindDisplayBorder(eat);
|
||||
// eat.Run(b, new BitmapImage(new Uri("pack://application:,,,/Res/汉堡.png")), Main.DisplayToNomal);
|
||||
// }
|
||||
//);
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "吃饭", () =>
|
||||
LoadingText.Content = "正在加载游戏";
|
||||
var m = new System.Windows.Controls.MenuItem()
|
||||
{
|
||||
winBetterBuy.Show(Food.FoodType.Meal);
|
||||
Header = "MOD管理",
|
||||
HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center,
|
||||
};
|
||||
m.Click += (x, y) =>
|
||||
{
|
||||
Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||
Topmost = false;
|
||||
winSetting.MainTab.SelectedIndex = 5;
|
||||
winSetting.Show();
|
||||
};
|
||||
Main.ToolBar.MenuMODConfig.Items.Add(m);
|
||||
try
|
||||
{
|
||||
//加载游戏创意工坊插件
|
||||
foreach (MainPlugin mp in Plugins)
|
||||
mp.LoadPlugin();
|
||||
}
|
||||
);
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "喝水", () =>
|
||||
{
|
||||
winBetterBuy.Show(Food.FoodType.Drink);
|
||||
}
|
||||
);
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "药品", () =>
|
||||
{
|
||||
winBetterBuy.Show(Food.FoodType.Drug);
|
||||
}
|
||||
);
|
||||
Main.SetMoveMode(Set.AllowMove, Set.SmartMove, Set.SmartMoveInterval * 1000);
|
||||
Main.SetLogicInterval((int)(Set.LogicInterval * 1000));
|
||||
if (Set.MessageBarOutside)
|
||||
Main.MsgBar.SetPlaceOUT();
|
||||
catch (Exception e)
|
||||
{
|
||||
new winReport(this, "由于插件引起的游戏启动错误\n" + e.ToString()).Show();
|
||||
}
|
||||
Foods.ForEach(item => item.LoadImageSource(this));
|
||||
|
||||
//加载图标
|
||||
notifyIcon = new NotifyIcon();
|
||||
notifyIcon.Text = "虚拟桌宠模拟器";
|
||||
ContextMenu m_menu;
|
||||
|
||||
m_menu = new ContextMenu();
|
||||
m_menu.MenuItems.Add(new MenuItem("操作教程", (x, y) => { Process.Start(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html"); }));
|
||||
m_menu.MenuItems.Add(new MenuItem("重置状态", (x, y) =>
|
||||
{
|
||||
Main.CleanState();
|
||||
Main.DisplayToNomal();
|
||||
Left = (SystemParameters.PrimaryScreenWidth - Width) / 2;
|
||||
Top = (SystemParameters.PrimaryScreenHeight - Height) / 2;
|
||||
}));
|
||||
m_menu.MenuItems.Add(new MenuItem("反馈中心", (x, y) => { new winReport(this).Show(); }));
|
||||
m_menu.MenuItems.Add(new MenuItem("开发控制台", (x, y) => { new winConsole(this).Show(); }));
|
||||
|
||||
m_menu.MenuItems.Add(new MenuItem("设置面板", (x, y) =>
|
||||
{
|
||||
Topmost = false;
|
||||
winSetting.Show();
|
||||
}));
|
||||
m_menu.MenuItems.Add(new MenuItem("退出桌宠", (x, y) => Close()));
|
||||
|
||||
LoadDIY();
|
||||
|
||||
notifyIcon.ContextMenu = m_menu;
|
||||
|
||||
notifyIcon.Icon = new System.Drawing.Icon(Application.GetResourceStream(new Uri("pack://application:,,,/vpeticon.ico")).Stream);
|
||||
|
||||
notifyIcon.Visible = true;
|
||||
notifyIcon.BalloonTipClicked += (a, b) =>
|
||||
{
|
||||
Topmost = false;
|
||||
winSetting.Show();
|
||||
};
|
||||
|
||||
if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html") && Set["SingleTips"].GetDateTime("tutorial") <= new DateTime(2023, 2, 23))
|
||||
{
|
||||
Set["SingleTips"].SetDateTime("tutorial", DateTime.Now);
|
||||
Process.Start(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html");
|
||||
}
|
||||
if (!Set["SingleTips"].GetBool("helloworld"))
|
||||
{
|
||||
Main.DefaultClickAction = () =>
|
||||
{
|
||||
if (new TimeSpan(DateTime.Now.Ticks - lastclicktime).TotalSeconds > 20)
|
||||
{
|
||||
lastclicktime = DateTime.Now.Ticks;
|
||||
var v = rndtext[Function.Rnd.Next(rndtext.Count)];
|
||||
Main.Say(v.Item1, v.Item2);
|
||||
}
|
||||
};
|
||||
Main.PlayVoiceVolume = Set.VoiceVolume;
|
||||
DisplayGrid.Child = Main;
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(2000);
|
||||
Set["SingleTips"].SetBool("helloworld", true);
|
||||
notifyIcon.ShowBalloonTip(10, "你好" + (IsSteamUser ? Steamworks.SteamClient.Name : Environment.UserName),
|
||||
"欢迎使用虚拟桌宠模拟器!\n如果遇到桌宠爬不见了,可以在我这里设置居中或退出桌宠", ToolTipIcon.Info);
|
||||
Thread.Sleep(2000);
|
||||
Main.Say("欢迎使用虚拟桌宠模拟器\n这是个中期的测试版,若有bug请多多包涵\n欢迎加群虚拟主播模拟器430081239或在菜单栏-管理-反馈中提交bug或建议", GraphCore.Helper.SayType.Shining);
|
||||
while (Main.IsWorking)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
Dispatcher.Invoke(() => LoadingText.Visibility = Visibility.Collapsed);
|
||||
});
|
||||
}
|
||||
else if (Set["SingleTips"].GetDateTime("update") <= new DateTime(2023, 6, 8))
|
||||
{
|
||||
if (Set["SingleTips"].GetDateTime("update") > new DateTime(2023, 6, 8))
|
||||
notifyIcon.ShowBalloonTip(10, "更新通知 06/09",
|
||||
"修复频繁喝水的bug,更好买新增查看详细信息\n修复干完活后动画停止播放的错误", ToolTipIcon.Info);
|
||||
else
|
||||
notifyIcon.ShowBalloonTip(10, "更新通知 06/08",
|
||||
"现已支持数据计算,桌宠现在需要进行吃饭喝水等\n前往设置调整速率和关闭数据计算\n若有游戏数据设计上的反馈,欢迎加群虚拟主播模拟器430081239或使用反馈功能反馈", ToolTipIcon.Info);
|
||||
Set["SingleTips"].SetDateTime("update", DateTime.Now);
|
||||
}
|
||||
Save();
|
||||
}));
|
||||
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "退出桌宠", () => { Main.ToolBar.Visibility = Visibility.Collapsed; Close(); });
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "开发控制台", () => { Main.ToolBar.Visibility = Visibility.Collapsed; new winConsole(this).Show(); });
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "反馈中心", () => { Main.ToolBar.Visibility = Visibility.Collapsed; new winReport(this).Show(); });
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "设置面板", () =>
|
||||
{
|
||||
Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||
Topmost = false;
|
||||
winSetting.Show();
|
||||
});
|
||||
|
||||
//this.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/Res/TopLogo2019.PNG")));
|
||||
|
||||
//Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "喂食测试", () =>
|
||||
// {
|
||||
// Main.ToolBar.Visibility = Visibility.Collapsed;
|
||||
// IRunImage eat = (IRunImage)Core.Graph.FindGraph(GraphType.Eat, GameSave.ModeType.Nomal);
|
||||
// var b = Main.FindDisplayBorder(eat);
|
||||
// eat.Run(b, new BitmapImage(new Uri("pack://application:,,,/Res/汉堡.png")), Main.DisplayToNomal);
|
||||
// }
|
||||
//);
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "吃饭", () =>
|
||||
{
|
||||
winBetterBuy.Show(Food.FoodType.Meal);
|
||||
}
|
||||
);
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "喝水", () =>
|
||||
{
|
||||
winBetterBuy.Show(Food.FoodType.Drink);
|
||||
}
|
||||
);
|
||||
Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Feed, "药品", () =>
|
||||
{
|
||||
winBetterBuy.Show(Food.FoodType.Drug);
|
||||
}
|
||||
);
|
||||
Main.SetMoveMode(Set.AllowMove, Set.SmartMove, Set.SmartMoveInterval * 1000);
|
||||
Main.SetLogicInterval((int)(Set.LogicInterval * 1000));
|
||||
if (Set.MessageBarOutside)
|
||||
Main.MsgBar.SetPlaceOUT();
|
||||
|
||||
//加载图标
|
||||
notifyIcon = new NotifyIcon();
|
||||
notifyIcon.Text = "虚拟桌宠模拟器";
|
||||
ContextMenu m_menu;
|
||||
|
||||
m_menu = new ContextMenu();
|
||||
m_menu.MenuItems.Add(new MenuItem("操作教程", (x, y) => { Process.Start(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html"); }));
|
||||
m_menu.MenuItems.Add(new MenuItem("重置状态", (x, y) =>
|
||||
{
|
||||
Main.CleanState();
|
||||
Main.DisplayToNomal();
|
||||
Left = (SystemParameters.PrimaryScreenWidth - Width) / 2;
|
||||
Top = (SystemParameters.PrimaryScreenHeight - Height) / 2;
|
||||
}));
|
||||
m_menu.MenuItems.Add(new MenuItem("反馈中心", (x, y) => { new winReport(this).Show(); }));
|
||||
m_menu.MenuItems.Add(new MenuItem("开发控制台", (x, y) => { new winConsole(this).Show(); }));
|
||||
|
||||
m_menu.MenuItems.Add(new MenuItem("设置面板", (x, y) =>
|
||||
{
|
||||
Topmost = false;
|
||||
winSetting.Show();
|
||||
}));
|
||||
m_menu.MenuItems.Add(new MenuItem("退出桌宠", (x, y) => Close()));
|
||||
|
||||
LoadDIY();
|
||||
|
||||
notifyIcon.ContextMenu = m_menu;
|
||||
|
||||
notifyIcon.Icon = new System.Drawing.Icon(Application.GetResourceStream(new Uri("pack://application:,,,/vpeticon.ico")).Stream);
|
||||
|
||||
notifyIcon.Visible = true;
|
||||
notifyIcon.BalloonTipClicked += (a, b) =>
|
||||
{
|
||||
Topmost = false;
|
||||
winSetting.Show();
|
||||
};
|
||||
|
||||
if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html") && Set["SingleTips"].GetDateTime("tutorial") <= new DateTime(2023, 2, 23))
|
||||
{
|
||||
Set["SingleTips"].SetDateTime("tutorial", DateTime.Now);
|
||||
Process.Start(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html");
|
||||
}
|
||||
if (!Set["SingleTips"].GetBool("helloworld"))
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
Thread.Sleep(2000);
|
||||
Set["SingleTips"].SetBool("helloworld", true);
|
||||
notifyIcon.ShowBalloonTip(10, "你好" + (IsSteamUser ? Steamworks.SteamClient.Name : Environment.UserName),
|
||||
"欢迎使用虚拟桌宠模拟器!\n如果遇到桌宠爬不见了,可以在我这里设置居中或退出桌宠", ToolTipIcon.Info);
|
||||
Thread.Sleep(2000);
|
||||
Main.Say("欢迎使用虚拟桌宠模拟器\n这是个中期的测试版,若有bug请多多包涵\n欢迎加群虚拟主播模拟器430081239或在菜单栏-管理-反馈中提交bug或建议", GraphCore.Helper.SayType.Shining);
|
||||
});
|
||||
}
|
||||
else if (Set["SingleTips"].GetDateTime("update") <= new DateTime(2023, 6, 15))
|
||||
{
|
||||
// if (Set["SingleTips"].GetDateTime("update") > new DateTime(2023, 6, 8))
|
||||
// notifyIcon.ShowBalloonTip(10, "更新通知 06/16",
|
||||
//"修复频繁喝水的bug,更好买新增查看详细信息\n更新了新的状态动画文件", ToolTipIcon.Info);
|
||||
// else
|
||||
notifyIcon.ShowBalloonTip(10, "更新通知 06/16",
|
||||
"现已支持数据计算,桌宠现在需要进行吃饭喝水等\n更新了新的状态动画文件\n新增自动备份存档功能\n数据计算数据相关优化", ToolTipIcon.Info);
|
||||
Set["SingleTips"].SetDateTime("update", DateTime.Now);
|
||||
}
|
||||
Save();
|
||||
}));
|
||||
}
|
||||
|
||||
private void AutoSaveTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
Save();
|
||||
}
|
||||
|
||||
|
||||
private void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
Save();
|
||||
try
|
||||
private void AutoSaveTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
//关闭所有插件
|
||||
foreach (MainPlugin mp in Plugins)
|
||||
mp.EndGame();
|
||||
Save();
|
||||
}
|
||||
catch { }
|
||||
Main?.Dispose();
|
||||
notifyIcon?.Dispose();
|
||||
System.Environment.Exit(0);
|
||||
|
||||
|
||||
private void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
Save();
|
||||
try
|
||||
{
|
||||
//关闭所有插件
|
||||
foreach (MainPlugin mp in Plugins)
|
||||
mp.EndGame();
|
||||
}
|
||||
catch { }
|
||||
Main?.Dispose();
|
||||
notifyIcon?.Dispose();
|
||||
System.Environment.Exit(0);
|
||||
}
|
||||
|
||||
|
||||
//public void DEBUGValue()
|
||||
//{
|
||||
// Dispatcher.Invoke(() =>
|
||||
// {
|
||||
// Console.WriteLine("Left:" + mwc.GetWindowsDistanceLeft());
|
||||
// Console.WriteLine("Right:" + mwc.GetWindowsDistanceRight());
|
||||
// });
|
||||
// Thread.Sleep(1000);
|
||||
// DEBUGValue();
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//public void DEBUGValue()
|
||||
//{
|
||||
// Dispatcher.Invoke(() =>
|
||||
// {
|
||||
// Console.WriteLine("Left:" + mwc.GetWindowsDistanceLeft());
|
||||
// Console.WriteLine("Right:" + mwc.GetWindowsDistanceRight());
|
||||
// });
|
||||
// Thread.Sleep(1000);
|
||||
// DEBUGValue();
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
|
BIN
VPet-Simulator.Windows/mod/0000_core/image/food/666感冒灵颗粒.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
VPet-Simulator.Windows/mod/0000_core/image/food/健胃整肠丸.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
VPet-Simulator.Windows/mod/0000_core/image/food/大力丸.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
VPet-Simulator.Windows/mod/0000_core/image/food/布洛芬缓释胶囊.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
VPet-Simulator.Windows/mod/0000_core/image/food/维生素C含片.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
VPet-Simulator.Windows/mod/0000_core/image/food/脑黑金.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
VPet-Simulator.Windows/mod/0000_core/image/food/速效救心丸.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
VPet-Simulator.Windows/mod/0000_core/image/food/钙片.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
VPet-Simulator.Windows/mod/0000_core/image/food/阿司匹林.png
Normal file
After Width: | Height: | Size: 4.6 KiB |