private bool LoadFile(FileInfo file, bool startsFromSavestate = false, int gotoFrame = 0) { if (!file.Exists) { Settings.RecentTas.HandleLoadError(MainForm, file.FullName); return(false); } _engaged = false; var newMovie = (ITasMovie)MovieSession.Get(file.FullName); newMovie.BindMarkersToInput = Settings.BindMarkersToInput; newMovie.GreenzoneInvalidated = GreenzoneInvalidated; if (!HandleMovieLoadStuff(newMovie)) { return(false); } _engaged = true; Settings.RecentTas.Add(newMovie.Filename); // only add if it did load if (startsFromSavestate) { GoToFrame(0); } else if (gotoFrame > 0) { GoToFrame(gotoFrame); } else { GoToFrame(CurrentTasMovie.TasSession.CurrentFrame); } // If we are loading an existing non-default movie, we will already have columns generated // Only set up columns if needed if (!TasView.AllColumns.Any()) { SetUpColumns(); } UpdateAutoFire(); SetUpToolStripColumns(); CurrentTasMovie.PropertyChanged += TasMovie_OnPropertyChanged; CurrentTasMovie.Branches.Current = CurrentTasMovie.TasSession.CurrentBranch; BookMarkControl.UpdateTextColumnWidth(); MarkerControl.UpdateTextColumnWidth(); // clear all selections TasView.DeselectAll(); BookMarkControl.Restart(); MarkerControl.Restart(); RefreshDialog(); return(true); }
private void LoadMovie(string filename, string archive = null) { if (Emulator.IsNull()) { OpenRom(); } if (Emulator.IsNull()) { return; } StartNewMovie(MovieSession.Get(filename), false); }
private void LoadMovie(string filename, string archive = null) { if (Emulator.IsNull()) { OpenRom(); if (Emulator.IsNull()) { return; } } if (GlobalWin.Tools.IsLoaded <TAStudio>()) { Tools.TAStudio.LoadMovieFile(filename); } else { StartNewMovie(MovieSession.Get(filename), false); } }
private void StartNewTasMovie() { if (!AskSaveChanges()) { return; } var filename = DefaultTasProjName(); // TODO don't do this, take over any mainform actions that can crash without a filename var tasMovie = (ITasMovie)MovieSession.Get(filename); tasMovie.BindMarkersToInput = Settings.BindMarkersToInput; tasMovie.TasStateManager.InvalidateCallback = GreenzoneInvalidated; tasMovie.PropertyChanged += TasMovie_OnPropertyChanged; tasMovie.PopulateWithDefaultHeaderValues( Emulator, Game, GlobalWin.FirmwareManager, Config.DefaultAuthor); SetTasMovieCallbacks(tasMovie); tasMovie.ClearChanges(); // Don't ask to save changes here. tasMovie.Save(); if (HandleMovieLoadStuff(tasMovie)) { CurrentTasMovie.TasStateManager.Capture(); // Capture frame 0 always. } // clear all selections TasView.DeselectAll(); BookMarkControl.Restart(); MarkerControl.Restart(); SetUpColumns(); RefreshDialog(); TasView.Refresh(); }