From 43ebe73a4a656a19207db047b2c65b5177798fd4 Mon Sep 17 00:00:00 2001 From: ZouJin <zoujin.dev@exlb.org> Date: Tue, 13 Aug 2024 01:08:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=AD=89=E7=BA=A7=E4=B8=8A?= =?UTF-8?q?=E5=8D=87=E5=8A=A8=E7=94=BB(=E8=8B=A5=E6=9C=89)=E5=92=8C?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=E5=8D=87=E9=99=90=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GameSave_VPet.cs | 30 ++++++++++++++++++- VPet-Simulator.Windows/MainWindow.xaml.cs | 1 + VPet-Simulator.Windows/mod/1122_CloudSaves | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) create mode 120000 VPet-Simulator.Windows/mod/1122_CloudSaves diff --git a/VPet-Simulator.Windows.Interface/GameSave_VPet.cs b/VPet-Simulator.Windows.Interface/GameSave_VPet.cs index 6923207..ea4ae85 100644 --- a/VPet-Simulator.Windows.Interface/GameSave_VPet.cs +++ b/VPet-Simulator.Windows.Interface/GameSave_VPet.cs @@ -1,6 +1,9 @@ using LinePutScript; using LinePutScript.Converter; +using LinePutScript.Localization.WPF; +using Panuon.WPF.UI; using System; +using System.Windows.Threading; using VPet_Simulator.Core; using static VPet_Simulator.Core.IGameSave; @@ -11,6 +14,11 @@ namespace VPet_Simulator.Windows.Interface; /// </summary> public class GameSave_VPet : IGameSave { + IMainWindow imw; + public GameSave_VPet(IMainWindow imw) + { + this.imw = imw; + } /// <summary> /// 宠物名字 /// </summary> @@ -48,17 +56,37 @@ public class GameSave_VPet : IGameSave set { int lun = LevelUpNeed(); + bool islevelup = false; + bool islevelmaxup = false; while (value >= lun) { + islevelup = true; value -= lun; LikabilityMax += 10; if (Level++ > 1000 + LevelMax * 100) { LevelMax++; + islevelmaxup = true; Level = 100 * LevelMax; } lun = LevelUpNeed(); } + if (islevelup) + {//播放等级升级动画 + var gf = imw.Core.Graph.FindGraph("levelup", GraphInfo.AnimatType.Single, Mode); + if (gf != null) + { + imw.Main.Display(gf, imw.Main.DisplayToNomal); + } + } + if (islevelmaxup) + {//告知用户上限等级上升 + imw.Dispatcher.Invoke(() => + { + imw.Main.Say("萝莉斯要说的话".Translate()); + MessageBoxX.Show("上限等级上升内容介绍".Translate(), "上限等级上升标题".Translate()); + }); + } exp = value; } } @@ -249,7 +277,7 @@ public class GameSave_VPet : IGameSave /// </summary> public void StoreTake() { - const int t = 10; + const int t = 10; var s = StoreStrength / t; StoreStrength -= s; diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index 0be3fa1..01dd83e 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -550,6 +550,7 @@ namespace VPet_Simulator.Windows } GameSavesData = new GameSave_v2(petname.Translate()); Core.Save = GameSavesData.GameSave; + HashCheck = HashCheck; } private void WorkTimer_E_FinishWork(WorkTimer.FinishWorkInfo obj) diff --git a/VPet-Simulator.Windows/mod/1122_CloudSaves b/VPet-Simulator.Windows/mod/1122_CloudSaves new file mode 120000 index 0000000..e118313 --- /dev/null +++ b/VPet-Simulator.Windows/mod/1122_CloudSaves @@ -0,0 +1 @@ +D:/Documents/Visual Studio 2022/Projects/VPet.Plugin.Demo/VPet.Plugin.CloudSaves/1122_CloudSaves \ No newline at end of file