public void MenuPage_Loaded(object sender, RoutedEventArgs e) { MenuScreenHeaders currentHeader; switch (MainWindow.PreviousPageTitle) { case "Intro": case "TRAINING": currentHeader = MenuScreenHeaders.MainMenu; break; case "LOCAL": currentHeader = MenuScreenHeaders.Multiplayer; break; default: return; } Options.TitleText = MenuScreen.GetTitleForHeader(currentHeader); Options.OptionNames = MenuScreen.GetOptionsForHeader(currentHeader); String imageName = MenuScreen.GetImageNameForHeader(currentHeader); MenuGrid.Background = FindResource(imageName) as ImageBrush; BottomBorder.BorderWidth = MenuGrid.ColumnDefinitions[1].ActualWidth; }
public void MenuPage_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { MenuScreenHeaders currentHeader; switch (Options.TitleText) { case "MAIN MENU": Options.DisableControl(); this.TransitionPage <Intro>(this.Title); return; case "SINGLEPLAYER": case "MULTIPLAYER": case "STADIUM": case "TRAINING": case "SETTINGS": currentHeader = MenuScreenHeaders.MainMenu; break; default: return; } PrepareForTransition(currentHeader); Options.TransitionBackward(MenuScreen.GetTitleForHeader(currentHeader), MenuScreen.GetOptionsForHeader(currentHeader)); }
public void Options_Selected(object sender, MouseButtonEventArgs e) { MenuScreenHeaders currentHeader; TextBlock senderTextBlock = sender as TextBlock; switch (senderTextBlock.Text) { case "SINGLEPLAYER": { var player = new MediaPlayer(); player.Open(new Uri(@"C:\Users\Takaji\Documents\GitHub\SmashFront\SmashFront\Resources\General\GENERAL SOUND EFFECTS\harp.wav")); player.Play(); } currentHeader = MenuScreenHeaders.Singleplayer; break; case "MULTIPLAYER": { var player = new MediaPlayer(); player.Open(new Uri(@"C:\Users\Takaji\Documents\GitHub\SmashFront\SmashFront\Resources\General\GENERAL SOUND EFFECTS\harp.wav")); player.Play(); } currentHeader = MenuScreenHeaders.Multiplayer; break; case "STADIUM": currentHeader = MenuScreenHeaders.Stadium; break; case "TRAINING": Options.DisableControl(); this.TransitionPage <TrainingPage>("TRAINING", 0.5); return; case "SETTINGS": currentHeader = MenuScreenHeaders.Settings; break; case "LOCAL": Options.DisableControl(); this.TransitionPage <TrainingPage>("LOCAL", 0.5); return; case "QUIT": Options.DisableControl(); this.ShutDown(); return; default: OptionDescription.Text = "Not yet implemented!"; return; } PrepareForTransition(currentHeader); Options.TransitionForward(MenuScreen.GetTitleForHeader(currentHeader), MenuScreen.GetOptionsForHeader(currentHeader)); }