Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. Thank you for your support. Tom Speirs

Patreon

[PLUGIN] 'Search Game' plugin for PinballX front-end


jejegameex

Recommended Posts

'Search Game' plugin for PinballX front-end, by 7he S4ge
Version 1.0.1 - 2022-05

image.png.47bfb60a5d0e10ca0847c5376ef91cc6.png

Installation :
Copy PinballXSearchGame.dll and INIFileParser.dll into the plugins folder of installation of PinballX. Ex : C:\Games\PinballX\Plugins

Configure :
Launch PluginManager.exe and active the plugin. Click on Configure button for configure keys to open the plugin and navigate into it.

image.png.7eb6c209f144bb6770a8024ea5d580b9.png

Remarks :
- API of PinballX does not allow to launch a game, but you can modify the parameters to the executable software.
  So this plugin attempt to add good parameters for each situation (with systems like Visual Pinball, MAME...), but it's not perfect.
- When you select a game in the Search dialog, the game is not launched automatically (API does not allow that), you must open the menu of PinballX and select 'Play Game'.
     Remark : if your key for select a game in 'Search Game' plugin is similar to the key of PinballX for select a game, when you choose a game in the search dialog,
              the dialog is closed and the key is given to PinballX too. So I like the behavior : you choose a game and the menu of PinballX also opens.
- Because the API does not to launch directly a table, the executable of the current system is used.
  So the plugin displays only the list of games in the current system.

Bugs :
- When we launch a game, topper and DMD medias of the current game stay in the screens (if the new game has no topper and dmd medias)
- If you use plugins with dialogs like PBXStatsDisplay, when you open the 'Search game' dialog, the others dialogs disappear.

 

--> This is a first version, it's works for me, but maybe not for all users, and certainly not for specific systems configurations.
Tell me the errors/bugs you find, and I will try to fix. The code source can help developers for debugging the problem.

--> This plugin show how a search function will be cool in the front-end, so maybe the API of plugins will be improved !

 

Changes Log :
1.0 First version
1.0.1 Corrections : name of the system was not always found in PinballX.ini, force reading XML databases files in UTF-8 encoding

PinballXSearchGame_1.0.1.zip PinballXSearchGame_1.0.1_SourceCode.zip

Edited by jejegameex
New version of the plugin
  • Like 2
Link to comment
Share on other sites

Nice idea!

I gave it a go on my desktop (PinballX XP/Vista version V5.42 32bit currently installed) and had an issue. I think it's because i have VPX set up as a custom/other system (sytem_3), PinballXSearchGame_logs.txt shows error "System found : Unknown System"

Files of interest attached, can add more if you need them. 

PinballXSearchGame_logs.txt PinballX.ini

Link to comment
Share on other sites

I gave it a try as well, but this is not for cabinet users I asume ?

Only works for keyboard (not joy buttons). the search was blank for me and didn't show any results. I could not close the window anymore and needed to force the process to quit.

Dialog was on playfield, but not rotated. 

but, I like the idea :D 

 

PinballXSearchGame_logs.txt

Link to comment
Share on other sites

8 hours ago, scutters said:

Nice idea!

I gave it a go on my desktop (PinballX XP/Vista version V5.42 32bit currently installed) and had an issue. I think it's because i have VPX set up as a custom/other system (sytem_3), PinballXSearchGame_logs.txt shows error "System found : Unknown System"

Files of interest attached, can add more if you need them. 

PinballXSearchGame_logs.txt 4.02 kB · 2 downloads PinballX.ini 9.42 kB · 1 download

Hi, thank you for testing.
I get the name of the system in the PinballX.ini file and I expect a property like 'Name' but in your file it's 'NAME'. I will change the code for a 'case-insensitive' process.

Can you check if the plugin load tables in the search dialog, after correction of the .ini file ?

  • Like 1
Link to comment
Share on other sites

4 hours ago, Mike_da_Spike said:

I gave it a try as well, but this is not for cabinet users I asume ?

Only works for keyboard (not joy buttons). the search was blank for me and didn't show any results. I could not close the window anymore and needed to force the process to quit.

Dialog was on playfield, but not rotated. 

but, I like the idea :D 

 

PinballXSearchGame_logs.txt 2.82 kB · 1 download

Hi, Thank you for testing.

I use it on my cabinet but I use Joy2Key for all programs. I will try to be compatible with joysticks buttons.
Screen rotation : I did not think about that ! My playfield screen is not rotated on my cabinet.
No results : can you check with a system like Visual Pinball ? I haven't tested Pinball FX.

Link to comment
Share on other sites

1 hour ago, jejegameex said:

Hi, thank you for testing.
I get the name of the system in the PinballX.ini file and I expect a property like 'Name' but in your file it's 'NAME'. I will change the code for a 'case-insensitive' process.

Can you check if the plugin load tables in the search dialog, after correction of the .ini file ?

Spot on!, changed the PinballX.ini from NAME to Name for system_3 and the game list is now populated. Searched for a table and launched successfully :)

1 hour ago, jejegameex said:

I use it on my cabinet but I use Joy2Key for all programs. I will try to be compatible with joysticks buttons.
Screen rotation : I did not think about that ! My playfield screen is not rotated on my cabinet.

Rotation (or position option for backglass screen etc) and button compatibility would be great for cab use (i don't use joytokey on the cab or have a keyboard handy while playing normally)

A couple of other suggestions;

  • I use unicode characters in some game description fields (thing like the Trade Mark symbol) - these aren't displayed correctly in the game list
  • An extra button to toggle between alpha and numeric characters in the search keys could be useful (numeric keys could also include special characters like '/' etc)
Link to comment
Share on other sites

10 hours ago, jejegameex said:

No results : can you check with a system like Visual Pinball ? I haven't tested Pinball FX.

I will check that as well, but at the moment I tested, I had the "all tables" filters.

Maybe it is easier to read all xml files and the result shows the system - table ?

8 hours ago, scutters said:
  • I use unicode characters in some game description fields (thing like the Trade Mark symbol) - these aren't displayed correctly in the game list

+1 . And also search on unicode ? 

 

EDIT : Tested it with my Visual Pinball System :

image.thumb.png.492b4f826b3cdd7e9f26ac09beb5a4ea.png

In your log :

Error when reading the file C:\Pinball\PinballX\Databases\Visual Pinball\Visual Pinball.xml : System.Xml.XmlException: System does not support 'Windows-1252' encoding. Line 1, position 31.
 ---> System.ArgumentException: 'Windows-1252' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. (Parameter 'name')
   at System.Text.EncodingTable.InternalGetCodePageFromName(String name)
   at System.Text.EncodingTable.GetCodePageFromName(String name)
   at System.Text.Encoding.GetEncoding(String name)
   at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName)
   --- End of inner exception stack trace ---
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args, Exception innerException)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Exception innerException)
   at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName)
   at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.Load(String filename)
   at PinballX.PinballXDatabases.GetTablesInfosFromDatabases(SystemInfoFromConfig systemInfos)

this is my XML

Visual Pinball.xml

Link to comment
Share on other sites

21 hours ago, Mike_da_Spike said:

I will check that as well, but at the moment I tested, I had the "all tables" filters.

Maybe it is easier to read all xml files and the result shows the system - table ?

+1 . And also search on unicode ?

The encoding in the XML file is set to "Windows-1252" : by default .Net read the file with this encoding. If you remove this info from the file I assume that it works. But I also change my code for force the reading of the file in UTF-8.

I forgot the filter "All tables" : I will check the behavior, but I think it's similar to choose a specific system : I can't load all tables of all systems because I can only replace parameters of the current executable used by the table selected in PinballX. Example : if we are in PinballX on a old table on VisualPinball 9.9.5, and we select in search dialog a recent table in VisualPinballX : the new table will be launched with the old executable 9.9.5 !!!

  • Like 1
Link to comment
Share on other sites

12 hours ago, jejegameex said:

I forgot the filter "All tables" : I will check the behavior, but I think it's similar to choose a specific system : I can't load all tables of all systems because I can only replace parameters of the current executable used by the table selected in PinballX. Example : if we are in PinballX on a old table on VisualPinball 9.9.5, and we select in search dialog a recent table in VisualPinballX : the new table will be launched with the old executable 9.9.5 !!!

Ahh yes, i think i faced similar issues with the random table plugin, that only works by a table entry by each system so slightly different but the alternateexe flag if used for some tables will cause the wrong exe to be used with the cmd line parameters - in the end i just excluded tables with the alternate exe flag set from the available tables. You might have to ignore those tables too.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...