添加 InputBox 接口

This commit is contained in:
ZouJin 2024-04-09 14:56:53 +08:00
parent deb7174d27
commit 0bf1ffc7e4
4 changed files with 32 additions and 13 deletions

View File

@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Threading;
using VPet_Simulator.Core; using VPet_Simulator.Core;
namespace VPet_Simulator.Windows.Interface namespace VPet_Simulator.Windows.Interface
@ -188,7 +189,21 @@ namespace VPet_Simulator.Windows.Interface
/// <param name="item">物品</param> /// <param name="item">物品</param>
void TakeItem(Food item); void TakeItem(Food item);
/// <summary>
/// 显示输入框
/// </summary>
/// <param name="title">标题</param>
/// <param name="text">文本</param>
/// <param name="defaulttext">默认文本</param>
/// <param name="ENDAction">结束事件</param>
/// <param name="AllowMutiLine">是否允许多行输入</param>
/// <param name="TextCenter">文本居中</param>
/// <param name="CanHide">能否隐藏</param>
void Show(string title, string text, string defaulttext, Action<string> ENDAction, bool AllowMutiLine = false, bool TextCenter = true, bool CanHide = false);
/// <summary>
/// UI线程调用位置
/// </summary>
Dispatcher Dispatcher { get; }
} }
} }

View File

@ -659,16 +659,19 @@ namespace VPet_Simulator.Windows
{ {
petHelper?.SetLocation(); petHelper?.SetLocation();
} }
//public void DEBUGValue() /// <summary>
//{ /// 显示输入框
// Dispatcher.Invoke(() => /// </summary>
// { /// <param name="title">标题</param>
// Console.WriteLine("Left:" + mwc.GetWindowsDistanceLeft()); /// <param name="text">文本</param>
// Console.WriteLine("Right:" + mwc.GetWindowsDistanceRight()); /// <param name="defaulttext">默认文本</param>
// }); /// <param name="ENDAction">结束事件</param>
// Thread.Sleep(1000); /// <param name="AllowMutiLine">是否允许多行输入</param>
// DEBUGValue(); /// <param name="TextCenter">文本居中</param>
//} /// <param name="CanHide">能否隐藏</param>
// public void Show(string title, string text, string defaulttext, Action<string> ENDAction, bool AllowMutiLine = false, bool TextCenter = true, bool CanHide = false)
{
winInputBox.Show(this, title, text, defaulttext, ENDAction, AllowMutiLine, TextCenter, CanHide);
}
} }
} }

View File

@ -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\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\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\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 pause

View File

@ -0,0 +1 @@
D:/Documents/Visual Studio 2022/Projects/VPet.Plugin.Demo/VPet.MutiPlayer.Stream/1111_MutiPlayerStream