From 47edb068f5d07a0dd66e51b21bc7b4a40646d48c Mon Sep 17 00:00:00 2001 From: ZouJin Date: Fri, 22 Mar 2024 22:09:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=88=87=E6=8D=A2=E7=BD=AE?= =?UTF-8?q?=E9=A1=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MutiPlayer/MPFriends.xaml.cs | 31 +++++++++++++++++-- .../MutiPlayer/winMutiPlayer.xaml.cs | 1 + 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml.cs b/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml.cs index 5b1f6b8..81194ed 100644 --- a/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml.cs +++ b/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml.cs @@ -29,6 +29,7 @@ using System.Windows.Media; using ToolBar = VPet_Simulator.Core.ToolBar; using Microsoft.VisualBasic.Logging; using System.Windows.Threading; +using static VPet_Simulator.Core.ToolBar; namespace VPet_Simulator.Windows; /// @@ -166,6 +167,14 @@ public partial class MPFriends : WindowX, IMPFriend tmp = lb.GetMemberData(friend, "onmod"); } SetPetGraph = tmp; + if (lb.GetMemberData(friend, "onmod") == "true") + { + NoTouchTrue(); + } + else + { + NoTouchFalse(); + } await GameLoad(Path); @@ -195,7 +204,7 @@ public partial class MPFriends : WindowX, IMPFriend } else { - NOTouch = false; + NoTouchFalse(); } }); } @@ -204,7 +213,11 @@ public partial class MPFriends : WindowX, IMPFriend { NOTouch = true; Main.ToolBar.MenuInteract.IsEnabled = false; - + } + private void NoTouchFalse() + { + NOTouch = false; + Main.ToolBar.MenuInteract.IsEnabled = true; } private void Main_Event_TouchHead() @@ -340,6 +353,19 @@ public partial class MPFriends : WindowX, IMPFriend Main.ToolBar.AddMenuButton(ToolBar.MenuType.Interact, "捏脸".Translate(), () => DisplayPinch()); Main.ToolBar.AddMenuButton(ToolBar.MenuType.Setting, "退出访客表".Translate(), wmp.Close); + var menuItem = new MenuItem() + { + Header = "置于顶层".Translate(), + HorizontalContentAlignment = HorizontalAlignment.Center, + IsCheckable = true, + IsChecked = Topmost + }; + menuItem.Click += delegate + { + Topmost = !Topmost; + }; + Main.ToolBar.MenuSetting.Items.Add(menuItem); + Main.ToolBar.tfun.Visibility = Visibility.Collapsed; Main.EventTimer.AutoReset = false; @@ -385,6 +411,7 @@ public partial class MPFriends : WindowX, IMPFriend new Point(pin[(gdbe)"px"], pin[(gdbe)"py"]), new Size(pin[(gdbe)"sw"], pin[(gdbe)"sh"]) , DisplayPinch, true)); } + Title = "{0}的{1}".Translate(friend.Name, Core.Save.Name); LoadingText.Content = "{0}的{1}".Translate(friend.Name, Core.Save.Name); LoadingText.Background = Function.ResourcesBrush(Function.BrushType.DARKPrimaryTransA); LoadingText.VerticalAlignment = VerticalAlignment.Top; diff --git a/VPet-Simulator.Windows/MutiPlayer/winMutiPlayer.xaml.cs b/VPet-Simulator.Windows/MutiPlayer/winMutiPlayer.xaml.cs index ead0715..ffca1c0 100644 --- a/VPet-Simulator.Windows/MutiPlayer/winMutiPlayer.xaml.cs +++ b/VPet-Simulator.Windows/MutiPlayer/winMutiPlayer.xaml.cs @@ -547,6 +547,7 @@ public partial class winMutiPlayer : Window, IMPWindows private void swAllowTouch_Checked(object sender, RoutedEventArgs e) { + if (mw == null) return; lb.SetMemberData("notouch", "true"); mw.Set.MPNOTouch = false; }