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 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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue