From f8b482819bada679b6e55ab71760fe4c6957a4e3 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Thu, 24 Aug 2023 00:31:24 +1000 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=BF=9E=E7=BB=AD=E5=90=83?= =?UTF-8?q?=E4=B8=9C=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WinDesign/winBetterBuy.xaml.cs | 64 +++++++++++-------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml.cs b/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml.cs index 11f78da..f7d32c9 100644 --- a/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml.cs @@ -50,7 +50,7 @@ namespace VPet_Simulator.Windows public void Show(Food.FoodType type) { mw.Topmost = false; - IsEnabled = true;//逃出 + showeatanm = true;//逃出 if (_searchTextBox != null) _searchTextBox.Text = ""; if (LsbCategory.SelectedIndex == (int)type) @@ -110,6 +110,7 @@ namespace VPet_Simulator.Windows IOrderedEnumerable ordered; switch (sortrule) { + default: case 0: if (sortasc) ordered = foods.OrderBy(x => x.TranslateName); @@ -146,12 +147,18 @@ namespace VPet_Simulator.Windows else ordered = foods.OrderByDescending(x => x.Feeling); break; - default: + case 6: if (sortasc) ordered = foods.OrderBy(x => x.Health); else ordered = foods.OrderByDescending(x => x.Health); break; + case 7: + if (sortasc) + ordered = foods.OrderBy(x => x.Exp); + else + ordered = foods.OrderByDescending(x => x.Exp); + break; } Dispatcher.Invoke(() => { @@ -185,12 +192,13 @@ namespace VPet_Simulator.Windows //eventArg.Source = sender; //PageDetail.RaiseEvent(eventArg); } + bool showeatanm = true; private void BtnBuy_Click(object sender, RoutedEventArgs e) { var Button = sender as Button; var item = Button.DataContext as Food; - IsEnabled = false; + //看是什么模式 if (mw.Set.EnableFunction) { @@ -254,30 +262,34 @@ namespace VPet_Simulator.Windows } } - GraphType gt; - switch (item.Type) - { - default: - gt = GraphType.Eat; - break; - case Food.FoodType.Drink: - gt = GraphType.Drink; - break; - case Food.FoodType.Gift: - gt = GraphType.Gift; - break; - } - var name = mw.Core.Graph.FindName(gt); - var ig = mw.Core.Graph.FindGraph(name, AnimatType.Single, mw.Core.Save.Mode); - if (ig != null) - { - var b = mw.Main.FindDisplayBorder(ig); - ig.Run(b, item.ImageSource, () => + if (showeatanm) + {//显示动画 + showeatanm = false; + GraphType gt; + switch (item.Type) { - Dispatcher.Invoke(() => IsEnabled = true); - mw.Main.DisplayToNomal(); - mw.Main.EventTimer_Elapsed(); - }); + default: + gt = GraphType.Eat; + break; + case Food.FoodType.Drink: + gt = GraphType.Drink; + break; + case Food.FoodType.Gift: + gt = GraphType.Gift; + break; + } + var name = mw.Core.Graph.FindName(gt); + var ig = mw.Core.Graph.FindGraph(name, AnimatType.Single, mw.Core.Save.Mode); + if (ig != null) + { + var b = mw.Main.FindDisplayBorder(ig); + ig.Run(b, item.ImageSource, () => + { + showeatanm = true; + mw.Main.DisplayToNomal(); + mw.Main.EventTimer_Elapsed(); + }); + } } if (!_puswitch.IsChecked.Value) {