Пример #1
0
    /// <summary>
    /// Needed so MainGUI doesnt go on top of MainMenu
    /// </summary>
    internal void ReLoadMainMenuIfActive()
    {
        var forms = FindObjectsOfType <MyForm>();

        for (int i = 0; i < forms.Length; i++)
        {
            if (forms[i] != null && forms[i].MyId.Contains("MainMenu"))
            {
                RedifineWindows();
                _mainMenuWindow.Destroy();
                _mainMenuWindow = null;

                _newGameWindow.Destroy();
                _newGameWindow = null;

                SaveLoadGameWindow.Destroy();
                SaveLoadGameWindow = null;

                _optionsWindow.Destroy();
                _optionsWindow = null;

                if (_achieveWindow)
                {
                    _achieveWindow.Destroy();
                    _achieveWindow = null;
                }

                DestroyCurrentMenu();
                LoadMainMenu();
                Debug.Log("Reload Main Menu  ReLoadMainMenuIfActive");

                RedifineWindows();
            }
        }
    }
Пример #2
0
 public void GetNewGameWindow()
 {
     NewGameWindow             = new NewGameWindow();
     this.NewGameOptions       = new NewGameOptions();
     VM_NewGame                = new VM_NewGame(NewGameOptions, this);
     NewGameWindow.DataContext = VM_NewGame;
     NewGameWindow.Show();
 }
Пример #3
0
        private void NewGameButton_Click(object sender, EventArgs e)
        {
            //TODO: perhaps some singleton solution should be here present
            //we don't want to open more than one of this
            NewGameWindow window = new NewGameWindow();

            window.Show();
        }
Пример #4
0
        private void NewGameMenuItemClick(object sender, RoutedEventArgs e)
        {
            var newGame = new NewGameWindow()
            {
                Owner = this
            };

            newGame.ShowDialog();
        }
Пример #5
0
 private void ViewModel_NewGame(object sender, EventArgs e)
 {
     _newGame = new NewGameWindow();
     _newGame.ShowDialog();
     if (_newGame.DialogResult.GetValueOrDefault(true))
     {
         _viewModel.TableSize = _newGame.size;
         _model._tableSize    = _newGame.size;
         _model.NewGame();
     }
 }
Пример #6
0
 /// <summary>
 /// Handles the Click event of the NewGameButton control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void NewGameButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         NewGameWindow childWindow = new NewGameWindow();
         this.Close();
         childWindow.ShowDialog();
     }
     catch (Exception error)
     {
         errorLogViewModel.LogError(error);
     }
 }
Пример #7
0
        public void StartNewGame()
        {
            MainWindow.Close();

            MainWindow                 = new MainWindow();
            this.GS                    = new GameState();
            GS.PlayerNames             = NewGameOptions.PlayerNames;
            GS.AI                      = NewGameOptions.PlayerAI;
            VM_MainWindow              = new VM_MainWindow(GS, this);
            VM_MainWindow.PlayerColors = NewGameOptions.PlayerColors;
            MainWindow.DataContext     = VM_MainWindow;
            MainWindow.Show();
            NewGameWindow.Close();
        }
Пример #8
0
        public INewGameViewModel NewGame()
        {
            var newGameWindow = new NewGameWindow();

            newGameWindow.DataContext = _newGameViewModel;
            newGameWindow.Owner       = Application.Current.MainWindow;

            if (newGameWindow.ShowDialog() == true)
            {
                return((INewGameViewModel)newGameWindow.DataContext);
            }

            return(null);
        }
Пример #9
0
        private void Start()
        {
            ExitMenuObject       = GameObject.Find("ConfirmExitGameDialog");
            AuthorsWindowObject  = GameObject.Find("AuthorsWindow");
            SettingsWindowObject = GameObject.Find("SettingsWindow");
            NewGameWindow        = GameObject.Find("NewGameWindow");
            ConfirmNewGameObject = GameObject.Find("ConfirmNewGameDialog");
            MainMenuObject       = GameObject.Find("MainMenu");

            NewGameWindow.SetActive(false);
            ConfirmNewGameObject.SetActive(false);
            AuthorsWindowObject.SetActive(false);
            SettingsWindowObject.SetActive(false);
            ExitMenuObject.SetActive(false);

            MainMenuObject.SetActive(true);
        }
Пример #10
0
    static void Init()
    {
        Controller.resetInstance();
        openedWindow = WelcomeWindowType.New;

        Language.Initialize();
        thisWindowReference = EditorWindow.GetWindow(typeof(WelcomeWindow));
        windowWidth         = EditorWindow.focusedWindow.position.width;
        windowHeight        = EditorWindow.focusedWindow.position.height;
        logo = (Texture2D)Resources.Load("EAdventureData/img/logo-editor", typeof(Texture2D));

        logoRect    = new Rect(0.01f * windowWidth, 0.01f * windowHeight, windowWidth * 0.98f, windowHeight * 0.25f);
        buttonsRect = new Rect(0.01f * windowWidth, 0.27f * windowHeight, windowWidth * 0.98f, windowHeight * 0.28f);
        windowRect  = new Rect(0.01f * windowWidth, 0.32f * windowHeight, 0.98f * windowWidth, 0.67f * windowHeight);

        //newGameWindow = new NewGameWindow(windowRect, new GUIContent(TC.get("GeneralText.New")), "Window");
        //openGameWindow = new OpenGameWindow(windowRect, new GUIContent(TC.get("GeneralText.Open")), "Window");
        newGameWindow  = new NewGameWindow(windowRect, new GUIContent("New"), "Window");
        openGameWindow = new OpenGameWindow(windowRect, new GUIContent("Open"), "Window");
        //recentGameWindow = new RecentGameWindow(windowRect, new GUIContent(Language.GetText("RECENT_GAME")), "Window");
    }
Пример #11
0
        /// <summary>
        /// Alkalmazás indulásának eseménykezelője.
        /// </summary>
        private void App_Startup(object sender, StartupEventArgs e)
        {
            _dataAccess = new DBPersistence();

            _newGame = new NewGameWindow();

            _model = new TicTacToeGameModel(_dataAccess);
            //_model.GameWon += new EventHandler<GameWonEventArgs>(Model_GameWon);
            _model.NewGame();

            _viewModel           = new TicTacToeViewModel(_model);
            _viewModel.LoadGame += new EventHandler(ViewModel_LoadGame); // kezeljük a nézetmodell eseményeit
            _viewModel.SaveGame += new EventHandler(ViewModel_SaveGame);
            _viewModel.GameExit += new EventHandler(ViewModel_GameExit);
            _viewModel.NewGame  += new EventHandler(ViewModel_NewGame);
            _model.GameOver     += new EventHandler <GameOverEventArgs>(Model_GameOver);

            _window             = new MainGameWindow();
            _window.DataContext = _viewModel;
            _window.Show();
        }
Пример #12
0
 private void RedifineWindows()
 {
     if (_mainMenuWindow == null)
     {
         _mainMenuWindow = FindObjectOfType <MainMenuWindow>();
     }
     if (_newGameWindow == null)
     {
         _newGameWindow = FindObjectOfType <NewGameWindow>();
     }
     if (SaveLoadGameWindow == null)
     {
         SaveLoadGameWindow = FindObjectOfType <SaveLoadGameWindow>();
     }
     if (_optionsWindow == null)
     {
         _optionsWindow = FindObjectOfType <OptionsWindow>();
     }
     if (_achieveWindow == null)
     {
         _achieveWindow = FindObjectOfType <AchieveWindow>();
     }
 }
Пример #13
0
        public Display(NewGameWindow window)
        {
            Screens = new List <Screen>();
            var control = window.Control2;

            foreach (var newGameControl2Control in control.Screens)
            {
                var screen = new Screen();
                screen.SystemIndex = newGameControl2Control.SystemIndexComboBox.SelectedIndex;
                if (newGameControl2Control.CPUSensitiveCheckBox.IsChecked != null)
                {
                    screen.IsCpuSensitive = (bool)newGameControl2Control.CPUSensitiveCheckBox.IsChecked;
                }
                if (newGameControl2Control.FullScreenCheckBox.IsChecked != null)
                {
                    screen.IsFullScreen = (bool)newGameControl2Control.FullScreenCheckBox.IsChecked;
                }
                if (newGameControl2Control.VSyncCheckBox.IsChecked != null)
                {
                    screen.IsVSync = (bool)newGameControl2Control.VSyncCheckBox.IsChecked;
                }

                var item   = (ComboBoxItem)newGameControl2Control.ResolutionComboBox.SelectedItem;
                var str    = item.Content.ToString().Split('x');
                var width  = int.Parse(str[0]);
                var height = int.Parse(str[1]);
                screen.Resolution = new Rectangle {
                    Width = width, Height = height
                };
                screen.TargetFps = int.Parse(newGameControl2Control.TargetedFramesPerSecondResultLabel.Content.ToString());

                var num = 0;
                if (newGameControl2Control.CPU1CheckBox.IsChecked != null)
                {
                    if ((bool)newGameControl2Control.CPU1CheckBox.IsChecked)
                    {
                        num |= 1;
                    }
                }
                if (newGameControl2Control.CPU2CheckBox.IsChecked != null)
                {
                    if ((bool)newGameControl2Control.CPU2CheckBox.IsChecked)
                    {
                        num |= 2;
                    }
                }
                if (newGameControl2Control.CPU3CheckBox.IsChecked != null)
                {
                    if ((bool)newGameControl2Control.CPU3CheckBox.IsChecked)
                    {
                        num |= 4;
                    }
                }
                if (newGameControl2Control.CPU4CheckBox.IsChecked != null)
                {
                    if ((bool)newGameControl2Control.CPU4CheckBox.IsChecked)
                    {
                        num |= 8;
                    }
                }
                if (num == 0)
                {
                    num = -1;
                }
                screen.CpuAffinity = num;

                Screens.Add(screen);
            }
        }
Пример #14
0
 public Connector(NewGameWindow window)
 {
 }
Пример #15
0
        public void NewGameBackButton()
        {
            NewGameWindow.SetActive(false);

            MainMenuObject.SetActive(true);
        }
Пример #16
0
 public void ConfirmNewGameButton_Click()
 {
     NewGameWindow.SetActive(true);
     ConfirmNewGameObject.SetActive(false);
 }
Пример #17
0
 public NewGameWindowViewModel(NewGameWindow window)
 {
     this.window = window;
 }