diff --git a/VPet-Simulator.Core/Display/ToolBar.xaml b/VPet-Simulator.Core/Display/ToolBar.xaml index 059dddd..7b40c8b 100644 --- a/VPet-Simulator.Core/Display/ToolBar.xaml +++ b/VPet-Simulator.Core/Display/ToolBar.xaml @@ -109,7 +109,7 @@ diff --git a/VPet-Simulator.Core/VPet-Simulator.Core.csproj b/VPet-Simulator.Core/VPet-Simulator.Core.csproj index 8c5d80e..2589545 100644 --- a/VPet-Simulator.Core/VPet-Simulator.Core.csproj +++ b/VPet-Simulator.Core/VPet-Simulator.Core.csproj @@ -26,7 +26,7 @@ - + diff --git a/VPet-Simulator.Windows.Interface/MPMessage.cs b/VPet-Simulator.Windows.Interface/MPMessage.cs index ac4658e..6818db0 100644 --- a/VPet-Simulator.Windows.Interface/MPMessage.cs +++ b/VPet-Simulator.Windows.Interface/MPMessage.cs @@ -5,6 +5,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Interop; +using VPet_Simulator.Core; namespace VPet_Simulator.Windows.Interface; @@ -23,9 +25,9 @@ public struct MPMessage /// Empty, /// - /// 聊天消息 (string) + /// 聊天消息 (chat) /// - Message, + Chat, /// /// 显示动画 (graphinfo) /// @@ -51,7 +53,7 @@ public struct MPMessage /// /// 消息内容 /// - [Line] public string Content { get; set; } + [Line] private string Content { get; set; } /// /// 被操作者 (显示动画用) /// @@ -59,4 +61,49 @@ public struct MPMessage public static byte[] ConverTo(MPMessage data) => Encoding.UTF8.GetBytes(LPSConvert.SerializeObject(data).ToString()); public static MPMessage ConverTo(byte[] data) => LPSConvert.DeserializeObject(new LPS(Encoding.UTF8.GetString(data))); + + public void SetContent(object content) + { + Content = LPSConvert.GetObjectString(content, convertNoneLineAttribute: true); + } + public T GetContent() + { + return (T)LPSConvert.GetStringObject(Content, typeof(T), convertNoneLineAttribute: true); + } + /// + /// 聊天结构 + /// + public struct Chat + { + /// + /// 聊天内容 + /// + public string Content { get; set; } + /// + /// 消息类型 + /// + public enum Type + { + /// + /// 私有 + /// + Private, + /// + /// 半公开 + /// + Internal, + /// + /// 公开 + /// + Public + } + /// + /// 聊天类型 + /// + public Type ChatType { get; set; } + /// + /// 发送者名字 + /// + public string SendName { get; set; } + } } diff --git a/VPet-Simulator.Windows.Interface/TalkBox.xaml b/VPet-Simulator.Windows.Interface/TalkBox.xaml index 26bc2bb..0a97e02 100644 --- a/VPet-Simulator.Windows.Interface/TalkBox.xaml +++ b/VPet-Simulator.Windows.Interface/TalkBox.xaml @@ -6,7 +6,7 @@ xmlns:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF" mc:Ignorable="d" xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" Height="500" Width="500" VerticalAlignment="Top"> + VerticalAlignment="Top" Margin="5" CornerRadius="5" Padding="5,5,5,3"> diff --git a/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj b/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj index c8a798d..c64364b 100644 --- a/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj +++ b/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj @@ -19,6 +19,6 @@ - + \ No newline at end of file diff --git a/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml b/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml index 83191ef..699ec20 100644 --- a/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml +++ b/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml @@ -10,6 +10,30 @@ + + + + + + + + + + + +