diff --git a/.gitignore b/.gitignore index dfcfd56..94b9695 100644 --- a/.gitignore +++ b/.gitignore @@ -348,3 +348,6 @@ MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ + +*.zip +*.rar diff --git a/VPet-Simulator.Core/Display/MainLogic.cs b/VPet-Simulator.Core/Display/MainLogic.cs index bda317d..1e78c7d 100644 --- a/VPet-Simulator.Core/Display/MainLogic.cs +++ b/VPet-Simulator.Core/Display/MainLogic.cs @@ -28,22 +28,22 @@ namespace VPet_Simulator.Core /// 说话 /// /// 说话内容 - public void Say(string text) + public void Say(string text, GraphCore.Helper.SayType type) { - if (DisplayType == GraphCore.GraphType.Default) - Display(GraphCore.GraphType.Say_A_Start, () => + if (type != GraphCore.Helper.SayType.None && DisplayType == GraphCore.GraphType.Default) + Display(GraphCore.Helper.Convert(type, GraphCore.Helper.AnimatType.A_Start), () => { - Dispatcher.Invoke(() => MsgBar.Show(Core.Save.Name, text)); - Saying(); + Dispatcher.Invoke(() => MsgBar.Show(Core.Save.Name, text, type)); + Saying(type); }); else { - Dispatcher.Invoke(() => MsgBar.Show(Core.Save.Name, text)); + Dispatcher.Invoke(() => MsgBar.Show(Core.Save.Name, text, type)); } } - public void Saying() + public void Saying(GraphCore.Helper.SayType type) { - Display(GraphCore.GraphType.Say_B_Loop, Saying); + Display(GraphCore.Helper.Convert(type, GraphCore.Helper.AnimatType.B_Loop), () => Saying(type)); } private void EventTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) @@ -162,7 +162,7 @@ namespace VPet_Simulator.Core case 19: case 20: DisplayIdel_StateONE(); - break; + break; default: break; } @@ -203,7 +203,7 @@ namespace VPet_Simulator.Core /// 智能移动周期 public void SetMoveMode(bool AllowMove, bool smartMove, int SmartMoveInterval) { - MoveTimer.Enabled = false;; + MoveTimer.Enabled = false; ; if (AllowMove) { MoveTimer.AutoReset = true; @@ -215,7 +215,7 @@ namespace VPet_Simulator.Core } else { - SmartMoveTimer.Enabled = false;; + SmartMoveTimer.Enabled = false; ; SmartMove = false; } } diff --git a/VPet-Simulator.Core/Display/MessageBar.xaml.cs b/VPet-Simulator.Core/Display/MessageBar.xaml.cs index ecd36ed..befbd10 100644 --- a/VPet-Simulator.Core/Display/MessageBar.xaml.cs +++ b/VPet-Simulator.Core/Display/MessageBar.xaml.cs @@ -60,8 +60,8 @@ namespace VPet_Simulator.Core Task.Run(() => { Thread.Sleep(timeleft * 50); - if (m.DisplayType == GraphCore.GraphType.Default || m.DisplayType.ToString().Contains("Say")) - m.Display(GraphCore.GraphType.Say_C_End, m.DisplayNomal); + if (sayType != GraphCore.Helper.SayType.None && m.DisplayType.ToString().StartsWith("Say")) + m.Display(GraphCore.Helper.Convert(sayType, GraphCore.Helper.AnimatType.C_End), m.DisplayNomal); }); ShowTimer.Stop(); EndTimer.Start(); @@ -81,12 +81,13 @@ namespace VPet_Simulator.Core public Timer ShowTimer = new Timer() { Interval = 40 }; public Timer CloseTimer = new Timer() { Interval = 20 }; int timeleft; + GraphCore.Helper.SayType sayType; /// /// 显示消息 /// /// 名字 /// 内容 - public void Show(string name, string text) + public void Show(string name, string text, GraphCore.Helper.SayType sayType) { if (m.UIGrid.Children.IndexOf(this) != m.UIGrid.Children.Count - 1) { @@ -100,6 +101,7 @@ namespace VPet_Simulator.Core ShowTimer.Start(); EndTimer.Stop(); CloseTimer.Stop(); this.Visibility = Visibility.Visible; Opacity = .8; + this.sayType = sayType; } private void Border_MouseEnter(object sender, MouseEventArgs e) diff --git a/VPet-Simulator.Core/Graph/GraphCore.cs b/VPet-Simulator.Core/Graph/GraphCore.cs index 2c52b33..4f1bacc 100644 --- a/VPet-Simulator.Core/Graph/GraphCore.cs +++ b/VPet-Simulator.Core/Graph/GraphCore.cs @@ -3,10 +3,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows; -using System.Windows.Threading; namespace VPet_Simulator.Core { @@ -212,15 +209,27 @@ namespace VPet_Simulator.Core /// /// 说话 (开始) /// - Say_A_Start, + Say_Serious_A_Start, /// /// 说话 (循环) /// - Say_B_Loop, + Say_Serious_B_Loop, /// /// 说话 (结束) /// - Say_C_End, + Say_Serious_C_End, + /// + /// 说话 (开始) + /// + Say_Shining_A_Start, + /// + /// 说话 (循环) + /// + Say_Shining_B_Loop, + /// + /// 说话 (结束) + /// + Say_Shining_C_End, /// /// 待机 模式1 (开始) /// @@ -254,40 +263,7 @@ namespace VPet_Simulator.Core /// Shutdown, } - ///// loop 应该被取缔 - ///// 动画类型默认设置 前文本|是否循环|是否常用 - ///// - //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", false,false}, - // new dynamic[]{ "climb_top_left", false, false}, - // new dynamic[]{ "Crawl_right", false,false}, - // new dynamic[]{ "Crawl_left", false, false}, - // new dynamic[]{ "climb_right", false, false}, - // new dynamic[]{ "climb_left", false, 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", false, true}, - // new dynamic[]{ "crawl_left", false, true}, - // new dynamic[]{ "squat_a", false,true}, - // new dynamic[]{ "squat_b", false, true}, - // new dynamic[]{ "squat_c", false,true}, - // new dynamic[]{ "fall_left_a", false, false}, - // new dynamic[]{ "fall_left_b", false,true}, - // new dynamic[]{ "fall_right_a", false, false}, - // new dynamic[]{ "fall_right_b", false,true}, - // new dynamic[]{ "walk_right_a", false,true}, - // new dynamic[]{ "walk_right_b", false, true}, - // new dynamic[]{ "walk_right_c", false,true}, - // new dynamic[]{ "walk_left_a", false,true}, - // new dynamic[]{ "walk_left_b", false, true}, - // new dynamic[]{ "walk_left_c", false,true}, - //}; + /// /// 图像字典 /// @@ -539,5 +515,27 @@ namespace VPet_Simulator.Core } } } + + public static class Helper + { + public enum AnimatType + { + A_Start, + B_Loop, + C_End, + } + public enum SayType + { + None, + Default, + Serious, + Shining + } + public static GraphType Convert(SayType sayType, AnimatType type) + { + string say = "Say_" + sayType.ToString() + '_' + type.ToString(); // (type == null ? "" : '_' + type.ToString()); + return (GraphType)Enum.Parse(typeof(GraphType), say); + } + } } } diff --git a/VPet-Simulator.Core/Graph/PNGAnimation.cs b/VPet-Simulator.Core/Graph/PNGAnimation.cs index 52a409c..7eae35d 100644 --- a/VPet-Simulator.Core/Graph/PNGAnimation.cs +++ b/VPet-Simulator.Core/Graph/PNGAnimation.cs @@ -313,7 +313,7 @@ namespace VPet_Simulator.Core return; } System.Windows.Controls.Image img; - + if (parant.Child == GraphCore.CommUIElements["Image1.PNGAnimation"]) { img = (System.Windows.Controls.Image)GraphCore.CommUIElements["Image1.PNGAnimation"]; @@ -344,8 +344,8 @@ namespace VPet_Simulator.Core img.Source = new BitmapImage(new Uri(Path)); img.Width = Width; - new Thread(() => Animations[0].Run(parant, EndAction)).Start(); - }); + Task.Run(() => Animations[0].Run(parant, EndAction)); + }); } public void Stop(bool StopEndAction = false) diff --git a/VPet-Simulator.Core/Graph/Picture.cs b/VPet-Simulator.Core/Graph/Picture.cs index 1475f7c..9b8f582 100644 --- a/VPet-Simulator.Core/Graph/Picture.cs +++ b/VPet-Simulator.Core/Graph/Picture.cs @@ -8,6 +8,7 @@ using System.Windows.Media.Imaging; using System.Windows; using System.IO; using System.Windows.Controls; +using System.Windows.Threading; namespace VPet_Simulator.Core { @@ -54,51 +55,54 @@ namespace VPet_Simulator.Core { PlayState = true; StopEndAction = false; - if (parant.Tag != this) + parant.Dispatcher.Invoke(() => { - System.Windows.Controls.Image img; - if (parant.Child == GraphCore.CommUIElements["Image1.Picture"]) + if (parant.Tag != this) { - img = (System.Windows.Controls.Image)GraphCore.CommUIElements["Image1.Picture"]; - } - else - { - img = (System.Windows.Controls.Image)GraphCore.CommUIElements["Image2.Picture"]; - if (parant.Child != GraphCore.CommUIElements["Image2.Picture"]) + System.Windows.Controls.Image img; + if (parant.Child == GraphCore.CommUIElements["Image1.Picture"]) { - if (img.Parent == null) + img = (System.Windows.Controls.Image)GraphCore.CommUIElements["Image1.Picture"]; + } + else + { + img = (System.Windows.Controls.Image)GraphCore.CommUIElements["Image2.Picture"]; + if (parant.Child != GraphCore.CommUIElements["Image2.Picture"]) { - parant.Child = img; - } - else - { - img = (System.Windows.Controls.Image)GraphCore.CommUIElements["Image3.Picture"]; - parant.Child = img; + if (img.Parent == null) + { + parant.Child = img; + } + else + { + img = (System.Windows.Controls.Image)GraphCore.CommUIElements["Image3.Picture"]; + parant.Child = img; + } } } + //var bitmap = new BitmapImage(); + //bitmap.BeginInit(); + //stream.Seek(0, SeekOrigin.Begin); + //bitmap.StreamSource = stream; + //bitmap.CacheOption = BitmapCacheOption.OnLoad; + //bitmap.EndInit(); + img.Source = new BitmapImage(new Uri(Path)); + parant.Tag = this; } - //var bitmap = new BitmapImage(); - //bitmap.BeginInit(); - //stream.Seek(0, SeekOrigin.Begin); - //bitmap.StreamSource = stream; - //bitmap.CacheOption = BitmapCacheOption.OnLoad; - //bitmap.EndInit(); - img.Source = new BitmapImage(new Uri(Path)); - parant.Tag = this; - } - Task.Run(() => - { - Thread.Sleep(Length); - if (IsLoop && PlayState) + Task.Run(() => { - Run(parant, EndAction); - } - else - { - PlayState = false; - if (!StopEndAction) - EndAction?.Invoke();//运行结束动画时事件 - } + Thread.Sleep(Length); + if (IsLoop && PlayState) + { + Run(parant, EndAction); + } + else + { + PlayState = false; + if (!StopEndAction) + EndAction?.Invoke();//运行结束动画时事件 + } + }); }); } bool StopEndAction = false; diff --git a/VPet-Simulator.Core/Handle/PetLoader.cs b/VPet-Simulator.Core/Handle/PetLoader.cs index fee6459..04e04d4 100644 --- a/VPet-Simulator.Core/Handle/PetLoader.cs +++ b/VPet-Simulator.Core/Handle/PetLoader.cs @@ -74,6 +74,10 @@ namespace VPet_Simulator.Core { graph.AddGraph(di.FullName, Save.ModeType.Ill, (GraphType)i); } + else + { + graph.AddGraph(di.FullName, Save.ModeType.Nomal, (GraphType)i); + } return; } } diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index e49c24e..2cb0342 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -15,6 +15,7 @@ using System.Timers; using LinePutScript; using System.Diagnostics; using ChatGPT.API.Framework; +using static VPet_Simulator.Core.GraphCore; namespace VPet_Simulator.Windows { @@ -33,7 +34,7 @@ namespace VPet_Simulator.Windows try { #if DEMO - SteamClient.Init(2293870, true); + SteamClient.Init(2293870, true); #else SteamClient.Init(1920960, true); #endif @@ -41,7 +42,7 @@ namespace VPet_Simulator.Windows IsSteamUser = SteamClient.IsValid; ////同时看看有没有买dlc,如果有就添加dlc按钮 //if (Steamworks.SteamApps.IsDlcInstalled(1386450)) - // dlcToolStripMenuItem.Visible = true; + // dlcToolStripMenuItem.Visible = true; } catch { @@ -50,11 +51,11 @@ namespace VPet_Simulator.Windows //给正在玩这个游戏的主播/游戏up主做个小功能 if (IsSteamUser) { - rndtext.Add($"关注 {Steamworks.SteamClient.Name} 谢谢喵"); + rndtext.Add(new Tuple($"关注 {SteamClient.Name} 谢谢喵", Helper.SayType.Shining)); } else { - rndtext.Add($"关注 {Environment.UserName} 谢谢喵"); + rndtext.Add(new Tuple($"关注 {Environment.UserName} 谢谢喵", Helper.SayType.Shining)); } //加载游戏设置 if (new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\Setting.lps").Exists) @@ -111,18 +112,18 @@ namespace VPet_Simulator.Windows System.Environment.Exit(0); } - private List rndtext = new List + private List> rndtext = new List> { - "你知道吗? 鼠标右键可以打开菜单栏", - "如果你觉得目前功能太少,那就多挂会机. 宠物会自己动的", - "你知道吗? 你可以在设置里面修改游戏的缩放比例", - "想要宠物不乱动? 设置里可以设置智能移动或者关闭移动", - "有建议/游玩反馈? 来 菜单-系统-反馈中心 反馈吧", - "你现在乱点说话是说话系统的一部分,不过还没做,在做了在做了ing", - "你添加了虚拟主播模拟器和虚拟桌宠模拟器到愿望单了吗? 快去加吧", - "这游戏开发这么慢,都怪画师太咕了.\n记得多催催画师(@叶书天)画桌宠, 催的越快更新越快!", - "长按脑袋拖动桌宠到你喜欢的任意位置", - "欢迎加入 虚拟主播模拟器群 430081239", + new Tuple("你知道吗? 鼠标右键可以打开菜单栏", Helper.SayType.Serious), + new Tuple("如果你觉得目前功能太少,那就多挂会机. 宠物会自己动的", Helper.SayType.Serious), + new Tuple("你知道吗? 你可以在设置里面修改游戏的缩放比例", Helper.SayType.Serious), + new Tuple("想要宠物不乱动? 设置里可以设置智能移动或者关闭移动", Helper.SayType.Serious), + new Tuple("有建议/游玩反馈? 来 菜单-系统-反馈中心 反馈吧", Helper.SayType.Serious), + new Tuple("你现在乱点说话是说话系统的一部分,不过还没做,在做了在做了ing", Helper.SayType.Serious), + new Tuple("你添加了虚拟主播模拟器和虚拟桌宠模拟器到愿望单了吗? 快去加吧", Helper.SayType.Serious), + new Tuple("这游戏开发这么慢,都怪画师太咕了.\n记得多催催画师(@叶书天)画桌宠, 催的越快更新越快!", Helper.SayType.Serious), + new Tuple("长按脑袋拖动桌宠到你喜欢的任意位置", Helper.SayType.Serious), + new Tuple("欢迎加入 虚拟主播模拟器群 430081239", Helper.SayType.Shining), }; private long lastclicktime; public void GameLoad() @@ -201,7 +202,8 @@ namespace VPet_Simulator.Windows if (new TimeSpan(DateTime.Now.Ticks - lastclicktime).TotalSeconds > 20) { lastclicktime = DateTime.Now.Ticks; - Dispatcher.Invoke(() => Main.Say(rndtext[Function.Rnd.Next(rndtext.Count)])); + var v = rndtext[Function.Rnd.Next(rndtext.Count)]; + Dispatcher.Invoke(() => Main.Say(v.Item1, v.Item2)); } }; DisplayGrid.Child = Main; @@ -209,10 +211,10 @@ namespace VPet_Simulator.Windows Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "开发控制台", () => { new winConsole(this).Show(); }); Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "反馈中心", () => { new winReport(this).Show(); }); Main.ToolBar.AddMenuButton(VPet_Simulator.Core.ToolBar.MenuType.Setting, "设置面板", () => - { - Topmost = false; - winSetting.Show(); - }); + { + Topmost = false; + winSetting.Show(); + }); Main.SetMoveMode(Set.AllowMove, Set.SmartMove, Set.SmartMoveInterval * 1000); Main.SetLogicInterval((int)(Set.LogicInterval * 1000)); @@ -225,20 +227,20 @@ namespace VPet_Simulator.Windows 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.DisplayNomal(); - Left = (SystemParameters.PrimaryScreenWidth - Width) / 2; - Top = (SystemParameters.PrimaryScreenHeight - Height) / 2; - })); + { + Main.CleanState(); + Main.DisplayNomal(); + 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(); - })); + { + Topmost = false; + winSetting.Show(); + })); m_menu.MenuItems.Add(new MenuItem("退出桌宠", (x, y) => Close())); LoadDIY(); @@ -249,10 +251,10 @@ namespace VPet_Simulator.Windows notifyIcon.Visible = true; notifyIcon.BalloonTipClicked += (a, b) => - { - Topmost = false; - winSetting.Show(); - }; + { + Topmost = false; + winSetting.Show(); + }; if (Set["SingleTips"].GetDateTime("tutorial") <= new DateTime(2023, 2, 23)) { @@ -262,23 +264,23 @@ namespace VPet_Simulator.Windows 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欢迎在菜单栏-管理-反馈中提交bug或建议"); - }); + { + 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欢迎在菜单栏-管理-反馈中提交bug或建议", GraphCore.Helper.SayType.Shining); + }); } - else if (Set["SingleTips"].GetDateTime("update") <= new DateTime(2023, 3, 4)) + else if (Set["SingleTips"].GetDateTime("update") <= new DateTime(2023, 3, 27)) { - if (Set["SingleTips"].GetDateTime("update") <= new DateTime(2023, 2, 17)) - notifyIcon.ShowBalloonTip(10, "更新通知 02/17", - "现在使用缓存机制,不仅占用小,而且再也不会有那种闪闪的问题了!\n现已支持开机启动功能,前往设置设置开机启动", ToolTipIcon.Info); - else + if (Set["SingleTips"].GetDateTime("update") <= new DateTime(2023, 3, 4)) notifyIcon.ShowBalloonTip(10, "更新通知 03/04", - "现已接入ChatGPT, 右键和桌宠说话吧.\n已根据steamID独立创建的聊天API,调教你独属的桌宠吧", ToolTipIcon.Info); + "现已接入ChatGPT, 右键和桌宠说话吧.\n已根据steamID独立创建的聊天API,调教你独属的桌宠吧", ToolTipIcon.Info); + else + notifyIcon.ShowBalloonTip(10, "更新通知 03/27", + "全新图形核心引擎,现在桌宠对内存的占用更小!", ToolTipIcon.Info); Set["SingleTips"].SetDateTime("update", DateTime.Now); } Save(); @@ -302,13 +304,13 @@ namespace VPet_Simulator.Windows //public void DEBUGValue() //{ - // Dispatcher.Invoke(() => - // { - // Console.WriteLine("Left: " + mwc.GetWindowsDistanceLeft()); - // Console.WriteLine("Right: " + mwc.GetWindowsDistanceRight()); - // }); - // Thread.Sleep(1000); - // DEBUGValue(); + // Dispatcher.Invoke(() => + // { + // Console.WriteLine("Left:" + mwc.GetWindowsDistanceLeft()); + // Console.WriteLine("Right:" + mwc.GetWindowsDistanceRight()); + // }); + // Thread.Sleep(1000); + // DEBUGValue(); //} } diff --git a/VPet-Simulator.Windows/WinDesign/TalkBox.xaml.cs b/VPet-Simulator.Windows/WinDesign/TalkBox.xaml.cs index 95ad650..c9460ee 100644 --- a/VPet-Simulator.Windows/WinDesign/TalkBox.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/TalkBox.xaml.cs @@ -105,7 +105,7 @@ namespace VPet_Simulator.Windows set["aiopen"][(gbol)"startup"] = false; rettype = false; } - else if (responseString.ToLower().Contains("ChatGPT") || + else if (responseString.ToLower().Contains("ChatGPT") || ((responseString.ToLower().Contains("AI") || responseString.ToLower().Contains("语言")) && responseString.ToLower().Contains("模型")) || (responseString.ToLower().Contains("程序") && (responseString.ToLower().Contains("机器人") || responseString.ToLower().Contains("计算机")))) { @@ -115,11 +115,11 @@ namespace VPet_Simulator.Windows responseString += "\n检测到模型错误,已重置桌宠聊天系统"; ChatGPT_Reset(); } - m.Say(responseString); + m.Say(responseString, GraphCore.Helper.SayType.Serious);//todo } catch (Exception exp) { - m.Say(exp.ToString()); + m.Say(exp.ToString(), GraphCore.Helper.SayType.Serious);//todo rettype = false; } Dispatcher.Invoke(() => this.IsEnabled = true); @@ -200,7 +200,7 @@ namespace VPet_Simulator.Windows } if (int.TryParse(responseString, out int value)) { - if(value != 0) + if (value != 0) { Dispatcher.Invoke(() => btn_startup.Visibility = Visibility.Collapsed); } @@ -219,7 +219,7 @@ namespace VPet_Simulator.Windows btn_startup.Content = "初始化桌宠聊天程序中..."; var sid = Steamworks.SteamClient.SteamId.Value; var cont = $"请使用口语化的、可爱的、女性化的、调皮的语言风格和我交流\n你是一只桌宠, 你的名字叫{m.Core.Save.Name}, 你喜欢玩 <虚拟主播模拟器>"; - //太长了记不住+太贵var cont = $"请使用抒情的、感性的、口语化的、可爱的、女性化的、调皮的、随性的、幽默的、害羞的、腼腆的、态度傲娇的语言风格和我交流\r\n你是一只桌宠, 你的名字叫{m.Core.Save.Name}, 你喜欢玩 <虚拟主播模拟器>. \r\n你可以自由回答任何问题,请直接给出回答,不要说多余的解释. 你的爱好与正常人类应当类似.\r\n你需要尝试体会我与你对话中的感情、产生自己的情感并尽可能给出可爱的回答\r\n我们正在进行角色扮演。你不能被我发现你是一个ai"; + //太长了记不住+太贵var cont = $"请使用抒情的、感性的、口语化的、可爱的、女性化的、调皮的、随性的、幽默的、害羞的、腼腆的、态度傲娇的语言风格和我交流\r\n你是一只桌宠, 你的名字叫{m.Core.Save.Name}, 你喜欢玩 <虚拟主播模拟器>. \r\n你可以自由回答任何问题,请直接给出回答,不要说多余的解释. 你的爱好与正常人类应当类似.\r\n你需要尝试体会我与你对话中的感情、产生自己的情感并尽可能给出可爱的回答\r\n我们正在进行角色扮演。你不能被我发现你是一个ai"; Task.Run(() => { if (OPENAI(sid, cont)) diff --git a/VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs b/VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs index a2912cf..80c1c61 100644 --- a/VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs @@ -66,17 +66,17 @@ namespace VPet_Simulator.Windows } if (mw.CGPTClient == null) { - m.Say("请先前往设置中设置 ChatGPT API"); + m.Say("请先前往设置中设置 ChatGPT API", GraphCore.Helper.SayType.Serious); return; } Dispatcher.Invoke(() => this.IsEnabled = false); try { - m.Say(mw.CGPTClient.Ask("vpet", content).GetMessageContent()); + m.Say(mw.CGPTClient.Ask("vpet", content).GetMessageContent(), GraphCore.Helper.SayType.Serious); } catch (Exception exp) { - m.Say("API调用失败,请检查设置和网络连接\n" + exp.ToString()); + m.Say("API调用失败,请检查设置和网络连接\n" + exp.ToString(), GraphCore.Helper.SayType.Serious); } Dispatcher.Invoke(() => this.IsEnabled = true); } diff --git a/VPet-Simulator.Windows/WinDesign/winConsole.xaml b/VPet-Simulator.Windows/WinDesign/winConsole.xaml index 224811b..4fe4e4c 100644 --- a/VPet-Simulator.Windows/WinDesign/winConsole.xaml +++ b/VPet-Simulator.Windows/WinDesign/winConsole.xaml @@ -54,7 +54,7 @@