Ejemplo n.º 1
0
        public void Execute(object parameter)
        {
            Model.SaveFile savefile      = new Model.SaveFile();
            JobVM          tempViewModel = savefile.Load();

            ViewModel.Job   = tempViewModel.Job;
            ViewModel.Rooms = tempViewModel.Rooms;
        }
Ejemplo n.º 2
0
        private void LoadFile(string path)
        {
            var saveFile = Model.SaveFile.FromPath(path);

            if (saveFile.Type != Enums.SaveFileType.Chapter && saveFile.Type != Enums.SaveFileType.Global)
            {
                MessageBox.Show("This type of save is not supported yet. Only 'Chapter' and 'Global' saves are supported right now.");
                return;
            }
            else
            {
                _saveFile = saveFile;
            }

            UpdateTitleBar(path);

            Cursor.Current = Cursors.WaitCursor;

            switch (_saveFile.Type)
            {
            case Enums.SaveFileType.Chapter:
                _chapterSave = Model.ChapterSave.FromSaveFile(_saveFile);
                _globalSave  = null;

                LoadChapterData();
                LoadUnitViewer();

                tabChapterData.Enabled = true;
                tabUnitViewer.Enabled  = true;
                tabMegacheats.Enabled  = true;
                tabNewGamePlus.Enabled = true;
                tabConvoy.Enabled      = true;
                tabGlobalData.Enabled  = false;

                break;

            case Enums.SaveFileType.Global:
                _globalSave  = Model.GlobalSave.FromSaveFile(_saveFile);
                _chapterSave = null;

                LoadGlobalData();

                tabChapterData.Enabled = false;
                tabUnitViewer.Enabled  = false;
                tabMegacheats.Enabled  = false;
                tabNewGamePlus.Enabled = false;
                tabConvoy.Enabled      = false;
                tabGlobalData.Enabled  = true;

                break;

            default: break;
            }

            Cursor.Current = Cursors.AppStarting;

            tabControl1.Enabled = true;
        }
Ejemplo n.º 3
0
        private void openFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            openFileDialog1.FileName = "";
            openFileDialog1.Filter   = "'Chapter' save|*";

            var startupPath = Config.StartupPath;

            if (startupPath == "" || !Directory.Exists(startupPath))
            {
                startupPath = Application.StartupPath;
            }
            openFileDialog1.InitialDirectory = startupPath;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                Config.StartupPath = Path.GetDirectoryName(openFileDialog1.FileName);

                var saveFile = Model.SaveFile.FromPath(openFileDialog1.FileName);

                if (saveFile.Type != Enums.SaveFileType.Chapter && saveFile.Type != Enums.SaveFileType.Global)
                {
                    MessageBox.Show("This type of save is not supported yet. Only 'Chapter' and 'Global' saves are supported right now.");
                    return;
                }
                else
                {
                    _saveFile = saveFile;
                }

                UpdateTitleBar(openFileDialog1.FileName);

                switch (_saveFile.Type)
                {
                case Enums.SaveFileType.Chapter:
                    _chapterSave = Model.ChapterSave.FromSaveFile(_saveFile);
                    _globalSave  = null;

                    LoadChapterData();
                    LoadUnitViewer();

                    tabChapterData.Enabled = true;
                    tabUnitViewer.Enabled  = true;
                    tabMegacheats.Enabled  = true;
                    tabNewGamePlus.Enabled = true;
                    tabGlobalData.Enabled  = false;

                    break;

                case Enums.SaveFileType.Global:
                    _globalSave  = Model.GlobalSave.FromSaveFile(_saveFile);
                    _chapterSave = null;

                    LoadGlobalData();

                    tabChapterData.Enabled = false;
                    tabUnitViewer.Enabled  = false;
                    tabMegacheats.Enabled  = false;
                    tabNewGamePlus.Enabled = false;
                    tabGlobalData.Enabled  = true;

                    break;

                default: break;
                }

                tabControl1.Enabled = true;
            }
        }