Skip to content

Commit

Permalink
1.5.1: Added support for a folder list to specifically hide games. (H…
Browse files Browse the repository at this point in the history
…idden section is hidden. click the > button)
  • Loading branch information
M1kerochip committed May 23, 2020
1 parent fa34517 commit fdaf907
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 42 deletions.
36 changes: 25 additions & 11 deletions CreateGameList_XML.vb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
Public Property HideBios As Boolean = True
Public Property HiddenListPath As String


''' <summary>
''' Path to the EmulationStation Gameslist.xml file to create and write to.
''' </summary>
Expand Down Expand Up @@ -205,6 +204,16 @@
Rating.LoadINI()
End If

Dim HiddenList As New ReadFolderINI
If HiddenListPath <> "" Then
prgFrm.lblMain.Text = "Reading Hidden Games List ini file: " + HiddenListPath
prgFrm.Refresh()
HiddenList.FolderINI_Path = HiddenListPath
HiddenList.SkipSettingsAndRoot = True
HiddenList.StoreHeader = False
HiddenList.LoadINI()
End If

Dim i As Integer
Dim st1 As String = ""
Dim Romfile As String = ""
Expand Down Expand Up @@ -317,32 +326,37 @@
Catch
End Try

If HideBios = True Then 'Hide Bios files in list
If Not xn(i).Attributes.GetNamedItem("isbios").InnerText Is Nothing Then 'Check MAME 'isbios' attribute exists in machine section in XML
If HideBios = True Then 'Hide Bios files in list
If Not xn(i).Attributes.GetNamedItem("isbios").InnerText Is Nothing Then 'Check MAME 'is this machine/system a bios only' attribute exists in machine section in XML
If xn(i).Attributes.GetNamedItem("isbios").InnerText.Trim = "yes" Then 'Read Bios attribute.
writeHiddensection = True 'Critera matches; write hidden section for this game
End If
End If
If xn(i).Item("display") Is Nothing Then
writeHiddensection = True 'Critera matches; write hidden section for this game
If xn(i).Item("display") Is Nothing Then 'Check MAME for 'Display' entries. Zero entries means screenless game/system.
writeHiddensection = True 'Critera matches; write hidden section for this game
End If
If Not xn(i).Attributes.GetNamedItem("runnable").InnerText Is Nothing Then 'Check MAME 'isbios' attribute exists in machine section in XML
If xn(i).Attributes.GetNamedItem("runnable").InnerText.Trim = "no" Then 'Read Bios attribute.
If Not xn(i).Attributes.GetNamedItem("runnable").InnerText Is Nothing Then 'Check MAME 'is this a runnable game/system' attribute exists in machine section in XML
If xn(i).Attributes.GetNamedItem("runnable").InnerText.Trim = "no" Then 'Read Bios attribute.
writeHiddensection = True 'Critera matches; write hidden section for this game
End If
End If
If Not xn(i).Attributes.GetNamedItem("ismechanical").InnerText Is Nothing Then 'Check MAME 'isbios' attribute exists in machine section in XML
If xn(i).Attributes.GetNamedItem("ismechanical").InnerText.Trim = "yes" Then 'Read Bios attribute.
If Not xn(i).Attributes.GetNamedItem("ismechanical").InnerText Is Nothing Then 'Check MAME 'is this a mechanical game/system' attribute exists in machine section in XML
If xn(i).Attributes.GetNamedItem("ismechanical").InnerText.Trim = "yes" Then 'Read Bios attribute.
writeHiddensection = True 'Critera matches; write hidden section for this game
End If
End If
If Not xn(i).Attributes.GetNamedItem("isdevice").InnerText Is Nothing Then 'Check MAME 'isbios' attribute exists in machine section in XML
If xn(i).Attributes.GetNamedItem("isdevice").InnerText.Trim = "yes" Then 'Read Bios attribute.
If Not xn(i).Attributes.GetNamedItem("isdevice").InnerText Is Nothing Then 'Check MAME 'is this a device?' attribute exists in machine section in XML
If xn(i).Attributes.GetNamedItem("isdevice").InnerText.Trim = "yes" Then 'Read Bios attribute.
writeHiddensection = True 'Critera matches; write hidden section for this game
End If
End If
End If

If HiddenListPath <> "" Then
If HiddenList.GetDataB(Romfile) = True Then
writeHiddensection = True 'Critera matches; write hidden section for this game
End If
End If

If writeHiddensection = True Then
W.WriteStartElement(“hidden”) 'Write hidden
Expand Down
4 changes: 2 additions & 2 deletions My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.5.0.0")>
<Assembly: AssemblyFileVersion("1.5.0.0")>
<Assembly: AssemblyVersion("1.5.1.0")>
<Assembly: AssemblyFileVersion("1.5.1.0")>
44 changes: 22 additions & 22 deletions frmMain.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 31 additions & 7 deletions frmMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Public Class frmMain

Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles Me.Load
Me.Text = "Create ES gamelist.xml v" + My.Application.Info.Version.ToString
Me.Width = 764
ReadSettings()
AddTooltips()
End Sub
Expand Down Expand Up @@ -211,17 +212,23 @@ Public Class frmMain
g.HideBios = False
End If

If chkAlsoRemoveINI.Checked Then
If IO.File.Exists(txtHiddenGames.Text) Then
g.HiddenListPath = txtHiddenGames.Text
End If
End If

g.PrettyXML = chkPrettyXML.Checked

g.ShowProgress = True
g.ShowProgress = True

Dim i As Integer = g.CreateGAMELIST_XML() 'Call the function
If i = 0 Then
MessageBox.Show("Successfully created")
Else
MessageBox.Show("Error: " + CStr(i))
Dim i As Integer = g.CreateGAMELIST_XML() 'Call the function
If i = 0 Then
MessageBox.Show("Successfully created")
Else
MessageBox.Show("Error: " + CStr(i))
End If
End If
End If
End Sub

Private Sub BtnImageDir_Click(sender As Object, e As EventArgs) Handles btnImageDir.Click
Expand Down Expand Up @@ -293,4 +300,21 @@ Public Class frmMain
System.Diagnostics.Process.Start("explorer.exe", "/n,/e," + IO.Path.GetDirectoryName(txtMameXMLPath.Text))
End If
End Sub

Private Sub btnWideForm_Click(sender As Object, e As EventArgs) Handles btnWideForm.Click
If btnWideForm.Text = ">" Then
btnWideForm.Text = "<"
Me.Width = 1136

Else
btnWideForm.Text = ">"
Me.Width = 764
End If
End Sub

Private Sub btnHiddenGamesPath_Click(sender As Object, e As EventArgs) Handles btnHiddenGamesPath.Click
If OpenFileDialog1.ShowDialog = DialogResult.OK Then
txtHiddenGames.Text = OpenFileDialog1.FileName
End If
End Sub
End Class

0 comments on commit fdaf907

Please sign in to comment.