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:
parent
db934f3689
commit
4479202151
|
@ -266,9 +266,6 @@ namespace BizHawk.Client.Common
|
||||||
public bool CheatsAutoSaveOnClose { get; set; } = true;
|
public bool CheatsAutoSaveOnClose { get; set; } = true;
|
||||||
public RecentFiles RecentCheats { get; set; } = new RecentFiles(8);
|
public RecentFiles RecentCheats { get; set; } = new RecentFiles(8);
|
||||||
|
|
||||||
// TAStudio
|
|
||||||
public TasStateManagerSettings DefaultTasStateManagerSettings { get; set; } = new TasStateManagerSettings();
|
|
||||||
|
|
||||||
// Macro Tool
|
// Macro Tool
|
||||||
public RecentFiles RecentMacros { get; set; } = new RecentFiles(8);
|
public RecentFiles RecentMacros { get; set; } = new RecentFiles(8);
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
public bool MoviesOnDisk { get; }
|
public bool MoviesOnDisk { get; }
|
||||||
public int MovieCompressionLevel { get; }
|
public int MovieCompressionLevel { get; }
|
||||||
public bool VBAStyleMovieLoadState { get; }
|
public bool VBAStyleMovieLoadState { get; }
|
||||||
|
TasStateManagerSettings DefaultTasStateManagerSettings { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MovieConfig : IMovieConfig
|
public class MovieConfig : IMovieConfig
|
||||||
|
@ -16,5 +17,7 @@
|
||||||
public bool MoviesOnDisk { get; set; }
|
public bool MoviesOnDisk { get; set; }
|
||||||
public int MovieCompressionLevel { get; set; } = 2;
|
public int MovieCompressionLevel { get; set; } = 2;
|
||||||
public bool VBAStyleMovieLoadState { get; set; }
|
public bool VBAStyleMovieLoadState { get; set; }
|
||||||
|
|
||||||
|
public TasStateManagerSettings DefaultTasStateManagerSettings { get; set; } = new TasStateManagerSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
Branches = new TasBranchCollection(this);
|
Branches = new TasBranchCollection(this);
|
||||||
ChangeLog = new TasMovieChangeLog(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";
|
Header[HeaderKeys.MovieVersion] = "BizHawk v2.0 Tasproj v1.0";
|
||||||
Markers = new TasMovieMarkerList(this);
|
Markers = new TasMovieMarkerList(this);
|
||||||
Markers.CollectionChanged += Markers_CollectionChanged;
|
Markers.CollectionChanged += Markers_CollectionChanged;
|
||||||
|
|
|
@ -7,20 +7,20 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public partial class DefaultGreenzoneSettings : Form
|
public partial class DefaultGreenzoneSettings : Form
|
||||||
{
|
{
|
||||||
|
private readonly MovieConfig _movieSettings;
|
||||||
private TasStateManagerSettings _settings;
|
private TasStateManagerSettings _settings;
|
||||||
|
|
||||||
public DefaultGreenzoneSettings()
|
public DefaultGreenzoneSettings(MovieConfig movieSettings)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
_movieSettings = movieSettings;
|
||||||
_settings = new TasStateManagerSettings(Global.Config.DefaultTasStateManagerSettings);
|
_settings = new TasStateManagerSettings(movieSettings.DefaultTasStateManagerSettings);
|
||||||
|
|
||||||
SettingsPropertyGrid.SelectedObject = _settings;
|
SettingsPropertyGrid.SelectedObject = _settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OkBtn_Click(object sender, EventArgs e)
|
private void OkBtn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Global.Config.DefaultTasStateManagerSettings = _settings;
|
_movieSettings.DefaultTasStateManagerSettings = _settings;
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1009,7 +1009,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void DefaultStateSettingsMenuItem_Click(object sender, EventArgs e)
|
private void DefaultStateSettingsMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
new DefaultGreenzoneSettings
|
new DefaultGreenzoneSettings(Config.Movies)
|
||||||
{
|
{
|
||||||
Location = this.ChildPointToScreen(TasView)
|
Location = this.ChildPointToScreen(TasView)
|
||||||
}.ShowDialog();
|
}.ShowDialog();
|
||||||
|
|
Loading…
Reference in New Issue