Improve encapsulation of `ToolFormBase` props
This commit is contained in:
parent
faf4a8b24f
commit
14f470a9a7
|
@ -11,17 +11,17 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public class ToolFormBase : FormBase, IToolForm, IDialogParent
|
||||
{
|
||||
public ToolManager Tools { get; set; }
|
||||
protected ToolManager Tools { get; private set; }
|
||||
|
||||
public DisplayManager DisplayManager { get; set; }
|
||||
protected DisplayManager DisplayManager { get; private set; }
|
||||
|
||||
public InputManager InputManager { get; set; }
|
||||
protected InputManager InputManager { get; private set; }
|
||||
|
||||
public IMainFormForTools MainForm { get; set; }
|
||||
protected IMainFormForTools MainForm { get; private set; }
|
||||
|
||||
public IMovieSession MovieSession { get; set; }
|
||||
protected IMovieSession MovieSession { get; private set; }
|
||||
|
||||
public IGameInfo Game { get; set; }
|
||||
protected IGameInfo Game { get; private set; }
|
||||
|
||||
public IDialogController DialogController => MainForm;
|
||||
|
||||
|
@ -32,6 +32,22 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public virtual void Restart() {}
|
||||
|
||||
public void SetToolFormBaseProps(
|
||||
DisplayManager displayManager,
|
||||
InputManager inputManager,
|
||||
IMainFormForTools mainForm,
|
||||
IMovieSession movieSession,
|
||||
ToolManager toolManager,
|
||||
IGameInfo game)
|
||||
{
|
||||
DisplayManager = displayManager;
|
||||
Game = game;
|
||||
InputManager = inputManager;
|
||||
MainForm = mainForm;
|
||||
MovieSession = movieSession;
|
||||
Tools = toolManager;
|
||||
}
|
||||
|
||||
public virtual void UpdateValues(ToolFormUpdateType type)
|
||||
{
|
||||
switch (type)
|
||||
|
|
|
@ -88,13 +88,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
f.Config = _config;
|
||||
if (!(form is ToolFormBase tool)) return;
|
||||
|
||||
tool.Tools = this;
|
||||
tool.DisplayManager = _displayManager;
|
||||
tool.InputManager = _inputManager;
|
||||
tool.MainForm = _owner;
|
||||
tool.MovieSession = _movieSession;
|
||||
tool.Game = _game;
|
||||
tool.SetToolFormBaseProps(_displayManager, _inputManager, _owner, _movieSession, this, _game);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue