move DefaultTasStateManagerSettings to the MovieSettings class allowing to not use Global in TasMovie constructor, also pass stuff in to DefaultGreenzoneSettings instead of using Globals

This commit is contained in:
adelikat 2020-06-06 08:49:46 -05:00
parent db934f3689
commit 4479202151
5 changed files with 10 additions and 10 deletions

View File

@ -266,9 +266,6 @@ namespace BizHawk.Client.Common
public bool CheatsAutoSaveOnClose { get; set; } = true;
public RecentFiles RecentCheats { get; set; } = new RecentFiles(8);
// TAStudio
public TasStateManagerSettings DefaultTasStateManagerSettings { get; set; } = new TasStateManagerSettings();
// Macro Tool
public RecentFiles RecentMacros { get; set; } = new RecentFiles(8);

View File

@ -7,6 +7,7 @@
public bool MoviesOnDisk { get; }
public int MovieCompressionLevel { get; }
public bool VBAStyleMovieLoadState { get; }
TasStateManagerSettings DefaultTasStateManagerSettings { get; }
}
public class MovieConfig : IMovieConfig
@ -16,5 +17,7 @@
public bool MoviesOnDisk { get; set; }
public int MovieCompressionLevel { get; set; } = 2;
public bool VBAStyleMovieLoadState { get; set; }
public TasStateManagerSettings DefaultTasStateManagerSettings { get; set; } = new TasStateManagerSettings();
}
}

View File

@ -17,7 +17,7 @@ namespace BizHawk.Client.Common
{
Branches = new TasBranchCollection(this);
ChangeLog = new TasMovieChangeLog(this);
TasStateManager = new TasStateManager(this, Global.Config.DefaultTasStateManagerSettings);
TasStateManager = new TasStateManager(this, session.Settings.DefaultTasStateManagerSettings);
Header[HeaderKeys.MovieVersion] = "BizHawk v2.0 Tasproj v1.0";
Markers = new TasMovieMarkerList(this);
Markers.CollectionChanged += Markers_CollectionChanged;

View File

@ -7,20 +7,20 @@ namespace BizHawk.Client.EmuHawk
{
public partial class DefaultGreenzoneSettings : Form
{
private readonly MovieConfig _movieSettings;
private TasStateManagerSettings _settings;
public DefaultGreenzoneSettings()
public DefaultGreenzoneSettings(MovieConfig movieSettings)
{
InitializeComponent();
_settings = new TasStateManagerSettings(Global.Config.DefaultTasStateManagerSettings);
_movieSettings = movieSettings;
_settings = new TasStateManagerSettings(movieSettings.DefaultTasStateManagerSettings);
SettingsPropertyGrid.SelectedObject = _settings;
}
private void OkBtn_Click(object sender, EventArgs e)
{
Global.Config.DefaultTasStateManagerSettings = _settings;
_movieSettings.DefaultTasStateManagerSettings = _settings;
Close();
}

View File

@ -1009,7 +1009,7 @@ namespace BizHawk.Client.EmuHawk
private void DefaultStateSettingsMenuItem_Click(object sender, EventArgs e)
{
new DefaultGreenzoneSettings
new DefaultGreenzoneSettings(Config.Movies)
{
Location = this.ChildPointToScreen(TasView)
}.ShowDialog();