From 00243e824bf11693fa0863f6062e368b350c36a4 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Wed, 29 Nov 2023 02:50:51 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8D=8F=E8=84=B8?= =?UTF-8?q?=E6=97=B6=E9=BC=A0=E6=A0=87=E7=A7=BB=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #288 --- Tutorial.md | 2 +- Tutorial_en.md | 2 +- Tutorial_zht.md | 2 +- VPet-Simulator.Core/Display/Main.xaml.cs | 3 +++ VPet-Simulator.Windows/MainWindow.cs | 12 ++++++------ 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Tutorial.md b/Tutorial.md index f0c87f4..4f81054 100644 --- a/Tutorial.md +++ b/Tutorial.md @@ -8,7 +8,7 @@ ## 11/24 更新 捏脸 -捏脸动画为2023年的[steam大奖提名活动](https://store.steampowered.com/news/app/1920960/view/6966567177514898075)奖励, 我们将参加轻松惬意大奖的提名,制作组期待喜欢《虚拟桌宠模拟器》各位主人们可以对我们提出[宝贵的一票](https://store.steampowered.com/news/app/1920960/view/6966567177514898075)。 +捏脸动画为2023年的steam大奖提名活动奖励 长按脸部捏脸 diff --git a/Tutorial_en.md b/Tutorial_en.md index 6bf6d79..f4cf0d3 100644 --- a/Tutorial_en.md +++ b/Tutorial_en.md @@ -9,7 +9,7 @@ The core gameplay revolves taking care of your Pet. However, more automatic acti ## 11/24 Update Pinch Face -Pinch animation for 2023 [steam award](https://store.steampowered.com/news/app/1920960/view/6966567177514898075) Voting Rewards, we participate in the nomination of the relaxation award. The production team is looking forward to the owners who like VPet Simulator to give us [valuable votes](https://store.steampowered.com/news/app/1920960/view/6966567177514898075) +Pinch animation for 2023 steam award Voting Rewards Long press on the face to pinch the face diff --git a/Tutorial_zht.md b/Tutorial_zht.md index c4e4249..3eb469d 100644 --- a/Tutorial_zht.md +++ b/Tutorial_zht.md @@ -9,7 +9,7 @@ 本遊戲的核心是桌面寵物,更多自動行為如亂走亂動、發呆、蹲下等,需要掛機才能看見。 ## 11/24 更新捏臉 -捏臉動畫為2023年的[steam大獎提名活動]( https://store.steampowered.com/news/app/1920960/view/6966567177514898075 )獎勵,我們參加輕鬆愜意大獎的提名,製作組期待喜歡《虛擬桌寵模擬器》各位主人們可以對我們提出[寶貴的一票]( https://store.steampowered.com/news/app/1920960/view/6966567177514898075 )。 +捏臉動畫為2023年的steam大獎提名活動 長按臉部捏臉 ![ss33](Tutorial.assets/ss33.gif) diff --git a/VPet-Simulator.Core/Display/Main.xaml.cs b/VPet-Simulator.Core/Display/Main.xaml.cs index fd24f4a..392c602 100644 --- a/VPet-Simulator.Core/Display/Main.xaml.cs +++ b/VPet-Simulator.Core/Display/Main.xaml.cs @@ -381,6 +381,9 @@ namespace VPet_Simulator.Core private DateTime wavespan; private void MainGrid_MouseWave(object sender, MouseEventArgs e) { + if(e.LeftButton == MouseButtonState.Pressed) + return; + isPress = false; if (rasetype >= 0 || State != WorkingState.Nomal) return; diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index 2053fd3..8ba2107 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -1346,11 +1346,11 @@ namespace VPet_Simulator.Windows //ClickTexts.Add(new ClickText("有建议/游玩反馈? 来 菜单-系统-反馈中心 反馈吧")); ClickTexts.Add(new ClickText("长按脑袋拖动桌宠到你喜欢的任意位置")); - //临时聊天内容 - ClickTexts.Add(new ClickText("主人,sbema秋季促销开始了哦,还有游戏大奖赛,快去给{name}去投一票吧。")); - ClickTexts.Add(new ClickText("主人主人,{name}参加了sbeam大奖赛哦,给人家投一票喵")); - ClickTexts.Add(new ClickText("那个。。主人。。\n人家参加了sbeam大奖赛哦。能不能。。给{name}投一票呢~")); - ClickTexts.Add(new ClickText("电脑里有一款《虚拟桌宠模拟器》的游戏正在参加2023的sbeam大奖赛,快来给桌宠投一票吧")); + ////临时聊天内容 + //ClickTexts.Add(new ClickText("主人,sbema秋季促销开始了哦,还有游戏大奖赛,快去给{name}去投一票吧。")); + //ClickTexts.Add(new ClickText("主人主人,{name}参加了sbeam大奖赛哦,给人家投一票喵")); + //ClickTexts.Add(new ClickText("那个。。主人。。\n人家参加了sbeam大奖赛哦。能不能。。给{name}投一票呢~")); + //ClickTexts.Add(new ClickText("电脑里有一款《虚拟桌宠模拟器》的游戏正在参加2023的sbeam大奖赛,快来给桌宠投一票吧")); //"如果你觉得目前功能太少,那就多挂会机. 宠物会自己动的".Translate(), //"你知道吗? 你可以在设置里面修改游戏的缩放比例".Translate(), //"你现在乱点说话是说话系统的一部分,不过还没做,在做了在做了ing".Translate(), @@ -1695,7 +1695,7 @@ namespace VPet_Simulator.Windows SetTransparentHitThrough(); } - if (File.Exists(ExtensionValue.BaseDirectory + @"\Tutorial.html") && Set["SingleTips"].GetDateTime("tutorial") <= new DateTime(2023, 10, 20)) + if (File.Exists(ExtensionValue.BaseDirectory + @"\Tutorial.html") && Set["SingleTips"].GetDateTime("tutorial") <= new DateTime(2023, 10, 20) && App.MainWindows.Count == 1) { Set["SingleTips"].SetDateTime("tutorial", DateTime.Now); if (LocalizeCore.CurrentCulture == "zh-Hans") From dfa4d3df3e316f3997a86933d0b3a54b27810946 Mon Sep 17 00:00:00 2001 From: YuanYixiao0014 <1014346709@qq.com> Date: Fri, 1 Dec 2023 00:47:33 -0500 Subject: [PATCH 2/4] =?UTF-8?q?=E9=9D=A0=E8=BF=91=E8=BE=B9=E7=BC=98?= =?UTF-8?q?=E6=97=B6=E9=87=8D=E6=96=B0=E5=BD=92=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Display/MainDisplay.cs | 1 + VPet-Simulator.Core/Handle/IController.cs | 6 ++++ .../Function/MWController.cs | 29 +++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/VPet-Simulator.Core/Display/MainDisplay.cs b/VPet-Simulator.Core/Display/MainDisplay.cs index 08f3251..b325e11 100644 --- a/VPet-Simulator.Core/Display/MainDisplay.cs +++ b/VPet-Simulator.Core/Display/MainDisplay.cs @@ -28,6 +28,7 @@ namespace VPet_Simulator.Core /// public void DisplayToNomal() { + this.Core.Controller.ResetPosition(); switch (State) { default: diff --git a/VPet-Simulator.Core/Handle/IController.cs b/VPet-Simulator.Core/Handle/IController.cs index 2456661..2fd018d 100644 --- a/VPet-Simulator.Core/Handle/IController.cs +++ b/VPet-Simulator.Core/Handle/IController.cs @@ -49,6 +49,12 @@ /// 显示面板窗体 /// void ShowPanel(); + + /// + /// 在边缘时重新靠边,防止被阻挡 + /// + void ResetPosition(); + /// /// 启用计算等数据功能 /// diff --git a/VPet-Simulator.Windows/Function/MWController.cs b/VPet-Simulator.Windows/Function/MWController.cs index 939ab50..f2ebcb6 100644 --- a/VPet-Simulator.Windows/Function/MWController.cs +++ b/VPet-Simulator.Windows/Function/MWController.cs @@ -107,6 +107,35 @@ namespace VPet_Simulator.Windows panelWindow.Show(); } + public void ResetPosition() + { + mw.Dispatcher.Invoke(() => + { + if (RePostionActive) + { + if (mw.Core.Controller.GetWindowsDistanceUp() < -0.25 * mw.Height && mw.Core.Controller.GetWindowsDistanceDown() < System.Windows.SystemParameters.PrimaryScreenHeight) + { + mw.Core.Controller.MoveWindows(0, -mw.Core.Controller.GetWindowsDistanceUp() / mw.Core.Controller.ZoomRatio); + } + else if (mw.Core.Controller.GetWindowsDistanceDown() < -0.25 * mw.Height && mw.Core.Controller.GetWindowsDistanceUp() < System.Windows.SystemParameters.PrimaryScreenHeight) + { + mw.Core.Controller.MoveWindows(0, mw.Core.Controller.GetWindowsDistanceDown() / mw.Core.Controller.ZoomRatio); + } + if (mw.Core.Controller.GetWindowsDistanceLeft() < -0.25 * mw.Width && mw.Core.Controller.GetWindowsDistanceRight() < System.Windows.SystemParameters.PrimaryScreenWidth) + { + mw.Core.Controller.MoveWindows(-mw.Core.Controller.GetWindowsDistanceLeft() / mw.Core.Controller.ZoomRatio, 0); + } + else if (mw.Core.Controller.GetWindowsDistanceRight() < -0.25 * mw.Width && mw.Core.Controller.GetWindowsDistanceLeft() < System.Windows.SystemParameters.PrimaryScreenWidth) + { + mw.Core.Controller.MoveWindows(mw.Core.Controller.GetWindowsDistanceRight() / mw.Core.Controller.ZoomRatio, 0); + } + } + }); + } + + + public bool RePostionActive = true; + public double ZoomRatio => mw.Set.ZoomLevel; public int PressLength => mw.Set.PressLength; From a8107a6ea8e21aa2214a1189b2c8b652079a50f9 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Sat, 2 Dec 2023 18:12:03 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=8C=96=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E5=BD=92=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Display/MainDisplay.cs | 2 +- VPet-Simulator.Core/Graph/GraphHelper.cs | 11 ++++- VPet-Simulator.Core/Handle/IController.cs | 11 ++++- .../Function/MWController.cs | 40 ++++++++++--------- 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/VPet-Simulator.Core/Display/MainDisplay.cs b/VPet-Simulator.Core/Display/MainDisplay.cs index 807546b..752427e 100644 --- a/VPet-Simulator.Core/Display/MainDisplay.cs +++ b/VPet-Simulator.Core/Display/MainDisplay.cs @@ -28,7 +28,6 @@ namespace VPet_Simulator.Core /// public void DisplayToNomal() { - this.Core.Controller.ResetPosition(); switch (State) { default: @@ -378,6 +377,7 @@ namespace VPet_Simulator.Core break; case -1: rasetype = int.MinValue; + Core.Controller.RePostionActive = !Core.Controller.CheckPosition(); if (string.IsNullOrEmpty(name)) Display(GraphType.Raised_Static, AnimatType.C_End, DisplayToNomal); else diff --git a/VPet-Simulator.Core/Graph/GraphHelper.cs b/VPet-Simulator.Core/Graph/GraphHelper.cs index 35ce6af..7f60711 100644 --- a/VPet-Simulator.Core/Graph/GraphHelper.cs +++ b/VPet-Simulator.Core/Graph/GraphHelper.cs @@ -485,8 +485,7 @@ namespace VPet_Simulator.Core return; } } - m.MoveTimer.Enabled = false; - m.Display(Graph, AnimatType.C_End, m.DisplayToNomal); + StopMoving(m); return; } //不是:继续右边走or停下 @@ -504,6 +503,14 @@ namespace VPet_Simulator.Core return; } } + StopMoving(m); + } + + private void StopMoving(Main m) + { + if (m.Core.Controller.RePostionActive) + m.Core.Controller.ResetPosition(); + m.Core.Controller.RePostionActive = !m.Core.Controller.CheckPosition(); m.MoveTimer.Enabled = false; m.Display(Graph, AnimatType.C_End, m.DisplayToNomal); } diff --git a/VPet-Simulator.Core/Handle/IController.cs b/VPet-Simulator.Core/Handle/IController.cs index 2fd018d..9ec7a29 100644 --- a/VPet-Simulator.Core/Handle/IController.cs +++ b/VPet-Simulator.Core/Handle/IController.cs @@ -54,6 +54,10 @@ /// 在边缘时重新靠边,防止被阻挡 /// void ResetPosition(); + /// + /// 判断桌宠是否靠边 + /// + bool CheckPosition(); /// /// 启用计算等数据功能 @@ -62,6 +66,11 @@ /// /// 互动周期 /// - int InteractionCycle { get; } + int InteractionCycle { get; } + + /// + /// 是否启用边缘重新定位 + /// + bool RePostionActive { get; set; } } } diff --git a/VPet-Simulator.Windows/Function/MWController.cs b/VPet-Simulator.Windows/Function/MWController.cs index f2ebcb6..bba350b 100644 --- a/VPet-Simulator.Windows/Function/MWController.cs +++ b/VPet-Simulator.Windows/Function/MWController.cs @@ -111,30 +111,32 @@ namespace VPet_Simulator.Windows { mw.Dispatcher.Invoke(() => { - if (RePostionActive) + if (GetWindowsDistanceUp() < -0.25 * mw.Height && GetWindowsDistanceDown() < System.Windows.SystemParameters.PrimaryScreenHeight) { - if (mw.Core.Controller.GetWindowsDistanceUp() < -0.25 * mw.Height && mw.Core.Controller.GetWindowsDistanceDown() < System.Windows.SystemParameters.PrimaryScreenHeight) - { - mw.Core.Controller.MoveWindows(0, -mw.Core.Controller.GetWindowsDistanceUp() / mw.Core.Controller.ZoomRatio); - } - else if (mw.Core.Controller.GetWindowsDistanceDown() < -0.25 * mw.Height && mw.Core.Controller.GetWindowsDistanceUp() < System.Windows.SystemParameters.PrimaryScreenHeight) - { - mw.Core.Controller.MoveWindows(0, mw.Core.Controller.GetWindowsDistanceDown() / mw.Core.Controller.ZoomRatio); - } - if (mw.Core.Controller.GetWindowsDistanceLeft() < -0.25 * mw.Width && mw.Core.Controller.GetWindowsDistanceRight() < System.Windows.SystemParameters.PrimaryScreenWidth) - { - mw.Core.Controller.MoveWindows(-mw.Core.Controller.GetWindowsDistanceLeft() / mw.Core.Controller.ZoomRatio, 0); - } - else if (mw.Core.Controller.GetWindowsDistanceRight() < -0.25 * mw.Width && mw.Core.Controller.GetWindowsDistanceLeft() < System.Windows.SystemParameters.PrimaryScreenWidth) - { - mw.Core.Controller.MoveWindows(mw.Core.Controller.GetWindowsDistanceRight() / mw.Core.Controller.ZoomRatio, 0); - } + MoveWindows(0, -GetWindowsDistanceUp() / ZoomRatio); + } + else if (GetWindowsDistanceDown() < -0.25 * mw.Height && GetWindowsDistanceUp() < System.Windows.SystemParameters.PrimaryScreenHeight) + { + MoveWindows(0, GetWindowsDistanceDown() / ZoomRatio); + } + if (GetWindowsDistanceLeft() < -0.25 * mw.Width && GetWindowsDistanceRight() < System.Windows.SystemParameters.PrimaryScreenWidth) + { + MoveWindows(-GetWindowsDistanceLeft() / ZoomRatio, 0); + } + else if (GetWindowsDistanceRight() < -0.25 * mw.Width && GetWindowsDistanceLeft() < System.Windows.SystemParameters.PrimaryScreenWidth) + { + MoveWindows(GetWindowsDistanceRight() / ZoomRatio, 0); } }); } + public bool CheckPosition() => mw.Dispatcher.Invoke(() => + GetWindowsDistanceUp() < -0.25 * mw.Height && GetWindowsDistanceDown() < System.Windows.SystemParameters.PrimaryScreenHeight + || GetWindowsDistanceDown() < -0.25 * mw.Height && GetWindowsDistanceUp() < System.Windows.SystemParameters.PrimaryScreenHeight + || GetWindowsDistanceLeft() < -0.25 * mw.Width && GetWindowsDistanceRight() < System.Windows.SystemParameters.PrimaryScreenWidth + || GetWindowsDistanceRight() < -0.25 * mw.Width && GetWindowsDistanceLeft() < System.Windows.SystemParameters.PrimaryScreenWidth + ); - - public bool RePostionActive = true; + public bool RePostionActive { get; set; } = true; public double ZoomRatio => mw.Set.ZoomLevel; From 537d5ad543196164275de12d6333f00ff9dba63e Mon Sep 17 00:00:00 2001 From: ZouJin Date: Thu, 7 Dec 2023 16:31:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=90=AF=E7=94=A8DLC=E6=8F=92=E4=BB=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- VPet-Simulator.Windows/Function/CoreMOD.cs | 11 ++++++++--- .../WinDesign/winGameSetting.xaml.cs | 6 ++++-- VPet-Simulator.Windows/mklink.bat | 8 ++++++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 6bfc78d..01dfcf8 100644 --- a/.gitignore +++ b/.gitignore @@ -352,4 +352,5 @@ MigrationBackup/ *.zip *.rar *_PDLC_* -*_DLC_* \ No newline at end of file +*_DLC_* +VPet-Simulator.Windows/mod/1111_ChatGPTPlus diff --git a/VPet-Simulator.Windows/Function/CoreMOD.cs b/VPet-Simulator.Windows/Function/CoreMOD.cs index b3a58d6..180b0a7 100644 --- a/VPet-Simulator.Windows/Function/CoreMOD.cs +++ b/VPet-Simulator.Windows/Function/CoreMOD.cs @@ -16,6 +16,11 @@ namespace VPet_Simulator.Windows { public class CoreMOD { + /// + /// 自动启用MOD名称 + /// + public static readonly string[] OnModDefList = new string[] { "Core", "PCat", "ModMaker" }; + public static HashSet LoadedDLL { get; } = new HashSet() { "Panuon.WPF.dll","steam_api.dll","Panuon.WPF.UI.dll","steam_api64.dll", @@ -264,7 +269,7 @@ namespace VPet_Simulator.Windows } catch (Exception e) { - ErrorMessage = e.Message; + ErrorMessage = e.Message; SuccessLoad = false; } } @@ -274,7 +279,7 @@ namespace VPet_Simulator.Windows } } } - catch(Exception e) + catch (Exception e) { ErrorMessage = e.Message; Tag.Add("该模组已损坏"); @@ -338,7 +343,7 @@ namespace VPet_Simulator.Windows } public static bool IsOnMod(this Setting t, string ModName) { - if (ModName == "Core") + if (CoreMOD.OnModDefList.Contains(ModName)) return true; var line = t.FindLine("onmod"); if (line == null) diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs index 9485964..c0687e7 100644 --- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs @@ -547,11 +547,13 @@ namespace VPet_Simulator.Windows private void ButtonDisEnable_MouseDown(object sender, MouseButtonEventArgs e) { - if (mod.Name.ToLower() == "core") + if (mod.Name == "Core") { MessageBoxX.Show("模组 Core 为<虚拟桌宠模拟器>核心文件,无法停用".Translate(), "停用失败".Translate()); return; } + else if (CoreMOD.OnModDefList.Contains(mod.Name)) + return; mw.Set.OnModRemove(mod.Name); ShowMod(mod.Name); ButtonRestart.Visibility = Visibility.Visible; @@ -577,7 +579,7 @@ namespace VPet_Simulator.Windows MessageBoxX.Show("请先登录Steam后才能上传文件".Translate(), "上传MOD需要Steam登录".Translate(), MessageBoxIcon.Warning); return; } - if (mods.Name.ToLower() == "core") + if (CoreMOD.OnModDefList.Contains(mods.Name)) { MessageBoxX.Show("模组 Core 为<虚拟桌宠模拟器>核心文件,无法发布\n如需发布自定义内容,请复制并更改名称".Translate(), "MOD上传失败".Translate(), MessageBoxIcon.Error); return; diff --git a/VPet-Simulator.Windows/mklink.bat b/VPet-Simulator.Windows/mklink.bat index 0e1dd58..db1ffbd 100644 --- a/VPet-Simulator.Windows/mklink.bat +++ b/VPet-Simulator.Windows/mklink.bat @@ -1,9 +1,17 @@ +chcp 65001 mklink /d "%~dp0\bin\x64\Debug\net462\mod" "%~dp0\mod" + +echo ^"以下是其他相关MOD的自动链接生成, 若提示错误为正常现象,无需理会" +echo "The following is the automatic link generation for other related MODs. If an error is prompted, it is a normal phenomenon and should not be ignored" + mklink /d "%~dp0\bin\x64\Release\net462\mod" "%~dp0\mod" mklink /d "%~dp0\mod\0001_ModMaker" "%~dp0\..\..\VPet.ModMaker\0001_ModMaker" mklink /d "%~dp0\mod\1100_DemoClock" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.DemoClock\1100_DemoClock" +mklink /d "%~dp0\mod\1111_ChatGPTPlus" "%~dp0\..\..\VPet.Plugin.ChatGPTPlus\VPet.Plugin.ChatGPTPlus\1111_ChatGPTPlus" mklink /d "%~dp0\mod\1101_EdgeTTS" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.EdgeTTS\1101_EdgeTTS" mklink /d "%~dp0\mod\1110_ChatGPT" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.ChatGPT\1110_ChatGPT" + + pause \ No newline at end of file