@@ -11,12 +11,11 @@ Public Class Form1
1111
1212 Dim Games As New List( Of SourceGame)
1313 Dim running As Boolean = False
14+ Dim ClosePending As Boolean = False
1415
1516 Private Sub Form1_Load(sender As Object , e As EventArgs) Handles MyBase .Load
1617 RefreshPlayKey()
1718
18- HoldToPlay.Checked = My.Settings.HoldToPlay
19-
2019 If My.Settings.UpdateCheck Then
2120 CheckForUpdate()
2221 End If
@@ -304,7 +303,7 @@ Public Class Form1
304303 slam_cfg.WriteLine( "alias slam_play_on ""alias slam_play slam_play_off; voice_inputfromfile 1; voice_loopback 1; +voicerecord""" )
305304 slam_cfg.WriteLine( "alias slam_play_off ""-voicerecord; voice_inputfromfile 0; voice_loopback 0; alias slam_play slam_play_on""" )
306305 slam_cfg.WriteLine( "alias slam_updatecfg ""host_writeconfig slam_relay""" )
307- If HoldToPlay.Checked Then
306+ If My.Settings.HoldToPlay Then
308307 slam_cfg.WriteLine( "alias +slam_hold_play slam_play_on" )
309308 slam_cfg.WriteLine( "alias -slam_hold_play slam_play_off" )
310309 slam_cfg.WriteLine( "bind {0} +slam_hold_play" , My.Settings.PlayKey)
@@ -567,6 +566,10 @@ Public Class Form1
567566 If Not IsNothing(e.Result) Then 'Result is always an exception
568567 MessageBox.Show(e.Result.Message & " See errorlog.txt for more info." , "Error" , MessageBoxButtons.OK, MessageBoxIcon.Error)
569568 End If
569+
570+ If ClosePending Then
571+ Me .Close()
572+ End If
570573 End Sub
571574
572575 Private Sub CreateTags( ByVal Game As SourceGame)
@@ -667,7 +670,7 @@ Public Class Form1
667670
668671 Private Sub TrackList_MouseClick(sender As Object , e As MouseEventArgs) Handles TrackList.MouseClick
669672 If e.Button = MouseButtons.Right Then
670- If TrackList.FocusedItem.Bounds.Contains(e.Location) = True Then
673+ If TrackList.FocusedItem.Bounds.Contains(e.Location) Then
671674
672675 For Each Control In TrackContextMenu.Items 'everything invisible
673676 Control.visible = False
@@ -901,13 +904,10 @@ Public Class Form1
901904 Private Sub Form1_FormClosing(sender As Object , e As FormClosingEventArgs) Handles Me .FormClosing
902905 If running Then
903906 StopPoll()
907+ ClosePending = True
908+ e.Cancel = True
904909 End If
905910 End Sub
906-
907- Private Sub HoldToPlay_CheckedChanged(sender As Object , e As EventArgs) Handles HoldToPlay.CheckedChanged
908- My.Settings.HoldToPlay = HoldToPlay.Checked
909- My.Settings.Save()
910- End Sub
911911End Class
912912
913913
0 commit comments