mirror of
https://github.com/kwsch/NHSE.git
synced 2026-09-27 20:36:55 -05:00
Disconnect on window close
This commit is contained in:
@@ -36,6 +36,24 @@ private void B_Connect_Click(object sender, EventArgs e)
|
||||
GB_Inject.Enabled = true;
|
||||
}
|
||||
|
||||
private void SysBotUI_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
TurnOffAuto();
|
||||
if (!Bot.Bot.Connected)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
Bot.Bot.Disconnect();
|
||||
}
|
||||
#pragma warning disable CA1031 // Do not catch general exception types
|
||||
catch (Exception ex)
|
||||
#pragma warning restore CA1031 // Do not catch general exception types
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private void B_WriteCurrent_Click(object sender, EventArgs e)
|
||||
{
|
||||
var offset = StringUtil.GetHexValue(RamOffset.Text);
|
||||
|
||||
Reference in New Issue
Block a user