Example #1
0
        protected void OpenSavePathWindow(object sender = null, RoutedEventArgs e = null)
        {
            SetSavePathWindow wnd = new SetSavePathWindow(game);

            wnd.Activate();
            if (wnd.ShowDialog() == true)
            {
                UpdateUI();
            }
        }
Example #2
0
        private bool OpenWindowForGame(Game game, bool skipSaveDataCheck = false)
        {
            if (game == Game.None)
            {
                return(false);
            }

            if (!skipSaveDataCheck && string.IsNullOrWhiteSpace(Data.SaveLocations[(int)game]))
            {
                SetSavePathWindow wnd = new SetSavePathWindow(game);
                wnd.Activate();
                if (wnd.ShowDialog() == false)
                {
                    return(false);                    //Save file selection was cancelled, do not continue
                }
            }

            Window window;

            switch (game)
            {
            case Game.Asylum:
                window = new AsylumWindow();
                break;

            case Game.City:
                window = new CityWindow();
                break;

            case Game.Origins:
                window = new OriginsWindow();
                break;

            case Game.Knight:
                window = new KnightWindow();
                break;

            default:
                return(false);
            }

            window.Activate();
            window.Show();
            return(true);
        }
Example #3
0
        private void KillWindow(Window newWindow, Game newGame, MenuItem sender)
        {
            if (newWindow != null)
            {
                if (string.IsNullOrWhiteSpace(Data.SaveLocations[(int)newGame]))
                {
                    Window wnd = new SetSavePathWindow(newGame);
                    wnd.Activate();
                    if (wnd.ShowDialog() == false)
                    {
                        newWindow.Close();
                        sender.IsChecked = false;
                        return;
                    }
                }

                newWindow.Activate();
                newWindow.Show();
            }

            Close();
        }