Update ext. tools to new IToolForm interface

interface changed in ea634daa7
This commit is contained in:
YoshiRulz 2020-05-05 09:05:58 +10:00
parent aaa75a19aa
commit 2c0d6dc32e
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 9 additions and 25 deletions

View File

@ -26,8 +26,6 @@ namespace BizHawk.Experiment.AutoGenConfig
public override string Text => "AutoGenConfig";
public bool UpdateBefore => false;
public AutoGenConfigForm()
{
ClientSize = new Size(640, 720);
@ -151,12 +149,8 @@ namespace BizHawk.Experiment.AutoGenConfig
public bool AskSaveChanges() => true;
public void FastUpdate() {}
public void NewUpdate(ToolFormUpdateType type) {}
public void Restart() {}
public void UpdateValues() {}
public void UpdateValues(ToolFormUpdateType type) {}
}
}

View File

@ -123,12 +123,8 @@ namespace BizHawk.DBManTool
public override string Text => "DBMan";
public bool UpdateBefore => false;
public bool AskSaveChanges() => true;
public void FastUpdate() {}
#if false
/// <remarks>This was just sitting in <c>BizHawk.Client.DBMan/Program.cs</c>.</remarks>
public static string GetExeDirectoryAbsolute()
@ -139,10 +135,8 @@ namespace BizHawk.DBManTool
}
#endif
public void NewUpdate(ToolFormUpdateType type) {}
public void Restart() {}
public void UpdateValues() {}
public void UpdateValues(ToolFormUpdateType type) {}
}
}

View File

@ -66,16 +66,8 @@ namespace HelloWorld
};
}
/// <remarks>We want <see cref="UpdateValues"/> to be called before rendering.</remarks>
public bool UpdateBefore => true;
public bool AskSaveChanges() => true;
/// <remarks>This is called instead of the usual <see cref="UpdateValues"/> when EmuHawk is turboing.</remarks>
public void FastUpdate() {}
public void NewUpdate(ToolFormUpdateType type) {}
/// <remarks>This is called once when the form is opened, and every time a new movie session starts.</remarks>
public void Restart()
{
@ -96,10 +88,14 @@ namespace HelloWorld
}
}
/// <remarks>Called just before every video frame.</remarks>
public void UpdateValues()
public void UpdateValues(ToolFormUpdateType type)
{
if (Global.Game.Name == "Null" || Watches.Count < 3) return;
if (!(type == ToolFormUpdateType.PreFrame || type == ToolFormUpdateType.FastPreFrame)
|| Global.Game.Name == "Null"
|| Watches.Count < 3)
{
return;
}
Watches.UpdateValues();
label_Watch1.Text = $"First watch ({Watches[0].AddressString}) current value: {Watches[0].ValueString}";
label_Watch2.Text = $"Second watch ({Watches[1].AddressString}) current value: {Watches[1].ValueString}";