Skip to content

Commit

Permalink
Request to turn off backglass in b2s settings #80: Add requester when…
Browse files Browse the repository at this point in the history
… backglass is hidden, restore window size
  • Loading branch information
JockeJarre committed Jun 5, 2024
1 parent fcbd891 commit 02b8b26
Show file tree
Hide file tree
Showing 6 changed files with 388 additions and 387 deletions.
4 changes: 4 additions & 0 deletions b2sbackglassserver/b2sbackglassserver/Classes/B2SSettings.vb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ Public Class B2SSettings
Public Shared Property FormNoFocus() As Boolean = False
Public Shared Property HideGrill() As System.Windows.Forms.CheckState = Windows.Forms.CheckState.Indeterminate
Public Shared Property HideB2SDMD() As Boolean = False
Public Shared Property HideB2SBackglass() As Boolean = False
Public Shared Property HideDMD() As System.Windows.Forms.CheckState = Windows.Forms.CheckState.Indeterminate

Public Shared Property AnimationSlowDowns() As Generic.Dictionary(Of String, Integer) = New Generic.Dictionary(Of String, Integer)
Expand Down Expand Up @@ -310,6 +311,7 @@ Public Class B2SSettings
If nodeTable.SelectSingleNode("HideGrill") IsNot Nothing Then HideGrill = CInt(nodeTable.SelectSingleNode("HideGrill").InnerText)
If nodeTable.SelectSingleNode("HideB2SDMD") IsNot Nothing Then HideB2SDMD = (nodeTable.SelectSingleNode("HideB2SDMD").InnerText = "1")
If nodeTable.SelectSingleNode("HideDMD") IsNot Nothing Then HideDMD = CInt(nodeTable.SelectSingleNode("HideDMD").InnerText)
If nodeTable.SelectSingleNode("HideB2SBackglass") IsNot Nothing Then HideB2SBackglass = (nodeTable.SelectSingleNode("HideB2SBackglass").InnerText = "1")
If nodeTable.SelectSingleNode("MatchingFileName") IsNot Nothing Then MatchingFileName = nodeTable.SelectSingleNode("MatchingFileName").InnerText
If nodeTable.SelectSingleNode("LampsBlackTurns") IsNot Nothing Then LampsSkipFrames = CInt(nodeTable.SelectSingleNode("LampsBlackTurns").InnerText)
If nodeTable.SelectSingleNode("SolenoidsBlackTurns") IsNot Nothing Then SolenoidsSkipFrames = CInt(nodeTable.SelectSingleNode("SolenoidsBlackTurns").InnerText)
Expand Down Expand Up @@ -389,6 +391,7 @@ Public Class B2SSettings
nodeTable.RemoveAll()
AddNode(XML, nodeTable, "HideGrill", CInt(HideGrill).ToString())
AddNode(XML, nodeTable, "HideB2SDMD", If(HideB2SDMD, "1", "0"))
AddNode(XML, nodeTable, "HideB2SBackglass", If(HideB2SBackglass, "1", "0"))
AddNode(XML, nodeTable, "HideDMD", CInt(HideDMD).ToString())
If Not String.IsNullOrEmpty(MatchingFileName) Then
AddNode(XML, nodeTable, "MatchingFileName", MatchingFileName)
Expand Down Expand Up @@ -466,6 +469,7 @@ Public Class B2SSettings
DefaultGlow = -1
HideGrill = System.Windows.Forms.CheckState.Indeterminate
HideB2SDMD = False
HideB2SBackglass = False
HideDMD = System.Windows.Forms.CheckState.Indeterminate
HyperpinXMLFile = String.Empty
AnimationSlowDowns.Clear()
Expand Down
5 changes: 5 additions & 0 deletions b2sbackglassserver/b2sbackglassserver/Forms/formBackglass.vb
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ Public Class formBackglass
#Region "painting"

Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
'If B2sSettings.HideBackglass Then hide this form
If B2SSettings.HideB2SBackglass Then
Me.Hide()
Return
End If

If Not B2SStatistics.LogStatistics Then

Expand Down
Loading

0 comments on commit 02b8b26

Please sign in to comment.