Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

84 merge the dll and exe backglass features #110

Merged
merged 18 commits into from
Jul 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
93d875b
All EXE features merged back to the dll version
JockeJarre Mar 1, 2024
12128b7
Catch Exception and log error
JockeJarre Mar 9, 2024
705e362
ci: move github actions to v4 to avoid deprecation warnings
JockeJarre Mar 9, 2024
3e53162
More merges
JockeJarre Mar 22, 2024
612b7d6
More merges
JockeJarre Mar 22, 2024
9be5f55
Update b2s-backglass.yml, remove betterled
JockeJarre Apr 1, 2024
e47e032
"Fantasy" setting in B2STableSettings.xml is ignored #93
JockeJarre Apr 8, 2024
3bc984e
Move old B2SBackglassServerEXE in tmp folder
JockeJarre Jun 19, 2024
5bc37ea
Add new B2SBackglassServerEXE based on the B2SBackglassServerWrapper …
JockeJarre Jun 19, 2024
e5afa56
SteveJones72's Potential New Feature to B2S Snippet x/y translation #71
JockeJarre Jun 21, 2024
84ee7bb
Use conditional compilation directives to split DLL and EXE source
JockeJarre Jun 23, 2024
10b0e06
B2SBackglassServerRegisterApp: re-registering B2S.Server should first…
JockeJarre Jun 25, 2024
ffa1038
2.5.0: Finally a merge of the source code of B2SBackglassServer & B2S…
JockeJarre Jun 26, 2024
66df61a
Potential New Feature to B2S Snippet x/y translation #71: Make only t…
JockeJarre Jun 26, 2024
276e801
Change build script to not include x86 nor x64 in the filename #104
JockeJarre Jun 26, 2024
8a81eb5
A bit more merged / Split
JockeJarre Jun 28, 2024
7ee1970
Add github run number to version
JockeJarre Jul 2, 2024
ce5e8e9
Remodel version into one file Classes/B2SVersionInfo.vb which is then…
JockeJarre Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More merges
JockeJarre committed Jun 26, 2024
commit 3e53162e8ada203e08f5c13d17db54c9c9c4d789
86 changes: 50 additions & 36 deletions b2sbackglassserver/b2sbackglassserver/Classes/B2SSettings.vb
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
Imports System.IO
Imports System.Reflection
Imports System.Windows.Forms
Imports System.Xml
Imports Microsoft.Win32

Public Class B2SSettings
@@ -93,6 +94,7 @@ Public Class B2SSettings
End Property
Public Shared Property IsPaintingLogOn() As Boolean = True
Public Shared Property IsStatisticsBackglassOn() As Boolean = True
Public Shared Property IsBackglassSearchLogOn As Boolean = False

Public Shared Property ShowStartupError() As Boolean = False ' set to True to display errors

@@ -164,6 +166,7 @@ Public Class B2SSettings
Public Shared Property IsGlowBulbOn() As Boolean = False
Public Shared Property GlowIndex() As Integer = -1
Public Shared Property DefaultGlow() As Integer = -1
Public Shared Property DisableBuiltInEMReelSound() As Nullable(Of Boolean) = Nothing
Public Shared Property FormToFront() As Boolean = True
Public Shared Property FormToBack() As Boolean = False
Public Shared Property FormNoFocus() As Boolean = False
@@ -238,7 +241,7 @@ Public Class B2SSettings
End Function

Public Shared Sub LoadGlobalAndTableSettings(xmlNode As Xml.XmlNode)
'If xmlNode.SelectSingleNode("DisableBuiltInEMReelSound") IsNot Nothing Then DisableBuiltInEMReelSound = (xmlNode.SelectSingleNode("DisableBuiltInEMReelSound").InnerText = "1")
If xmlNode.SelectSingleNode("DisableBuiltInEMReelSound") IsNot Nothing Then DisableBuiltInEMReelSound = (xmlNode.SelectSingleNode("DisableBuiltInEMReelSound").InnerText = "1")
If xmlNode.SelectSingleNode("HideGrill") IsNot Nothing Then HideGrill = CInt(xmlNode.SelectSingleNode("HideGrill").InnerText)
If xmlNode.SelectSingleNode("HideB2SDMD") IsNot Nothing Then HideB2SDMD = (xmlNode.SelectSingleNode("HideB2SDMD").InnerText = "1")
If xmlNode.SelectSingleNode("HideDMD") IsNot Nothing Then HideDMD = CInt(xmlNode.SelectSingleNode("HideDMD").InnerText)
@@ -304,19 +307,13 @@ Public Class B2SSettings
If nodeHeader.SelectSingleNode("IsLEDsStateLogOn") IsNot Nothing Then IsLEDsStateLogOn = (nodeHeader.SelectSingleNode("IsLEDsStateLogOn").InnerText = "1")
If nodeHeader.SelectSingleNode("IsPaintingLogOn") IsNot Nothing Then IsPaintingLogOn = (nodeHeader.SelectSingleNode("IsPaintingLogOn").InnerText = "1")
If nodeHeader.SelectSingleNode("IsStatisticsBackglassOn") IsNot Nothing Then IsStatisticsBackglassOn = (nodeHeader.SelectSingleNode("IsStatisticsBackglassOn").InnerText = "1")
If nodeHeader.SelectSingleNode("IsBackglassSearchLogOn") IsNot Nothing Then IsBackglassSearchLogOn = (nodeHeader.SelectSingleNode("IsBackglassSearchLogOn").InnerText = "1")
If nodeHeader.SelectSingleNode("ShowStartupError") IsNot Nothing Then ShowStartupError = (nodeHeader.SelectSingleNode("ShowStartupError").InnerText = "1")
If nodeHeader.SelectSingleNode("StartBackground") IsNot Nothing Then
GlobalStartBackground = (nodeHeader.SelectSingleNode("StartBackground").InnerText = "1")
End If
If nodeHeader.SelectSingleNode("FormToFront") IsNot Nothing Then FormToFront = (nodeHeader.SelectSingleNode("FormToFront").InnerText = "1")
If nodeHeader.SelectSingleNode("FormToBack") IsNot Nothing Then
FormToBack = (nodeHeader.SelectSingleNode("FormToBack").InnerText = "1")
If FormToBack Then FormToFront = False
FormNoFocus = True
End If
If nodeHeader.SelectSingleNode("FormNoFocus") IsNot Nothing Then
FormNoFocus = (nodeHeader.SelectSingleNode("FormNoFocus").InnerText = "1")
End If
LoadGlobalAndTableSettings(nodeHeader)

If nodeHeader.SelectSingleNode("ScreenshotPath") IsNot Nothing Then
ScreenshotPath = nodeHeader.SelectSingleNode("ScreenshotPath").InnerText
ScreenshotFileType = CInt(nodeHeader.SelectSingleNode("ScreenshotFileType").InnerText)
@@ -341,32 +338,9 @@ Public Class B2SSettings
Dim nodeTable As Xml.XmlElement = nodeHeader.SelectSingleNode(If(Not String.IsNullOrEmpty(GameName), GameName, B2SName))
If nodeTable IsNot Nothing Then
_IsGameNameFound = True
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)
If nodeTable.SelectSingleNode("GIStringsBlackTurns") IsNot Nothing Then GIStringsSkipFrames = CInt(nodeTable.SelectSingleNode("GIStringsBlackTurns").InnerText)
If nodeTable.SelectSingleNode("LEDsBlackTurns") IsNot Nothing Then LEDsSkipFrames = CInt(nodeTable.SelectSingleNode("LEDsBlackTurns").InnerText)
If nodeTable.SelectSingleNode("LampsSkipFrames") IsNot Nothing Then LampsSkipFrames = CInt(nodeTable.SelectSingleNode("LampsSkipFrames").InnerText)
If nodeTable.SelectSingleNode("SolenoidsSkipFrames") IsNot Nothing Then SolenoidsSkipFrames = CInt(nodeTable.SelectSingleNode("SolenoidsSkipFrames").InnerText)
If nodeTable.SelectSingleNode("GIStringsSkipFrames") IsNot Nothing Then GIStringsSkipFrames = CInt(nodeTable.SelectSingleNode("GIStringsSkipFrames").InnerText)
If nodeTable.SelectSingleNode("LEDsSkipFrames") IsNot Nothing Then LEDsSkipFrames = CInt(nodeTable.SelectSingleNode("LEDsSkipFrames").InnerText)
If nodeTable.SelectSingleNode("UsedLEDType") IsNot Nothing Then UsedLEDType = CInt(nodeTable.SelectSingleNode("UsedLEDType").InnerText)
If nodeTable.SelectSingleNode("IsGlowBulbOn") IsNot Nothing Then IsGlowBulbOn = (nodeTable.SelectSingleNode("IsGlowBulbOn").InnerText = "1")
If nodeTable.SelectSingleNode("GlowIndex") IsNot Nothing Then GlowIndex = CInt(nodeTable.SelectSingleNode("GlowIndex").InnerText)
If nodeTable.SelectSingleNode("StartAsEXE") IsNot Nothing Then StartAsEXE = (nodeTable.SelectSingleNode("StartAsEXE").InnerText = "1")
If nodeTable.SelectSingleNode("DualMode") IsNot Nothing Then CurrentDualMode = CInt(nodeTable.SelectSingleNode("DualMode").InnerText)
LoadGlobalAndTableSettings(nodeTable)
If nodeTable.SelectSingleNode("StartBackground") IsNot Nothing Then StartBackground = (nodeTable.SelectSingleNode("StartBackground").InnerText = "1")
If nodeTable.SelectSingleNode("FormToFront") IsNot Nothing Then FormToFront = (nodeTable.SelectSingleNode("FormToFront").InnerText = "1")
If nodeTable.SelectSingleNode("FormToBack") IsNot Nothing Then
FormToBack = (nodeTable.SelectSingleNode("FormToBack").InnerText = "1")
If FormToBack Then FormToFront = False
FormNoFocus = True
End If
If nodeTable.SelectSingleNode("FormNoFocus") IsNot Nothing Then FormNoFocus = (nodeTable.SelectSingleNode("FormNoFocus").InnerText = "1")
If nodeTable.SelectSingleNode("MatchingFileName") IsNot Nothing Then MatchingFileName = nodeTable.SelectSingleNode("MatchingFileName").InnerText

Dim nodeAnimations As Xml.XmlElement = nodeTable.SelectSingleNode("Animations")
If nodeAnimations IsNot Nothing Then
@@ -444,6 +418,10 @@ Public Class B2SSettings
If StartBackground.HasValue Then
AddNode(XML, nodeTable, "StartBackground", If(StartBackground, "1", "0"))
End If
If DisableBuiltInEMReelSound.HasValue Then
AddNode(XML, nodeTable, "DisableBuiltInEMReelSound", If(DisableBuiltInEMReelSound, "1", "0"))
End If

AddNode(XML, nodeTable, "FormToFront", If(FormToFront, "1", "0"))
AddNode(XML, nodeTable, "FormToBack", If(FormToBack, "1", "0"))
AddNode(XML, nodeTable, "FormNoFocus", If(FormNoFocus, "1", "0"))
@@ -481,6 +459,7 @@ Public Class B2SSettings
IsGIStringsStateLogOn = False
IsLEDsStateLogOn = False
IsPaintingLogOn = False
IsBackglassSearchLogOn = False
IsStatisticsBackglassOn = False
ScreenshotPath = String.Empty
ScreenshotFileType = eImageFileType.PNG
@@ -570,26 +549,61 @@ Public Class B2SSettings
Public Shared ReadOnly Property HyperpinName() As String
Get
Dim ret As String = String.Empty
Dim searchPathLog As Log = New Log("BackglassSearchPath")
searchPathLog.IsLogOn = B2SSettings.IsBackglassSearchLogOn

searchPathLog.WriteLogEntry("Start Search Hyperpinname")
If HyperpinXMLFile <> "Unknown" Then
If Not String.IsNullOrEmpty(HyperpinXMLFile) AndAlso IO.File.Exists(HyperpinXMLFile) Then
Dim Xml As Xml.XmlDocument = New Xml.XmlDocument
Xml.Load(HyperpinXMLFile)
searchPathLog.WriteLogEntry("Loop Hyperpinname")
If Xml.SelectNodes("menu") IsNot Nothing Then
For Each node As Xml.XmlNode In Xml.SelectNodes("menu")
For Each gamenode As Xml.XmlNode In node.SelectNodes("game")
If gamenode.Attributes("name") IsNot Nothing Then
Dim name As String = gamenode.Attributes("name").InnerText
searchPathLog.WriteLogEntry("Check name: " + name + " compare with: " + B2SData.TableFileName)
If name.Equals(B2SData.TableFileName, StringComparison.CurrentCultureIgnoreCase) Then
ret = gamenode.SelectSingleNode("description").InnerText
searchPathLog.WriteLogEntry("Found: " + ret + "end search")
Exit For
Else 'Westworld, allow optional <gamename> syntax
If gamenode.SelectSingleNode("gamename") IsNot Nothing Then
Dim gamename As String = gamenode.SelectSingleNode("gamename").InnerText
If Not String.IsNullOrEmpty(gamename) Then
searchPathLog.WriteLogEntry("Check gamename: " + gamename + " compare with: " + B2SSettings.GameName)
If gamename.Equals(B2SSettings.GameName, StringComparison.CurrentCultureIgnoreCase) Then
ret = gamenode.SelectSingleNode("description").InnerText
searchPathLog.WriteLogEntry("Found: " + ret + "end search")
Exit For
End If
End If
End If

'last chance, try rom name
If gamenode.SelectSingleNode("rom") IsNot Nothing Then
Dim romname As String = gamenode.SelectSingleNode("rom").InnerText
If Not String.IsNullOrEmpty(romname) Then
searchPathLog.WriteLogEntry("Check rom: " + romname + " compare with: " + B2SSettings.GameName)
If romname.Equals(B2SSettings.GameName, StringComparison.CurrentCultureIgnoreCase) Then
ret = gamenode.SelectSingleNode("description").InnerText
searchPathLog.WriteLogEntry("Found: " + ret + "end search")
Exit For
End If
End If
End If
End If
End If
Next
If Not String.IsNullOrEmpty(ret) Then Exit For
Next
End If
End If
If String.IsNullOrEmpty(ret) Then ret = B2SData.TableFileName
If String.IsNullOrEmpty(ret) Then
ret = B2SData.TableFileName
searchPathLog.WriteLogEntry("Nothing found, using: " + ret + "as replacement")
End If
End If
' get out
Return ret
Original file line number Diff line number Diff line change
@@ -1255,7 +1255,7 @@ Public Class formBackglass
reel.ScoreType = b2sscoretype
reel.SoundName = soundName
If rollinginterval >= 10 Then reel.RollingInterval = rollinginterval
'AddHandler reel.ReelRollOver, AddressOf Reels_ReelRollOver ' no need to add this right now; maybe later

If isOnBackglass Then
reel.Type = B2SBaseBox.eType.OnBackglass
Me.Controls.Add(reel)
Original file line number Diff line number Diff line change
@@ -31,12 +31,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<<<<<<< HEAD
<Assembly: AssemblyVersion("2.1.3")>
<Assembly: AssemblyFileVersion("2.1.3")>
<Assembly: AssemblyInformationalVersion("2.1.3")>
=======
<Assembly: AssemblyVersion("2.1.2")>
<Assembly: AssemblyFileVersion("2.1.2")>
<Assembly: AssemblyInformationalVersion("2.1.2")>
>>>>>>> 91e813b (All EXE features merged back to the dll version)
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ Imports Microsoft.Win32

Public Class B2SSettings

Public Const DirectB2SVersion As String = "2.1.2"
Public Const DirectB2SVersion As String = "2.1.1"
Public Const MinimumDirectB2SVersion As String = "1.0"
Public Shared Property BackglassFileVersion() As String = String.Empty

Original file line number Diff line number Diff line change
@@ -2279,7 +2279,6 @@ Public Class formBackglass
reel.ScoreType = b2sscoretype
reel.SoundName = soundName
If rollinginterval >= 10 Then reel.RollingInterval = rollinginterval
'AddHandler reel.ReelRollOver, AddressOf Reels_ReelRollOver ' no need to add this right now; maybe later
If isOnBackglass Then
reel.Type = B2SBaseBox.eType.OnBackglass
Me.Controls.Add(reel)
@@ -2761,9 +2760,6 @@ Public Class formBackglass

End If

' set info flags to dirty to load them
' B2SData.IsInfoDirty = True

End If

End Sub
Original file line number Diff line number Diff line change
@@ -31,12 +31,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<<<<<<< HEAD
<Assembly: AssemblyVersion("2.1.3")>
<Assembly: AssemblyFileVersion("2.1.3")>
<Assembly: AssemblyInformationalVersion("2.1.3")>
=======
<Assembly: AssemblyVersion("2.1.2")>
<Assembly: AssemblyFileVersion("2.1.2")>
<Assembly: AssemblyInformationalVersion("2.1.2")>
>>>>>>> 91e813b (All EXE features merged back to the dll version)