private void ConfigureInput() { Observable.EveryUpdate() .Where(_ => Input.GetKeyDown(KeyCode.Space) && currentGameState == GameState.Running) .Subscribe(_ => { _playerPlanet.Shoot(); _ammoPanel.SetRocketAmmo(_playerPlanet.GetCurrentRocketSettings().rocketType, _playerPlanet.GetCurrentAmmo()); if (_playerPlanet.GetCurrentAmmo() <= 0) { SwitchToNextNonEmptyAmmo(); } }).AddTo(_compositeDisposable); Observable.EveryUpdate().Where(_ => (Input.GetKeyDown(KeyCode.LeftShift) || Input.GetKeyDown(KeyCode.RightShift)) && currentGameState == GameState.Running).Subscribe(_ => { SwitchToNextNonEmptyAmmo(); }).AddTo(_compositeDisposable); Observable.EveryUpdate() .Where(_ => Input.GetKeyDown(KeyCode.Escape) && currentGameState == GameState.Running) .Subscribe(_ => { currentGameState = GameState.Paused; Time.timeScale = 0; _mainMenuView.Show(currentGameState); }).AddTo(_compositeDisposable); }
private void GoBack() { MainMenuView main = new MainMenuView(); main.Show(); CloseSelf(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); Window window = new MainMenuView(); window.Show(); }
protected override void OnClosing(CancelEventArgs e) { MainMenuView MMV = new MainMenuView(); MMV.DataContext = DataContext; MMV.Show(); }
private void GoBack() { SelectedEmployee = null; MainMenuView main = new MainMenuView(); main.Show(); CloseMainMenu(); }
/// <summary> /// Shows the main menu view. /// </summary> /// <param name="session">the user session</param> /// <returns>the main menu view</returns> public MainMenuView ShowMainMenuView(Session session) { var view = new MainMenuView(this, accountService, session); view.UpdateAccountDisplay(); view.Show(); return(view); }
private void Cancel_Click(object sender, RoutedEventArgs e) { MainMenuView MMV = new MainMenuView(); MMV.DataContext = DataContext; MMV.Show(); Close(); }
public void Initialize() { _view.LoadEarthButton.onClick.AddListener(LoadEarthHandler); _view.LoadMoonButton.onClick.AddListener(LoadMoonHandler); _view.LoadJupiterButton.onClick.AddListener(LoadJupiterHandler); _view.Show(); }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { MainMenuView.Show(); if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }
private void logoutHandler(bool isLogout) { if (isLogout) { this.Hide(); UserContext.LoggedinUser = null; Window window = new MainMenuView(); window.Show(); } }
private void Add_Click(object sender, RoutedEventArgs e) { if (TextType.Text != "") { ((MainViewModel)DataContext).AddNewType(TextType.Text); MainMenuView MMV = new MainMenuView(); MMV.DataContext = DataContext; MMV.Show(); Close(); } }
private void GoBack() { if (prevIsMain) { MainMenuView main = new MainMenuView(); main.Show(); } else { ClientView client = new ClientView(); client.Show(); } CloseSelf(); }
public void LogIn(object parameter) { string password = ((PasswordBox)parameter).Password.ToString(); EmployeeAccount account = MatchCredentials(Username, password); if (account != null) { EmployeeSession.Instance.User = account; mainMenu = new MainMenuView(); mainMenu.Show(); CloseLogin(); } else { MessageBox.Show("Verkeerde inloggegevens of gebruiker bestaat niet."); } }
public static void Menu() { MainMenuView.Show(); while (true) { switch (Console.ReadKey().Key) { case ConsoleKey.D1: CreateContactController.CreateContact(); break; case ConsoleKey.NumPad1: CreateContactController.CreateContact(); break; case ConsoleKey.D2: ContactsController.Contacts(SearchContactView.Show().Trim().Split(' ')); break; case ConsoleKey.NumPad2: ContactsController.Contacts(SearchContactView.Show().Trim().Split(' ')); break; case ConsoleKey.D3: ContactsController.Contacts(); break; case ConsoleKey.NumPad3: ContactsController.Contacts(); break; default: Page.ErrorMessage(0); break; } } }
public void Show() { View.Show(); }