diff --git a/Wpf_AiSportsMicrospace/Dto/MusicJumpRopeContext.cs b/Wpf_AiSportsMicrospace/Dto/MusicJumpRopeContext.cs index bc1a575..b968a68 100644 --- a/Wpf_AiSportsMicrospace/Dto/MusicJumpRopeContext.cs +++ b/Wpf_AiSportsMicrospace/Dto/MusicJumpRopeContext.cs @@ -19,7 +19,7 @@ namespace Dto public List UserScoreList { get; private set; } public List Sports { get; private set; } public List UseNameList { get; private set; } = new() { "蓝方选手", "红方选手" }; - public List UserBeatSyncList = new List(); + public static List UserBeatSyncList = new List(); public Dictionary> MusicBeats { get; private set; } = new() { diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/1.gif b/Wpf_AiSportsMicrospace/Resources/Img/Album/1.gif index d204eda..ea3bc7c 100644 Binary files a/Wpf_AiSportsMicrospace/Resources/Img/Album/1.gif and b/Wpf_AiSportsMicrospace/Resources/Img/Album/1.gif differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/11.gif b/Wpf_AiSportsMicrospace/Resources/Img/Album/11.gif new file mode 100644 index 0000000..d204eda Binary files /dev/null and b/Wpf_AiSportsMicrospace/Resources/Img/Album/11.gif differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/2.gif b/Wpf_AiSportsMicrospace/Resources/Img/Album/2.gif index 482a780..617ee4e 100644 Binary files a/Wpf_AiSportsMicrospace/Resources/Img/Album/2.gif and b/Wpf_AiSportsMicrospace/Resources/Img/Album/2.gif differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/22.gif b/Wpf_AiSportsMicrospace/Resources/Img/Album/22.gif new file mode 100644 index 0000000..482a780 Binary files /dev/null and b/Wpf_AiSportsMicrospace/Resources/Img/Album/22.gif differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/3.gif b/Wpf_AiSportsMicrospace/Resources/Img/Album/3.gif index fcd87f3..b79d956 100644 Binary files a/Wpf_AiSportsMicrospace/Resources/Img/Album/3.gif and b/Wpf_AiSportsMicrospace/Resources/Img/Album/3.gif differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/33.gif b/Wpf_AiSportsMicrospace/Resources/Img/Album/33.gif new file mode 100644 index 0000000..fcd87f3 Binary files /dev/null and b/Wpf_AiSportsMicrospace/Resources/Img/Album/33.gif differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/change_bg.png b/Wpf_AiSportsMicrospace/Resources/Img/Album/change_bg.png index c9b07be..fd7c9b1 100644 Binary files a/Wpf_AiSportsMicrospace/Resources/Img/Album/change_bg.png and b/Wpf_AiSportsMicrospace/Resources/Img/Album/change_bg.png differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/Album/change_bg2.png b/Wpf_AiSportsMicrospace/Resources/Img/Album/change_bg2.png new file mode 100644 index 0000000..c9b07be Binary files /dev/null and b/Wpf_AiSportsMicrospace/Resources/Img/Album/change_bg2.png differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/gif/2.gif b/Wpf_AiSportsMicrospace/Resources/Img/gif/2.gif index e514ee7..ea3bc7c 100644 Binary files a/Wpf_AiSportsMicrospace/Resources/Img/gif/2.gif and b/Wpf_AiSportsMicrospace/Resources/Img/gif/2.gif differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/gif/22.gif b/Wpf_AiSportsMicrospace/Resources/Img/gif/22.gif new file mode 100644 index 0000000..e514ee7 Binary files /dev/null and b/Wpf_AiSportsMicrospace/Resources/Img/gif/22.gif differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/gif/3.gif b/Wpf_AiSportsMicrospace/Resources/Img/gif/3.gif index 22f0150..b79d956 100644 Binary files a/Wpf_AiSportsMicrospace/Resources/Img/gif/3.gif and b/Wpf_AiSportsMicrospace/Resources/Img/gif/3.gif differ diff --git a/Wpf_AiSportsMicrospace/Resources/Img/gif/33.gif b/Wpf_AiSportsMicrospace/Resources/Img/gif/33.gif new file mode 100644 index 0000000..22f0150 Binary files /dev/null and b/Wpf_AiSportsMicrospace/Resources/Img/gif/33.gif differ diff --git a/Wpf_AiSportsMicrospace/Views/Home.xaml b/Wpf_AiSportsMicrospace/Views/Home.xaml index fa2ead2..8dd3583 100644 --- a/Wpf_AiSportsMicrospace/Views/Home.xaml +++ b/Wpf_AiSportsMicrospace/Views/Home.xaml @@ -30,23 +30,29 @@ Padding="0,100" /> - + />--> + + + + + - + />--> + + + + + @@ -135,7 +146,7 @@ - + diff --git a/Wpf_AiSportsMicrospace/Views/Home.xaml.cs b/Wpf_AiSportsMicrospace/Views/Home.xaml.cs index 90ebd69..43a604c 100644 --- a/Wpf_AiSportsMicrospace/Views/Home.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/Home.xaml.cs @@ -174,15 +174,23 @@ namespace Wpf_AiSportsMicrospace mainWin?.SwitchPageWithMaskAnimation(newPage, true); } else if (coverFlow.SelectedIndex == 1) + { + var newPage = new StandingLeap(); + mainWin?.SwitchPageWithMaskAnimation(newPage, true); + } + else if (coverFlow.SelectedIndex == 2) { var newPage = new MusicJumpRope(); mainWin?.SwitchPageWithMaskAnimation(newPage, true); } + else if (coverFlow.SelectedIndex == 3) + { + var newPage = new WhackAMole(); + mainWin?.SwitchPageWithMaskAnimation(newPage, true); + } else { - //var newPage = new TrainingRecords(); - //var newPage = new WhackAMole(); - var newPage = new StandingLeap(); + var newPage = new TrainingRecords(); mainWin?.SwitchPageWithMaskAnimation(newPage, true); } } diff --git a/Wpf_AiSportsMicrospace/Views/JumpLong/StandingLeap.xaml b/Wpf_AiSportsMicrospace/Views/JumpLong/StandingLeap.xaml index 3e5945c..efdef62 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpLong/StandingLeap.xaml +++ b/Wpf_AiSportsMicrospace/Views/JumpLong/StandingLeap.xaml @@ -14,7 +14,7 @@ - + - + - + diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs b/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs index 20784b7..c76c73d 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/JumpRope/MusicJumpRope.xaml.cs @@ -388,8 +388,8 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope public void showRank() { - double left = _musicJumpRopeContext.UserBeatSyncList[0]; - double right = _musicJumpRopeContext.UserBeatSyncList[1]; + double left = MusicJumpRopeContext.UserBeatSyncList[0]; + double right = MusicJumpRopeContext.UserBeatSyncList[1]; score4.Text = (left * 10).ToString(); score3.Text = (right * 10).ToString(); if (left > right) @@ -436,7 +436,7 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope _musicJumpRopeContext.Sports.Clear(); _musicJumpRopeContext.UserList.Clear(); _musicJumpRopeContext.UserNumberList.Clear(); - _musicJumpRopeContext.UserBeatSyncList.Clear(); + MusicJumpRopeContext.UserBeatSyncList.Clear(); double imgWidth = userBox.ActualWidth; double imgHeight = userBox.ActualHeight; @@ -479,9 +479,9 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope bool hit = beats.Any(b => Math.Abs(b - currentTime) <= _beatTolerance); if (hit) { - _musicJumpRopeContext.UserBeatSyncList[indexCopy] += 1; - double left = _musicJumpRopeContext.UserBeatSyncList[0]; - double right = _musicJumpRopeContext.UserBeatSyncList[1]; + MusicJumpRopeContext.UserBeatSyncList[indexCopy] += 1; + double left = MusicJumpRopeContext.UserBeatSyncList[0]; + double right = MusicJumpRopeContext.UserBeatSyncList[1]; double total = left + right; @@ -599,7 +599,7 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope userBox.Children.Add(userItem); _musicJumpRopeContext.UserList.Add(userItem); _musicJumpRopeContext.UserNumberList.Add("0"); - _musicJumpRopeContext.UserBeatSyncList.Add(0); + MusicJumpRopeContext.UserBeatSyncList.Add(0); return userItem; // } diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/TrainingRecords.xaml b/Wpf_AiSportsMicrospace/Views/JumpRope/TrainingRecords.xaml index e87b0ff..324d0fc 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpRope/TrainingRecords.xaml +++ b/Wpf_AiSportsMicrospace/Views/JumpRope/TrainingRecords.xaml @@ -6,130 +6,185 @@ xmlns:local="clr-namespace:Views.JumpRope" mc:Ignorable="d" xmlns:gif="http://wpfanimatedgif.codeplex.com" + xmlns:hc="https://handyorg.github.io/handycontrol" Height="1080" Width="1920" Loaded="UserControl_Loaded"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Margin="-20,10,30,20" + /> + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Wpf_AiSportsMicrospace/Views/JumpRope/TrainingRecords.xaml.cs b/Wpf_AiSportsMicrospace/Views/JumpRope/TrainingRecords.xaml.cs index 0ee2e52..5abc090 100644 --- a/Wpf_AiSportsMicrospace/Views/JumpRope/TrainingRecords.xaml.cs +++ b/Wpf_AiSportsMicrospace/Views/JumpRope/TrainingRecords.xaml.cs @@ -28,7 +28,10 @@ namespace Views.JumpRope public partial class TrainingRecords : UserControl { private Main _mainWin => Application.Current.MainWindow as Main; - private GroupJumpRopeContext _groupJumpRopeContext; + //private GroupJumpRopeContext _groupJumpRopeContext; + //private MusicJumpRopeContext _musicJumpRopeContext; + + UserControl newPage = null; public TrainingRecords() { @@ -96,6 +99,7 @@ namespace Views.JumpRope public void LoadData() { ShowRankingBoard(GroupJumpRopeContext.RankList); + showRank(); } public void ShowRankingBoard(List list) { @@ -163,6 +167,37 @@ namespace Views.JumpRope } } + public void showRank() + { + double left = MusicJumpRopeContext.UserBeatSyncList[0]; + double right = MusicJumpRopeContext.UserBeatSyncList[1]; + score4.Text = (left * 10).ToString(); + score3.Text = (right * 10).ToString(); + if (left > right) + { + lose1.Margin = new Thickness(60, 0, 0, 0); + lose2.Margin = new Thickness(60, 0, 0, 0); + lose3.Margin = new Thickness(60, 0, 0, 0); + win1.Margin = new Thickness(980, -123, 0, 0); + win2.Margin = new Thickness(980, -123, 0, 0); + + text1.Text = "LOSE"; + text2.Text = "WIN"; + text1.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#7987a2")); + text2.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#fdcb50")); + } + else if (right == left) + { + text2.Text = "WIN"; + text2.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#fdcb50")); + lose1.Visibility = Visibility.Hidden; + lose2.Visibility = Visibility.Hidden; + lose3.Visibility = Visibility.Hidden; + + win3.Visibility = Visibility.Visible; + win4.Visibility = Visibility.Visible; + } + } public int DetectLeftHandRaise(Human human) { var calculator = PostureCalculate.CreateCalculator();