From 94575885b97b17551d507b7ee32a35f5f3b7bf6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B1=B3?= Date: Wed, 3 Jul 2024 23:13:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99DanmaOnly=E5=A2=9E=E5=8A=A0=E5=9B=9E?= =?UTF-8?q?=E8=BD=A6=E5=8F=91=E9=80=81=E5=BC=B9=E5=B9=95=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Desktop/Views/Windows/DanmaOnlyWindow.xaml | 2 +- Desktop/Views/Windows/DanmaOnlyWindow.xaml.cs | 14 ++++++++++++++ Desktop/Views/Windows/VlcPlayWindow.xaml.cs | 1 - 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Desktop/Views/Windows/DanmaOnlyWindow.xaml b/Desktop/Views/Windows/DanmaOnlyWindow.xaml index 53746e70..956d5768 100644 --- a/Desktop/Views/Windows/DanmaOnlyWindow.xaml +++ b/Desktop/Views/Windows/DanmaOnlyWindow.xaml @@ -35,7 +35,7 @@ - + diff --git a/Desktop/Views/Windows/DanmaOnlyWindow.xaml.cs b/Desktop/Views/Windows/DanmaOnlyWindow.xaml.cs index 132373bf..44b36567 100644 --- a/Desktop/Views/Windows/DanmaOnlyWindow.xaml.cs +++ b/Desktop/Views/Windows/DanmaOnlyWindow.xaml.cs @@ -163,5 +163,19 @@ private void DanmaOnly_DanmaInput_TextChanged(object sender, TextChangedEventArg textBox.SelectionStart = selectionStart > 20 ? 20 : selectionStart; } } + + private void DanmaOnly_DanmaInput_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) + { + if (e.KeyStates == Keyboard.GetKeyStates(Key.Enter)) + { + string T = DanmaOnly_DanmaInput.Text; + if (string.IsNullOrEmpty(T) && T.Length > 20) + { + return; + } + Danmu.SendDanmu(roomCard.RoomId.ToString(), T); + DanmaOnly_DanmaInput.Clear(); + } + } } } diff --git a/Desktop/Views/Windows/VlcPlayWindow.xaml.cs b/Desktop/Views/Windows/VlcPlayWindow.xaml.cs index 471809e4..cee01313 100644 --- a/Desktop/Views/Windows/VlcPlayWindow.xaml.cs +++ b/Desktop/Views/Windows/VlcPlayWindow.xaml.cs @@ -407,7 +407,6 @@ private void AddDanmu(string DanmuText, bool IsSubtitle, long uid = 0) break; } } - double b = Core.Init.GetRunTime(); danMuOrbitInfos[Index].Time = (int)(Init.GetRunTime() + 5); //非UI线程调用UI组件 System.Windows.Application.Current.Dispatcher.Invoke(async () =>