diff --git a/VPet-Simulator.Core/Display/Main.xaml b/VPet-Simulator.Core/Display/Main.xaml index c779c2c..4c86f65 100644 --- a/VPet-Simulator.Core/Display/Main.xaml +++ b/VPet-Simulator.Core/Display/Main.xaml @@ -1,6 +1,5 @@  @@ -8,6 +7,7 @@ + diff --git a/VPet-Simulator.Core/Display/Main.xaml.cs b/VPet-Simulator.Core/Display/Main.xaml.cs index e33ffff..e44a5bb 100644 --- a/VPet-Simulator.Core/Display/Main.xaml.cs +++ b/VPet-Simulator.Core/Display/Main.xaml.cs @@ -106,6 +106,14 @@ namespace VPet_Simulator.Core Core.TouchEvent.Add(new TouchArea(Core.Graph.GraphConfig.TouchHeadLocate, Core.Graph.GraphConfig.TouchHeadSize, DisplayTouchHead)); Core.TouchEvent.Add(new TouchArea(Core.Graph.GraphConfig.TouchRaisedLocate, Core.Graph.GraphConfig.TouchRaisedSize, DisplayRaised, true)); } + /// + /// 播放语音 + /// + /// 语音位置 + public void PlayVoice(Uri VoicePath) + { + VoicePlayer.Source = VoicePath; + } private void SmartMoveTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { diff --git a/VPet-Simulator.Core/Display/MainLogic.cs b/VPet-Simulator.Core/Display/MainLogic.cs index bd2ef16..05a4067 100644 --- a/VPet-Simulator.Core/Display/MainLogic.cs +++ b/VPet-Simulator.Core/Display/MainLogic.cs @@ -38,17 +38,20 @@ namespace VPet_Simulator.Core /// 说话内容 public void Say(string text, GraphCore.Helper.SayType type = GraphCore.Helper.SayType.Shining) { - OnSay?.Invoke(text); - if (type != GraphCore.Helper.SayType.None && DisplayType == GraphCore.GraphType.Default) - Display(GraphCore.Helper.Convert(type, GraphCore.Helper.AnimatType.A_Start), () => + Task.Run(() => + { + OnSay?.Invoke(text); + 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, type)); + Saying(type); + }); + else { Dispatcher.Invoke(() => MsgBar.Show(Core.Save.Name, text, type)); - Saying(type); - }); - else - { - Dispatcher.Invoke(() => MsgBar.Show(Core.Save.Name, text, type)); - } + } + }); } public void Saying(GraphCore.Helper.SayType type)