diff --git a/VPet-Simulator.Windows.Interface/IMainWindow.cs b/VPet-Simulator.Windows.Interface/IMainWindow.cs index dc00daf..f26fd9e 100644 --- a/VPet-Simulator.Windows.Interface/IMainWindow.cs +++ b/VPet-Simulator.Windows.Interface/IMainWindow.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Windows; using System.Windows.Controls; using System.Windows.Media; +using System.Windows.Threading; using VPet_Simulator.Core; namespace VPet_Simulator.Windows.Interface @@ -188,7 +189,21 @@ namespace VPet_Simulator.Windows.Interface /// 物品 void TakeItem(Food item); - + /// + /// 显示输入框 + /// + /// 标题 + /// 文本 + /// 默认文本 + /// 结束事件 + /// 是否允许多行输入 + /// 文本居中 + /// 能否隐藏 + void Show(string title, string text, string defaulttext, Action ENDAction, bool AllowMutiLine = false, bool TextCenter = true, bool CanHide = false); + /// + /// UI线程调用位置 + /// + Dispatcher Dispatcher { get; } } } diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index 423dc41..0907c80 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -659,16 +659,19 @@ namespace VPet_Simulator.Windows { petHelper?.SetLocation(); } - //public void DEBUGValue() - //{ - // Dispatcher.Invoke(() => - // { - // Console.WriteLine("Left:" + mwc.GetWindowsDistanceLeft()); - // Console.WriteLine("Right:" + mwc.GetWindowsDistanceRight()); - // }); - // Thread.Sleep(1000); - // DEBUGValue(); - //} - // + /// + /// 显示输入框 + /// + /// 标题 + /// 文本 + /// 默认文本 + /// 结束事件 + /// 是否允许多行输入 + /// 文本居中 + /// 能否隐藏 + public void Show(string title, string text, string defaulttext, Action ENDAction, bool AllowMutiLine = false, bool TextCenter = true, bool CanHide = false) + { + winInputBox.Show(this, title, text, defaulttext, ENDAction, AllowMutiLine, TextCenter, CanHide); + } } } diff --git a/VPet-Simulator.Windows/mklink.bat b/VPet-Simulator.Windows/mklink.bat index dada308..0e4170f 100644 --- a/VPet-Simulator.Windows/mklink.bat +++ b/VPet-Simulator.Windows/mklink.bat @@ -14,5 +14,5 @@ mklink /d "%~dp0\mod\1100_DemoClock" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.D 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" - +mklink /d "%~dp0\mod\1111_MutiPlayerStream" "%~dp0\..\..\VPet.Plugin.Demo\VPet.MutiPlayer.Stream\1111_MutiPlayerStream" pause \ No newline at end of file diff --git a/VPet-Simulator.Windows/mod/1111_MutiPlayerStream b/VPet-Simulator.Windows/mod/1111_MutiPlayerStream new file mode 120000 index 0000000..0612006 --- /dev/null +++ b/VPet-Simulator.Windows/mod/1111_MutiPlayerStream @@ -0,0 +1 @@ +D:/Documents/Visual Studio 2022/Projects/VPet.Plugin.Demo/VPet.MutiPlayer.Stream/1111_MutiPlayerStream \ No newline at end of file